From 1405e47fc10bf75fb325e3e8e2978cc06ba1c261 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sat, 9 Nov 2002 00:04:18 +0000 Subject: Mainly updates for additional/altered admin permission options ... note, you MUST empty your current auth_options table and insert the list from the mysql_basic, you will also need to empty the auth_user/auth_group tables and re-assign permissions, and you should clear the $acl_options array in config_cache git-svn-id: file:///svn/phpbb/trunk@3020 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/admin/admin_email.php | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) (limited to 'phpBB/admin/admin_email.php') diff --git a/phpBB/admin/admin_email.php b/phpBB/admin/admin_email.php index 41e3ca55cd..ada237a912 100644 --- a/phpBB/admin/admin_email.php +++ b/phpBB/admin/admin_email.php @@ -19,33 +19,28 @@ * ***************************************************************************/ -if ( !empty($setmodules) ) +if (!empty($setmodules)) { - if ( !$auth->acl_get('a_general') ) + if (!$auth->acl_get('a_email')) { return; } - $filename = basename(__FILE__); - $module['General']['Mass_Email'] = $filename . $SID; + $module['General']['Mass_Email'] = basename(__FILE__) . $SID; return; } define('IN_PHPBB', 1); -// // Include files -// $phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); -// -// Do we have general admin permissions? -// -if ( !$auth->acl_get('a_general') ) +// Check permissions +if (!$auth->acl_get('a_email')) { - return; + trigger_error($user->lang['NO_ADMIN']); } // @@ -57,7 +52,7 @@ $subject = ''; // // Do the job ... // -if ( isset($_POST['submit']) ) +if (isset($_POST['submit'])) { // // Increase maximum execution time in case of a lot of users, but don't complain about it if it isn't @@ -67,10 +62,10 @@ if ( isset($_POST['submit']) ) $group_id = intval($_POST['g']); - $sql = ( $group_id != -1 ) ? "SELECT u.user_email FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug WHERE ug.group_id = $group_id AND ug.user_pending <> " . TRUE . " AND u.user_id = ug.user_id" : "SELECT user_email FROM " . USERS_TABLE; + $sql = ($group_id != -1) ? "SELECT u.user_email FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug WHERE ug.group_id = $group_id AND ug.user_pending <> " . TRUE . " AND u.user_id = ug.user_id" : "SELECT user_email FROM " . USERS_TABLE; $result = $db->sql_query($sql); - if ( !($email_list = $db->sql_fetchrowset($g_result)) ) + if (!($email_list = $db->sql_fetchrowset($g_result))) { // // Output a relevant GENERAL_MESSAGE about users/group @@ -87,14 +82,14 @@ if ( isset($_POST['submit']) ) // $error = FALSE; - if ( !$error ) + if (!$error) { include($phpbb_root_path . 'includes/emailer.'.$phpEx); // // Let's do some checking to make sure that mass mail functions // are working in win32 versions of php. // - if ( preg_match('/[c-z]:\\\.*/i', getenv('PATH')) && !$config['smtp_delivery']) + if (preg_match('/[c-z]:\\\.*/i', getenv('PATH')) && !$config['smtp_delivery']) { // We are running on windows, force delivery to use // our smtp functions since php's are broken by default @@ -108,7 +103,7 @@ if ( isset($_POST['submit']) ) $bcc_list = ''; for($i = 0; $i < count($email_list); $i++) { - $bcc_list .= ( ( $bcc_list != '' ) ? ', ' : '' ) . $email_list[$i]['user_email']; + $bcc_list .= (($bcc_list != '') ? ', ' : '') . $email_list[$i]['user_email']; } $email_headers .= "Bcc: $bcc_list\n"; @@ -145,13 +140,13 @@ $sql = "SELECT group_id, group_name $result = $db->sql_query($sql); $select_list = ''; @@ -163,7 +158,7 @@ page_header($user->lang['Mass_Email']);

lang['Mass_email_explain']; ?>

-
"> +
-- cgit v1.2.1
lang['Compose']; ?>