Changeset 79 for branches/1.1dev/lib


Ignore:
Timestamp:
Apr 5, 2006 7:16:48 PM (18 years ago)
Author:
scdev
Message:

axis-out checkin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1dev/lib/App.inc.php

    r78 r79  
    104104    if (!is_dir($CFG->log_directory) || !is_writable($CFG->log_directory)) {
    105105        // 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'));
    107109    }
    108110   
     
    121123   
    122124    // FILE ACTION
    123     if ($priority <= $CFG->log_file_priority && $CFG->log_file_priority) {
     125    if ($CFG->log_file_priority && $priority <= $CFG->log_file_priority) {
    124126        error_log($event_str . "\n", 3, $CFG->log_directory . '/' . $CFG->log_filename);
    125127    }
    126128
    127129    // EMAIL ACTION
    128     if ($priority <= $CFG->log_email_priority && $CFG->log_email_priority) {
     130    if ($CFG->log_email_priority && $priority <= $CFG->log_email_priority) {
    129131        if (empty($CFG->log_to_email)) {
    130132            $CFG->log_to_email = 'bug@strangecode.com';
     
    140142   
    141143    // SMS ACTION
    142     if ($priority <= $CFG->log_sms_priority && $CFG->log_sms_priority) {
     144    if ($CFG->log_sms_priority && $priority <= $CFG->log_sms_priority) {
    143145        if (empty($CFG->log_to_email)) {
    144146            $CFG->log_to_sms = 'bug@strangecode.com';
     
    150152
    151153    // SCREEN ACTION
    152     if ($priority <= $CFG->log_screen_priority && $CFG->log_screen_priority) {
     154    if ($CFG->log_screen_priority && $priority <= $CFG->log_screen_priority) {
    153155        echo "[{$event['date']}] [{$event['type']}] [{$event['file:line']}] [{$event['message']}]\n";
    154156    }
     
    292294}
    293295
    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*/
     311function dieBoomerangURL($id=null, $carry_args=null, $default_url=null)
    301312{
    302313    // Get URL from stored boomerang. Allow non specific URL if ID not valid.
     
    307318            $url = end($_SESSION['_boomerang']['url']);
    308319        }
    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()) {
    310323        // 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.
    312324        $url = getenv('HTTP_REFERER');
    313325    } else {
Note: See TracChangeset for help on using the changeset viewer.