Code

Remove dependency to sambaversion
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 2 Oct 2009 14:23:26 +0000 (14:23 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 2 Oct 2009 14:23:26 +0000 (14:23 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14490 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_config.inc
gosa-core/include/functions.inc

index 6c7ed800886425a698dddb83c975506dbbee6d72..d696c19e155bdea925bf73741920c75d64b14462 100644 (file)
@@ -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"]);
       }
     }
+    
   }
 
 
index 2eae062515b0a6657105affdd7fa3fa31eb91fa5..c09a59acf896815a5d55d8a12754e2fd47275bef 100644 (file)
@@ -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);
 }