Code

Updated workstation - Startup
[gosa.git] / plugins / admin / systems / class_servRepository.inc
index 740fdf0ea6a668b85825bcf73751db54c7b6ee25..c95860729cf54c183c1d698d635f0b1c9e15f205 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 
-require_once("class_goService.inc");
-
 class servrepository extends goService
 {
   /* CLI vars */
@@ -17,32 +15,30 @@ class servrepository extends goService
   /* Search filter */
   var $regex                  = "*";
 
-  /* Configurationdialog for repositories */
-  var $dialog                 = NULL;
-
   /* Repositories */
   var $repositories          = array();
   var $FAIrepository         = array();
   var $conflicts             = array("FAIrepositoryServer");
   var $DisplayName           = "";
   var $StatusFlag            = "";
-
+  
+  var $view_logged            = FALSE;
   var $fai_activated          = FALSE;
 
-  function servrepository ($config, $dn= NULL, $parent= NULL)
+  function servrepository (&$config, $dn= NULL, $parent= NULL)
   {
     plugin::plugin ($config, $dn, $parent);
 
+    $this->DisplayName = _("Repository service");
+
     /* Skip this if fai is deactivated */
-    $tmp = search_config($this->config->data,"faiManagement","CLASS");
+    $tmp= $this->config->search("faiManagement", "CLASS",array('menu','tabs'));
     if(!empty($tmp)){
       $this->fai_activated = TRUE;    
     }else{
       return;
     }
 
-    $this->DisplayName = _("Repository service");
-
     $this->repositories = array();
     if(isset($this->attrs['FAIrepository'])){
       for($i = 0; $i < $this->attrs['FAIrepository']['count']; $i++){
@@ -83,10 +79,6 @@ class servrepository extends goService
         $this->repositories[$tmp[2]]=$tmp2;      
       }
     }
-
-    if($this->is_account){
-      @log::log("view","server/".get_class($this),$this->dn);
-    }
   }
 
   function execute()
@@ -94,6 +86,11 @@ class servrepository extends goService
     /* Call parent execute */
     plugin::execute();
 
+    if($this->is_account && !$this->view_logged){
+      $this->view_logged = TRUE;
+      new log("view","server/".get_class($this),$this->dn);
+    }
+
     if(!$this->fai_activated){
       $str = "<h2>"._("You can't use this plugin until FAI is activated.")."</h2>";
       return $str;
@@ -229,17 +226,17 @@ class servrepository extends goService
         }else{ 
           $this->repositories[$obj['Release']]=$obj;        
         }
-        $this->dialog = NULL;
+        $this->dialog = FALSE;
         $this->is_dialog= false;
       }
     }
 
     if(isset($_POST['repository_setup_cancel'])){
-      $this->dialog=NULL;
+      $this->dialog=FALSE;
       $this->is_dialog = false;
     }
    
-    if($this->dialog != NULL){
+    if(is_object($this->dialog)){
       $this->dialog->save_object();
       $this->is_dialog = true;
       return($this->dialog->execute());
@@ -249,9 +246,10 @@ class servrepository extends goService
       Repository setup dialog handling /END
     */
 
-    $divlist = new divList("repositories");
+    $divlist = new divlist("repositories");
     $divlist->SetEntriesPerPage(0);
     $divlist->setHeight(400);
+    $divlist->SetPluginMode();
 
     $divlist->setHeader(array(array("string"=>_("Release"),"attach"=>"style='width:80px;'"),
                               array("string"=>_("Sections")),
@@ -352,9 +350,9 @@ class servrepository extends goService
     }
 
     if($this->initially_was_account){
-      @log::log("modify","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+      new log("modify","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }else{
-      @log::log("create","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+      new log("create","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }
   }