Commit 5715f5fe authored by mcramer's avatar mcramer

- Implemented check for theme compatibility

- Implemented session message system (template modifications pending)
- Updated ISPC SVN version number to 3.0.5
parent 2cb656cf
......@@ -2130,6 +2130,6 @@ INSERT INTO `sys_user` (`userid`, `sys_userid`, `sys_groupid`, `sys_perm_user`,
-- Dumping data for table `sys_config`
--
INSERT INTO sys_config VALUES ('1','db','db_version','3.0.4.5');
INSERT INTO sys_config VALUES ('1','db','db_version','3.0.5');
SET FOREIGN_KEY_CHECKS = 1;
\ No newline at end of file
......@@ -56,7 +56,7 @@ $revision = str_replace(array('Revision:','$',' '), '', $svn_revision);
//** Application
define('ISPC_APP_TITLE', 'ISPConfig');
define('ISPC_APP_VERSION', '3.0.4.5');
define('ISPC_APP_VERSION', '3.0.5');
define('DEVSYSTEM', 0);
......
......@@ -278,6 +278,15 @@ class listform_actions {
$app->tpl->setVar($app->listform->wordbook);
$app->tpl->setVar('form_action', $app->listform->listDef['file']);
if(isset($_SESSION['show_info_msg'])) {
$app->tpl->setVar('show_info_msg', $_SESSION['show_info_msg']);
unset($_SESSION['show_info_msg']);
}
if(isset($_SESSION['show_error_msg'])) {
$app->tpl->setVar('show_error_msg', $_SESSION['show_error_msg']);
unset($_SESSION['show_error_msg']);
}
//* Parse the templates and send output to the browser
$this->onShowEnd();
}
......
......@@ -491,6 +491,14 @@ class tform_actions {
$app->tpl->setVar('form_navibar',$navibar);
}
if(isset($_SESSION['show_info_msg'])) {
$app->tpl->setVar('show_info_msg', $_SESSION['show_info_msg']);
unset($_SESSION['show_info_msg']);
}
if(isset($_SESSION['show_error_msg'])) {
$app->tpl->setVar('show_error_msg', $_SESSION['show_error_msg']);
unset($_SESSION['show_error_msg']);
}
// loading plugins
$this->loadPlugins($this->active_tab);
......
......@@ -100,7 +100,9 @@ $handle = @opendir(ISPC_THEMES_PATH);
while ($file = @readdir ($handle)) {
if (substr($file, 0, 1) != '.') {
if(@is_dir(ISPC_THEMES_PATH."/$file")) {
$themes_list[$file] = $file;
if($file == 'default' || (@file_exists(ISPC_THEMES_PATH."/$file/ISPC_VERSION") && trim(@file_get_contents(ISPC_THEMES_PATH."/$file/ISPC_VERSION")) == ISPC_APP_VERSION)) {
$themes_list[$file] = $file;
}
}
}
}
......
......@@ -73,7 +73,9 @@ $handle = @opendir(ISPC_THEMES_PATH);
while ($file = @readdir ($handle)) {
if (substr($file, 0, 1) != '.') {
if(@is_dir(ISPC_THEMES_PATH."/$file")) {
$themes_list[$file] = $file;
if($file == 'default' || (@file_exists(ISPC_THEMES_PATH."/$file/ISPC_VERSION") && trim(@file_get_contents(ISPC_THEMES_PATH."/$file/ISPC_VERSION")) == ISPC_APP_VERSION)) {
$themes_list[$file] = $file;
}
}
}
}
......
......@@ -73,7 +73,9 @@ $handle = @opendir(ISPC_THEMES_PATH);
while ($file = @readdir ($handle)) {
if (substr($file, 0, 1) != '.') {
if(@is_dir(ISPC_THEMES_PATH."/$file")) {
$themes_list[$file] = $file;
if($file == 'default' || (@file_exists(ISPC_THEMES_PATH."/$file/ISPC_VERSION") && trim(@file_get_contents(ISPC_THEMES_PATH."/$file/ISPC_VERSION")) == ISPC_APP_VERSION)) {
$themes_list[$file] = $file;
}
}
}
}
......
......@@ -61,7 +61,9 @@ $handle = @opendir(ISPC_THEMES_PATH);
while ($file = @readdir ($handle)) {
if (substr($file, 0, 1) != '.') {
if(@is_dir(ISPC_THEMES_PATH."/$file")) {
$themes_list[$file] = $file;
if($file == 'default' || (@file_exists(ISPC_THEMES_PATH."/$file/ISPC_VERSION") && trim(@file_get_contents(ISPC_THEMES_PATH."/$file/ISPC_VERSION")) == ISPC_APP_VERSION)) {
$themes_list[$file] = $file;
}
}
}
}
......
......@@ -93,6 +93,16 @@ $app->tpl->setVar('welcome_user', $welcome);
*/
$info = array();
if(isset($_SESSION['show_info_msg'])) {
$info[] = array('info_msg' => $_SESSION['show_info_msg']);
unset($_SESSION['show_info_msg']);
}
if(isset($_SESSION['show_error_msg'])) {
$app->tpl->setloop('error', array(array('error_msg' => $_SESSION['show_error_msg'])));
unset($_SESSION['show_error_msg']);
}
/*
* Check the ISPConfig-Version (only for the admin)
*/
......
......@@ -51,6 +51,16 @@ if($sys_config['tab_change_discard'] == 'y') {
$app->tpl->setVar('global_tabchange_discard_txt', $app->lng('global_tabchange_discard_txt'));
}
if(isset($_SESSION['show_info_msg'])) {
$app->tpl->setVar('show_info_msg', $_SESSION['show_info_msg']);
unset($_SESSION['show_info_msg']);
}
if(isset($_SESSION['show_error_msg'])) {
$app->tpl->setVar('show_error_msg', $_SESSION['show_error_msg']);
unset($_SESSION['show_error_msg']);
}
$app->tpl_defaults();
$app->tpl->pparse();
?>
\ No newline at end of file
......@@ -65,7 +65,7 @@ class login_index {
$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 @@ class login_index {
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);
......
......@@ -20,4 +20,5 @@ $wb['pw_reset_txt'] = 'Passwort zurücksetzen';
$wb['pw_button_txt'] = 'Passwort zusenden';
$wb['email_txt'] = 'E-Mail';
$wb['error_maintenance_mode'] = 'Diese ISPConfig-Installation wird gerade gewartet. Wir sind in Kürze wieder für Sie da. Vielen Dank für Ihre Geduld.';
$wb['theme_not_compatible'] = 'Das gewählte Theme ist mit dieser ISPConfig Version nicht kompatibel. Bitte prüfen Sie, ob ein Update des Themes verfügbar ist.<br />Es wurde nun automatisch das Standard-Theme aktiviert.';
?>
......@@ -24,4 +24,6 @@ $wb['pw_button_txt'] = "Resend password";
$wb['email_txt'] = "Email";
$wb['error_maintenance_mode'] = 'This ISPConfig installation is currently under maintenance. We should be back shortly. Thank you for your patience.';
$wb['theme_not_compatible'] = 'The chosen theme is not compatible with the current ISPConfig version. Please check for a new version of the theme.<br />The default theme as been activated automatically.';
?>
\ No newline at end of file
......@@ -38,6 +38,14 @@ $app->tpl->setVar($rec2);
$app->tpl->setVar('msg',$msg);
$app->tpl->setVar('error',$error);
if(isset($_SESSION['show_info_msg'])) {
$app->tpl->setVar('show_info_msg', $_SESSION['show_info_msg']);
unset($_SESSION['show_info_msg']);
}
if(isset($_SESSION['show_error_msg'])) {
$app->tpl->setVar('show_error_msg', $_SESSION['show_error_msg']);
unset($_SESSION['show_error_msg']);
}
......
3.0.4.6
\ No newline at end of file
......@@ -113,7 +113,9 @@ $handle = @opendir(ISPC_THEMES_PATH);
while ($file = @readdir ($handle)) {
if (substr($file, 0, 1) != '.') {
if(@is_dir(ISPC_THEMES_PATH."/$file")) {
$themes_list[$file] = $file;
if($file == 'default' || (@file_exists(ISPC_THEMES_PATH."/$file/ISPC_VERSION") && trim(@file_get_contents(ISPC_THEMES_PATH."/$file/ISPC_VERSION")) == ISPC_APP_VERSION)) {
$themes_list[$file] = $file;
}
}
}
}
......
......@@ -113,7 +113,9 @@ $handle = @opendir(ISPC_THEMES_PATH);
while ($file = @readdir ($handle)) {
if (substr($file, 0, 1) != '.') {
if(@is_dir(ISPC_THEMES_PATH."/$file")) {
$themes_list[$file] = $file;
if($file == 'default' || (@file_exists(ISPC_THEMES_PATH."/$file/ISPC_VERSION") && trim(@file_get_contents(ISPC_THEMES_PATH."/$file/ISPC_VERSION")) == ISPC_APP_VERSION)) {
$themes_list[$file] = $file;
}
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment