Code

Added external hook.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 3 Dec 2007 15:10:10 +0000 (15:10 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 3 Dec 2007 15:10:10 +0000 (15:10 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7985 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_password-methods-heimdal.inc
include/class_password-methods.inc

index 8a0257981cd366fe055f3c3008ed5c05fa4589c8..216685df7393a09a9e4ca770ca91a1d1405e9669 100644 (file)
@@ -115,6 +115,7 @@ class passwordMethodheimdal extends passwordMethod
   }
 
 
+
        function generate_hash($pwd)
        {
     $mode= "kerberos";
@@ -139,13 +140,35 @@ class passwordMethodheimdal extends passwordMethod
   }
 
 
-  function set_password()
+  function set_password($password)
   {
     #TODO
     # Add or modify kerberos entry below $this->dn
     # See https://oss.gonicus.de/labs/gosa/ticket/223
     # Order: create entries, then call the heimdal_keygen hook with the realm (returned by generate_hash)
     #        to let it add the missing kerberos keys.
+
+    global $config;
+    $cmd = "";
+    if(isset($config->current['HEIMDAL_KEYGEN'])){
+      $cmd = $config->current['HEIMDAL_KEYGEN'];
+      if(!check_command($cmd)){
+        new msg_dialog(_("Heimdal"),sprintf(_("The configured HEIMDAL_KEYGEN '%s' is not a valid command."),$cmd),WARNING_DIALOG);
+      }
+    }
+    if(isset($this->config->data['MAIN']['HEIMDAL_KEYGEN'])){
+      $cmd = $this->config->data['MAIN']['HEIMDAL_KEYGEN'];
+      if(!check_command($cmd)){
+        new msg_dialog(_("Heimdal"),sprintf(_("The configured HEIMDAL_KEYGEN '%s' is not a valid command."),$cmd),WARNING_DIALOG);
+      }
+    }
+    if ($cmd != ""){
+      $cmd = $cmd." ".$this->generate_hash($password);
+      $res = exec($cmd);
+      if(!$res){
+        new msg_dialog(_("Heimdal"),sprintf(_("The configured HEIMDAL_KEYGEN '%s' wasn't successfully executed. Command does not reurn 0."),$cmd),WARNING_DIALOG);
+      }
+    }
   }
 
 
@@ -310,9 +333,9 @@ class passwordMethodheimdal extends passwordMethod
       }
 
       /* This should not happen, because the UID can't be modified via GOsa ui */
-      if(!$this->is_account& $dn != $this->dn){  
-        plugin::move($this->dn,$dn);
-      }
+#      if(!$this->is_account& $dn != $this->parent_dn){  
+#        plugin::move($this->dn,$dn);
+#      }
 
       /* Add / Updated data */
       $ldap->cd($dn);
index 4131a9f60ac7d5617c6f097f4b0b191cd5897f0c..f6954eca1a05ed02fc84e49e98de0d258fd1d044 100644 (file)
@@ -101,7 +101,7 @@ class passwordMethod
 
   // Method to let passwords backends manage additional information
   // besides the userAttribute entry
-  function set_password()
+  function set_password($password)
   {
   }