index 5abb02d36c7eaead079c3376e5485a0c7cb5ceb6..2c759829e891250265451d489ef753d79655277b 100644 (file)
class termgroup extends plugin
{
/* attribute list for save action */
- var $attributes= array("gotoMode","gotoSyslogServer", "gotoNtpServer");
- var $objectclasses= array("gotoWorkstationTemplate");
-
var $members= array();
var $gotoMode = "locked";
"memcheck" => "memcheck",
"sysinfo" => "sysinfo");
- var $CopyPasteVars = array("gotoNtpServers","modes","inheritTimeServer");
+ var $attributes = array("gotoMode","gotoSyslogServer", "gotoNtpServer");
+ var $objectclasses = array("gotoWorkstationTemplate");
+ var $CopyPasteVars = array("gotoNtpServers","modes","inheritTimeServer","members");
+ var $view_logged = FALSE;
+
function termgroup ($config, $dn= NULL, $parent= NULL)
{
unset($this->gotoNtpServers[$key]);
}
}
-
-
}
function check()
$ldap->cd($this->orig_dn);
$ldap->modify($this->attrs);
$this->handle_post_events("remove");
+ new log("remove","ogroups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
}
{
/* Get required informations */
$og = $this->parent->by_object['ogroup'];
- $allobs = $og->allobjects;
+ $allobs = $og->objcache;
/* Get correct value for FAIstate */
$action = $this->mapActions[$act];
$ldap->cd ($this->config->current['BASE']);
/* Foreach member of mthis ogroup ... */
- foreach($og->mem as $key ){
+ foreach($og->member as $key ){
/* check objectClasses and create attributes array */
$attrs = array("FAIstate"=>$action);
$ldap->cd ($key);
$ldap->modify($attrs);
show_ldap_error($ldap->get_error(),sprintf(_("Setting action state (FAIstate) failed for object '%s', value was '%s'."),$key,$action));
-
- if(!preg_match("/success/i",$ldap->get_error())) {
- gosa_log("FAILED !! Updating FAIstate to '".$action."' : ".$key);
- }else{
- gosa_log("OK. Updating FAIstate to '".$action."' : ".$key);
- }
}
}
}
/* Call parent execute */
plugin::execute();
+ if(!$this->view_logged){
+ $this->view_logged = TRUE;
+ new log("view","ogroups/".get_class($this),$this->dn);
+ }
/***************
Handle requested action
$this->cleanup();
$ldap->modify ($this->attrs);
+ if($this->initially_was_account){
+ new log("modify","ogroups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ }else{
+ new log("create","ogroups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ }
+
if(!$this->didAction){
$this->handle_post_events("modify");
}
"plDescription" => _("System group"),
"plSelfModify" => FALSE,
"plDepends" => array(),
- "plPriority" => 0,
+ "plPriority" => 5,
"plSection" => array("administration"),
"plCategory" => array("ogroups"),
"plProvidedAcls"=> array(
));
}
+ function PrepareForCopyPaste($source)
+ {
+ /* Create used ntp server array */
+ $this->gotoNtpServer= array();
+
+ if(isset($source['gotoNtpServer'])){
+ $this->inheritTimeServer = false;
+ unset($source['gotoNtpServer']['count']);
+ foreach($source['gotoNtpServer'] as $server){
+ $this->gotoNtpServer[$server] = $server;
+ }
+ }
+ /* Set inherit checkbox state */
+ if(in_array("default",$this->gotoNtpServer)){
+ $this->inheritTimeServer = true;
+ $this->gotoNtpServer=array();
+ }
+ /* Create available ntp options */
+ $this->gotoNtpServers = $this->config->data['SERVERS']['NTP'];
+ foreach($this->gotoNtpServers as $key => $server){
+ if($server == "default"){
+ unset($this->gotoNtpServers[$key]);
+ }
+ }
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: