comparison modules/dblog/dblog.module @ 5:2427550111ae 6.2

Drupal 6.2
author Franck Deroche <webmaster@defr.org>
date Tue, 23 Dec 2008 14:30:08 +0100
parents c1f4ac30525a
children
comparison
equal deleted inserted replaced
4:d94886ac61a0 5:2427550111ae
1 <?php 1 <?php
2 // $Id: dblog.module,v 1.21 2008/01/08 10:35:41 goba Exp $ 2 // $Id: dblog.module,v 1.21.2.2 2008/04/09 21:11:46 goba Exp $
3 3
4 /** 4 /**
5 * @file 5 * @file
6 * System monitoring and logging for administrators. 6 * System monitoring and logging for administrators.
7 * 7 *
45 $items['admin/settings/logging/dblog'] = array( 45 $items['admin/settings/logging/dblog'] = array(
46 'title' => 'Database logging', 46 'title' => 'Database logging',
47 'description' => 'Settings for logging to the Drupal database logs. This is the most common method for small to medium sites on shared hosting. The logs are viewable from the admin pages.', 47 'description' => 'Settings for logging to the Drupal database logs. This is the most common method for small to medium sites on shared hosting. The logs are viewable from the admin pages.',
48 'page callback' => 'drupal_get_form', 48 'page callback' => 'drupal_get_form',
49 'page arguments' => array('dblog_admin_settings'), 49 'page arguments' => array('dblog_admin_settings'),
50 'access arguments' => array('administer site configuration'),
50 'file' => 'dblog.admin.inc', 51 'file' => 'dblog.admin.inc',
51 ); 52 );
52 53
53 $items['admin/reports/dblog'] = array( 54 $items['admin/reports/dblog'] = array(
54 'title' => 'Recent log entries', 55 'title' => 'Recent log entries',
55 'description' => 'View events that have recently been logged.', 56 'description' => 'View events that have recently been logged.',
56 'page callback' => 'dblog_overview', 57 'page callback' => 'dblog_overview',
58 'access arguments' => array('access site reports'),
57 'weight' => -1, 59 'weight' => -1,
58 'file' => 'dblog.admin.inc', 60 'file' => 'dblog.admin.inc',
59 ); 61 );
60 $items['admin/reports/page-not-found'] = array( 62 $items['admin/reports/page-not-found'] = array(
61 'title' => "Top 'page not found' errors", 63 'title' => "Top 'page not found' errors",
62 'description' => "View 'page not found' errors (404s).", 64 'description' => "View 'page not found' errors (404s).",
63 'page callback' => 'dblog_top', 65 'page callback' => 'dblog_top',
64 'page arguments' => array('page not found'), 66 'page arguments' => array('page not found'),
67 'access arguments' => array('access site reports'),
65 'file' => 'dblog.admin.inc', 68 'file' => 'dblog.admin.inc',
66 ); 69 );
67 $items['admin/reports/access-denied'] = array( 70 $items['admin/reports/access-denied'] = array(
68 'title' => "Top 'access denied' errors", 71 'title' => "Top 'access denied' errors",
69 'description' => "View 'access denied' errors (403s).", 72 'description' => "View 'access denied' errors (403s).",
70 'page callback' => 'dblog_top', 73 'page callback' => 'dblog_top',
71 'page arguments' => array('access denied'), 74 'page arguments' => array('access denied'),
75 'access arguments' => array('access site reports'),
72 'file' => 'dblog.admin.inc', 76 'file' => 'dblog.admin.inc',
73 ); 77 );
74 $items['admin/reports/event/%'] = array( 78 $items['admin/reports/event/%'] = array(
75 'title' => 'Details', 79 'title' => 'Details',
76 'page callback' => 'dblog_event', 80 'page callback' => 'dblog_event',
77 'page arguments' => array(3), 81 'page arguments' => array(3),
82 'access arguments' => array('access site reports'),
78 'type' => MENU_CALLBACK, 83 'type' => MENU_CALLBACK,
79 'file' => 'dblog.admin.inc', 84 'file' => 'dblog.admin.inc',
80 ); 85 );
81 return $items; 86 return $items;
82 } 87 }
96 * Remove expired log messages and flood control events. 101 * Remove expired log messages and flood control events.
97 */ 102 */
98 function dblog_cron() { 103 function dblog_cron() {
99 // Cleanup the watchdog table 104 // Cleanup the watchdog table
100 $max = db_result(db_query('SELECT MAX(wid) FROM {watchdog}')); 105 $max = db_result(db_query('SELECT MAX(wid) FROM {watchdog}'));
101 db_query('DELETE FROM {watchdog} WHERE wid < %d', $max - variable_get('dblog_row_limit', 1000)); 106 db_query('DELETE FROM {watchdog} WHERE wid <= %d', $max - variable_get('dblog_row_limit', 1000));
102 } 107 }
103 108
104 /** 109 /**
105 * Implementation of hook_user(). 110 * Implementation of hook_user().
106 */ 111 */