Skip to content

Instantly share code, notes, and snippets.

@lucas1
Last active April 23, 2016 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucas1/c48fb5a64f8f547e9175a13646483fcf to your computer and use it in GitHub Desktop.
Save lucas1/c48fb5a64f8f547e9175a13646483fcf to your computer and use it in GitHub Desktop.

NAME

iRedAdmin::Admin - API for add, edit, delete, enable and disable User Admin

VERSION

Version 0.01

SYNOPSIS

use iRedAdmin;
 
my $iredadmin = iRedAdmin->new(
    url => 'https://hostname.mydomain.com/iredadmin',
    username => 'postmaster@mydomain.com',
    password => 'your_password',
    cookie => '/home/user/cookie.txt',
    lang => 3
);

my $admin = $iredadmin->Admin->Add(
    email => 'foo@domain.com',
    password => 'your_password',
    name => 'Foo',
    lang => 3
);

print $iredadmin->error unless $admin; # print error if $admin is equal 0

METHODS

Add

Method to add Admin.

Arguments

email

Email of Admin

password

Password of Admin

name

Display Name of Admin (Optional)

lang

Language default of Admin, default English. See more about lang

Edit

Method to edit Admin.

Arguments

email

Email of Admin

name

Change Display Name of Admin

lang

Change language default of Admin

enable

1 to enable, 0 to disable, without set not change account

Password

Method to change password of Admin.

Arguments

email

Email of Admin

password

New password of Admin

Enable

Method to enable Admins.

Example

$iredadmin->Admin->Enable(
   'foo@domain.com',
   'bar@domain.com',
   'baz@domain.com'
);

Disable

Method to disable Admins.

Example

$iredadmin->Admin->Disable(
   'foo@domain.com',
   'bar@domain.com',
   'baz@domain.com'
);

Delete

Method to delete Admins.

Example

$iredadmin->Admin->Delete(
   'foo@domain.com',
   'bar@domain.com',
   'baz@domain.com'
);

AUTHOR

Lucas Tiago de Moraes, <lucastiagodemoraes@gmail.com>

COPYRIGHT AND LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment