From f5aa16541e6901d2fc543f9044be1c898365b61e Mon Sep 17 00:00:00 2001
From: svncommit <devs@roundcube.net>
Date: Thu, 28 Aug 2008 04:15:31 -0400
Subject: [PATCH] Add folder hierarchy collapsing.

---
 index.php |   26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/index.php b/index.php
index 699cf19..aa6bf12 100644
--- a/index.php
+++ b/index.php
@@ -2,7 +2,7 @@
 /*
  +-------------------------------------------------------------------------+
  | RoundCube Webmail IMAP Client                                           |
- | Version 0.2-20080619                                                    |
+ | Version 0.2-20080620                                                    |
  |                                                                         |
  | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland                   |
  |                                                                         |
@@ -52,6 +52,15 @@
   }
 }
 
+
+// check if config files had errors
+if ($err_str = $RCMAIL->config->get_error()) {
+  raise_error(array(
+    'code' => 601,
+    'type' => 'php',
+    'message' => $err_str), false, true);
+}
+
 // check DB connections and exit on failure
 if ($err_str = $DB->is_error()) {
   raise_error(array(
@@ -79,7 +88,7 @@
               get_input_value('_pass', RCUBE_INPUT_POST, true, 'ISO-8859-1'), $host)) {
     // create new session ID
     unset($_SESSION['temp']);
-    sess_regenerate_id();
+    rcube_sess_regenerate_id();
 
     // send auth cookie if necessary
     $RCMAIL->authenticate_session();
@@ -92,8 +101,7 @@
                       $_SERVER['REMOTE_ADDR']));
 
     // send redirect
-    header("Location: {$RCMAIL->comm_path}");
-    exit;
+    $OUTPUT->redirect();
   }
   else {
     $OUTPUT->show_message($IMAP->error_code == -1 ? 'imaperror' : 'loginfailed', 'warning');
@@ -138,7 +146,7 @@
 if (empty($RCMAIL->user->ID)) {
   
   if ($OUTPUT->ajax_call)
-    $OUTPUT->remote_response("setTimeout(\"location.href='\"+this.env.comm_path+\"'\", 2000);");
+    $OUTPUT->redirect(array(), 2000);
   
   // check if installer is still active
   if ($RCMAIL->config->get('enable_installer') && is_readable('./installer/index.php')) {
@@ -193,6 +201,14 @@
   )
 );
 
+// save preference value
+if ($RCMAIL->action=='save-pref')
+  {
+  $USER->save_prefs(array(get_input_value('_name', RCUBE_INPUT_POST) => get_input_value('_value', RCUBE_INPUT_POST)));
+  $OUTPUT->reset();
+  $OUTPUT->send();
+  }
+
 // include task specific functions
 include_once 'program/steps/'.$RCMAIL->task.'/func.inc';
 

--
Gitblit v1.9.1