From b15a3111be0c51410e302500df9b4cbce9cd38d3 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 2 Aug 2006 15:53:19 +0000 Subject: - fixing some bugs - removed file_exists calls for auth plugins since they need to be there once set up git-svn-id: file:///svn/phpbb/trunk@6228 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/session.php | 57 ++++++++++++++++------------------------------ 1 file changed, 19 insertions(+), 38 deletions(-) (limited to 'phpBB/includes/session.php') diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 922e9bdb91..12ba3dba1e 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -172,17 +172,10 @@ class session // Load limit check (if applicable) if ($config['limit_load']) { - if (@file_exists('/proc/loadavg') && @is_readable('/proc/loadavg')) + if ($load = @file_get_contents('/proc/loadavg')) { - if ($load = @file_get_contents('/proc/loadavg')) - { - $this->load = array_slice(explode(' ', $load), 0, 1); - $this->load = floatval($this->load[0]); - } - else - { - set_config('limit_load', '0'); - } + $this->load = array_slice(explode(' ', $load), 0, 1); + $this->load = floatval($this->load[0]); } else { @@ -220,18 +213,14 @@ class session // Check whether the session is still valid if we have one $method = basename(trim($config['auth_method'])); + include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx); - if (file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx)) + $method = 'validate_session_' . $method; + if (function_exists($method)) { - include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx); - - $method = 'validate_session_' . $method; - if (function_exists($method)) + if (!$method($this->data)) { - if (!$method($this->data)) - { - $session_expired = true; - } + $session_expired = true; } } @@ -357,21 +346,17 @@ class session } $method = basename(trim($config['auth_method'])); + include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx); - if (file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx)) + $method = 'autologin_' . $method; + if (function_exists($method)) { - include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx); + $this->data = $method(); - $method = 'autologin_' . $method; - if (function_exists($method)) + if (sizeof($this->data)) { - $this->data = $method(); - - if (sizeof($this->data)) - { - $this->cookie_data['k'] = ''; - $this->cookie_data['u'] = $this->data['user_id']; - } + $this->cookie_data['k'] = ''; + $this->cookie_data['u'] = $this->data['user_id']; } } @@ -547,16 +532,12 @@ class session // Allow connecting logout with external auth method logout $method = basename(trim($config['auth_method'])); + include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx); - if (file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx)) + $method = 'logout_' . $method; + if (function_exists($method)) { - include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx); - - $method = 'logout_' . $method; - if (function_exists($method)) - { - $method($this->data); - } + $method($this->data); } if ($this->data['user_id'] != ANONYMOUS) -- cgit v1.2.1