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,73 +623,88 @@ class sambaSamAccount {
function get_profileOptions() { function get_profileOptions() {
$return = array(); $return = array();
// use Unix password as Samba password if ($_SESSION[$this->base]->type=='user') {
$return[] = array( // use Unix password as Samba password
0 => array('kind' => 'text', 'text' => _('Use unix password') . ': '), $return[] = array(
1 => array('kind' => 'input', 'name' => 'sambaSamAccount_useunixpwd', 'type' => 'checkbox', 'checked' => true), 0 => array('kind' => 'text', 'text' => _('Use unix password') . ': '),
2 => array('kind' => 'help', 'value' => 'TODO') 1 => array('kind' => 'input', 'name' => 'sambaSamAccount_useunixpwd', 'type' => 'checkbox', 'checked' => true),
); 2 => array('kind' => 'help', 'value' => 'TODO')
// use no password at all );
$return[] = array( // use no password at all
0 => array('kind' => 'text', 'text' => _('Use no password') . ': '), $return[] = array(
1 => array('kind' => 'input', 'name' => 'sambaSamAccount_sambaAcctFlagsN', 'type' => 'checkbox', 'checked' => false), 0 => array('kind' => 'text', 'text' => _('Use no password') . ': '),
2 => array('kind' => 'help', 'value' => 'TODO') 1 => array('kind' => 'input', 'name' => 'sambaSamAccount_sambaAcctFlagsN', 'type' => 'checkbox', 'checked' => false),
); 2 => array('kind' => 'help', 'value' => 'TODO')
// password never expires );
$return[] = array( // password never expires
0 => array('kind' => 'text', 'text' => _('Password does not expire') . ': '), $return[] = array(
1 => array('kind' => 'input', 'name' => 'sambaSamAccount_sambaAcctFlagsX', 'type' => 'checkbox', 'checked' => true), 0 => array('kind' => 'text', 'text' => _('Password does not expire') . ': '),
2 => array('kind' => 'help', 'value' => 'TODO') 1 => array('kind' => 'input', 'name' => 'sambaSamAccount_sambaAcctFlagsX', 'type' => 'checkbox', 'checked' => true),
); 2 => array('kind' => 'help', 'value' => 'TODO')
// account deactivation );
$return[] = array( // account deactivation
0 => array('kind' => 'text', 'text' => _('Account is deactivated') . ': '), $return[] = array(
1 => array('kind' => 'input', 'name' => 'sambaSamAccount_sambaAcctFlagsD', 'type' => 'checkbox', 'checked' => false), 0 => array('kind' => 'text', 'text' => _('Account is deactivated') . ': '),
2 => array('kind' => 'help', 'value' => 'TODO') 1 => array('kind' => 'input', 'name' => 'sambaSamAccount_sambaAcctFlagsD', 'type' => 'checkbox', 'checked' => false),
); 2 => array('kind' => 'help', 'value' => 'TODO')
// letter of home drive );
$drives = array(); // letter of home drive
for ($i = 90; $i > 67; $i--) $drives[] = chr($i) . ':'; $drives = array();
$return[] = array( for ($i = 90; $i > 67; $i--) $drives[] = chr($i) . ':';
0 => array('kind' => 'text', 'text' => _('Home drive') . ': '), $return[] = array(
1 => array('kind' => 'select', 'name' => 'sambaSamAccount_sambaHomeDrive', 'options' => $drives, 'options_selected' => array('Z:')), 0 => array('kind' => 'text', 'text' => _('Home drive') . ': '),
2 => array('kind' => 'help', 'value' => 'TODO') 1 => array('kind' => 'select', 'name' => 'sambaSamAccount_sambaHomeDrive', 'options' => $drives, 'options_selected' => array('Z:')),
); 2 => array('kind' => 'help', 'value' => 'TODO')
// path to home directory );
$return[] = array( // path to home directory
0 => array('kind' => 'text', 'text' => _('Home path') . ': '), $return[] = array(
1 => array('kind' => 'input', 'type' => 'text', 'name' => 'sambaSamAccount_sambaHomePath', 'size' => '20', 'maxlength' => '255', 'value' => ''), 0 => array('kind' => 'text', 'text' => _('Home path') . ': '),
2 => array('kind' => 'help', 'value' => 'TODO') 1 => array('kind' => 'input', 'type' => 'text', 'name' => 'sambaSamAccount_sambaHomePath', 'size' => '20', 'maxlength' => '255', 'value' => ''),
); 2 => array('kind' => 'help', 'value' => 'TODO')
// profile path );
$return[] = array( // profile path
0 => array('kind' => 'text', 'text' => _('Profile path') . ': '), $return[] = array(
1 => array('kind' => 'input', 'type' => 'text', 'name' => 'sambaSamAccount_sambaProfilePath', 'size' => '20', 'maxlength' => '255', 'value' => ''), 0 => array('kind' => 'text', 'text' => _('Profile path') . ': '),
2 => array('kind' => 'help', 'value' => 'TODO') 1 => array('kind' => 'input', 'type' => 'text', 'name' => 'sambaSamAccount_sambaProfilePath', 'size' => '20', 'maxlength' => '255', 'value' => ''),
); 2 => array('kind' => 'help', 'value' => 'TODO')
// logon script );
$return[] = array( // logon script
0 => array('kind' => 'text', 'text' => _('Logon script') . ': '), $return[] = array(
1 => array('kind' => 'input', 'type' => 'text', 'name' => 'sambaSamAccount_sambaLogonScript', 'size' => '20', 'maxlength' => '255', 'value' => ''), 0 => array('kind' => 'text', 'text' => _('Logon script') . ': '),
2 => array('kind' => 'help', 'value' => 'TODO') 1 => array('kind' => 'input', 'type' => 'text', 'name' => 'sambaSamAccount_sambaLogonScript', 'size' => '20', 'maxlength' => '255', 'value' => ''),
); 2 => array('kind' => 'help', 'value' => 'TODO')
// allowed workstations );
$return[] = array( // allowed workstations
0 => array('kind' => 'text', 'text' => _('Samba workstations') . ': '), $return[] = array(
1 => array('kind' => 'input', 'type' => 'text', 'name' => 'sambaSamAccount_sambaUserWorkstations', 'value' => ''), 0 => array('kind' => 'text', 'text' => _('Samba workstations') . ': '),
2 => array('kind' => 'help', 'value' => 'TODO') 1 => array('kind' => 'input', 'type' => 'text', 'name' => 'sambaSamAccount_sambaUserWorkstations', 'value' => ''),
); 2 => array('kind' => 'help', 'value' => 'TODO')
// domains );
$sambaDomains = $_SESSION['ldap']->search_domains($_SESSION['config']->get_domainSuffix()); // domains
$sambaDomainNames = array(); $sambaDomains = $_SESSION['ldap']->search_domains($_SESSION['config']->get_domainSuffix());
for ($i = 0; $i < count($sambaDomains); $i++) { $sambaDomainNames = array();
$sambaDomainNames[] = $sambaDomains[$i]->name; 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')
);
}
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[] = 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;
} }