| <?php |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| if ( basename($_SERVER['PHP_SELF']) <> 'index.php') |
| { |
| echo '<h3>Sorry, this page can\'t be served directly. '; |
| echo 'Try <a href="index.php?p=users&a=add">this instead</a>.</h3>'; |
| exit; |
| } |
| |
| |
| |
| $fields = array('uid', 'userpassword', 'cn', 'employeetype', 'preferredlanguage', 'displayname'); |
| $entry = $ldap->init_useradd_values( $fields ); |
| |
| |
| |
| if ( isset( $_POST['useradd'] ) ) |
| { |
| $message = $ldap->do_action( $entry, 'add' ); |
| } |
| |
| |
| |
| if ( isset($message) ) |
| { |
| echo $message; |
| } |
| |
| |
| |
| echo '<h1>' . ucfirst(translate('add')) . ' ' . translate('user') . '</h1>'; |
| |
| |
| |
| echo show_useradd_form( $entry ); |
| |
| ?> |