0
|
1 |
<?php
|
|
2 |
|
|
3 |
function disable_user($username)
|
|
4 |
{
|
|
5 |
ldap_replace_attr(ldap_make_user_dn($username), 'loginShell', '/sbin/nologin');
|
|
6 |
kadm5_disable_user($username);
|
|
7 |
}
|
|
8 |
|
|
9 |
function enable_user($username)
|
|
10 |
{
|
|
11 |
ldap_replace_attr(ldap_make_user_dn($username), 'loginShell', '/bin/bash');
|
|
12 |
kadm5_enable_user($username);
|
|
13 |
}
|
|
14 |
|
|
15 |
function is_user_enabled($username)
|
|
16 |
{
|
|
17 |
return kadm5_is_user_unexpired($username);
|
|
18 |
}
|
|
19 |
|
|
20 |
function delete_user($username)
|
|
21 |
{
|
|
22 |
ldap_delete_user($username);
|
|
23 |
kadm5_delete_user($username);
|
|
24 |
}
|
|
25 |
|
|
26 |
function create_user($username, $password, $gn, $sn, $cn, $title)
|
|
27 |
{
|
|
28 |
return ldap_create_user($username, $gn, $sn, $cn, $title) &&
|
|
29 |
kadm5_create_user($username, $password);
|
|
30 |
}
|
|
31 |
|
|
32 |
function reset_password($username, $password)
|
|
33 |
{
|
|
34 |
return kadm5_reset_password($username, $password);
|
|
35 |
}
|
|
36 |
|
|
37 |
function create_group($gid, $desc)
|
|
38 |
{
|
|
39 |
return ldap_create_group($gid, $desc);
|
|
40 |
}
|
|
41 |
|
|
42 |
function delete_group($gid)
|
|
43 |
{
|
|
44 |
return ldap_delete_group($gid);
|
|
45 |
}
|