- check for field 'theme' in table 'panel_session' as it's being used before the update, fixes #607

- add some missing css-classes for the updater

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2011-02-23 08:47:14 +01:00
parent 957a0e78a3
commit 6837852f52
3 changed files with 50 additions and 1 deletions

View File

@@ -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']) . "'");
}
// 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')
{

View File

@@ -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
*

View File

@@ -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;
}