From 95539119e14bb1a472cb732989a978dd240bc04b Mon Sep 17 00:00:00 2001
From: vogelor <vogelor@ispconfig3>
Date: Tue, 4 May 2010 09:28:07 +0000
Subject: [PATCH] Improved Theme-Handling (nor every user can have its own
 theme)

---
 interface/lib/app.inc.php     | 4 ++++
 interface/web/login/index.php | 6 +++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/interface/lib/app.inc.php b/interface/lib/app.inc.php
index 28ba6bc22..869432498 100644
--- a/interface/lib/app.inc.php
+++ b/interface/lib/app.inc.php
@@ -203,6 +203,10 @@ class app {
 		if(isset($_SESSION['s']['user']) && $this->auth->has_clients($_SESSION['s']['user']['userid'])) {
 			$this->tpl->setVar('is_reseller', 1);
 		}
+		/* Show username */
+		if(isset($_SESSION['s']['user'])) {
+			$this->tpl->setVar('cpuser', $_SESSION['s']['user']['username']);
+		}
 	}
 
 } // end class
diff --git a/interface/web/login/index.php b/interface/web/login/index.php
index c1fa43b07..22a1eac8a 100644
--- a/interface/web/login/index.php
+++ b/interface/web/login/index.php
@@ -152,7 +152,11 @@ class login_index {
 							
 							$app->plugin->raiseEvent('login',$this);
 							
-							echo 'HEADER_REDIRECT:'.$_SESSION['s']['module']['startpage'];
+							/*
+							 * We need LOGIN_REDIRECT instead of HEADER_REDIRECT to load the
+							 * new theme, if the logged-in user has another
+							 */
+							echo 'LOGIN_REDIRECT:'.$_SESSION['s']['module']['startpage'];
 										
 		                   	exit;
 		             	} else {
-- 
GitLab