code reformating
This commit is contained in:
parent
e10c8280eb
commit
4598a24714
|
@ -133,13 +133,13 @@ class posixAccount extends baseModule {
|
||||||
// self service configuration settings
|
// self service configuration settings
|
||||||
$return['selfServiceSettings'] = array(
|
$return['selfServiceSettings'] = array(
|
||||||
array(
|
array(
|
||||||
0 => array('kind' => 'text', 'text' => '<b>' . _("Password hash type") . ': </b>'),
|
array('kind' => 'text', 'text' => '<b>' . _("Password hash type") . ': </b>'),
|
||||||
1 => array('kind' => 'select', 'name' => 'posixAccount_pwdHash', 'size' => '1',
|
array('kind' => 'select', 'name' => 'posixAccount_pwdHash', 'size' => '1',
|
||||||
'options' => array("CRYPT", "SHA", "SSHA", "MD5", "SMD5", "PLAIN"), 'options_selected' => array('SSHA')),
|
'options' => array("CRYPT", "SHA", "SSHA", "MD5", "SMD5", "PLAIN"), 'options_selected' => array('SSHA')),
|
||||||
2 => array('kind' => 'text', 'value' => ' '),
|
array('kind' => 'text', 'value' => ' '),
|
||||||
3 => array('kind' => 'text', 'value' => ' '),
|
array('kind' => 'text', 'value' => ' '),
|
||||||
4 => array('kind' => 'text', 'value' => ' '),
|
array('kind' => 'text', 'value' => ' '),
|
||||||
5 => array('kind' => 'help', 'value' => 'pwdHash'))
|
array('kind' => 'help', 'value' => 'pwdHash'))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// profile checks
|
// profile checks
|
||||||
|
@ -153,31 +153,31 @@ class posixAccount extends baseModule {
|
||||||
// configuration options
|
// configuration options
|
||||||
$return['config_options']['user'] = array(
|
$return['config_options']['user'] = array(
|
||||||
array(
|
array(
|
||||||
0 => array('kind' => 'text', 'text' => '<b>' . _("Users") . ': </b>' . _('Minimum UID number') . "*: "),
|
array('kind' => 'text', 'text' => '<b>' . _("Users") . ': </b>' . _('Minimum UID number') . "*: "),
|
||||||
1 => array('kind' => 'input', 'name' => 'posixAccount_minUID', 'type' => 'text', 'size' => '10', 'maxlength' => '255'),
|
array('kind' => 'input', 'name' => 'posixAccount_minUID', 'type' => 'text', 'size' => '10', 'maxlength' => '255'),
|
||||||
2 => array('kind' => 'text', 'value' => ' '),
|
array('kind' => 'text', 'value' => ' '),
|
||||||
3 => array('kind' => 'text', 'text' => _('Maximum UID number') . "*: "),
|
array('kind' => 'text', 'text' => _('Maximum UID number') . "*: "),
|
||||||
4 => array('kind' => 'input', 'name' => 'posixAccount_maxUID', 'type' => 'text', 'size' => '10', 'maxlength' => '255'),
|
array('kind' => 'input', 'name' => 'posixAccount_maxUID', 'type' => 'text', 'size' => '10', 'maxlength' => '255'),
|
||||||
5 => array('kind' => 'help', 'value' => 'minMaxUser'))
|
array('kind' => 'help', 'value' => 'minMaxUser'))
|
||||||
);
|
);
|
||||||
$return['config_options']['host'] = array(
|
$return['config_options']['host'] = array(
|
||||||
array(
|
array(
|
||||||
0 => array('kind' => 'text', 'text' => '<b>' . _("Hosts") . ': </b>' . _('Minimum UID number') . "*: "),
|
array('kind' => 'text', 'text' => '<b>' . _("Hosts") . ': </b>' . _('Minimum UID number') . "*: "),
|
||||||
1 => array('kind' => 'input', 'name' => 'posixAccount_minMachine', 'type' => 'text', 'size' => '10', 'maxlength' => '255'),
|
array('kind' => 'input', 'name' => 'posixAccount_minMachine', 'type' => 'text', 'size' => '10', 'maxlength' => '255'),
|
||||||
2 => array('kind' => 'text', 'value' => ' '),
|
array('kind' => 'text', 'value' => ' '),
|
||||||
3 => array('kind' => 'text', 'text' => _('Maximum UID number') . "*: "),
|
array('kind' => 'text', 'text' => _('Maximum UID number') . "*: "),
|
||||||
4 => array('kind' => 'input', 'name' => 'posixAccount_maxMachine', 'type' => 'text', 'size' => '10', 'maxlength' => '255'),
|
array('kind' => 'input', 'name' => 'posixAccount_maxMachine', 'type' => 'text', 'size' => '10', 'maxlength' => '255'),
|
||||||
5 => array('kind' => 'help', 'value' => 'minMaxHost'))
|
array('kind' => 'help', 'value' => 'minMaxHost'))
|
||||||
);
|
);
|
||||||
$return['config_options']['all'] = array(
|
$return['config_options']['all'] = array(
|
||||||
array(
|
array(
|
||||||
0 => array('kind' => 'text', 'text' => '<b>' . _("Password hash type") . ': </b>'),
|
array('kind' => 'text', 'text' => '<b>' . _("Password hash type") . ': </b>'),
|
||||||
1 => array('kind' => 'select', 'name' => 'posixAccount_pwdHash', 'size' => '1',
|
array('kind' => 'select', 'name' => 'posixAccount_pwdHash', 'size' => '1',
|
||||||
'options' => array("CRYPT", "SHA", "SSHA", "MD5", "SMD5", "PLAIN"), 'options_selected' => array('SSHA')),
|
'options' => array("CRYPT", "SHA", "SSHA", "MD5", "SMD5", "PLAIN"), 'options_selected' => array('SSHA')),
|
||||||
2 => array('kind' => 'text', 'value' => ' '),
|
array('kind' => 'text', 'value' => ' '),
|
||||||
3 => array('kind' => 'text', 'value' => ' '),
|
array('kind' => 'text', 'value' => ' '),
|
||||||
4 => array('kind' => 'text', 'value' => ' '),
|
array('kind' => 'text', 'value' => ' '),
|
||||||
5 => array('kind' => 'help', 'value' => 'pwdHash'))
|
array('kind' => 'help', 'value' => 'pwdHash'))
|
||||||
);
|
);
|
||||||
// upload
|
// upload
|
||||||
$return['upload_preDepends'] = array('inetOrgPerson');
|
$return['upload_preDepends'] = array('inetOrgPerson');
|
||||||
|
@ -492,16 +492,19 @@ class posixAccount extends baseModule {
|
||||||
// remove old memberships
|
// remove old memberships
|
||||||
$dn_groups = $_SESSION['cache']->get_cache('memberUid', 'posixGroup', 'group');
|
$dn_groups = $_SESSION['cache']->get_cache('memberUid', 'posixGroup', 'group');
|
||||||
$DNs = array_keys($dn_groups);
|
$DNs = array_keys($dn_groups);
|
||||||
foreach ($DNs as $DN)
|
foreach ($DNs as $DN) {
|
||||||
if (in_array($this->orig['uid'][0], $dn_groups[$DN]))
|
if (in_array($this->orig['uid'][0], $dn_groups[$DN])) {
|
||||||
$return[$DN]['remove']['memberUid'][0] = $this->orig['uid'][0];
|
$return[$DN]['remove']['memberUid'][0] = $this->orig['uid'][0];
|
||||||
|
}
|
||||||
|
}
|
||||||
// Add new memberships
|
// Add new memberships
|
||||||
if (is_array($this->groups))
|
if (is_array($this->groups)) {
|
||||||
foreach ($this->groups as $group) {
|
foreach ($this->groups as $group) {
|
||||||
$dn = $_SESSION['cache']->in_cache($group, 'cn', 'group');
|
$dn = $_SESSION['cache']->in_cache($group, 'cn', 'group');
|
||||||
$return[$dn]['add']['memberUid'][0] = $this->attributes['uid'][0];
|
$return[$dn]['add']['memberUid'][0] = $this->attributes['uid'][0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
// update groups.
|
// update groups.
|
||||||
$add = array_delete($this->groups_orig, $this->groups);
|
$add = array_delete($this->groups_orig, $this->groups);
|
||||||
|
@ -918,46 +921,46 @@ class posixAccount extends baseModule {
|
||||||
$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 (
|
$return[] = array (
|
||||||
0 => array('kind' => 'text', 'text' => _("User name").'*'),
|
array('kind' => 'text', 'text' => _("User name").'*'),
|
||||||
1 => array('kind' => 'input', 'name' => 'uid', 'type' => 'text', 'size' => '30', 'maxlength' => '20', 'value' => $userName),
|
array('kind' => 'input', 'name' => 'uid', 'type' => 'text', 'size' => '30', 'maxlength' => '20', 'value' => $userName),
|
||||||
2 => array('kind' => 'help', 'value' => 'uid'));
|
array('kind' => 'help', 'value' => 'uid'));
|
||||||
$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 (
|
$return[] = array (
|
||||||
0 => array('kind' => 'text', 'text' => _("Common name").'*'),
|
array('kind' => 'text', 'text' => _("Common name").'*'),
|
||||||
1 => array('kind' => 'input', 'name' => 'cn', 'type' => 'text', 'size' => '30', 'value' => $commonName),
|
array('kind' => 'input', 'name' => 'cn', 'type' => 'text', 'size' => '30', 'value' => $commonName),
|
||||||
2 => array('kind' => 'help', 'value' => 'cn'));
|
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(
|
$return[] = array(
|
||||||
0 => array('kind' => 'text', 'text' => _('UID number').'*'),
|
array('kind' => 'text', 'text' => _('UID number').'*'),
|
||||||
1 => array('kind' => 'input', 'name' => 'uidNumber', 'type' => 'text', 'size' => '6', 'maxlength' => '6', 'value' => $uidNumber),
|
array('kind' => 'input', 'name' => 'uidNumber', 'type' => 'text', 'size' => '6', 'maxlength' => '6', 'value' => $uidNumber),
|
||||||
2 => array('kind' => 'help', 'value' => 'uidNumber'));
|
array('kind' => 'help', 'value' => 'uidNumber'));
|
||||||
$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[] = array(
|
||||||
0 => array('kind' => 'text', 'text' => _('Gecos')),
|
array('kind' => 'text', 'text' => _('Gecos')),
|
||||||
1 => array('kind' => 'input', 'name' => 'gecos', 'type' => 'text', 'size' => '30', 'maxlength' => '255', 'value' => $gecos),
|
array('kind' => 'input', 'name' => 'gecos', 'type' => 'text', 'size' => '30', 'maxlength' => '255', 'value' => $gecos),
|
||||||
2 => array('kind' => 'help', 'value' => 'gecos'));
|
array('kind' => 'help', 'value' => 'gecos'));
|
||||||
$groupSelected = array();
|
$groupSelected = array();
|
||||||
if (isset($this->attributes['gidNumber'][0])) {
|
if (isset($this->attributes['gidNumber'][0])) {
|
||||||
$gid = $_SESSION['cache']->getgrnam($this->attributes['gidNumber'][0]);
|
$gid = $_SESSION['cache']->getgrnam($this->attributes['gidNumber'][0]);
|
||||||
$groupSelected = array($gid);
|
$groupSelected = array($gid);
|
||||||
}
|
}
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'text', 'text' => _('Primary group').'*' ),
|
array('kind' => 'text', 'text' => _('Primary group').'*' ),
|
||||||
1 => array('kind' => 'select', 'name' => 'gidNumber', 'options' => $groups, 'options_selected' => $groupSelected),
|
array('kind' => 'select', 'name' => 'gidNumber', 'options' => $groups, 'options_selected' => $groupSelected),
|
||||||
2 => array('kind' => 'help', 'value' => 'gidNumber'));
|
array('kind' => 'help', 'value' => 'gidNumber'));
|
||||||
|
|
||||||
if ($this->get_scope()=='user') {
|
if ($this->get_scope()=='user') {
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'text', 'text' => _('Additional groups')),
|
array('kind' => 'text', 'text' => _('Additional groups')),
|
||||||
1 => array('kind' => 'input', 'name' => 'form_subpage_posixAccount_group_open', 'type' => 'submit', 'value' => _('Edit groups')),
|
array('kind' => 'input', 'name' => 'form_subpage_posixAccount_group_open', 'type' => 'submit', 'value' => _('Edit groups')),
|
||||||
2 => array('kind' => 'help', 'value' => 'addgroup'));
|
array('kind' => 'help', 'value' => 'addgroup'));
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'text', 'text' => _('Home directory').'*'),
|
array('kind' => 'text', 'text' => _('Home directory').'*'),
|
||||||
1 => array('kind' => 'input', 'name' => 'homeDirectory', 'type' => 'text', 'size' => '30', 'maxlength' => '255', 'value' => $this->attributes['homeDirectory'][0]),
|
array('kind' => 'input', 'name' => 'homeDirectory', 'type' => 'text', 'size' => '30', 'maxlength' => '255', 'value' => $this->attributes['homeDirectory'][0]),
|
||||||
2 => array('kind' => 'help', 'value' => 'homeDirectory'));
|
array('kind' => 'help', 'value' => 'homeDirectory'));
|
||||||
if ($this->getAccountContainer()->isNewAccount && isset($_SESSION['config']->scriptPath) && ($_SESSION['config']->scriptPath != '')) {
|
if ($this->getAccountContainer()->isNewAccount && isset($_SESSION['config']->scriptPath) && ($_SESSION['config']->scriptPath != '')) {
|
||||||
// get list of lamdaemon servers
|
// get list of lamdaemon servers
|
||||||
$lamdaemonServers = explode(";", $_SESSION['config']->get_scriptServers());
|
$lamdaemonServers = explode(";", $_SESSION['config']->get_scriptServers());
|
||||||
|
@ -976,8 +979,8 @@ class posixAccount extends baseModule {
|
||||||
}
|
}
|
||||||
if (!isset($this->attributes['userPassword'][0])) {
|
if (!isset($this->attributes['userPassword'][0])) {
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'text', 'text' => _('Password') ),
|
array('kind' => 'text', 'text' => _('Password') ),
|
||||||
1 => array('kind' => 'input', 'name' => 'form_subpage_posixAccount_password_open', 'type' => 'submit', 'value' => _('Set password')));
|
array('kind' => 'input', 'name' => 'form_subpage_posixAccount_password_open', 'type' => 'submit', 'value' => _('Set password')));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (pwd_is_enabled($this->attributes['userPassword'][0])) {
|
if (pwd_is_enabled($this->attributes['userPassword'][0])) {
|
||||||
|
@ -1000,9 +1003,9 @@ class posixAccount extends baseModule {
|
||||||
}
|
}
|
||||||
if (count($shelllist)!=0) {
|
if (count($shelllist)!=0) {
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'text', 'text' => _('Login shell').'*'),
|
array('kind' => 'text', 'text' => _('Login shell').'*'),
|
||||||
1 => array('kind' => 'select', 'name' => 'loginShell', 'options' => $shelllist, 'options_selected' => array ($this->attributes['loginShell'][0])),
|
array('kind' => 'select', 'name' => 'loginShell', 'options' => $shelllist, 'options_selected' => array ($this->attributes['loginShell'][0])),
|
||||||
2 => array('kind' => 'help', 'value' => 'loginShell'));
|
array('kind' => 'help', 'value' => 'loginShell'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
|
@ -1011,9 +1014,9 @@ class posixAccount extends baseModule {
|
||||||
function display_html_delete() {
|
function display_html_delete() {
|
||||||
if ($this->get_scope() == 'user' && isset($_SESSION['config']->scriptPath)) {
|
if ($this->get_scope() == 'user' && isset($_SESSION['config']->scriptPath)) {
|
||||||
$return[] = array (
|
$return[] = array (
|
||||||
0 => array('kind' => 'text', 'text' => _('Delete home directory')),
|
array('kind' => 'text', 'text' => _('Delete home directory')),
|
||||||
1 => array('kind' => 'input', 'name' => 'deletehomedir', 'type' => 'checkbox'),
|
array('kind' => 'input', 'name' => 'deletehomedir', 'type' => 'checkbox'),
|
||||||
2 => array('kind' => 'help', 'value' => 'deletehomedir'));
|
array('kind' => 'help', 'value' => 'deletehomedir'));
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
@ -1039,27 +1042,27 @@ class posixAccount extends baseModule {
|
||||||
$groups = array_flip($groups);
|
$groups = array_flip($groups);
|
||||||
|
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'fieldset', 'legend' => _("Additional groups"), 'value' => array(
|
array('kind' => 'fieldset', 'legend' => _("Additional groups"), 'value' => array(
|
||||||
0 => array(
|
array(
|
||||||
0 => array('kind' => 'fieldset', 'td' => array('valign' => 'top'), 'legend' => _("Selected groups"), 'value' => array(
|
array('kind' => 'fieldset', 'td' => array('valign' => 'top'), 'legend' => _("Selected groups"), 'value' => array(
|
||||||
0 => array (
|
array (
|
||||||
0 => array('kind' => 'select', 'name' => 'removegroups', 'size' => '15', 'multiple' => true, 'options' => $this->groups)))),
|
array('kind' => 'select', 'name' => 'removegroups', 'size' => '15', 'multiple' => true, 'options' => $this->groups)))),
|
||||||
1 => array('kind' => 'table', 'value' => array(
|
array('kind' => 'table', 'value' => array(
|
||||||
0 => array(
|
array(
|
||||||
0 => array('kind' => 'input', 'type' => 'submit', 'name' => 'addgroups_button', 'value' => '<=', 'td' => array('align' => 'center'))),
|
array('kind' => 'input', 'type' => 'submit', 'name' => 'addgroups_button', 'value' => '<=', 'td' => array('align' => 'center'))),
|
||||||
1 => array(
|
array(
|
||||||
0 => array ( 'kind' => 'input', 'type' => 'submit', 'name' => 'removegroups_button', 'value' => '=>', 'td' => array('align' => 'center'))),
|
array ( 'kind' => 'input', 'type' => 'submit', 'name' => 'removegroups_button', 'value' => '=>', 'td' => array('align' => 'center'))),
|
||||||
2 => array(
|
array(
|
||||||
0 => array ( 'kind' => 'help', 'value' => 'addgroup', 'td' => array('align' => 'center'))))),
|
array ( 'kind' => 'help', 'value' => 'addgroup', 'td' => array('align' => 'center'))))),
|
||||||
2 => array('kind' => 'fieldset', 'td' => array('valign' => 'top'), 'legend' => _("Available groups"), 'value' => array(
|
array('kind' => 'fieldset', 'td' => array('valign' => 'top'), 'legend' => _("Available groups"), 'value' => array(
|
||||||
0 => array(
|
array(
|
||||||
0 => array('kind' => 'select', 'name' => 'addgroups', 'size' => '15', 'multiple' => true, 'options' => $groups))))
|
array('kind' => 'select', 'name' => 'addgroups', 'size' => '15', 'multiple' => true, 'options' => $groups))))
|
||||||
))));
|
))));
|
||||||
|
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Back'), 'name' => 'form_subpage_posixAccount_attributes_back'),
|
array('kind' => 'input', 'type' => 'submit', 'value' => _('Back'), 'name' => 'form_subpage_posixAccount_attributes_back'),
|
||||||
1 => array('kind' => 'text'),
|
array('kind' => 'text'),
|
||||||
2 => array('kind' => 'text'));
|
array('kind' => 'text'));
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1070,18 +1073,18 @@ class posixAccount extends baseModule {
|
||||||
*/
|
*/
|
||||||
function display_html_password() {
|
function display_html_password() {
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'text', 'text' => _('Password') ),
|
array('kind' => 'text', 'text' => _('Password') ),
|
||||||
1 => array('kind' => 'input', 'name' => 'userPassword', 'type' => 'password', 'size' => '20', 'maxlength' => '255', 'value' => ""),
|
array('kind' => 'input', 'name' => 'userPassword', 'type' => 'password', 'size' => '20', 'maxlength' => '255', 'value' => ""),
|
||||||
2 => array('kind' => 'help', 'value' => 'userPassword'));
|
array('kind' => 'help', 'value' => 'userPassword'));
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'text', 'text' => _('Repeat password')),
|
array('kind' => 'text', 'text' => _('Repeat password')),
|
||||||
1 => array('kind' => 'input', 'name' => 'userPassword2', 'type' => 'password', 'size' => '20', 'maxlength' => '255', 'value' => ""));
|
array('kind' => 'input', 'name' => 'userPassword2', 'type' => 'password', 'size' => '20', 'maxlength' => '255', 'value' => ""));
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'table', 'value' => array(
|
array('kind' => 'table', 'value' => array(
|
||||||
0 => array(
|
array(
|
||||||
0 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Ok'), 'name' => 'form_subpage_posixAccount_attributes_submit'),
|
array('kind' => 'input', 'type' => 'submit', 'value' => _('Ok'), 'name' => 'form_subpage_posixAccount_attributes_submit'),
|
||||||
1 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Cancel'), 'name' => 'form_subpage_posixAccount_attributes_back'),
|
array('kind' => 'input', 'type' => 'submit', 'value' => _('Cancel'), 'name' => 'form_subpage_posixAccount_attributes_back'),
|
||||||
2 => array('kind' => 'text')))));
|
array('kind' => 'text')))));
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1096,27 +1099,31 @@ class posixAccount extends baseModule {
|
||||||
$groups = $_SESSION['cache']->findgroups(); // list of all groupnames
|
$groups = $_SESSION['cache']->findgroups(); // list of all groupnames
|
||||||
$shelllist = getshells(); // list of all valid shells
|
$shelllist = getshells(); // list of all valid shells
|
||||||
// primary Unix group
|
// primary Unix group
|
||||||
$return[] = array(0 => array('kind' => 'text', 'text' => _('Primary group') . ": "),
|
$return[] = array(
|
||||||
1 => array('kind' => 'select', 'name' => 'posixAccount_primaryGroup', 'options' => $groups, 'options_selected' => array(), 'size' => 1),
|
array('kind' => 'text', 'text' => _('Primary group') . ": "),
|
||||||
2 => array('kind' => 'help', 'value' => 'gidNumber', 'scope' => 'user'));
|
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(0 => array('kind' => 'text', 'text' => _('Additional groups') . ": "),
|
$return[] = array(
|
||||||
1 => array('kind' => 'select', 'name' => 'posixAccount_additionalGroup', 'options' => $groups,
|
array('kind' => 'text', 'text' => _('Additional groups') . ": "),
|
||||||
|
array('kind' => 'select', 'name' => 'posixAccount_additionalGroup', 'options' => $groups,
|
||||||
'options_selected' => array(), 'size' => 10, 'multiple' => true),
|
'options_selected' => array(), 'size' => 10, 'multiple' => true),
|
||||||
2 => array('kind' => 'help', 'value' => 'addgroup', 'scope' => 'user'));
|
array('kind' => 'help', 'value' => 'addgroup', 'scope' => 'user'));
|
||||||
// home directory
|
// home directory
|
||||||
$return[] = array(0 => array('kind' => 'text', 'text' => _('Home directory') . ": "),
|
$return[] = array(
|
||||||
1 => array('kind' => 'input', 'name' => 'posixAccount_homeDirectory', 'type' => 'text', 'size' => '30', 'maxlength' => '255', 'value' => '/home/$user'),
|
array('kind' => 'text', 'text' => _('Home directory') . ": "),
|
||||||
2 => array('kind' => 'help', 'value' => 'homeDirectory', 'scope' => 'user'));
|
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(0 => array('kind' => 'text', 'text' => _('Login shell') . ": "),
|
$return[] = array(
|
||||||
1 => array('kind' => 'select', 'name' => 'posixAccount_loginShell', 'options' => $shelllist, 'options_selected' => array("/bin/bash")),
|
array('kind' => 'text', 'text' => _('Login shell') . ": "),
|
||||||
2 => array('kind' => 'help', 'value' => 'loginShell', 'scope' => 'user'));
|
array('kind' => 'select', 'name' => 'posixAccount_loginShell', 'options' => $shelllist, 'options_selected' => array("/bin/bash")),
|
||||||
|
array('kind' => 'help', 'value' => 'loginShell', 'scope' => 'user'));
|
||||||
}
|
}
|
||||||
elseif ($this->get_scope() == 'host') {
|
elseif ($this->get_scope() == 'host') {
|
||||||
$groups = $_SESSION['cache']->findgroups(); // list of all groupnames
|
$groups = $_SESSION['cache']->findgroups(); // list of all groupnames
|
||||||
// primary Unix group
|
// primary Unix group
|
||||||
$return[] = array(0 => array('kind' => 'text', 'text' => _('Primary group') . ": "),
|
$return[] = array(array('kind' => 'text', 'text' => _('Primary group') . ": "),
|
||||||
1 => array('kind' => 'select', 'name' => 'posixAccount_primaryGroup', 'options' => $groups, 'options_selected' => array(), 'size' => 1),
|
1 => array('kind' => 'select', 'name' => 'posixAccount_primaryGroup', 'options' => $groups, 'options_selected' => array(), 'size' => 1),
|
||||||
2 => array('kind' => 'help', 'value' => 'gidNumber', 'scope' => 'host'));
|
2 => array('kind' => 'help', 'value' => 'gidNumber', 'scope' => 'host'));
|
||||||
}
|
}
|
||||||
|
@ -1662,10 +1669,10 @@ class posixAccount extends baseModule {
|
||||||
$return = array();
|
$return = array();
|
||||||
if (in_array('password', $fields)) {
|
if (in_array('password', $fields)) {
|
||||||
$return['password'] = array(
|
$return['password'] = array(
|
||||||
0 => array('kind' => 'text', 'text' => _('New password')),
|
array('kind' => 'text', 'text' => _('New password')),
|
||||||
1 => array('kind' => 'input', 'name' => 'posixAccount_password', 'type' => 'password', 'size' => '30', 'maxlength' => '255'),
|
array('kind' => 'input', 'name' => 'posixAccount_password', 'type' => 'password', 'size' => '30', 'maxlength' => '255'),
|
||||||
2 => array('kind' => 'text', 'text' => _('Reenter password')),
|
array('kind' => 'text', 'text' => _('Reenter password')),
|
||||||
3 => array('kind' => 'input', 'name' => 'posixAccount_password2', 'type' => 'password', 'size' => '30', 'maxlength' => '255')
|
array('kind' => 'input', 'name' => 'posixAccount_password2', 'type' => 'password', 'size' => '30', 'maxlength' => '255')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
|
|
Loading…
Reference in New Issue