mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/15201] Remove wrong user style check
PHPBB3-15201
This commit is contained in:
parent
48a3bd1a9e
commit
4719f94cec
2 changed files with 4 additions and 22 deletions
|
@ -165,7 +165,7 @@ class style_update_p1 extends \phpbb\db\migration\migration
|
||||||
|
|
||||||
$this->config->set('default_style', $default_style);
|
$this->config->set('default_style', $default_style);
|
||||||
|
|
||||||
$sql = 'UPDATE ' . USERS_TABLE . ' SET user_style = 0';
|
$sql = 'UPDATE ' . USERS_TABLE . ' SET user_style = ' . $default_style;
|
||||||
$this->sql_query($sql);
|
$this->sql_query($sql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -183,9 +183,9 @@ class style_update_p1 extends \phpbb\db\migration\migration
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset styles for users
|
// Reset styles for users
|
||||||
$this->sql_query('UPDATE ' . USERS_TABLE . '
|
$this->sql_query('UPDATE ' . USERS_TABLE . "
|
||||||
SET user_style = 0
|
SET user_style = '" . $valid_styles[0] . "'
|
||||||
WHERE ' . $this->db->sql_in_set('user_style', $valid_styles, true));
|
WHERE " . $this->db->sql_in_set('user_style', $valid_styles, true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -278,24 +278,6 @@ class user extends \phpbb\session
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
// User has wrong style
|
|
||||||
if (!$this->style && $style_id == $this->data['user_style'])
|
|
||||||
{
|
|
||||||
$style_id = $this->data['user_style'] = $config['default_style'];
|
|
||||||
|
|
||||||
$sql = 'UPDATE ' . USERS_TABLE . "
|
|
||||||
SET user_style = $style_id
|
|
||||||
WHERE user_id = {$this->data['user_id']}";
|
|
||||||
$db->sql_query($sql);
|
|
||||||
|
|
||||||
$sql = 'SELECT *
|
|
||||||
FROM ' . STYLES_TABLE . " s
|
|
||||||
WHERE s.style_id = $style_id";
|
|
||||||
$result = $db->sql_query($sql, 3600);
|
|
||||||
$this->style = $db->sql_fetchrow($result);
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$this->style)
|
if (!$this->style)
|
||||||
{
|
{
|
||||||
trigger_error('NO_STYLE_DATA', E_USER_ERROR);
|
trigger_error('NO_STYLE_DATA', E_USER_ERROR);
|
||||||
|
|
Loading…
Add table
Reference in a new issue