From da5e7a023cec055984fbaab81609d2ddd4bccf13 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Sun, 19 Aug 2007 08:07:53 -0400
Subject: [PATCH] Fixed a problem in the session initialization

---
 interface/lib/config.inc.php            |    2 +-
 interface/web/mail/mail_domain_list.php |    3 ++-
 interface/web/login/index.php           |    9 +++++----
 interface/lib/app.inc.php               |   16 ++++++++--------
 interface/web/js/scrigo.js              |    2 +-
 5 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/interface/lib/app.inc.php b/interface/lib/app.inc.php
index bf5df99..353297a 100644
--- a/interface/lib/app.inc.php
+++ b/interface/lib/app.inc.php
@@ -53,15 +53,15 @@
 				$this->load('db_'.$this->_conf['db_type']);
 				$this->db = new db;
 		}
-		if($this->_conf['start_session'] == true) {
+		
+		//* Start the session
+		if($conf["start_session"] == true) {
 			session_start();
-            //* Initialise vars if session is not set
-            if( !isset($_SESSION['s']['id']) ){
-                $_SESSION['s'] = array( 'id' => session_id(), 
-                                        'theme' => $this->_conf['theme'], 
-                                        'language' => $this->_conf['language']
-                                        );
-            }
+			
+			//* Initialize session variables
+			if(!isset($_SESSION['s']['id']) ) $_SESSION["s"]['id'] = session_id();
+			if(empty($_SESSION["s"]["theme"])) $_SESSION["s"]['theme'] = $conf['theme'];
+			if(empty($_SESSION["s"]["language"])) $_SESSION["s"]['language'] = $conf['language'];
 		}
 	}
 
diff --git a/interface/lib/config.inc.php b/interface/lib/config.inc.php
index 16f7557..efe42f9 100644
--- a/interface/lib/config.inc.php
+++ b/interface/lib/config.inc.php
@@ -27,7 +27,7 @@
 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-error_reporting(E_ALL|E_STRICT);
+error_reporting(E_ALL|E_NOTICE);
 
 header('Pragma: no-cache');
 header('Cache-Control: no-store, no-cache, max-age=0, must-revalidate');
diff --git a/interface/web/js/scrigo.js b/interface/web/js/scrigo.js
index 26d270a..703c626 100644
--- a/interface/web/js/scrigo.js
+++ b/interface/web/js/scrigo.js
@@ -61,7 +61,7 @@
     var userNameObj = frm.username;
     if(userNameObj.value == ''){
         userNameObj.focus();
-        return;q
+        return;
     }
     var passwordObj = frm.passwort;
     if(passwordObj.value == ''){
diff --git a/interface/web/login/index.php b/interface/web/login/index.php
index b59a760..7e1efad 100644
--- a/interface/web/login/index.php
+++ b/interface/web/login/index.php
@@ -36,11 +36,12 @@
 private $target = '';
 
 public function render() {
+	
 	if(isset($_SESSION['s']['user']) && is_array($_SESSION['s']['user']) && is_array($_SESSION['s']['module'])) {
 		die('HEADER_REDIRECT:'.$_SESSION['s']['module']['startpage']);
 	}
 	
-	global $app;
+	global $app, $conf;
 	$app->uses('tpl');
 	$app->tpl->newTemplate('form.tpl.htm');
     
@@ -64,14 +65,14 @@
                                 $_SESSION['s']['user'] = $user;
                                 $_SESSION['s']['user']['theme'] = isset($user['app_theme']) ? $user['app_theme'] : 'default';
                                 $_SESSION['s']['language'] = $user['language'];
-								//print_r($_SESSION);
+								$_SESSION["s"]['theme'] = $_SESSION['s']['user']['theme'];
+								
 								if(is_file($_SESSION['s']['user']['startmodule'].'/lib/module.conf.php')) {
 									include_once($_SESSION['s']['user']['startmodule'].'/lib/module.conf.php');
 									$_SESSION['s']['module'] = $module;
 								}
-								
 								echo 'HEADER_REDIRECT:'.$_SESSION['s']['module']['startpage'];
-								//echo 'HEADER_REDIRECT:content.php?s_mod=admin&s_pg=index';
+								
                                 exit;
                         } else {
                                 $error = $app->lng(1003);
diff --git a/interface/web/mail/mail_domain_list.php b/interface/web/mail/mail_domain_list.php
index ffe2ecd..ee8d88c 100644
--- a/interface/web/mail/mail_domain_list.php
+++ b/interface/web/mail/mail_domain_list.php
@@ -12,8 +12,9 @@
 * End Form configuration
 ******************************************/
 
+
 // Checking module permissions
-if(!stristr($_SESSION["s"]["user"]["modules"],$_SESSION["s"]["module"]["name"])) {
+if(!stristr($_SESSION["s"]["user"]["modules"],'mail')) {
 	header("Location: ../index.php");
 	exit;
 }

--
Gitblit v1.9.1