Vergleich xmlhttp.php - 1.8.5 - 1.8.15

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 84Zeile 84
}

// Load basic theme information that we could be needing.

}

// Load basic theme information that we could be needing.

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

if(isset($theme['tid']) && !is_member($theme['allowedgroups']) && $theme['allowedgroups'] != 'all')
{
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", $loadstyle);
$theme = $db->fetch_array($query);
}









// No theme was found - we attempt to load the master or any other theme
if(!isset($theme['tid']) || isset($theme['tid']) && !$theme['tid'])
{
// Missing theme was from a user, run a query to set any users using the theme to the default

// No theme was found - we attempt to load the master or any other theme
if(!isset($theme['tid']) || isset($theme['tid']) && !$theme['tid'])
{
// Missing theme was from a user, run a query to set any users using the theme to the default

	$db->update_query('users', array('style' => 0), "style = '{$mybb->user['style']}'");


	$db->update_query('users', array('style' => 0), "style = '{$mybb->user['style']}'");


	// Attempt to load the master or any other theme if the master is not available
$query = $db->simple_select('themes', 'name, tid, properties, stylesheets', '', array('order_by' => 'tid', 'limit' => 1));
$theme = $db->fetch_array($query);

	// Attempt to load the master or any other theme if the master is not available
$query = $db->simple_select('themes', 'name, tid, properties, stylesheets', '', array('order_by' => 'tid', 'limit' => 1));
$theme = $db->fetch_array($query);

Zeile 112Zeile 124

// Set the appropriate image language directory for this theme.
// Are we linking to a remote theme server?


// Set the appropriate image language directory for this theme.
// Are we linking to a remote theme server?

if(my_substr($theme['imgdir'], 0, 7) == 'http://' || my_substr($theme['imgdir'], 0, 8) == 'https://')
{
// If a language directory for the current language exists within the theme - we use it

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(!empty($mybb->user['language']))

	{

	{

		$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->user['language'];
}
else
{
// Check if a custom language directory exists for this theme
if(!empty($mybb->settings['bblanguage']))

		$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->user['language'];
}
else
{
// Check if a custom language directory exists for this theme
if(!empty($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

			$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->settings['bblanguage'];
}
// Otherwise, the image language directory is the same as the language directory for the theme

Zeile 162Zeile 174
		// Otherwise, the image language directory is the same as the language directory for the theme
else
{

		// Otherwise, the image language directory is the same as the language directory for the theme
else
{

		$theme['imglangdir'] = $theme['imgdir'];

			$theme['imglangdir'] = $theme['imgdir'];

		}
}


		}
}


Zeile 210Zeile 222
if($mybb->input['action'] == "get_users")
{
$mybb->input['query'] = ltrim($mybb->get_input('query'));

if($mybb->input['action'] == "get_users")
{
$mybb->input['query'] = ltrim($mybb->get_input('query'));

 
	$search_type = $mybb->get_input('search_type', MyBB::INPUT_INT); // 0: contains, 1: starts with, 2: ends with





	// If the string is less than 3 characters, quit.
if(my_strlen($mybb->input['query']) < 3)

	// If the string is less than 2 characters, quit.
if(my_strlen($mybb->input['query']) < 2)

	{
exit;
}

	{
exit;
}

Zeile 239Zeile 252

$plugins->run_hooks("xmlhttp_get_users_start");



$plugins->run_hooks("xmlhttp_get_users_start");


	$query = $db->simple_select("users", "uid, username", "username LIKE '".$db->escape_string_like($mybb->input['query'])."%'", $query_options);















	$likestring = $db->escape_string_like($mybb->input['query']);
if($search_type == 1)
{
$likestring .= '%';
}
elseif($search_type == 2)
{
$likestring = '%'.$likestring;
}
else
{
$likestring = '%'.$likestring.'%';
}

$query = $db->simple_select("users", "uid, username", "username LIKE '{$likestring}'", $query_options);

	if($limit == 1)
{
$user = $db->fetch_array($query);

	if($limit == 1)
{
$user = $db->fetch_array($query);

		$user['username'] = htmlspecialchars_uni($user['username']);
$data = array('id' => $user['username'], 'text' => $user['username']);

		$data = array('uid' => $user['uid'], 'id' => $user['username'], 'text' => $user['username']);


	}
else
{
$data = array();
while($user = $db->fetch_array($query))
{

	}
else
{
$data = array();
while($user = $db->fetch_array($query))
{

			$user['username'] = htmlspecialchars_uni($user['username']);
$data[] = array('id' => $user['username'], 'text' => $user['username']);

			$data[] = array('uid' => $user['uid'], 'id' => $user['username'], 'text' => $user['username']);


		}
}


		}
}


Zeile 298Zeile 323

// Missing thread, invalid forum? Error.
if(!$forum || $forum['type'] != "f")


// Missing thread, invalid forum? Error.
if(!$forum || $forum['type'] != "f")

	{
xmlhttp_error($lang->thread_doesnt_exist);
}

// Fetch forum permissions.
$forumpermissions = forum_permissions($forum['fid']);

$plugins->run_hooks("xmlhttp_edit_subject_start");

	{
xmlhttp_error($lang->thread_doesnt_exist);
}

// Fetch forum permissions.
$forumpermissions = forum_permissions($forum['fid']);

$plugins->run_hooks("xmlhttp_edit_subject_start");


// If this user is not a moderator with "caneditposts" permissions.
if(!is_moderator($forum['fid'], "caneditposts"))
{
// Thread is closed - no editing allowed.
if($thread['closed'] == 1)


// If this user is not a moderator with "caneditposts" permissions.
if(!is_moderator($forum['fid'], "caneditposts"))
{
// Thread is closed - no editing allowed.
if($thread['closed'] == 1)

		{

		{

			xmlhttp_error($lang->thread_closed_edit_subjects);
}
// Forum is not open, user doesn't have permission to edit, or author doesn't match this user - don't allow editing.
else if($forum['open'] == 0 || $forumpermissions['caneditposts'] == 0 || $mybb->user['uid'] != $post['uid'] || $mybb->user['uid'] == 0)
{
xmlhttp_error($lang->no_permission_edit_subject);

			xmlhttp_error($lang->thread_closed_edit_subjects);
}
// Forum is not open, user doesn't have permission to edit, or author doesn't match this user - don't allow editing.
else if($forum['open'] == 0 || $forumpermissions['caneditposts'] == 0 || $mybb->user['uid'] != $post['uid'] || $mybb->user['uid'] == 0)
{
xmlhttp_error($lang->no_permission_edit_subject);

		}

		}

		// If we're past the edit time limit - don't allow editing.
else if($mybb->usergroup['edittimelimit'] != 0 && $post['dateline'] < (TIME_NOW-($mybb->usergroup['edittimelimit']*60)))
{

		// If we're past the edit time limit - don't allow editing.
else if($mybb->usergroup['edittimelimit'] != 0 && $post['dateline'] < (TIME_NOW-($mybb->usergroup['edittimelimit']*60)))
{

Zeile 361Zeile 386
		$updatepost = array(
"pid" => $post['pid'],
"tid" => $thread['tid'],

		$updatepost = array(
"pid" => $post['pid'],
"tid" => $thread['tid'],

 
			"prefix" => $thread['prefix'],

			"subject" => $subject,
"edit_uid" => $mybb->user['uid']
);

			"subject" => $subject,
"edit_uid" => $mybb->user['uid']
);

Zeile 411Zeile 437

// No result, die.
if(!$post)


// No result, die.
if(!$post)

	{

	{

		xmlhttp_error($lang->post_doesnt_exist);
}


		xmlhttp_error($lang->post_doesnt_exist);
}


Zeile 425Zeile 451
	if(!$thread || !$forum || $forum['type'] != "f")
{
xmlhttp_error($lang->thread_doesnt_exist);

	if(!$thread || !$forum || $forum['type'] != "f")
{
xmlhttp_error($lang->thread_doesnt_exist);

 
	}

// Check if this forum is password protected and we have a valid password
if(check_forum_password($forum['fid'], 0, true))
{
xmlhttp_error($lang->wrong_forum_password);

	}

// Fetch forum permissions.
$forumpermissions = forum_permissions($forum['fid']);

	}

// Fetch forum permissions.
$forumpermissions = forum_permissions($forum['fid']);





	$plugins->run_hooks("xmlhttp_edit_post_start");

// If this user is not a moderator with "caneditposts" permissions.

	$plugins->run_hooks("xmlhttp_edit_post_start");

// If this user is not a moderator with "caneditposts" permissions.

Zeile 437Zeile 469
	{
// Thread is closed - no editing allowed.
if($thread['closed'] == 1)

	{
// Thread is closed - no editing allowed.
if($thread['closed'] == 1)

		{

		{

			xmlhttp_error($lang->thread_closed_edit_message);

			xmlhttp_error($lang->thread_closed_edit_message);

		}

		}

		// Forum is not open, user doesn't have permission to edit, or author doesn't match this user - don't allow editing.
else if($forum['open'] == 0 || $forumpermissions['caneditposts'] == 0 || $mybb->user['uid'] != $post['uid'] || $mybb->user['uid'] == 0 || $mybb->user['suspendposting'] == 1)

		// Forum is not open, user doesn't have permission to edit, or author doesn't match this user - don't allow editing.
else if($forum['open'] == 0 || $forumpermissions['caneditposts'] == 0 || $mybb->user['uid'] != $post['uid'] || $mybb->user['uid'] == 0 || $mybb->user['suspendposting'] == 1)

		{

		{

			xmlhttp_error($lang->no_permission_edit_post);
}
// If we're past the edit time limit - don't allow editing.

			xmlhttp_error($lang->no_permission_edit_post);
}
// If we're past the edit time limit - don't allow editing.

Zeile 450Zeile 482
		{
$lang->edit_time_limit = $lang->sprintf($lang->edit_time_limit, $mybb->usergroup['edittimelimit']);
xmlhttp_error($lang->edit_time_limit);

		{
$lang->edit_time_limit = $lang->sprintf($lang->edit_time_limit, $mybb->usergroup['edittimelimit']);
xmlhttp_error($lang->edit_time_limit);

		}

		}

		// User can't edit unapproved post
if($post['visible'] == 0)

		// User can't edit unapproved post
if($post['visible'] == 0)

		{

		{

			xmlhttp_error($lang->post_moderation);

			xmlhttp_error($lang->post_moderation);

		}

// Forum is closed - no editing allowed
if($forum['open'] == 0)
{
xmlhttp_error($lang->no_permission_edit_post);
}
}

$plugins->run_hooks("xmlhttp_edit_post_end");

		}
}

$plugins->run_hooks("xmlhttp_edit_post_end");








if($mybb->get_input('do') == "get_post")
{


if($mybb->get_input('do') == "get_post")
{

Zeile 502Zeile 528
				$message = utf8_decode($message);
$editreason = utf8_decode($editreason);
}

				$message = utf8_decode($message);
$editreason = utf8_decode($editreason);
}

		}


		}


		// Set up posthandler.
require_once MYBB_ROOT."inc/datahandlers/post.php";
$posthandler = new PostDataHandler("update");
$posthandler->action = "post";

		// Set up posthandler.
require_once MYBB_ROOT."inc/datahandlers/post.php";
$posthandler = new PostDataHandler("update");
$posthandler->action = "post";





		// Set the post data that came from the input to the $post array.
$updatepost = array(
"pid" => $post['pid'],

		// Set the post data that came from the input to the $post array.
$updatepost = array(
"pid" => $post['pid'],

Zeile 516Zeile 542
			"editreason" => $editreason,
"edit_uid" => $mybb->user['uid']
);

			"editreason" => $editreason,
"edit_uid" => $mybb->user['uid']
);

 

// If this is the first post set the prefix. If a forum requires a prefix the quick edit would throw an error otherwise
if($post['pid'] == $thread['firstpost'])
{
$updatepost['prefix'] = $thread['prefix'];
}


		$posthandler->set_data($updatepost);

// Now let the post handler do all the hard work.

		$posthandler->set_data($updatepost);

// Now let the post handler do all the hard work.

Zeile 557Zeile 590
			"me_username" => $post['username'],
"filter_badwords" => 1
);

			"me_username" => $post['username'],
"filter_badwords" => 1
);

 

$post['username'] = htmlspecialchars_uni($post['username']);


if($post['smilieoff'] == 1)


if($post['smilieoff'] == 1)

		{

		{

			$parser_options['allow_smilies'] = 0;
}

if($mybb->user['showimages'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0)
{
$parser_options['allow_imgcode'] = 0;

			$parser_options['allow_smilies'] = 0;
}

if($mybb->user['showimages'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0)
{
$parser_options['allow_imgcode'] = 0;

		}


		}


		if($mybb->user['showvideos'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestvideos'] != 1 && $mybb->user['uid'] == 0)
{
$parser_options['allow_videocode'] = 0;

		if($mybb->user['showvideos'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestvideos'] != 1 && $mybb->user['uid'] == 0)
{
$parser_options['allow_videocode'] = 0;

		}

$post['message'] = $parser->parse_message($message, $parser_options);


		}

$post['message'] = $parser->parse_message($message, $parser_options);


		// Now lets fetch all of the attachments for these posts.
if($mybb->settings['enableattachments'] != 0)
{

		// Now lets fetch all of the attachments for these posts.
if($mybb->settings['enableattachments'] != 0)
{

Zeile 582Zeile 617
			while($attachment = $db->fetch_array($query))
{
$attachcache[$attachment['pid']][$attachment['aid']] = $attachment;

			while($attachment = $db->fetch_array($query))
{
$attachcache[$attachment['pid']][$attachment['aid']] = $attachment;

			}


			}


			require_once MYBB_ROOT."inc/functions_post.php";

get_post_attachments($post['pid'], $post);

			require_once MYBB_ROOT."inc/functions_post.php";

get_post_attachments($post['pid'], $post);

Zeile 595Zeile 630
		{
$post['editdate'] = my_date('relative', TIME_NOW);
$post['editnote'] = $lang->sprintf($lang->postbit_edited, $post['editdate']);

		{
$post['editdate'] = my_date('relative', TIME_NOW);
$post['editnote'] = $lang->sprintf($lang->postbit_edited, $post['editdate']);

 
			$mybb->user['username'] = htmlspecialchars_uni($mybb->user['username']);

			$post['editedprofilelink'] = build_profile_link($mybb->user['username'], $mybb->user['uid']);
$post['editreason'] = trim($editreason);
$editreason = "";

			$post['editedprofilelink'] = build_profile_link($mybb->user['username'], $mybb->user['uid']);
$post['editreason'] = trim($editreason);
$editreason = "";

Zeile 624Zeile 660
}
// Fetch the list of multiquoted posts which are not in a specific thread
else if($mybb->input['action'] == "get_multiquoted")

}
// Fetch the list of multiquoted posts which are not in a specific thread
else if($mybb->input['action'] == "get_multiquoted")

{

{

	// If the cookie does not exist, exit
if(!array_key_exists("multiquote", $mybb->cookies))

	// If the cookie does not exist, exit
if(!array_key_exists("multiquote", $mybb->cookies))

	{
exit;
}

	{
exit;
}

	// Divide up the cookie using our delimeter
$multiquoted = explode("|", $mybb->cookies['multiquote']);


	// Divide up the cookie using our delimeter
$multiquoted = explode("|", $mybb->cookies['multiquote']);


Zeile 656Zeile 692
	if($unviewable_forums)
{
$unviewable_forums = "AND t.fid NOT IN ({$unviewable_forums})";

	if($unviewable_forums)
{
$unviewable_forums = "AND t.fid NOT IN ({$unviewable_forums})";

	}

	}

	if($inactiveforums)

	if($inactiveforums)

	{

	{

		$inactiveforums = "AND t.fid NOT IN ({$inactiveforums})";
}

		$inactiveforums = "AND t.fid NOT IN ({$inactiveforums})";
}

 

// Check group permissions if we can't view threads not started by us
$group_permissions = forum_permissions();
$onlyusfids = array();
foreach($group_permissions as $gpfid => $forum_permissions)
{
if(isset($forum_permissions['canonlyviewownthreads']) && $forum_permissions['canonlyviewownthreads'] == 1)
{
$onlyusfids[] = $gpfid;
}
}


	$message = '';

// Are we loading all quoted posts or only those not in the current thread?

	$message = '';

// Are we loading all quoted posts or only those not in the current thread?

Zeile 682Zeile 730

// Query for any posts in the list which are not within the specified thread
$query = $db->query("


// Query for any posts in the list which are not within the specified thread
$query = $db->query("

		SELECT p.subject, p.message, p.pid, p.tid, p.username, p.dateline, t.fid, p.visible, u.username AS userusername

		SELECT p.subject, p.message, p.pid, p.tid, p.username, p.dateline, t.fid, t.uid AS thread_uid, p.visible, u.username AS userusername

		FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)

		FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)

Zeile 691Zeile 739
	");
while($quoted_post = $db->fetch_array($query))
{

	");
while($quoted_post = $db->fetch_array($query))
{

		if(!is_moderator($quoted_post['fid'], "canviewunapprove") && $quoted_post['visible'] == 0)





		if(
(!is_moderator($quoted_post['fid'], "canviewunapprove") && $quoted_post['visible'] == 0) ||
(!is_moderator($quoted_post['fid'], "canviewdeleted") && $quoted_post['visible'] == -1) ||
(in_array($quoted_post['fid'], $onlyusfids) && (!$mybb->user['uid'] || $quoted_post['thread_uid'] != $mybb->user['uid']))
)

		{
continue;
}

		{
continue;
}

Zeile 764Zeile 816
else if($mybb->input['action'] == "refresh_question" && $mybb->settings['securityquestion'])
{
header("Content-type: application/json; charset={$charset}");

else if($mybb->input['action'] == "refresh_question" && $mybb->settings['securityquestion'])
{
header("Content-type: application/json; charset={$charset}");

	



	$sid = $db->escape_string($mybb->get_input('question_id'));
$query = $db->query("
SELECT q.qid, s.sid

	$sid = $db->escape_string($mybb->get_input('question_id'));
$query = $db->query("
SELECT q.qid, s.sid

		FROM ".TABLE_PREFIX."questionsessions s
LEFT JOIN ".TABLE_PREFIX."questions q ON (q.qid=s.qid)
WHERE q.active='1' AND s.sid='{$sid}'
");

if($db->num_rows($query) == 0)
{
xmlhttp_error($lang->answer_valid_not_exists);

		FROM ".TABLE_PREFIX."questionsessions s
LEFT JOIN ".TABLE_PREFIX."questions q ON (q.qid=s.qid)
WHERE q.active='1' AND s.sid='{$sid}'
");

if($db->num_rows($query) == 0)
{
xmlhttp_error($lang->answer_valid_not_exists);

	}

	}

	



	$qsession = $db->fetch_array($query);

	$qsession = $db->fetch_array($query);

	



	// Delete previous question session
$db->delete_query("questionsessions", "sid='$sid'");

	// Delete previous question session
$db->delete_query("questionsessions", "sid='$sid'");

	



	require_once MYBB_ROOT."inc/functions_user.php";

	require_once MYBB_ROOT."inc/functions_user.php";

	



	$sid = generate_question($qsession['qid']);
$query = $db->query("
SELECT q.question, s.sid

	$sid = generate_question($qsession['qid']);
$query = $db->query("
SELECT q.question, s.sid

		FROM ".TABLE_PREFIX."questionsessions s

		FROM ".TABLE_PREFIX."questionsessions s

		LEFT JOIN ".TABLE_PREFIX."questions q ON (q.qid=s.qid)
WHERE q.active='1' AND s.sid='{$sid}' AND q.qid!='{$qsession['qid']}'
");

		LEFT JOIN ".TABLE_PREFIX."questions q ON (q.qid=s.qid)
WHERE q.active='1' AND s.sid='{$sid}' AND q.qid!='{$qsession['qid']}'
");

	



	$plugins->run_hooks("xmlhttp_refresh_question");

	$plugins->run_hooks("xmlhttp_refresh_question");

	



	if($db->num_rows($query) > 0)
{
$question = $db->fetch_array($query);

	if($db->num_rows($query) > 0)
{
$question = $db->fetch_array($query);

		



		echo json_encode(array("question" => htmlspecialchars_uni($question['question']), 'sid' => htmlspecialchars_uni($question['sid'])));

		echo json_encode(array("question" => htmlspecialchars_uni($question['question']), 'sid' => htmlspecialchars_uni($question['sid'])));

		exit;
}
else

		exit;
}
else

	{
xmlhttp_error($lang->answer_valid_not_exists);
}

	{
xmlhttp_error($lang->answer_valid_not_exists);
}

Zeile 812Zeile 864
	header("Content-type: application/json; charset={$charset}");
$sid = $db->escape_string($mybb->get_input('question'));
$answer = $db->escape_string($mybb->get_input('answer'));

	header("Content-type: application/json; charset={$charset}");
$sid = $db->escape_string($mybb->get_input('question'));
$answer = $db->escape_string($mybb->get_input('answer'));

	



	$query = $db->query("
SELECT q.*, s.sid
FROM ".TABLE_PREFIX."questionsessions s
LEFT JOIN ".TABLE_PREFIX."questions q ON (q.qid=s.qid)
WHERE q.active='1' AND s.sid='{$sid}'
");

	$query = $db->query("
SELECT q.*, s.sid
FROM ".TABLE_PREFIX."questionsessions s
LEFT JOIN ".TABLE_PREFIX."questions q ON (q.qid=s.qid)
WHERE q.active='1' AND s.sid='{$sid}'
");

	



	if($db->num_rows($query) == 0)
{
echo json_encode($lang->answer_valid_not_exists);

	if($db->num_rows($query) == 0)
{
echo json_encode($lang->answer_valid_not_exists);

Zeile 832Zeile 884
		$validated = 0;

foreach($valid_answers as $answers)

		$validated = 0;

foreach($valid_answers as $answers)

		{

		{

			if(my_strtolower($answers) == my_strtolower($answer))
{
$validated = 1;
}
}

			if(my_strtolower($answers) == my_strtolower($answer))
{
$validated = 1;
}
}

		



		$plugins->run_hooks("xmlhttp_validate_question");

if($validated != 1)

		$plugins->run_hooks("xmlhttp_validate_question");

if($validated != 1)

		{

		{

			echo json_encode($lang->answer_does_not_match);

			echo json_encode($lang->answer_does_not_match);

			exit;
}

			exit;
}

		else
{
echo json_encode("true");
exit;
}

		else
{
echo json_encode("true");
exit;
}

	}

	}


exit;
}


exit;
}

Zeile 865Zeile 917
	$plugins->run_hooks("xmlhttp_complex_password");

if(!preg_match("/^.*(?=.{".$mybb->settings['minpasswordlength'].",})(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).*$/", $password))

	$plugins->run_hooks("xmlhttp_complex_password");

if(!preg_match("/^.*(?=.{".$mybb->settings['minpasswordlength'].",})(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).*$/", $password))

	{

	{

		echo json_encode($lang->complex_password_fails);

		echo json_encode($lang->complex_password_fails);

	}

	}

	else
{
// Return nothing but an OK password if passes regex

	else
{
// Return nothing but an OK password if passes regex

Zeile 877Zeile 929
	exit;
}
else if($mybb->input['action'] == "username_availability")

	exit;
}
else if($mybb->input['action'] == "username_availability")

{
if(!verify_post_check($mybb->get_input('my_post_key'), true))

{
if(!verify_post_check($mybb->get_input('my_post_key'), true))

	{
xmlhttp_error($lang->invalid_post_code);
}

	{
xmlhttp_error($lang->invalid_post_code);
}

Zeile 904Zeile 956
	// Check if the username belongs to the list of banned usernames.
$banned_username = is_banned_username($username, true);
if($banned_username)

	// Check if the username belongs to the list of banned usernames.
$banned_username = is_banned_username($username, true);
if($banned_username)

	{

	{

		echo json_encode($lang->banned_username);
exit;
}

		echo json_encode($lang->banned_username);
exit;
}

Zeile 930Zeile 982
	else
{
//$lang->username_available = $lang->sprintf($lang->username_available, htmlspecialchars_uni($username));

	else
{
//$lang->username_available = $lang->sprintf($lang->username_available, htmlspecialchars_uni($username));

		echo json_encode("true");

		echo json_encode("true");

		exit;

		exit;

	}

	}

}

}

else if($mybb->input['action'] == "username_exists")

else if($mybb->input['action'] == "email_availability")

{
if(!verify_post_check($mybb->get_input('my_post_key'), true))
{
xmlhttp_error($lang->invalid_post_code);
}


{
if(!verify_post_check($mybb->get_input('my_post_key'), true))
{
xmlhttp_error($lang->invalid_post_code);
}


	require_once MYBB_ROOT."inc/functions_user.php";
$username = $mybb->get_input('value');

header("Content-type: application/json; charset={$charset}");

	require_once MYBB_ROOT."inc/datahandlers/user.php";
$userhandler = new UserDataHandler("insert");

$email = $mybb->get_input('email');





	if(!trim($username))
{
echo json_encode(array("success" => 1));
exit;
}

// Check if the username actually exists
$user = get_user_by_username($username);

	header("Content-type: application/json; charset={$charset}");












	$plugins->run_hooks("xmlhttp_username_exists");














	$user = array(
'email' => $email
);

$userhandler->set_data($user);

$errors = array();

if(!$userhandler->verify_email())
{
$errors = $userhandler->get_friendly_errors();
}

$plugins->run_hooks("xmlhttp_email_availability");





	if($user['uid'])
{
$lang->valid_username = $lang->sprintf($lang->valid_username, htmlspecialchars_uni($username));
echo json_encode(array("success" => $lang->valid_username));

	if(!empty($errors))
{
echo json_encode($errors[0]);


		exit;
}
else
{

		exit;
}
else
{

		$lang->invalid_username = $lang->sprintf($lang->invalid_username, htmlspecialchars_uni($username));
echo json_encode($lang->invalid_username);

		echo json_encode("true");


		exit;
}
}

		exit;
}
}

Zeile 990Zeile 1046
		$offline = array();
while($buddy = $db->fetch_array($query))
{

		$offline = array();
while($buddy = $db->fetch_array($query))
{

 
			$buddy['username'] = htmlspecialchars_uni($buddy['username']);

			$buddy_name = format_name($buddy['username'], $buddy['usergroup'], $buddy['displaygroup']);
$profile_link = build_profile_link($buddy_name, $buddy['uid'], '_blank');
if($buddy['lastactive'] > $timecut && ($buddy['invisible'] == 0 || $mybb->user['usergroup'] == 4) && $buddy['lastvisit'] != $buddy['lastactive'])

			$buddy_name = format_name($buddy['username'], $buddy['usergroup'], $buddy['displaygroup']);
$profile_link = build_profile_link($buddy_name, $buddy['uid'], '_blank');
if($buddy['lastactive'] > $timecut && ($buddy['invisible'] == 0 || $mybb->user['usergroup'] == 4) && $buddy['lastvisit'] != $buddy['lastactive'])

Zeile 1018Zeile 1075
/**
* Spits an XML Http based error message back to the browser
*

/**
* Spits an XML Http based error message back to the browser
*

 * @param string The message to send back.

 * @param string $message The message to send back.

 */
function xmlhttp_error($message)
{

 */
function xmlhttp_error($message)
{