mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-01 20:19:13 +02:00
Authentication stuff ... plugins generate any HTML form stuff they require
git-svn-id: file:///svn/phpbb/trunk@2838 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
2c55d91ef8
commit
702761f40b
@ -33,6 +33,7 @@ if ( !empty($setmodules) )
|
||||
$module['General']['Board_settings'] = "$file$SID&mode=setting";
|
||||
$module['General']['Email_settings'] = "$file$SID&mode=email";
|
||||
$module['General']['Server_settings'] = "$file$SID&mode=server";
|
||||
$module['General']['Auth_settings'] = "$file$SID&mode=auth";
|
||||
return;
|
||||
}
|
||||
|
||||
@ -61,36 +62,25 @@ else
|
||||
//
|
||||
// Pull all config data
|
||||
//
|
||||
switch ( $mode )
|
||||
$sql = "SELECT *
|
||||
FROM " . CONFIG_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ( $row = $db->sql_fetchrow($result) )
|
||||
{
|
||||
case 'userdefs':
|
||||
$sql = "SELECT *
|
||||
FROM " . CONFIG_USER_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
break;
|
||||
$config_name = $row['config_name'];
|
||||
$config_value = $row['config_value'];
|
||||
|
||||
default:
|
||||
$sql = "SELECT *
|
||||
FROM " . CONFIG_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
$default_config[$config_name] = $config_value;
|
||||
$new[$config_name] = ( isset($HTTP_POST_VARS[$config_name]) ) ? $HTTP_POST_VARS[$config_name] : $default_config[$config_name];
|
||||
|
||||
while ( $row = $db->sql_fetchrow($result) )
|
||||
{
|
||||
$config_name = $row['config_name'];
|
||||
$config_value = $row['config_value'];
|
||||
$default_config[$config_name] = $config_value;
|
||||
|
||||
$new[$config_name] = ( isset($HTTP_POST_VARS[$config_name]) ) ? $HTTP_POST_VARS[$config_name] : $default_config[$config_name];
|
||||
|
||||
if ( isset($HTTP_POST_VARS['submit']) )
|
||||
{
|
||||
$sql = "UPDATE " . CONFIG_TABLE . " SET
|
||||
config_value = '" . str_replace("\'", "''", $new[$config_name]) . "'
|
||||
WHERE config_name = '$config_name'";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
break;
|
||||
if ( isset($HTTP_POST_VARS['submit']) )
|
||||
{
|
||||
$sql = "UPDATE " . CONFIG_TABLE . " SET
|
||||
config_value = '" . str_replace("\'", "''", $new[$config_name]) . "'
|
||||
WHERE config_name = '$config_name'";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset($HTTP_POST_VARS['submit']) )
|
||||
@ -122,6 +112,12 @@ switch ( $mode )
|
||||
case 'server':
|
||||
$l_title = 'Server_settings';
|
||||
break;
|
||||
case 'login':
|
||||
$l_title = 'Server_settings';
|
||||
break;
|
||||
case 'auth':
|
||||
$l_title = 'Auth_settings';
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
@ -506,6 +502,55 @@ switch ( $mode )
|
||||
|
||||
break;
|
||||
|
||||
case 'auth':
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
$auth_plugins = array();
|
||||
|
||||
$dp = opendir($phpbb_root_path . 'includes/auth');
|
||||
while ( $file = readdir($dp) )
|
||||
{
|
||||
if ( preg_match('/^auth_(.*?)\.' . $phpEx . '$/', $file) )
|
||||
{
|
||||
$auth_plugins[] = preg_replace('/^auth_(.*?)\.' . $phpEx . '$/', '\1', $file);
|
||||
}
|
||||
}
|
||||
|
||||
sort($auth_plugins);
|
||||
|
||||
$auth_select = '';
|
||||
foreach ( $auth_plugins as $method )
|
||||
{
|
||||
$selected = ( $board_config['auth_method'] == $method ) ? ' selected="selected"' : '';
|
||||
$auth_select .= '<option value="' . $method . '"' . $selected . '>' . ucfirst($method) . '</option>';
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="row1" width="50%"><?php echo $lang['Auth_method']; ?>:</td>
|
||||
<td class="row2"><select name="auth_method"><?php echo $auth_select; ?></select></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
foreach ( $auth_plugins as $method )
|
||||
{
|
||||
if ( $method && file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx) )
|
||||
{
|
||||
include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
|
||||
|
||||
$method = 'admin_' . $method;
|
||||
if ( function_exists($method) )
|
||||
{
|
||||
$method($new);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user