packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/includes/users.php
author Dan Fuhry <dan@fuhry.us>
Tue, 08 Jan 2013 23:13:29 -0500
changeset 0 3906ca745819
permissions -rw-r--r--
First commit!

<?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);
}