Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

NAME

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

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 $user = $iredadmin->User->Add(
    email => 'foo@domain.com',
    password => 'password_of_email',
    name => 'Foo',
    quota => 2048
);

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

METHODS

Add

Method to add User.

Arguments

email

Email of User

password

Password of User

name

Display Name of User (Optional)

quota

Mailbox Quota of User (Optional)

Edit

Method to edit User.

Arguments

email

Email of User

name

Change Display Name of User

lang

Change language default of User

enable

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

global_admin

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

Password

Method to change password of User.

Arguments

email

Email of User

password

New password of User

Enable

Method to enable Users.

Example

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

Disable

Method to disable Users.

Example

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

Delete

Method to delete Users.

Example

$iredadmin->User->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
You can’t perform that action at this time.