Blame Scripts/Php/Webenv/admin/p_users_add.php

878a2b
878a2b
/***
878a2b
 * Useradd page.
878a2b
 *
878a2b
 * This page sumarize the actions needed to add users into LDAP
878a2b
 * directory server's database.
878a2b
 *
878a2b
 * --
878a2b
 * 2009 (c) Alain Reguera Delgado <al@ciget.cienfuegos.cu>
878a2b
 * Released under GPL lisence (http://www.fsf.org/licensing/licenses/gpl.txt)
878a2b
 */
878a2b
878a2b
//------------/* Show error if this page is called directly.
878a2b
878a2b
    if ( basename($_SERVER['PHP_SELF']) <> 'index.php')
878a2b
    {
878a2b
        echo '

Sorry, this page can\'t be served directly. ';

878a2b
        echo 'Try this instead.';
878a2b
        exit;
878a2b
    }
878a2b
878a2b
//------------/* Initialize entry values.
878a2b
878a2b
    $fields = array('uid', 'userpassword', 'cn', 'employeetype', 'preferredlanguage', 'displayname');
878a2b
    $entry  = $ldap->init_useradd_values( $fields );
878a2b
878a2b
//------------/* Do Action if POST 
878a2b
878a2b
    if ( isset( $_POST['useradd'] ) )
878a2b
    {
878a2b
        $message = $ldap->do_action( $entry, 'add' );
878a2b
    }
878a2b
878a2b
//------------/* Display useradd action results
878a2b
878a2b
    if ( isset($message) )
878a2b
    {
878a2b
        echo $message; 
878a2b
    }
878a2b
878a2b
//------------/* Display useradd title
878a2b
878a2b
    echo '

' . ucfirst(translate('add')) . ' ' . translate('user') . '

';
878a2b
878a2b
//------------/* Display useradd form
878a2b
878a2b
    echo show_useradd_form( $entry ); 
878a2b
878a2b
?>