Changeset 3231 in subversion


Ignore:
Timestamp:
Jan 28, 2010 6:27:16 AM (3 years ago)
Author:
alec
Message:
  • add file/line definitions to raise_error() calls
Location:
trunk/roundcubemail
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/index.php

    r3208 r3231  
    112112        $_SERVER['REMOTE_ADDR'])); 
    113113    } 
    114      
     114 
    115115    // restore original request parameters 
    116116    $query = array(); 
  • trunk/roundcubemail/program/include/rcmail.php

    r3227 r3231  
    507507      else { 
    508508        raise_error(array( 
    509           'code' => 600, 
    510           'type' => 'php', 
     509          'code' => 600, 'type' => 'php', 
     510          'file' => __FILE__, 'line' => __LINE__, 
    511511          'message' => "Failed to create a user record. Maybe aborted by a plugin?" 
    512           ), true, false);         
     512          ), true, false); 
    513513      } 
    514514    } 
    515515    else { 
    516516      raise_error(array( 
    517         'code' => 600, 
    518         'type' => 'php', 
    519         'file' => RCMAIL_CONFIG_DIR."/main.inc.php", 
     517        'code' => 600, 'type' => 'php', 
     518        'file' => __FILE__, 'line' => __LINE__, 
    520519        'message' => "Acces denied for new user $username. 'auto_create_user' is disabled" 
    521520        ), true, false); 
     
    948947    { 
    949948      raise_error(array( 
    950         'code' => 500, 
    951         'type' => 'php', 
    952         'file' => __FILE__, 
     949        'code' => 500, 'type' => 'php', 
     950        'file' => __FILE__, 'line' => __LINE__, 
    953951        'message' => "Could not perform encryption; make sure Mcrypt is installed or lib/des.inc is available" 
    954952      ), true, true); 
     
    994992    { 
    995993      raise_error(array( 
    996         'code' => 500, 
    997         'type' => 'php', 
    998         'file' => __FILE__, 
     994        'code' => 500, 'type' => 'php', 
     995        'file' => __FILE__, 'line' => __LINE__, 
    999996        'message' => "Could not perform decryption; make sure Mcrypt is installed or lib/des.inc is available" 
    1000997      ), true, true); 
  • trunk/roundcubemail/program/include/rcube_config.php

    r3212 r3231  
    181181    $this->prop = array_merge($this->prop, $prefs); 
    182182  } 
    183    
     183 
    184184   
    185185  /** 
     
    192192    return $this->prop; 
    193193  } 
     194 
    194195 
    195196  /** 
     
    205206    { 
    206207      raise_error(array( 
    207         'code' => 500, 
    208         'type' => 'php', 
    209         'file' => __FILE__, 
     208        'code' => 500, 'type' => 'php', 
     209        'file' => __FILE__, 'line' => __LINE__, 
    210210        'message' => "Request for unconfigured crypto key \"$key\"" 
    211211      ), true, true); 
     
    218218    { 
    219219      raise_error(array( 
    220         'code' => 500, 
    221         'type' => 'php', 
    222         'file' => __FILE__, 
     220        'code' => 500, 'type' => 'php', 
     221        'file' => __FILE__, 'line' => __LINE__, 
    223222        'message' => "Configured crypto key \"$key\" is not exactly 24 bytes long" 
    224223      ), true, true); 
     
    227226    return $key; 
    228227  } 
     228 
    229229 
    230230  /** 
     
    245245      return "\n"; 
    246246  } 
    247  
    248    
    249    
     247   
     248 
    250249  /** 
    251250   * Return the mail domain configured for the given host 
  • trunk/roundcubemail/program/include/rcube_imap.php

    r3212 r3231  
    106106      $ICL_SSL = $use_ssl == 'imaps' ? 'ssl' : $use_ssl; 
    107107    else if ($use_ssl) { 
    108       raise_error(array('code' => 403, 'type' => 'imap', 'file' => __FILE__, 
    109                         'message' => 'Open SSL not available;'), TRUE, FALSE); 
     108      raise_error(array('code' => 403, 'type' => 'imap', 
     109        'file' => __FILE__, 'line' => __LINE__, 
     110        'message' => "Open SSL not available"), TRUE, FALSE); 
    110111      $port = 143; 
    111112    } 
     
    137138      { 
    138139      $this->error_code = $GLOBALS['iil_errornum']; 
    139       raise_error(array('code' => 403, 
    140                        'type' => 'imap', 
    141                        'message' => $GLOBALS['iil_error']), TRUE, FALSE); 
     140      raise_error(array('code' => 403, 'type' => 'imap', 
     141        'file' => __FILE__, 'line' => __LINE__, 
     142        'message' => $GLOBALS['iil_error']), TRUE, FALSE); 
    142143      } 
    143144 
  • trunk/roundcubemail/program/include/rcube_ldap.php

    r3230 r3231  
    8585     
    8686    if (!function_exists('ldap_connect')) 
    87       raise_error(array('code' => 100, 'type' => 'ldap', 'message' => "No ldap support in this installation of PHP"), true); 
     87      raise_error(array('code' => 100, 'type' => 'ldap', 
     88        'file' => __FILE__, 'line' => __LINE__, 
     89        'message' => "No ldap support in this installation of PHP"), true); 
    8890 
    8991    if (is_resource($this->conn)) 
     
    141143    } 
    142144    else 
    143       raise_error(array('code' => 100, 'type' => 'ldap', 'message' => "Could not connect to any LDAP server, tried $host:{$this->prop[port]} last"), true); 
     145      raise_error(array('code' => 100, 'type' => 'ldap', 
     146        'file' => __FILE__, 'line' => __LINE__, 
     147        'message' => "Could not connect to any LDAP server, last tried $host:{$this->prop[port]}"), true); 
    144148 
    145149    // See if the directory is writeable. 
     
    174178 
    175179    raise_error(array( 
    176         'code' => ldap_errno($this->conn), 
    177         'type' => 'ldap', 
     180        'code' => ldap_errno($this->conn), 'type' => 'ldap', 
     181        'file' => __FILE__, 'line' => __LINE__, 
    178182        'message' => "Bind failed for dn=$dn: ".ldap_error($this->conn)), 
    179183        true); 
  • trunk/roundcubemail/program/include/rcube_mdb2.php

    r3227 r3231  
    267267        $this->db_error_msg = $q->userinfo; 
    268268 
    269         raise_error(array('code' => 500, 'type' => 'db', 'line' => __LINE__, 'file' => __FILE__, 
    270                           'message' => $this->db_error_msg), TRUE, TRUE); 
     269        raise_error(array('code' => 500, 'type' => 'db', 
     270          'line' => __LINE__, 'file' => __FILE__, 
     271          'message' => $this->db_error_msg), TRUE, TRUE); 
    271272        } 
    272273      else 
     
    627628      $this->db_error = TRUE; 
    628629      $this->db_error_msg = $res->getMessage(); 
    629       raise_error(array('code' => 500, 'type' => 'db', 'line' => __LINE__, 'file' => __FILE__, 
     630      raise_error(array('code' => 500, 'type' => 'db', 
     631            'line' => __LINE__, 'file' => __FILE__, 
    630632            'message' => $res->getMessage() . " Query: "  
    631633            . substr(preg_replace('/[\r\n]+\s*/', ' ', $res->userinfo), 0, 512)), 
  • trunk/roundcubemail/program/include/rcube_plugin.php

    r3212 r3231  
    6161    $rcmail = rcmail::get_instance(); 
    6262    if (is_file($fpath) && !$rcmail->config->load_from_file($fpath, false)) { 
    63       raise_error(array('code' => 527, 'type' => 'php', 'message' => "Failed to load config from $fpath"), true, false); 
     63      raise_error(array('code' => 527, 'type' => 'php', 
     64        'file' => __FILE__, 'line' => __LINE__, 
     65        'message' => "Failed to load config from $fpath"), true, false); 
    6466      return false; 
    6567    } 
     
    134136  { 
    135137    if ($task != asciiwords($task)) { 
    136       raise_error(array('code' => 526, 'type' => 'php', 'message' => "Invalid task name: $task. Only characters [a-z0-9_.-] are allowed"), true, false); 
     138      raise_error(array('code' => 526, 'type' => 'php', 
     139        'file' => __FILE__, 'line' => __LINE__, 
     140        'message' => "Invalid task name: $task. Only characters [a-z0-9_.-] are allowed"), true, false); 
    137141    } 
    138142    else if (in_array(rcmail::$main_tasks, $task)) { 
    139       raise_error(array('code' => 526, 'type' => 'php', 'message' => "Cannot register taks $task; already taken by another plugin or the application itself"), true, false); 
     143      raise_error(array('code' => 526, 'type' => 'php', 
     144        'file' => __FILE__, 'line' => __LINE__, 
     145        'message' => "Cannot register taks $task; already taken by another plugin or the application itself"), true, false); 
    140146    } 
    141147    else { 
  • trunk/roundcubemail/program/include/rcube_plugin_api.php

    r3212 r3231  
    9797        } 
    9898        else { 
    99           raise_error(array('code' => 520, 'type' => 'php', 'message' => "No plugin class $plugin_name found in $fn"), true, false); 
     99          raise_error(array('code' => 520, 'type' => 'php', 
     100            'file' => __FILE__, 'line' => __LINE__, 
     101            'message' => "No plugin class $plugin_name found in $fn"), true, false); 
    100102        } 
    101103      } 
    102104      else { 
    103         raise_error(array('code' => 520, 'type' => 'php', 'message' => "Failed to load plugin file $fn"), true, false); 
     105        raise_error(array('code' => 520, 'type' => 'php', 
     106          'file' => __FILE__, 'line' => __LINE__, 
     107          'message' => "Failed to load plugin file $fn"), true, false); 
    104108      } 
    105109    } 
     
    137141      // trigger fatal error if still not loaded 
    138142      if (!$loaded) { 
    139         raise_error(array('code' => 520, 'type' => 'php', 'message' => "Requried plugin $plugin_name was not loaded"), true, true); 
     143        raise_error(array('code' => 520, 'type' => 'php', 
     144          'file' => __FILE__, 'line' => __LINE__, 
     145          'message' => "Requried plugin $plugin_name was not loaded"), true, true); 
    140146      } 
    141147    } 
     
    168174      $this->handlers[$hook][] = $callback; 
    169175    else 
    170       raise_error(array('code' => 521, 'type' => 'php', 'message' => "Invalid callback function for $hook"), true, false); 
     176      raise_error(array('code' => 521, 'type' => 'php', 
     177        'file' => __FILE__, 'line' => __LINE__, 
     178        'message' => "Invalid callback function for $hook"), true, false); 
    171179  } 
    172180   
     
    221229    } 
    222230    else { 
    223       raise_error(array('code' => 523, 'type' => 'php', 'message' => "Cannot register action $action; already taken by another plugin"), true, false); 
     231      raise_error(array('code' => 523, 'type' => 'php', 
     232        'file' => __FILE__, 'line' => __LINE__, 
     233        'message' => "Cannot register action $action; already taken by another plugin"), true, false); 
    224234    } 
    225235  } 
     
    238248    } 
    239249    else { 
    240       raise_error(array('code' => 524, 'type' => 'php', 'message' => "No handler found for action $action"), true, true); 
     250      raise_error(array('code' => 524, 'type' => 'php', 
     251        'file' => __FILE__, 'line' => __LINE__, 
     252        'message' => "No handler found for action $action"), true, true); 
    241253    } 
    242254  } 
     
    262274    } 
    263275    else { 
    264       raise_error(array('code' => 525, 'type' => 'php', 'message' => "Cannot register template handler $name; already taken by another plugin"), true, false); 
     276      raise_error(array('code' => 525, 'type' => 'php', 
     277        'file' => __FILE__, 'line' => __LINE__, 
     278        'message' => "Cannot register template handler $name; already taken by another plugin"), true, false); 
    265279    } 
    266280  } 
  • trunk/roundcubemail/program/include/rcube_template.php

    r3226 r3231  
    291291            // prevent from endless loops 
    292292            if ($exit != 'recur' && $this->app->plugins->is_processing('render_page')) { 
    293                 raise_error(array('code' => 505, 'type' => 'php', 'message' => 'Recursion alert: ignoring output->send()'), true, false); 
     293                raise_error(array('code' => 505, 'type' => 'php', 
     294                    'file' => __FILE__, 'line' => __LINE__, 
     295                    'message' => 'Recursion alert: ignoring output->send()'), true, false); 
    294296                return; 
    295297            } 
  • trunk/roundcubemail/program/steps/mail/sendmail.inc

    r3219 r3231  
    3131 
    3232if (!isset($_SESSION['compose']['id'])) { 
    33   raise_error(array('code' => 500, 'type' => 'smtp', 'file' => __FILE__, 'message' => "Invalid compose ID"), true, false); 
    34   console("Sendmail error", $_SESSION['compose']); 
     33  raise_error(array('code' => 500, 'type' => 'smtp', 
     34    'file' => __FILE__, 'line' => __LINE__, 
     35    'message' => "Invalid compose ID"), true, false); 
     36 
    3537  $OUTPUT->show_message("An internal error occured. Please try again.", 'error'); 
    3638  $OUTPUT->send('iframe'); 
  • trunk/roundcubemail/program/steps/mail/spell_pspell.inc

    r3223 r3231  
    2424      'code' => 500, 
    2525      'type' => 'php', 
    26       'file' => __FILE__, 
     26      'file' => __FILE__, 'line' => __LINE__, 
    2727      'message' => "Pspell extension not available"), true, false); 
    2828       
  • trunk/roundcubemail/program/steps/mail/viewsource.inc

    r2613 r3231  
    5151      'code' => 500, 
    5252      'type' => 'php', 
     53      'file' => __FILE__, 'line' => __LINE__, 
    5354      'message' => 'Message UID '.$uid.' not found'), 
    54     true, 
    55     true); 
     55    true, true); 
    5656} 
    5757 
Note: See TracChangeset for help on using the changeset viewer.