use new meta HTML classes

This commit is contained in:
Roland Gruber 2010-09-25 18:48:51 +00:00
parent ebda568acc
commit be743a467b
1 changed files with 130 additions and 166 deletions

View File

@ -140,13 +140,10 @@ class posixAccount extends baseModule implements passwordService {
// self service field settings // self service field settings
$return['selfServiceFieldSettings'] = array('password' => _('Password')); $return['selfServiceFieldSettings'] = array('password' => _('Password'));
// self service configuration settings // self service configuration settings
$return['selfServiceSettings'] = array( $selfServiceContainer = new htmlTable();
array( $selfServiceContainer->addElement(new htmlTableExtendedSelect('posixAccount_pwdHash', array("CRYPT", "SHA", "SSHA", "MD5", "SMD5", "PLAIN"),
array('kind' => 'text', 'text' => '<b>' . _("Password hash type") . ': &nbsp;</b>'), array('SSHA'), _("Password hash type"), 'pwdHash'));
array('kind' => 'select', 'name' => 'posixAccount_pwdHash', 'size' => '1', $return['selfServiceSettings'] = $selfServiceContainer;
'options' => array("CRYPT", "SHA", "SSHA", "MD5", "SMD5", "PLAIN"), 'options_selected' => array('SSHA')),
array('kind' => 'help', 'value' => 'pwdHash'))
);
} }
// profile checks // profile checks
$return['profile_checks']['posixAccount_homeDirectory'] = array('type' => 'ext_preg', 'regex' => 'homeDirectory', $return['profile_checks']['posixAccount_homeDirectory'] = array('type' => 'ext_preg', 'regex' => 'homeDirectory',
@ -157,41 +154,30 @@ class posixAccount extends baseModule implements passwordService {
'posixAccount_loginShell' => 'loginShell' 'posixAccount_loginShell' => 'loginShell'
); );
// configuration options // configuration options
$return['config_options']['user'] = array( $configUserContainer = new htmlTable();
array( $configUserContainer->addElement(new htmlSubTitle(_("Users")), true);
array('kind' => 'text', 'text' => '<b>' . _("Users") . ': &nbsp;</b>' . _('Minimum UID number') . "* "), $minUid = new htmlTableExtendedInputField(_('Minimum UID number'), 'posixAccount_minUID', null, 'minMaxUser');
array('kind' => 'input', 'name' => 'posixAccount_minUID', 'type' => 'text', 'size' => '10', 'maxlength' => '255'), $minUid->setRequired(true);
array('kind' => 'text', 'value' => '&nbsp;'), $configUserContainer->addElement($minUid, true);
array('kind' => 'text', 'text' => _('Maximum UID number') . "* "), $maxUid = new htmlTableExtendedInputField(_('Maximum UID number'), 'posixAccount_maxUID', null, 'minMaxUser');
array('kind' => 'input', 'name' => 'posixAccount_maxUID', 'type' => 'text', 'size' => '10', 'maxlength' => '255'), $maxUid->setRequired(true);
array('kind' => 'help', 'value' => 'minMaxUser')) $configUserContainer->addElement($maxUid);
); $return['config_options']['user'] = $configUserContainer;
$return['config_options']['host'] = array( $configHostContainer = new htmlTable();
array( $configHostContainer->addElement(new htmlSubTitle(_("Hosts")), true);
array('kind' => 'text', 'text' => '<b>' . _("Hosts") . ': &nbsp;</b>' . _('Minimum UID number') . "* "), $minUid = new htmlTableExtendedInputField(_('Minimum UID number'), 'posixAccount_minMachine', null, 'minMaxHost');
array('kind' => 'input', 'name' => 'posixAccount_minMachine', 'type' => 'text', 'size' => '10', 'maxlength' => '255'), $minUid->setRequired(true);
array('kind' => 'text', 'value' => '&nbsp;'), $configHostContainer->addElement($minUid, true);
array('kind' => 'text', 'text' => _('Maximum UID number') . "* "), $maxUid = new htmlTableExtendedInputField(_('Maximum UID number'), 'posixAccount_maxMachine', null, 'minMaxHost');
array('kind' => 'input', 'name' => 'posixAccount_maxMachine', 'type' => 'text', 'size' => '10', 'maxlength' => '255'), $maxUid->setRequired(true);
array('kind' => 'help', 'value' => 'minMaxHost')) $configHostContainer->addElement($maxUid);
); $return['config_options']['host'] = $configHostContainer;
$return['config_options']['all'] = array( $configOptionsContainer = new htmlTable();
array( $configOptionsContainer->addElement(new htmlSubTitle(_('Options')), true);
array('kind' => 'text', 'text' => _("Password hash type") . ' &nbsp;'), $configOptionsContainer->addElement(new htmlTableExtendedSelect('posixAccount_pwdHash', array("CRYPT", "SHA", "SSHA", "MD5", "SMD5", "PLAIN"),
array('kind' => 'select', 'name' => 'posixAccount_pwdHash', 'size' => '1', array('SSHA'), _("Password hash type"), 'pwdHash'), true);
'options' => array("CRYPT", "SHA", "SSHA", "MD5", "SMD5", "PLAIN"), 'options_selected' => array('SSHA')), $configOptionsContainer->addElement(new htmlTableExtendedInputCheckbox('posixAccount_primaryGroupAsSecondary', false, _('Set primary group as memberUid'), 'primaryGroupAsSecondary'));
array('kind' => 'text', 'value' => '&nbsp;'), $return['config_options']['all'] = $configOptionsContainer;
array('kind' => 'text', 'value' => '&nbsp;'),
array('kind' => 'text', 'value' => '&nbsp;'),
array('kind' => 'help', 'value' => 'pwdHash')),
array(
array('kind' => 'text', 'text' => _('Set primary group as memberUid')),
array('kind' => 'input', 'name' => 'posixAccount_primaryGroupAsSecondary', 'type' => 'checkbox'),
array('kind' => 'text', 'value' => '&nbsp;'),
array('kind' => 'text', 'value' => '&nbsp;'),
array('kind' => 'text', 'value' => '&nbsp;'),
array('kind' => 'help', 'value' => 'primaryGroupAsSecondary'))
);
// upload // upload
$return['upload_preDepends'] = array('inetOrgPerson'); $return['upload_preDepends'] = array('inetOrgPerson');
// user specific upload options // user specific upload options
@ -711,13 +697,13 @@ class posixAccount extends baseModule implements passwordService {
else $this->createhomedir = false; else $this->createhomedir = false;
$this->attributes['homeDirectory'][0] = $_POST['homeDirectory']; $this->attributes['homeDirectory'][0] = $_POST['homeDirectory'];
// Load attributes // Load attributes
if (isset($_POST['form_subpage_posixAccount_attributes_lockPassword'])) { if (isset($_POST['lockPassword'])) {
$this->attributes['userPassword'][0] = pwd_disable($this->attributes['userPassword'][0]); $this->attributes['userPassword'][0] = pwd_disable($this->attributes['userPassword'][0]);
} }
if (isset($_POST['form_subpage_posixAccount_attributes_unlockPassword'])) { if (isset($_POST['unlockPassword'])) {
$this->attributes['userPassword'][0] = pwd_enable($this->attributes['userPassword'][0]); $this->attributes['userPassword'][0] = pwd_enable($this->attributes['userPassword'][0]);
} }
if (isset($_POST['form_subpage_posixAccount_attributes_removePassword'])) { if (isset($_POST['removePassword'])) {
unset($this->attributes['userPassword']); unset($this->attributes['userPassword']);
} }
$this->attributes['uid'][0] = $_POST['uid']; $this->attributes['uid'][0] = $_POST['uid'];
@ -913,10 +899,15 @@ class posixAccount extends baseModule implements passwordService {
* @return array HTML meta data * @return array HTML meta data
*/ */
function display_html_attributes() { function display_html_attributes() {
$groups = $this->findGroups(); // list of all group names $return = new htmlTable();
$groupList = $this->findGroups(); // list of all group names
$groups = array();
for ($i = 0; $i < sizeof($groupList); $i++) {
$groups[$groupList[$i][1]] = $groupList[$i][0];
}
if (count($groups)==0) { if (count($groups)==0) {
StatusMessage("ERROR", _('No Unix groups found in LDAP! Please create one first.'), ''); $return->addElement(new htmlStatusMessage("ERROR", _('No Unix groups found in LDAP! Please create one first.')));
return array(); return $return;
} }
$shelllist = getshells(); // list of all valid shells $shelllist = getshells(); // list of all valid shells
@ -925,7 +916,7 @@ class posixAccount extends baseModule implements passwordService {
// fill default value for user ID with first/last name // fill default value for user ID with first/last name
$attrs = $this->getAccountContainer()->getAccountModule('inetOrgPerson')->getAttributes(); $attrs = $this->getAccountContainer()->getAccountModule('inetOrgPerson')->getAttributes();
if (isset($attrs['sn'][0])) { if (isset($attrs['sn'][0])) {
if (isset($attrs['givenName'])) { if (isset($attrs['givenName'][0]) && ($attrs['givenName'][0] != '')) {
$this->attributes['uid'][0] = preg_replace('/[^a-z0-9_-]/', '', strtolower($attrs['givenName'][0][0] . $attrs['sn'][0])); $this->attributes['uid'][0] = preg_replace('/[^a-z0-9_-]/', '', strtolower($attrs['givenName'][0][0] . $attrs['sn'][0]));
} }
else { else {
@ -933,7 +924,7 @@ class posixAccount extends baseModule implements passwordService {
} }
} }
} }
if ($this->attributes['cn'][0] == '') { if (!isset($this->attributes['cn'][0]) || ($this->attributes['cn'][0] == '')) {
// set a default value for common name // set a default value for common name
if (($this->get_scope() == 'host') && (substr($_POST['uid'], -1, 1) == '$')) { if (($this->get_scope() == 'host') && (substr($_POST['uid'], -1, 1) == '$')) {
$this->attributes['cn'][0] = substr($_POST['uid'], 0, strlen($_POST['uid']) - 1); $this->attributes['cn'][0] = substr($_POST['uid'], 0, strlen($_POST['uid']) - 1);
@ -957,42 +948,41 @@ class posixAccount extends baseModule implements passwordService {
$userName = ''; $userName = '';
if (isset($this->attributes['uid'][0])) $userName = $this->attributes['uid'][0]; if (isset($this->attributes['uid'][0])) $userName = $this->attributes['uid'][0];
$return[] = array ( $uidInput = new htmlTableExtendedInputField(_("User name"), 'uid', $userName, 'uid');
array('kind' => 'text', 'text' => _("User name").'*'), $uidInput->setRequired(true);
array('kind' => 'input', 'name' => 'uid', 'type' => 'text', 'size' => '30', 'maxlength' => '20', 'value' => $userName), $uidInput->setFieldMaxLength(20);
array('kind' => 'help', 'value' => 'uid')); $return->addElement($uidInput, true);
$commonName = ''; $commonName = '';
if (isset($this->attributes['cn'][0])) $commonName = $this->attributes['cn'][0]; if (isset($this->attributes['cn'][0])) $commonName = $this->attributes['cn'][0];
$return[] = array ( $cnInput = new htmlTableExtendedInputField(_("Common name"), 'cn', $commonName, 'cn');
array('kind' => 'text', 'text' => _("Common name").'*'), $cnInput->setRequired(true);
array('kind' => 'input', 'name' => 'cn', 'type' => 'text', 'size' => '30', 'value' => $commonName), $return->addElement($cnInput, true);
array('kind' => 'help', 'value' => 'cn'));
$uidNumber = ''; $uidNumber = '';
if (isset($this->attributes['uidNumber'][0])) $uidNumber = $this->attributes['uidNumber'][0]; if (isset($this->attributes['uidNumber'][0])) $uidNumber = $this->attributes['uidNumber'][0];
$return[] = array( $uidNumberInput = new htmlTableExtendedInputField(_('UID number'), 'uidNumber', $uidNumber, 'uidNumber');
array('kind' => 'text', 'text' => _('UID number').'*'), $uidNumberInput->setRequired(true);
array('kind' => 'input', 'name' => 'uidNumber', 'type' => 'text', 'size' => '30', 'maxlength' => '20', 'value' => $uidNumber), $uidNumberInput->setFieldMaxLength(20);
array('kind' => 'help', 'value' => 'uidNumber')); $return->addElement($uidNumberInput, true);
$gecos = ''; $gecos = '';
if (isset($this->attributes['gecos'][0])) $gecos = $this->attributes['gecos'][0]; if (isset($this->attributes['gecos'][0])) $gecos = $this->attributes['gecos'][0];
$return[] = array( $return->addElement(new htmlTableExtendedInputField(_('Gecos'), 'gecos', $gecos, 'gecos'), true);
array('kind' => 'text', 'text' => _('Gecos')), $primaryGroup = array();
array('kind' => 'input', 'name' => 'gecos', 'type' => 'text', 'size' => '30', 'maxlength' => '255', 'value' => $gecos), if (isset($this->attributes['gidNumber'][0])) {
array('kind' => 'help', 'value' => 'gecos')); $primaryGroup[] = $this->attributes['gidNumber'][0];
$return[] = array( }
array('kind' => 'text', 'text' => _('Primary group').'*' ), $gidNumberSelect = new htmlTableExtendedSelect('gidNumber', $groups, $primaryGroup, _('Primary group'), 'gidNumber');
array('kind' => 'select', 'name' => 'gidNumber', 'descriptiveOptions' => true, 'options' => $groups, 'options_selected' => array($this->attributes['gidNumber'][0])), $gidNumberSelect->setHasDescriptiveElements(true);
array('kind' => 'help', 'value' => 'gidNumber')); $return->addElement($gidNumberSelect, true);
if ($this->get_scope()=='user') { if ($this->get_scope()=='user') {
$return[] = array( // additional groups
array('kind' => 'text', 'text' => _('Additional groups')), $return->addElement(new htmlOutputText(_('Additional groups')));
array('kind' => 'input', 'name' => 'form_subpage_posixAccount_group_open', 'type' => 'submit', 'value' => _('Edit groups')), $return->addElement(new htmlAccountPageButton(get_class($this), 'group', 'open', _('Edit groups')));
array('kind' => 'help', 'value' => 'addgroup')); $return->addElement(new htmlHelpLink('addgroup'), true);
$return[] = array( // home directory
array('kind' => 'text', 'text' => _('Home directory').'*'), $homedirInput = new htmlTableExtendedInputField(_('Home directory'), 'homeDirectory', $this->attributes['homeDirectory'][0], 'homeDirectory');
array('kind' => 'input', 'name' => 'homeDirectory', 'type' => 'text', 'size' => '30', 'maxlength' => '255', 'value' => $this->attributes['homeDirectory'][0]), $homedirInput->setRequired(true);
array('kind' => 'help', 'value' => 'homeDirectory')); $return->addElement($homedirInput, true);
if ($this->getAccountContainer()->isNewAccount && ($_SESSION['config']->get_scriptPath() != null) if ($this->getAccountContainer()->isNewAccount && ($_SESSION['config']->get_scriptPath() != null)
&& ($_SESSION['config']->get_scriptPath() != '')) { && ($_SESSION['config']->get_scriptPath() != '')) {
// get list of lamdaemon servers // get list of lamdaemon servers
@ -1002,35 +992,28 @@ class posixAccount extends baseModule implements passwordService {
if (isset($temp[1])) $lamdaemonServers[$i] = $temp[1]; if (isset($temp[1])) $lamdaemonServers[$i] = $temp[1];
else $lamdaemonServers[$i] = $temp[0]; else $lamdaemonServers[$i] = $temp[0];
} }
$return[] = array( $return->addElement(new htmlOutputText(_('Create home directory')));
array('kind' => 'text', 'text' => _('Create home directory')), $homeServerContainer = new htmlTable();
array('kind' => 'table', 'value' => array(array( $homeServerContainer->addElement(new htmlInputCheckbox('createhomedir', $this->createhomedir));
array('kind' => 'input', 'name' => 'createhomedir', 'type' => 'checkbox', 'checked' => $this->createhomedir), $homeServerContainer->addElement(new htmlSelect('createhomediron', $lamdaemonServers, $this->lamdaemonServer));
array('kind' => 'select', 'name' => 'createhomediron', 'options' => $lamdaemonServers, 'options_selected' => $this->lamdaemonServer), $return->addElement($homeServerContainer);
))), $return->addElement(new htmlHelpLink('createhomedir'), true);
array('kind' => 'help', 'value' => 'createhomedir'));
} }
if (count($shelllist)!=0) { $return->addElement(new htmlTableExtendedSelect('loginShell', $shelllist, array($this->attributes['loginShell'][0]), _('Login shell'), 'loginShell'), true);
$return[] = array( }
array('kind' => 'text', 'text' => _('Login shell').'*'), // password buttons
array('kind' => 'select', 'name' => 'loginShell', 'options' => $shelllist, 'options_selected' => array ($this->attributes['loginShell'][0])), if (isset($this->attributes['userPassword'][0])) {
array('kind' => 'help', 'value' => 'loginShell')); $return->addElement(new htmlOutputText(_('Password')));
$pwdContainer = new htmlTable();
if (pwd_is_enabled($this->attributes['userPassword'][0])) {
$pwdContainer->addElement(new htmlButton('lockPassword', _('Lock password')));
} }
else {
$pwdContainer->addElement(new htmlButton('unlockPassword', _('Unlock password')));
}
$pwdContainer->addElement(new htmlButton('removePassword', _('Remove password')));
$return->addElement($pwdContainer);
} }
if (isset($this->attributes['userPassword'][0]) && pwd_is_enabled($this->attributes['userPassword'][0])) {
$lockOption = array('kind' => 'input', 'name' => 'form_subpage_posixAccount_attributes_lockPassword', 'type' => 'submit', 'value' => _('Lock password'));
}
else {
$lockOption = array('kind' => 'input', 'name' => 'form_subpage_posixAccount_attributes_unlockPassword', 'type' => 'submit', 'value' => _('Unlock password'));
}
$return[] = array(
array('kind' => 'text', 'text' => _('Password') ),
array('kind' => 'table', 'value' => array(
array($lockOption),
array(
array('kind' => 'input', 'name' => 'form_subpage_posixAccount_attributes_removePassword', 'type' => 'submit', 'value' => _('Remove password'))
)
)));
return $return; return $return;
} }
@ -1040,11 +1023,10 @@ class posixAccount extends baseModule implements passwordService {
* @return meta HTML code * @return meta HTML code
*/ */
function display_html_delete() { function display_html_delete() {
$return = null;
if ($this->get_scope() == 'user' && ($_SESSION['config']->get_scriptPath() != null)) { if ($this->get_scope() == 'user' && ($_SESSION['config']->get_scriptPath() != null)) {
$return[] = array ( $return = new htmlTable();
array('kind' => 'text', 'text' => _('Delete home directory')), $return->addElement(new htmlTableExtendedInputCheckbox('deletehomedir', false, _('Delete home directory'), 'deletehomedir'));
array('kind' => 'input', 'name' => 'deletehomedir', 'type' => 'checkbox'),
array('kind' => 'help', 'value' => 'deletehomedir'));
} }
return $return; return $return;
} }
@ -1055,6 +1037,7 @@ class posixAccount extends baseModule implements passwordService {
* @return array meta HTML code * @return array meta HTML code
*/ */
function display_html_group() { function display_html_group() {
$return = new htmlTable();
// load list with all groups // load list with all groups
$dn_groups = $_SESSION['cache']->get_cache('cn', 'posixGroup', 'group'); $dn_groups = $_SESSION['cache']->get_cache('cn', 'posixGroup', 'group');
$DNs = array_keys($dn_groups); $DNs = array_keys($dn_groups);
@ -1069,28 +1052,29 @@ class posixAccount extends baseModule implements passwordService {
unset ($groups[$group]); unset ($groups[$group]);
$groups = array_flip($groups); $groups = array_flip($groups);
$return[] = array( $return->addElement(new htmlSubTitle(_("Additional groups")), true);
array('kind' => 'fieldset', 'legend' => _("Additional groups"), 'value' => array( $return->addElement(new htmlOutputText(_("Selected groups")));
array( $return->addElement(new htmlOutputText(''));
array('kind' => 'fieldset', 'td' => array('valign' => 'top'), 'legend' => _("Selected groups"), 'value' => array( $return->addElement(new htmlOutputText(_("Available groups")));
array ( $return->addNewLine();
array('kind' => 'select', 'name' => 'removegroups', 'size' => '15', 'multiple' => true, 'options' => $this->groups)))),
array('kind' => 'table', 'value' => array( $remSelect = new htmlSelect('removegroups', $this->groups, null, 15);
array( $remSelect->setMultiSelect(true);
array('kind' => 'input', 'type' => 'submit', 'name' => 'addgroups_button', 'value' => '<=', 'td' => array('align' => 'center'))), $return->addElement($remSelect);
array( $buttonContainer = new htmlTable();
array ( 'kind' => 'input', 'type' => 'submit', 'name' => 'removegroups_button', 'value' => '=>', 'td' => array('align' => 'center'))), $buttonContainer->addElement(new htmlButton('addgroups_button', 'back.gif', true), true);
array( $buttonContainer->addElement(new htmlButton('removegroups_button', 'forward.gif', true), true);
array ( 'kind' => 'help', 'value' => 'addgroup', 'td' => array('align' => 'center'))))), $buttonContainer->addElement(new htmlHelpLink('addgroup'));
array('kind' => 'fieldset', 'td' => array('valign' => 'top'), 'legend' => _("Available groups"), 'value' => array( $return->addElement($buttonContainer);
array( $addSelect = new htmlSelect('addgroups', $groups, null, 15);
array('kind' => 'select', 'name' => 'addgroups', 'size' => '15', 'multiple' => true, 'options' => $groups)))) $addSelect->setMultiSelect(true);
)))); $return->addElement($addSelect);
$return->addNewLine();
$return[] = array(
array('kind' => 'input', 'type' => 'submit', 'value' => _('Back'), 'name' => 'form_subpage_posixAccount_attributes_back'), $return->addElement(new htmlSpacer(null, '10px'), true);
array('kind' => 'text'),
array('kind' => 'text')); $backButton = new htmlAccountPageButton(get_class($this), 'attributes', 'back', _('Back'));
$return->addElement($backButton);
return $return; return $return;
} }
@ -1100,7 +1084,7 @@ class posixAccount extends baseModule implements passwordService {
* @return profile elements * @return profile elements
*/ */
function get_profileOptions() { function get_profileOptions() {
$return = array(); $return = new htmlTable();
$groupList = $this->findGroups(); $groupList = $this->findGroups();
$groups = array(); $groups = array();
for ($i = 0; $i < sizeof($groupList); $i++) { for ($i = 0; $i < sizeof($groupList); $i++) {
@ -1109,50 +1093,30 @@ class posixAccount extends baseModule implements passwordService {
if ($this->get_scope() == 'user') { if ($this->get_scope() == 'user') {
$shelllist = getshells(); // list of all valid shells $shelllist = getshells(); // list of all valid shells
// primary Unix group // primary Unix group
$return[] = array( $return->addElement(new htmlTableExtendedSelect('posixAccount_primaryGroup', $groups, null, _('Primary group'), 'gidNumber'), true);
array('kind' => 'text', 'text' => _('Primary group') . ": "),
array('kind' => 'select', 'name' => 'posixAccount_primaryGroup', 'options' => $groups, 'options_selected' => array(), 'size' => 1),
array('kind' => 'help', 'value' => 'gidNumber', 'scope' => 'user'));
// additional group memberships // additional group memberships
$return[] = array( $addGroupSelect = new htmlTableExtendedSelect('posixAccount_additionalGroup', $groups, null, _('Additional groups'), 'addgroup', 10);
array('kind' => 'text', 'text' => _('Additional groups') . ": "), $addGroupSelect->setMultiSelect(true);
array('kind' => 'select', 'name' => 'posixAccount_additionalGroup', 'options' => $groups, $return->addElement($addGroupSelect, true);
'options_selected' => array(), 'size' => 10, 'multiple' => true),
array('kind' => 'help', 'value' => 'addgroup', 'scope' => 'user'));
// home directory // home directory
$return[] = array( $return->addElement(new htmlTableExtendedInputField(_('Home directory'), 'posixAccount_homeDirectory', '/home/$user', 'homeDirectory'), true);
array('kind' => 'text', 'text' => _('Home directory') . ": "),
array('kind' => 'input', 'name' => 'posixAccount_homeDirectory', 'type' => 'text', 'size' => '30', 'maxlength' => '255', 'value' => '/home/$user'),
array('kind' => 'help', 'value' => 'homeDirectory', 'scope' => 'user'));
// login shell // login shell
$return[] = array( $return->addElement(new htmlTableExtendedSelect('posixAccount_loginShell', $shelllist, array("/bin/bash"), _('Login shell'), 'loginShell'), true);
array('kind' => 'text', 'text' => _('Login shell') . ": "),
array('kind' => 'select', 'name' => 'posixAccount_loginShell', 'options' => $shelllist, 'options_selected' => array("/bin/bash")),
array('kind' => 'help', 'value' => 'loginShell', 'scope' => 'user'));
// lamdaemon settings // lamdaemon settings
if (($_SESSION['config']->get_scriptPath() != null)) { if (($_SESSION['config']->get_scriptPath() != null)) {
$return[] = array( $return->addElement(new htmlTableExtendedInputCheckbox('posixAccount_createHomedir', false, _('Create home directory'), 'createhomedir'), true);
array('kind' => 'text', 'text' => _('Create home directory') . ": "), $lamdaemonServers = explode(";", $_SESSION['config']->get_scriptServers());
array('kind' => 'input', 'type' => 'checkbox', 'name' => 'posixAccount_createHomedir'), for ($i = 0; $i < sizeof($lamdaemonServers); $i++) {
array('kind' => 'help', 'value' => 'createhomedir', 'scope' => 'user')); $temp = explode(":", $lamdaemonServers[$i]);
$lamdaemonServers = explode(";", $_SESSION['config']->get_scriptServers()); if (isset($temp[1])) $lamdaemonServers[$i] = $temp[1];
for ($i = 0; $i < sizeof($lamdaemonServers); $i++) { else $lamdaemonServers[$i] = $temp[0];
$temp = explode(":", $lamdaemonServers[$i]); }
if (isset($temp[1])) $lamdaemonServers[$i] = $temp[1]; $return->addElement(new htmlTableExtendedSelect('posixAccount_homedirServer', $lamdaemonServers, null, _('Home directory server'), 'createhomedir'), true);
else $lamdaemonServers[$i] = $temp[0];
}
$return[] = array(
array('kind' => 'text', 'text' => _('Home directory server') . ": "),
array('kind' => 'select', 'name' => 'posixAccount_homedirServer', 'options' => $lamdaemonServers),
array('kind' => 'help', 'value' => 'createhomedir', 'scope' => 'user'));
} }
} }
elseif ($this->get_scope() == 'host') { elseif ($this->get_scope() == 'host') {
// primary Unix group // primary Unix group
$return[] = array( $return->addElement(new htmlTableExtendedSelect('posixAccount_primaryGroup', $groups, array(), _('Primary group'), 'gidNumber'));
array('kind' => 'text', 'text' => _('Primary group') . ": "),
array('kind' => 'select', 'name' => 'posixAccount_primaryGroup', 'options' => $groups, 'options_selected' => array(), 'size' => 1),
array('kind' => 'help', 'value' => 'gidNumber', 'scope' => 'host'));
} }
return $return; return $return;
} }