diff --git a/gosa-plugins/systems/admin/systems/class_serverService.inc b/gosa-plugins/systems/admin/systems/class_serverService.inc
index 14ff1970e53462dfb6881e61aafb6e2c13578644..4bd58ed1894d29ca7ff73227e0b95b6f0595615e 100644 (file)
var $backup = NULL;
var $acl ;
var $cn;
+ var $parent ;
- function ServerService (&$config, $dn)
+ function ServerService (&$config, $dn,$parent)
{
plugin::plugin($config);
+ $this->parent = $parent;
$this->dn= $dn;
+
+ /* Adapt parent attributes */
+ if(isset($this->parent->attrs)){
+ $this->attrs = $this->parent->attrs;
+ }
+
foreach ($config->data['TABS']['SERVERSERVICE'] as $plug){
if(class_available($plug['CLASS'])){
$name= $plug['CLASS'];
$this->plugin_names[]= $name;
- $this->plugins[$name]= new $name($config, $dn);
+ $this->plugins[$name]= new $name($config, $dn, $this);
+
+ /* Initialize kerberos key support */
+ if(isset($this->plugins[$name]->krb_service_prefix) && !empty($this->plugins[$name]->krb_service_prefix)){
+ $this->plugins[$name]->krb_host_key = &$this->parent->kerberos_key_service;
+ }
/* Capture all service objectClases, necessary for acl handling */
if(isset($this->plugins[$name]->objectclasses)){
}
}
}else{
- trigger_error("Service class missing: ".$plug['CLASS']);
+ #trigger_error("Service class missing: ".$plug['CLASS']);
}
}
$this->divList = new divListSystemService($config,$this);
if($s_action == "RemoveSingleService"){
/* Create resetted obj */
- $new_obj = new $s_entry($this->config,$this->dn);
+ $new_obj = new $s_entry($this->config,$this->dn, $this);
$new_obj -> set_acl_base($this->acl_base);
$new_obj -> set_acl_category(preg_replace("/\/$/","",$this->acl_category));
$tmp = $new_obj->getListEntry();
/* Edit a service and make a backup from all attributes,
to be able to restore old values after aborting dialog */
if($s_action == "EditSingleService"){
- $this->backup = get_object_vars($this->plugins[$s_entry]);
- $this->dialog = $this->plugins[$s_entry];
- $this->current = $s_entry;
+ if($this->plugins[$s_entry]->acl_is_readable("")){
+ $this->backup = get_object_vars($this->plugins[$s_entry]);
+ $this->dialog = $this->plugins[$s_entry];
+ $this->current = $s_entry;
+ }
}
Restore vars with values before editing */
if(isset($_POST['CancelService']) && !empty($this->current)){
if($this->backup == NULL){
- $this->plugins[$this->current] = new $this->current($this->config,$this->dn);
+ $this->plugins[$this->current] = new $this->current($this->config,$this->dn,$this);
$this->plugins[$this->current]-> set_acl_base($this->acl_base);
$this->plugins[$this->current]-> set_acl_category(preg_replace("/\/$/","",$this->acl_category));
/* Abort dialog */
if(isset($_POST['SaveService']) && is_object($this->dialog)){
- $this->dialog->save_object();
+# $this->dialog->save_object();
$msgs = $this->dialog->check();
if(count($msgs)){
foreach($msgs as $msg){
/* There is currently a subdialog open, display this dialog */
if(is_object($this->dialog)){
- $this->dialog->save_object();
- return($this->dialog->execute());
+ $add ="";
+ if(isset($this->dialog->krb_host_key) && $this->dialog->krb_host_key instanceof krbHostKeys){
+ $add = $this->dialog->krb_host_key->save_object_by_prefix($this->dialog->krb_service_prefix);
+ $add = $this->dialog->krb_host_key->execute_by_prefix($this->dialog->krb_service_prefix,TRUE);
+ }
+ return($add.$this->dialog->execute());
}
$tmp = $this->plugins[$name]->getListEntry();
/* Check if given action is allowed for this service */
- if($tmp[$map[$action]]){
+ if($tmp[$map[$action]] && !empty($this->plugins[$name]->StatusFlag)){
if($this->plugins[$name]->initially_was_account && $this->plugins[$name]->is_account){
$this->plugins[$name]->setStatus($action);
}
function save_object()
{
foreach($this->plugins as $name => $obj){
-
-# if($obj->is_account){
-# $this->plugins[$name]->save_object();
-# }
+ if($obj->is_account){
+ $this->plugins[$name]->save_object();
+ }
}
}
}
}
if($this->plugins[$name]->initially_was_account){
+ if(isset($this->plugins[$name]->krb_host_key) && $this->plugins[$name]->krb_host_key instanceof krbHostKeys){
+ $this->plugins[$name]->krb_host_key->remove_from_parent_by_prefix($this->plugins[$name]->krb_service_prefix);
+ }
$this->plugins[$name]->remove_from_parent();
}
}