From 1aceb9cec82639250a603aa0806f0399f7bae68d Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Mon, 16 Apr 2012 07:02:21 -0400
Subject: [PATCH] - Framework refactoring (I hope it's the last one):   rcube,rcmail,rcube_ui -> rcube,rcmail,rcube_utils   renamed main.inc into rcube_bc.inc

---
 index.php |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/index.php b/index.php
index 8a7a79f..6790338 100644
--- a/index.php
+++ b/index.php
@@ -52,7 +52,7 @@
 
 // check if config files had errors
 if ($err_str = $RCMAIL->config->get_error()) {
-  raise_error(array(
+  rcmail::raise_error(array(
     'code' => 601,
     'type' => 'php',
     'message' => $err_str), false, true);
@@ -60,7 +60,7 @@
 
 // check DB connections and exit on failure
 if ($err_str = $RCMAIL->db->is_error()) {
-  raise_error(array(
+  rcmail::raise_error(array(
     'code' => 603,
     'type' => 'db',
     'message' => $err_str), FALSE, TRUE);
@@ -68,13 +68,13 @@
 
 // error steps
 if ($RCMAIL->action == 'error' && !empty($_GET['_code'])) {
-  raise_error(array('code' => hexdec($_GET['_code'])), FALSE, TRUE);
+  rcmail::raise_error(array('code' => hexdec($_GET['_code'])), FALSE, TRUE);
 }
 
 // check if https is required (for login) and redirect if necessary
 if (empty($_SESSION['user_id']) && ($force_https = $RCMAIL->config->get('force_https', false))) {
   $https_port = is_bool($force_https) ? 443 : $force_https;
-  if (!rcube_ui::https_check($https_port)) {
+  if (!rcube_utils::https_check($https_port)) {
     $host  = preg_replace('/:[0-9]+$/', '', $_SERVER['HTTP_HOST']);
     $host .= ($https_port != 443 ? ':' . $https_port : '');
     header('Location: https://' . $host . $_SERVER['REQUEST_URI']);
@@ -89,15 +89,15 @@
 
 // try to log in
 if ($RCMAIL->task == 'login' && $RCMAIL->action == 'login') {
-  $request_valid = $_SESSION['temp'] && $RCMAIL->check_request(rcube_ui::INPUT_POST, 'login');
+  $request_valid = $_SESSION['temp'] && $RCMAIL->check_request(rcube_utils::INPUT_POST, 'login');
 
   // purge the session in case of new login when a session already exists 
   $RCMAIL->kill_session();
 
   $auth = $RCMAIL->plugins->exec_hook('authenticate', array(
     'host' => $RCMAIL->autoselect_host(),
-    'user' => trim(rcube_ui::get_input_value('_user', rcube_ui::INPUT_POST)),
-    'pass' => rcube_ui::get_input_value('_pass', rcube_ui::INPUT_POST, true,
+    'user' => trim(rcube_utils::get_input_value('_user', rcube_utils::INPUT_POST)),
+    'pass' => rcube_utils::get_input_value('_pass', rcube_utils::INPUT_POST, true,
        $RCMAIL->config->get('password_charset', 'ISO-8859-1')),
     'cookiecheck' => true,
     'valid' => $request_valid,
@@ -123,7 +123,7 @@
 
     // restore original request parameters
     $query = array();
-    if ($url = rcube_ui::get_input_value('_url', rcube_ui::INPUT_POST)) {
+    if ($url = rcube_utils::get_input_value('_url', rcube_utils::INPUT_POST)) {
       parse_str($url, $query);
 
       // prevent endless looping on login page
@@ -172,7 +172,7 @@
 // not logged in -> show login page
 if (empty($RCMAIL->user->ID)) {
   // log session failures
-  $task = rcube_ui::get_input_value('_task', rcube_ui::INPUT_GPC);
+  $task = rcube_utils::get_input_value('_task', rcube_utils::INPUT_GPC);
   if ($task && !in_array($task, array('login','logout')) && !$session_error && ($sess_id = $_COOKIE[ini_get('session.name')])) {
     $RCMAIL->session->log("Aborted session " . $sess_id . "; no valid session data found");
     $session_error = true;
@@ -209,7 +209,7 @@
 
   // check client X-header to verify request origin
   if ($OUTPUT->ajax_call) {
-    if (rcube_request_header('X-Roundcube-Request') != $RCMAIL->get_request_token() && !$RCMAIL->config->get('devel_mode')) {
+    if (rcube_utils::request_header('X-Roundcube-Request') != $RCMAIL->get_request_token() && !$RCMAIL->config->get('devel_mode')) {
       header('HTTP/1.1 403 Forbidden');
       die("Invalid Request");
     }
@@ -281,7 +281,7 @@
 
 
 // if we arrive here, something went wrong
-raise_error(array(
+rcmail::raise_error(array(
   'code' => 404,
   'type' => 'php',
   'line' => __LINE__,

--
Gitblit v1.9.1