updated profile options

This commit is contained in:
Roland Gruber 2004-04-11 13:07:24 +00:00
parent 1508049bbf
commit 2cf5aeea93
4 changed files with 167 additions and 78 deletions

View File

@ -585,12 +585,9 @@ class posixGroup {
return $return; return $return;
} }
// posixGroup has no profile options
function get_profileOptions() { function get_profileOptions() {
$return = array(); return array();
$return[] = array (0 => array ( 'kind' => 'text', 'text' => _("Groupname")),
1 => array ('kind' => 'input', 'name' => 'cn', 'type' => 'text', 'size' => '20', 'maxlength' => '20'),
2 => array ('kind' => 'help', 'value' => 'cn'));
return $return;
} }
// checks if the values of a new or modified profile are valid // checks if the values of a new or modified profile are valid

View File

@ -608,9 +608,78 @@ class sambaAccount {
function get_profileOptions() { function get_profileOptions() {
$return = array(); $return = array();
$return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Domain') ), if ($_SESSION[$this->base]->type=='user') {
1 => array ( 'kind' => 'input', 'type' => 'text', 'name' => 'domain', 'size' => '20', 'maxlength' => '255', 'value' => $this->attributes['domain'][0]), // set Unix password for Samba
2 => array ( 'kind' => 'help', 'value' => 'domain' )); $return[] = array(
0 => array('kind' => 'text', 'text' => _('Use unix password') . ': '),
1 => array('kind' => 'input', 'name' => 'sambaAccount_useunixpwd', 'type' => 'checkbox', 'checked' => true),
2 => array('kind' => 'help', 'value' => 'TODO')
);
// set no password
$return[] = array(
0 => array('kind' => 'text', 'text' => _('Use no password') . ': '),
1 => array('kind' => 'input', 'name' => 'sambaAccount_acctFlagsN', 'type' => 'checkbox', 'checked' => false),
2 => array('kind' => 'help', 'value' => 'TODO')
);
// password expiry
$return[] = array(
0 => array('kind' => 'text', 'text' => _('Password does not expire') . ': '),
1 => array('kind' => 'input', 'name' => 'sambaAccount_acctFlagsX', 'type' => 'checkbox', 'checked' => true),
2 => array('kind' => 'help', 'value' => 'TODO')
);
// account deactivation
$return[] = array(
0 => array('kind' => 'text', 'text' => _('Account is deactivated') . ': '),
1 => array('kind' => 'input', 'name' => 'sambaAccount_acctFlagsD', 'type' => 'checkbox', 'checked' => false),
2 => array('kind' => 'help', 'value' => 'TODO')
);
// drive letter
$drives = array();
for ($i = 90; $i > 67; $i--) $drives[] = chr($i) . ':';
$return[] = array(
0 => array('kind' => 'text', 'text' => _('Home drive') . ': '),
1 => array('kind' => 'select', 'name' => 'sambaAccount_homeDrive', 'options' => $drives, 'options_selected' => array ('Z:')),
2 => array('kind' => 'help', 'value' => 'TODO')
);
// path to home directory
$return[] = array(
0 => array('kind' => 'text', 'text' => _('Home path') . ': '),
1 => array('kind' => 'input', 'type' => 'text', 'name' => 'sambaAccount_smbHome', 'size' => '20', 'maxlength' => '255', 'value' => ''),
2 => array('kind' => 'help', 'value' => 'TODO')
);
// path to profile
$return[] = array(
0 => array('kind' => 'text', 'text' => _('Profile path') . ': '),
1 => array('kind' => 'input', 'type' => 'text', 'name' => 'sambaAccount_profilePath', 'size' => '20', 'maxlength' => '255', 'value' => ''),
2 => array('kind' => 'help', 'value' => 'TODO')
);
// logon script
$return[] = array(
0 => array('kind' => 'text', 'text' => _('Logon script') . ': '),
1 => array('kind' => 'input', 'type' => 'text', 'name' => 'sambaAccount_scriptPath', 'size' => '20', 'maxlength' => '255', 'value' => ''),
2 => array('kind' => 'help', 'value' => 'TODO')
);
// allowed workstations
$return[] = array(
0 => array('kind' => 'text', 'text' => _('Samba workstations') . ': '),
1 => array('kind' => 'input', 'type' => 'text', 'name' => 'sambaAccount_userWorkstations', 'value' => ''),
2 => array('kind' => 'help', 'value' => 'TODO')
);
// Samba domain
$return[] = array(
0 => array('kind' => 'text', 'text' => _('Domain') . ': '),
1 => array('kind' => 'input', 'type' => 'text', 'name' => 'sambaAccount_domain', 'size' => '20', 'maxlength' => '255', 'value' => ''),
2 => array('kind' => 'help', 'value' => 'TODO')
);
}
elseif ($_SESSION[$this->base]->type=='user') {
// Samba domain
$return[] = array(
0 => array('kind' => 'text', 'text' => _('Domain') . ': '),
1 => array('kind' => 'input', 'type' => 'text', 'name' => 'sambaAccount_domain', 'size' => '20', 'maxlength' => '255', 'value' => ''),
2 => array('kind' => 'help', 'value' => 'TODO')
);
}
return $return; return $return;
} }

View File

@ -307,10 +307,18 @@ class sambaGroupMapping {
function get_profileOptions() { function get_profileOptions() {
$return = array(); $return = array();
// TODO fill in correct domains // get list of domains
$return[] = array (0 => array ('kind' => 'text', 'text' => _('Domain')), $sambaDomains = $_SESSION['ldap']->search_domains($_SESSION['config']->get_domainSuffix());
1 => array ('kind' => 'select', 'name' => 'sambaDomainName', 'options' => $sambaDomainNames), $sambaDomainNames = array();
2 => array ('kind' => 'help', 'value' => 'sambaDomainName' )); for ($i = 0; $i < count($sambaDomains); $i++ ) {
// extract names
$sambaDomainNames[] = $sambaDomains[$i]->name;
}
// domain
$return[] = array (
0 => array('kind' => 'text', 'text' => _('Domain')),
1 => array('kind' => 'select', 'name' => 'sambaDomainName', 'options' => $sambaDomainNames, 'options_selected' => array ()),
2 => array('kind' => 'help', 'value' => 'sambaDomainName' ));
return $return; return $return;
} }

View File

@ -623,6 +623,7 @@ class sambaSamAccount {
function get_profileOptions() { function get_profileOptions() {
$return = array(); $return = array();
if ($_SESSION[$this->base]->type=='user') {
// use Unix password as Samba password // use Unix password as Samba password
$return[] = array( $return[] = array(
0 => array('kind' => 'text', 'text' => _('Use unix password') . ': '), 0 => array('kind' => 'text', 'text' => _('Use unix password') . ': '),
@ -690,6 +691,20 @@ class sambaSamAccount {
1 => array('kind' => 'select', 'name' => 'sambaSamAccount_sambaDomainName', 'options' => $sambaDomainNames, 'options_selected' => array()), 1 => array('kind' => 'select', 'name' => 'sambaSamAccount_sambaDomainName', 'options' => $sambaDomainNames, 'options_selected' => array()),
2 => array('kind' => 'help', 'value' => 'TODO') 2 => array('kind' => 'help', 'value' => 'TODO')
); );
}
elseif ($_SESSION[$this->base]->type=='host') {
// domains
$sambaDomains = $_SESSION['ldap']->search_domains($_SESSION['config']->get_domainSuffix());
$sambaDomainNames = array();
for ($i = 0; $i < count($sambaDomains); $i++) {
$sambaDomainNames[] = $sambaDomains[$i]->name;
}
$return[] = array(
0 => array('kind' => 'text', 'text' => _('Domain') . ': '),
1 => array('kind' => 'select', 'name' => 'sambaSamAccount_sambaDomainName', 'options' => $sambaDomainNames, 'options_selected' => array()),
2 => array('kind' => 'help', 'value' => 'TODO')
);
}
return $return; return $return;
} }