Add grant-mail command for account in lpt
This commit is contained in:
parent
495202128e
commit
e270f53e35
17
utils/lpt
17
utils/lpt
@ -82,6 +82,7 @@ my %cmds_account =
|
||||
|
||||
"grant-intra" => \&cmd_account_grantintra,
|
||||
"grant-lab" => \&cmd_account_grantlab,
|
||||
"grant-mail" => \&cmd_account_grantmail,
|
||||
);
|
||||
|
||||
my %cmds_group =
|
||||
@ -299,6 +300,22 @@ sub cmd_account_grantlab($@)
|
||||
$ldap->unbind or die ("couldn't disconnect correctly");
|
||||
}
|
||||
|
||||
sub cmd_account_grantmail($)
|
||||
{
|
||||
my $login = shift;
|
||||
|
||||
my $ldap = LDAP::ldap_connect();
|
||||
|
||||
my $dn = LDAP::search_dn($ldap, "ou=users", "uid=$login");
|
||||
|
||||
LDAP::update_attribute($ldap, $dn, "mailAccountActive", "yes");
|
||||
LDAP::add_attribute($ldap, $dn, "objectClass", "MailAccount");
|
||||
|
||||
log(INFO, "$login now grants to receive e-mail. Remember to add some aliases!");
|
||||
|
||||
$ldap->unbind or die ("couldn't disconnect correctly");
|
||||
}
|
||||
|
||||
sub cmd_account_mail(@)
|
||||
{
|
||||
return cmd_account_vieworchange('mail', 'mail', @_);
|
||||
|
Reference in New Issue
Block a user