Unsupported scripts and control panel web app for a hosting company
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

adminlog.php 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?PHP
  2. if (!defined('LIB_DATABASE')) { require_once('lib/database.php'); }
  3. if (!defined('LIB_COMMON')) { require_once('lib/common.php'); }
  4. if (!defined('ADMIN') || !ADMIN) { die('Admins only'); }
  5. ?>
  6. <div class="block" id="log">
  7. <h2>ADMIN: Control panel log</h2>
  8. <table class="innerblock">
  9. <tr>
  10. <th>Time</th>
  11. <th>User</th>
  12. <th>Level</th>
  13. <th>Message</th>
  14. </tr>
  15. <?PHP
  16. $i = 0;
  17. $sql = 'SELECT user_id, user_name, log_level, log_time, log_message FROM log ';
  18. $sql .= 'NATURAL JOIN users ORDER BY log_time DESC LIMIT 0,25';
  19. $res = mysql_query($sql) or mf(__FILE__, __LINE__, $sql);
  20. while ($row = mysql_fetch_array($res)) {
  21. echo '<tr class="'.(($i != 0) ? 'odd':'even').'"><td>'.gmdate('r',$row['log_time']).'</td><td><a href="'.CP_PATH.'checkuser/'.$row['user_id'].'">';
  22. echo $row['user_name'].'</a></td>';
  23. switch($row['log_level']) {
  24. case 'critical':
  25. echo '<td style="color: red; font-weight: bold;">Critical</td>';
  26. break;
  27. case 'important':
  28. echo '<td style="font-weight: bold;">Important</td>';
  29. break;
  30. case 'normal':
  31. case 'unknown':
  32. echo '<td>'.ucfirst($row['log_level']).'</td>';
  33. break;
  34. case 'info':
  35. echo '<td style="color: gray">Information</td>';
  36. }
  37. echo '<td>'. $row['log_message'].'</td></tr>';
  38. $i = 1 - $i;
  39. }
  40. ?>
  41. </table>
  42. </div>