Vergleich global.php - 1.8.2 - 1.8.17

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 17Zeile 17
// Load main MyBB core file which begins all of the magic
require_once $working_dir.'/inc/init.php';


// Load main MyBB core file which begins all of the magic
require_once $working_dir.'/inc/init.php';


$shutdown_queries = array();

$shutdown_queries = $shutdown_functions = array();


// Read the usergroups cache as well as the moderators cache
$groupscache = $cache->read('usergroups');


// Read the usergroups cache as well as the moderators cache
$groupscache = $cache->read('usergroups');

Zeile 27Zeile 27
{
$cache->update_usergroups();
$groupscache = $cache->read('usergroups');

{
$cache->update_usergroups();
$groupscache = $cache->read('usergroups');

}

if(!defined('THIS_SCRIPT'))
{
define('THIS_SCRIPT', '');

 
}

$current_page = my_strtolower(basename(THIS_SCRIPT));

}

$current_page = my_strtolower(basename(THIS_SCRIPT));

Zeile 54Zeile 49
$session->init();
$mybb->session = &$session;


$session->init();
$mybb->session = &$session;


$mybb->user['ismoderator'] = is_moderator('', '', $mybb->user['uid']);

$mybb->user['ismoderator'] = is_moderator(0, '', $mybb->user['uid']);


// Set our POST validation code here
$mybb->post_code = generate_post_check();


// Set our POST validation code here
$mybb->post_code = generate_post_check();

Zeile 79Zeile 74
		my_setcookie('mybblang', $mybb->settings['bblanguage']);
}
$mybb->user['language'] = $mybb->settings['bblanguage'];

		my_setcookie('mybblang', $mybb->settings['bblanguage']);
}
$mybb->user['language'] = $mybb->settings['bblanguage'];

}

}

// Cookied language!
else if(!$mybb->user['uid'] && !empty($mybb->cookies['mybblang']) && $lang->language_exists($mybb->cookies['mybblang']))
{

// Cookied language!
else if(!$mybb->user['uid'] && !empty($mybb->cookies['mybblang']) && $lang->language_exists($mybb->cookies['mybblang']))
{

Zeile 111Zeile 106
// The user used our new quick theme changer
if(isset($mybb->input['theme']) && verify_post_check($mybb->get_input('my_post_key'), true))
{

// The user used our new quick theme changer
if(isset($mybb->input['theme']) && verify_post_check($mybb->get_input('my_post_key'), true))
{

	$mybb->user['style'] = $mybb->get_input('theme');
// If user is logged in, update their theme selection with the new one
if($mybb->user['uid'])













	// Set up user handler.
require_once MYBB_ROOT.'inc/datahandlers/user.php';
$userhandler = new UserDataHandler('update');

$user = array(
'uid' => $mybb->user['uid'],
'style' => $mybb->get_input('theme', MyBB::INPUT_INT),
'usergroup' => $mybb->user['usergroup'],
'additionalgroups' => $mybb->user['additionalgroups']
);

$userhandler->set_data($user);

// validate_user verifies the style if it is set in the data array.
if($userhandler->validate_user())

	{

	{

		if(isset($mybb->cookies['mybbtheme']))














		$mybb->user['style'] = $user['style'];

// If user is logged in, update their theme selection with the new one
if($mybb->user['uid'])
{
if(isset($mybb->cookies['mybbtheme']))
{
my_unsetcookie('mybbtheme');
}

$userhandler->update_user();
}
// Guest = cookie
else

		{

		{

			my_unsetcookie('mybbtheme');

			my_setcookie('mybbtheme', $user['style']);

		}

		}


$db->update_query('users', array('style' => (int)$mybb->user['style']), "uid = '{$mybb->user['uid']}'");
}
// Guest = cookie
else
{
my_setcookie('mybbtheme', $mybb->get_input('theme'));

 
	}
}
// Cookied theme!
else if(!$mybb->user['uid'] && !empty($mybb->cookies['mybbtheme']))
{

	}
}
// Cookied theme!
else if(!$mybb->user['uid'] && !empty($mybb->cookies['mybbtheme']))
{

	$mybb->user['style'] = $mybb->cookies['mybbtheme'];

	$mybb->user['style'] = (int)$mybb->cookies['mybbtheme'];

}

// This user has a custom theme set in their profile

}

// This user has a custom theme set in their profile

Zeile 224Zeile 237
}

// Fetch the theme to load from the cache

}

// Fetch the theme to load from the cache

 
if($loadstyle != "def='1'")
{
$query = $db->simple_select('themes', 'name, tid, properties, stylesheets, allowedgroups', $loadstyle, array('limit' => 1));
$theme = $db->fetch_array($query);

if(isset($theme['tid']) && !$load_from_forum && !is_member($theme['allowedgroups']) && $theme['allowedgroups'] != 'all')
{
if($load_from_user == 1)
{
$db->update_query('users', array('style' => 0), "style='{$mybb->user['style']}' AND uid='{$mybb->user['uid']}'");
}

if(isset($mybb->cookies['mybbtheme']))
{
my_unsetcookie('mybbtheme');
}

$loadstyle = "def='1'";
}
}


if($loadstyle == "def='1'")
{
if(!$cache->read('default_theme'))
{
$cache->update_default_theme();
}

if($loadstyle == "def='1'")
{
if(!$cache->read('default_theme'))
{
$cache->update_default_theme();
}

 


	$theme = $cache->read('default_theme');

	$theme = $cache->read('default_theme');

}
else
{
$query = $db->simple_select('themes', 'name, tid, properties, stylesheets', $loadstyle, array('limit' => 1));
$theme = $db->fetch_array($query);


$load_from_forum = $load_from_user = 0;




}

// No theme was found - we attempt to load the master or any other theme

}

// No theme was found - we attempt to load the master or any other theme

Zeile 326Zeile 358
}
unset($actions);


}
unset($actions);


if(!empty($theme_stylesheets))

if(!empty($theme_stylesheets) && is_array($theme['disporder']))

{
foreach($theme['disporder'] as $style_name => $order)
{

{
foreach($theme['disporder'] as $style_name => $order)
{

Zeile 338Zeile 370
}

// Are we linking to a remote theme server?

}

// Are we linking to a remote theme server?

if(my_substr($theme['imgdir'], 0, 7) == 'http://' || my_substr($theme['imgdir'], 0, 8) == 'https://')

if(my_validate_url($theme['imgdir']))

{
// If a language directory for the current language exists within the theme - we use it
if(!empty($mybb->user['language']))

{
// If a language directory for the current language exists within the theme - we use it
if(!empty($mybb->user['language']))

Zeile 361Zeile 393
}
else
{

}
else
{

    $img_directory = $theme['imgdir'];

	$img_directory = $theme['imgdir'];





    if($mybb->settings['usecdn'] && !empty($mybb->settings['cdnpath']))
{
$img_directory = rtrim($mybb->settings['cdnpath'], '/') . '/' . ltrim($theme['imgdir'], '/');
}

























	if($mybb->settings['usecdn'] && !empty($mybb->settings['cdnpath']))
{
$img_directory = rtrim($mybb->settings['cdnpath'], '/') . '/' . ltrim($theme['imgdir'], '/');
}

if(!@is_dir($img_directory))
{
$theme['imgdir'] = 'images';
}

// If a language directory for the current language exists within the theme - we use it
if(!empty($mybb->user['language']) && is_dir($img_directory.'/'.$mybb->user['language']))
{
$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->user['language'];
}
else
{
// Check if a custom language directory exists for this theme
if(is_dir($img_directory.'/'.$mybb->settings['bblanguage']))
{
$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->settings['bblanguage'];
}
// Otherwise, the image language directory is the same as the language directory for the theme
else
{
$theme['imglangdir'] = $theme['imgdir'];
}
}





    if(!@is_dir($img_directory))
{
$theme['imgdir'] = 'images';
}

// If a language directory for the current language exists within the theme - we use it
if(!empty($mybb->user['language']) && is_dir($img_directory.'/'.$mybb->user['language']))
{
$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->user['language'];
}
else
{
// Check if a custom language directory exists for this theme
if(is_dir($img_directory.'/'.$mybb->settings['bblanguage']))
{
$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->settings['bblanguage'];
}
// Otherwise, the image language directory is the same as the language directory for the theme
else
{
$theme['imglangdir'] = $theme['imgdir'];
}
}

$theme['imgdir'] = $mybb->get_asset_url($theme['imgdir']);
$theme['imglangdir'] = $mybb->get_asset_url($theme['imglangdir']);
}

	$theme['imgdir'] = $mybb->get_asset_url($theme['imgdir']);
$theme['imglangdir'] = $mybb->get_asset_url($theme['imglangdir']);
}


























// Theme logo - is it a relative URL to the forum root? Append bburl
if(!preg_match("#^(\.\.?(/|$)|([a-z0-9]+)://)#i", $theme['logo']) && substr($theme['logo'], 0, 1) != '/')


// Theme logo - is it a relative URL to the forum root? Append bburl
if(!preg_match("#^(\.\.?(/|$)|([a-z0-9]+)://)#i", $theme['logo']) && substr($theme['logo'], 0, 1) != '/')

Zeile 403Zeile 435
}

// Load Main Templates and Cached Templates

}

// Load Main Templates and Cached Templates

if(isset($templatelist))
{

if(isset($templatelist))
{

	$templatelist .= ',';

	$templatelist .= ',';

}

}

else
{
$templatelist = '';

else
{
$templatelist = '';

}

$templatelist .= "headerinclude,header,footer,gobutton,htmldoctype,header_welcomeblock_member,header_welcomeblock_guest,header_welcomeblock_member_admin,global_pm_alert,global_unreadreports,error,footer_languageselect_option,footer_contactus";
$templatelist .= ",global_pending_joinrequests,global_awaiting_activation,nav,nav_sep,nav_bit,nav_sep_active,nav_bit_active,footer_languageselect,footer_themeselect,header_welcomeblock_member_moderator,redirect,header_menu_calendar,nav_dropdown,footer_themeselector,task_image";
$templatelist .= ",global_boardclosed_warning,global_bannedwarning,error_inline,error_nopermission_loggedin,error_nopermission,debug_summary,header_quicksearch,header_menu_search,header_menu_portal,header_menu_memberlist,usercp_themeselector_option,smilie";
$templates->cache($db->escape_string($templatelist));







}

$templatelist .= "headerinclude,header,footer,gobutton,htmldoctype,header_welcomeblock_member,header_welcomeblock_member_user,header_welcomeblock_member_moderator,header_welcomeblock_member_admin,error";
$templatelist .= ",global_pending_joinrequests,global_awaiting_activation,nav,nav_sep,nav_bit,nav_sep_active,nav_bit_active,footer_languageselect,footer_themeselect,global_unreadreports,footer_contactus";
$templatelist .= ",global_boardclosed_warning,global_bannedwarning,error_inline,error_nopermission_loggedin,error_nopermission,global_pm_alert,header_menu_search,header_menu_portal,redirect,footer_languageselect_option";
$templatelist .= ",video_dailymotion_embed,video_facebook_embed,video_liveleak_embed,video_metacafe_embed,video_myspacetv_embed,video_veoh_embed,video_vimeo_embed,video_yahoo_embed,video_youtube_embed,debug_summary";
$templatelist .= ",smilieinsert_row,smilieinsert_row_empty,smilieinsert,smilieinsert_getmore,smilieinsert_smilie,global_board_offline_modal,footer_themeselector,task_image,usercp_themeselector_option,php_warnings";
$templatelist .= ",mycode_code,mycode_email,mycode_img,mycode_php,mycode_quote_post,mycode_size_int,mycode_url,global_no_permission_modal,global_boardclosed_reason,nav_dropdown,global_remote_avatar_notice";
$templatelist .= ",header_welcomeblock_member_pms,header_welcomeblock_member_search,header_welcomeblock_guest,header_welcomeblock_guest_login_modal,header_welcomeblock_guest_login_modal_lockout";
$templatelist .= ",header_menu_calendar,header_menu_memberlist,global_dst_detection,header_quicksearch,smilie";
$templates->cache($db->escape_string($templatelist));


// Set the current date and time now
$datenow = my_date($mybb->settings['dateformat'], TIME_NOW, '', false);
$timenow = my_date($mybb->settings['timeformat'], TIME_NOW);

// Set the current date and time now
$datenow = my_date($mybb->settings['dateformat'], TIME_NOW, '', false);
$timenow = my_date($mybb->settings['timeformat'], TIME_NOW);

Zeile 443Zeile 480
}

// Prepare the main templates for use

}

// Prepare the main templates for use

$admincplink = $modcplink = '';

$admincplink = $modcplink = $usercplink = '';


// Load appropriate welcome block for the current logged in user
if($mybb->user['uid'] != 0)


// Load appropriate welcome block for the current logged in user
if($mybb->user['uid'] != 0)

Zeile 453Zeile 490
	{
$admin_dir = $config['admin_dir'];
eval('$admincplink = "'.$templates->get('header_welcomeblock_member_admin').'";');

	{
$admin_dir = $config['admin_dir'];
eval('$admincplink = "'.$templates->get('header_welcomeblock_member_admin').'";');

	}


	}


	if($mybb->usergroup['canmodcp'] == 1)

	if($mybb->usergroup['canmodcp'] == 1)

	{

	{

		eval('$modcplink = "'.$templates->get('header_welcomeblock_member_moderator').'";');
}


		eval('$modcplink = "'.$templates->get('header_welcomeblock_member_moderator').'";');
}


	// Format the welcome back message
$lang->welcome_back = $lang->sprintf($lang->welcome_back, build_profile_link($mybb->user['username'], $mybb->user['uid']), $lastvisit);

// Tell the user their PM usage
$lang->welcome_pms_usage = $lang->sprintf($lang->welcome_pms_usage, my_number_format($mybb->user['pms_unread']), my_number_format($mybb->user['pms_total']));



















	if($mybb->usergroup['canusercp'] == 1)
{
eval('$usercplink = "'.$templates->get('header_welcomeblock_member_user').'";');
}

// Format the welcome back message
$lang->welcome_back = $lang->sprintf($lang->welcome_back, build_profile_link(htmlspecialchars_uni($mybb->user['username']), $mybb->user['uid']), $lastvisit);

$searchlink = '';
if($mybb->usergroup['cansearch'] == 1)
{
eval('$searchlink = "'.$templates->get('header_welcomeblock_member_search').'";');
}

// Tell the user their PM usage
$pmslink = '';
if($mybb->settings['enablepms'] != 0 && $mybb->usergroup['canusepms'] == 1)
{
$lang->welcome_pms_usage = $lang->sprintf($lang->welcome_pms_usage, my_number_format($mybb->user['pms_unread']), my_number_format($mybb->user['pms_total']));

eval('$pmslink = "'.$templates->get('header_welcomeblock_member_pms').'";');
}


	eval('$welcomeblock = "'.$templates->get('header_welcomeblock_member').'";');
}
// Otherwise, we have a guest

	eval('$welcomeblock = "'.$templates->get('header_welcomeblock_member').'";');
}
// Otherwise, we have a guest

Zeile 485Zeile 540
			$login_username = $lang->login_username;
break;
}

			$login_username = $lang->login_username;
break;
}

 

if($mybb->cookies['lockoutexpiry'])
{
$secsleft = (int)($mybb->cookies['lockoutexpiry'] - TIME_NOW);
$hoursleft = floor($secsleft / 3600);
$minsleft = floor(($secsleft / 60) % 60);
$secsleft = floor($secsleft % 60);

$lang->failed_login_wait = $lang->sprintf($lang->failed_login_wait, $hoursleft, $minsleft, $secsleft);

eval('$loginform = "'.$templates->get('header_welcomeblock_guest_login_modal_lockout').'";');
}
else
{
eval('$loginform = "'.$templates->get('header_welcomeblock_guest_login_modal').'";');
}


	eval('$welcomeblock = "'.$templates->get('header_welcomeblock_guest').'";');
}


	eval('$welcomeblock = "'.$templates->get('header_welcomeblock_guest').'";');
}


Zeile 517Zeile 589
if($mybb->user['uid'] != 0 && is_array($groupleaders) && array_key_exists($mybb->user['uid'], $groupleaders))
{
$groupleader = $groupleaders[$mybb->user['uid']];

if($mybb->user['uid'] != 0 && is_array($groupleaders) && array_key_exists($mybb->user['uid'], $groupleaders))
{
$groupleader = $groupleaders[$mybb->user['uid']];

 
	$showjoinnotice = false;


$gids = "'0'";
foreach($groupleader as $user)


$gids = "'0'";
foreach($groupleader as $user)

Zeile 527Zeile 600
		}

$user['gid'] = (int)$user['gid'];

		}

$user['gid'] = (int)$user['gid'];

		$gids .= ",'{$user['gid']}'";
}

$query = $db->simple_select('joinrequests', 'COUNT(uid) as total', "gid IN ({$gids}) AND invite='0'");
$total_joinrequests = $db->fetch_field($query, 'total');

if($total_joinrequests > 0)
{
if($total_joinrequests == 1)
{
$lang->pending_joinrequests = $lang->pending_joinrequest;
}
else



if(!empty($groupscache[$user['gid']]['joinable']) && $groupscache[$user['gid']]['joinable'] == 1)
{
$showjoinnotice = true;
$gids .= ",'{$user['gid']}'";
}
}

if($showjoinnotice)
{
$query = $db->simple_select('joinrequests', 'COUNT(uid) as total', "gid IN ({$gids}) AND invite='0'");
$total_joinrequests = $db->fetch_field($query, 'total');

if($total_joinrequests > 0)

		{

		{

			$total_joinrequests = my_number_format($total_joinrequests);
$lang->pending_joinrequests = $lang->sprintf($lang->pending_joinrequests, $total_joinrequests);
}







			if($total_joinrequests == 1)
{
$lang->pending_joinrequests = $lang->pending_joinrequest;
}
else
{
$total_joinrequests = my_number_format($total_joinrequests);
$lang->pending_joinrequests = $lang->sprintf($lang->pending_joinrequests, $total_joinrequests);
}





		eval('$pending_joinrequests = "'.$templates->get('global_pending_joinrequests').'";');


			eval('$pending_joinrequests = "'.$templates->get('global_pending_joinrequests').'";');
}

	}
}

	}
}





$unreadreports = '';
// This user is a moderator, super moderator or administrator

$unreadreports = '';
// This user is a moderator, super moderator or administrator

if($mybb->usergroup['cancp'] == 1 || ($mybb->user['ismoderator'] && $mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canmanagereportedcontent'] == 1))

if($mybb->settings['reportmethod'] == "db" && ($mybb->usergroup['cancp'] == 1 || ($mybb->user['ismoderator'] && $mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canmanagereportedcontent'] == 1)))

{
// Only worth checking if we are here because we have ACP permissions and the other condition fails
if($mybb->usergroup['cancp'] == 1 && !($mybb->user['ismoderator'] && $mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canmanagereportedcontent'] == 1))

{
// Only worth checking if we are here because we have ACP permissions and the other condition fails
if($mybb->usergroup['cancp'] == 1 && !($mybb->user['ismoderator'] && $mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canmanagereportedcontent'] == 1))

	{

	{

		// First we check if the user's a super admin: if yes, we don't care about permissions
$can_access_moderationqueue = true;

		// First we check if the user's a super admin: if yes, we don't care about permissions
$can_access_moderationqueue = true;

		$is_super_admin = is_super_admin($recipient['uid']);

		$is_super_admin = is_super_admin($mybb->user['uid']);

		if(!$is_super_admin)
{
// Include admin functions

		if(!$is_super_admin)
{
// Include admin functions

Zeile 575Zeile 656
			{
// Get admin permissions
$adminperms = get_admin_permissions($mybb->user['uid']);

			{
// Get admin permissions
$adminperms = get_admin_permissions($mybb->user['uid']);





				$permissions = forum_admin_permissions();
if(array_key_exists('moderation_queue', $permissions['permissions']) && $adminperms['forum']['moderation_queue'] != 1)
{

				$permissions = forum_admin_permissions();
if(array_key_exists('moderation_queue', $permissions['permissions']) && $adminperms['forum']['moderation_queue'] != 1)
{

Zeile 588Zeile 669
	{
$can_access_moderationqueue = false;
}

	{
$can_access_moderationqueue = false;
}

	



	if($can_access_moderationqueue || ($mybb->user['ismoderator'] && $mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canmanagereportedcontent'] == 1))
{
// Read the reported content cache

	if($can_access_moderationqueue || ($mybb->user['ismoderator'] && $mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canmanagereportedcontent'] == 1))
{
// Read the reported content cache

Zeile 656Zeile 737

if($ban['lifted'] > 0)
{


if($ban['lifted'] > 0)
{

			$banlift = my_date($mybb->settings['dateformat'], $ban['lifted']) . $lang->comma . my_date($mybb->settings['timeformat'], $ban['lifted']);

			$banlift = my_date('normal', $ban['lifted']);

		}
}


		}
}


Zeile 705Zeile 786
	}
else
{

	}
else
{

 
		$pm['fromusername'] = htmlspecialchars_uni($pm['fromusername']);

		$user_text = build_profile_link($pm['fromusername'], $pm['fromuid']);
}


		$user_text = build_profile_link($pm['fromusername'], $pm['fromuid']);
}


Zeile 719Zeile 801
	eval('$pm_notice = "'.$templates->get('global_pm_alert').'";');
}


	eval('$pm_notice = "'.$templates->get('global_pm_alert').'";');
}


if($mybb->usergroup['cancp'] == 1)







$remote_avatar_notice = '';
if(($mybb->user['avatartype'] === 'remote' || $mybb->user['avatartype'] === 'gravatar') && !$mybb->settings['allowremoteavatars'])
{
eval('$remote_avatar_notice = "'.$templates->get('global_remote_avatar_notice').'";');
}

if($mybb->settings['awactialert'] == 1 && $mybb->usergroup['cancp'] == 1)

{
$awaitingusers = $cache->read('awaitingactivation');

{
$awaitingusers = $cache->read('awaitingactivation');

 

if(isset($awaitingusers['time']) && $awaitingusers['time'] + 86400 < TIME_NOW)
{
$cache->update_awaitingactivation();
$awaitingusers = $cache->read('awaitingactivation');
}


if(!empty($awaitingusers['users']))


if(!empty($awaitingusers['users']))

	{

	{

		$awaitingusers = (int)$awaitingusers['users'];

		$awaitingusers = (int)$awaitingusers['users'];

	}
else
{
$awaitingusers = 0;
}


	}
else
{
$awaitingusers = 0;
}


	if($awaitingusers < 1)
{
$awaitingusers = 0;

	if($awaitingusers < 1)
{
$awaitingusers = 0;

	}

	}

	else
{
$awaitingusers = my_number_format($awaitingusers);
}

	else
{
$awaitingusers = my_number_format($awaitingusers);
}

	



	if($awaitingusers > 0)
{
if($awaitingusers == 1)

	if($awaitingusers > 0)
{
if($awaitingusers == 1)

Zeile 751Zeile 845
		{
$awaiting_message = $lang->sprintf($lang->awaiting_message_plural, $awaitingusers);
}

		{
$awaiting_message = $lang->sprintf($lang->awaiting_message_plural, $awaitingusers);
}

 

if($admincplink)
{
$awaiting_message .= $lang->sprintf($lang->awaiting_message_link, $mybb->settings['bburl'], $admin_dir);
}


		eval('$awaitingusers = "'.$templates->get('global_awaiting_activation').'";');
}
else

		eval('$awaitingusers = "'.$templates->get('global_awaiting_activation').'";');
}
else

Zeile 785Zeile 885
if($task_cache['nextrun'] <= TIME_NOW)
{
eval("\$task_image = \"".$templates->get("task_image")."\";");

if($task_cache['nextrun'] <= TIME_NOW)
{
eval("\$task_image = \"".$templates->get("task_image")."\";");

 
}

// Post code
$post_code_string = '';
if($mybb->user['uid'])
{
$post_code_string = '&amp;my_post_key='.$mybb->post_code;

}

// Are we showing the quick language selection box?

}

// Are we showing the quick language selection box?

Zeile 808Zeile 915
			{
$selected = '';
}

			{
$selected = '';
}





			eval('$lang_options .= "'.$templates->get('footer_languageselect_option').'";');
}


			eval('$lang_options .= "'.$templates->get('footer_languageselect_option').'";');
}


Zeile 827Zeile 934
	{
$theme_redirect_url = get_current_location(true, 'theme');
eval('$theme_select = "'.$templates->get('footer_themeselect').'";');

	{
$theme_redirect_url = get_current_location(true, 'theme');
eval('$theme_select = "'.$templates->get('footer_themeselect').'";');

	}
}


	}
}


// If we use the contact form, show 'Contact Us' link when appropriate
$contact_us = '';
if(($mybb->settings['contactlink'] == "contact.php" && $mybb->settings['contact'] == 1 && ($mybb->settings['contact_guests'] != 1 && $mybb->user['uid'] == 0 || $mybb->user['uid'] > 0)) || $mybb->settings['contactlink'] != "contact.php")
{

// If we use the contact form, show 'Contact Us' link when appropriate
$contact_us = '';
if(($mybb->settings['contactlink'] == "contact.php" && $mybb->settings['contact'] == 1 && ($mybb->settings['contact_guests'] != 1 && $mybb->user['uid'] == 0 || $mybb->user['uid'] > 0)) || $mybb->settings['contactlink'] != "contact.php")
{

	if(my_substr($mybb->settings['contactlink'], 0, 1) != '/' && my_substr($mybb->settings['contactlink'], 0, 7) != 'http://' && my_substr($mybb->settings['contactlink'], 0, 8) != 'https://' && my_substr($mybb->settings['contactlink'], 0, 7) != 'mailto:')

	if(!my_validate_url($mybb->settings['contactlink'], true) && my_substr($mybb->settings['contactlink'], 0, 7) != 'mailto:')

	{
$mybb->settings['contactlink'] = $mybb->settings['bburl'].'/'.$mybb->settings['contactlink'];
}

eval('$contact_us = "'.$templates->get('footer_contactus').'";');

	{
$mybb->settings['contactlink'] = $mybb->settings['bburl'].'/'.$mybb->settings['contactlink'];
}

eval('$contact_us = "'.$templates->get('footer_contactus').'";');

}


}


// DST Auto detection enabled?
$auto_dst_detection = '';
if($mybb->user['uid'] > 0 && $mybb->user['dstcorrection'] == 2)
{

// DST Auto detection enabled?
$auto_dst_detection = '';
if($mybb->user['uid'] > 0 && $mybb->user['dstcorrection'] == 2)
{

	$auto_dst_detection = "<script type=\"text/javascript\">if(MyBB) { $([document, window]).bind(\"load\", function() { MyBB.detectDSTChange('".($mybb->user['timezone']+$mybb->user['dst'])."'); }); }</script>\n";


	$timezone = (float)$mybb->user['timezone'] + $mybb->user['dst'];
eval('$auto_dst_detection = "'.$templates->get('global_dst_detection').'";');

}

}

 


eval('$footer = "'.$templates->get('footer').'";');

// Add our main parts to the navigation

eval('$footer = "'.$templates->get('footer').'";');

// Add our main parts to the navigation

Zeile 862Zeile 971
if(is_banned_ip($session->ipaddress, true))
{
if($mybb->user['uid'])

if(is_banned_ip($session->ipaddress, true))
{
if($mybb->user['uid'])

    {

	{

		$db->delete_query('sessions', "ip = ".$db->escape_binary($session->packedip)." OR uid='{$mybb->user['uid']}'");

		$db->delete_query('sessions', "ip = ".$db->escape_binary($session->packedip)." OR uid='{$mybb->user['uid']}'");

    }
else
{

	}
else
{

		$db->delete_query('sessions', "ip = ".$db->escape_binary($session->packedip));

		$db->delete_query('sessions', "ip = ".$db->escape_binary($session->packedip));

    }

	}

	error($lang->error_banned);
}

$closed_bypass = array(

	error($lang->error_banned);
}

$closed_bypass = array(

	'member.php' => array(
'login',
'do_login',
'logout',
),
'captcha.php',


	'member.php' => array(
'login',
'do_login',
'logout',
),
'captcha.php',
'contact.php',

);

);





// If the board is closed, the user is not an administrator and they're not trying to login, show the board closed message
if($mybb->settings['boardclosed'] == 1 && $mybb->usergroup['canviewboardclosed'] != 1 && !in_array($current_page, $closed_bypass) && (!is_array($closed_bypass[$current_page]) || !in_array($mybb->get_input('action'), $closed_bypass[$current_page])))
{
// Show error

// If the board is closed, the user is not an administrator and they're not trying to login, show the board closed message
if($mybb->settings['boardclosed'] == 1 && $mybb->usergroup['canviewboardclosed'] != 1 && !in_array($current_page, $closed_bypass) && (!is_array($closed_bypass[$current_page]) || !in_array($mybb->get_input('action'), $closed_bypass[$current_page])))
{
// Show error

	$lang->error_boardclosed .= "<blockquote>{$mybb->settings['boardclosed_reason']}</blockquote>";
error($lang->error_boardclosed);

















	if(!$mybb->settings['boardclosed_reason'])
{
$mybb->settings['boardclosed_reason'] = $lang->boardclosed_reason;
}

eval('$reason = "'.$templates->get('global_boardclosed_reason').'";');
$lang->error_boardclosed .= $reason;

if(!$mybb->get_input('modal'))
{
error($lang->error_boardclosed);
}
else
{
$output = '';
eval('$output = "'.$templates->get('global_board_offline_modal', 1, 0).'";');
echo($output);
}

	exit;
}


	exit;
}


Zeile 905Zeile 1031
		'resetpassword',
),
'captcha.php',

		'resetpassword',
),
'captcha.php',

 
	'contact.php',

);

// If the board forces user to login/register, and the user is a guest, show the force login message

);

// If the board forces user to login/register, and the user is a guest, show the force login message

Zeile 931Zeile 1058
	}
else
{

	}
else
{

		$condition = "uid = '".$mybb->get_input('referrer', 1)."'";

		$condition = "uid = '".$mybb->get_input('referrer', MyBB::INPUT_INT)."'";

	}

$query = $db->simple_select('users', 'uid', $condition, array('limit' => 1));

	}

$query = $db->simple_select('users', 'uid', $condition, array('limit' => 1));

Zeile 943Zeile 1070
	}
}


	}
}


 
$output = '';
$notallowed = false;

if($mybb->usergroup['canview'] != 1)
{
// Check pages allowable even when not allowed to view board

if($mybb->usergroup['canview'] != 1)
{
// Check pages allowable even when not allowed to view board

Zeile 953Zeile 1082
			$allowable_actions = explode(',', ALLOWABLE_PAGE);
if(!in_array($mybb->get_input('action'), $allowable_actions))
{

			$allowable_actions = explode(',', ALLOWABLE_PAGE);
if(!in_array($mybb->get_input('action'), $allowable_actions))
{

				error_no_permission();

				$notallowed = true;

			}

unset($allowable_actions);
}
else if(ALLOWABLE_PAGE !== 1)
{

			}

unset($allowable_actions);
}
else if(ALLOWABLE_PAGE !== 1)
{

			error_no_permission();
}
}

			$notallowed = true;
}
}

	else

	else

	{
error_no_permission();

	{
$notallowed = true;

	}

	}

}
















if($notallowed == true)
{
if(!$mybb->get_input('modal'))
{
error_no_permission();
}
else
{
eval('$output = "'.$templates->get('global_no_permission_modal', 1, 0).'";');
echo($output);
exit;
}
}
}


// Find out if this user of ours is using a banned email address.
// If they are, redirect them to change it
if($mybb->user['uid'] && is_banned_email($mybb->user['email']) && $mybb->settings['emailkeep'] != 1)
{
if(THIS_SCRIPT != 'usercp.php' || THIS_SCRIPT == 'usercp.php' && $mybb->get_input('action') != 'email' && $mybb->get_input('action') != 'do_email')


// Find out if this user of ours is using a banned email address.
// If they are, redirect them to change it
if($mybb->user['uid'] && is_banned_email($mybb->user['email']) && $mybb->settings['emailkeep'] != 1)
{
if(THIS_SCRIPT != 'usercp.php' || THIS_SCRIPT == 'usercp.php' && $mybb->get_input('action') != 'email' && $mybb->get_input('action') != 'do_email')

	{

	{

		redirect('usercp.php?action=email');

		redirect('usercp.php?action=email');

	}

	}

	else if($mybb->request_method != 'post')
{
$banned_email_error = inline_error(array($lang->banned_email_warning));
}

	else if($mybb->request_method != 'post')
{
$banned_email_error = inline_error(array($lang->banned_email_warning));
}

}


}


// work out which items the user has collapsed
$colcookie = '';
if(!empty($mybb->cookies['collapsed']))

// work out which items the user has collapsed
$colcookie = '';
if(!empty($mybb->cookies['collapsed']))

{

{

	$colcookie = $mybb->cookies['collapsed'];
}

	$colcookie = $mybb->cookies['collapsed'];
}


// set up collapsable items (to automatically show them us expanded)
$collapsed = array('boardstats' => '', 'boardstats_e' => '', 'quickreply' => '', 'quickreply_e' => '');
$collapsedimg = $collapsed;


$collapse = $collapsed = $collapsedimg = array();




if($colcookie)
{


if($colcookie)
{

	$col = explode("|", $colcookie);
if(!is_array($col))
{
$col[0] = $colcookie; // only one item
}
unset($collapsed);
foreach($col as $key => $val)

	// Preserve and don't unset $collapse, will be needed globally throughout many pages
$collapse = explode("|", $colcookie);
foreach($collapse as $val)





	{
$ex = $val."_e";
$co = $val."_c";

	{
$ex = $val."_e";
$co = $val."_c";