From 5715f5fe3954a2112f443964244747dfd6d31937 Mon Sep 17 00:00:00 2001
From: mcramer <m.cramer@pixcept.de>
Date: Wed, 05 Sep 2012 07:48:32 -0400
Subject: [PATCH] - Implemented check for theme compatibility - Implemented session message system (template modifications pending) - Updated ISPC SVN version number to 3.0.5

---
 interface/web/login/index.php |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/interface/web/login/index.php b/interface/web/login/index.php
index 726411b..a99a775 100644
--- a/interface/web/login/index.php
+++ b/interface/web/login/index.php
@@ -65,7 +65,7 @@
 			$maintenance_mode_error = $app->lng('error_maintenance_mode');
 		}
 
-		//* Login Form was send
+		//* Login Form was sent
 		if(count($_POST) > 0) {
 
 			//** Check variables
@@ -197,6 +197,17 @@
 									include_once($_SESSION['s']['user']['startmodule'].'/lib/module.conf.php');
 									$_SESSION['s']['module'] = $module;
 								}
+                                
+                                // check if the user theme is valid
+                                if($_SESSION['s']['user']['theme'] != 'default') {
+                                    $tmp_path = ISPC_THEMES_PATH."/".$_SESSION['s']['user']['theme'];
+                                    if(!@is_dir($tmp_path) || !@file_exists($tmp_path."/ISPC_VERSION") || trim(file_get_contents($tmp_path."/ISPC_VERSION")) != ISPC_APP_VERSION) {
+                                        // fall back to default theme if this one is not compatible with current ispc version
+                                        $_SESSION['s']['user']['theme'] = 'default';
+                                        $_SESSION['s']['theme'] = 'default';
+                                        $_SESSION['show_error_msg'] = $app->lng('theme_not_compatible');
+                                    }
+                                }
 
 								$app->plugin->raiseEvent('login',$this);
 

--
Gitblit v1.9.1