2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* Inclusive Design Institute */
8 /* This program is free software. You can redistribute it and/or */
9 /* modify it under the terms of the GNU General Public License */
10 /* as published by the Free Software Foundation. */
11 /************************************************************************/
14 define('AT_INCLUDE_PATH', '../include/');
15 require(AT_INCLUDE_PATH.'vitals.inc.php');
16 admin_authenticate(AT_ADMIN_PRIV_ADMIN);
18 require(AT_INCLUDE_PATH.'header.inc.php');
22 <form name="form" method="post" action="admin/error_logging_details.php">
23 <table class="data" summary="" rules="cols">
26 <th><?php echo _AT('profile'); ?></th>
27 <th><?php echo _AT('date'); ?></th>
28 <th><?php echo _AT('bug_count'); ?></th>
34 <input type="submit" name="view" value="<?php echo _AT('view_profile_bugs'); ?>" />
35 <input type="submit" name="delete" value="<?php echo _AT('delete_profile'); ?>" />
42 $dir_ = AT_CONTENT_DIR . 'logs';
47 if (!($dir = @opendir($dir_))) {
48 $msg->printNoLookupFeedback('Could not access /content/logs. Check that the permission for the <strong>Server</string> user are r+w to it');
49 require(AT_INCLUDE_PATH.'footer.inc.php');
55 * Run through the logs directory and lets get all the profiles of all the logs of all the dates, sort
56 * by primary key as date, secondary key is profile name
60 // loop through folder to get files and directory listing
61 while (($file = readdir($dir)) !== false) {
63 /* if the name is not a directory */
64 if( ($file == '.') || ($file == '..')) {
68 if (is_dir($dir_ . '/' . $file)) {
69 $logdirs{$file} = $file; // store the day log dir
72 closedir($dir); // clean it up
74 if (empty($logdirs)) { ?>
76 <td colspan="3"><?php echo _AT('none_found'); ?></td>
82 foreach ($logdirs as $row => $val) {
83 $log_profiles; // store all the profiles under the dir /content/logs/$val
84 $log_profiles_bug_count; // store the amount of bugs per profile
86 if (!($dir = opendir($dir_ . '/' . $val))) {
87 $msg->printNoLookupFeedback('Could not access /content/logs/' . $val . '. Check that the permission for the <strong>Server</string> user are r+w to it');
88 require(AT_INCLUDE_PATH.'footer.inc.php');
92 // Open a read pointer to run through each log date directory getting all the profiles
93 while (($file = readdir($dir)) !== false) {
95 if (($file == '.') || ($file == '..') || is_dir($file)) {
99 if (strpos($file, 'profile') !== false) { // found a profile, store its md5 key identifier
100 $tmp_ = substr($file, strpos($file, '_') + 1);
101 $tmp_ = substr($tmp_, 0, strpos($tmp_, '.log.php'));
102 $log_profiles{$file} = $tmp_;
106 closedir($dir); // clean it up
109 * Open a read pointer to run through each log date directory getting all the bugs associated
110 * all the profiles in $log_profiles
112 if (empty($log_profiles)) {
113 $msg->printNoLookupFeedback('Warning. No profile found in ' . $dir_ . '/' . $val);
114 require(AT_INCLUDE_PATH.'footer.inc.php');
119 foreach ($log_profiles as $elem => $val_) {
122 /* for each profile get the number of bugs associated with it */
123 if (!($dir = opendir($dir_ . '/' . $val))) {
124 $msg->printNoLookupFeedback('Could not access /content/logs' . $val . '. Check that the permission for the <strong>Server</string> user are r+w to it');
125 require(AT_INCLUDE_PATH.'footer.inc.php');
130 while (($file = readdir($dir)) !== false) {
132 // make sure we ignore profiles too!, just look at bug files
133 if( ($file == '.') || ($file == '..') || is_dir($file) || (strpos($file, 'profile') !== false)) {
137 // found a bug that maps to $val_ md5 profile identifer
138 if (strpos($file, $val_) !== false) {
144 // store the amount of bugs associated with profile
145 $log_profiles_bug_count{$val}[$val_] = $count;
147 $log_profiles = array();
150 * At this point ($log_profiles => key) = ($log_profiles_bug_count => key).
152 * Lets print out <td> rows corresponding to all profiles found in the following format:
154 * Profile name, profile date, profile bug count.
156 foreach ($log_profiles_bug_count as $day => $profile) :
157 foreach ($profile as $stamp => $total) :
159 <tr onmousedown="document.form['<?php echo $stamp.$day; ?>'].checked = true;rowselect(this);" id="r_<?php echo $stamp.$day; ?>">
160 <td><input type="radio" id="<?php echo $stamp.$day; ?>" value="<?php echo $stamp.':'.$day; ?>" name="data" /><label for="<?php echo $stamp.$day; ?>"><?php echo $count_; ?></label></td>
161 <td><?php echo $day; ?></td>
162 <td><?php echo $total; ?></td>
175 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>