* Released under GPL lisence (http://www.fsf.org/licensing/licenses/gpl.txt)
*/
//-------------/* Show error if this page is called directly.
if ( basename($_SERVER['PHP_SELF']) <> 'index.php')
{
echo '
Sorry, this page can\'t be served directly. ';
echo 'Try this instead.
';
exit;
}
//------------|* Define filter.
$filter = $ldap->build_filter_string();
/*------------|* Initialize entry values. */
$entries = $ldap->get_entries( $filter );
/*------------|* Do Action if POST
*
* Description : Actions take place entry by entry. Just one
* entry at the same time. Actually two actions are supported
* (update,delete). */
if ( isset( $_POST['useradmin'] ) )
{
// Define useradmin attributes.
$fields = array('cn', 'userpassword', 'displayname', 'preferredlanguage', 'employeetype');
// Recover action to do.
$action = $_POST['action'];
// Reinitialize entries values based on input and do action if present
$message = $ldap->init_useradmin_values( $entries, $fields, $action );
// Reload entry value to reflect changes immediately
$entries = $ldap->get_entries( $filter );
}
//------------/* Display useradmin action results
if ( isset( $message ) )
{
echo $message;
}
//------------/* Display useradmin title
echo '' . ucfirst(translate(strtolower('admin'))) . ' ' . translate(strtolower('users')) . '
';
//------------/* Display useradmin form
?>