packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/includes/users.php
author Dan Fuhry <dan@enanocms.org>
Sat, 23 Feb 2013 14:26:05 -0500
changeset 8 f68fdcc18df9
parent 0 3906ca745819
permissions -rw-r--r--
Started on the database

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