diff --git a/plugins/admin/systems/class_goLogDBServer.inc b/plugins/admin/systems/class_goLogDBServer.inc
index a61d0b354d516dc1191dd7a5c3e5dab27982bbc4..254abe369660ae282d0d7b9475f1ee49f55dce00 100644 (file)
var $objectclasses = array("goLogDBServer");
var $attributes = array("goLogDBServerStatus","goLogAdmin", "goLogPassword");
var $StatusFlag = "goLogDBServerStatus";
-
+
/* This class can't be assigned twice so it conflicts with itsself */
var $conflicts = array("goLogDBServer");
var $goLogDBServerStatus = "";
var $goLogAdmin = "";
var $goLogPassword = "";
-
-
+
+
function goLogDBServer($config,$dn)
{
plugin::plugin($config,$dn);
{
$flag = $this->StatusFlag;
$fields['Status'] = $this->$flag;
- $fields['Message'] = _("Asterisk management");
+ $fields['Message'] = _("Logging database");
$fields['AllowStart'] = true;
$fields['AllowStop'] = true;
$fields['AllowRestart'] = true;
$ldap->add($this->attrs);
}
show_ldap_error($ldap->get_error());
+ $this->handle_post_events("remove");
}
$ldap->add($this->attrs);
}
show_ldap_error($ldap->get_error());
+ if($this->initially_was_account){
+ $this->handle_post_events("modify");
+ }else{
+ $this->handle_post_events("add");
+ }
}
$this->$flag = $value;
$ldap->modify($attrs);
show_ldap_error($ldap->get_error());
+ $this->action_hook();
}
}
}
return($message);
}
-
+
function save_object()
{
if(isset($_POST['goLogDBServerPosted'])){
plugin::save_object();
}
- }
+ }
+
+ function action_hook($add_attrs= array())
+ {
+ /* Find postcreate entries for this class */
+ $command= search_config($this->config->data['MENU'], get_class($this), "ACTION_HOOK");
+ if ($command == "" && isset($this->config->data['TABS'])){
+ $command= search_config($this->config->data['TABS'], get_class($this), "ACTION_HOOK");
+ }
+ if ($command != ""){
+ /* Walk through attribute list */
+ foreach ($this->attributes as $attr){
+ if (!is_array($this->$attr)){
+ $command= preg_replace("/%$attr/", $this->$attr, $command);
+ }
+ }
+ $command= preg_replace("/%dn/", $this->dn, $command);
+ /* Additional attributes */
+ foreach ($add_attrs as $name => $value){
+ $command= preg_replace("/%$name/", $value, $command);
+ }
+ if (check_command($command)){
+ @DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__,
+ $command, "Execute");
+
+ exec($command);
+ } else {
+ $message= sprintf(_("Command '%s', specified as ACTION_HOOK for plugin '%s' doesn't seem to exist."), $command, get_class($this));
+ print_red ($message);
+ }
+ }
+ }
+
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>