diff --git a/index.php b/index.php index 10debf61..c14332ec 100644 --- a/index.php +++ b/index.php @@ -190,7 +190,19 @@ if($action == 'login') $db->query("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = '" . (int)$userinfo['userid'] . "' AND `adminsession` = '" . $db->escape($userinfo['adminsession']) . "'"); } - $db->query("INSERT INTO `" . TABLE_PANEL_SESSIONS . "` (`hash`, `userid`, `ipaddress`, `useragent`, `lastactivity`, `language`, `adminsession`, `theme`) VALUES ('" . $db->escape($s) . "', '" . (int)$userinfo['userid'] . "', '" . $db->escape($remote_addr) . "', '" . $db->escape($http_user_agent) . "', '" . time() . "', '" . $db->escape($language) . "', '" . $db->escape($userinfo['adminsession']) . "', '" . $db->escape($theme) . "')"); + // check for field 'theme' in session-table, refs #607 + $fields = mysql_list_fields($db->getDbName(), TABLE_PANEL_SESSIONS); + $columns = mysql_num_fields($fields); + $field_array = array(); + for ($i = 0; $i < $columns; $i++) { + $field_array[] = mysql_field_name($fields, $i); + } + + if (!in_array('theme', $field_array)) { + $db->query("INSERT INTO `" . TABLE_PANEL_SESSIONS . "` (`hash`, `userid`, `ipaddress`, `useragent`, `lastactivity`, `language`, `adminsession`) VALUES ('" . $db->escape($s) . "', '" . (int)$userinfo['userid'] . "', '" . $db->escape($remote_addr) . "', '" . $db->escape($http_user_agent) . "', '" . time() . "', '" . $db->escape($language) . "', '" . $db->escape($userinfo['adminsession']) . "')"); + } else { + $db->query("INSERT INTO `" . TABLE_PANEL_SESSIONS . "` (`hash`, `userid`, `ipaddress`, `useragent`, `lastactivity`, `language`, `adminsession`, `theme`) VALUES ('" . $db->escape($s) . "', '" . (int)$userinfo['userid'] . "', '" . $db->escape($remote_addr) . "', '" . $db->escape($http_user_agent) . "', '" . time() . "', '" . $db->escape($language) . "', '" . $db->escape($userinfo['adminsession']) . "', '" . $db->escape($theme) . "')"); + } if($userinfo['adminsession'] == '1') { diff --git a/lib/classes/database/class.db.php b/lib/classes/database/class.db.php index 3d9bc652..2c786bee 100644 --- a/lib/classes/database/class.db.php +++ b/lib/classes/database/class.db.php @@ -150,6 +150,11 @@ class db return @mysql_close($this->link_id); } + function getDbName() + { + return $this->database; + } + /** * Escapes user input to be used in mysql queries * diff --git a/templates/Froxlor/froxlor.css b/templates/Froxlor/froxlor.css index cb7d2d05..06119be6 100644 --- a/templates/Froxlor/froxlor.css +++ b/templates/Froxlor/froxlor.css @@ -685,3 +685,35 @@ select { .maintable { width: 90%; } + +.update_progess +{ + padding: 2em; + text-align: left; +} + +.preconfig +{ + text-align: left; + margin-top: 20px; + margin-bottom: 5px; + margin-right: 15px; + margin-left: 15px; +} + +.preconfigitem +{ + padding: 0.15em; + border-bottom: 1px solid #cccccc; +} + +.preconfdesc +{ + display: block; + margin-bottom: 0.5em; + font-size: 120%; +} + +.strikethrough { + text-decoration: line-through; +}