From: hickert Date: Mon, 3 Dec 2007 15:00:12 +0000 (+0000) Subject: Fixed detection of valid configured heimdal extension X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=50ecad0e240174bb714b2c5569dac91857c0dc2c;p=gosa.git Fixed detection of valid configured heimdal extension git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7984 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_password-methods-heimdal.inc b/include/class_password-methods-heimdal.inc index a99ee8535..8a0257981 100644 --- a/include/class_password-methods-heimdal.inc +++ b/include/class_password-methods-heimdal.inc @@ -93,14 +93,26 @@ class passwordMethodheimdal extends passwordMethod function is_available() { - #TODO - # Check if heimdal information is available - # in configuration and return true/false - # - # In particular, we need the "heimdal_keygen" to feed kadmin in order to return "true". - # - return true; - } + 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(isset($config->data['SERVERS']['KERBEROS']['REALM']) && check_command($cmd)){ + return TRUE; + }else{ + return FALSE; + } + } function generate_hash($pwd) diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index c7504f113..fbb55c12a 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -560,9 +560,14 @@ class user extends plugin } $temp= passwordMethod::get_available_methods(); + $is_configurable= FALSE; $hashes = $temp['name']; - $test= new $temp[$this->pw_storage]($this->config); - $is_configurable= $test->is_configurable(); + if(isset($temp[$this->pw_storage])){ + $test= new $temp[$this->pw_storage]($this->config); + $is_configurable= $test->is_configurable(); + }else{ + new msg_dialog(_("Password method"),_("The selected password method is no longer available."),WARNING_DIALOG); + } /* Load attributes and acl's */ $ui =get_userinfo();