2004-08-02 14:32:04 +00:00
|
|
|
<?php
|
2007-10-05 14:30:11 +00:00
|
|
|
/**
|
2005-04-09 12:26:45 +00:00
|
|
|
*
|
2014-05-27 20:18:06 +02:00
|
|
|
* This file is part of the phpBB Forum Software package.
|
|
|
|
*
|
|
|
|
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
|
|
|
* @license GNU General Public License, version 2 (GPL-2.0)
|
|
|
|
*
|
|
|
|
* For full copyright and license information, please see
|
|
|
|
* the docs/CREDITS.txt file.
|
2005-04-09 12:26:45 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2006-05-05 17:56:33 +00:00
|
|
|
* @ignore
|
2005-04-09 12:26:45 +00:00
|
|
|
*/
|
2002-03-18 13:35:43 +00:00
|
|
|
define('IN_PHPBB', true);
|
2007-07-26 15:51:11 +00:00
|
|
|
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
|
2003-09-07 13:46:51 +00:00
|
|
|
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
2006-06-06 20:53:46 +00:00
|
|
|
require($phpbb_root_path . 'common.' . $phpEx);
|
|
|
|
require($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
|
|
|
require($phpbb_root_path . 'includes/functions_module.' . $phpEx);
|
2004-08-02 14:32:04 +00:00
|
|
|
|
|
|
|
// Basic parameter data
|
2005-10-04 21:31:35 +00:00
|
|
|
$id = request_var('i', '');
|
2004-08-02 14:32:04 +00:00
|
|
|
$mode = request_var('mode', '');
|
|
|
|
|
2013-08-05 15:38:58 -04:00
|
|
|
if (in_array($mode, array('login', 'login_link', 'logout', 'confirm', 'sendpassword', 'activate')))
|
2004-06-01 17:02:20 +00:00
|
|
|
{
|
|
|
|
define('IN_LOGIN', true);
|
|
|
|
}
|
2004-08-02 14:32:04 +00:00
|
|
|
|
|
|
|
// Start session management
|
2005-10-04 21:31:35 +00:00
|
|
|
$user->session_begin();
|
2004-08-02 14:32:04 +00:00
|
|
|
$auth->acl($user->data);
|
|
|
|
$user->setup('ucp');
|
|
|
|
|
2006-06-19 21:30:32 +00:00
|
|
|
// Setting a variable to let the style designer know where he is...
|
|
|
|
$template->assign_var('S_IN_UCP', true);
|
|
|
|
|
2005-10-04 21:31:35 +00:00
|
|
|
$module = new p_master();
|
2008-09-23 13:30:52 +00:00
|
|
|
$default = false;
|
2003-05-10 17:19:27 +00:00
|
|
|
|
2003-05-19 15:24:14 +00:00
|
|
|
// Basic "global" modes
|
2003-05-10 17:19:27 +00:00
|
|
|
switch ($mode)
|
2001-10-10 17:27:34 +00:00
|
|
|
{
|
2003-05-10 17:19:27 +00:00
|
|
|
case 'activate':
|
2005-10-04 21:31:35 +00:00
|
|
|
$module->load('ucp', 'activate');
|
|
|
|
$module->display($user->lang['UCP_ACTIVATE']);
|
|
|
|
|
2006-06-06 20:53:46 +00:00
|
|
|
redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
|
2005-10-04 21:31:35 +00:00
|
|
|
break;
|
2003-03-17 00:53:38 +00:00
|
|
|
|
2005-04-09 12:26:45 +00:00
|
|
|
case 'resend_act':
|
2005-10-04 21:31:35 +00:00
|
|
|
$module->load('ucp', 'resend');
|
|
|
|
$module->display($user->lang['UCP_RESEND']);
|
|
|
|
break;
|
2005-04-09 12:26:45 +00:00
|
|
|
|
2003-10-12 15:29:18 +00:00
|
|
|
case 'sendpassword':
|
2005-10-04 21:31:35 +00:00
|
|
|
$module->load('ucp', 'remind');
|
|
|
|
$module->display($user->lang['UCP_REMIND']);
|
|
|
|
break;
|
2003-05-19 15:24:14 +00:00
|
|
|
|
2003-05-10 17:19:27 +00:00
|
|
|
case 'register':
|
2005-04-10 18:07:12 +00:00
|
|
|
if ($user->data['is_registered'] || isset($_REQUEST['not_agreed']))
|
2003-05-10 17:19:27 +00:00
|
|
|
{
|
2006-06-06 20:53:46 +00:00
|
|
|
redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
|
2003-05-10 17:19:27 +00:00
|
|
|
}
|
2003-03-17 00:53:38 +00:00
|
|
|
|
2005-10-04 21:31:35 +00:00
|
|
|
$module->load('ucp', 'register');
|
2005-12-26 21:02:39 +00:00
|
|
|
$module->display($user->lang['REGISTER']);
|
2005-10-04 21:31:35 +00:00
|
|
|
break;
|
2003-03-17 00:53:38 +00:00
|
|
|
|
2003-05-19 15:24:14 +00:00
|
|
|
case 'confirm':
|
2005-10-04 21:31:35 +00:00
|
|
|
$module->load('ucp', 'confirm');
|
|
|
|
break;
|
2003-05-19 15:24:14 +00:00
|
|
|
|
2003-05-10 17:19:27 +00:00
|
|
|
case 'login':
|
2005-04-10 18:07:12 +00:00
|
|
|
if ($user->data['is_registered'])
|
2003-05-10 17:19:27 +00:00
|
|
|
{
|
2006-06-06 20:53:46 +00:00
|
|
|
redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
|
2003-05-10 17:19:27 +00:00
|
|
|
}
|
2003-03-17 00:53:38 +00:00
|
|
|
|
2007-01-03 18:58:19 +00:00
|
|
|
login_box(request_var('redirect', "index.$phpEx"));
|
2006-01-25 21:01:52 +00:00
|
|
|
break;
|
2003-05-10 17:19:27 +00:00
|
|
|
|
2013-07-25 11:41:04 -04:00
|
|
|
case 'login_link':
|
|
|
|
if ($user->data['is_registered'])
|
|
|
|
{
|
|
|
|
redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
|
|
|
|
}
|
|
|
|
|
|
|
|
$module->load('ucp', 'login_link');
|
2013-07-25 12:49:30 -04:00
|
|
|
$module->display($user->lang['UCP_LOGIN_LINK']);
|
2013-07-25 11:41:04 -04:00
|
|
|
break;
|
|
|
|
|
2003-05-10 17:19:27 +00:00
|
|
|
case 'logout':
|
2010-09-22 21:58:20 +02:00
|
|
|
if ($user->data['user_id'] != ANONYMOUS && $request->is_set('sid') && $request->variable('sid', '') === $user->session_id)
|
2007-05-15 17:38:57 +00:00
|
|
|
{
|
|
|
|
$user->session_kill();
|
|
|
|
}
|
2013-07-13 12:27:00 -04:00
|
|
|
else if ($user->data['user_id'] != ANONYMOUS)
|
2007-05-15 17:38:57 +00:00
|
|
|
{
|
2013-07-13 12:27:00 -04:00
|
|
|
meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
|
2008-06-13 19:39:01 +00:00
|
|
|
|
2013-07-13 12:27:00 -04:00
|
|
|
$message = $user->lang['LOGOUT_FAILED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a> ');
|
|
|
|
trigger_error($message);
|
|
|
|
}
|
2007-05-15 17:38:57 +00:00
|
|
|
|
2013-07-13 12:27:00 -04:00
|
|
|
redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
|
2006-01-25 21:01:52 +00:00
|
|
|
break;
|
2004-05-31 18:00:10 +00:00
|
|
|
|
2006-03-18 12:17:22 +00:00
|
|
|
case 'terms':
|
|
|
|
case 'privacy':
|
|
|
|
|
|
|
|
$message = ($mode == 'terms') ? 'TERMS_OF_USE_CONTENT' : 'PRIVACY_POLICY';
|
|
|
|
$title = ($mode == 'terms') ? 'TERMS_USE' : 'PRIVACY';
|
|
|
|
|
|
|
|
if (empty($user->lang[$message]))
|
|
|
|
{
|
|
|
|
if ($user->data['is_registered'])
|
|
|
|
{
|
2006-06-06 20:53:46 +00:00
|
|
|
redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
|
2006-03-18 12:17:22 +00:00
|
|
|
}
|
2006-06-06 20:53:46 +00:00
|
|
|
|
2006-05-04 18:25:01 +00:00
|
|
|
login_box();
|
2006-03-18 12:17:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$template->set_filenames(array(
|
|
|
|
'body' => 'ucp_agreement.html')
|
|
|
|
);
|
|
|
|
|
2006-06-12 22:16:27 +00:00
|
|
|
// Disable online list
|
2014-03-19 19:55:55 +05:30
|
|
|
page_header($user->lang[$title]);
|
2006-03-18 12:17:22 +00:00
|
|
|
|
|
|
|
$template->assign_vars(array(
|
|
|
|
'S_AGREEMENT' => true,
|
|
|
|
'AGREEMENT_TITLE' => $user->lang[$title],
|
2006-03-18 22:53:14 +00:00
|
|
|
'AGREEMENT_TEXT' => sprintf($user->lang[$message], $config['sitename'], generate_board_url()),
|
2006-06-06 20:53:46 +00:00
|
|
|
'U_BACK' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'),
|
2009-06-24 10:08:18 +00:00
|
|
|
'L_BACK' => $user->lang['BACK_TO_LOGIN'],
|
|
|
|
));
|
2006-06-06 20:53:46 +00:00
|
|
|
|
2006-03-18 12:17:22 +00:00
|
|
|
page_footer();
|
|
|
|
|
2006-01-25 21:01:52 +00:00
|
|
|
break;
|
2005-04-09 12:26:45 +00:00
|
|
|
|
2004-05-31 18:00:10 +00:00
|
|
|
case 'delete_cookies':
|
2008-06-13 19:39:01 +00:00
|
|
|
|
2004-05-31 18:00:10 +00:00
|
|
|
// Delete Cookies with dynamic names (do NOT delete poll cookies)
|
2004-06-06 21:44:49 +00:00
|
|
|
if (confirm_box(true))
|
2004-05-31 18:00:10 +00:00
|
|
|
{
|
2004-06-06 21:44:49 +00:00
|
|
|
$set_time = time() - 31536000;
|
2006-06-06 20:53:46 +00:00
|
|
|
|
2013-09-10 14:01:09 +02:00
|
|
|
foreach ($request->variable_names(\phpbb\request\request_interface::COOKIE) as $cookie_name)
|
2004-05-31 18:00:10 +00:00
|
|
|
{
|
2013-09-10 14:01:09 +02:00
|
|
|
$cookie_data = $request->variable($cookie_name, '', true, \phpbb\request\request_interface::COOKIE);
|
2010-08-31 21:29:11 +02:00
|
|
|
|
2009-09-03 09:25:16 +00:00
|
|
|
// Only delete board cookies, no other ones...
|
|
|
|
if (strpos($cookie_name, $config['cookie_name'] . '_') !== 0)
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2004-06-06 21:44:49 +00:00
|
|
|
$cookie_name = str_replace($config['cookie_name'] . '_', '', $cookie_name);
|
2007-01-07 14:08:47 +00:00
|
|
|
|
2014-12-07 05:52:24 +04:00
|
|
|
/**
|
|
|
|
* Event to save custom cookies from deletion
|
|
|
|
*
|
2014-12-28 13:20:04 +04:00
|
|
|
* @event core.ucp_delete_cookies
|
2014-12-28 03:44:07 +04:00
|
|
|
* @var string cookie_name Cookie name to checking
|
|
|
|
* @var bool retain_cookie Do we retain our cookie or not, true if retain
|
2014-12-07 05:52:24 +04:00
|
|
|
* @since 3.1.3-RC1
|
|
|
|
*/
|
2014-12-27 17:43:30 +04:00
|
|
|
$retain_cookie = false;
|
|
|
|
$vars = array('cookie_name', 'retain_cookie');
|
2014-12-28 13:20:04 +04:00
|
|
|
extract($phpbb_dispatcher->trigger_event('core.ucp_delete_cookies', compact($vars)));
|
2014-12-27 17:43:30 +04:00
|
|
|
if ($retain_cookie)
|
2014-12-07 05:52:24 +04:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2007-01-07 14:08:47 +00:00
|
|
|
// Polls are stored as {cookie_name}_poll_{topic_id}, cookie_name_ got removed, therefore checking for poll_
|
|
|
|
if (strpos($cookie_name, 'poll_') !== 0)
|
2004-06-06 21:44:49 +00:00
|
|
|
{
|
|
|
|
$user->set_cookie($cookie_name, '', $set_time);
|
|
|
|
}
|
2004-05-31 18:00:10 +00:00
|
|
|
}
|
2006-06-06 20:53:46 +00:00
|
|
|
|
2004-06-06 21:44:49 +00:00
|
|
|
$user->set_cookie('track', '', $set_time);
|
2005-07-08 12:29:45 +00:00
|
|
|
$user->set_cookie('u', '', $set_time);
|
|
|
|
$user->set_cookie('k', '', $set_time);
|
2004-06-06 21:44:49 +00:00
|
|
|
$user->set_cookie('sid', '', $set_time);
|
2004-05-31 18:00:10 +00:00
|
|
|
|
2004-06-06 21:44:49 +00:00
|
|
|
// We destroy the session here, the user will be logged out nevertheless
|
2005-08-19 10:48:39 +00:00
|
|
|
$user->session_kill();
|
2006-01-05 21:24:22 +00:00
|
|
|
$user->session_begin();
|
2004-05-31 18:00:10 +00:00
|
|
|
|
2006-06-06 20:53:46 +00:00
|
|
|
meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
|
2004-05-31 18:00:10 +00:00
|
|
|
|
2006-06-06 20:53:46 +00:00
|
|
|
$message = $user->lang['COOKIES_DELETED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
|
2004-06-06 21:44:49 +00:00
|
|
|
trigger_error($message);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
confirm_box(false, 'DELETE_COOKIES', '');
|
|
|
|
}
|
2006-06-06 20:53:46 +00:00
|
|
|
|
|
|
|
redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
|
2006-03-01 21:48:02 +00:00
|
|
|
|
2006-01-25 21:01:52 +00:00
|
|
|
break;
|
2006-04-17 13:09:50 +00:00
|
|
|
|
|
|
|
case 'switch_perm':
|
|
|
|
|
|
|
|
$user_id = request_var('u', 0);
|
|
|
|
|
|
|
|
$sql = 'SELECT *
|
|
|
|
FROM ' . USERS_TABLE . '
|
|
|
|
WHERE user_id = ' . (int) $user_id;
|
|
|
|
$result = $db->sql_query($sql);
|
|
|
|
$user_row = $db->sql_fetchrow($result);
|
|
|
|
$db->sql_freeresult($result);
|
|
|
|
|
2009-08-03 13:32:52 +00:00
|
|
|
if (!$auth->acl_get('a_switchperm') || !$user_row || $user_id == $user->data['user_id'] || !check_link_hash(request_var('hash', ''), 'switchperm'))
|
2006-04-17 13:09:50 +00:00
|
|
|
{
|
2006-06-06 20:53:46 +00:00
|
|
|
redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
|
2006-04-17 13:09:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
include($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
|
|
|
|
|
|
|
|
$auth_admin = new auth_admin();
|
|
|
|
if (!$auth_admin->ghost_permissions($user_id, $user->data['user_id']))
|
|
|
|
{
|
2006-06-06 20:53:46 +00:00
|
|
|
redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
|
2006-04-17 13:09:50 +00:00
|
|
|
}
|
|
|
|
|
2006-06-06 20:53:46 +00:00
|
|
|
add_log('admin', 'LOG_ACL_TRANSFER_PERMISSIONS', $user_row['username']);
|
2006-04-17 13:09:50 +00:00
|
|
|
|
2007-01-21 18:33:45 +00:00
|
|
|
$message = sprintf($user->lang['PERMISSIONS_TRANSFERRED'], $user_row['username']) . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
|
2006-04-17 13:09:50 +00:00
|
|
|
trigger_error($message);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'restore_perm':
|
|
|
|
|
|
|
|
if (!$user->data['user_perm_from'] || !$auth->acl_get('a_switchperm'))
|
|
|
|
{
|
2006-06-06 20:53:46 +00:00
|
|
|
redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
|
2006-04-17 13:09:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$auth->acl_cache($user->data);
|
|
|
|
|
|
|
|
$sql = 'SELECT username
|
|
|
|
FROM ' . USERS_TABLE . '
|
|
|
|
WHERE user_id = ' . $user->data['user_perm_from'];
|
|
|
|
$result = $db->sql_query($sql);
|
|
|
|
$username = $db->sql_fetchfield('username');
|
|
|
|
$db->sql_freeresult($result);
|
|
|
|
|
|
|
|
add_log('admin', 'LOG_ACL_RESTORE_PERMISSIONS', $username);
|
|
|
|
|
2006-06-06 20:53:46 +00:00
|
|
|
$message = $user->lang['PERMISSIONS_RESTORED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
|
2006-04-17 13:09:50 +00:00
|
|
|
trigger_error($message);
|
|
|
|
|
|
|
|
break;
|
2008-09-23 13:30:52 +00:00
|
|
|
|
|
|
|
default:
|
|
|
|
$default = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
// We use this approach because it does not impose large code changes
|
|
|
|
if (!$default)
|
|
|
|
{
|
|
|
|
return true;
|
2003-01-30 20:04:21 +00:00
|
|
|
}
|
|
|
|
|
2003-05-10 17:19:27 +00:00
|
|
|
// Only registered users can go beyond this point
|
2005-04-10 18:07:12 +00:00
|
|
|
if (!$user->data['is_registered'])
|
2003-05-10 17:19:27 +00:00
|
|
|
{
|
2005-04-10 18:07:12 +00:00
|
|
|
if ($user->data['is_bot'])
|
2004-05-30 19:24:53 +00:00
|
|
|
{
|
2006-06-06 20:53:46 +00:00
|
|
|
redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
|
2004-05-30 19:24:53 +00:00
|
|
|
}
|
2004-08-02 14:32:04 +00:00
|
|
|
|
2011-10-13 19:17:56 +02:00
|
|
|
if ($id == 'pm' && $mode == 'view' && isset($_GET['p']))
|
|
|
|
{
|
|
|
|
$redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx?i=pm&p=" . request_var('p', 0));
|
|
|
|
login_box($redirect_url, $user->lang['LOGIN_EXPLAIN_UCP']);
|
|
|
|
}
|
|
|
|
|
2004-09-01 15:47:46 +00:00
|
|
|
login_box('', $user->lang['LOGIN_EXPLAIN_UCP']);
|
2003-05-10 17:19:27 +00:00
|
|
|
}
|
2003-03-04 17:52:50 +00:00
|
|
|
|
2007-03-24 18:00:21 +00:00
|
|
|
// Instantiate module system and generate list of available modules
|
|
|
|
$module->list_modules('ucp');
|
2003-03-04 17:52:50 +00:00
|
|
|
|
2007-03-24 18:00:21 +00:00
|
|
|
// Check if the zebra module is set
|
2007-03-26 15:42:05 +00:00
|
|
|
if ($module->is_active('zebra', 'friends'))
|
2007-03-24 18:00:21 +00:00
|
|
|
{
|
|
|
|
// Output listing of friends online
|
|
|
|
$update_time = $config['load_online_time'] * 60;
|
2006-05-05 22:06:17 +00:00
|
|
|
|
2011-11-21 16:22:07 +01:00
|
|
|
$sql_ary = array(
|
2007-07-03 15:17:24 +00:00
|
|
|
'SELECT' => 'u.user_id, u.username, u.username_clean, u.user_colour, MAX(s.session_time) as online_time, MIN(s.session_viewonline) AS viewonline',
|
2006-05-05 22:06:17 +00:00
|
|
|
|
2007-03-24 18:00:21 +00:00
|
|
|
'FROM' => array(
|
|
|
|
USERS_TABLE => 'u',
|
2011-11-21 16:22:07 +01:00
|
|
|
ZEBRA_TABLE => 'z',
|
2007-03-24 18:00:21 +00:00
|
|
|
),
|
2006-05-05 22:06:17 +00:00
|
|
|
|
2007-03-24 18:00:21 +00:00
|
|
|
'LEFT_JOIN' => array(
|
|
|
|
array(
|
|
|
|
'FROM' => array(SESSIONS_TABLE => 's'),
|
2011-11-21 16:22:07 +01:00
|
|
|
'ON' => 's.session_user_id = z.zebra_id',
|
|
|
|
),
|
2007-03-24 18:00:21 +00:00
|
|
|
),
|
2006-05-05 22:06:17 +00:00
|
|
|
|
2007-03-24 18:00:21 +00:00
|
|
|
'WHERE' => 'z.user_id = ' . $user->data['user_id'] . '
|
|
|
|
AND z.friend = 1
|
|
|
|
AND u.user_id = z.zebra_id',
|
2006-05-21 16:54:19 +00:00
|
|
|
|
2007-07-03 15:14:20 +00:00
|
|
|
'GROUP_BY' => 'z.zebra_id, u.user_id, u.username_clean, u.user_colour, u.username',
|
2006-05-05 22:06:17 +00:00
|
|
|
|
2007-03-24 18:00:21 +00:00
|
|
|
'ORDER_BY' => 'u.username_clean ASC',
|
2011-11-21 16:22:07 +01:00
|
|
|
);
|
2003-03-17 00:53:38 +00:00
|
|
|
|
2011-11-21 16:22:07 +01:00
|
|
|
$sql = $db->sql_build_query('SELECT_DISTINCT', $sql_ary);
|
2007-03-24 18:00:21 +00:00
|
|
|
$result = $db->sql_query($sql);
|
2003-05-09 14:11:55 +00:00
|
|
|
|
2007-03-24 18:00:21 +00:00
|
|
|
while ($row = $db->sql_fetchrow($result))
|
|
|
|
{
|
2007-07-03 15:14:20 +00:00
|
|
|
$which = (time() - $update_time < $row['online_time'] && ($row['viewonline'] || $auth->acl_get('u_viewonline'))) ? 'online' : 'offline';
|
2006-11-16 16:51:19 +00:00
|
|
|
|
2007-03-24 18:00:21 +00:00
|
|
|
$template->assign_block_vars("friends_{$which}", array(
|
|
|
|
'USER_ID' => $row['user_id'],
|
2003-03-04 17:52:50 +00:00
|
|
|
|
2007-03-24 18:00:21 +00:00
|
|
|
'U_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']),
|
|
|
|
'USER_COLOUR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']),
|
|
|
|
'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
|
|
|
|
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']))
|
|
|
|
);
|
|
|
|
}
|
|
|
|
$db->sql_freeresult($result);
|
|
|
|
}
|
2005-10-04 21:31:35 +00:00
|
|
|
|
2007-04-29 12:30:22 +00:00
|
|
|
// Do not display subscribed topics/forums if not allowed
|
|
|
|
if (!$config['allow_topic_notify'] && !$config['allow_forum_notify'])
|
|
|
|
{
|
|
|
|
$module->set_display('main', 'subscribed', false);
|
|
|
|
}
|
|
|
|
|
2012-08-03 23:41:00 +02:00
|
|
|
/**
|
|
|
|
* Use this event to enable and disable additional UCP modules
|
|
|
|
*
|
|
|
|
* @event core.ucp_display_module_before
|
|
|
|
* @var p_master module Object holding all modules and their status
|
|
|
|
* @var mixed id Active module category (can be the int or string)
|
|
|
|
* @var string mode Active module
|
2014-04-25 12:15:44 +02:00
|
|
|
* @since 3.1.0-a1
|
2012-08-03 23:41:00 +02:00
|
|
|
*/
|
|
|
|
$vars = array('module', 'id', 'mode');
|
|
|
|
extract($phpbb_dispatcher->trigger_event('core.ucp_display_module_before', compact($vars)));
|
2012-03-16 00:43:52 +01:00
|
|
|
|
2005-10-04 21:31:35 +00:00
|
|
|
// Select the active module
|
|
|
|
$module->set_active($id, $mode);
|
2003-10-01 17:24:53 +00:00
|
|
|
|
|
|
|
// Load and execute the relevant module
|
2005-10-04 21:31:35 +00:00
|
|
|
$module->load_active();
|
|
|
|
|
|
|
|
// Assign data to the template engine for the list of modules
|
2006-06-06 20:53:46 +00:00
|
|
|
$module->assign_tpl_vars(append_sid("{$phpbb_root_path}ucp.$phpEx"));
|
2005-10-04 21:31:35 +00:00
|
|
|
|
2006-06-12 22:16:27 +00:00
|
|
|
// Generate the page, do not display/query online list
|
2014-03-24 00:12:40 +05:30
|
|
|
$module->display($module->get_page_title());
|