diff --git a/plugins/admin/systems/class_goNtpServer.inc b/plugins/admin/systems/class_goNtpServer.inc
index 3f423dea7a7b84b892ccd4581c34957f7b7252f5..f7a9ea42ea0f881685aab9fed452154794fdd9c3 100644 (file)
/* This plugin only writes its objectClass */
var $objectclasses = array("goNtpServer");
- var $attributes = array("goTimeSource","goNtpServerStatus");
+ var $attributes = array("goTimeSource");
var $StatusFlag = "goNtpServerStatus";
/* This class can't be assigned twice so it conflicts with itsself */
var $goTimeSource = array();
var $goNtpServerStatus= "";
var $acl;
-
+ var $cn = "";
function goNtpServer($config,$dn)
{
function getListEntry()
{
+ $this->updateStatusState();
$flag = $this->StatusFlag;
$fields['Status'] = $this->$flag;
$fields['Message'] = _("NTP service");
$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");
+ }
}
foreach ($add_attrs as $name => $value){
$command= preg_replace("/%$name/", $value, $command);
}
+
+ /* If there are still some %.. in our command, try to fill these with some other class vars */
+ if(preg_match("/%/",$command)){
+ $attrs = get_object_vars($this);
+ foreach($attrs as $name => $value){
+ if(!is_string($value)) continue;
+ $command= preg_replace("/%$name/", $value, $command);
+ }
+ }
+
if (check_command($command)){
@DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__,
$command, "Execute");
}
}
+
+ /* Get updates for status flag */
+ function updateStatusState()
+ {
+ if(empty($this->StatusFlag)) return;
+
+ $attrs = array();
+ $flag = $this->StatusFlag;
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->cn);
+ $ldap->cat($this->dn,array($flag));
+ if($ldap->count()){
+ $attrs = $ldap->fetch();
+ }
+ if(isset($attrs[$flag][0])){
+ $this->$flag = $attrs[$flag][0];
+ }
+ }
+
+
function check(){ return array();}
function save_object(){;}