mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
Preliminary 'freeze' on permissions awaiting developer feedback, testing, etc. Caching of non-dynmaic config and acl option elements.
git-svn-id: file:///svn/phpbb/trunk@2970 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -41,17 +41,13 @@ $phpbb_root_path = '../';
|
||||
require($phpbb_root_path . 'extension.inc');
|
||||
require('pagestart.' . $phpEx);
|
||||
|
||||
//
|
||||
// Do we have ban permissions?
|
||||
//
|
||||
if ( !$auth->acl_get('a_ban') )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// Mode setting
|
||||
//
|
||||
if ( isset($_POST['mode']) || isset($_GET['mode']) )
|
||||
{
|
||||
$mode = ( isset($_POST['mode']) ) ? $_POST['mode'] : $_GET['mode'];
|
||||
@@ -63,15 +59,15 @@ else
|
||||
|
||||
$current_time = time();
|
||||
|
||||
//
|
||||
// Start program
|
||||
//
|
||||
if ( isset($_POST['bansubmit']) )
|
||||
if ( isset($_POST['bansubmit']) || isset($_GET['bansubmit']) )
|
||||
{
|
||||
$ban_reason = ( isset($_POST['banreason']) ) ? $_POST['banreason'] : '';
|
||||
$ban_list = array_unique(explode("\n", $_POST['ban']));
|
||||
$ban = ( !empty($_POST['ban']) ) ? $_POST['ban'] : $_GET['ban'];
|
||||
$ban_list = array_unique(explode("\n", $ban));
|
||||
$ban_list_log = implode(', ', $ban_list);
|
||||
|
||||
$ban_reason = ( isset($_POST['banreason']) ) ? $_POST['banreason'] : '';
|
||||
|
||||
if ( !empty($_POST['banlength']) )
|
||||
{
|
||||
if ( $_POST['banlength'] != -1 || empty($_POST['banlengthother']) )
|
||||
@@ -207,11 +203,9 @@ if ( isset($_POST['bansubmit']) )
|
||||
|
||||
for($i = 0; $i < count($ban_list); $i++)
|
||||
{
|
||||
//
|
||||
// This ereg match is based on one by php@unreelpro.com
|
||||
// contained in the annotated php manual at php.com (ereg
|
||||
// section)
|
||||
//
|
||||
if ( eregi('^(([[:alnum:]\*]+([-_.][[:alnum:]\*]+)*\.?)|(\*))@([[:alnum:]]+([-_]?[[:alnum:]]+)*\.){1,3}([[:alnum:]]{2,6})$', trim($ban_list[$i])) )
|
||||
{
|
||||
$banlist[] = '\'' . trim($ban_list[$i]) . '\'';
|
||||
|
@@ -42,11 +42,12 @@ define('IN_PHPBB', 1);
|
||||
$phpbb_root_path = '../';
|
||||
require($phpbb_root_path . 'extension.inc');
|
||||
require('pagestart.' . $phpEx);
|
||||
require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
||||
|
||||
// Are we authed?
|
||||
if ( !$auth->acl_get('a_general') )
|
||||
{
|
||||
message_die(MESSAGE, $user->lang['No_admin']);
|
||||
trigger_error($user->lang['No_admin']);
|
||||
}
|
||||
|
||||
// Get mod
|
||||
@@ -83,8 +84,11 @@ while ( $row = $db->sql_fetchrow($result) )
|
||||
|
||||
if ( isset($_POST['submit']) )
|
||||
{
|
||||
// Re-cache config data
|
||||
config_config($new);
|
||||
|
||||
add_admin_log('log_' . $mode . '_config');
|
||||
message_die(MESSAGE, $user->lang['Config_updated']);
|
||||
trigger_error($user->lang['Config_updated']);
|
||||
}
|
||||
|
||||
//
|
||||
|
@@ -46,7 +46,7 @@ require($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
||||
// Do we have forum admin permissions?
|
||||
if ( !$auth->acl_get('a_auth') )
|
||||
{
|
||||
message_die(MESSAGE, $user->lang['No_admin']);
|
||||
trigger_error($user->lang['No_admin']);
|
||||
}
|
||||
|
||||
// Define some vars
|
||||
@@ -78,16 +78,19 @@ switch ( $mode )
|
||||
$l_title_explain = $user->lang['Permissions_explain'];
|
||||
$l_can = '_can';
|
||||
break;
|
||||
|
||||
case 'moderators':
|
||||
$l_title = $user->lang['Moderators'];
|
||||
$l_title_explain = $user->lang['Moderators_explain'];
|
||||
$l_can = '_can';
|
||||
break;
|
||||
|
||||
case 'supermoderators':
|
||||
$l_title = $user->lang['Super_Moderators'];
|
||||
$l_title_explain = $user->lang['Super_Moderators_explain'];
|
||||
$l_can = '_can';
|
||||
break;
|
||||
|
||||
case 'administrators':
|
||||
$l_title = $user->lang['Administrators'];
|
||||
$l_title_explain = $user->lang['Administrators_explain'];
|
||||
@@ -147,12 +150,10 @@ else if ( isset($_POST['delete']) )
|
||||
trigger_error('Permissions updated successfully');
|
||||
}
|
||||
|
||||
// Get required information, either all forums if
|
||||
// no id was specified or just the requsted if it
|
||||
// was
|
||||
// Get required information, either all forums if no id was
|
||||
// specified or just the requsted if it was
|
||||
if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators' )
|
||||
{
|
||||
//
|
||||
// Clear some vars, grab some info if relevant ...
|
||||
$s_hidden_fields = '';
|
||||
|
||||
@@ -394,8 +395,8 @@ if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators
|
||||
// NEEDS COMPLETING ... OR SCRAPPING :D
|
||||
quick_options = new Array();
|
||||
quick_options['basic'] = new Array();
|
||||
quick_options['basic']['allow'] = '34, 36,';
|
||||
quick_options['basic']['deny'] = '35,';
|
||||
quick_options['basic']['allow'] = '';
|
||||
quick_options['basic']['deny'] = '';
|
||||
quick_options['basic']['inherit'] = '';
|
||||
quick_options['advanced'] = new Array();
|
||||
|
||||
@@ -412,6 +413,7 @@ if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators
|
||||
{
|
||||
if (option)
|
||||
{
|
||||
document.acl.set.selectedIndex = 0;
|
||||
var expr = new RegExp(/\d+/);
|
||||
for (i = 0; i < document.acl.length; i++)
|
||||
{
|
||||
@@ -478,9 +480,9 @@ if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators
|
||||
?>
|
||||
<tr>
|
||||
<td class="<?php echo $row_class; ?>"><?php echo $l_can_cell; ?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_option_id']; ?>]" value="<?php echo ACL_ALLOW; ?>"<?php echo $allow_type; ?> /></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_option_id']; ?>]" value="<?php echo ACL_DENY; ?>"<?php echo $deny_type; ?> /></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_option_id']; ?>]" value="<?php echo ACL_INHERIT; ?>"<?php echo $inherit_type; ?> /></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_value']; ?>]" value="<?php echo ACL_ALLOW; ?>"<?php echo $allow_type; ?> /></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_value']; ?>]" value="<?php echo ACL_DENY; ?>"<?php echo $deny_type; ?> /></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_value']; ?>]" value="<?php echo ACL_INHERIT; ?>"<?php echo $inherit_type; ?> /></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
|
@@ -174,8 +174,8 @@ elseif ( isset($_GET['pane']) && $_GET['pane'] == 'right' )
|
||||
}
|
||||
|
||||
// Get forum statistics
|
||||
$total_posts = get_db_stat('postcount');
|
||||
$total_topics = get_db_stat('topiccount');
|
||||
$total_posts = $board_config['num_posts'];
|
||||
$total_topics = $board_config['num_topics'];
|
||||
$total_users = $board_config['num_users'];
|
||||
|
||||
$start_date = $user->format_date($board_config['board_startdate']);
|
||||
|
Reference in New Issue
Block a user