本文整理汇总了PHP中login_box函数的典型用法代码示例。如果您正苦于以下问题:PHP login_box函数的具体用法?PHP login_box怎么用?PHP login_box使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了login_box函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: needs_auth
/**
* Checks whether user is logged in and outputs login box
* for guests or returns error response for registered users.
*
* @return Response object
*/
public function needs_auth()
{
if (!$this->user->data['is_registered']) {
login_box($this->get_current_url());
}
return $this->error($this->user->lang['NO_AUTH'], 403);
}
示例2: base
public function base()
{
$note = utf8_normalize_nfc($this->request->variable('note', '', true));
$submit = isset($_POST['submit']) ? true : false;
$error = array();
// check if user s logged in, since this page can be used only after registration...
if (!$this->user->data['is_registered']) {
login_box($this->helper->route('vinny_usersnotes_controller'));
}
// ... and also this is not for bots (especially for bad ones :)
if ($this->user->data['is_bot']) {
redirect(append_sid("{$this->phpbb_root_path}index.{$this->phpEx}"));
}
$s_action = $this->helper->route('vinny_usersnotes_controller');
$s_hidden_fields = '';
add_form_key('postform');
// create a template variables
$this->template->assign_vars(array('S_POST_ACTION' => $s_action, 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'ERROR' => sizeof($error) ? implode('<br />', $error) : ''));
if ($submit) {
/*if(!check_form_key('postform'))
{
trigger_error('FORM_INVALID');
}*/
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_note = "' . $note . '"
WHERE user_id = ' . $this->user->data['user_id'];
$this->db->sql_query($sql);
meta_refresh(3, $this->helper->route('vinny_usersnotes_controller'));
trigger_error(sprintf($this->user->lang['NOTES_SAVED'], $this->helper->route('vinny_usersnotes_controller')));
}
// create a template variables
$this->template->assign_vars(array('NOTE' => $this->user->data['user_note']));
$this->template->assign_block_vars('navlinks', array('FORUM_NAME' => $this->user->lang['NOTES']));
return $this->helper->render('notes.html', $this->user->lang['NOTES']);
}
示例3: login_redirect
public function login_redirect()
{
if (!$this->user->data['is_registered']) {
login_box();
}
$this->template->assign_var('A_VARIABLE', 'I am a variable');
return $this->helper->render('foo_bar_body.html');
}
示例4: main
function main()
{
// Only registered users can go beyond this point
if (!$this->user->data['is_registered']) {
if ($this->user->data['is_bot']) {
redirect(append_sid("{$this->phpbb_root_path}index.{$this->phpEx}"));
}
login_box('', $this->user->lang['LOGIN_INFO']);
}
$adm_points = $this->request->variable('adm_points', false);
$u_id = $this->request->variable('user_id', 0);
$post_id = $this->request->variable('post_id', 0);
if (empty($u_id)) {
$message = $this->user->lang['EDIT_NO_ID_SPECIFIED'] . '<br /><br /><a href="' . $this->helper->route('dmzx_ultimatepoints_controller', array('mode' => 'bank_edit')) . '">« ' . $this->user->lang['BACK_TO_PREV'] . '</a>';
trigger_error($message);
}
$user_id = $u_id;
add_form_key('bank_edit');
if ($adm_points != false && ($this->auth->acl_get('a_') || $this->auth->acl_get('m_chg_bank'))) {
$this->template->assign_block_vars('administer_bank', array());
$submit = isset($_POST['submit']) ? true : false;
if ($submit) {
if (!check_form_key('bank_edit')) {
trigger_error('FORM_INVALID');
}
$new_points = round($this->request->variable('points', 0.0), 2);
$this->functions_points->set_bank($u_id, $new_points);
$sql_array = array('SELECT' => 'user_id, username, user_points, user_colour', 'FROM' => array(USERS_TABLE => 'u'), 'WHERE' => 'user_id = ' . (int) $u_id);
$sql = $this->db->sql_build_query('SELECT', $sql_array);
$result = $this->db->sql_query($sql);
$points_user = $this->db->sql_fetchrow($result);
// Add logs
$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_MOD_BANK', false, array($points_user['username']));
$message = $post_id ? sprintf($this->user->lang['EDIT_P_RETURN_POST'], '<a href="' . append_sid("{$this->phpbb_root_path}viewtopic.{$this->phpEx}", "p=" . $post_id) . '">', '</a>') : sprintf($this->user->lang['EDIT_P_RETURN_INDEX'], '<a href="' . append_sid("{$this->phpbb_root_path}index.{$this->phpEx}") . '">', '</a>');
trigger_error(sprintf($this->user->lang['EDIT_POINTS_SET'], $this->config['points_name']) . $message);
} else {
$sql_array = array('SELECT' => 'u.user_id, u.username, u.user_points, u.user_colour, b.holding', 'FROM' => array(USERS_TABLE => 'u'), 'LEFT_JOIN' => array(array('FROM' => array($this->points_bank_table => 'b'), 'ON' => 'u.user_id = b.user_id')), 'WHERE' => 'u.user_id = ' . (int) $u_id);
$sql = $this->db->sql_build_query('SELECT', $sql_array);
$result = $this->db->sql_query($sql);
$row = $this->db->sql_fetchrow($result);
if (empty($u_id)) {
$message = $this->user->lang['EDIT_USER_NOT_EXIST'] . '<br /><br /><a href="' . $this->helper->route('dmzx_ultimatepoints_controller', array('mode' => 'bank_edit')) . '">« ' . $this->user->lang['BACK_TO_PREV'] . '</a>';
trigger_error($message);
}
$hidden_fields = build_hidden_fields(array('user_id' => $u_id, 'post_id' => $post_id));
$this->template->assign_vars(array('USER_NAME' => get_username_string('full', $u_id, $row['username'], $row['user_colour']), 'BANK_POINTS' => sprintf($this->functions_points->number_format_points($row['holding'])), 'POINTS_NAME' => $this->config['points_name'], 'CURRENT_VALUE' => $row['holding'], 'L_POINTS_MODIFY' => sprintf($this->user->lang['EDIT_BANK_MODIFY'], $this->config['points_name']), 'L_P_BANK_TITLE' => sprintf($this->user->lang['EDIT_P_BANK_TITLE'], $this->config['points_name']), 'L_USERNAME' => $this->user->lang['USERNAME'], 'L_SET_AMOUNT' => $this->user->lang['EDIT_SET_AMOUNT'], 'U_USER_LINK' => append_sid("{$this->phpbb_root_path}memberlist.{$this->phpEx}", "mode=viewprofile&u=" . $u_id), 'S_ACTION' => $this->helper->route('dmzx_ultimatepoints_controller', array('mode' => 'bank_edit', 'adm_points' => '1')), 'S_HIDDEN_FIELDS' => $hidden_fields));
}
}
// Generate the page
page_header($this->user->lang['EDIT_POINTS_ADMIN']);
// Generate the page template
$this->template->set_filenames(array('body' => 'points/points_bank_edit.html'));
page_footer();
}
示例5: not_authorised
public static function not_authorised($backlink, $loginlink = '', $login_explain = '')
{
global $user, $phpbb_container;
$url = $phpbb_container->get('phpbbgallery.core.url');
if (!$user->data['is_registered'] && $loginlink) {
if ($login_explain && isset($user->lang[$login_explain])) {
$login_explain = $user->lang[$login_explain];
} else {
$login_explain = '';
}
login_box($loginlink, $login_explain);
} else {
$url->meta_refresh(3, $backlink);
trigger_error('NOT_AUTHORISED');
}
}
示例6: handle
public function handle($notify_id = 0)
{
$this->user->add_lang_ext('gn36/versionchecknotifier', 'global');
if (!$notify_id) {
trigger_error('INVALID_NOTIFICATION_ID_REDIRECT');
}
if (!$this->user->data['is_registered']) {
login_box();
}
$notifications = $this->manager->load_notifications(array('notification_id' => intval($notify_id)));
if (!isset($notifications['notifications'][$notify_id])) {
trigger_error('INVALID_NOTIFICATION_ID_REDIRECT');
}
/** @var $notification \phpbb\notification\type\base */
$notification = $notifications['notifications'][$notify_id];
$url = $notification->get_url();
redirect($url, false, true);
}
示例7: trigger_error
trigger_error($message);
break;
default:
$default = true;
break;
}
// We use this approach because it does not impose large code changes
if (!$default) {
return true;
}
// Only registered users can go beyond this point
if (!$user->data['is_registered']) {
if ($user->data['is_bot']) {
redirect(append_sid("{$phpbb_root_path}index.{$phpEx}"));
}
login_box('', $user->lang['LOGIN_EXPLAIN_UCP']);
}
// Instantiate module system and generate list of available modules
$module->list_modules('ucp');
// Check if the zebra module is set
if ($module->is_active('zebra', 'friends')) {
// Output listing of friends online
$update_time = $config['load_online_time'] * 60;
$sql = $db->sql_build_query('SELECT_DISTINCT', array('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', 'FROM' => array(USERS_TABLE => 'u', ZEBRA_TABLE => 'z'), 'LEFT_JOIN' => array(array('FROM' => array(SESSIONS_TABLE => 's'), 'ON' => 's.session_user_id = z.zebra_id')), 'WHERE' => 'z.user_id = ' . $user->data['user_id'] . '
AND z.friend = 1
AND u.user_id = z.zebra_id', 'GROUP_BY' => 'z.zebra_id, u.user_id, u.username_clean, u.user_colour, u.username', 'ORDER_BY' => 'u.username_clean ASC'));
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$which = time() - $update_time < $row['online_time'] && ($row['viewonline'] || $auth->acl_get('u_viewonline')) ? 'online' : 'offline';
$template->assign_block_vars("friends_{$which}", array('USER_ID' => $row['user_id'], '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'])));
}
示例8: render_data_for_page
//.........这里部分代码省略.........
// Return for: \$this->helper->render(filename, lang_title);
return array('filename' => 'mchat_rules.html', 'lang_title' => $this->user->lang['MCHAT_HELP']);
} else {
// Show no rules
trigger_error('MCHAT_NO_RULES', E_USER_NOTICE);
}
break;
// whois function..
// whois function..
case 'whois':
// Must have auths
if ($mchat_mode == 'whois' && $mchat_ip) {
// function already exists..
if (!function_exists('user_ipwhois')) {
include $this->phpbb_root_path . 'includes/functions_user.' . $this->phpEx;
}
$this->user_ip = $this->request->variable('ip', '');
$this->template->assign_var('WHOIS', user_ipwhois($this->user_ip));
// Output the page
// Return for: \$this->helper->render(filename, lang_title);
return array('filename' => 'viewonline_whois.html', 'lang_title' => $this->user->lang['WHO_IS_ONLINE']);
} else {
// Show not authorized
trigger_error('NO_AUTH_OPERATION', E_USER_NOTICE);
}
break;
// Clean function...
// Clean function...
case 'clean':
// User logged in?
if (!$this->user->data['is_registered'] || !$mchat_founder) {
if (!$this->user->data['is_registered']) {
// Login box...
login_box('', $this->user->lang['LOGIN']);
} else {
if (!$mchat_founder) {
// Show not authorized
trigger_error('NO_AUTH_OPERATION', E_USER_NOTICE);
}
}
}
$mchat_redirect = $this->request->variable('redirect', '');
$mchat_redirect = $mchat_redirect == 'index' ? append_sid("{$this->phpbb_root_path}index.{$this->phpEx}") : $this->helper->route('dmzx_mchat_controller', array('#mChat'));
if (confirm_box(true)) {
// Run cleaner
$sql = 'TRUNCATE TABLE ' . $this->mchat_table;
$this->db->sql_query($sql);
meta_refresh(3, $mchat_redirect);
trigger_error($this->user->lang['MCHAT_CLEANED'] . '<br /><br />' . sprintf($this->user->lang['RETURN_PAGE'], '<a href="' . $mchat_redirect . '">', '</a>'));
} else {
// Display confirm box
confirm_box(false, $this->user->lang['MCHAT_DELALLMESS']);
}
$this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_MCHAT_TABLE_PRUNED');
redirect($mchat_redirect);
break;
// Archive function...
// Archive function...
case 'archive':
if (!$mchat_read_archive || !$mchat_view) {
// redirect to correct page
$mchat_redirect = append_sid("{$this->phpbb_root_path}index.{$this->phpEx}");
// Redirect to previous page
meta_refresh(3, $mchat_redirect);
trigger_error($this->user->lang['MCHAT_NOACCESS_ARCHIVE'] . '<br /><br />' . sprintf($this->user->lang['RETURN_PAGE'], '<a href="' . $mchat_redirect . '">', '</a>'));
}
示例9: trigger_error
$db->sql_freeresult($result);
if (!$forum_data) {
trigger_error('NO_FORUM');
}
// Configure style, language, etc.
$user->setup('viewforum', $forum_data['forum_style']);
// Redirect to login upon emailed notification links
if (isset($_GET['e']) && !$user->data['is_registered']) {
login_box('', $user->lang['LOGIN_NOTIFY_FORUM']);
}
// Permissions check
if (!$auth->acl_gets('f_list', 'f_read', $forum_id) || $forum_data['forum_type'] == FORUM_LINK && $forum_data['forum_link'] && !$auth->acl_get('f_read', $forum_id)) {
if ($user->data['user_id'] != ANONYMOUS) {
trigger_error('SORRY_AUTH_READ');
}
login_box('', $user->lang['LOGIN_VIEWFORUM']);
}
// Forum is passworded ... check whether access has been granted to this
// user this session, if not show login box
if ($forum_data['forum_password']) {
login_forum_box($forum_data);
}
// Is this forum a link? ... User got here either because the
// number of clicks is being tracked or they guessed the id
if ($forum_data['forum_type'] == FORUM_LINK && $forum_data['forum_link']) {
// Does it have click tracking enabled?
if ($forum_data['forum_flags'] & FORUM_FLAG_LINK_TRACK) {
$sql = 'UPDATE ' . FORUMS_TABLE . '
SET forum_posts_approved = forum_posts_approved + 1
WHERE forum_id = ' . $forum_id;
$db->sql_query($sql);
示例10: trigger_error
if ($user->data['is_registered'] && $auth->acl_gets('f_edit', 'm_edit', $forum_id)) {
$is_authed = true;
}
break;
case 'delete':
if ($user->data['is_registered'] && $auth->acl_gets('f_delete', 'm_delete', $forum_id)) {
$is_authed = true;
}
break;
}
if (!$is_authed) {
$check_auth = $mode == 'quote' ? 'reply' : $mode;
if ($user->data['is_registered']) {
trigger_error('USER_CANNOT_' . strtoupper($check_auth));
}
login_box('', $user->lang['LOGIN_EXPLAIN_' . strtoupper($mode)]);
}
// Is the user able to post within this forum?
if ($post_data['forum_type'] != FORUM_POST && in_array($mode, array('post', 'bump', 'quote', 'reply'))) {
trigger_error('USER_CANNOT_FORUM_POST');
}
// Forum/Topic locked?
if (($post_data['forum_status'] == ITEM_LOCKED || isset($post_data['topic_status']) && $post_data['topic_status'] == ITEM_LOCKED) && !$auth->acl_get('m_edit', $forum_id)) {
trigger_error($post_data['forum_status'] == ITEM_LOCKED ? 'FORUM_LOCKED' : 'TOPIC_LOCKED');
}
// Can we edit this post ... if we're a moderator with rights then always yes
// else it depends on editing times, lock status and if we're the correct user
if ($mode == 'edit' && !$auth->acl_get('m_edit', $forum_id)) {
if ($user->data['user_id'] != $post_data['poster_id']) {
trigger_error('USER_CANNOT_EDIT');
}
示例11: extract
extract($phpbb_dispatcher->trigger_event('core.viewtopic_before_f_read_check', compact($vars)));
// Start auth check
if (!$overrides_f_read_check && !$auth->acl_get('f_read', $forum_id)) {
if ($user->data['user_id'] != ANONYMOUS) {
trigger_error('SORRY_AUTH_READ');
}
login_box('', $user->lang['LOGIN_VIEWFORUM']);
}
// Forum is passworded ... check whether access has been granted to this
// user this session, if not show login box
if (!$overrides_forum_password_check && $topic_data['forum_password']) {
login_forum_box($topic_data);
}
// Redirect to login upon emailed notification links if user is not logged in.
if (isset($_GET['e']) && $user->data['user_id'] == ANONYMOUS) {
login_box(build_url('e') . '#unread', $user->lang['LOGIN_NOTIFY_TOPIC']);
}
// What is start equal to?
if ($post_id) {
$start = floor($topic_data['prev_posts'] / $config['posts_per_page']) * $config['posts_per_page'];
}
// Get topic tracking info
if (!isset($topic_tracking_info)) {
$topic_tracking_info = array();
// Get topic tracking info
if ($config['load_db_lastread'] && $user->data['is_registered']) {
$tmp_topic_data = array($topic_id => $topic_data);
$topic_tracking_info = get_topic_tracking($forum_id, $topic_id, $tmp_topic_data, array($forum_id => $topic_data['forum_mark_time']));
unset($tmp_topic_data);
} else {
if ($config['load_anon_lastread'] || $user->data['is_registered']) {
示例12: define
*/
/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = defined('PHPBB_ROOT_PATH') ? PHPBB_ROOT_PATH : '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include $phpbb_root_path . 'common.' . $phpEx;
require $phpbb_root_path . 'ads/constants.' . $phpEx;
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('mods/info_acp_ads');
// Display a login box if they are not logged in
if (!$user->data['is_registered']) {
login_box();
}
if (!file_exists($phpbb_root_path . 'umil/umil_frontend.' . $phpEx)) {
trigger_error('Please download the latest UMIL (Unified MOD Install Library) from: <a href="http://www.phpbb.com/mods/umil/">phpBB.com/mods/umil</a>', E_USER_ERROR);
}
include $phpbb_root_path . 'umil/umil_frontend.' . $phpEx;
$umil = new umil_frontend('ACP_ADVERTISEMENT_MANAGEMENT', true);
// Check after initiating UMIL.
if ($user->data['user_type'] != USER_FOUNDER) {
trigger_error('FOUNDERS_ONLY');
}
if ($umil->confirm_box(true)) {
include $phpbb_root_path . 'ads/versions.' . $phpEx;
$umil->run_actions('uninstall', $versions, 'ads_version');
} else {
$umil->display_stages(array('CONFIRM', 'UNINSTALL'));
示例13: redirect
// Start session management
//$user->session_begin();
//$auth->acl($user->data);
global $config, $db, $user, $auth, $template, $cache;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
$db->return_on_error = 1;
if (!$user->data['is_registered'])
{
if ($user->data['is_bot'])
{
redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
}
login_box('', 'LOGIN');
}
else if ($user->data['user_type'] != USER_FOUNDER)
{
die('You are not allowed in here. :)');
}
//if (isset($config['photo_gallery_version']) && version_compare($config['photo_gallery_version'], '0.1.0', '>='))
//{
// trigger_error('you already have the latest photo gallery installed');
// exit;
//}
switch ($db->sql_layer)
{
case 'mysql':
示例14: main
function main($id, $mode)
{
global $config, $phpbb_root_path, $phpEx;
global $db, $user, $auth, $template;
$user_id = request_var('u', 0);
$key = request_var('k', '');
$sql = 'SELECT user_id, username, user_type, user_email, user_newpasswd, user_lang, user_notify_type, user_actkey, user_inactive_reason
FROM ' . USERS_TABLE . "\n\t\t\tWHERE user_id = {$user_id}";
$result = $db->sql_query($sql);
$user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!$user_row) {
trigger_error('NO_USER');
}
if ($user_row['user_type'] != USER_INACTIVE && !$user_row['user_newpasswd']) {
meta_refresh(3, append_sid("{$phpbb_root_path}index.{$phpEx}"));
trigger_error('ALREADY_ACTIVATED');
}
if ($user_row['user_inactive_reason'] == INACTIVE_MANUAL || $user_row['user_actkey'] != $key) {
trigger_error('WRONG_ACTIVATION');
}
// Do not allow activating by non administrators when admin activation is on
// Only activation type the user should be able to do is INACTIVE_REMIND
// or activate a new password which is not an activation state :@
if (!$user_row['user_newpasswd'] && $user_row['user_inactive_reason'] != INACTIVE_REMIND && $config['require_activation'] == USER_ACTIVATION_ADMIN && !$auth->acl_get('a_user')) {
if (!$user->data['is_registered']) {
login_box('', $user->lang['NO_AUTH_OPERATION']);
}
trigger_error('NO_AUTH_OPERATION');
}
$update_password = $user_row['user_newpasswd'] ? true : false;
if ($update_password) {
$sql_ary = array('user_actkey' => '', 'user_password' => $user_row['user_newpasswd'], 'user_newpasswd' => '', 'user_pass_convert' => 0, 'user_login_attempts' => 0);
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . $user_row['user_id'];
$db->sql_query($sql);
add_log('user', $user_row['user_id'], 'LOG_USER_NEW_PASSWORD', $user_row['username']);
}
if (!$update_password) {
include_once $phpbb_root_path . 'includes/functions_user.' . $phpEx;
user_active_flip('activate', $user_row['user_id']);
$sql = 'UPDATE ' . USERS_TABLE . "\n\t\t\t\tSET user_actkey = ''\n\t\t\t\tWHERE user_id = {$user_row['user_id']}";
$db->sql_query($sql);
// Create the correct logs
add_log('user', $user_row['user_id'], 'LOG_USER_ACTIVE_USER');
if ($auth->acl_get('a_user')) {
add_log('admin', 'LOG_USER_ACTIVE', $user_row['username']);
}
}
if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !$update_password) {
include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
$messenger = new messenger(false);
$messenger->template('admin_welcome_activated', $user_row['user_lang']);
$messenger->to($user_row['user_email'], $user_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('USERNAME' => htmlspecialchars_decode($user_row['username'])));
$messenger->send($user_row['user_notify_type']);
$message = 'ACCOUNT_ACTIVE_ADMIN';
} else {
if (!$update_password) {
$message = $user_row['user_inactive_reason'] == INACTIVE_PROFILE ? 'ACCOUNT_ACTIVE_PROFILE' : 'ACCOUNT_ACTIVE';
} else {
$message = 'PASSWORD_ACTIVATED';
}
}
meta_refresh(3, append_sid("{$phpbb_root_path}index.{$phpEx}"));
trigger_error($user->lang[$message]);
}
示例15: if
if (!$config['load_unreads_search'])
{
$template->assign_var('S_NO_SEARCH', true);
trigger_error('NO_SEARCH_UNREADS');
}
else if (!$config['load_anon_lastread'] && !$user->data['is_registered'])
{
login_box('', $user->lang['LOGIN_EXPLAIN_UNREADSEARCH']);
}
break;
// The "new posts" search uses user_lastvisit which is user based, so it should require user to log in.
case 'newposts':
if ($user->data['user_id'] == ANONYMOUS)
{
login_box('', $user->lang['LOGIN_EXPLAIN_NEWPOSTS']);
}
break;
default:
// There's nothing to do here for now ;)
break;
}
// Is user able to search? Has search been disabled?
if (!$auth->acl_get('u_search') || !$auth->acl_getf_global('f_search') || !$config['load_search'])
{
$template->assign_var('S_NO_SEARCH', true);
trigger_error('NO_SEARCH');
}