From cabd3941d0248262f13fddf2356ca4426b1fcb62 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 25 Jun 2009 06:51:15 +0000 Subject: [PATCH] The kerberos MIT plugin caused the setup to display white page. - We do not have $config object during setup, added checks. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13791 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../kerberos/class_password-methods-MIT.inc | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_password-methods-MIT.inc b/gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_password-methods-MIT.inc index f41b11425..bf7092834 100644 --- a/gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_password-methods-MIT.inc +++ b/gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_password-methods-MIT.inc @@ -339,7 +339,16 @@ class passwordMethodMIT extends passwordMethod */ public function is_available() { + global $config; + /* No config object given, this may be the case + if there is only a is_available() request triggered. + */ + if(!is_object($config)){ + return; + } + + $o = new gosaSupportDaemon(FALSE); if(count($this->server_list) && $o->connect() && $o->is_configured()){ @@ -356,7 +365,11 @@ class passwordMethodMIT extends passwordMethod public function generate_hash($pwd = "") { $mode= "kerberos"; - if ($this->config->get_cfg_value("useSaslForKerberos") == "true"){ + + /* No config object given, this may be the case + if there is only a is_available() request triggered. + */ + if (is_object($config) && $this->config->get_cfg_value("useSaslForKerberos") == "true"){ $mode= "sasl"; } return "{".$mode."}".$this->attrs['uid'][0]."@".$this->goKrbRealm; @@ -408,7 +421,11 @@ class passwordMethodMIT extends passwordMethod public function get_hash_name() { $mode= "kerberos"; - if ($this->config->get_cfg_value("useSaslForKerberos") == "true"){ + + /* No config object given, this may be the case + if there is only a is_available() request triggered. + */ + if (is_object($config) && $this->config->get_cfg_value("useSaslForKerberos") == "true"){ $mode= "sasl"; } return "$mode"; -- 2.30.2