Remove need for session_ids for "allowed" bots, dump user_founder/user_active in favour of user_type, new user_type, USER_IGNORE

git-svn-id: file:///svn/phpbb/trunk@4603 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2003-10-15 17:43:07 +00:00
parent 8661a45de5
commit a47fa4d6ca
21 changed files with 425 additions and 251 deletions

View file

@ -3,7 +3,7 @@
// //
// $Id$ // $Id$
// //
// FILENAME : viewtopic.php // FILENAME : admin_jabber.php
// STARTED : Sat Feb 13, 2001 // STARTED : Sat Feb 13, 2001
// COPYRIGHT : © 2001, 2003 phpBB Group // COPYRIGHT : © 2001, 2003 phpBB Group
// WWW : http://www.phpbb.com/ // WWW : http://www.phpbb.com/

View file

@ -145,7 +145,7 @@ elseif ($pane == 'right')
trigger_error($user->lang['NO_ADMIN']); trigger_error($user->lang['NO_ADMIN']);
} }
$sql = ($activate) ? 'UPDATE ' . USERS_TABLE . " SET user_active = 1 WHERE user_id IN ($mark)" : 'DELETE FROM ' . USERS_TABLE . " WHERE user_id IN ($mark)"; $sql = ($activate) ? 'UPDATE ' . USERS_TABLE . ' SET user_type = ' . USER_NORMAL . " WHERE user_id IN ($mark)" : 'DELETE FROM ' . USERS_TABLE . " WHERE user_id IN ($mark)";
$db->sql_query($sql); $db->sql_query($sql);
if (!$delete) if (!$delete)
@ -253,7 +253,7 @@ elseif ($pane == 'right')
$sql = 'SELECT COUNT(user_id) AS stat $sql = 'SELECT COUNT(user_id) AS stat
FROM ' . USERS_TABLE . ' FROM ' . USERS_TABLE . '
WHERE user_active = 1'; WHERE user_type IN (' . USER_NORMAL . ',' . USER_FOUNDER . ')';
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result); $row = $db->sql_fetchrow($result);
@ -516,9 +516,8 @@ elseif ($pane == 'right')
<?php <?php
$sql = 'SELECT user_id, username, user_regdate $sql = 'SELECT user_id, username, user_regdate
FROM ' . USERS_TABLE . ' FROM ' . USERS_TABLE . '
WHERE user_active = 0 WHERE user_type = ' . USER_INACTIVE . '
AND user_id <> ' . ANONYMOUS . '
ORDER BY user_regdate ASC'; ORDER BY user_regdate ASC';
$result = $db->sql_query($sql); $result = $db->sql_query($sql);

View file

@ -32,15 +32,6 @@ if (@ini_get('register_globals'))
} }
} }
// If magic quotes is off, addslashes
/*if (!get_magic_quotes_gpc())
{
$_GET = slash_input_data($_GET);
$_POST = slash_input_data($_POST);
$_REQUEST = slash_input_data($_REQUEST);
$_COOKIE = slash_input_data($_COOKIE);
}*/
require($phpbb_root_path . 'config.'.$phpEx); require($phpbb_root_path . 'config.'.$phpEx);
if (!defined('PHPBB_INSTALLED')) if (!defined('PHPBB_INSTALLED'))
@ -86,6 +77,11 @@ define('AVATAR_UPLOAD', 1);
define('AVATAR_REMOTE', 2); define('AVATAR_REMOTE', 2);
define('AVATAR_GALLERY', 3); define('AVATAR_GALLERY', 3);
define('USER_NORMAL', 0);
define('USER_INACTIVE', 1);
define('USER_IGNORE', 2);
define('USER_FOUNDER', 3);
// ACL // ACL
define('ACL_NO', 0); define('ACL_NO', 0);
define('ACL_YES', 1); define('ACL_YES', 1);
@ -156,6 +152,7 @@ define('ATTACHMENTS_TABLE', $table_prefix.'attachments');
define('ATTACHMENTS_DESC_TABLE', $table_prefix.'attach_desc'); define('ATTACHMENTS_DESC_TABLE', $table_prefix.'attach_desc');
define('BANLIST_TABLE', $table_prefix.'banlist'); define('BANLIST_TABLE', $table_prefix.'banlist');
define('BBCODES_TABLE', $table_prefix.'bbcodes'); define('BBCODES_TABLE', $table_prefix.'bbcodes');
define('BOTS_TABLE', $table_prefix.'bots');
define('CACHE_TABLE', $table_prefix.'cache'); define('CACHE_TABLE', $table_prefix.'cache');
define('CONFIG_TABLE', $table_prefix.'config'); define('CONFIG_TABLE', $table_prefix.'config');
define('CONFIRM_TABLE', $table_prefix.'confirm'); define('CONFIRM_TABLE', $table_prefix.'confirm');

View file

@ -20,7 +20,7 @@ function login_apache(&$username, &$password)
if ($php_auth_user && $php_auth_pw) if ($php_auth_user && $php_auth_pw)
{ {
$sql = ' user_id, username, user_password, user_passchg, user_email, user_active $sql = ' user_id, username, user_password, user_passchg, user_email, user_type
FROM ' . USERS_TABLE . " FROM ' . USERS_TABLE . "
WHERE username = '" . $db->sql_escape($username) . "'"; WHERE username = '" . $db->sql_escape($username) . "'";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
@ -28,7 +28,7 @@ function login_apache(&$username, &$password)
if ($row = $db->sql_fetchrow($result)) if ($row = $db->sql_fetchrow($result))
{ {
$db->sql_freeresult($result); $db->sql_freeresult($result);
return (empty($row['user_active'])) ? 0 : $row; return ($row['user_type'] == USER_INACTIVE || $row['user_type'] == USER_IGNORE) ? 0 : $row;
} }
} }

View file

@ -14,7 +14,7 @@ function login_db(&$username, &$password)
{ {
global $db, $config; global $db, $config;
$sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_active $sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_type
FROM ' . USERS_TABLE . " FROM ' . USERS_TABLE . "
WHERE username = '" . $db->sql_escape($username) . "'"; WHERE username = '" . $db->sql_escape($username) . "'";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
@ -24,7 +24,7 @@ function login_db(&$username, &$password)
$db->sql_freeresult($result); $db->sql_freeresult($result);
if (md5($password) == $row['user_password']) if (md5($password) == $row['user_password'])
{ {
return (empty($row['user_active'])) ? 0 : $row; return ($row['user_type'] == USER_INACTIVE || $row['user_type'] == USER_IGNORE) ? 0 : $row;
} }
} }

View file

@ -34,7 +34,7 @@ function login_ldap(&$username, &$password)
{ {
@ldap_close($ldap); @ldap_close($ldap);
$sql ='SELECT user_id, username, user_password, user_passchg, user_email, user_active $sql ='SELECT user_id, username, user_password, user_passchg, user_email, user_type
FROM ' . USERS_TABLE . " FROM ' . USERS_TABLE . "
WHERE username = '" . $db->sql_escape($username) . "'"; WHERE username = '" . $db->sql_escape($username) . "'";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
@ -42,7 +42,7 @@ function login_ldap(&$username, &$password)
if ($row = $db->sql_fetchrow($result)) if ($row = $db->sql_fetchrow($result))
{ {
$db->sql_freeresult($result); $db->sql_freeresult($result);
return (empty($row['user_active'])) ? 0 : $row; return ($row['user_type'] == USER_INACTIVE || $row['user_type'] == USER_IGNORE) ? 0 : $row;
} }
} }
} }

View file

@ -1236,16 +1236,15 @@ function page_header($page_title = '')
if (!empty($config['load_online']) && !empty($config['load_online_time'])) if (!empty($config['load_online']) && !empty($config['load_online_time']))
{ {
$userlist_ary = $userlist_visible = array(); $userlist_ary = $userlist_visible = array();
$logged_visible_online = $logged_hidden_online = $guests_online = 0; $logged_visible_online = $logged_hidden_online = $guests_online = $prev_user_id = 0;
$prev_user_id = 0;
$prev_user_ip = $reading_sql = ''; $prev_user_ip = $reading_sql = '';
if (!empty($_REQUEST['f'])) if (!empty($_REQUEST['f']))
{ {
$reading_sql = "AND s.session_page LIKE '%f=" . intval($_REQUEST['f']) . "%'"; $reading_sql = "AND s.session_page LIKE '%f=" . intval($_REQUEST['f']) . "%'";
} }
$sql = 'SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_colour, s.session_ip, s.session_allow_viewonline $sql = 'SELECT u.username, u.user_id, u.user_type, u.user_allow_viewonline, u.user_colour, s.session_ip, s.session_allow_viewonline
FROM ' . USERS_TABLE . ' u, ' . SESSIONS_TABLE . ' s FROM ' . USERS_TABLE . ' u, ' . SESSIONS_TABLE . ' s
WHERE s.session_time >= ' . (time() - (intval($config['load_online_time']) * 60)) . " WHERE s.session_time >= ' . (time() - (intval($config['load_online_time']) * 60)) . "
$reading_sql $reading_sql
@ -1279,7 +1278,7 @@ function page_header($page_title = '')
if ($row['user_allow_viewonline'] || $auth->acl_get('u_viewonline')) if ($row['user_allow_viewonline'] || $auth->acl_get('u_viewonline'))
{ {
$user_online_link = "<a href=\"memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $row['user_id'] . '">' . $user_online_link . '</a>'; $user_online_link = ($row['user_type'] <> USER_IGNORE) ? "<a href=\"memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $row['user_id'] . '">' . $user_online_link . '</a>' : $user_online_link;
$online_userlist .= ($online_userlist != '') ? ', ' . $user_online_link : $user_online_link; $online_userlist .= ($online_userlist != '') ? ', ' . $user_online_link : $user_online_link;
} }
} }

View file

@ -357,7 +357,7 @@ function avatar_upload($data, &$error)
} }
unset($url_ary); unset($url_ary);
$tmp_path = (!@ini_get('safe_mode')) ? false : $phpbb_root_path . 'cache/tmp'; $tmp_path = (!@ini_get('safe_mode')) ? false : $phpbb_root_path . 'cache';
$filename = tempnam($tmp_path, uniqid(rand()) . '-'); $filename = tempnam($tmp_path, uniqid(rand()) . '-');
if (!($fp = @fopen($filename, 'wb'))) if (!($fp = @fopen($filename, 'wb')))
@ -389,7 +389,7 @@ function avatar_upload($data, &$error)
// Replace any chars which may cause us problems with _ // Replace any chars which may cause us problems with _
$bad_chars = array(' ', '/', ':', '*', '?', '"', '<', '>', '|'); $bad_chars = array(' ', '/', ':', '*', '?', '"', '<', '>', '|');
$data['filename'] = $user->data['user_id'] . '_' . str_replace($bad_chars, '_', $realname) . '.' . $filetype; $data['filename'] = $data['user_id'] . '_' . str_replace($bad_chars, '_', $realname) . '.' . $filetype;
$data['width'] = $width; $data['width'] = $width;
$data['height'] = $height; $data['height'] = $height;
@ -415,6 +415,48 @@ function avatar_upload($data, &$error)
return $data; return $data;
} }
function avatar_gallery($category, &$error)
{
global $config;
$path = $phpbb_root_path . $config['avatar_gallery_path'];
// To be replaced with SQL ... before M3 completion
$dp = @opendir($path);
$data = array();
$avatar_row_count = $avatar_col_count = 0;
while ($file = readdir($dp))
{
if ($file{0} != '.' && is_dir("$path/$file"))
{
$dp2 = @opendir("$path/$file");
while ($sub_file = readdir($dp2))
{
if (preg_match('#\.(gif$|png$|jpg|jpeg)$#i', $sub_file))
{
$data[$file][$avatar_row_count][$avatar_col_count]['file'] = "$file/$sub_file";
$data[$file][$avatar_row_count][$avatar_col_count]['name'] = ucfirst(str_replace('_', ' ', preg_replace('#^(.*)\..*$#', '\1', $sub_file)));
$avatar_col_count++;
if ($avatar_col_count == 4)
{
$avatar_row_count++;
$avatar_col_count = 0;
}
}
}
closedir($dp2);
}
}
closedir($dp);
@ksort($data);
return $data;
}
// Generates an alphanumeric random string of given length // Generates an alphanumeric random string of given length
function gen_rand_string($num_chars) function gen_rand_string($num_chars)
{ {
@ -444,7 +486,7 @@ function add_to_group($action, $group_id, $user_id_ary, $username_ary, $colour,
$which_ary = ($user_id_ary) ? 'user_id_ary' : 'username_ary'; $which_ary = ($user_id_ary) ? 'user_id_ary' : 'username_ary';
if ($$which_ary && !is_array($$which_ary )) if ($$which_ary && !is_array($$which_ary))
{ {
$user_id_ary = array($user_id_ary); $user_id_ary = array($user_id_ary);
} }

View file

@ -137,8 +137,72 @@ class session
$sessiondata = array(); $sessiondata = array();
$current_time = time(); $current_time = time();
$bot = false;
if ($config['active_sessions']) // Pull bot information from DB and loop through it
$sql = 'SELECT user_id, bot_agent, bot_ip
FROM phpbb_bots
WHERE bot_active = 1';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
if ($row['bot_agent'] && $row['bot_agent'] == $this->browser)
{
$bot = $row['user_id'];
}
if ($row['bot_ip'] && (!$row['bot_agent'] || $bot))
{
foreach (explode(',', $row['bot_ip']) as $bot_ip)
{
if (strpos($this->ip, $bot_ip) === 0)
{
$bot = $row['user_id'];
break;
}
}
}
if ($bot)
{
$user_id = $bot;
break;
}
}
$db->sql_freeresult($result);
// Garbage collection ... remove old sessions updating user information
// if necessary. It means (potentially) 11 queries but only infrequently
if ($current_time - $config['session_gc'] > $config['session_last_gc'])
{
$this->gc($current_time);
}
// Grab user data ... join on session if it exists for session time
$sql = 'SELECT u.*, s.session_time, s.session_id
FROM (' . USERS_TABLE . ' u
LEFT JOIN ' . SESSIONS_TABLE . " s ON s.session_user_id = u.user_id)
WHERE u.user_id = $user_id
ORDER BY s.session_time DESC";
$result = $db->sql_query($sql);
$this->data = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// Check autologin request, is it valid?
if (empty($this->data) || ($this->data['user_password'] != $autologin && !$set_autologin) || ($this->data['user_type'] == USER_INACTIVE && !$bot))
{
$autologin = '';
$this->data['user_id'] = $user_id = ANONYMOUS;
}
// If we're a bot then we'll re-use an existing id if available
if ($bot && $this->data['session_id'])
{
$this->session_id = $this->data['session_id'];
}
if (!$this->data['session_time'] && $config['active_sessions'])
{ {
// Limit sessions in 1 minute period // Limit sessions in 1 minute period
$sql = 'SELECT COUNT(*) AS sessions $sql = 'SELECT COUNT(*) AS sessions
@ -155,33 +219,8 @@ class session
} }
} }
// Garbage collection ... remove old sessions updating user information
// if necessary. It means (potentially) 11 queries but only infrequently
if ($current_time - $config['session_gc'] > $config['session_last_gc'])
{
$this->gc($current_time);
}
// Grab user data ... join on session if it exists for session time
$sql = 'SELECT u.*, s.session_time
FROM (' . USERS_TABLE . ' u
LEFT JOIN ' . SESSIONS_TABLE . " s ON s.session_user_id = u.user_id)
WHERE u.user_id = $user_id
ORDER BY s.session_time DESC";
$result = $db->sql_query($sql);
$this->data = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// Check autologin request, is it valid?
if (empty($this->data) || ($this->data['user_password'] != $autologin && !$set_autologin) || !$this->data['user_active'])
{
$autologin = '';
$this->data['user_id'] = $user_id = ANONYMOUS;
}
// Is user banned? Are they excluded? // Is user banned? Are they excluded?
if (!$this->data['user_founder']) if (!$this->data['user_type'] != USER_FOUNDER && !$bot)
{ {
$banned = false; $banned = false;
@ -259,18 +298,25 @@ class session
} }
$db->sql_return_on_error(false); $db->sql_return_on_error(false);
$this->data['session_id'] = $this->session_id; if (!$bot)
$sessiondata['autologinid'] = ($autologin && $user_id != ANONYMOUS) ? $autologin : '';
$sessiondata['userid'] = $user_id;
$this->set_cookie('data', serialize($sessiondata), $current_time + 31536000);
$this->set_cookie('sid', $this->session_id, 0);
$SID = '?sid=' . $this->session_id;
if ($this->data['user_id'] != ANONYMOUS)
{ {
// Trigger EVT_NEW_SESSION $this->data['session_id'] = $this->session_id;
$sessiondata['autologinid'] = ($autologin && $user_id != ANONYMOUS) ? $autologin : '';
$sessiondata['userid'] = $user_id;
$this->set_cookie('data', serialize($sessiondata), $current_time + 31536000);
$this->set_cookie('sid', $this->session_id, 0);
$SID = '?sid=' . $this->session_id;
if ($this->data['user_id'] != ANONYMOUS)
{
// Trigger EVT_NEW_SESSION
}
}
else
{
$SID = '?sid=';
} }
return true; return true;
@ -729,7 +775,7 @@ class auth
$db->sql_freeresult($result); $db->sql_freeresult($result);
// If this user is founder we're going to force fill the admin options ... // If this user is founder we're going to force fill the admin options ...
if ($userdata['user_founder']) if ($userdata['user_type'] == USER_FOUNDER)
{ {
foreach ($this->acl_options['global'] as $opt => $id) foreach ($this->acl_options['global'] as $opt => $id)
{ {
@ -833,15 +879,8 @@ class auth
$autologin = (!empty($autologin)) ? md5($password) : ''; $autologin = (!empty($autologin)) ? md5($password) : '';
if ($login['user_active']) // Trigger EVENT_LOGIN
{ return $user->create($login['user_id'], $autologin, true, $viewonline);
// Trigger EVENT_LOGIN
return $user->create($login['user_id'], $autologin, true, $viewonline);
}
else
{
return false;
}
} }
} }

View file

@ -3,7 +3,7 @@
// //
// $Id$ // $Id$
// //
// FILENAME : usercp_activate.php // FILENAME : ucp_activate.php
// STARTED : Mon May 19, 2003 // STARTED : Mon May 19, 2003
// COPYRIGHT : © 2001, 2003 phpBB Group // COPYRIGHT : © 2001, 2003 phpBB Group
// WWW : http://www.phpbb.com/ // WWW : http://www.phpbb.com/
@ -13,74 +13,86 @@
class ucp_activate extends module class ucp_activate extends module
{ {
function main($module_id) function ucp_activate($id, $mode)
{ {
global $censors, $config, $db, $user, $auth, $SID, $template, $phpbb_root_path, $phpEx; global $censors, $config, $db, $user, $auth, $SID, $template, $phpbb_root_path, $phpEx;
$user_id = (isset($_REQUEST['u'])) ? intval($_REQUEST['u']) : false; $user_id = request_var('u', 0);
$key = request_var('k', '');
$sql = 'SELECT user_id, username, user_active, user_email, user_newpasswd, user_lang, user_actkey $sql = 'SELECT user_id, username, user_type, user_email, user_newpasswd, user_lang, user_notify_type, user_actkey
FROM ' . USERS_TABLE . " FROM ' . USERS_TABLE . "
WHERE user_id = $user_id"; WHERE user_id = $user_id";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result)) if (!($row = $db->sql_fetchrow($result)))
{
if ($row['user_active'] && $row['user_actkey'] == '')
{
meta_refresh(3, "index.$phpEx$SID");
trigger_error($user->lang['Already_activated']);
}
else if ($row['user_actkey'] == $_GET['k'])
{
$sql_update_pass = ($row['user_newpasswd'] != '') ? ", user_password = '" . $db->sql_escape($row['user_newpasswd']) . "', user_newpasswd = ''" : '';
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_active = 1, user_actkey = ''" . $sql_update_pass . "
WHERE user_id = " . $row['user_id'];
$result = $db->sql_query($sql);
if ($config['require_activation'] == USER_ACTIVATION_ADMIN && $sql_update_pass == '')
{
$this->include_file('includes/emailer');
$emailer = new emailer($config['smtp_delivery']);
$emailer->use_template('admin_welcome_activated', $row['user_lang']);
$emailer->to($row['user_email']);
$emailer->assign_vars(array(
'SITENAME' => $config['sitename'],
'USERNAME' => $row['username'],
'PASSWORD' => $password_confirm,
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']))
);
$emailer->send();
$emailer->reset();
meta_refresh(3, "index.$phpEx$SID");
trigger_error($user->lang['Account_active_admin']);
}
else
{
meta_refresh(3, "index.$phpEx$SID");
$message = (!$sql_update_pass) ? $user->lang['ACCOUNT_ACTIVE'] : $user->lang['PASSWORD_ACTIVATED'];
trigger_error($message);
}
set_config('newest_user_id', $row['user_id']);
set_config('newest_username', $row['username']);
set_config('num_users', $config['num_users'] + 1, TRUE);
}
else
{
trigger_error($user->lang['Wrong_activation']);
}
}
else
{ {
trigger_error($user->lang['NO_USER']); trigger_error($user->lang['NO_USER']);
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
if ($row['user_type'] <> USER_INACTIVE && !$row['user_newpasswd'])
{
meta_refresh(3, "index.$phpEx$SID");
trigger_error($user->lang['ALREADY_ACTIVATED']);
}
if ($row['user_actkey'] != $key)
{
trigger_error($user->lang['WRONG_ACTIVATION']);
}
$sql_update_pass = ($row['user_newpasswd']) ? ", user_password = '" . $db->sql_escape($row['user_newpasswd']) . "', user_newpasswd = ''" : '';
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_type = ' . USER_NORMAL . ", user_actkey = ''$sql_update_pass
WHERE user_id = " . $row['user_id'];
$result = $db->sql_query($sql);
if ($config['require_activation'] == USER_ACTIVATION_ADMIN && $sql_update_pass)
{
include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);
$messenger = new messenger();
$messenger->template('admin_welcome_activated', $row['user_lang']);
$messenger->subject($subject);
$messenger->replyto($user->data['board_contact']);
$messenger->to($row['user_email'], $row['username']);
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->assign_vars(array(
'SITENAME' => $config['sitename'],
'USERNAME' => $row['username'],
'PASSWORD' => $password_confirm,
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']))
);
$messenger->send($row['user_notify_type']);
$messenger->queue->save();
$message = 'ACCOUNT_ACTIVE_ADMIN';
}
else
{
$message = (!$sql_update_pass) ? 'ACCOUNT_ACTIVE' : 'PASSWORD_ACTIVATED';
}
if (!$sql_update_pass)
{
set_config('newest_user_id', $row['user_id']);
set_config('newest_username', $row['username']);
set_config('num_users', $config['num_users'] + 1, TRUE);
}
meta_refresh(3, "index.$phpEx$SID");
trigger_error($user->lang[$message]);
} }
} }

View file

@ -91,6 +91,9 @@ class ucp_profile extends module
update_username($user->data['username'], $username); update_username($user->data['username'], $username);
} }
// TODO
// If email changed and email activation enabled, deactivate and notify
meta_refresh(3, "ucp.$phpEx$SID&amp;i=$id&amp;mode=$mode"); meta_refresh(3, "ucp.$phpEx$SID&amp;i=$id&amp;mode=$mode");
$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&amp;i=$id&amp;mode=$mode\">", '</a>'); $message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&amp;i=$id&amp;mode=$mode\">", '</a>');
trigger_error($message); trigger_error($message);
@ -358,6 +361,9 @@ class ucp_profile extends module
case 'avatar': case 'avatar':
$display_gallery = (isset($_POST['displaygallery'])) ? true : false;
$avatar_category = request_var('category', '');
// Can we upload? // Can we upload?
$can_upload = ($config['allow_avatar_upload'] && file_exists($phpbb_root_path . $config['avatar_path']) && is_writeable($phpbb_root_path . $config['avatar_path']) && $auth->acl_get('u_chgavatar') && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false; $can_upload = ($config['allow_avatar_upload'] && file_exists($phpbb_root_path . $config['avatar_path']) && is_writeable($phpbb_root_path . $config['avatar_path']) && $auth->acl_get('u_chgavatar') && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
@ -386,6 +392,8 @@ class ucp_profile extends module
if (!sizeof($error)) if (!sizeof($error))
{ {
$data['user_id'] = $user->data['user_id'];
if (!empty($_FILES['uploadfile']['tmp_name']) && $can_upload) if (!empty($_FILES['uploadfile']['tmp_name']) && $can_upload)
{ {
$data = avatar_upload($data, $error); $data = avatar_upload($data, $error);
@ -444,10 +452,10 @@ class ucp_profile extends module
switch ($user->data['user_avatar_type']) switch ($user->data['user_avatar_type'])
{ {
case AVATAR_UPLOAD: case AVATAR_UPLOAD:
$avatar_img = $config['avatar_path'] . '/'; $avatar_img = $phpbb_root_path . $config['avatar_path'] . '/';
break; break;
case AVATAR_GALLERY: case AVATAR_GALLERY:
$avatar_img = $config['avatar_gallery_path'] . '/'; $avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
break; break;
} }
$avatar_img .= $user->data['user_avatar']; $avatar_img .= $user->data['user_avatar'];
@ -457,37 +465,76 @@ class ucp_profile extends module
$template->assign_vars(array( $template->assign_vars(array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '', 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
'AVATAR' => $avatar_img, 'AVATAR' => $avatar_img,
'AVATAR_SIZE' => $config['avatar_filesize'], 'AVATAR_SIZE' => $config['avatar_filesize'],
'AVATAR_URL' => (isset($uploadurl)) ? $uploadurl : '',
'AVATAR_REMOTE' => (isset($remotelink)) ? $remotelink : (($user->data['user_avatar_type'] == AVATAR_REMOTE) ? $user->data['user_avatar'] : ''),
'WIDTH' => (isset($width)) ? $width : $user->data['user_avatar_width'],
'HEIGHT' => (isset($height)) ? $height : $user->data['user_avatar_height'],
'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024)), 'S_FORM_ENCTYPE' => ($can_upload) ? ' enctype="multipart/form-data"' : '',
'S_FORM_ENCTYPE' => ($can_upload) ? ' enctype="multipart/form-data"' : '', 'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024)),)
'S_UPLOAD_AVATAR_FILE' => $can_upload,
'S_UPLOAD_AVATAR_URL' => $can_upload,
'S_LINK_AVATAR' => ($auth->acl_get('u_chgavatar') && $config['allow_avatar_remote']) ? true : false,
'S_GALLERY_AVATAR' => ($auth->acl_get('u_chgavatar') && $config['allow_avatar_local']) ? true : false,
'S_AVATAR_CAT_OPTIONS' => $s_categories,
'S_AVATAR_PAGE_OPTIONS' => $s_pages,)
); );
if ($display_gallery && $auth->acl_get('u_chgavatar') && $config['allow_avatar_local'])
{
$avatar_list = avatar_gallery($category, $error);
$category = (!$category) ? key($avatar_list) : $category;
$s_category_options = '';
foreach (array_keys($avatar_list) as $cat)
{
$s_category_options .= '<option value="' . $cat . '">' . $cat . '</option>';
}
$template->assign_vars(array(
'S_DISPLAY_GALLERY' => true,
'S_CAT_OPTIONS' => $s_category_options)
);
foreach ($avatar_list[$category] as $avatar_row_ary)
{
$template->assign_block_vars('avatar_row', array());
foreach ($avatar_row_ary as $avatar_col_ary)
{
$template->assign_block_vars('avatar_row.avatar_column', array(
'AVATAR_IMAGE' => $phpbb_root_path . $config['avatar_gallery_path'] . '/' . $avatar_col_ary['file'],
'AVATAR_NAME' => $avatar_col_ary['name'])
);
$template->assign_block_vars('avatar_row.avatar_option_column', array(
'AVATAR_IMAGE' => $phpbb_root_path . $config['avatar_gallery_path'] . '/' . $avatar_col_ary['file'],)
);
}
}
}
else
{
$template->assign_vars(array(
'AVATAR' => $avatar_img,
'AVATAR_SIZE' => $config['avatar_filesize'],
'WIDTH' => (isset($width)) ? $width : $user->data['user_avatar_width'],
'HEIGHT' => (isset($height)) ? $height : $user->data['user_avatar_height'],
'S_UPLOAD_AVATAR_FILE' => $can_upload,
'S_UPLOAD_AVATAR_URL' => $can_upload,
'S_LINK_AVATAR' => ($auth->acl_get('u_chgavatar') && $config['allow_avatar_remote']) ? true : false,
'S_GALLERY_AVATAR' => ($auth->acl_get('u_chgavatar') && $config['allow_avatar_local']) ? true : false,
'S_AVATAR_CAT_OPTIONS' => $s_categories,
'S_AVATAR_PAGE_OPTIONS' => $s_pages,)
);
}
break; break;
} }
$template->assign_vars(array( $template->assign_vars(array(
'L_TITLE' => $user->lang['UCP_' . strtoupper($mode)], 'L_TITLE' => $user->lang['UCP_' . strtoupper($mode)],
'S_DISPLAY_' . strtoupper($mode) => true, 'S_HIDDEN_FIELDS' => $s_hidden_fields,
'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_UCP_ACTION' => "ucp.$phpEx$SID&amp;i=$id&amp;mode=$mode")
'S_UCP_ACTION' => "ucp.$phpEx$SID&amp;i=$id&amp;mode=$mode")
); );
$this->display($user->lang['UCP_PROFILE'], 'ucp_profile.html'); $this->display($user->lang['UCP_PROFILE'], 'ucp_profile_' . $mode . '.html');
} }
} }

View file

@ -152,11 +152,11 @@ class ucp_register extends module
$key_len = 54 - (strlen($server_url)); $key_len = 54 - (strlen($server_url));
$key_len = ($key_len > 6) ? $key_len : 6; $key_len = ($key_len > 6) ? $key_len : 6;
$user_actkey = substr($user_actkey, 0, $key_len); $user_actkey = substr($user_actkey, 0, $key_len);
$user_active = 0; $user_type = USER_INACTIVE;
} }
else else
{ {
$user_active = 1; $user_type = USER_NORMAL;
$user_actkey = ''; $user_actkey = '';
} }
@ -170,7 +170,7 @@ class ucp_register extends module
'user_timezone' => (float) $tz, 'user_timezone' => (float) $tz,
'user_lang' => $lang, 'user_lang' => $lang,
'user_allow_pm' => 1, 'user_allow_pm' => 1,
'user_active' => $user_active, 'user_type' => $user_type,
'user_actkey' => $user_actkey, 'user_actkey' => $user_actkey,
'user_ip' => $user->ip, 'user_ip' => $user->ip,
'user_regdate' => time(), 'user_regdate' => time(),

View file

@ -24,7 +24,7 @@ class ucp_remind extends module
$username = request_var('username', ''); $username = request_var('username', '');
$email = request_var('email', ''); $email = request_var('email', '');
$sql = 'SELECT user_id, username, user_email, user_jabber, user_notify_type, user_active, user_lang $sql = 'SELECT user_id, username, user_email, user_jabber, user_notify_type, user_type, user_lang
FROM ' . USERS_TABLE . " FROM ' . USERS_TABLE . "
WHERE user_email = '" . $db->sql_escape($email) . "' WHERE user_email = '" . $db->sql_escape($email) . "'
AND username = '" . $db->sql_escape($username) . "'"; AND username = '" . $db->sql_escape($username) . "'";
@ -39,13 +39,14 @@ class ucp_remind extends module
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
if (!$row['user_active']) if ($row['user_type'] == USER_INACTIVE)
{ {
trigger_error($lang['ACCOUNT_INACTIVE']); trigger_error($lang['ACCOUNT_INACTIVE']);
} }
$server_url = generate_board_url(); $server_url = generate_board_url();
$username = $row['username']; $username = $row['username'];
$user_id = $row['user_id'];
$key_len = 54 - strlen($server_url); $key_len = 54 - strlen($server_url);
$key_len = ($str_len > 6) ? $key_len : 6; $key_len = ($str_len > 6) ? $key_len : 6;
@ -74,7 +75,7 @@ class ucp_remind extends module
'PASSWORD' => $user_password, 'PASSWORD' => $user_password,
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']), 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']),
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&k=$user_actkey") 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u=$user_id&k=$user_actkey")
); );
$messenger->send($row['user_notify_type']); $messenger->send($row['user_notify_type']);

View file

@ -101,6 +101,18 @@ CREATE TABLE phpbb_bbcodes (
PRIMARY KEY (bbcode_id) PRIMARY KEY (bbcode_id)
); );
# Table: 'phpbb_bots'
CREATE TABLE phpbb_bots (
bot_id tinyint(3) unsigned NOT NULL auto_increment,
bot_active tinyint(1) DEFAULT '1' NOT NULL,
bot_name varchar(255) DEFAULT '' NOT NULL,
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
bot_agent varchar(255) DEFAULT '' NOT NULL,
bot_ip varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (bot_id),
KEY bot_active (bot_active)
)
# Table: 'phpbb_cache' # Table: 'phpbb_cache'
CREATE TABLE phpbb_cache ( CREATE TABLE phpbb_cache (
var_name varchar(255) DEFAULT '' NOT NULL, var_name varchar(255) DEFAULT '' NOT NULL,
@ -683,8 +695,7 @@ CREATE TABLE phpbb_user_group (
# Table: 'phpbb_users' # Table: 'phpbb_users'
CREATE TABLE phpbb_users ( CREATE TABLE phpbb_users (
user_id mediumint(8) UNSIGNED NOT NULL auto_increment, user_id mediumint(8) UNSIGNED NOT NULL auto_increment,
user_active tinyint(1) DEFAULT '1' NOT NULL, user_type tinyint(1) DEFAULT '0' NOT NULL,
user_founder tinyint(1) DEFAULT '0' NOT NULL,
group_id mediumint(8) DEFAULT '3' NOT NULL, group_id mediumint(8) DEFAULT '3' NOT NULL,
user_permissions text DEFAULT '' NOT NULL, user_permissions text DEFAULT '' NOT NULL,
user_ip varchar(40) DEFAULT '' NOT NULL, user_ip varchar(40) DEFAULT '' NOT NULL,
@ -737,10 +748,10 @@ CREATE TABLE phpbb_users (
user_msnm varchar(255) DEFAULT '' NOT NULL, user_msnm varchar(255) DEFAULT '' NOT NULL,
user_jabber varchar(255) DEFAULT '' NOT NULL, user_jabber varchar(255) DEFAULT '' NOT NULL,
user_website varchar(100) DEFAULT '' NOT NULL, user_website varchar(100) DEFAULT '' NOT NULL,
user_actkey varchar(32) DEFAULT '' NOT NULL,
user_newpasswd varchar(32) DEFAULT '' NOT NULL,
user_occ varchar(255) DEFAULT '' NOT NULL, user_occ varchar(255) DEFAULT '' NOT NULL,
user_interests varchar(255) DEFAULT '' NOT NULL, user_interests varchar(255) DEFAULT '' NOT NULL,
user_actkey varchar(32) DEFAULT '' NOT NULL,
user_newpasswd varchar(32) DEFAULT '' NOT NULL,
PRIMARY KEY (user_id), PRIMARY KEY (user_id),
KEY user_birthday (user_birthday(6)) KEY user_birthday (user_birthday(6))
); );

View file

@ -312,22 +312,20 @@ INSERT INTO phpbb_forums (forum_id, forum_name, forum_desc, left_id, right_id, p
# MSSQL IDENTITY phpbb_users ON # # MSSQL IDENTITY phpbb_users ON #
# -- Users # -- Users
INSERT INTO phpbb_users (user_id, user_founder, group_id, username, user_regdate, user_password, user_email, user_lang, user_style) VALUES (1, 0, 1, 'Anonymous', 0, '', '', 'en', 1); INSERT INTO phpbb_users (user_id, user_type, group_id, username, user_regdate, user_password, user_email, user_lang, user_style) VALUES (1, 2, 1, 'Anonymous', 0, '', '', 'en', 1);
# -- username: Admin password: admin (change this or remove it ON #ce everything is working!) # -- username: Admin password: admin (change this or remove it ON #ce everything is working!)
INSERT INTO phpbb_users (user_id, user_founder, group_id, username, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour) VALUES (2, 1, 7, 'Admin', 0, '21232f297a57a5a743894a0e4a801fc3', 'admin@yourdomain.com', 'en', 1, 1, 'AA0000'); INSERT INTO phpbb_users (user_id, user_type, group_id, username, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour) VALUES (2, 3, 7, 'Admin', 0, '21232f297a57a5a743894a0e4a801fc3', 'admin@yourdomain.com', 'en', 1, 1, 'AA0000');
# -- bots
INSERT INTO phpbb_users (user_id, user_type, group_id, username, user_regdate, user_password, user_lang, user_style, user_rank, user_colour) VALUES (3, 2, 8, 'Googlebot', 0, '', 'en', 1, 1, '9E8DA7');
INSERT INTO phpbb_users (user_id, user_type, group_id, username, user_regdate, user_password, user_lang, user_style, user_rank, user_colour) VALUES (4, 2, 8, 'Fastcrawler', 0, '', 'en', 1, 1, '9E8DA7');
INSERT INTO phpbb_users (user_id, user_type, group_id, username, user_regdate, user_password, user_lang, user_style, user_rank, user_colour) VALUES (5, 2, 8, 'Alexa', 0, '', 'en', 1, 1, '9E8DA7');
INSERT INTO phpbb_users (user_id, user_type, group_id, username, user_regdate, user_password, user_lang, user_style, user_rank, user_colour) VALUES (6, 2, 8, 'Inktomi', 0, '', 'en', 1, 1, '9E8DA7');
# MSSQL IDENTITY phpbb_users OFF # # MSSQL IDENTITY phpbb_users OFF #
# MSSQL IDENTITY phpbb_ranks ON #
# -- Ranks
INSERT INTO phpbb_ranks (rank_id, rank_title, rank_min, rank_special, rank_image) VALUES (1, 'Site Admin', -1, 1, NULL);
# MSSQL IDENTITY phpbb_ranks OFF #
# MSSQL IDENTITY phpbb_groups ON # # MSSQL IDENTITY phpbb_groups ON #
# -- Groups # -- Groups
@ -338,7 +336,7 @@ INSERT INTO phpbb_groups (group_id, group_name, group_type) VALUES (4, 'REGISTER
INSERT INTO phpbb_groups (group_id, group_name, group_type) VALUES (5, 'REGISTERED_COPPA', 3); INSERT INTO phpbb_groups (group_id, group_name, group_type) VALUES (5, 'REGISTERED_COPPA', 3);
INSERT INTO phpbb_groups (group_id, group_name, group_type, group_colour) VALUES (6, 'SUPER_MODERATORS', 3, '00AA00'); INSERT INTO phpbb_groups (group_id, group_name, group_type, group_colour) VALUES (6, 'SUPER_MODERATORS', 3, '00AA00');
INSERT INTO phpbb_groups (group_id, group_name, group_type, group_colour) VALUES (7, 'ADMINISTRATORS', 3, 'AA0000'); INSERT INTO phpbb_groups (group_id, group_name, group_type, group_colour) VALUES (7, 'ADMINISTRATORS', 3, 'AA0000');
INSERT INTO phpbb_groups (group_id, group_name, group_type) VALUES (8, 'BANNED', 3); INSERT INTO phpbb_groups (group_id, group_name, group_type, group_colour) VALUES (8, 'BOTS', 3, '9E8DA7');
# MSSQL IDENTITY phpbb_groups OFF # # MSSQL IDENTITY phpbb_groups OFF #
@ -347,12 +345,34 @@ INSERT INTO phpbb_groups (group_id, group_name, group_type) VALUES (8, 'BANNED',
INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (1, 1, 0, 0); INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (1, 1, 0, 0);
INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (4, 2, 0, 0); INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (4, 2, 0, 0);
INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (7, 2, 0, 1); INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (7, 2, 0, 1);
INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (8, 3, 0, 0);
INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (8, 4, 0, 0);
INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (8, 5, 0, 0);
INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (8, 6, 0, 0);
# -- Modules # MSSQL IDENTITY phpbb_ranks ON #
# -- Ranks
INSERT INTO phpbb_ranks (rank_id, rank_title, rank_min, rank_special, rank_image) VALUES (1, 'Site Admin', -1, 1, NULL);
# MSSQL IDENTITY phpbb_ranks OFF #
# MSSQL IDENTITY phpbb_bots ON #
# -- Bots
INSERT INTO phpbb_bots (bot_id, bot_active, bot_name, user_id, bot_agent, bot_ip) VALUES (1, 1, 'Googebot', 3, 'Googlebot/2.1 (+http://www.googlebot.com/bot.html)', '216.239.46.,64.68.8.');
INSERT INTO phpbb_bots (bot_id, bot_active, bot_name, user_id, bot_agent, bot_ip) VALUES (2, 1, 'Fastcrawler', 4, 'FAST-WebCrawler', '66.77.73.');
INSERT INTO phpbb_bots (bot_id, bot_active, bot_name, user_id, bot_agent, bot_ip) VALUES (3, 1, 'Alexa ia_archiver', 5, 'ia_archiver', '66.28.250.,209.237.238.');
INSERT INTO phpbb_bots (bot_id, bot_active, bot_name, user_id, bot_agent, bot_ip) VALUES (4, 1, 'Inktomi', 6, 'Slurp', '216.35.116.');
# MSSQL IDENTITY phpbb_bots OFF #
# MSSQL IDENTITY phpbb_modules OFF # # MSSQL IDENTITY phpbb_modules OFF #
# -- Modules
INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('mcp', 'MAIN', 'main', 1, 1, '', ''); INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('mcp', 'MAIN', 'main', 1, 1, '', '');
INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('ucp', 'MAIN', 'main', 1, 1, 'front\r\nsubscribed\r\ndrafts', ''); INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('ucp', 'MAIN', 'main', 1, 1, 'front\r\nsubscribed\r\ndrafts', '');
INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('ucp', 'PROFILE', 'profile', 2, 1, 'profile_info\r\nreg_details\r\nsignature\r\navatar', ''); INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('ucp', 'PROFILE', 'profile', 2, 1, 'profile_info\r\nreg_details\r\nsignature\r\navatar', '');
@ -363,7 +383,6 @@ INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_or
# Permissions # Permissions
# Default user - admin rights # Default user - admin rights
INSERT INTO phpbb_auth_users (user_id, forum_id, auth_option_id, auth_setting) SELECT 2, 0, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'u_%'; INSERT INTO phpbb_auth_users (user_id, forum_id, auth_option_id, auth_setting) SELECT 2, 0, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'u_%';
INSERT INTO phpbb_auth_users (user_id, forum_id, auth_option_id, auth_setting) SELECT 2, 0, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'a_%'; INSERT INTO phpbb_auth_users (user_id, forum_id, auth_option_id, auth_setting) SELECT 2, 0, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'a_%';
@ -400,6 +419,10 @@ INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting)
INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 3, 1, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option IN ('f_list', 'f_read', 'f_post', 'f_reply', 'f_quote', 'f_bbcode', 'f_search', 'f_print'); INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 3, 1, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option IN ('f_list', 'f_read', 'f_post', 'f_reply', 'f_quote', 'f_bbcode', 'f_search', 'f_print');
INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 3, 2, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option IN ('f_list', 'f_read', 'f_post', 'f_reply', 'f_quote', 'f_bbcode', 'f_search', 'f_print'); INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 3, 2, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option IN ('f_list', 'f_read', 'f_post', 'f_reply', 'f_quote', 'f_bbcode', 'f_search', 'f_print');
# BOTS - read/view only
INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 8, 1, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option IN ('f_list', 'f_read');
INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 8, 2, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option IN ('f_list', 'f_read');
# -- Moderator cache # -- Moderator cache
INSERT INTO phpbb_moderator_cache (user_id, forum_id, username) VALUES (2, 2, 'Admin'); INSERT INTO phpbb_moderator_cache (user_id, forum_id, username) VALUES (2, 2, 'Admin');
@ -460,14 +483,6 @@ INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, disp
INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/exclaim.gif', 19, 19, 7, 1); INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/exclaim.gif', 19, 19, 7, 1);
# -- ucp modules
INSERT INTO phpbb_ucp_modules (module_id, module_title, module_filename, module_order) VALUES (1, 'MAIN', 'main', 1);
INSERT INTO phpbb_ucp_modules (module_id, module_title, module_filename, module_order) VALUES (2, 'PROFILE', 'profile', 2);
INSERT INTO phpbb_ucp_modules (module_id, module_title, module_filename, module_order) VALUES (3, 'PREFERENCES', 'prefs', 3);
INSERT INTO phpbb_ucp_modules (module_id, module_title, module_filename, module_order) VALUES (4, 'MESSAGING', 'pm', 4);
INSERT INTO phpbb_ucp_modules (module_id, module_title, module_filename, module_order) VALUES (5, 'LISTS', 'zebra', 5);
# MSSQL IDENTITY phpbb_search_wordlist ON # # MSSQL IDENTITY phpbb_search_wordlist ON #
# -- wordlist # -- wordlist

View file

@ -47,10 +47,6 @@ $lang += array(
'PHP_INFO' => 'PHP Information', 'PHP_INFO' => 'PHP Information',
'IM' => 'Jabber Settings', 'IM' => 'Jabber Settings',
'GROUP_CAT' => 'Usergroups',
'CREATE' => 'Create',
'GROUP_PREFS' => 'Preferences',
'LOG_CAT' => 'Logging', 'LOG_CAT' => 'Logging',
'ADMIN_LOGS' => 'Admin Log', 'ADMIN_LOGS' => 'Admin Log',
'MOD_LOGS' => 'Moderator Log', 'MOD_LOGS' => 'Moderator Log',
@ -67,13 +63,18 @@ $lang += array(
'MANAGE_THEME' => 'Themes', 'MANAGE_THEME' => 'Themes',
'MANAGE_IMAGESET' => 'Imagesets', 'MANAGE_IMAGESET' => 'Imagesets',
'USER_CAT' => 'Users', 'USER_CAT' => 'Users / Groups',
'BAN_EMAILS' => 'Ban Emails', 'BAN_EMAILS' => 'Ban Emails',
'BAN_IPS' => 'Ban IPs', 'BAN_IPS' => 'Ban IPs',
'BAN_USERS' => 'Ban Usernames', 'BAN_USERS' => 'Ban Usernames',
'DISALLOW' => 'Disallow names', 'DISALLOW' => 'Disallow names',
'RANKS' => 'Ranks', 'RANKS' => 'Ranks',
'PRUNE_USERS' => 'Prune users', 'PRUNE_USERS' => 'Prune users',
'BOTS' => 'Bots',
'GROUP_MANAGE' => 'Manage groups',
'GROUP_PREFS' => 'Group prefs',
'USER_PERMS' => 'User permissions',
'GROUP_PERMS' => 'Group permissions',
'ADMINISTRATORS' => 'Administrators', 'ADMINISTRATORS' => 'Administrators',
'USERNAMES_EXPLAIN' => 'Place each username on a seperate line', 'USERNAMES_EXPLAIN' => 'Place each username on a seperate line',
@ -221,6 +222,10 @@ $lang += array(
'LOG_EMAIL_ERROR' => '%s', 'LOG_EMAIL_ERROR' => '%s',
'LOG_JABBER_ERROR' => '%s', 'LOG_JABBER_ERROR' => '%s',
'LOG_BOT_ADDED' => '<b>New bot added</b><br />&#187; %s',
'LOG_BOT_UPDATED' => '<b>Existing bot updated</b><br />&#187; %s',
'LOG_BOT_DELETE' => '<b>Deleted bot</b><br />&#187; %s',
); );
// Index page // Index page
@ -1779,4 +1784,38 @@ $lang += array(
'INST_ERR_FTP_LOGIN' => 'Could not login to ftp server, check your username and password', 'INST_ERR_FTP_LOGIN' => 'Could not login to ftp server, check your username and password',
); );
// Bots
$lang += array(
'BOTS_EXPLAIN' => 'Bots or crawlers are automated agents most commonly used by search engines to update their databases. Since they rarely make proper use of sessions they can distort visitor counts, increase load and sometimes fail to index sites correctly. Here you can define a special type of user to overcome these problems.',
'BOT_NAME' => 'Bot name',
'BOT_LAST_VISIT' => 'Last visit',
'BOT_NEVER' => 'Never',
'BOT_ACTIVATE' => 'Activate',
'BOT_DEACTIVATE' => 'Deactivate',
'BOT_ADD' => 'Add bot',
'BOT_EDIT' => 'Edit bots',
'BOT_EDIT_EXPLAIN' => 'Here you can add or edit an existing bot entry. You may define an agent string and/or one or more IP addresses (or range of addresses) to match. Be careful when defining matching agent strings or addresses. You may also specify a style and language that the bot will view the board using. This may allow you to reduce bandwidth use by setting a simple style for bots. Remember to set appropriate permissions for the special Bot usergroup.',
'BOT_NAME' => 'Bot name',
'BOT_NAME_EXPLAIN' => 'Used only for your own information.',
'BOT_LANG' => 'Bot language',
'BOT_LANG_EXPLAIN' => 'The language presented to the bot as it browses',
'BOT_STYLE' => 'Bot style',
'BOT_STYLE_EXPLAIN' => 'The style used for the board by the bot',
'BOT_ACTIVE' => 'Bot active',
'BOT_AGENT' => 'Agent match',
'BOT_AGENT_EXPLAIN' => 'A string matching the bots browser agent.',
'BOT_IP' => 'Bot IP address',
'BOT_IP_EXPLAIN' => 'Partial matches are allowed, seperate addresses with an apostrophe. A single hostname may be entered instead of an IP.',
'BOT_ADDED' => 'New bot successfully added',
'BOT_UPDATED' => 'Existing bot updated successfully',
'BOT_DELETED' => 'Bot deleted successfully',
'NO_BOT' => 'Found no bot with the specified ID',
'ERR_BOT_NO_MATCHES' => 'You must supply at least one of an agent or IP for this bot match.',
'ERR_BOT_NO_IP' => 'The IP addresses you supplied were invalid or the hostname could not be resolved.',
);
?> ?>

View file

@ -245,7 +245,7 @@ $lang = array(
'G_INACTIVE' => 'Unapproved Users', 'G_INACTIVE' => 'Unapproved Users',
'G_INACTIVE_COPPA' => 'Unapproved COPPA Users', 'G_INACTIVE_COPPA' => 'Unapproved COPPA Users',
'G_GUESTS' => 'Guests', 'G_GUESTS' => 'Guests',
'G_BANNED' => 'Banned Users', 'G_BOTS' => 'Bots',
'NO_NEW_POSTS' => 'No new posts', 'NO_NEW_POSTS' => 'No new posts',
'NEW_POSTS' => 'New posts', 'NEW_POSTS' => 'New posts',
@ -684,7 +684,7 @@ $lang += array(
'DOWNLOAD_COUNTS' => '%d Times', // replace %d with count 'DOWNLOAD_COUNTS' => '%d Times', // replace %d with count
); );
// ucp // ucp_main
$lang += array( $lang += array(
'UCP' => 'User Control Panel', 'UCP' => 'User Control Panel',
'UCP_OPTIONS' => 'Options', 'UCP_OPTIONS' => 'Options',
@ -733,8 +733,10 @@ $lang += array(
'EMPTY_DRAFT_TITLE' => 'You must enter a draft title', 'EMPTY_DRAFT_TITLE' => 'You must enter a draft title',
'EMPTY_DRAFT' => 'You must enter a message to submit your changes', 'EMPTY_DRAFT' => 'You must enter a message to submit your changes',
'BACK_TO_DRAFTS' => 'Back to saved drafts', 'BACK_TO_DRAFTS' => 'Back to saved drafts',
);
// ucp_profile
$lang += array(
'UCP_PROFILE' => 'Profile', 'UCP_PROFILE' => 'Profile',
'UCP_REG_DETAILS' => 'Registration details', 'UCP_REG_DETAILS' => 'Registration details',
@ -763,6 +765,9 @@ $lang += array(
'UCP_JABBER' => 'Jabber Address', 'UCP_JABBER' => 'Jabber Address',
'BIRTHDAY' => 'Birthday', 'BIRTHDAY' => 'Birthday',
'BIRTHDAY_EXPLAIN' => 'Setting a year will list your age when it is your birthday.', 'BIRTHDAY_EXPLAIN' => 'Setting a year will list your age when it is your birthday.',
'DAY' => 'Day',
'MONTH' => 'Month',
'YEAR' => 'Year',
'UCP_SIGNATURE' => 'Your signature', 'UCP_SIGNATURE' => 'Your signature',
'SIGNATURE_NOTICE' => 'Please note that some forums limit the size and content of your signature. Be sure to read any forum or board rules to ensure you comply with them.', 'SIGNATURE_NOTICE' => 'Please note that some forums limit the size and content of your signature. Be sure to read any forum or board rules to ensure you comply with them.',
@ -784,7 +789,8 @@ $lang += array(
'LINK_REMOTE_SIZE' => 'Avatar dimensions', 'LINK_REMOTE_SIZE' => 'Avatar dimensions',
'LINK_REMOTE_SIZE_EXPLAIN' => 'Specify the width and height of the avatar, leave blank to attempt automatic verification.', 'LINK_REMOTE_SIZE_EXPLAIN' => 'Specify the width and height of the avatar, leave blank to attempt automatic verification.',
'BY' => 'by', // Width by Height 'BY' => 'by', // Width by Height
'AVATAR_GALLERY' => 'Select from gallery', 'AVATAR_GALLERY' => 'Local gallery',
'DISPLAY_GALLERY' => 'Display gallery',
'AVATAR_CATEGORY' => 'Category', 'AVATAR_CATEGORY' => 'Category',
'AVATAR_PAGE' => 'Page', 'AVATAR_PAGE' => 'Page',
@ -795,8 +801,10 @@ $lang += array(
'AVATAR_NO_SIZE' => 'Could not obtain width or height of linked avatar, please enter them manually.', 'AVATAR_NO_SIZE' => 'Could not obtain width or height of linked avatar, please enter them manually.',
'PROFILE_UPDATED' => 'Your profile has been updated.', 'PROFILE_UPDATED' => 'Your profile has been updated.',
);
// ucp_register
$lang += array(
'REGISTRATION' => 'Registration', 'REGISTRATION' => 'Registration',
'COPPA_BIRTHDAY' => 'To continue with the registration procedure please tell us when you were born.', 'COPPA_BIRTHDAY' => 'To continue with the registration procedure please tell us when you were born.',
'UCP_COPPA_BEFORE' => 'Before %s', 'UCP_COPPA_BEFORE' => 'Before %s',
@ -821,61 +829,24 @@ $lang += array(
'COPPA_COMPLIANCE' => 'COPPA Compliance', 'COPPA_COMPLIANCE' => 'COPPA Compliance',
'COPPA_EXPLAIN' => 'Please note that clicking submit will create your account. However it cannot be activated until a parent or guardian approves your registration. You will be emailed a copy of the necessary form with details of where to send it.', 'COPPA_EXPLAIN' => 'Please note that clicking submit will create your account. However it cannot be activated until a parent or guardian approves your registration. You will be emailed a copy of the necessary form with details of where to send it.',
'PASSWORD_MISMATCH' => 'The passwords you entered did not match',
'No_user_id_specified' => 'Sorry but that user does not exist',
'Wrong_Profile' => 'You cannot modify a profile that is not your own.',
'Only_one_avatar' => 'Only one type of avatar can be specified',
'File_no_data' => 'The file at the URL you gave contains no data',
'No_connection_URL' => 'A connection could not be made to the URL you gave',
'Incomplete_URL' => 'The URL you entered is incomplete',
'Wrong_remote_avatar_format' => 'The URL of the remote avatar is not valid',
'No_send_account_inactive' => 'Sorry, but your password cannot be retrieved because your account is currently inactive. Please contact the forum administrator for more information',
'Profile_updated' => 'Your profile has been updated',
'Profile_updated_inactive' => 'Your profile has been updated, however you have changed vital details thus your account is now inactive. Check your email to find out how to reactivate your account, or if admin activation is require wait for the administrator to reactivate your account',
'Fields_empty' => 'You must fill in the required fields',
'Avatar_filetype' => 'The avatar filetype must be .jpg, .gif or .png',
'Avatar_filesize' => 'The avatar image file size must be less than %d kB',
'Welcome_subject' => 'Welcome to %s Forums',
'New_account_subject' => 'New user account',
'Account_activated_subject' => 'Account Activated',
'PASSWORD_MISMATCH' => 'The passwords you entered did not match',
'CONFIRM_CODE_WRONG' => 'The confirmation code you entered was incorrect.', 'CONFIRM_CODE_WRONG' => 'The confirmation code you entered was incorrect.',
'TOO_MANY_REGISTERS' => 'You have exceeded the maximum number of registration attempts for this session. Please try again later.', 'TOO_MANY_REGISTERS' => 'You have exceeded the maximum number of registration attempts for this session. Please try again later.',
'ACCOUNT_ADDED' => 'Thank you for registering, your account has been created. You may now login with your username and password', 'ACCOUNT_ADDED' => 'Thank you for registering, your account has been created. You may now login with your username and password',
'ACCOUNT_INACTIVE' => 'Your account has been created. However, this forum requires account activation, an activation key has been sent to the email address you provided. Please check your email for further information', 'ACCOUNT_INACTIVE' => 'Your account has been created. However, this forum requires account activation, an activation key has been sent to the email address you provided. Please check your email for further information',
'ACCOUNT_INACTIVE_ADMIN'=> 'Your account has been created. However, this forum requires account activation by the administrator. An email has been sent to them and you will be informed when your account has been activated', 'ACCOUNT_INACTIVE_ADMIN'=> 'Your account has been created. However, this forum requires account activation by the administrator. An email has been sent to them and you will be informed when your account has been activated',
'ACCOUNT_COPPA' => 'Your account has been created but has to be approved, please check your email for details.', 'ACCOUNT_COPPA' => 'Your account has been created but has to be approved, please check your email for details.',
'Send_password' => 'Send me a new password',
'Password_updated' => 'A new password has been created, please check your email for details on how to activate it',
'No_email_match' => 'The email address you supplied does not match the one listed for that username',
'New_password_activation' => 'New password activation',
'Password_activated' => 'Your account has been re-activated. To logon please use the password supplied in the email you received',
'COPPA' => 'Your account has been created but has to be approved, please check your email for details.',
); );
// ucp_activate // ucp_activate
$lang += array( $lang += array(
'Account_active' => 'Your account has now been activated. Thank you for registering', 'ACCOUNT_ACTIVE' => 'Your account has now been activated. Thank you for registering',
'Account_active_admin' => 'The account has now been activated', 'ACCOUNT_ACTIVE_ADMIN' => 'The account has now been activated',
'Reactivate' => 'Reactivate your account!', 'PASSWORD_ACTIVATED' => 'Your new password has been activated',
'Already_activated' => 'You have already activated your account',
'Wrong_activation' => 'The activation key you supplied does not match any in the database', 'ALREADY_ACTIVATED' => 'You have already activated your account',
'WRONG_ACTIVATION' => 'The activation key you supplied does not match any in the database',
); );
// ucp_remind // ucp_remind

View file

@ -410,7 +410,7 @@ switch ($mode)
$sql = 'SELECT username, user_email, user_allow_viewemail, user_lang, user_jabber, user_notify_method $sql = 'SELECT username, user_email, user_allow_viewemail, user_lang, user_jabber, user_notify_method
FROM ' . USERS_TABLE . " FROM ' . USERS_TABLE . "
WHERE user_id = $user_id WHERE user_id = $user_id
AND user_active = 1"; AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
if (!($row = $db->sql_fetchrow($result))) if (!($row = $db->sql_fetchrow($result)))
@ -676,7 +676,7 @@ switch ($mode)
{ {
$sql = 'SELECT COUNT(user_id) AS total_users $sql = 'SELECT COUNT(user_id) AS total_users
FROM ' . USERS_TABLE . ' FROM ' . USERS_TABLE . '
WHERE user_id <> ' . ANONYMOUS . " WHERE user_type <> ' . USER_IGNORE . "
$where_sql"; $where_sql";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
@ -728,6 +728,8 @@ switch ($mode)
); );
} }
// TODO
// ?????????
$sql = 'SELECT session_user_id, MAX(session_time) AS session_time $sql = 'SELECT session_user_id, MAX(session_time) AS session_time
FROM ' . SESSIONS_TABLE . ' FROM ' . SESSIONS_TABLE . '
WHERE session_time >= ' . (time() - 300) . ' WHERE session_time >= ' . (time() - 300) . '
@ -745,7 +747,7 @@ switch ($mode)
// Do the SQL thang // Do the SQL thang
$sql = 'SELECT username, user_id, user_colour, user_allow_viewemail, user_posts, user_regdate, user_rank, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_lastvisit $sql = 'SELECT username, user_id, user_colour, user_allow_viewemail, user_posts, user_regdate, user_rank, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_lastvisit
FROM ' . USERS_TABLE . ' FROM ' . USERS_TABLE . '
WHERE user_id <> ' . ANONYMOUS . " WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ")
$where_sql $where_sql
ORDER BY $order_by"; ORDER BY $order_by";
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);

View file

@ -21,7 +21,7 @@
<!-- ELSE --> <!-- ELSE -->
<tr class="row2"> <tr class="row2">
<!-- ENDIF --> <!-- ENDIF -->
<td class="gen" width="35%" height="28">&nbsp;<a href="{reg_user_row.U_USER_PROFILE}" title="{reg_user_row.USER_IP}">{reg_user_row.USERNAME}</a>&nbsp;</td> <td class="gen" width="35%" height="28">&nbsp;<!-- IF reg_user_row.U_USER_PROFILE --><a href="{reg_user_row.U_USER_PROFILE}" title="{reg_user_row.USER_IP}"><!-- ENDIF -->{reg_user_row.USERNAME}<!-- IF reg_user_row.U_USER_PROFILE --></a><!-- ENDIF -->&nbsp;</td>
<td class="gen" width="25%" align="center" nowrap="nowrap">&nbsp;{reg_user_row.LASTUPDATE}&nbsp;</td> <td class="gen" width="25%" align="center" nowrap="nowrap">&nbsp;{reg_user_row.LASTUPDATE}&nbsp;</td>
<td class="gen" width="40%">&nbsp;<a href="{reg_user_row.U_FORUM_LOCATION}">{reg_user_row.FORUM_LOCATION}</a>&nbsp;</td> <td class="gen" width="40%">&nbsp;<a href="{reg_user_row.U_FORUM_LOCATION}">{reg_user_row.FORUM_LOCATION}</a>&nbsp;</td>
</tr> </tr>

View file

@ -238,8 +238,8 @@ $user->setup();
$ucp = new module(); $ucp = new module();
// Basic parameter data // Basic parameter data
$mode = (!empty($_REQUEST['mode'])) ? htmlspecialchars($_REQUEST['mode']) : false; $mode = request_var('mode', '');
$module = (!empty($_REQUEST['i'])) ? htmlspecialchars($_REQUEST['i']) : false; $module = request_var('i', '');
// Basic "global" modes // Basic "global" modes
switch ($mode) switch ($mode)
@ -247,6 +247,7 @@ switch ($mode)
case 'activate': case 'activate':
$ucp->load('ucp', 'activate'); $ucp->load('ucp', 'activate');
$ucp->module->ucp_activate(); $ucp->module->ucp_activate();
redirect("index.$phpEx$SID");
break; break;
case 'sendpassword': case 'sendpassword':
@ -292,7 +293,7 @@ switch ($mode)
// Only registered users can go beyond this point // Only registered users can go beyond this point
if ($user->data['user_id'] == ANONYMOUS) if ($user->data['user_type'] == USER_INACTIVE || $user->data['user_type'] == USER_IGNORE)
{ {
redirect("index.$phpEx"); redirect("index.$phpEx");
} }

View file

@ -22,10 +22,9 @@ $auth->acl($user->data);
$user->setup(); $user->setup();
// Get and set some variables // Get and set some variables
$start = (isset($_GET['start'])) ? intval($_GET['start']) : 0; $start = request_var('start', 0);
$sort_key = request_var('sk', 'b');
$sort_key = (!empty($_REQUEST['sk'])) ? htmlspecialchars($_REQUEST['sk']) : 'b'; $sort_dir = request_var('sd', 'd');
$sort_dir = (!empty($_REQUEST['sd'])) ? htmlspecialchars($_REQUEST['sd']) : 'd';
$sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_LOCATION'], 'c' => $user->lang['SORT_JOINED']); $sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_LOCATION'], 'c' => $user->lang['SORT_JOINED']);
$sort_key_sql = array('a' => 'username', 'b' => 'session_time', 'c' => 'session_page'); $sort_key_sql = array('a' => 'username', 'b' => 'session_time', 'c' => 'session_page');
@ -48,7 +47,7 @@ $db->sql_freeresult($result);
// Get user list // Get user list
$sql = 'SELECT u.user_id, u.username, u.user_allow_viewonline, u.user_colour, s.session_time, s.session_page, s.session_ip, s.session_allow_viewonline $sql = 'SELECT u.user_id, u.username, u.user_type, u.user_allow_viewonline, u.user_colour, s.session_time, s.session_page, s.session_ip, s.session_allow_viewonline
FROM ' . USERS_TABLE . ' u, ' . SESSIONS_TABLE . ' s FROM ' . USERS_TABLE . ' u, ' . SESSIONS_TABLE . ' s
WHERE u.user_id = s.session_user_id WHERE u.user_id = s.session_user_id
AND s.session_time >= ' . (time() - ($config['load_online_time'] * 60)) . ' AND s.session_time >= ' . (time() - ($config['load_online_time'] * 60)) . '
@ -187,7 +186,7 @@ while ($row = $db->sql_fetchrow($result))
'S_ROW_COUNT' => $$which_counter, 'S_ROW_COUNT' => $$which_counter,
'U_USER_PROFILE' => "memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $row['user_id'], 'U_USER_PROFILE' => ($row['user_type'] <> USER_IGNORE) ? "memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $row['user_id'] : '',
'U_FORUM_LOCATION' => $location_url) 'U_FORUM_LOCATION' => $location_url)
); );