From: hickert Date: Mon, 3 Dec 2007 15:10:10 +0000 (+0000) Subject: Added external hook. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f659c03aef833889681671abbd766e277d1a3462;p=gosa.git Added external hook. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7985 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_password-methods-heimdal.inc b/include/class_password-methods-heimdal.inc index 8a0257981..216685df7 100644 --- a/include/class_password-methods-heimdal.inc +++ b/include/class_password-methods-heimdal.inc @@ -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); diff --git a/include/class_password-methods.inc b/include/class_password-methods.inc index 4131a9f60..f6954eca1 100644 --- a/include/class_password-methods.inc +++ b/include/class_password-methods.inc @@ -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) { }