get domain name from sambaSID not sambaDomainName

This commit is contained in:
Roland Gruber 2005-08-12 12:44:13 +00:00
parent 2221165957
commit 1c1afe71be
1 changed files with 8 additions and 8 deletions

View File

@ -709,13 +709,17 @@ class sambaSamAccount extends baseModule {
* It will output a complete html-table * It will output a complete html-table
*/ */
function display_html_attributes(&$post) { function display_html_attributes(&$post) {
// Get Domain SID from name // Get Domain SID from user SID
if ($this->attributes['sambaSID'][0]!='')
$domainSID = substr($this->attributes['sambaSID'][0], 0, strrpos($this->attributes['sambaSID'][0], "-"));
$sambaDomains = search_domains($_SESSION['config']->get_Suffix('domain')); $sambaDomains = search_domains($_SESSION['config']->get_Suffix('domain'));
for ($i=0; $i<count($sambaDomains); $i++ ) { for ($i=0; $i<count($sambaDomains); $i++ ) {
$sambaDomainNames[] = $sambaDomains[$i]->name; $sambaDomainNames[] = $sambaDomains[$i]->name;
if ($this->attributes['sambaDomainName'][0] == $sambaDomains[$i]->name) if ($domainSID == $sambaDomains[$i]->SID) {
$SID = $sambaDomains[$i]->SID; $SID = $domainSID;
$sel_domain = $sambaDomains[$i]->name;
} }
}
$canchangedate = getdate($this->attributes['sambaPwdCanChange'][0]); $canchangedate = getdate($this->attributes['sambaPwdCanChange'][0]);
$mustchangedate = getdate($this->attributes['sambaPwdMustChange'][0]); $mustchangedate = getdate($this->attributes['sambaPwdMustChange'][0]);
@ -815,12 +819,8 @@ class sambaSamAccount extends baseModule {
1 => array ( 'kind' => 'select', 'name' => 'sambaSID', 'options' => $options, 'options_selected' => $selected), 1 => array ( 'kind' => 'select', 'name' => 'sambaSID', 'options' => $options, 'options_selected' => $selected),
2 => array ( 'kind' => 'help', 'value' => 'sambaSID' )); 2 => array ( 'kind' => 'help', 'value' => 'sambaSID' ));
} }
$selectedDomain = array();
if (in_array($this->attributes['sambaDomainName'][0], $sambaDomainNames)) {
$selectedDomain = array($this->attributes['sambaDomainName'][0]);
}
$return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Domain') ), $return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Domain') ),
1 => array ( 'kind' => 'select', 'name' => 'sambaDomainName', 'options' => $sambaDomainNames, 'options_selected' => $selectedDomain), 1 => array ( 'kind' => 'select', 'name' => 'sambaDomainName', 'options' => $sambaDomainNames, 'options_selected' => array($sel_domain)),
2 => array ( 'kind' => 'help', 'value' => 'sambaDomainName' )); 2 => array ( 'kind' => 'help', 'value' => 'sambaDomainName' ));
// logon hours // logon hours
if ($_SESSION[$this->base]->type=='user') { if ($_SESSION[$this->base]->type=='user') {