From 880813bf6b355da4560bd979bacec6a70edfa7bc Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 4 Jun 2008 13:16:31 +0000 Subject: [PATCH] Updated host_key_support git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11210 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../services/kerberos/class_krb_host_keys.inc | 50 ++++++++++++------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_krb_host_keys.inc b/gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_krb_host_keys.inc index 9886feb03..0e31d98c2 100644 --- a/gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_krb_host_keys.inc +++ b/gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_krb_host_keys.inc @@ -117,6 +117,35 @@ class krb_host_keys extends plugin } + public function create_key($id,$name) + { + $this->o_queue->krb5_add_principal($id,$name,array()); + if($this->o_queue->is_error()){ + msg_dialog::display(_("Service infrastructure"),msgPool::siError($this->o_queue->get_error()),ERROR_DIALOG); + }else{ + $this->recreate_key($id,$name); + } + } + + + public function recreate_key($id,$name) + { + $this->o_queue->krb5_ramdomize_key($id, $name); + if($this->o_queue->is_error()){ + msg_dialog::display(_("Service infrastructure"),msgPool::siError($this->o_queue->get_error()),ERROR_DIALOG); + } + } + + + public function delete_key($id,$name) + { + $this->o_queue->krb5_del_principal($id, $name); + if($this->o_queue->is_error()){ + msg_dialog::display(_("Service infrastructure"),msgPool::siError($this->o_queue->get_error()),ERROR_DIALOG); + } + } + + public function save_object() { @@ -124,15 +153,7 @@ class krb_host_keys extends plugin if(preg_match("/^create_/",$name)){ $id = preg_replace("/^create_([a-z0-9\:]*)_.*/i","\\1",$name); $realm = $this->server_list[$id]['REALM']; - $this->o_queue->krb5_add_principal($id, $this->namingAttr."@".$realm, array()); - if($this->o_queue->is_error()){ - msg_dialog::display(_("Service infrastructure"),msgPool::siError($this->o_queue->get_error()),ERROR_DIALOG); - } - echo "Not implemented yet."; -# $this->o_queue->krb5_ramdomize_key($id, $this->namingAttr."@".$realm); -# if($this->o_queue->is_error()){ -# msg_dialog::display(_("Service infrastructure"),msgPool::siError($this->o_queue->get_error()),ERROR_DIALOG); -# } + $this->create_key($id,$this->namingAttr."@".$realm); $this->init(); break; } @@ -141,11 +162,7 @@ class krb_host_keys extends plugin if(preg_match("/^recreate_/",$name)){ $id = preg_replace("/^recreate_([a-z0-9\:]*)_.*/i","\\1",$name); $realm = $this->server_list[$id]['REALM']; - echo "Not implemented yet."; -# $this->o_queue->krb5_ramdomize_key($id, $this->namingAttr."@".$realm); -# if($this->o_queue->is_error()){ -# msg_dialog::display(_("Service infrastructure"),msgPool::siError($this->o_queue->get_error()),ERROR_DIALOG); -# } + $this->recreate_key($id,$this->namingAttr."@".$realm); $this->init(); break; } @@ -154,10 +171,7 @@ class krb_host_keys extends plugin if(preg_match("/^remove_/",$name)){ $id = preg_replace("/^remove_([a-z0-9\:]*)_.*/i","\\1",$name); $realm = $this->server_list[$id]['REALM']; - $this->o_queue->krb5_del_principal($id, $this->namingAttr."@".$realm); - if($this->o_queue->is_error()){ - msg_dialog::display(_("Service infrastructure"),msgPool::siError($this->o_queue->get_error()),ERROR_DIALOG); - } + $this->delete_key($id,$this->namingAttr."@".$realm); $this->init(); break; } -- 2.30.2