Code

Fixed unfdefined index warnings in gosa_log_view
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 26 Nov 2007 12:03:42 +0000 (12:03 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 26 Nov 2007 12:03:42 +0000 (12:03 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7887 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/addons/logview/class_gosa_logview.inc
plugins/addons/logview/gosa_log_contents.tpl

index f591f79e77384f456b1bd00d2b149ab643c10ba9..847800380854101df599512807472634e8a73190 100644 (file)
@@ -303,61 +303,63 @@ class gosa_logview extends plugin
 
   function save_object()
   {
-    /* Get submitted range */  
-    if(isset($_POST['EntriesPerPage'])){
-      if(is_numeric($_POST['EntriesPerPage'])){
-        $this->range = $_POST['EntriesPerPage'];
+    if(isset($_POST['gosa_log_contents_posted'])){
+
+      /* Get submitted range */        
+      if(isset($_POST['EntriesPerPage'])){
+        if(is_numeric($_POST['EntriesPerPage'])){
+          $this->range = $_POST['EntriesPerPage'];
+        }
       }
-    }
 
-    /* Get actual select boxe values */
-    $logfilter_changed = FALSE;
-    foreach( array("server", "action","time","regex") as $type){
-      if(isset($_POST[$type])){
-        $this->$type = $_POST[$type];   
+      /* Get actual select boxe values */
+      $logfilter_changed = FALSE;
+      foreach( array("server", "action","time","regex") as $type){
+        if(isset($_POST[$type])){
+          $this->$type = $_POST[$type];   
+        }
       }
-    }
 
-    /* Filter regex values */
-    if ($this->regex == ""){
-      $this->regex= '*';
-    } else {
-      $new = preg_replace('/\*\**/', '*', $this->regex);
-      $this->regex= $new;
-    }
+      /* Filter regex values */
+      if ($this->regex == ""){
+        $this->regex= '*';
+      } else {
+        $new = preg_replace('/\*\**/', '*', $this->regex);
+        $this->regex= $new;
+      }
 
-    /* Set start value */
-    if (isset($_GET['start'])){
-      $this->start= (int)$_GET['start'];
-    }
-  
-    /* Reset page number if filter has changed */
-    if ($logfilter_changed > 0){
-      $this->start= 0;
-    }
+      /* Set start value */
+      if (isset($_GET['start'])){
+        $this->start= (int)$_GET['start'];
+      }
+
+      /* Reset page number if filter has changed */
+      if ($logfilter_changed > 0){
+        $this->start= 0;
+      }
 
-    /* Adapt sorting */
-    if (isset($_GET['sort'])){
+      /* Adapt sorting */
+      if (isset($_GET['sort'])){
+
+        if($_GET['direction'] == "up"){
+          $this->sort_direction = "down";
+        }else{
+          $this->sort_direction = "up";
+        }
 
-      if($_GET['direction'] == "up"){
-        $this->sort_direction = "down";
-      }else{
-        $this->sort_direction = "up";
+        $this->sort= (int)$_GET['sort'];
+        if ($this->sort < 0 || $this->sort > count($this->fields)){
+          $this->sort= 0;
+        }
       }
 
-      $this->sort= (int)$_GET['sort'];
-      if ($this->sort < 0 || $this->sort > count($this->fields)){
-        $this->sort= 0;
+      /* Save attributes in Sessiob, so we are able to recontruct filter on plugin reload */
+      $_SESSION['logview']['gosa_log'] = array();
+      foreach(array("action","server","time","regex") as $attr){
+        $_SESSION['logview']['gosa_log'][$attr] = $this->$attr;
       }
-    }
 
-    /* Save attributes in Sessiob, so we are able to recontruct filter on plugin reload */
-    $_SESSION['logview']['gosa_log'] = array();
-    foreach(array("action","server","time","regex") as $attr){
-      $_SESSION['logview']['gosa_log'][$attr] = $this->$attr;
     }
-
-
   }
 
 
index d037e2deeb15d7201861d947b9b0f93cdaed0c83..4a9f3c9cb72e9784f3dee2755adde2514b9debcf 100644 (file)
@@ -3,7 +3,7 @@
 </div>
 <div class="contentboxb">
 
- <table summary="" width="100%" class="contentboxb" style="border-top:1px solid #B0B0B0; padding:0px;">
+ <table summary="" width="100%" class="contentboxb" style="border-top:1px solid #B0B0B0; padding:0px;" border=0>
   <tr>
    <td width="33%">
     <table summary="">
@@ -99,7 +99,7 @@
 {else}
   <b>{t}Search returned no results...{/t}</b>
 {/if}
-
+<input type='hidden' name='gosa_log_contents_posted' value='1'>
 <!-- Place cursor -->
 <script language="JavaScript" type="text/javascript">
   <!-- // First input field on page