1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-21 23:13:43 +02:00

make sure user->setup() works even if there is no valid session

git-svn-id: file:///svn/phpbb/trunk@9291 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2009-01-22 12:47:08 +00:00
parent 121116cae3
commit 04fdca03b3

View File

@ -2,7 +2,7 @@
/**
*
* @package phpBB3
* @version $Id: user.php 9205 2008-12-18 18:08:57Z acydburn $
* @version $Id$
* @copyright (c) 2005, 2008 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
@ -225,6 +225,17 @@ class phpbb_user extends phpbb_session
*/
public function setup($lang_set = false, $style = false)
{
// Check if there is a valid session
if (empty($this->data))
{
$this->session_begin();
if (phpbb::registered('acl'))
{
phpbb::$acl->init($this->data);
}
}
if ($this->data['user_id'] != ANONYMOUS)
{
$this->lang_name = (file_exists($this->lang_path . $this->data['user_lang'] . "/common." . PHP_EXT)) ? $this->data['user_lang'] : basename(phpbb::$config['default_lang']);