Code

Added "Force localboot"
[gosa.git] / plugins / admin / systems / class_goSyslogServer.inc
index 7bb179adf80410898a025e22603e5b9c675342cc..da96ea33085a730f92d14292ccc4847762c19182 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 
-class goSyslogServer extends plugin{
+require_once("class_goService.inc");
+
+class goSyslogServer extends goService{
        
   var $cli_summary      = "This plugin is used within the ServerService Pluign \nand indicates that this server has syslog server enabled.";
   var $cli_description  = "Some longer text\nfor help";
@@ -8,7 +10,7 @@ class goSyslogServer extends plugin{
 
   /* This plugin only writes its objectClass */
   var $objectclasses    = array("goSyslogServer");
-  var $attributes       = array("goSyslogServerStatus");
+  var $attributes       = array();
   var $StatusFlag       = "goSyslogServerStatus";
  
   /* This class can't be assigned twice so it conflicts with itsself */
@@ -17,7 +19,7 @@ class goSyslogServer extends plugin{
   var $DisplayName      = "";
   var $dn               = NULL;
   var $acl;
-
+  var $cn                    = "";
   var $goSyslogServerStatus  = "";
  
   function goSyslogServer($config,$dn)
@@ -30,96 +32,47 @@ class goSyslogServer extends plugin{
   function execute()
   { 
     $smarty = get_smarty(); 
-    foreach($this->attributes as $attr){
-      $smarty->assign($attr,$this->$attr);
-      $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
-    }
     return($smarty->fetch(get_template_path("goSyslogServer.tpl",TRUE,dirname(__FILE__))));
   }
 
 
   function getListEntry()
   {
-    $flag = $this->StatusFlag;
-    $fields['Status']     = $this->$flag;
-    $fields['Message']    = _("Syslog service");
-    $fields['AllowStart'] = true;
-    $fields['AllowStop']  = true;
-    $fields['AllowRestart'] = true;
-    $fields['AllowRemove']= true;
-    $fields['AllowEdit']  = true;
+    $fields               = goService::getListEntry();
+    $fields['Message']    = _("Logging service");
+    $fields['AllowEdit']  = false;
     return($fields);
   }
 
-
-  function remove_from_parent()
-  {
-    plugin::remove_from_parent();
-    /* Check if this is a new entry ... add/modify */
-    $ldap = $this->config->get_ldap_link();
-    $ldap->cat($this->dn,array("objectClass"));
-    if($ldap->count()){
-      $ldap->cd($this->dn);
-      $ldap->modify($this->attrs);
-    }else{
-      $ldap->cd($this->dn);
-      $ldap->add($this->attrs);
-    }
-    show_ldap_error($ldap->get_error());
-  }
-
-
-  function save()
-  {
-    plugin::save();
-    /* Check if this is a new entry ... add/modify */
-    $ldap = $this->config->get_ldap_link();
-    $ldap->cat($this->dn,array("objectClass"));
-    if($ldap->count()){
-      $ldap->cd($this->dn);
-      $ldap->modify($this->attrs);
-    }else{
-      $ldap->cd($this->dn);
-      $ldap->add($this->attrs);
-    }
-    show_ldap_error($ldap->get_error());
-  }
-
-
-  /* Directly save new status flag */
-  function setStatus($value)
-  {
-    if($value == "none") return;
-    if(!$this->initially_was_account) return;
-    $ldap = $this->config->get_ldap_link();
-    $ldap->cd($this->dn);
-    $ldap->cat($this->dn,array("objectClass"));
-    if($ldap->count()){
-
-      $tmp = $ldap->fetch();
-      for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
-        $attrs['objectClass'][] = $tmp['objectClass'][$i];
-      }
-      $flag = $this->StatusFlag;
-      $attrs[$flag] = $value;
-      $this->$flag = $value;
-      $ldap->modify($attrs);
-      show_ldap_error($ldap->get_error());
-    }
-  }
-
-
   function check()
   { 
     $message = plugin::check();
     return($message);
   }
-  
+
 
   function save_object()
   {
     plugin::save_object();
-  }  
+  } 
+
+  /* Return plugin informations for acl handling */
+  function plInfo()
+  {
+    return (array(
+          "plShortName"   => _("Logging service"),
+          "plDescription" => _("Logging service")." ("._("Services").")",
+          "plSelfModify"  => FALSE,
+          "plDepends"     => array(),
+          "plPriority"    => 88,
+          "plSection"     => array("administration"),
+          "plCategory"    => array("server"),
+
+          "plProvidedAcls"=> array()
+          ));
+  }
+
+
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>