diff --git a/plugins/admin/systems/class_goSyslogServer.inc b/plugins/admin/systems/class_goSyslogServer.inc
index 585b3d8a582cf18203496a593e4be57ab8e96ad6..da96ea33085a730f92d14292ccc4847762c19182 100644 (file)
<?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";
/* 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 = "";
function goSyslogServer($config,$dn)
{
plugin::plugin($config,$dn);
- $this->DisplayName = _("Syslog service");
+ $this->DisplayName = _("Logging service");
}
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['AllowReset'] = 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)
- {
- $ldap = $this->config->get_ldap_link();
- $ldap->cd($this->dn);
- $ldap->cat($this->dn,array("objectClass"));
-
- if($ldap->count()){
- $attrs =array();
- $tmp = $ldap->fetch();
- for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
- $attrs['objectClass'][] = $tmp['objectClass'][$i];
- }
- if(!in_array("goSyslogServer",$attrs['objectClass'])){
- $attrs['objectClass'][] = "goSyslogServer";
- }
-
- $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:
?>