Code

Initially set password correctly.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 7 May 2008 09:07:11 +0000 (09:07 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 7 May 2008 09:07:11 +0000 (09:07 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10807 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/heimdal/admin/systems/services/kerberos/class_password-methods-MIT.inc

index 281bba7c610bd0969eb3080c7260d5416a5626c5..ce015b8b46b95056b39a981ad5e47f3c40f7118c 100644 (file)
@@ -164,6 +164,12 @@ class passwordMethodMIT extends passwordMethod
       $ldap->cd($dn);
       $ldap->cat($dn);
       $this->attrs = $ldap->fetch();
+
+      /* Set initial pwd hash which take effect if no password method was set yet.  
+         Will be overwritten by the following lines, if the user has already a valid principal.
+       */
+      $this->principal = $this->attrs['uid'][0]."@".$this->goKrbRealm;
+
       if(isset($this->attrs['userPassword']) && preg_match("/^\{".$this->get_hash_name()."\}/",$this->attrs['userPassword'][0])){
 
         /* Extract principal name out of userPassword attribute 
@@ -321,7 +327,7 @@ class passwordMethodMIT extends passwordMethod
       @param  String  The password -in this case unusued.             
       @return String  The generated hash
    */
-  function generate_hash($pwd)
+  function generate_hash($pwd = "")
   {
     $mode= "kerberos";
     if (isset($this->config->current['KRBSASL']) && preg_match('/^true$/i', $this->config->current['KRBSASL'])){
@@ -484,7 +490,7 @@ class passwordMethodMIT extends passwordMethod
       $smarty->assign($date_val."_i",date("i",$this->$date_val));
     }
 
-    return($smarty->fetch(get_template_path("pwd_kerberos_mit.tpl")));
+    return($smarty->fetch(get_template_path("pwd_kerberos_mit.tpl",TRUE,dirname(__FILE__))));
   }