diff options
| author | Nils Adermann <naderman@naderman.de> | 2006-03-18 16:19:18 +0000 |
|---|---|---|
| committer | Nils Adermann <naderman@naderman.de> | 2006-03-18 16:19:18 +0000 |
| commit | 957502a28b1d2afec74cad30731dc2ee101cafe3 (patch) | |
| tree | 7707c27358fd83138566fca91fe8577bbffdd06f /phpBB/includes/acp/acp_board.php | |
| parent | 9f7bc931259522fe7ae1ea9d6b5f4b17b60c97ad (diff) | |
| download | forums-957502a28b1d2afec74cad30731dc2ee101cafe3.tar forums-957502a28b1d2afec74cad30731dc2ee101cafe3.tar.gz forums-957502a28b1d2afec74cad30731dc2ee101cafe3.tar.bz2 forums-957502a28b1d2afec74cad30731dc2ee101cafe3.tar.xz forums-957502a28b1d2afec74cad30731dc2ee101cafe3.zip | |
- Added init_{$auth_plugin} function which can be used to test a connection to the authentication system before actually saving the new configuration. This will hopefully stop people from locking themselves out by using an authentication system that they cannot connect to.
git-svn-id: file:///svn/phpbb/trunk@5653 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/acp/acp_board.php')
| -rw-r--r-- | phpBB/includes/acp/acp_board.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index d39316226b..cc5b316a09 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -282,6 +282,11 @@ class acp_board continue; } + if ($config_name == 'auth_method') + { + continue; + } + $config_value = $cfg_array[$config_name]; $this->new_config[$config_name] = $config_value; @@ -313,6 +318,8 @@ class acp_board sort($auth_plugins); + $updated_auth_settings = false; + $old_auth_config = array(); foreach ($auth_plugins as $method) { if ($method && file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx)) @@ -337,11 +344,13 @@ class acp_board continue; } + $old_auth_config[$field] = $this->new_config[$field]; $config_value = $cfg_array[$field]; $this->new_config[$field] = $config_value; if ($submit) { + $updated_auth_settings = true; set_config($field, $config_value); } } @@ -350,6 +359,33 @@ class acp_board } } } + + if ($submit && (($cfg_array['auth_method'] != $this->new_config['auth_method']) || $updated_auth_settings)) + { + $method = $cfg_array['auth_method']; + if ($method && in_array($method, $auth_plugins)) + { + include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx); + + $method = 'init_' . $method; + if (function_exists($method)) + { + if (($error = $method()) == true) + { + foreach ($old_auth_config as $config_name => $config_value) + { + set_config($config_name, $config_value); + } + trigger_error($error . adm_back_link($this->u_action)); + } + } + set_config('auth_method', $cfg_array['auth_method']); + } + else + { + trigger_error('NO_AUTH_PLUGIN'); + } + } } if ($submit) |
