- Timestamp:
- 01/01/08 03:32:42 (11 months ago)
- Location:
- trunk
- Files:
-
- 3 modified
-
admin/index.php (modified) (1 diff)
-
common/mvblog_admin.php (modified) (4 diffs)
-
common/mvblog_log.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/index.php
r770 r773 176 176 $admin->show_userlog(); 177 177 break; 178 case "show_adminlog" : 179 $admin->show_adminlog(); 180 break; 178 181 default : 179 182 $admin->show_index(); -
trunk/common/mvblog_admin.php
r770 r773 70 70 break; 71 71 case "show_userlog": 72 $this->_selected_menuitem = "users"; 73 $this->_selected_submenuitem = "log"; 72 $this->_selected_menuitem = "log"; 73 $this->_selected_submenuitem = "users"; 74 break; 75 case "show_adminlog": 76 $this->_selected_menuitem = "log"; 77 $this->_selected_submenuitem = "admin"; 74 78 break; 75 79 case "show_authors" : … … 369 373 <a class="if_menu_item<?php if ($this->_selected_menuitem == "plugins") { echo "_act"; } ?>" href="./index.php?action=show_plugins"><?php echo gettext("Plugins"); ?></a> 370 374 <a class="if_menu_item<?php if ($this->_selected_menuitem == "import") { echo "_act"; } ?>" href="./index.php?action=show_import"><?php echo gettext("Import"); ?></a> 375 <a class="if_menu_item<?php if ($this->_selected_menuitem == "log") { echo "_act"; } ?>" href="./index.php?action=show_adminlog"><?php echo gettext("Log"); ?></a> 371 376 <a class="if_menu_item" href="./index.php?action=logout"><?php echo gettext("Logout"); ?></a> 372 377 </div> … … 399 404 <a class="if_submenu_item<?php if ($this->_selected_submenuitem == "index") { echo "_act"; } ?>" href="./index.php"><?php echo gettext("Main"); ?></a> 400 405 <a class="if_submenu_item<?php if ($this->_selected_submenuitem == "about") { echo "_act"; } ?>" href="./index.php?action=show_about"><?php echo gettext("About"); ?></a> 406 <?php 407 break; 408 case "log" : 409 ?> 410 <a class="if_submenu_item<?php if ($this->_selected_submenuitem == "admin") { echo "_act"; } ?>" href="./index.php?action=show_adminlog"><?php echo gettext("Backend"); ?></a> 411 <a class="if_submenu_item<?php if ($this->_selected_submenuitem == "users") { echo "_act"; } ?>" href="./index.php?action=show_userlog"><?php echo gettext("Frontend"); ?></a> 401 412 <?php 402 413 break; … … 2046 2057 */ 2047 2058 public function show_userlog() { 2048 $this->log->show_log(); 2059 $this->log->show_log(2); 2060 } 2061 /* }}} */ 2062 /* show_adminlog {{{ */ 2063 /** 2064 * Show a log of what happened 2065 */ 2066 public function show_adminlog() { 2067 $this->log->show_log(1); 2049 2068 } 2050 2069 /* }}} */ -
trunk/common/mvblog_log.php
r770 r773 68 68 public function get_log($user_type = 0, $count = 25, $ts_start = 0, $ts_end = 0) { 69 69 $logrecords = array(); 70 $sql = "SELECT * FROM log ORDER BY time DESC"; 70 switch ($user_type) { 71 case 1: 72 case 2: 73 $sql = sprintf("SELECT * FROM log WHERE user_type = %d ORDER BY time DESC", $user_type); 74 break; 75 default: 76 $sql = "SELECT * FROM log ORDER BY time DESC"; 77 break; 78 } 71 79 $res = $this->db->query($sql); 72 80 while ($row = $res->fetchRow(MDB2_FETCHMODE_ASSOC)) { … … 83 91 /** 84 92 * Show log overview 93 * 94 * @param int $user_type 1 for admin, 2 for users, 0 for everything 85 95 */ 86 public function show_log( ) {87 $logrecords = $this->get_log( );96 public function show_log($user_type = 1) { 97 $logrecords = $this->get_log($user_type); 88 98 echo "<table style=\"border: 1px solid black;\"><tr>\n"; 89 99 echo "\t<td style=\"border: 1px solid black;\">date</td><td style=\"border: 1px solid black;\">login</td><td style=\"border: 1px solid black;\">fullname</td>\n";
