Blame Scripts/CentOS-Web/admin/p_users_add.php

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

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

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

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

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