1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

Merge branch 'develop-olympus' into develop

* develop-olympus:
  [ticket/9851] "Search new posts" should require login.
  [task/phpdoc] Added a phpdoc task to the build process
  [task/phpdoc] Added a configuration file for phpDocumentor.
  [feature/acm-wincache] Adding caching module for WinCache's User Cache.
  [ticket/9939] Fix JavaScript error in admin recaptcha template
  [ticket/9575] Also change 'administrate' to 'administer' in templates
  [ticket/8736] guest can have 255 chars long username
  [ticket/9928] Do not link "login to your board" to the "send statistics" page.
  [ticket/9575] Change 'administrate' to 'administer'
  [ticket/9921] Adding sample configuration file for the lighttpd webserver.
  [ticket/9932] Add the Bing bot when converting
  [ticket/9930] Redirect failes with open_basedir enabled.
  [ticket/9910] Make sure S_BBCODE_ALLOWED exists when viewing PMs
This commit is contained in:
Nils Adermann
2010-12-13 17:14:36 +01:00
17 changed files with 313 additions and 33 deletions

View File

@@ -47,32 +47,44 @@ $sort_dir = request_var('sd', 'd');
$return_chars = request_var('ch', ($topic_id) ? -1 : 300);
$search_forum = request_var('fid', array(0));
// We put login boxes for the case if search_id is egosearch or unreadposts
// We put login boxes for the case if search_id is newposts, egosearch or unreadposts
// because a guest should be able to log in even if guests search is not permitted
// Egosearch is an author search
if ($search_id == 'egosearch')
switch ($search_id)
{
$author_id = $user->data['user_id'];
// Egosearch is an author search
case 'egosearch':
$author_id = $user->data['user_id'];
if ($user->data['user_id'] == ANONYMOUS)
{
login_box('', $user->lang['LOGIN_EXPLAIN_EGOSEARCH']);
}
break;
if ($user->data['user_id'] == ANONYMOUS)
{
login_box('', $user->lang['LOGIN_EXPLAIN_EGOSEARCH']);
}
}
// Search for unread posts needs to be allowed and user to be logged in if topics tracking for guests is disabled
if ($search_id == 'unreadposts')
{
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']);
}
// Search for unread posts needs to be allowed and user to be logged in if topics tracking for guests is disabled
case 'unreadposts':
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?