Changeset 5828 in subversion for branches/devel-framework/roundcubemail


Ignore:
Timestamp:
Jan 27, 2012 4:16:56 AM (16 months ago)
Author:
alec
Message:
  • Unified raise_error() usage
Location:
branches/devel-framework/roundcubemail
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • branches/devel-framework/roundcubemail/installer/utils.php

    r5807 r5828  
    5656} 
    5757 
    58  
    59 /** 
    60  * Fake internal error handler to catch errors 
    61  */ 
    62 function raise_error($p) 
    63 { 
    64     $rci = rcube_install::get_instance(); 
    65     $rci->raise_error($p); 
    66 } 
    67  
    6858/** 
    6959 * Local callback function for PEAR errors 
     
    7161function __pear_error($err) 
    7262{ 
    73     raise_error(array( 
     63    rcmail::raise_error(array( 
    7464        'code' => $err->getCode(), 
    7565        'message' => $err->getMessage(), 
  • branches/devel-framework/roundcubemail/program/include/main.inc

    r5825 r5828  
    288288} 
    289289 
    290  
    291 // may be defined in Installer 
    292 if (!function_exists('raise_error')) { 
    293290function raise_error($arg=array(), $log=false, $terminate=false) 
    294291{ 
    295     rcube_ui::raise_error($arg, $log, $terminate); 
    296 } 
     292    rcmail::raise_error($arg, $log, $terminate); 
    297293} 
    298294 
    299295function rcube_log_bug($arg_arr) 
    300296{ 
    301     rcube_ui::log_bug($arg_arr); 
     297    rcmail::log_bug($arg_arr); 
    302298} 
    303299 
  • branches/devel-framework/roundcubemail/program/include/rcmail.php

    r5822 r5828  
    366366    if (!$seen["$host:$port"]++) { 
    367367      $this->mc_available--; 
    368       raise_error(array('code' => 604, 'type' => 'db', 
     368      self::raise_error(array('code' => 604, 'type' => 'db', 
    369369        'line' => __LINE__, 'file' => __FILE__, 
    370370        'message' => "Memcache failure on host $host:$port"), 
     
    444444 
    445445    if (!$contacts) { 
    446       raise_error(array( 
     446      self::raise_error(array( 
    447447        'code' => 700, 'type' => 'php', 
    448448        'file' => __FILE__, 'line' => __LINE__, 
     
    632632 
    633633    if (!class_exists($driver_class)) { 
    634       raise_error(array( 
     634      self::raise_error(array( 
    635635        'code' => 700, 'type' => 'php', 
    636636        'file' => __FILE__, 'line' => __LINE__, 
     
    917917      } 
    918918      else { 
    919         raise_error(array( 
     919        self::raise_error(array( 
    920920          'code' => 620, 'type' => 'php', 
    921921          'file' => __FILE__, 'line' => __LINE__, 
     
    925925    } 
    926926    else { 
    927       raise_error(array( 
     927      self::raise_error(array( 
    928928        'code' => 621, 'type' => 'php', 
    929929        'file' => __FILE__, 'line' => __LINE__, 
     
    13891389      } 
    13901390      else { 
    1391         raise_error(array( 
     1391        self::raise_error(array( 
    13921392          'code' => 500, 'type' => 'php', 
    13931393          'file' => __FILE__, 'line' => __LINE__, 
     
    14421442      } 
    14431443      else { 
    1444         raise_error(array( 
     1444        self::raise_error(array( 
    14451445          'code' => 500, 'type' => 'php', 
    14461446          'file' => __FILE__, 'line' => __LINE__, 
     
    18081808                $body_file = tempnam($temp_dir, 'rcmMsg'); 
    18091809                if (PEAR::isError($mime_result = $message->saveMessageBody($body_file))) { 
    1810                     raise_error(array('code' => 650, 'type' => 'php', 
     1810                    self::raise_error(array('code' => 650, 'type' => 'php', 
    18111811                        'file' => __FILE__, 'line' => __LINE__, 
    18121812                        'message' => "Could not create message: ".$mime_result->getMessage()), 
     
    18311831            // log error 
    18321832            if (!$sent) { 
    1833                 raise_error(array('code' => 800, 'type' => 'smtp', 
     1833                self::raise_error(array('code' => 800, 'type' => 'smtp', 
    18341834                    'line' => __LINE__, 'file' => __FILE__, 
    18351835                    'message' => "SMTP error: ".join("\n", $smtp_response)), TRUE, FALSE); 
     
    18571857 
    18581858            if (PEAR::isError($msg_body)) { 
    1859                 raise_error(array('code' => 650, 'type' => 'php', 
     1859                self::raise_error(array('code' => 650, 'type' => 'php', 
    18601860                    'file' => __FILE__, 'line' => __LINE__, 
    18611861                    'message' => "Could not create message: ".$msg_body->getMessage()), 
     
    21752175 
    21762176    /** 
     2177     * Throw system error (and show error page). 
     2178     * 
     2179     * @param array Named parameters 
     2180     *      - code:    Error code (required) 
     2181     *      - type:    Error type [php|db|imap|javascript] (required) 
     2182     *      - message: Error message 
     2183     *      - file:    File where error occured 
     2184     *      - line:    Line where error occured 
     2185     * @param boolean True to log the error 
     2186     * @param boolean Terminate script execution 
     2187     */ 
     2188    public static function raise_error($arg = array(), $log = false, $terminate = false) 
     2189    { 
     2190        // installer 
     2191        if (class_exists('rcube_install', false)) { 
     2192            $rci = rcube_install::get_instance(); 
     2193            $rci->raise_error($arg); 
     2194            return; 
     2195        } 
     2196 
     2197        if ($log && $arg['type'] && $arg['message']) { 
     2198            self::log_bug($arg); 
     2199        } 
     2200 
     2201        // display error page and terminate script 
     2202        if ($terminate) { 
     2203            rcube_ui::raise_error($arg['code'], $arg['message']); 
     2204        } 
     2205    } 
     2206 
     2207 
     2208    /** 
     2209     * Report error according to configured debug_level 
     2210     * 
     2211     * @param array Named parameters 
     2212     * @see self::raise_error() 
     2213     */ 
     2214    public static function log_bug($arg_arr) 
     2215    { 
     2216        $rcmail  = rcmail::get_instance(); 
     2217        $program = strtoupper($arg_arr['type']); 
     2218        $level   = $rcmail->config->get('debug_level'); 
     2219 
     2220        // disable errors for ajax requests, write to log instead (#1487831) 
     2221        if (($level & 4) && !empty($_REQUEST['_remote'])) { 
     2222            $level = ($level ^ 4) | 1; 
     2223        } 
     2224 
     2225        // write error to local log file 
     2226        if ($level & 1) { 
     2227            if ($_SERVER['REQUEST_METHOD'] == 'POST') { 
     2228                $post_query = '?_task='.urlencode($_POST['_task']).'&_action='.urlencode($_POST['_action']); 
     2229            } 
     2230            else { 
     2231                $post_query = ''; 
     2232            } 
     2233 
     2234            $log_entry = sprintf("%s Error: %s%s (%s %s)", 
     2235                $program, 
     2236                $arg_arr['message'], 
     2237                $arg_arr['file'] ? sprintf(' in %s on line %d', $arg_arr['file'], $arg_arr['line']) : '', 
     2238                $_SERVER['REQUEST_METHOD'], 
     2239                $_SERVER['REQUEST_URI'] . $post_query); 
     2240 
     2241            if (!self::write_log('errors', $log_entry)) { 
     2242                // send error to PHPs error handler if write_log didn't succeed 
     2243                trigger_error($arg_arr['message']); 
     2244            } 
     2245        } 
     2246 
     2247        // report the bug to the global bug reporting system 
     2248        if ($level & 2) { 
     2249            // TODO: Send error via HTTP 
     2250        } 
     2251 
     2252        // show error if debug_mode is on 
     2253        if ($level & 4) { 
     2254            print "<b>$program Error"; 
     2255 
     2256            if (!empty($arg_arr['file']) && !empty($arg_arr['line'])) { 
     2257                print " in $arg_arr[file] ($arg_arr[line])"; 
     2258            } 
     2259 
     2260            print ':</b>&nbsp;'; 
     2261            print nl2br($arg_arr['message']); 
     2262            print '<br />'; 
     2263            flush(); 
     2264        } 
     2265    } 
     2266 
     2267 
     2268    /** 
    21772269     * Write login data (name, ID, IP address) to the 'userlogins' log file. 
    21782270     */ 
  • branches/devel-framework/roundcubemail/program/include/rcube_config.php

    r5822 r5828  
    277277        // Bomb out if the requested key does not exist 
    278278        if (!array_key_exists($key, $this->prop)) { 
    279             raise_error(array( 
     279            rcmail::raise_error(array( 
    280280                'code' => 500, 'type' => 'php', 
    281281                'file' => __FILE__, 'line' => __LINE__, 
     
    288288        // Bomb out if the configured key is not exactly 24 bytes long 
    289289        if (strlen($key) != 24) { 
    290             raise_error(array( 
     290            rcmail::raise_error(array( 
    291291                'code' => 500, 'type' => 'php', 
    292292                    'file' => __FILE__, 'line' => __LINE__, 
     
    312312                return $delim; 
    313313            else 
    314                 raise_error(array( 
     314                rcmail::raise_error(array( 
    315315                    'code' => 500, 'type' => 'php', 
    316316                        'file' => __FILE__, 'line' => __LINE__, 
  • branches/devel-framework/roundcubemail/program/include/rcube_imap.php

    r5825 r5828  
    130130        } 
    131131        else if ($use_ssl) { 
    132             raise_error(array('code' => 403, 'type' => 'imap', 
     132            rcmail::raise_error(array('code' => 403, 'type' => 'imap', 
    133133                'file' => __FILE__, 'line' => __LINE__, 
    134134                'message' => "OpenSSL not available"), true, false); 
     
    185185                    $user, rcmail::remote_ip(), $this->conn->error); 
    186186 
    187                 raise_error(array('code' => 403, 'type' => 'imap', 
     187                rcmail::raise_error(array('code' => 403, 'type' => 'imap', 
    188188                    'file' => __FILE__, 'line' => __LINE__, 
    189189                    'message' => $message), true, false); 
  • branches/devel-framework/roundcubemail/program/include/rcube_ldap.php

    r5822 r5828  
    158158 
    159159        if (!function_exists('ldap_connect')) 
    160             raise_error(array('code' => 100, 'type' => 'ldap', 
     160            rcmail::raise_error(array('code' => 100, 'type' => 'ldap', 
    161161                'file' => __FILE__, 'line' => __LINE__, 
    162162                'message' => "No ldap support in this installation of PHP"), 
     
    204204 
    205205        if (!is_resource($this->conn)) { 
    206             raise_error(array('code' => 100, 'type' => 'ldap', 
     206            rcmail::raise_error(array('code' => 100, 'type' => 'ldap', 
    207207                'file' => __FILE__, 'line' => __LINE__, 
    208208                'message' => "Could not connect to any LDAP server, last tried $hostname"), true); 
     
    266266                        $replaces['%dn'] = $this->prop['search_dn_default']; 
    267267                    else { 
    268                         raise_error(array( 
     268                        rcmail::raise_error(array( 
    269269                            'code' => 100, 'type' => 'ldap', 
    270270                            'file' => __FILE__, 'line' => __LINE__, 
     
    320320 
    321321        if (!function_exists('ldap_sasl_bind')) { 
    322             raise_error(array('code' => 100, 'type' => 'ldap', 
     322            rcmail::raise_error(array('code' => 100, 'type' => 'ldap', 
    323323                'file' => __FILE__, 'line' => __LINE__, 
    324324                'message' => "Unable to bind: ldap_sasl_bind() not exists"), 
     
    346346        $this->_debug("S: ".ldap_error($this->conn)); 
    347347 
    348         raise_error(array( 
     348        rcmail::raise_error(array( 
    349349            'code' => ldap_errno($this->conn), 'type' => 'ldap', 
    350350            'file' => __FILE__, 'line' => __LINE__, 
     
    379379        $this->_debug("S: ".ldap_error($this->conn)); 
    380380 
    381         raise_error(array( 
     381        rcmail::raise_error(array( 
    382382            'code' => ldap_errno($this->conn), 'type' => 'ldap', 
    383383            'file' => __FILE__, 'line' => __LINE__, 
  • branches/devel-framework/roundcubemail/program/include/rcube_mdb2.php

    r5826 r5828  
    103103            $this->db_error_msg = $dbh->getMessage(); 
    104104 
    105             raise_error(array('code' => 500, 'type' => 'db', 
     105            rcmail::raise_error(array('code' => 500, 'type' => 'db', 
    106106                'line' => __LINE__, 'file' => __FILE__, 
    107107                'message' => $dbh->getUserInfo()), true, false); 
     
    297297                $this->db_error_msg = $q->userinfo; 
    298298 
    299                 raise_error(array('code' => 500, 'type' => 'db', 
     299                rcmail::raise_error(array('code' => 500, 'type' => 'db', 
    300300                    'line' => __LINE__, 'file' => __FILE__, 
    301301                    'message' => $this->db_error_msg), true, false); 
     
    738738            $this->db_error = true; 
    739739            $this->db_error_msg = $res->getMessage(); 
    740             raise_error(array('code' => 500, 'type' => 'db', 
     740            rcmail::raise_error(array('code' => 500, 'type' => 'db', 
    741741                'line' => __LINE__, 'file' => __FILE__, 
    742742                'message' => $res->getMessage() . " Query: "  
     
    792792        if (strlen($data)) { 
    793793            if (!sqlite_exec($dbh->connection, $data, $error) || MDB2::isError($dbh)) { 
    794                 raise_error(array('code' => 500, 'type' => 'db', 
     794                rcmail::raise_error(array('code' => 500, 'type' => 'db', 
    795795                    'line' => __LINE__, 'file' => __FILE__, 
    796796                    'message' => $error), true, false); 
  • branches/devel-framework/roundcubemail/program/include/rcube_plugin.php

    r5168 r5828  
    110110    $rcmail = rcmail::get_instance(); 
    111111    if (is_file($fpath) && !$rcmail->config->load_from_file($fpath)) { 
    112       raise_error(array('code' => 527, 'type' => 'php', 
     112      rcmail::raise_error(array( 
     113        'code' => 527, 'type' => 'php', 
    113114        'file' => __FILE__, 'line' => __LINE__, 
    114115        'message' => "Failed to load config from $fpath"), true, false); 
    115116      return false; 
    116117    } 
    117      
     118 
    118119    return true; 
    119120  } 
  • branches/devel-framework/roundcubemail/program/include/rcube_plugin_api.php

    r5672 r5828  
    131131      // trigger fatal error if still not loaded 
    132132      if (!$loaded) { 
    133         raise_error(array('code' => 520, 'type' => 'php', 
     133        rcmail::raise_error(array('code' => 520, 'type' => 'php', 
    134134          'file' => __FILE__, 'line' => __LINE__, 
    135135          'message' => "Requried plugin $plugin_name was not loaded"), true, true); 
     
    187187      } 
    188188      else { 
    189         raise_error(array('code' => 520, 'type' => 'php', 
     189        rcmail::raise_error(array('code' => 520, 'type' => 'php', 
    190190          'file' => __FILE__, 'line' => __LINE__, 
    191191          'message' => "No plugin class $plugin_name found in $fn"), true, false); 
     
    193193    } 
    194194    else { 
    195       raise_error(array('code' => 520, 'type' => 'php', 
     195      rcmail::raise_error(array('code' => 520, 'type' => 'php', 
    196196        'file' => __FILE__, 'line' => __LINE__, 
    197197        'message' => "Failed to load plugin file $fn"), true, false); 
     
    212212    if (is_callable($callback)) { 
    213213      if (isset($this->deprecated_hooks[$hook])) { 
    214         raise_error(array('code' => 522, 'type' => 'php', 
     214        rcmail::raise_error(array('code' => 522, 'type' => 'php', 
    215215          'file' => __FILE__, 'line' => __LINE__, 
    216216          'message' => "Deprecated hook name. ".$hook.' -> '.$this->deprecated_hooks[$hook]), true, false); 
     
    220220    } 
    221221    else 
    222       raise_error(array('code' => 521, 'type' => 'php', 
     222      rcmail::raise_error(array('code' => 521, 'type' => 'php', 
    223223        'file' => __FILE__, 'line' => __LINE__, 
    224224        'message' => "Invalid callback function for $hook"), true, false); 
     
    278278    } 
    279279    else { 
    280       raise_error(array('code' => 523, 'type' => 'php', 
     280      rcmail::raise_error(array('code' => 523, 'type' => 'php', 
    281281        'file' => __FILE__, 'line' => __LINE__, 
    282282        'message' => "Cannot register action $action; already taken by another plugin"), true, false); 
     
    297297    } 
    298298    else { 
    299       raise_error(array('code' => 524, 'type' => 'php', 
     299      rcmail::raise_error(array('code' => 524, 'type' => 'php', 
    300300        'file' => __FILE__, 'line' => __LINE__, 
    301301        'message' => "No handler found for action $action"), true, true); 
     
    323323    } 
    324324    else { 
    325       raise_error(array('code' => 525, 'type' => 'php', 
     325      rcmail::raise_error(array('code' => 525, 'type' => 'php', 
    326326        'file' => __FILE__, 'line' => __LINE__, 
    327327        'message' => "Cannot register template handler $name; already taken by another plugin"), true, false); 
     
    339339  { 
    340340    if ($task != asciiwords($task)) { 
    341       raise_error(array('code' => 526, 'type' => 'php', 
     341      rcmail::raise_error(array('code' => 526, 'type' => 'php', 
    342342        'file' => __FILE__, 'line' => __LINE__, 
    343343        'message' => "Invalid task name: $task. Only characters [a-z0-9_.-] are allowed"), true, false); 
    344344    } 
    345345    else if (in_array($task, rcmail::$main_tasks)) { 
    346       raise_error(array('code' => 526, 'type' => 'php', 
     346      rcmail::raise_error(array('code' => 526, 'type' => 'php', 
    347347        'file' => __FILE__, 'line' => __LINE__, 
    348348        'message' => "Cannot register taks $task; already taken by another plugin or the application itself"), true, false); 
  • branches/devel-framework/roundcubemail/program/include/rcube_session.php

    r5822 r5828  
    7676      } 
    7777      else { 
    78         raise_error(array('code' => 604, 'type' => 'db', 
     78        rcmail::raise_error(array('code' => 604, 'type' => 'db', 
    7979          'line' => __LINE__, 'file' => __FILE__, 
    8080          'message' => "Failed to connect to memcached. Please check configuration"), 
  • branches/devel-framework/roundcubemail/program/include/rcube_spellchecker.php

    r5822 r5828  
    5959 
    6060        if ($this->engine == 'pspell' && !extension_loaded('pspell')) { 
    61             raise_error(array( 
     61            rcmail::raise_error(array( 
    6262                'code' => 500, 'type' => 'php', 
    6363                'file' => __FILE__, 'line' => __LINE__, 
  • branches/devel-framework/roundcubemail/program/include/rcube_template.php

    r5822 r5828  
    311311            // prevent from endless loops 
    312312            if ($exit != 'recur' && $this->app->plugins->is_processing('render_page')) { 
    313                 raise_error(array('code' => 505, 'type' => 'php', 
     313                rcmail::raise_error(array('code' => 505, 'type' => 'php', 
    314314                  'file' => __FILE__, 'line' => __LINE__, 
    315315                  'message' => 'Recursion alert: ignoring output->send()'), true, false); 
     
    404404            $path = "$skin_path/templates/".$this->deprecated_templates[$realname].".html"; 
    405405            if (is_readable($path)) 
    406                 raise_error(array('code' => 502, 'type' => 'php', 
     406                rcmail::raise_error(array('code' => 502, 'type' => 'php', 
    407407                    'file' => __FILE__, 'line' => __LINE__, 
    408408                    'message' => "Using deprecated template '".$this->deprecated_templates[$realname] 
     
    413413        // read template file 
    414414        if (($templ = @file_get_contents($path)) === false) { 
    415             raise_error(array( 
     415            rcmail::raise_error(array( 
    416416                'code' => 501, 
    417417                'type' => 'php', 
     
    577577                return $matches[0] . $this->parse_conditions($result); 
    578578            } 
    579             raise_error(array( 
     579            rcmail::raise_error(array( 
    580580                'code' => 500, 
    581581                'type' => 'php', 
  • branches/devel-framework/roundcubemail/program/include/rcube_ui.php

    r5822 r5828  
    12171217 
    12181218    /** 
    1219      * Throw system error and show error page 
    1220      * 
    1221      * @param array Named parameters 
    1222      *      - code: Error code (required) 
    1223      *      - type: Error type [php|db|imap|javascript] (required) 
    1224      *      - message: Error message 
    1225      *      - file: File where error occured 
    1226      *      - line: Line where error occured 
    1227      * @param boolean True to log the error 
    1228      * @param boolean Terminate script execution 
    1229      */ 
    1230     public static function raise_error($arg = array(), $log = false, $terminate = false) 
    1231     { 
    1232         global $__page_content, $CONFIG, $OUTPUT, $ERROR_CODE, $ERROR_MESSAGE; 
    1233  
    1234         // report bug (if not incompatible browser) 
    1235         if ($log && $arg['type'] && $arg['message']) { 
    1236             self::log_bug($arg); 
    1237         } 
    1238  
    1239         // display error page and terminate script 
    1240         if ($terminate) { 
    1241             $ERROR_CODE = $arg['code']; 
    1242             $ERROR_MESSAGE = $arg['message']; 
    1243             include INSTALL_PATH . 'program/steps/utils/error.inc'; 
    1244             exit; 
    1245         } 
    1246     } 
    1247  
    1248  
    1249     /** 
    1250      * Report error according to configured debug_level 
    1251      * 
    1252      * @param array Named parameters 
    1253      * @see self::raise_error() 
    1254      */ 
    1255     public static function log_bug($arg_arr) 
    1256     { 
    1257         global $CONFIG; 
    1258  
    1259         $program = strtoupper($arg_arr['type']); 
    1260         $level   = $CONFIG['debug_level']; 
    1261  
    1262         // disable errors for ajax requests, write to log instead (#1487831) 
    1263         if (($level & 4) && !empty($_REQUEST['_remote'])) { 
    1264             $level = ($level ^ 4) | 1; 
    1265         } 
    1266  
    1267         // write error to local log file 
    1268         if ($level & 1) { 
    1269             $post_query = ($_SERVER['REQUEST_METHOD'] == 'POST' ? '?_task='.urlencode($_POST['_task']).'&_action='.urlencode($_POST['_action']) : ''); 
    1270             $log_entry = sprintf("%s Error: %s%s (%s %s)", 
    1271                 $program, 
    1272                 $arg_arr['message'], 
    1273                 $arg_arr['file'] ? sprintf(' in %s on line %d', $arg_arr['file'], $arg_arr['line']) : '', 
    1274                 $_SERVER['REQUEST_METHOD'], 
    1275                 $_SERVER['REQUEST_URI'] . $post_query); 
    1276  
    1277             if (!rcmail::write_log('errors', $log_entry)) { 
    1278                 // send error to PHPs error handler if write_log didn't succeed 
    1279                 trigger_error($arg_arr['message']); 
    1280             } 
    1281         } 
    1282  
    1283         // report the bug to the global bug reporting system 
    1284         if ($level & 2) { 
    1285             // TODO: Send error via HTTP 
    1286         } 
    1287  
    1288         // show error if debug_mode is on 
    1289         if ($level & 4) { 
    1290             print "<b>$program Error"; 
    1291  
    1292             if (!empty($arg_arr['file']) && !empty($arg_arr['line'])) { 
    1293                 print " in $arg_arr[file] ($arg_arr[line])"; 
    1294             } 
    1295  
    1296             print ':</b>&nbsp;'; 
    1297             print nl2br($arg_arr['message']); 
    1298             print '<br />'; 
    1299             flush(); 
    1300         } 
     1219     * Show error page and terminate script execution 
     1220     * 
     1221     * @param int    $code     Error code 
     1222     * @param string $message  Error message 
     1223     */ 
     1224    public static function raise_error($code, $message) 
     1225    { 
     1226        global $__page_content, $ERROR_CODE, $ERROR_MESSAGE; 
     1227 
     1228        $ERROR_CODE    = $code; 
     1229        $ERROR_MESSAGE = $message; 
     1230 
     1231        include INSTALL_PATH . 'program/steps/utils/error.inc'; 
     1232        exit; 
    13011233    } 
    13021234 
  • branches/devel-framework/roundcubemail/program/include/rcube_user.php

    r5822 r5828  
    505505        } 
    506506        else { 
    507             raise_error(array( 
     507            rcmail::raise_error(array( 
    508508                'code' => 500, 
    509509                'type' => 'php', 
  • branches/devel-framework/roundcubemail/program/steps/utils/error.inc

    r4685 r5828  
    2020*/ 
    2121 
     22$rcmail = rcmail::get_instance(); 
    2223 
    2324// browser is not compatible with this application 
     
    8687  $__error_text  = "Please contact your server-administrator."; 
    8788 
    88   if (($CONFIG['debug_level'] & 4) && $ERROR_MESSAGE) 
     89  if (($rcmail->config->get('debug_level') & 4) && $ERROR_MESSAGE) 
    8990    $__error_text = $ERROR_MESSAGE; 
    9091  else 
     
    9596 
    9697// Ajax request 
    97 if ($OUTPUT && ($OUTPUT instanceof rcube_json_output)) { 
     98if ($rcmail->output && ($rcmail->output instanceof rcube_json_output)) { 
    9899  header("HTTP/1.0 $HTTP_ERR_CODE $__error_title"); 
    99100  die; 
     
    108109EOF; 
    109110 
    110 if ($OUTPUT && $OUTPUT->template_exists('error')) { 
    111   $OUTPUT->reset(); 
    112   $OUTPUT->send('error'); 
     111if ($rcmail->output && $rcmail->output->template_exists('error')) { 
     112  $rcmail->output->reset(); 
     113  $rcmail->output->send('error'); 
    113114} 
    114115 
    115 $__skin = $CONFIG->skin ? $CONFIG->skin : 'default'; 
    116 $__productname = $CONFIG['product_name'] ? $CONFIG['product_name'] : 'Roundcube Webmail'; 
     116$__skin = $rcmail->config->get('skin', 'default'); 
     117$__productname = $rcmail->config->get('product_name', 'Roundcube Webmail'); 
    117118 
    118119// print system error page 
Note: See TracChangeset for help on using the changeset viewer.