Vergleich inc/datahandlers/user.php - 1.8.8 - 1.8.22

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

// Has the user tried to use their email address or username as a password?

		}

// Has the user tried to use their email address or username as a password?

		if($user['email'] === $user['password'] || $user['username'] === $user['password'])

		if(!empty($user['email']) && !empty($user['username']))

		{

		{

			$this->set_error('bad_password_security');
return false;






			if($user['email'] === $user['password'] || $user['username'] === $user['password']
|| strpos($user['password'], $user['email']) !== false || strpos($user['password'], $user['username']) !== false
|| strpos($user['email'], $user['password']) !== false || strpos($user['username'], $user['password']) !== false)
{
$this->set_error('bad_password_security');
return false;
}

		}

// See if the board has "require complex passwords" enabled.

		}

// See if the board has "require complex passwords" enabled.

Zeile 211Zeile 216
			$this->set_error("passwords_dont_match");
return false;
}

			$this->set_error("passwords_dont_match");
return false;
}


// MD5 the password
$user['md5password'] = md5($user['password']);

// Generate our salt
$user['salt'] = generate_salt();

// Combine the password and salt
$user['saltedpw'] = salt_password($user['md5password'], $user['salt']);

 

// Generate the user login key
$user['loginkey'] = generate_loginkey();



// Generate the user login key
$user['loginkey'] = generate_loginkey();


 
		// Combine the password and salt
$password_fields = create_password($user['password'], false, $user);
$user = array_merge($user, $password_fields);

return true;
}

/**
* Verifies usergroup selections and other group details.
*
* @return boolean True when valid, false when invalid.
*/
function verify_usergroup()
{

		return true;
}

		return true;
}



 
	/**

	/**

	* Verifies usergroup selections and other group details.

	* Verifies if an email address is valid or not.

	*
* @return boolean True when valid, false when invalid.
*/

	*
* @return boolean True when valid, false when invalid.
*/

	function verify_usergroup()

	function verify_email()

	{

	{

		return true;
}
/**
* Verifies if an email address is valid or not.
*
* @return boolean True when valid, false when invalid.
*/
function verify_email()
{
global $mybb;


		global $mybb;











		$user = &$this->data;

// Check if an email address has actually been entered.

		$user = &$this->data;

// Check if an email address has actually been entered.

Zeile 288Zeile 288
		if(isset($user['email2']) && $user['email'] != $user['email2'])
{
$this->set_error("emails_dont_match");

		if(isset($user['email2']) && $user['email'] != $user['email2'])
{
$this->set_error("emails_dont_match");

			return false;
}

return true;
}

/**

			return false;
}

return true;
}

/**

	* Verifies if a website is valid or not.
*
* @return boolean True when valid, false when invalid.

	* Verifies if a website is valid or not.
*
* @return boolean True when valid, false when invalid.

Zeile 381Zeile 381
			$this->set_error("invalid_birthday");
return false;
}

			$this->set_error("invalid_birthday");
return false;
}

		else if($birthday['year'] == date("Y"))

		elseif($birthday['year'] == date("Y"))

		{
// Error if birth date is in future
if($birthday['month'] > date("m") || ($birthday['month'] == date("m") && $birthday['day'] > date("d")))

		{
// Error if birth date is in future
if($birthday['month'] > date("m") || ($birthday['month'] == date("m") && $birthday['day'] > date("d")))

Zeile 395Zeile 395
		if($mybb->settings['coppa'] == "enabled" && ($birthday['year'] == 0 || !$birthday['year']))
{
$this->set_error("invalid_birthday_coppa");

		if($mybb->settings['coppa'] == "enabled" && ($birthday['year'] == 0 || !$birthday['year']))
{
$this->set_error("invalid_birthday_coppa");

			return false;

			return false;

		}
elseif(($mybb->settings['coppa'] == "deny" && $birthday['year'] > (date("Y")-13)) && !is_moderator())

		}
elseif(($mybb->settings['coppa'] == "deny" && $birthday['year'] > (date("Y")-13)) && !is_moderator())

		{

		{

			$this->set_error("invalid_birthday_coppa2");
return false;

			$this->set_error("invalid_birthday_coppa2");
return false;

		}

		}


// Make the user's birthday field
if($birthday['year'] != 0)


// Make the user's birthday field
if($birthday['year'] != 0)

Zeile 418Zeile 418
		{
// No field is specified, so return an empty string for an unknown birthday
$user['bday'] = '';

		{
// No field is specified, so return an empty string for an unknown birthday
$user['bday'] = '';

		}
return true;

		}
return true;

	}

/**

	}

/**

Zeile 467Zeile 467
	* @return boolean True when valid, false when invalid.
*/
function verify_threadnum()

	* @return boolean True when valid, false when invalid.
*/
function verify_threadnum()

	{
$user = &$this->data;

	{
$user = &$this->data;


if(isset($user['threadnum']) && $user['threadnum'] < 0)
{


if(isset($user['threadnum']) && $user['threadnum'] < 0)
{

Zeile 567Zeile 567
					if(!in_array(htmlspecialchars_uni($profile_fields[$field]), $expoptions) && trim($profile_fields[$field]) != "")
{
$this->set_error('bad_profile_field_values', array($profilefield['name']));

					if(!in_array(htmlspecialchars_uni($profile_fields[$field]), $expoptions) && trim($profile_fields[$field]) != "")
{
$this->set_error('bad_profile_field_values', array($profilefield['name']));

					}

					}

					$options = $db->escape_string($profile_fields[$field]);
}
else
{
if($profilefield['maxlength'] > 0 && my_strlen($profile_fields[$field]) > $profilefield['maxlength'])

					$options = $db->escape_string($profile_fields[$field]);
}
else
{
if($profilefield['maxlength'] > 0 && my_strlen($profile_fields[$field]) > $profilefield['maxlength'])

					{

					{

						$this->set_error('max_limit_reached', array($profilefield['name'], $profilefield['maxlength']));

						$this->set_error('max_limit_reached', array($profilefield['name'], $profilefield['maxlength']));

					}

if(!empty($profilefield['regex']) && !preg_match("#".$profilefield['regex']."#i", $profile_fields[$field]))

					}

if(!empty($profilefield['regex']) && !empty($profile_fields[$field]) && !preg_match("#".$profilefield['regex']."#i", $profile_fields[$field]))

					{
$this->set_error('bad_profile_field_value', array($profilefield['name']));
}

					{
$this->set_error('bad_profile_field_value', array($profilefield['name']));
}

Zeile 593Zeile 593

/**
* Verifies if an optionally entered referrer exists or not.


/**
* Verifies if an optionally entered referrer exists or not.

	*
* @return boolean True when valid, false when invalid.
*/

	*
* @return boolean True when valid, false when invalid.
*/

	function verify_referrer()
{
global $db, $mybb;

	function verify_referrer()
{
global $db, $mybb;

Zeile 686Zeile 686
		{
$options['dst'] = 1;
}

		{
$options['dst'] = 1;
}

		else if($options['dstcorrection'] == 0)

		elseif($options['dstcorrection'] == 0)

		{
$options['dst'] = 0;
}

if($this->method == "insert" || (isset($options['threadmode']) && $options['threadmode'] != "linear" && $options['threadmode'] != "threaded"))

		{
$options['dst'] = 0;
}

if($this->method == "insert" || (isset($options['threadmode']) && $options['threadmode'] != "linear" && $options['threadmode'] != "threaded"))

		{

		{

			if($mybb->settings['threadusenetstyle'])
{
$options['threadmode'] = 'threaded';
}
else

			if($mybb->settings['threadusenetstyle'])
{
$options['threadmode'] = 'threaded';
}
else

			{

			{

				$options['threadmode'] = 'linear';
}
}

				$options['threadmode'] = 'linear';
}
}

Zeile 707Zeile 707
		if($this->method == "insert" || (array_key_exists('tpp', $options) && $mybb->settings['usertppoptions']))
{
if(!isset($options['tpp']))

		if($this->method == "insert" || (array_key_exists('tpp', $options) && $mybb->settings['usertppoptions']))
{
if(!isset($options['tpp']))

			{

			{

				$options['tpp'] = 0;
}
$explodedtpp = explode(",", $mybb->settings['usertppoptions']);

				$options['tpp'] = 0;
}
$explodedtpp = explode(",", $mybb->settings['usertppoptions']);

Zeile 717Zeile 717
				$biggest = $explodedtpp[count($explodedtpp)-1];
// Is the selected option greater than the allowed options?
if($options['tpp'] > $biggest)

				$biggest = $explodedtpp[count($explodedtpp)-1];
// Is the selected option greater than the allowed options?
if($options['tpp'] > $biggest)

				{

				{

					$options['tpp'] = $biggest;
}
}

					$options['tpp'] = $biggest;
}
}

Zeile 791Zeile 791
		if($lastvisit <= 0)
{
$lastvisit = TIME_NOW;

		if($lastvisit <= 0)
{
$lastvisit = TIME_NOW;

		}
return true;

}

/**

		}
return true;

}

/**

	 * Verifies if a last active date is valid or not.

	 * Verifies if a last active date is valid or not.

	 *
* @return boolean True when valid, false when invalid.
*/

	 *
* @return boolean True when valid, false when invalid.
*/

	function verify_lastactive()
{
$lastactive = &$this->data['lastactive'];

	function verify_lastactive()
{
$lastactive = &$this->data['lastactive'];

Zeile 812Zeile 812
			$lastactive = TIME_NOW;
}
return true;

			$lastactive = TIME_NOW;
}
return true;





	}

/**

	}

/**

Zeile 821Zeile 821
	 * @return boolean True when valid, false when invalid.
*/
function verify_away()

	 * @return boolean True when valid, false when invalid.
*/
function verify_away()

	{

	{

		global $mybb;

$user = &$this->data;

		global $mybb;

$user = &$this->data;

Zeile 834Zeile 834
			$user['away']['awayreason'] = '';
return true;
}

			$user['away']['awayreason'] = '';
return true;
}

		else if($user['away']['returndate'])

		elseif($user['away']['returndate'])

		{

		{

 
			// Validate the awayreason length, since the db holds 200 chars for this field
$reasonlength = my_strlen($user['away']['awayreason']);
if($reasonlength > 200)
{
$this->set_error("away_too_long", array($reasonlength - 200));
return false;
}


			list($returnday, $returnmonth, $returnyear) = explode('-', $user['away']['returndate']);
if(!$returnday || !$returnmonth || !$returnyear)
{

			list($returnday, $returnmonth, $returnyear) = explode('-', $user['away']['returndate']);
if(!$returnday || !$returnmonth || !$returnyear)
{

Zeile 845Zeile 853

// Validate the return date lengths
$user['away']['returndate'] = substr($returnday, 0, 2).'-'.substr($returnmonth, 0, 2).'-'.substr($returnyear, 0, 4);


// Validate the return date lengths
$user['away']['returndate'] = substr($returnday, 0, 2).'-'.substr($returnmonth, 0, 2).'-'.substr($returnyear, 0, 4);

		}
return true;
}

		}
return true;
}


/**
* Verifies if a language is valid for this user or not.


/**
* Verifies if a language is valid for this user or not.

Zeile 857Zeile 865
	function verify_language()
{
global $lang;

	function verify_language()
{
global $lang;





		$language = &$this->data['language'];

// An invalid language has been specified?

		$language = &$this->data['language'];

// An invalid language has been specified?

Zeile 871Zeile 879

/**
* Verifies if a style is valid for this user or not.


/**
* Verifies if a style is valid for this user or not.

	 *
* @return boolean True when valid, false when invalid.

	 *
* @return boolean True when valid, false when invalid.

	 */
function verify_style()
{

	 */
function verify_style()
{

Zeile 919Zeile 927
	 * @return boolean True when timezone was valid, false otherwise
*/
function verify_timezone()

	 * @return boolean True when timezone was valid, false otherwise
*/
function verify_timezone()

	{
$user = &$this->data;

$timezones = get_supported_timezones();

	{
$user = &$this->data;

$timezones = get_supported_timezones();


if(!array_key_exists($user['timezone'], $timezones))
{


if(!array_key_exists($user['timezone'], $timezones))
{

Zeile 972Zeile 980
			$this->verify_password();
}
if($this->method == "insert" || array_key_exists('usergroup', $user))

			$this->verify_password();
}
if($this->method == "insert" || array_key_exists('usergroup', $user))

		{

		{

			$this->verify_usergroup();
}
if($this->method == "insert" || array_key_exists('email', $user))
{
$this->verify_email();

			$this->verify_usergroup();
}
if($this->method == "insert" || array_key_exists('email', $user))
{
$this->verify_email();

		}

		}

		if($this->method == "insert" || array_key_exists('website', $user))
{
$this->verify_website();
}
if($this->method == "insert" || array_key_exists('icq', $user))

		if($this->method == "insert" || array_key_exists('website', $user))
{
$this->verify_website();
}
if($this->method == "insert" || array_key_exists('icq', $user))

		{

		{

			$this->verify_icq();
}
if($this->method == "insert" || (isset($user['birthday']) && is_array($user['birthday'])))
{
$this->verify_birthday();

			$this->verify_icq();
}
if($this->method == "insert" || (isset($user['birthday']) && is_array($user['birthday'])))
{
$this->verify_birthday();

		}

		}

		if($this->method == "insert" || array_key_exists('postnum', $user))
{
$this->verify_postnum();
}
if($this->method == "insert" || array_key_exists('threadnum', $user))

		if($this->method == "insert" || array_key_exists('postnum', $user))
{
$this->verify_postnum();
}
if($this->method == "insert" || array_key_exists('threadnum', $user))

		{

		{

			$this->verify_threadnum();
}
if($this->method == "insert" || array_key_exists('profile_fields', $user))

			$this->verify_threadnum();
}
if($this->method == "insert" || array_key_exists('profile_fields', $user))

Zeile 1046Zeile 1054
		if($this->method == "insert" || array_key_exists('style', $user))
{
$this->verify_style();

		if($this->method == "insert" || array_key_exists('style', $user))
{
$this->verify_style();

		}

		}

		if($this->method == "insert" || array_key_exists('signature', $user))
{
$this->verify_signature();

		if($this->method == "insert" || array_key_exists('signature', $user))
{
$this->verify_signature();

Zeile 1087Zeile 1095

$user = &$this->data;



$user = &$this->data;


		$array = array('postnum', 'threadnum', 'avatar', 'avatartype', 'additionalgroups', 'displaygroup', 'icq', 'aim', 'yahoo', 'skype', 'google', 'bday', 'signature', 'style', 'dateformat', 'timeformat', 'notepad');

		$array = array('postnum', 'threadnum', 'avatar', 'avatartype', 'additionalgroups', 'displaygroup', 'icq', 'skype', 'google', 'bday', 'signature', 'style', 'dateformat', 'timeformat', 'notepad');

		foreach($array as $value)
{
if(!isset($user[$value]))
{
$user[$value] = '';
}

		foreach($array as $value)
{
if(!isset($user[$value]))
{
$user[$value] = '';
}

 
		}

// If user is being created from ACP, there is no last visit or last active
if(defined('IN_ADMINCP'))
{
$user['lastvisit'] = $user['lastactive'] = 0;

		}

$this->user_insert_data = array(
"username" => $db->escape_string($user['username']),

		}

$this->user_insert_data = array(
"username" => $db->escape_string($user['username']),

			"password" => $user['saltedpw'],

			"password" => $user['password'],

			"salt" => $user['salt'],
"loginkey" => $user['loginkey'],
"email" => $db->escape_string($user['email']),

			"salt" => $user['salt'],
"loginkey" => $user['loginkey'],
"email" => $db->escape_string($user['email']),

Zeile 1115Zeile 1129
			"lastvisit" => (int)$user['lastvisit'],
"website" => $db->escape_string($user['website']),
"icq" => (int)$user['icq'],

			"lastvisit" => (int)$user['lastvisit'],
"website" => $db->escape_string($user['website']),
"icq" => (int)$user['icq'],

			"aim" => $db->escape_string($user['aim']),
"yahoo" => $db->escape_string($user['yahoo']),

 
			"skype" => $db->escape_string($user['skype']),
"google" => $db->escape_string($user['google']),
"birthday" => $user['bday'],

			"skype" => $db->escape_string($user['skype']),
"google" => $db->escape_string($user['google']),
"birthday" => $user['bday'],

Zeile 1174Zeile 1186
		if($user['options']['dstcorrection'] == 1)
{
$this->user_insert_data['dst'] = 1;

		if($user['options']['dstcorrection'] == 1)
{
$this->user_insert_data['dst'] = 1;

		}
else if($user['options']['dstcorrection'] == 0)
{

		}
elseif($user['options']['dstcorrection'] == 0)
{

			$this->user_insert_data['dst'] = 0;

			$this->user_insert_data['dst'] = 0;

		}

$plugins->run_hooks("datahandler_user_insert", $this);

		}

$plugins->run_hooks("datahandler_user_insert", $this);


$this->uid = $db->insert_query("users", $this->user_insert_data);


$this->uid = $db->insert_query("users", $this->user_insert_data);





		$user['user_fields']['ufid'] = $this->uid;

		$user['user_fields']['ufid'] = $this->uid;





		$pfcache = $cache->read('profilefields');

if(is_array($pfcache))

		$pfcache = $cache->read('profilefields');

if(is_array($pfcache))

Zeile 1197Zeile 1209
					continue;
}
$user['user_fields']["fid{$profile_field['fid']}"] = '';

					continue;
}
$user['user_fields']["fid{$profile_field['fid']}"] = '';

			}
}

$db->insert_query("userfields", $user['user_fields'], false);

			}
}

$db->insert_query("userfields", $user['user_fields'], false);


if($this->user_insert_data['referrer'] != 0)
{


if($this->user_insert_data['referrer'] != 0)
{

Zeile 1250Zeile 1262
		if(count($this->get_errors()) > 0)
{
die("The user is not valid.");

		if(count($this->get_errors()) > 0)
{
die("The user is not valid.");

		}

		}


$user = &$this->data;
$user['uid'] = (int)$user['uid'];


$user = &$this->data;
$user['uid'] = (int)$user['uid'];

Zeile 1260Zeile 1272
		if(isset($user['username']))
{
$this->user_update_data['username'] = $db->escape_string($user['username']);

		if(isset($user['username']))
{
$this->user_update_data['username'] = $db->escape_string($user['username']);

		}
if(isset($user['saltedpw']))
{
$this->user_update_data['password'] = $user['saltedpw'];




		}
if(isset($user['password']))
{
$this->user_update_data['password'] = $user['password'];
}
if(isset($user['salt']))
{

			$this->user_update_data['salt'] = $user['salt'];

			$this->user_update_data['salt'] = $user['salt'];

 
		}
if(isset($user['loginkey']))
{

			$this->user_update_data['loginkey'] = $user['loginkey'];
}
if(isset($user['email']))

			$this->user_update_data['loginkey'] = $user['loginkey'];
}
if(isset($user['email']))

		{
$this->user_update_data['email'] = $user['email'];

		{
$this->user_update_data['email'] = $db->escape_string($user['email']);

		}
if(isset($user['postnum']))

		}
if(isset($user['postnum']))

		{

		{

			$this->user_update_data['postnum'] = (int)$user['postnum'];
}
if(isset($user['threadnum']))
{
$this->user_update_data['threadnum'] = (int)$user['threadnum'];

			$this->user_update_data['postnum'] = (int)$user['postnum'];
}
if(isset($user['threadnum']))
{
$this->user_update_data['threadnum'] = (int)$user['threadnum'];

		}

		}

		if(isset($user['avatar']))
{
$this->user_update_data['avatar'] = $db->escape_string($user['avatar']);
$this->user_update_data['avatartype'] = $db->escape_string($user['avatartype']);
}
if(isset($user['usergroup']))

		if(isset($user['avatar']))
{
$this->user_update_data['avatar'] = $db->escape_string($user['avatar']);
$this->user_update_data['avatartype'] = $db->escape_string($user['avatartype']);
}
if(isset($user['usergroup']))

		{

		{

			$this->user_update_data['usergroup'] = (int)$user['usergroup'];
}
if(isset($user['additionalgroups']))
{
$this->user_update_data['additionalgroups'] = $db->escape_string($user['additionalgroups']);

			$this->user_update_data['usergroup'] = (int)$user['usergroup'];
}
if(isset($user['additionalgroups']))
{
$this->user_update_data['additionalgroups'] = $db->escape_string($user['additionalgroups']);

		}

		}

		if(isset($user['displaygroup']))
{
$this->user_update_data['displaygroup'] = (int)$user['displaygroup'];
}
if(isset($user['usertitle']))

		if(isset($user['displaygroup']))
{
$this->user_update_data['displaygroup'] = (int)$user['displaygroup'];
}
if(isset($user['usertitle']))

		{

		{

			$this->user_update_data['usertitle'] = $db->escape_string($user['usertitle']);
}
if(isset($user['regdate']))
{
$this->user_update_data['regdate'] = (int)$user['regdate'];

			$this->user_update_data['usertitle'] = $db->escape_string($user['usertitle']);
}
if(isset($user['regdate']))
{
$this->user_update_data['regdate'] = (int)$user['regdate'];

		}

		}

		if(isset($user['lastactive']))

		if(isset($user['lastactive']))

		{

		{

			$this->user_update_data['lastactive'] = (int)$user['lastactive'];

			$this->user_update_data['lastactive'] = (int)$user['lastactive'];

		}

		}

		if(isset($user['lastvisit']))
{
$this->user_update_data['lastvisit'] = (int)$user['lastvisit'];

		if(isset($user['lastvisit']))
{
$this->user_update_data['lastvisit'] = (int)$user['lastvisit'];

Zeile 1315Zeile 1333
		if(isset($user['signature']))
{
$this->user_update_data['signature'] = $db->escape_string($user['signature']);

		if(isset($user['signature']))
{
$this->user_update_data['signature'] = $db->escape_string($user['signature']);

		}

		}

		if(isset($user['website']))

		if(isset($user['website']))

		{

		{

			$this->user_update_data['website'] = $db->escape_string($user['website']);
}
if(isset($user['icq']))
{
$this->user_update_data['icq'] = (int)$user['icq'];

			$this->user_update_data['website'] = $db->escape_string($user['website']);
}
if(isset($user['icq']))
{
$this->user_update_data['icq'] = (int)$user['icq'];

		}
if(isset($user['aim']))
{
$this->user_update_data['aim'] = $db->escape_string($user['aim']);
}
if(isset($user['yahoo']))
{
$this->user_update_data['yahoo'] = $db->escape_string($user['yahoo']);

 
		}
if(isset($user['skype']))
{

		}
if(isset($user['skype']))
{

Zeile 1357Zeile 1367
			$this->user_update_data['timezone'] = $db->escape_string($user['timezone']);
}
if(isset($user['dateformat']))

			$this->user_update_data['timezone'] = $db->escape_string($user['timezone']);
}
if(isset($user['dateformat']))

		{

		{

			$this->user_update_data['dateformat'] = $db->escape_string($user['dateformat']);
}
if(isset($user['timeformat']))

			$this->user_update_data['dateformat'] = $db->escape_string($user['dateformat']);
}
if(isset($user['timeformat']))

		{

		{

			$this->user_update_data['timeformat'] = $db->escape_string($user['timeformat']);
}
if(isset($user['regip']))
{
$this->user_update_data['regip'] = $db->escape_string($user['regip']);

			$this->user_update_data['timeformat'] = $db->escape_string($user['timeformat']);
}
if(isset($user['regip']))
{
$this->user_update_data['regip'] = $db->escape_string($user['regip']);

		}

		}

		if(isset($user['language']))
{
$this->user_update_data['language'] = $db->escape_string($user['language']);
}
if(isset($user['away']))

		if(isset($user['language']))
{
$this->user_update_data['language'] = $db->escape_string($user['language']);
}
if(isset($user['away']))

		{

		{

			$this->user_update_data['away'] = (int)$user['away']['away'];
$this->user_update_data['awaydate'] = $db->escape_string($user['away']['date']);
$this->user_update_data['returndate'] = $db->escape_string($user['away']['returndate']);

			$this->user_update_data['away'] = (int)$user['away']['away'];
$this->user_update_data['awaydate'] = $db->escape_string($user['away']['date']);
$this->user_update_data['returndate'] = $db->escape_string($user['away']['returndate']);

Zeile 1382Zeile 1392
		if(isset($user['notepad']))
{
$this->user_update_data['notepad'] = $db->escape_string($user['notepad']);

		if(isset($user['notepad']))
{
$this->user_update_data['notepad'] = $db->escape_string($user['notepad']);

		}

		}

		if(isset($user['usernotes']))

		if(isset($user['usernotes']))

		{

		{

			$this->user_update_data['usernotes'] = $db->escape_string($user['usernotes']);
}
if(isset($user['options']) && is_array($user['options']))

			$this->user_update_data['usernotes'] = $db->escape_string($user['usernotes']);
}
if(isset($user['options']) && is_array($user['options']))

Zeile 1393Zeile 1403
			{
$this->user_update_data[$option] = $value;
}

			{
$this->user_update_data[$option] = $value;
}

		}

		}

		if(array_key_exists('coppa_user', $user))
{
$this->user_update_data['coppauser'] = (int)$user['coppa_user'];

		if(array_key_exists('coppa_user', $user))
{
$this->user_update_data['coppauser'] = (int)$user['coppa_user'];

Zeile 1405Zeile 1415
		if($old_user['pmnotice'] == "2" && $this->user_update_data['pmnotice'] == 1)
{
unset($this->user_update_data['pmnotice']);

		if($old_user['pmnotice'] == "2" && $this->user_update_data['pmnotice'] == 1)
{
unset($this->user_update_data['pmnotice']);

		}

$plugins->run_hooks("datahandler_user_update", $this);

		}

$plugins->run_hooks("datahandler_user_update", $this);


if(count($this->user_update_data) < 1 && empty($user['user_fields']))
{


if(count($this->user_update_data) < 1 && empty($user['user_fields']))
{

Zeile 1452Zeile 1462
					$user_fields[$field['Field']] = '';
}
$db->insert_query("userfields", $user_fields);

					$user_fields[$field['Field']] = '';
}
$db->insert_query("userfields", $user_fields);

			}

			}

			$db->update_query("userfields", $user['user_fields'], "ufid='{$user['uid']}'", false);
}


			$db->update_query("userfields", $user['user_fields'], "ufid='{$user['uid']}'", false);
}


Zeile 1476Zeile 1486
			{
// User was latest to register, update stats
update_stats(array("numusers" => "+0"));

			{
// User was latest to register, update stats
update_stats(array("numusers" => "+0"));

			}
}


			}
}


		return true;
}

		return true;
}





	/**
* Provides a method to completely delete a user.
*

	/**
* Provides a method to completely delete a user.
*

Zeile 1497Zeile 1507
		if(count($this->get_errors()) > 0)
{
die('The user is not valid.');

		if(count($this->get_errors()) > 0)
{
die('The user is not valid.');

		}

$this->delete_uids = array_map('intval', (array)$delete_uids);


		}

$this->delete_uids = array_map('intval', (array)$delete_uids);


		foreach($this->delete_uids as $key => $uid)
{
if(!$uid || is_super_admin($uid) || $uid == $mybb->user['uid'])

		foreach($this->delete_uids as $key => $uid)
{
if(!$uid || is_super_admin($uid) || $uid == $mybb->user['uid'])

Zeile 1509Zeile 1519
				unset($this->delete_uids[$key]);
}
}

				unset($this->delete_uids[$key]);
}
}





		$plugins->run_hooks('datahandler_user_delete_start', $this);

$this->delete_uids = implode(',', $this->delete_uids);

		$plugins->run_hooks('datahandler_user_delete_start', $this);

$this->delete_uids = implode(',', $this->delete_uids);

Zeile 1522Zeile 1532
			);

return $this->return_values;

			);

return $this->return_values;

		}

$this->delete_content();

		}

$this->delete_content();


// Delete the user
$query = $db->delete_query('users', "uid IN({$this->delete_uids})");


// Delete the user
$query = $db->delete_query('users', "uid IN({$this->delete_uids})");

Zeile 1548Zeile 1558

$db->update_query('privatemessages', array('fromid' => 0), "fromid IN({$this->delete_uids})");
$db->update_query('users', array('referrer' => 0), "referrer IN({$this->delete_uids})");


$db->update_query('privatemessages', array('fromid' => 0), "fromid IN({$this->delete_uids})");
$db->update_query('users', array('referrer' => 0), "referrer IN({$this->delete_uids})");





		// Update thread ratings
$query = $db->query("
SELECT r.*, t.numratings, t.totalratings

		// Update thread ratings
$query = $db->query("
SELECT r.*, t.numratings, t.totalratings

Zeile 1586Zeile 1596
		$cache->update_forumsdisplay();
$cache->update_reportedcontent();
$cache->update_awaitingactivation();

		$cache->update_forumsdisplay();
$cache->update_reportedcontent();
$cache->update_awaitingactivation();

 
		$cache->update_birthdays();


return $this->return_values;
}


return $this->return_values;
}

Zeile 1596Zeile 1607
	 * @param array|bool $delete_uids Array of user ids, false if they're already set (eg when using the delete_user function)
*/
function delete_content($delete_uids=false)

	 * @param array|bool $delete_uids Array of user ids, false if they're already set (eg when using the delete_user function)
*/
function delete_content($delete_uids=false)

	{
global $db, $plugins, $mybb;

if($delete_uids != false)
{
$this->delete_uids = array_map('intval', (array)$delete_uids);

foreach($this->delete_uids as $key => $uid)
{
if(!$uid || is_super_admin($uid) || $uid == $mybb->user['uid'])
{

	{
global $db, $plugins, $mybb;

if($delete_uids != false)
{
$this->delete_uids = array_map('intval', (array)$delete_uids);

foreach($this->delete_uids as $key => $uid)
{
if(!$uid || is_super_admin($uid) || $uid == $mybb->user['uid'])
{

					// Remove super admins
unset($this->delete_uids[$key]);
}

					// Remove super admins
unset($this->delete_uids[$key]);
}

Zeile 1650Zeile 1661

// Update the reports made by the deleted users by setting the uid to 0
$db->update_query('reportedcontent', array('uid' => 0), "uid IN({$this->delete_uids})");


// Update the reports made by the deleted users by setting the uid to 0
$db->update_query('reportedcontent', array('uid' => 0), "uid IN({$this->delete_uids})");


// Remove any of the user(s) uploaded avatars
require_once MYBB_ROOT.'inc/functions_upload.php';
foreach(explode(',', $this->delete_uids) as $uid)
{
remove_avatars($uid);
}


// Remove any of the user(s) uploaded avatars
require_once MYBB_ROOT.'inc/functions_upload.php';
foreach(explode(',', $this->delete_uids) as $uid)
{
remove_avatars($uid);
}

	}

/**

	}

/**

Zeile 1665Zeile 1676
	 * @param array|bool $delete_uids Array of user ids, false if they're already set (eg when using the delete_user function)
*/
function delete_posts($delete_uids=false)

	 * @param array|bool $delete_uids Array of user ids, false if they're already set (eg when using the delete_user function)
*/
function delete_posts($delete_uids=false)

	{
global $db, $plugins, $mybb;

if($delete_uids != false)
{
$this->delete_uids = array_map('intval', (array)$delete_uids);

foreach($this->delete_uids as $key => $uid)
{
if(!$uid || is_super_admin($uid) || $uid == $mybb->user['uid'])
{
// Remove super admins
unset($this->delete_uids[$key]);
}
}

$this->delete_uids = implode(',', $this->delete_uids);

	{
global $db, $plugins, $mybb;

if($delete_uids != false)
{
$this->delete_uids = array_map('intval', (array)$delete_uids);

foreach($this->delete_uids as $key => $uid)
{
if(!$uid || is_super_admin($uid) || $uid == $mybb->user['uid'])
{
// Remove super admins
unset($this->delete_uids[$key]);
}
}

$this->delete_uids = implode(',', $this->delete_uids);

		}

require_once MYBB_ROOT.'inc/class_moderation.php';
$moderation = new Moderation();

$plugins->run_hooks('datahandler_user_delete_posts', $this);

		}

require_once MYBB_ROOT.'inc/class_moderation.php';
$moderation = new Moderation();

$plugins->run_hooks('datahandler_user_delete_posts', $this);





		if(empty($this->delete_uids))
{
return;

		if(empty($this->delete_uids))
{
return;

Zeile 1697Zeile 1708
		// Threads
$query = $db->simple_select('threads', 'tid', "uid IN({$this->delete_uids})");
while($tid = $db->fetch_field($query, 'tid'))

		// Threads
$query = $db->simple_select('threads', 'tid', "uid IN({$this->delete_uids})");
while($tid = $db->fetch_field($query, 'tid'))

		{

		{

			$moderation->delete_thread($tid);
}


			$moderation->delete_thread($tid);
}


Zeile 1706Zeile 1717
		while($pid = $db->fetch_field($query, 'pid'))
{
$moderation->delete_post($pid);

		while($pid = $db->fetch_field($query, 'pid'))
{
$moderation->delete_post($pid);

		}

		}

	}

/**

	}

/**

Zeile 1740Zeile 1751
			"website" => "",
"birthday" => "",
"icq" => "",

			"website" => "",
"birthday" => "",
"icq" => "",

			"aim" => "",
"yahoo" => "",

 
			"skype" => "",
"google" => "",
"usertitle" => "",

			"skype" => "",
"google" => "",
"usertitle" => "",

Zeile 1758Zeile 1767
		);

if($gid > 0)

		);

if($gid > 0)

		{

		{

			$update["usergroup"] = (int)$gid;

			$update["usergroup"] = (int)$gid;

		}

$plugins->run_hooks('datahandler_user_clear_profile', $this);

		}

$plugins->run_hooks('datahandler_user_clear_profile', $this);


if(empty($this->delete_uids))


if(empty($this->delete_uids))

		{

		{

			return;

			return;

		}


		}


		$db->update_query("users", $update, "uid IN({$this->delete_uids})");
$db->delete_query('userfields', "ufid IN({$this->delete_uids})");

		$db->update_query("users", $update, "uid IN({$this->delete_uids})");
$db->delete_query('userfields', "ufid IN({$this->delete_uids})");





		// Remove any of the user(s) uploaded avatars
require_once MYBB_ROOT.'inc/functions_upload.php';
foreach(explode(',', $this->delete_uids) as $uid)

		// Remove any of the user(s) uploaded avatars
require_once MYBB_ROOT.'inc/functions_upload.php';
foreach(explode(',', $this->delete_uids) as $uid)

Zeile 1783Zeile 1792
	public function verify_signature()
{
global $mybb, $parser;

	public function verify_signature()
{
global $mybb, $parser;





		if(!isset($parser))
{
require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;
}

		if(!isset($parser))
{
require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;
}





		$parser_options = array(
'allow_html' => $mybb->settings['sightml'],
'filter_badwords' => 1,

		$parser_options = array(
'allow_html' => $mybb->settings['sightml'],
'filter_badwords' => 1,

Zeile 1798Zeile 1807
			'allow_imgcode' => $mybb->settings['sigimgcode'],
"filter_badwords" => 1
);

			'allow_imgcode' => $mybb->settings['sigimgcode'],
"filter_badwords" => 1
);





		$parsed_sig = $parser->parse_message($this->data['signature'], $parser_options);

if((($mybb->settings['sigimgcode'] == 0 && $mybb->settings['sigsmilies'] != 1) &&

		$parsed_sig = $parser->parse_message($this->data['signature'], $parser_options);

if((($mybb->settings['sigimgcode'] == 0 && $mybb->settings['sigsmilies'] != 1) &&

Zeile 1808Zeile 1817
		)
{
$imgsallowed = 0;

		)
{
$imgsallowed = 0;

			



			if($mybb->settings['sigimgcode'] == 1)
{
$imgsallowed = $mybb->settings['maxsigimages'];

			if($mybb->settings['sigimgcode'] == 1)
{
$imgsallowed = $mybb->settings['maxsigimages'];

Zeile 1819Zeile 1828

if($mybb->settings['sigcountmycode'] == 0)
{


if($mybb->settings['sigcountmycode'] == 0)
{

			$parsed_sig = $parser->text_parse_message($this->data['signature']);

			$parsed_sig = $parser->text_parse_message($this->data['signature'], array('signature_parse' => '1'));

		}
else
{

		}
else
{