allow to set no drive letter
This commit is contained in:
parent
d217dd78b3
commit
3495c51e9d
|
@ -131,7 +131,6 @@ class sambaSamAccount extends baseModule {
|
||||||
'error_message' => $this->messages['logonHours'][0]);
|
'error_message' => $this->messages['logonHours'][0]);
|
||||||
// profile mappings
|
// profile mappings
|
||||||
$return['profile_mappings'] = array(
|
$return['profile_mappings'] = array(
|
||||||
'sambaSamAccount_sambaHomeDrive' => 'sambaHomeDrive',
|
|
||||||
'sambaSamAccount_smbhome' => 'sambaHomePath',
|
'sambaSamAccount_smbhome' => 'sambaHomePath',
|
||||||
'sambaSamAccount_profilePath' => 'sambaProfilePath',
|
'sambaSamAccount_profilePath' => 'sambaProfilePath',
|
||||||
'sambaSamAccount_logonScript' => 'sambaLogonScript',
|
'sambaSamAccount_logonScript' => 'sambaLogonScript',
|
||||||
|
@ -556,7 +555,10 @@ class sambaSamAccount extends baseModule {
|
||||||
$this->attributes['sambaPwdMustChange'][0] = mktime($post['sambaPwdMustChange_h'], $post['sambaPwdMustChange_m'], $post['sambaPwdMustChange_s'],
|
$this->attributes['sambaPwdMustChange'][0] = mktime($post['sambaPwdMustChange_h'], $post['sambaPwdMustChange_m'], $post['sambaPwdMustChange_s'],
|
||||||
$post['sambaPwdMustChange_mon'], $post['sambaPwdMustChange_day'], $post['sambaPwdMustChange_yea']);
|
$post['sambaPwdMustChange_mon'], $post['sambaPwdMustChange_day'], $post['sambaPwdMustChange_yea']);
|
||||||
$this->attributes['sambaHomePath'][0] = $post['sambaHomePath'];
|
$this->attributes['sambaHomePath'][0] = $post['sambaHomePath'];
|
||||||
$this->attributes['sambaHomeDrive'][0] = $post['sambaHomeDrive'];
|
if ($post['sambaHomeDrive'] == "-")
|
||||||
|
$this->attributes['sambaHomeDrive'][0] = '';
|
||||||
|
else
|
||||||
|
$this->attributes['sambaHomeDrive'][0] = $post['sambaHomeDrive'];
|
||||||
$this->attributes['sambaLogonScript'][0] = $post['sambaLogonScript'];
|
$this->attributes['sambaLogonScript'][0] = $post['sambaLogonScript'];
|
||||||
$this->attributes['sambaProfilePath'][0] = $post['sambaProfilePath'];
|
$this->attributes['sambaProfilePath'][0] = $post['sambaProfilePath'];
|
||||||
$rids = array_keys($this->rids);
|
$rids = array_keys($this->rids);
|
||||||
|
@ -800,9 +802,15 @@ class sambaSamAccount extends baseModule {
|
||||||
2 => array ( 'kind' => 'select', 'name' => 'sambaPwdMustChange_yea',
|
2 => array ( 'kind' => 'select', 'name' => 'sambaPwdMustChange_yea',
|
||||||
'options' => $year, 'options_selected' => array($mustchangedate['year']))))),
|
'options' => $year, 'options_selected' => array($mustchangedate['year']))))),
|
||||||
2 => array ( 'kind' => 'help', 'value' => 'pwdMustChange' ));
|
2 => array ( 'kind' => 'help', 'value' => 'pwdMustChange' ));
|
||||||
|
|
||||||
|
$drives = array('-');
|
||||||
for ($i=90; $i>67; $i--) $drives[] = chr($i).':';
|
for ($i=90; $i>67; $i--) $drives[] = chr($i).':';
|
||||||
|
if ($this->attributes['sambaHomeDrive'][0]) {
|
||||||
|
$selected = array ($this->attributes['sambaHomeDrive'][0]);
|
||||||
|
}
|
||||||
|
else $selected = array('-');
|
||||||
$return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Home drive') ),
|
$return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Home drive') ),
|
||||||
1 => array ( 'kind' => 'select', 'name' => 'sambaHomeDrive', 'options' => $drives, 'options_selected' => array ($this->attributes['sambaHomeDrive'][0])),
|
1 => array ( 'kind' => 'select', 'name' => 'sambaHomeDrive', 'options' => $drives, 'options_selected' => $selected),
|
||||||
2 => array ( 'kind' => 'help', 'value' => 'homeDrive' ));
|
2 => array ( 'kind' => 'help', 'value' => 'homeDrive' ));
|
||||||
$return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Home path') ),
|
$return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Home path') ),
|
||||||
1 => array ( 'kind' => 'input', 'type' => 'text', 'name' => 'sambaHomePath', 'size' => '20', 'maxlength' => '255', 'value' => $this->attributes['sambaHomePath'][0]),
|
1 => array ( 'kind' => 'input', 'type' => 'text', 'name' => 'sambaHomePath', 'size' => '20', 'maxlength' => '255', 'value' => $this->attributes['sambaHomePath'][0]),
|
||||||
|
@ -819,6 +827,8 @@ class sambaSamAccount extends baseModule {
|
||||||
|
|
||||||
$names = array_keys($this->rids);
|
$names = array_keys($this->rids);
|
||||||
$wrid=false;
|
$wrid=false;
|
||||||
|
$options = array();
|
||||||
|
$selected = array();
|
||||||
for ($i=0; $i<count($names); $i++) {
|
for ($i=0; $i<count($names); $i++) {
|
||||||
if ($this->attributes['sambaPrimaryGroupSID'][0]==$SID."-".$this->rids[$names[$i]]) {
|
if ($this->attributes['sambaPrimaryGroupSID'][0]==$SID."-".$this->rids[$names[$i]]) {
|
||||||
$selected[] = $names[$i];
|
$selected[] = $names[$i];
|
||||||
|
@ -1014,11 +1024,11 @@ class sambaSamAccount extends baseModule {
|
||||||
2 => array('kind' => 'help', 'value' => 'deactivated')
|
2 => array('kind' => 'help', 'value' => 'deactivated')
|
||||||
);
|
);
|
||||||
// letter of home drive
|
// letter of home drive
|
||||||
$drives = array();
|
$drives = array('-');
|
||||||
for ($i = 90; $i > 67; $i--) $drives[] = chr($i) . ':';
|
for ($i = 90; $i > 67; $i--) $drives[] = chr($i) . ':';
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'text', 'text' => _('Home drive') . ': '),
|
0 => array('kind' => 'text', 'text' => _('Home drive') . ': '),
|
||||||
1 => array('kind' => 'select', 'name' => 'sambaSamAccount_sambaHomeDrive', 'options' => $drives, 'options_selected' => array('Z:')),
|
1 => array('kind' => 'select', 'name' => 'sambaSamAccount_sambaHomeDrive', 'options' => $drives, 'options_selected' => array('-')),
|
||||||
2 => array('kind' => 'help', 'value' => 'homeDrive')
|
2 => array('kind' => 'help', 'value' => 'homeDrive')
|
||||||
);
|
);
|
||||||
// path to home directory
|
// path to home directory
|
||||||
|
@ -1116,6 +1126,13 @@ class sambaSamAccount extends baseModule {
|
||||||
elseif ($profile['sambaSamAccount_sambaAcctFlagsD'][0] == "false") {
|
elseif ($profile['sambaSamAccount_sambaAcctFlagsD'][0] == "false") {
|
||||||
$this->deactivated = false;
|
$this->deactivated = false;
|
||||||
}
|
}
|
||||||
|
// home drive
|
||||||
|
if ($profile['sambaSamAccount_sambaHomeDrive'][0] == "-") {
|
||||||
|
$this->attributes['sambaHomeDrive'][0] = '';
|
||||||
|
}
|
||||||
|
elseif ($profile['sambaSamAccount_sambaHomeDrive'][0]) {
|
||||||
|
$this->attributes['sambaHomeDrive'][0] = $profile['sambaSamAccount_sambaHomeDrive'][0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue