add_objectClass(\'posixAccount\');'), E_USER_ERROR); $this->base = $base; // posixAccount is only a valid objectClass for user and host if (!($_SESSION[$this->base]->get_type() == 'user') && !($_SESSION[$this->base]->get_type() == 'host')) trigger_error(_('posixAccount can only be used for users or hosts.'), E_USER_WARNING); /* Check if ldap conatiner is in array and set type * users are using inetOrgPerson-, hosts account-container */ if (!isset($_SESSION[$this->base]->module['inetOrgPerson']) && $_SESSION[$this->base]->type=='user') $_SESSION[$this->base]->add_objectClass('inetOrgPerson'); if (!isset($_SESSION[$this->base]->module['account']) && $_SESSION[$this->base]->type=='host') $_SESSION[$this->base]->add_objectClass('account'); // Add Array with all attributes and type $this->attributes = $_SESSION[$this->base]->get_module_attributes('posixAccount'); $_SESSION[$this->base]->add_attributes ('posixAccount'); $this->alias = _('posixAccount'); $groups = $_SESSION[$_SESSION[$this->base]->cache]->findgroups(); // list of all groupnames if (count($groups)==0) trigger_error(_('No groups found in ldap.'), E_USER_WARNING); // Make references to attributes which already esists in ldap $newattributes = array_keys($this->attributes); $module = array_keys($_SESSION[$this->base]->module); for ($i=0; $ibase]->module[$module[$i]]->attributes[$attribute])) $this->attributes[$attribute] =& $_SESSION[$this->base]->module[$module[$i]]->attributes[$attribute]; } $this->orig = $this->attributes ; $this->attributes['objectClass'][0] = 'posixAccount'; $this->createhomedir=false; } // Variables // Alias Name. This name is shown in the menu instead of posixAccount var $alias; // name of accountContainer so we can read other classes in accuontArray var $base; // Use a unix password? var $userPassword_no; // Lock account? var $userPassword_lock; // This variable contains all inetOrgPerson attributes var $attributes; /* If an account was loaded all attributes are kept in this array * to compare it with new changed attributes */ var $orig; /* These two variables keep an array of groups the * user is also member of. */ var $groups; var $groups_orig; var $createhomedir; /* $attribute['userPassword'] can't accessed directly because it's enrcypted * To read / write password function userPassword is needed * This function will return the unencrypted password when * called without a variable * If it's called with a new password, the * new password will be stored encrypted */ function userPassword($newpassword=false) { if (is_string($newpassword)) { // Write new password if ($newpassword!='') { $iv = base64_decode($_COOKIE["IV"]); $key = base64_decode($_COOKIE["Key"]); $this->attributes['userPassword'][0] = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $newpassword, MCRYPT_MODE_ECB, $iv)); } else $this->attributes['userPassword'][0] = ''; return 0; } else { if ($this->attributes['userPassword'][0]!='') { // Read existing password if set $iv = base64_decode($_COOKIE["IV"]); $key = base64_decode($_COOKIE["Key"]); $password = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($this->attributes['userPassword'][0]), MCRYPT_MODE_ECB, $iv); $password = str_replace(chr(00), '', $password); return $password; } else return ''; } } /* This function returns a list with all required modules */ function dependencies() { if ($_SESSION[$this->base]->type=='user') return array('inetOrgPerson'); if ($_SESSION[$this->base]->type=='host') return array('account'); // return error if unsupported type is used return -1; } function module_ready() { return true; } /* Write variables into object and do some regexp checks */ function proccess_attributes($post) { if ($this->orig['uid'][0]!='' && $post['form_posixAccount_uid']!=$this->attributes['uid'][0]) $errors[] = array('INFO', _('UID'), _('UID has changed. Do you want to change home directory?')); if ($this->orig['gidNumber'][0]!='' && $_SESSION[$_SESSION[$this->base]->cache]->getgid($post['form_posixAccount_gidNumber'])!=$this->attributes['gidNumber'][0]) $errors[] = array('INFO', _('GID number'), sprintf(_('GID number has changed. To keep file ownership you have to run the following command as root: \'find / -gid %s -uid %s -exec chgrp %s {} \;\''), $this->orig['gidNumber'][0], $this->orig['uidNumber'][0], $_SESSION[$_SESSION[$this->base]->cache]->getgid($post['form_posixAccount_gidNumber']))); if ($this->orig['uidNumber'][0]!='' && $post['form_posixAccount_uidNumber']!=$this->attributes['uidNumber'][0]) $errors[] = array('INFO', _('UID number'), sprintf(_('UID number has changed. To keep file ownership you have to run the following command as root: \'find / -uid %s -exec chown %s {} \;\''), $this->orig['uidNumber'][0], $this->attributes['uidNumber'][0])); if (isset($post['form_posixAccount_homeDirectory']) && $this->orig['homeDirectory'][0]!='' && $post['form_posixAccount_homeDirectory']!=$this->attributes['homeDirectory'][0]) $errors[] = array('INFO', _('Home directory'), sprintf(_('Home directory changed. To keep home directory you have to run the following command as root: \'mv %s %s\''), $this->orig['homeDirectory'][0], $this->attributes['homeDirectory'][0])); // Load attributes $this->attributes['uid'][0] = $post['form_posixAccount_uid']; $this->attributes['cn'][0] = $this->attributes['uid'][0]; $this->attributes['uidNumber'][0] = $post['form_posixAccount_uidNumber']; $this->attributes['gidNumber'][0] = $_SESSION[$_SESSION[$this->base]->cache]->getgid($post['form_posixAccount_gidNumber']); $this->attributes['homeDirectory'][0] = $post['form_posixAccount_homeDirectory']; $this->attributes['loginShell'][0] = $post['form_posixAccount_loginShell']; $this->attributes['gecos'][0] = $post['form_posixAccount_gecos']; if ($post['form_posixAccount_createhomedir']) $this->createhomedir = true; else $this->createhomedir = false; if ($post['form_posixAccount_userPassword_no']) $this->userPassword_no=true; else $this->userPassword_no=false; if ($post['form_posixAccount_userPassword_lock']) $this->userPassword_lock=true; else $this->userPassword_lock=false; if (isset($post['form_posixAccount_userPassword'])) { if ($post['form_posixAccount_userPassword'] != $post['form_posixAccount_userPassword2']) { $errors[] = array('ERROR', _('Password'), _('Please enter the same password in both password-fields.')); unset ($post['form_posixAccount_userPassword2']); } else $this->userPassword($post['form_posixAccount_userPassword']); } if ($post['form_posixAccount_genpass']) $this->userPassword(genpasswd()); // Check if UID is valid. If none value was entered, the next useable value will be inserted // load min and may uidNumber if ($_SESSION[$this->base]->type=='user') { $minID = intval($_SESSION[$_SESSION[$this->base]->config]->get_minUID()); $maxID = intval($_SESSION[$_SESSION[$this->base]->config]->get_maxUID()); } if ($_SESSION[$this->base]->type=='host') { $minID = intval($_SESSION[$_SESSION[$this->base]->config]->get_minMachine()); $maxID = intval($_SESSION[$_SESSION[$this->base]->config]->get_maxMachine()); } $dn_uids = $_SESSION[$_SESSION[$this->base]->cache]->get_cache('uidNumber', 'posixAccount', '*'); // get_cache will return an array ( dn1 => array(uidnumber1), dn2 => array(uidnumber2), ... ) foreach ($dn_uids as $uid) $uids[] = $uid[0]; if(is_array($uids)) sort ($uids, SORT_NUMERIC); if ($this->attributes['uidNumber'][0]=='') { // No id-number given if ($this->orig['uidNumber'][0]=='') { // new account -> we have to find a free id-number if (count($uids)!=0) { // There are some uids // Store highest id-number $id = $uids[count($uids)-1]; // Return minimum allowed id-number if all found id-numbers are too low if ($id < $minID) $this->attributes['uidNumber'][0] = $minID; // Return higesht used id-number + 1 if it's still in valid range if ($id < $maxID) $this->attributes['uidNumber'][0] = $id+1; /* If this function is still running we have to fid a free id-number between * the used id-numbers */ $i = intval($minID); while (in_array($i, $uids)) $i++; if ($i>$maxID) $errors[] = array('ERROR', _('ID-Number'), _('No free ID-Number!')); else { $this->attributes['uidNumber'][0] = $i; $errors[] = array('WARN', _('ID-Number'), _('It is possible that this ID-number is reused. This can cause several problems because files with old permissions might still exist. To avoid this warning set maxUID to a higher value.')); } } else $this->attributes['uidNumber'][0] = $minID; // return minimum allowed id-number if no id-numbers are found } else $this->attributes['uidNumber'][0] = $this->orig['uidNumber'][0]; // old account -> return id-number which has been used } else { // Check manual ID // id-number is out of valid range if ( ($this->attributes['uidNumber'][0]!=$post['form_posixAccount_uidNumber']) && ($this->attributes['uidNumber'][0] < $minID || $this->attributes['uidNumber'][0] > $maxID)) $errors[] = array('ERROR', _('ID-Number'), sprintf(_('Please enter a value between %s and %s!'), $minID, $maxID)); // $uids is allways an array but not if no entries were found if (is_array($uids)) { // id-number is in use and account is a new account if ((in_array($this->attributes['uidNumber'][0], $uids)) && $this->orig['uidNumber'][0]=='') $errors[] = array('ERROR', _('ID-Number'), _('ID is already in use')); // id-number is in use, account is existing account and id-number is not used by itself if ((in_array($this->attributes['uidNumber'][0], $uids)) && $this->orig['uidNumber'][0]!='' && ($this->orig['uidNumber'][0] != $this->attributes['uidNumber'][0]) ) { $errors[] = array('ERROR', _('ID-Number'), _('ID is already in use')); $this->attributes['uidNumber'][0] = $this->orig['uidNumber'][0]; } } } if ($_SESSION[$this->base]->type=='user') { if (($this->attributes['uid'][0] != $post['form_posixAccount_uid']) && ereg('[A-Z]$', $post['form_posixAccount_uid'])) $errors[] = array('WARN', _('Username'), _('You are using a capital letters. This can cause problems because windows isn\'t case-sensitive.')); // Check if Homedir is valid $this->attributes['homeDirectory'][0] = str_replace('$group', $_SESSION[$_SESSION[$this->base]->cache]->getgrnam($this->attributes['gidNumber'][0]), $this->attributes['homeDirectory'][0]); if ($this->attributes['uid'][0] != '') $this->attributes['homeDirectory'][0] = str_replace('$user', $this->attributes['uid'][0], $this->attributes['homeDirectory'][0]); if ($this->attributes['homeDirectory'][0] != $post['form_posixAccount_homeDirectory']) $errors[] = array('INFO', _('Home directory'), _('Replaced $user or $group in homedir.')); if ( !ereg('^[/]([a-z]|[A-Z])([a-z]|[A-Z]|[0-9]|[.]|[-]|[_])*([/]([a-z]|[A-Z])([a-z]|[A-Z]|[0-9]|[.]|[-]|[_])*)*$', $this->attributes['homeDirectory'][0] )) $errors[] = array('ERROR', _('Home directory'), _('Homedirectory contains invalid characters.')); // Check if Username contains only valid characters if ( !ereg('^([a-z]|[A-Z]|[0-9]|[.]|[-]|[_])+$', $this->attributes['uid'][0])) $errors[] = array('ERROR', _('Username'), _('Username contains invalid characters. Valid characters are: a-z, A-Z, 0-9 and .-_ !')); } if ($_SESSION[$this->base]->type=='host') { if (($this->attributes['uid'][0] != $post['form_account_uid']) && ereg('[A-Z]$', $post['form_account_uid'])) $errors[] = array('WARN', _('Hostname'), _('You are using a capital letters. This can cause problems because windows isn\'t case-sensitive.')); // Check if Username contains only valid characters if ( !ereg('^([a-z]|[A-Z]|[0-9]|[.]|[-]|[_])+[$]$', $this->attributes['uid'][0])) $errors[] = array('ERROR', _('Hostname'), _('Hostname contains invalid characters. Valid characters are: a-z, A-Z, 0-9 and .-_ ! Hostname must end with $ !')); } // Create automatic useraccount with number if original user already exists // Reset name to original name if new name is in use // Set username back to original name if new username is in use if ($_SESSION[$_SESSION[$this->base]->cache]->in_cache($this->attributes['uid'][0],'uid', '*')!=false && ($this->orig['uid'][0]!='')) { $this->attributes['uid'][0] = $this->orig['uid'][0]; } // Change uid to a new uid until a free uid is found else while ($_SESSION[$_SESSION[$this->base]->cache]->in_cache($this->attributes['uid'][0], 'uid', '*')) { if ($_SESSION[$this->base]->type=='host') $this->attributes['uid'][0] = substr($this->attributes['uid'][0], 0, -1); // get last character of username $lastchar = substr($this->attributes['uid'][0], strlen($this->attributes['uid'][0])-1, 1); // Last character is no number if ( !ereg('^([0-9])+$', $lastchar)) /* Last character is no number. Therefore we only have to * add "2" to it. */ if ($_SESSION[$this->base]->type=='host') $this->attributes['uid'][0] = $this->attributes['uid'][0] . '2$'; else $this->attributes['uid'][0] = $this->attributes['uid'][0] . '2'; else { /* Last character is a number -> we have to increase the number until we've * found a groupname with trailing number which is not in use. * * $i will show us were we have to split groupname so we get a part * with the groupname and a part with the trailing number */ $i=strlen($this->attributes['uid'][0])-1; $mark = false; // Set $i to the last character which is a number in $account_new->general_username while (!$mark) { if (ereg('^([0-9])+$',substr($this->attributes['uid'][0], $i, strlen($this->attributes['uid'][0])-$i))) $i--; else $mark=true; } // increase last number with one $firstchars = substr($this->attributes['uid'][0], 0, $i+1); $lastchars = substr($this->attributes['uid'][0], $i+1, strlen($this->attributes['uid'][0])-$i); // Put username together if ($_SESSION[$this->base]->type=='host') $this->attributes['uid'][0] = $firstchars . (intval($lastchars)+1)."$"; else $this->attributes['uid'][0] = $firstchars . (intval($lastchars)+1); } } // Show warning if lam has changed username if ($_SESSION[$this->base]->type=='user') if ($this->attributes['uid'][0] != $post['form_posixAccount_uid']) { $errors[] = array('WARN', _('Username'), _('Username in use. Selected next free username.')); } if ($_SESSION[$this->base]->type=='host') if ($this->attributes['uid'][0] != $post['form_posixAccount_uid']) { $errors[] = array('WARN', _('Hostname'), _('Hostname in use. Selected next free hostname.')); } if (!ereg('^([a-z]|[A-Z]|[0-9]|[\|]|[\#]|[\*]|[\,]|[\.]|[\;]|[\:]|[\_]|[\-]|[\+]|[\!]|[\%]|[\&]|[\/]|[\?]|[\{]|[\[]|[\(]|[\)]|[\]]|[\}])*$', $this->userPassword())) $errors[] = array('ERROR', _('Password'), _('Password contains invalid characters. Valid characters are: a-z, A-Z, 0-9 and #*,.;:_-+!$%&/|?{[()]}= !')); // Return error-messages if (is_array($errors)) return $errors; // Go to additional group page when no error did ocour and button was pressed if ($post['form_posixAccount_addgroup']) return 'group'; return 0; } /* Write variables into object and do some regexp checks */ function proccess_group($post) { do { // X-Or, only one if() can be true if (isset($post['form_posixAccount_addgroups']) && isset($post['form_posixAccount_addgroups_button'])) { // Add groups to list // Add new group $this->groups = @array_merge($this->groups, $post['form_posixAccount_addgroups']); // sort groups sort($this->groups); break; } if (isset($post['form_posixAccount_removegroups']) && isset($post['form_posixAccount_removegroups_button'])) { // remove groups from list $this->groups = array_delete($post['form_posixAccount_removegroups'], $this->groups); break; } } while(0); if (isset($post['form_posixAccount_addgroups_button']) || isset($post['form_posixAccount_removegroups_button'])) return 'group'; if ($post['form_posixAccount_toattributes']) return 'attributes'; return 0; } /* This function loads all attributes into the object * $attr is an array as it's retured from ldap_get_attributes */ function load_attributes($attr) { // Load attributes which are displayed // unset count entries unset ($attr['count']); $attributes = array_keys($attr); foreach ($attributes as $attribute) unset ($attr[$attribute]['count']); // unset double entries for ($i=0; $iattributes[$attribute])) { // decode as unicode $this->attributes[$attribute] = $attr[$attribute]; for ($i=0; $iattributes[$attribute]); $i++) $this->attributes[$attribute][$i] = utf8_decode ($this->attributes[$attribute][$i]); } } // Values are kept as copy so we can compare old attributes with new attributes $this->attributes['objectClass'][0] = 'posixAccount'; $this->orig = $this->attributes; // get all additional groupmemberships $dn_groups = $_SESSION[$_SESSION[$this->base]->cache]->get_cache('memberUid', 'posixGroup', 'group'); $DNs = array_keys($dn_groups); foreach ($DNs as $DN) { if (in_array($attr['uid'][0], $dn_groups[$DN])) { $this->groups[] = substr($DN, 3, strpos($DN, ',')-3); } } $this->groups_orig = $this->groups; return 0; } /* This function returns an array with 3 entries: * array( DN1 ('add' => array($attr), 'remove' => array($attr), 'modify' => array($attr)), DN2 .... ) * DN is the DN to change. It may be possible to change several DNs, * e.g. create a new user and add him to some groups via attribute memberUid * add are attributes which have to be added to ldap entry * remove are attributes which have to be removed from ldap entry * modify are attributes which have to been modified in ldap entry */ function save_attributes() { $return = $_SESSION[$this->base]->save_module_attributes($this->attributes, $this->orig); if (isset($return[$_SESSION[$this->base]->dn]['modify']['userPassword'])) unset($return[$_SESSION[$this->base]->dn]['modify']['userPassword']); // Set unix password if (count($this->orig['userPassword'])==0) { // New user or no old password set if ($this->userPassword_no) { $return[$_SESSION[$this->base]->dn]['modify']['userPassword'][0] = pwd_hash ('', !$this->userPassword_lock); } else $return[$_SESSION[$this->base]->dn]['modify']['userPassword'][0] = utf8_encode(pwd_hash ($this->userPassword(), !$this->userPassword_lock)); } else { if (($this->attributes['userPassword'][0] != $this->orig['userPassword'][0] && $this->userPassword()!='' ) || $this->userPassword_no) { // Write new password if ($this->userPassword_no) $return[$_SESSION[$this->base]->dn]['modify']['userPassword'][0] = pwd_hash ('', !$this->userPassword_lock); else $return[$_SESSION[$this->base]->dn]['modify']['userPassword'][0] = utf8_encode(pwd_hash ($this->userPassword(), !$this->userPassword_lock)); } else { // No new password but old password // (un)lock password if ($this->userPassword_lock == pwd_is_enabled($this->orig['userPassword'][0])) { // Split old password hash in {CRYPT} and password-hash $i = 0; while ($this->orig['userPassword'][0]{$i} != '}') $i++; $passwd = substr($this->orig['userPassword'][0], $i+1 ); $crypt = substr($this->orig['userPassword'][0], 0, $i+1 ); // remove trailing ! from password hash if ($passwd{0} == '!') $passwd = substr($passwd, 1); // Write new password if ($this->userPassword_lock) $return[$_SESSION[$this->base]->dn]['modify']['userPassword'][0] = utf8_encode("$crypt!$passwd"); else $return[$_SESSION[$this->base]->dn]['modify']['userPassword'][0] = utf8_encode("$crypt$passwd"); } } } // Remove primary group from additional groups for ($i=0; $igroups); $i++) { if ($this->groups[$i]==$_SESSION[$_SESSION[$this->base]->cache]->getgrnam($this->attributes['gidNumber'])) unset($this->groups[$i]); } // Set additional group memberships if ($this->orig['uid'][0]!='' && $this->attributes['uid'][0]!=$this->orig['uid'][0]) { // remove old memberships $dn_groups = $_SESSION[$_SESSION[$this->base]->cache]->get_cache('memberUid', 'posixGroup', 'group'); $DNs = array_keys($dn_groups); foreach ($DNs as $DN) if (in_array($this->orig['uid'][0], $dn_groups[$DN])) $return[$DN]['remove']['memberUid'][0] = $this->orig['uid'][0]; // Add new memberships if (is_array($this->groups)) foreach ($this->groups as $group) { $dn = $_SESSION[$_SESSION[$this->base]->ldap]->in_cache ($group, 'cn', 'group'); $return[$dn]['add']['memberUid'][0] = $this->attributes['uid'][0]; } } else { if (is_array($this->groups)) { // There are some additional groups defined if (is_array($this->groups_orig)) { //There are some old groups. $add = array_delete($this->groups_orig, $this->groups); $remove = array_delete($this->groups, $this->groups_orig); $dn_cns = $_SESSION[$_SESSION[$this->base]->cache]->get_cache('cn', 'posixGroup', 'group'); // get_cache will return an array ( dn1 => array(cn1), dn2 => array(cn2), ... ) $DNs = array_keys($dn_cns); foreach ($DNs as $DN) { if (is_array($add)) if (in_array($dn_cns[$DN][0], $add)) $return[$DN]['add']['memberUid'] = $this->attributes['uid']; if (is_array($remove)) if (in_array($dn_cns[$DN][0], $remove)) $return[$DN]['remove']['memberUid'] = $this->attributes['uid']; } // primary group mut also be removed if it has changed after setting additional groups if (in_array($_SESSION[$_SESSION[$this->base]->cache]->getgrnam($this->attributes['gidNumber']), $this->groups_orig)) $return[$DN]['remove']['memberUid'] = $this->attributes['uid']; } else { // Add user to every group $dn_cns = $_SESSION[$_SESSION[$this->base]->cache]->get_cache('cn', 'posixGroup', 'group'); // get_cache will return an array ( dn1 => array(cn1), dn2 => array(cn2), ... ) $DNs = array_keys($dn_cns); foreach ($DNs as $DN) { if (in_array($dn_cns[$DN][0], $this->groups)) $return[$DN]['add']['memberUid'] = $this->attributes['uid']; } } } else { if (is_array($this->groups_orig)) { //There are some old groups which have to be removed $dn_cns = $_SESSION[$_SESSION[$this->base]->cache]->get_cache('cn', 'posixGroup', 'group'); // get_cache will return an array ( dn1 => array(cn1), dn2 => array(cn2), ... ) $DNs = array_keys($dn_cns); foreach ($DNs as $DN) { if (in_array($dn_cns[$DN][0], $this->orig['groups'])) $return[$DN]['remove']['memberUid'] = $this->attributes['uid']; } } } } if ($this->createhomedir) $return[$_SESSION[$this->base]->dn]['lamdaemon']['command'][] = $this->attributes['uid'][0] . " home add"; return $return; } function delete_attributes() { } /* This function returns all ldap attributes * which are part of posixAccount and returns * also their values. */ function get_attributes() { $return = $this->attributes; $return['userPassword'] = $this->userPassword(); return $return; } /* This function will create the html-page * to show a page with all attributes. * It will output a complete html-table */ function display_html_attributes($post) { $groups = $_SESSION[$_SESSION[$this->base]->cache]->findgroups(); // list of all groupnames $shelllist = getshells(); // list of all valid shells if ($this->attributes['userPassword'][0] != $this->orig['userPassword'][0]) $password=$this->userPassword(); else $password=''; echo "\n"; echo "\n"; echo '\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($_SESSION[$this->base]->type=='user') { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($this->orig['homeDirectory']=='' && isset($_SESSION[$_SESSION[$this->base]->config]->scriptPath)) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if (count($shelllist)!=0) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } } echo "
' . _('Username') . "*attributes['uid'][0]."\">" . _('Help') . "
" . _('UID number') ."attributes['uidNumber'][0]."\">" . _('Help') . "
" . _('Gecos') . "attributes['gecos'][0]."\">" . _('Help') . "
" . _('Primary group') . "*" . _('Help') . "
" . _('Additional groups') . "" . _('Help') . "
" . _('Home directory') . "*attributes['homeDirectory'][0]."\">" . _('Help') . "
" . _('Create home directory') . "*createhomedir) echo " checked "; echo ">
" . _('Password') . "
" . _('Repeat password') . "
" . _('Use no password') . "userPassword_no) echo " checked "; echo ">" . _('Help') . "
" . _('Lock password') . "userPassword_lock) echo " checked "; echo ">" . _('Help') . "
" . _('Login shell') . "*" . _('Help') . "
\n"; return 0; } function display_html_group($post) { // load list with all groups $dn_groups = $_SESSION[$_SESSION[$this->base]->cache]->get_cache('gidNumber', 'posixGroup', 'group'); $DNs = array_keys($dn_groups); foreach ($DNs as $DN) $groups[] = substr($DN, 3, strpos($DN, ',')-3); // sort groups sort($groups, SORT_STRING); // remove groups the user is member of from grouplist $groups = array_delete($this->groups, $groups); // Remove primary group from grouplist $groups = array_flip($groups); if (isset($groups[$_SESSION[$_SESSION[$this->base]->cache]->getgrnam($this->attributes['gidNumber'])])) unset ($groups[$_SESSION[$_SESSION[$this->base]->cache]->getgrnam($this->attributes['gidNumber'])]); $groups = array_flip($groups); echo "\n\n"; echo "
base]->type."edit-bright\">"; echo "base]->type."edit-bright\">" . _("Additional groups") . "\n"; echo "\n\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
"; echo "
base]->type."edit-bright\">"; echo "base]->type."edit-bright\">" . _("Selected groups") . "\n"; // Show all groups the user is additional member of if (count($this->groups)!=0) { echo "\n"; } echo "
"; echo " "; echo "\">

"; echo ""._('Help')."
\n"; echo "
base]->type."edit-bright\">"; echo "base]->type."edit-bright\">" . _('Available groups') . "\n"; // show all groups expect these the user is member of if (count($groups)!=0) { echo "\n"; } echo "
\n"; echo "\n"; echo "
\n"; echo "
\n"; return 0; } } ?>