packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/includes/users.php
<?php
function disable_user($username)
{
ldap_replace_attr(ldap_make_user_dn($username), 'loginShell', '/sbin/nologin');
kadm5_disable_user($username);
}
function enable_user($username)
{
ldap_replace_attr(ldap_make_user_dn($username), 'loginShell', '/bin/bash');
kadm5_enable_user($username);
}
function is_user_enabled($username)
{
return kadm5_is_user_unexpired($username);
}
function delete_user($username)
{
ldap_delete_user($username);
kadm5_delete_user($username);
}
function create_user($username, $password, $gn, $sn, $cn, $title)
{
return ldap_create_user($username, $gn, $sn, $cn, $title) &&
kadm5_create_user($username, $password);
}
function reset_password($username, $password)
{
return kadm5_reset_password($username, $password);
}
function create_group($gid, $desc)
{
return ldap_create_group($gid, $desc);
}
function delete_group($gid)
{
return ldap_delete_group($gid);
}