aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/admin
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2002-10-26 12:36:38 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2002-10-26 12:36:38 +0000
commit1edc9d362f316c5f8149743f585f301703a966d8 (patch)
tree4c65dd50a681e6f6014d892f750e6aa139cb48a1 /phpBB/admin
parenta7d186fd9127db566ec2ad0a66aaeabe2d569004 (diff)
downloadforums-1edc9d362f316c5f8149743f585f301703a966d8.tar
forums-1edc9d362f316c5f8149743f585f301703a966d8.tar.gz
forums-1edc9d362f316c5f8149743f585f301703a966d8.tar.bz2
forums-1edc9d362f316c5f8149743f585f301703a966d8.tar.xz
forums-1edc9d362f316c5f8149743f585f301703a966d8.zip
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
Diffstat (limited to 'phpBB/admin')
-rw-r--r--phpBB/admin/admin_ban.php16
-rw-r--r--phpBB/admin/admin_board.php8
-rw-r--r--phpBB/admin/admin_permissions.php22
-rw-r--r--phpBB/admin/index.php4
4 files changed, 25 insertions, 25 deletions
diff --git a/phpBB/admin/admin_ban.php b/phpBB/admin/admin_ban.php
index fa672a935a..bd4c9775d1 100644
--- a/phpBB/admin/admin_ban.php
+++ b/phpBB/admin/admin_ban.php
@@ -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]) . '\'';
diff --git a/phpBB/admin/admin_board.php b/phpBB/admin/admin_board.php
index 6f26eb934b..fb0b54997c 100644
--- a/phpBB/admin/admin_board.php
+++ b/phpBB/admin/admin_board.php
@@ -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']);
}
//
diff --git a/phpBB/admin/admin_permissions.php b/phpBB/admin/admin_permissions.php
index d1bbf440e9..05d83d9139 100644
--- a/phpBB/admin/admin_permissions.php
+++ b/phpBB/admin/admin_permissions.php
@@ -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
diff --git a/phpBB/admin/index.php b/phpBB/admin/index.php
index 25a8b95ce9..e8a6c1d134 100644
--- a/phpBB/admin/index.php
+++ b/phpBB/admin/index.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']);