From: hickert Date: Fri, 25 Apr 2008 08:12:40 +0000 (+0000) Subject: Updated krb service to use the servers macaddress X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=57a6a1ba3763fe6f5ca8031f5bf02a7aff0292e3;p=gosa.git Updated krb service to use the servers macaddress git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10680 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/heimdal/admin/systems/services/kerberos/class_goKrbServer.inc b/gosa-plugins/heimdal/admin/systems/services/kerberos/class_goKrbServer.inc index aea907211..9478b9c0b 100644 --- a/gosa-plugins/heimdal/admin/systems/services/kerberos/class_goKrbServer.inc +++ b/gosa-plugins/heimdal/admin/systems/services/kerberos/class_goKrbServer.inc @@ -23,23 +23,34 @@ class goKrbServer extends goService{ var $policies = array(); var $id = -1; - var $macAddress = "00:01:6c:9d:aa:16" ; + var $macAddress = "" ; + - public function goKrbServer(&$config,$dn) + public function goKrbServer(&$config,$dn,$parent) { goService::goService($config,$dn); $this->DisplayName = _("Kerberos service"); + $this->parent = $parent; + + /* Detect macAddress of this device + */ + $this->macAddress = ""; + if(isset($this->parent->parent->netConfigDNS->macAddress)){ + $this->macAddress = &$this->parent->parent->netConfigDNS->macAddress; + } /* Get configured policies */ - $o = new gosaSupportDaemon(); - $tmp = $o->krb5_list_policies($this->macAddress); - if($o->is_error()){ - msg_dialog::display(_("Service infrastructure"),msgPool::siError($o->get_error()),ERROR_DIALOG); - }else{ - $this->policies = array(); - foreach($tmp as $policy){ - $this->policies[] = array("NAME" => $policy,"STATUS" => "LOADED","DATA" => array()); + if(!empty($this->macAddress) && $this->is_account){ + $o = new gosaSupportDaemon(); + $tmp = $o->krb5_list_policies($this->macAddress); + if($o->is_error()){ + msg_dialog::display(_("Service infrastructure"),msgPool::siError($o->get_error()),ERROR_DIALOG); + }else{ + $this->policies = array(); + foreach($tmp as $policy){ + $this->policies[] = array("NAME" => $policy,"STATUS" => "LOADED","DATA" => array()); + } } } } @@ -140,6 +151,9 @@ class goKrbServer extends goService{ if (empty($this->goKrbRealm)){ $message[]= msgPool::required(_("Realm")); } + if(count($this->policies) && (empty($this->macAddress) || !tests::is_mac($this->macAddress))){ + $message[] = _("In order to save policy changes, the server reqiures a valid mac address."); + } return($message); }