Changeset 79 for branches/1.1dev/lib
- Timestamp:
- Apr 5, 2006 7:16:48 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.1dev/lib/App.inc.php
r78 r79 104 104 if (!is_dir($CFG->log_directory) || !is_writable($CFG->log_directory)) { 105 105 // We must use trigger_error rather than calling logMsg, which might lead to an infinite loop. 106 trigger_error(sprintf('Codebase error: log directory (%s) not found or writable.', $CFG->log_directory), E_USER_ERROR); 106 trigger_error(sprintf('Codebase error: log directory not found or writable: %s', $CFG->log_directory), E_USER_NOTICE); 107 $CFG->log_directory = '/tmp'; 108 $CFG->log_filename = sprintf('%s_%s.log', getenv('USER'), getenv('HTTP_HOST')); 107 109 } 108 110 … … 121 123 122 124 // FILE ACTION 123 if ($ priority <= $CFG->log_file_priority &&$CFG->log_file_priority) {125 if ($CFG->log_file_priority && $priority <= $CFG->log_file_priority) { 124 126 error_log($event_str . "\n", 3, $CFG->log_directory . '/' . $CFG->log_filename); 125 127 } 126 128 127 129 // EMAIL ACTION 128 if ($ priority <= $CFG->log_email_priority &&$CFG->log_email_priority) {130 if ($CFG->log_email_priority && $priority <= $CFG->log_email_priority) { 129 131 if (empty($CFG->log_to_email)) { 130 132 $CFG->log_to_email = 'bug@strangecode.com'; … … 140 142 141 143 // SMS ACTION 142 if ($ priority <= $CFG->log_sms_priority &&$CFG->log_sms_priority) {144 if ($CFG->log_sms_priority && $priority <= $CFG->log_sms_priority) { 143 145 if (empty($CFG->log_to_email)) { 144 146 $CFG->log_to_sms = 'bug@strangecode.com'; … … 150 152 151 153 // SCREEN ACTION 152 if ($ priority <= $CFG->log_screen_priority &&$CFG->log_screen_priority) {154 if ($CFG->log_screen_priority && $priority <= $CFG->log_screen_priority) { 153 155 echo "[{$event['date']}] [{$event['type']}] [{$event['file:line']}] [{$event['message']}]\n"; 154 156 } … … 292 294 } 293 295 294 /** 295 * Redirects a user by calling the dieURL(). It will use: 296 * 1. the stored boomerang URL, it it exists 297 * 2. the referring URL, it it exists. 298 * 3. an empty string, which will force dieURL to use the default URL. 299 */ 300 function dieBoomerangURL($id=null, $carry_args=null) 296 /* 297 * Redirects a user by calling App::dieURL(). It will use: 298 * 1. the stored boomerang URL, it it exists 299 * 2. a specified $default_url, it it exists 300 * 3. the referring URL, it it exists. 301 * 4. redirect_home_url configuration variable. 302 * 303 * @access public 304 * @param string $id Identifier for this script. 305 * @param mixed $carry_args Additional arguments to carry in the URL automatically (see App::oHREF()). 306 * @param string $default_url A default URL if there is not a valid specified boomerang URL. 307 * @return bool False if the session is not running. No return otherwise. 308 * @author Quinn Comendant <quinn@strangecode.com> 309 * @since 31 Mar 2006 19:17:00 310 */ 311 function dieBoomerangURL($id=null, $carry_args=null, $default_url=null) 301 312 { 302 313 // Get URL from stored boomerang. Allow non specific URL if ID not valid. … … 307 318 $url = end($_SESSION['_boomerang']['url']); 308 319 } 309 } else if (!refererIsMe() && !preg_match('/admin_common/', getenv('SCRIPT_NAME'))) { 320 } else if (isset($default_url)) { 321 $url = $default_url; 322 } else if (!refererIsMe()) { 310 323 // Ensure that the redirecting page is not also the referrer. 311 // admin_common is an alias of 'admin', which confuses this function. Just here for local testing.312 324 $url = getenv('HTTP_REFERER'); 313 325 } else {
Note: See TracChangeset
for help on using the changeset viewer.