[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ossec-cvs] ossec-hids: eventSummary.php (HEAD) [davelowe]



Module name:	ossec-hids
Changes by:	davelowe	07/07/18 02:02:47

Modified files:
	eventSummary.php

Log message:
Showing full location

Index: eventSummary.php
===================================================================
RCS file: /usr/cvsroot/ossec-ui/ossec/Site/eventSummary.php,v
diff -u -r1.5 -r1.6
--- eventSummary.php	11 Jul 2007 01:55:33 -0000	1.5
+++ eventSummary.php	18 Jul 2007 05:02:47 -0000	1.6
@@ -1,80 +1,86 @@
 <!-- START EVENT DETAILS -->
 <div id="layerEventSummary" class="layerEventSummary">
-
 <?php
-if(isset($_GET['selectHost']))
+/* OS PHP init */
+if (!function_exists('os_handle_start'))
 {
-    $USER_host = $_GET['selectHost'];
-    if($USER_host == "All")
-    {
-        $USER_host = NULL;
-    }
+  echo 'You are not allowed direct access.</b><br />\n';
+  return(1);
 }
-else
+
+/* Check to see if a host has been selected */
+if(isset($_GET['selectHost']))
 {
-    $USER_host = NULL;
+        $USER_host = $_GET['selectHost'];
+        if($USER_host == "All"){
+                $USER_host = NULL;
+        }
 }
-
-/* OS PHP init */
-if (!function_exists('os_handle_start'))
+else
 {
-    echo "<b id='red'>You are not allowed direct access.</b><br />\n";
-    return(1);
+        $USER_host = NULL;
 }
 
 /* Getting last alerts */
 $alert_list = os_getalerts($ossec_handle, 0, 0, 30);
 if($alert_list == NULL)
 {
-    echo "<b>Unable to retrieve alerts. </b><br />\n";
+        echo "<b>Unable to retrieve alerts. </b><br />\n";
 }
 else
 {
-  foreach ($agent_list as $agent)
-  {
-    $evt_count = sizeof($alert_list) -1;
-    /* Alerts table */
-    echo "<table width=100% cellpadding=0 cellspacing=0 border=0>\n
-          <tr>\n
-	  <td class=\"ttd\"><div class=\"eventHeader\">Location</div></td>\n
-          <td class=\"ttd\"><div class=\"eventHeader\">Date/Time</div></td>\n
-	  <td class=\"ttd\"><div class=\"eventHeader\">Rule ID</div></td>\n
-	  <td class=\"ttd\"><div class=\"eventHeader\">Level</div></td>\n
-	  <td class=\"ttd\"><div class=\"eventHeader\">Summary</div></td>\n
-	  <td class=\"ttd\"><div class=\"eventHeader\">Information</div></td>
-	  <td class=\"ttd\"></td>\n
-	  </tr>\n
-	  ";
-		
-    while($evt_count >= 0)
-    {
-      $alert = $alert_list[$evt_count];
-      $pos = strpos($alert['location'], '>');
-      $name = substr($alert['location'], 0, ($pos-1));
-        
-      if ($name == $USER_host)
-      {
-        $al_date = date('Y M d H:i:s', $alert{'time'});
-	echo "<tr>\n<td class=\"ttd\">\n".strstr($alert{'location'},'>')."</td>\n
-	      <td class=\"ttd\">".$al_date."</td>\n
-	      <td align=center class=\"ttd\">".$alert{'id'}."</td>\n
-	      <td align=center class=\"ttd\">".$alert{'level'}."</td>\n
-	      <td class=\"ttd\">".$alert{'description'}."</td> \n
-	      <td width=20 class=\"ttd\"><div onclick=showEventDetails('".$evt_count."','layerDetails'); class=\"details\">More</div>
-	      <div id=\"".$evt_count."\" style=\"visibility: hidden; position: absolute;\">";
-	      foreach($alert{'msg'} as $alert_msg)
-	      {
-	        if($alert_msg == NULL)
-	        break;
-	        echo $alert_msg;
-	      }
-	      echo "</div></td>\n</tr>\n";
-      }
-      $evt_count--;
-    } 
-  }
-  echo "</table>\n";
+        /* We have alerts */
+        /* Alerts table */
+        echo '
+        <table width="100%" cellpadding="0" cellspacing="0" border="0">
+        <tr>
+        <td class="ttd"><div class="eventHeader">Location</div></td>
+        <td class="ttd"><div class="eventHeader">Date/Time</div></td>
+        <td class="ttd"><div class="eventHeader">Rule ID</div></td>
+        <td class="ttd"><div class="eventHeader">Level</div></td>
+        <td class="ttd"><div class="eventHeader">Summary</div></td>
+        <td class="ttd"><div class="eventHeader">Information</div></td>
+        <td class="ttd"></td>
+        </tr>
+        ';
+
+        foreach ($agent_list as $agent)
+        {
+                $evt_count = sizeof($alert_list) -1;
+                while($evt_count >= 0)
+                {
+                        $alert = $alert_list[$evt_count];
+                        $al_date = date('Y M d H:i:s', $alert{'time'});
+                        /* Pump out the alert information */
+                        echo "<tr>\n";
+                        /* Location */
+                        echo "<td class=\"ttd\">".$alert{'location'}."</td>\n";
+                        /*  Date */
+                        echo "<td class=\"ttd\">".$al_date."</td>\n";
+                        /* Alert ID */
+                        echo "<td align=center class=\"ttd\">".$alert{'id'}."</td>\n";
+                        /* Alert Level */
+                        echo "<td align=center class=\"ttd\">".$alert{'level'}."</td>\n";
+                        /* Alert Description */
+                        echo "<td class=\"ttd\">".$alert{'description'}."</td> \n";
+                        /* Link to alert Details */
+                        echo "<td width=20 class=\"ttd\"><div onclick=showEventDetails('".$evt_count."','layerDetails'); class=\"details\">More</div>";
+                        /* Alert Details in Hidden element */
+                        echo "<div id=\"".$evt_count."\" style=\"visibility: hidden; position: absolute;\">";
+                        foreach($alert{'msg'} as $alert_msg)
+                        {
+                                if($alert_msg == NULL)
+                                        break;
+                                echo $alert_msg;
+                        }
+                        echo "</div></td>\n</tr>\n";
+                        /* End Alert Details in Hidden Element */
+                        /* END ALERT */
+                        $evt_count--;
+                }
+        }
+        echo "</table>\n";
 }
 ?>
 </div>
-<!-- END EVENT DETAILS -->
+<!-- END EVENT DETAILS -->
\ No newline at end of file


OSSEC home | Main Index | Thread Index


OSSEC project: www.ossec.net.
Mailling list information: http://www.ossec.net/en/mailing_lists.html.