As I have many problems im mass emailing in phpBB 3,I found this php-script that alows me to get my forum user emails from database.
But anyone can run this script in my forum and rubbing users emails too if know filename ! So I want make changes on it so only ADMIN that logged in ACP can run this script,what changes should be make in this script to do it ?
Code: Select all
<?php
//Downloaded from www.Maghsad.com
// Do not change this part
if (!defined('IN_PHPBB'))
{
exit;
}
$phpbb_root_path = './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
if ($_GET['fid']) { $fid = $_GET['fid']; }
$sql = 'SELECT user_email FROM phpbb_users';
$result = $db->sql_query($sql);
while ($data = $db->sql_fetchrow($result)) {
echo ','.$data['user_email'].',';
echo '<br>';
}
?>