diff --git a/plugins/admin/systems/class_goSyslogServer.inc b/plugins/admin/systems/class_goSyslogServer.inc
index 7bb179adf80410898a025e22603e5b9c675342cc..abeb947feb465bbca5ec3c7731d960cc76757ce8 100644 (file)
<?php
-class goSyslogServer extends plugin{
+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";
/* 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 */
var $DisplayName = "";
var $dn = NULL;
var $acl;
-
+ var $cn = "";
var $goSyslogServerStatus = "";
+ var $view_logged =FALSE;
- function goSyslogServer($config,$dn)
+ function goSyslogServer(&$config,$dn)
{
- plugin::plugin($config,$dn);
- $this->DisplayName = _("Logging service");
+ goService::goService($config,$dn);
+ $this->DisplayName = _("Syslog server");
}
function execute()
{
- $smarty = get_smarty();
- foreach($this->attributes as $attr){
- $smarty->assign($attr,$this->$attr);
- $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
+ if($this->is_account && !$this->view_logged){
+ $this->view_logged = TRUE;
+ new log("view","server/".get_class($this),$this->dn);
}
+
+
+ $smarty = get_smarty();
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'] = _("Syslog server");
+ $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:
?>