mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 16:35:35 +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:
@ -33,6 +33,7 @@ if ( !empty($setmodules) )
|
|||||||
$module['General']['Board_settings'] = "$file$SID&mode=setting";
|
$module['General']['Board_settings'] = "$file$SID&mode=setting";
|
||||||
$module['General']['Email_settings'] = "$file$SID&mode=email";
|
$module['General']['Email_settings'] = "$file$SID&mode=email";
|
||||||
$module['General']['Server_settings'] = "$file$SID&mode=server";
|
$module['General']['Server_settings'] = "$file$SID&mode=server";
|
||||||
|
$module['General']['Auth_settings'] = "$file$SID&mode=auth";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,25 +62,16 @@ else
|
|||||||
//
|
//
|
||||||
// Pull all config data
|
// Pull all config data
|
||||||
//
|
//
|
||||||
switch ( $mode )
|
$sql = "SELECT *
|
||||||
{
|
|
||||||
case 'userdefs':
|
|
||||||
$sql = "SELECT *
|
|
||||||
FROM " . CONFIG_USER_TABLE;
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
$sql = "SELECT *
|
|
||||||
FROM " . CONFIG_TABLE;
|
FROM " . CONFIG_TABLE;
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
while ( $row = $db->sql_fetchrow($result) )
|
while ( $row = $db->sql_fetchrow($result) )
|
||||||
{
|
{
|
||||||
$config_name = $row['config_name'];
|
$config_name = $row['config_name'];
|
||||||
$config_value = $row['config_value'];
|
$config_value = $row['config_value'];
|
||||||
$default_config[$config_name] = $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];
|
$new[$config_name] = ( isset($HTTP_POST_VARS[$config_name]) ) ? $HTTP_POST_VARS[$config_name] : $default_config[$config_name];
|
||||||
|
|
||||||
if ( isset($HTTP_POST_VARS['submit']) )
|
if ( isset($HTTP_POST_VARS['submit']) )
|
||||||
@ -89,8 +81,6 @@ switch ( $mode )
|
|||||||
WHERE config_name = '$config_name'";
|
WHERE config_name = '$config_name'";
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isset($HTTP_POST_VARS['submit']) )
|
if ( isset($HTTP_POST_VARS['submit']) )
|
||||||
@ -122,6 +112,12 @@ switch ( $mode )
|
|||||||
case 'server':
|
case 'server':
|
||||||
$l_title = 'Server_settings';
|
$l_title = 'Server_settings';
|
||||||
break;
|
break;
|
||||||
|
case 'login':
|
||||||
|
$l_title = 'Server_settings';
|
||||||
|
break;
|
||||||
|
case 'auth':
|
||||||
|
$l_title = 'Auth_settings';
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -506,6 +502,55 @@ switch ( $mode )
|
|||||||
|
|
||||||
break;
|
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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Reference in New Issue
Block a user