aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2009-01-22 12:47:08 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2009-01-22 12:47:08 +0000
commit04fdca03b3761bdf24c2303bad3fcab35f5594a8 (patch)
tree4b37e0814bdb8ef015da10a55ee2993f5e5b02b5
parent121116cae369f7385d475c8354f976d56ac3e909 (diff)
downloadforums-04fdca03b3761bdf24c2303bad3fcab35f5594a8.tar
forums-04fdca03b3761bdf24c2303bad3fcab35f5594a8.tar.gz
forums-04fdca03b3761bdf24c2303bad3fcab35f5594a8.tar.bz2
forums-04fdca03b3761bdf24c2303bad3fcab35f5594a8.tar.xz
forums-04fdca03b3761bdf24c2303bad3fcab35f5594a8.zip
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
-rw-r--r--phpBB/includes/classes/user.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/phpBB/includes/classes/user.php b/phpBB/includes/classes/user.php
index d4d083916c..f24f1f1a59 100644
--- a/phpBB/includes/classes/user.php
+++ b/phpBB/includes/classes/user.php
@@ -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']);