packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/includes/users.php
changeset 0 3906ca745819
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/includes/users.php	Tue Jan 08 23:13:29 2013 -0500
@@ -0,0 +1,45 @@
+<?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);
+}