From: cajus Date: Fri, 2 Oct 2009 14:23:26 +0000 (+0000) Subject: Remove dependency to sambaversion X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ff448e8045c25e2f17d0912191fff5ecd40b7344;p=gosa.git Remove dependency to sambaversion git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14490 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_config.inc b/gosa-core/include/class_config.inc index 6c7ed8008..d696c19e1 100644 --- a/gosa-core/include/class_config.inc +++ b/gosa-core/include/class_config.inc @@ -297,9 +297,6 @@ class config { { $this->current= $this->data['LOCATIONS'][$name]; - if (!isset($this->current['SAMBAVERSION'])){ - $this->current['SAMBAVERSION']= 3; - } if (!isset($this->current['USERRDN'])){ $this->current['USERRDN']= "ou=people"; } @@ -620,31 +617,30 @@ class config { } /* Get samba servers from LDAP, in case of samba3 */ - if ($this->current['SAMBAVERSION'] == 3){ - $this->data['SERVERS']['SAMBA']= array(); - $ldap->cd ($this->current['BASE']); - $ldap->search ("(objectClass=sambaDomain)"); - while ($attrs= $ldap->fetch()){ - $this->data['SERVERS']['SAMBA'][$attrs['sambaDomainName'][0]]= array( "SID" =>"","RIDBASE" =>""); - if(isset($attrs["sambaSID"][0])){ - $this->data['SERVERS']['SAMBA'][$attrs['sambaDomainName'][0]]["SID"] = $attrs["sambaSID"][0]; - } - if(isset($attrs["sambaAlgorithmicRidBase"][0])){ - $this->data['SERVERS']['SAMBA'][$attrs['sambaDomainName'][0]]["RIDBASE"] = $attrs["sambaAlgorithmicRidBase"][0]; - } + $this->data['SERVERS']['SAMBA']= array(); + $ldap->cd ($this->current['BASE']); + $ldap->search ("(objectClass=sambaDomain)"); + while ($attrs= $ldap->fetch()){ + $this->data['SERVERS']['SAMBA'][$attrs['sambaDomainName'][0]]= array( "SID" =>"","RIDBASE" =>""); + if(isset($attrs["sambaSID"][0])){ + $this->data['SERVERS']['SAMBA'][$attrs['sambaDomainName'][0]]["SID"] = $attrs["sambaSID"][0]; } + if(isset($attrs["sambaAlgorithmicRidBase"][0])){ + $this->data['SERVERS']['SAMBA'][$attrs['sambaDomainName'][0]]["RIDBASE"] = $attrs["sambaAlgorithmicRidBase"][0]; + } + } - /* If no samba servers are found, look for configured sid/ridbase */ - if (count($this->data['SERVERS']['SAMBA']) == 0){ - if (!isset($this->current["SAMBASID"]) || !isset($this->current["SAMBARIDBASE"])){ - msg_dialog::display(_("Configuration error"), _("sambaSID and/or sambaRidBase missing in the configuration!"), ERROR_DIALOG); - } else { - $this->data['SERVERS']['SAMBA']['DEFAULT']= array( - "SID" => $this->current["SAMBASID"], - "RIDBASE" => $this->current["SAMBARIDBASE"]); - } + /* If no samba servers are found, look for configured sid/ridbase */ + if (count($this->data['SERVERS']['SAMBA']) == 0){ + if (!isset($this->current["SAMBASID"]) || !isset($this->current["SAMBARIDBASE"])){ + msg_dialog::display(_("Configuration error"), _("sambaSID and/or sambaRidBase missing in the configuration!"), ERROR_DIALOG); + } else { + $this->data['SERVERS']['SAMBA']['DEFAULT']= array( + "SID" => $this->current["SAMBASID"], + "RIDBASE" => $this->current["SAMBARIDBASE"]); } } + } diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index 2eae06251..c09a59acf 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -2591,17 +2591,11 @@ function generate_smb_nt_hash($password) list($lm,$nt)= split (":", trim($hash)); - if ($config->get_cfg_value("sambaversion") == 3) { - $attrs['sambaLMPassword']= $lm; - $attrs['sambaNTPassword']= $nt; - $attrs['sambaPwdLastSet']= date('U'); - $attrs['sambaBadPasswordCount']= "0"; - $attrs['sambaBadPasswordTime']= "0"; - } else { - $attrs['lmPassword']= $lm; - $attrs['ntPassword']= $nt; - $attrs['pwdLastSet']= date('U'); - } + $attrs['sambaLMPassword']= $lm; + $attrs['sambaNTPassword']= $nt; + $attrs['sambaPwdLastSet']= date('U'); + $attrs['sambaBadPasswordCount']= "0"; + $attrs['sambaBadPasswordTime']= "0"; return($attrs); }