Vergleich inc/datahandlers/user.php - 1.6.2 - 1.6.12

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: user.php 5172 2010-08-02 23:13:03Z RyanGordon $

 * $Id$

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 70Zeile 70

// Fix bad characters
$username = trim_blank_chrs($username);


// Fix bad characters
$username = trim_blank_chrs($username);

		$username = str_replace(array(unicode_chr(160), unicode_chr(173), unicode_chr(0xCA), dec_to_utf8(8238), dec_to_utf8(8237), dec_to_utf8(8203)), array(" ", "-", "", "", "", ""), $username);

		$username = str_replace(array(unichr(160), unichr(173), unichr(0xCA), dec_to_utf8(8238), dec_to_utf8(8237), dec_to_utf8(8203)), array(" ", "-", "", "", "", ""), $username);


// Remove multiple spaces from the username
$username = preg_replace("#\s{2,}#", " ", $username);


// Remove multiple spaces from the username
$username = preg_replace("#\s{2,}#", " ", $username);

Zeile 90Zeile 90
		}

// Check for certain characters in username (<, >, &, commas and slashes)

		}

// Check for certain characters in username (<, >, &, commas and slashes)

		if(strpos($username, "<") !== false || strpos($username, ">") !== false || strpos($username, "&") !== false || my_strpos($username, "\\") !== false || strpos($username, ";") !== false || strpos($username, ",") !== false)

		if(strpos($username, "<") !== false || strpos($username, ">") !== false || strpos($username, "&") !== false || my_strpos($username, "\\") !== false || strpos($username, ";") !== false || strpos($username, ",") !== false || !validate_utf8_string($username, false, false))

		{
$this->set_error("bad_characters_username");
return false;

		{
$this->set_error("bad_characters_username");
return false;

Zeile 126Zeile 126

return true;
}


return true;
}

	



	/**
* Verifies if a username is already in use or not.
*

	/**
* Verifies if a username is already in use or not.
*

Zeile 136Zeile 136
	{
global $db;


	{
global $db;


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

$uid_check = "";

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

$uid_check = "";

		if($this->data['uid'])
{
$uid_check = " AND uid!='{$this->data['uid']}'";

		if($this->data['uid'])
{
$uid_check = " AND uid!='{$this->data['uid']}'";

		}

$query = $db->simple_select("users", "COUNT(uid) AS count", "LOWER(username)='".$db->escape_string(strtolower(trim($username)))."'{$uid_check}");


		}

$query = $db->simple_select("users", "COUNT(uid) AS count", "LOWER(username)='".$db->escape_string(strtolower(trim($username)))."'{$uid_check}");


		$user_count = $db->fetch_field($query, "count");
if($user_count > 0)
{
$this->set_error("username_exists", array($username));
return true;

		$user_count = $db->fetch_field($query, "count");
if($user_count > 0)
{
$this->set_error("username_exists", array($username));
return true;

		}

		}

		else
{
return false;

		else
{
return false;

Zeile 160Zeile 160

/**
* Verifies if a new password is valid or not.


/**
* Verifies if a new password is valid or not.

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

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

	*/
function verify_password()
{

	*/
function verify_password()
{

Zeile 183Zeile 183
			// First, see if there is one or more complex character(s) in the password.
if(!preg_match("/^.*(?=.{".$mybb->settings['minpasswordlength'].",})(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).*$/", $user['password']))
{

			// First, see if there is one or more complex character(s) in the password.
if(!preg_match("/^.*(?=.{".$mybb->settings['minpasswordlength'].",})(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).*$/", $user['password']))
{

				$this->set_error('no_complex_characters');

				$this->set_error('no_complex_characters', array($mybb->settings['minpasswordlength']));

				return false;
}
}

				return false;
}
}

Zeile 196Zeile 196
		}

// MD5 the password

		}

// MD5 the password

		$user['md5password'] = md5($user['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 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();


Zeile 212Zeile 212

/**
* Verifies usergroup selections and other group details.


/**
* Verifies usergroup selections and other group details.

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

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

	function verify_usergroup()
{
$user = &$this->data;

	function verify_usergroup()
{
$user = &$this->data;

Zeile 249Zeile 249
		if(is_banned_email($user['email'], true))
{
$this->set_error('banned_email');

		if(is_banned_email($user['email'], true))
{
$this->set_error('banned_email');

			return false;

			return false;

		}

		}

		



		// Check signed up emails
// Ignore the ACP because the Merge System sometimes produces users with duplicate email addresses (Not A Bug)
if($mybb->settings['allowmultipleemails'] == 0 && !defined("IN_ADMINCP"))

		// Check signed up emails
// Ignore the ACP because the Merge System sometimes produces users with duplicate email addresses (Not A Bug)
if($mybb->settings['allowmultipleemails'] == 0 && !defined("IN_ADMINCP"))

Zeile 261Zeile 261
				$this->set_error('email_already_in_use');
return false;
}

				$this->set_error('email_already_in_use');
return false;
}

		}


		}


		// If we have an "email2", verify it matches the existing email
if(isset($user['email2']) && $user['email'] != $user['email2'])
{
$this->set_error("emails_dont_match");

		// If we have an "email2", verify it matches the existing email
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 344Zeile 344

$user = &$this->data;
$birthday = &$user['birthday'];


$user = &$this->data;
$birthday = &$user['birthday'];





		if(!is_array($birthday))
{
return true;
}

		if(!is_array($birthday))
{
return true;
}





		// Sanitize any input we have
$birthday['day'] = intval($birthday['day']);
$birthday['month'] = intval($birthday['month']);

		// Sanitize any input we have
$birthday['day'] = intval($birthday['day']);
$birthday['month'] = intval($birthday['month']);

Zeile 359Zeile 359
		if($birthday['day'] != 0 || $birthday['month'] != 0)
{
if($birthday['day'] < 1 || $birthday['day'] > 31 || $birthday['month'] < 1 || $birthday['month'] > 12 || ($birthday['month'] == 2 && $birthday['day'] > 29))

		if($birthday['day'] != 0 || $birthday['month'] != 0)
{
if($birthday['day'] < 1 || $birthday['day'] > 31 || $birthday['month'] < 1 || $birthday['month'] > 12 || ($birthday['month'] == 2 && $birthday['day'] > 29))

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

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

		}

// Check if the day actually exists.
$months = get_bdays($birthday['year']);
if($birthday['day'] > $months[$birthday['month']-1])

		}

// Check if the day actually exists.
$months = get_bdays($birthday['year']);
if($birthday['day'] > $months[$birthday['month']-1])

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

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


// Error if a year exists and the year is out of range
if($birthday['year'] != 0 && ($birthday['year'] < (date("Y")-100)) || $birthday['year'] > date("Y"))


// Error if a year exists and the year is out of range
if($birthday['year'] != 0 && ($birthday['year'] < (date("Y")-100)) || $birthday['year'] > date("Y"))

Zeile 380Zeile 380
			return false;
}
else if($birthday['year'] == date("Y"))

			return false;
}
else if($birthday['year'] == date("Y"))

		{

		{

			// Error if birth date is in future
if($birthday['month'] > date("m") || ($birthday['month'] == date("m") && $birthday['day'] > date("d")))
{
$this->set_error("invalid_birthday");
return false;
}

			// Error if birth date is in future
if($birthday['month'] > date("m") || ($birthday['month'] == date("m") && $birthday['day'] > date("d")))
{
$this->set_error("invalid_birthday");
return false;
}

		}

		}


// Error if COPPA is on, and the user hasn't verified their age / under 13
if($mybb->settings['coppa'] == "enabled" && ($birthday['year'] == 0 || !$birthday['year']))


// Error if COPPA is on, and the user hasn't verified their age / under 13
if($mybb->settings['coppa'] == "enabled" && ($birthday['year'] == 0 || !$birthday['year']))

Zeile 395Zeile 395
			$this->set_error("invalid_birthday_coppa");
return false;
}

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

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

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

		{
$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)
{
// If the year is specified, put together a d-m-y string
$user['bday'] = $birthday['day']."-".$birthday['month']."-".$birthday['year'];


// Make the user's birthday field
if($birthday['year'] != 0)
{
// If the year is specified, put together a d-m-y string
$user['bday'] = $birthday['day']."-".$birthday['month']."-".$birthday['year'];

		}

		}

		elseif($birthday['day'] && $birthday['month'])

		elseif($birthday['day'] && $birthday['month'])

		{

		{

			// If only a day and month are specified, put together a d-m string
$user['bday'] = $birthday['day']."-".$birthday['month']."-";
}

			// If only a day and month are specified, put together a d-m string
$user['bday'] = $birthday['day']."-".$birthday['month']."-";
}

Zeile 416Zeile 416
		{
// 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;
}

/**
* Verifies if the birthday privacy option is valid or not.
*
* @return boolean True when valid, false when invalid.
*/
function verify_birthday_privacy()
{
$birthdayprivacy = &$this->data['birthdayprivacy'];
$accepted = array(
'none',
'age',
'all');

if(!in_array($birthdayprivacy, $accepted))
{
$this->set_error("invalid_birthday_privacy");
return false;
}

		return true;
}

		return true;
}

	



	/**
* Verifies if the post count field is filled in correctly.
*

	/**
* Verifies if the post count field is filled in correctly.
*

Zeile 428Zeile 449
	function verify_postnum()
{
$user = &$this->data;

	function verify_postnum()
{
$user = &$this->data;

		



		if($user['postnum'] < 0)
{
$this->set_error("invalid_postnum");
return false;

		if($user['postnum'] < 0)
{
$this->set_error("invalid_postnum");
return false;

		}

return true;
}


		}

return true;
}


	/**
* Verifies if a profile fields are filled in correctly.
*

	/**
* Verifies if a profile fields are filled in correctly.
*

Zeile 446Zeile 467
	function verify_profile_fields()
{
global $db;

	function verify_profile_fields()
{
global $db;


if($this->admin_override == true)
{
return true;
}

 

$user = &$this->data;
$profile_fields = &$this->data['profile_fields'];


$user = &$this->data;
$profile_fields = &$this->data['profile_fields'];

Zeile 459Zeile 475
		$userfields = array();
$comma = '';
$editable = '';

		$userfields = array();
$comma = '';
$editable = '';

		



		if(!$this->data['profile_fields_editable'])
{
$editable = "editable=1";

		if(!$this->data['profile_fields_editable'])
{
$editable = "editable=1";

Zeile 469Zeile 485
		$options = array(
'order_by' => 'disporder'
);

		$options = array(
'order_by' => 'disporder'
);

		$query = $db->simple_select('profilefields', 'name, type, fid, required', $editable, $options);

		$query = $db->simple_select('profilefields', 'name, type, fid, required, maxlength', $editable, $options);


// Then loop through the profile fields.
while($profilefield = $db->fetch_array($query))


// Then loop through the profile fields.
while($profilefield = $db->fetch_array($query))

Zeile 482Zeile 498
			// If the profile field is required, but not filled in, present error.
if($type != "multiselect" && $type != "checkbox")
{

			// If the profile field is required, but not filled in, present error.
if($type != "multiselect" && $type != "checkbox")
{

				if(trim($profile_fields[$field]) == "" && $profilefield['required'] == 1 && !defined('IN_ADMINCP'))

				if(trim($profile_fields[$field]) == "" && $profilefield['required'] == 1 && !defined('IN_ADMINCP') && THIS_SCRIPT != "modcp.php")

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

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

			elseif(($type == "multiselect" || $type == "checkbox") && $profile_fields[$field] == "" && $profilefield['required'] == 1 && !defined('IN_ADMINCP'))

			elseif(($type == "multiselect" || $type == "checkbox") && $profile_fields[$field] == "" && $profilefield['required'] == 1 && !defined('IN_ADMINCP') && THIS_SCRIPT != "modcp.php")

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

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

Zeile 495Zeile 511
			// Sort out multiselect/checkbox profile fields.
$options = '';
if(($type == "multiselect" || $type == "checkbox") && is_array($profile_fields[$field]))

			// Sort out multiselect/checkbox profile fields.
$options = '';
if(($type == "multiselect" || $type == "checkbox") && is_array($profile_fields[$field]))

			{

			{

				$expoptions = explode("\n", $thing[1]);
$expoptions = array_map('trim', $expoptions);
foreach($profile_fields[$field] as $value)

				$expoptions = explode("\n", $thing[1]);
$expoptions = array_map('trim', $expoptions);
foreach($profile_fields[$field] as $value)

Zeile 532Zeile 548
			}
else
{

			}
else
{

				$options = $db->escape_string($profile_fields[$field]);






				if($profilefield['maxlength'] > 0 && my_strlen($profile_fields[$field]) > $profilefield['maxlength'])
{
$this->set_error('max_limit_reached', array($profilefield['name'], $profilefield['maxlength']));
}

$options = $db->escape_string($profile_fields[$field]);

			}
$user['user_fields'][$field] = $options;
}

			}
$user['user_fields'][$field] = $options;
}

Zeile 563Zeile 584
			}
}
$user['referrer_uid'] = $referrer['uid'];

			}
}
$user['referrer_uid'] = $referrer['uid'];


return true;
}



return true;
}


	/**
* Verifies user options.
*

	/**
* Verifies user options.
*

Zeile 575Zeile 596
	function verify_options()
{
global $mybb;

	function verify_options()
{
global $mybb;

		



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

// Verify yes/no options.

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

// Verify yes/no options.

Zeile 591Zeile 612
		$this->verify_yesno_option($options, 'showavatars', 1);
$this->verify_yesno_option($options, 'showquickreply', 1);
$this->verify_yesno_option($options, 'showredirect', 1);

		$this->verify_yesno_option($options, 'showavatars', 1);
$this->verify_yesno_option($options, 'showquickreply', 1);
$this->verify_yesno_option($options, 'showredirect', 1);

		



		if($mybb->settings['postlayout'] == 'classic')

		if($mybb->settings['postlayout'] == 'classic')

		{

		{

			$this->verify_yesno_option($options, 'classicpostbit', 1);

			$this->verify_yesno_option($options, 'classicpostbit', 1);

		}

		}

		else
{
$this->verify_yesno_option($options, 'classicpostbit', 0);
}

		else
{
$this->verify_yesno_option($options, 'classicpostbit', 0);
}

		



		if(array_key_exists('subscriptionmethod', $options))
{
// Value out of range

		if(array_key_exists('subscriptionmethod', $options))
{
// Value out of range

Zeile 620Zeile 641
				$options['dstcorrection'] = 0;
}
}

				$options['dstcorrection'] = 0;
}
}

		



		if($options['dstcorrection'] == 1)
{
$options['dst'] = 1;

		if($options['dstcorrection'] == 1)
{
$options['dst'] = 1;

		}

		}

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

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

Zeile 642Zeile 663
        {
$options['showcodebuttons'] = 1;
}

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

		



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

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

Zeile 660Zeile 681
		{
$explodedtpp = explode(",", $mybb->settings['usertppoptions']);
if(is_array($explodedtpp))

		{
$explodedtpp = explode(",", $mybb->settings['usertppoptions']);
if(is_array($explodedtpp))

			{

			{

				@asort($explodedtpp);
$biggest = $explodedtpp[count($explodedtpp)-1];
// Is the selected option greater than the allowed options?

				@asort($explodedtpp);
$biggest = $explodedtpp[count($explodedtpp)-1];
// Is the selected option greater than the allowed options?

Zeile 713Zeile 734
		if($regdate <= 0)
{
$regdate = TIME_NOW;

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

		}

		}

		return true;
}

		return true;
}





	/**
* Verifies if a last visit date is valid or not.
*

	/**
* Verifies if a last visit date is valid or not.
*

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

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

		}

		}

		return true;

}

		return true;

}

Zeile 767Zeile 788
		$user = &$this->data;
// If the board does not allow "away mode" or the user is marking as not away, set defaults.
if($mybb->settings['allowaway'] == 0 || $user['away']['away'] != 1)

		$user = &$this->data;
// If the board does not allow "away mode" or the user is marking as not away, set defaults.
if($mybb->settings['allowaway'] == 0 || $user['away']['away'] != 1)

		{

		{

			$user['away']['away'] = 0;
$user['away']['date'] = 0;
$user['away']['returndate'] = 0;

			$user['away']['away'] = 0;
$user['away']['date'] = 0;
$user['away']['returndate'] = 0;

Zeile 782Zeile 803
				$this->set_error("missing_returndate");
return false;
}

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

			



			// 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;
}


Zeile 808Zeile 829
		}
return true;
}

		}
return true;
}

	



	/**
* Verifies if this is coming from a spam bot or not
*

	/**
* Verifies if this is coming from a spam bot or not
*

Zeile 817Zeile 838
	function verify_checkfields()
{
$user = &$this->data;

	function verify_checkfields()
{
$user = &$this->data;

		



		// An invalid language has been specified?
if($user['regcheck1'] !== "" || $user['regcheck2'] !== "true")
{
$this->set_error("invalid_checkfield");
return false;

		// An invalid language has been specified?
if($user['regcheck1'] !== "" || $user['regcheck2'] !== "true")
{
$this->set_error("invalid_checkfield");
return false;

		}

		}

		return true;
}


		return true;
}


Zeile 858Zeile 879
			}
}
if($this->method == "insert" || array_key_exists('usertitle', $user))

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

		{

		{

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

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

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

		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" || array_key_exists('icq', $user))
{
$this->verify_icq();

Zeile 894Zeile 915
			$this->verify_postnum();
}
if($this->method == "insert" || array_key_exists('profile_fields', $user))

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

		{

		{

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

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

Zeile 912Zeile 933
		if($this->method == "insert" || array_key_exists('lastvisit', $user))
{
$this->verify_lastvisit();

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

		}

		}

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

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

Zeile 929Zeile 950
		{
$this->verify_checkfields();
}

		{
$this->verify_checkfields();
}

		
if(method_exists($plugins, "run_hooks_by_ref"))

		if(array_key_exists('birthdayprivacy', $user))


		{

		{

			$plugins->run_hooks_by_ref("datahandler_user_validate", $this);

			$this->verify_birthday_privacy();

		}

		}

		




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


		// We are done validating, return.
$this->set_validated(true);
if(count($this->get_errors()) > 0)

		// We are done validating, return.
$this->set_validated(true);
if(count($this->get_errors()) > 0)

Zeile 982Zeile 1004
			"regdate" => intval($user['regdate']),
"lastactive" => intval($user['lastactive']),
"lastvisit" => intval($user['lastvisit']),

			"regdate" => intval($user['regdate']),
"lastactive" => intval($user['lastactive']),
"lastvisit" => intval($user['lastvisit']),

			"website" => $db->escape_string(htmlspecialchars($user['website'])),

			"website" => $db->escape_string(htmlspecialchars_uni($user['website'])),

			"icq" => intval($user['icq']),

			"icq" => intval($user['icq']),

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

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

			"birthday" => $user['bday'],
"signature" => $db->escape_string($user['signature']),
"allownotices" => $user['options']['allownotices'],

			"birthday" => $user['bday'],
"signature" => $db->escape_string($user['signature']),
"allownotices" => $user['options']['allownotices'],

Zeile 1034Zeile 1056
			"classicpostbit" => $user['options']['classicpostbit'],
"usernotes" => ''
);

			"classicpostbit" => $user['options']['classicpostbit'],
"usernotes" => ''
);

		



		if($user['options']['dstcorrection'] == 1)

		if($user['options']['dstcorrection'] == 1)

		{

		{

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

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

		}

		}

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

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


if(method_exists($plugins, "run_hooks_by_ref"))
{
$plugins->run_hooks_by_ref("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;

		



		$query = $db->simple_select("profilefields", "fid");
while($profile_field = $db->fetch_array($query))
{

		$query = $db->simple_select("profilefields", "fid");
while($profile_field = $db->fetch_array($query))
{

Zeile 1064Zeile 1083
		}

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

		}

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

		



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

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

Zeile 1114Zeile 1133
			$this->user_update_data['username'] = $db->escape_string($user['username']);
}
if(isset($user['saltedpw']))

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

		{

		{

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

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

		}

		}

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

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

		{

		{

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

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

Zeile 1128Zeile 1147
			$this->user_update_data['postnum'] = intval($user['postnum']);
}
if(isset($user['avatar']))

			$this->user_update_data['postnum'] = intval($user['postnum']);
}
if(isset($user['avatar']))

		{

		{

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

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

Zeile 1143Zeile 1162
		if(isset($user['displaygroup']))
{
$this->user_update_data['displaygroup'] = intval($user['displaygroup']);

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

		}

		}

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

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

		{

		{

			$this->user_update_data['usertitle'] = $db->escape_string(htmlspecialchars_uni($user['usertitle']));

			$this->user_update_data['usertitle'] = $db->escape_string(htmlspecialchars_uni($user['usertitle']));

		}

		}

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

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

		{

		{

			$this->user_update_data['regdate'] = intval($user['regdate']);
}
if(isset($user['lastactive']))

			$this->user_update_data['regdate'] = intval($user['regdate']);
}
if(isset($user['lastactive']))

Zeile 1157Zeile 1176
			$this->user_update_data['lastactive'] = intval($user['lastactive']);
}
if(isset($user['lastvisit']))

			$this->user_update_data['lastactive'] = intval($user['lastactive']);
}
if(isset($user['lastvisit']))

		{

		{

			$this->user_update_data['lastvisit'] = intval($user['lastvisit']);
}
if(isset($user['signature']))

			$this->user_update_data['lastvisit'] = intval($user['lastvisit']);
}
if(isset($user['signature']))

Zeile 1165Zeile 1184
			$this->user_update_data['signature'] = $db->escape_string($user['signature']);
}
if(isset($user['website']))

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

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

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

		if(isset($user['icq']))
{
$this->user_update_data['icq'] = intval($user['icq']);
}
if(isset($user['aim']))
{

		if(isset($user['icq']))
{
$this->user_update_data['icq'] = intval($user['icq']);
}
if(isset($user['aim']))
{

			$this->user_update_data['aim'] = $db->escape_string(htmlspecialchars($user['aim']));

			$this->user_update_data['aim'] = $db->escape_string(htmlspecialchars_uni($user['aim']));

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

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

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

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

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

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

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

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

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

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

Zeile 1191Zeile 1210
		if(isset($user['birthdayprivacy']))
{
$this->user_update_data['birthdayprivacy'] = $db->escape_string($user['birthdayprivacy']);

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

		}

		}

		if(isset($user['style']))
{
$this->user_update_data['style'] = intval($user['style']);
}
if(isset($user['timezone']))

		if(isset($user['style']))
{
$this->user_update_data['style'] = intval($user['style']);
}
if(isset($user['timezone']))

		{

		{

			$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']))

Zeile 1209Zeile 1228
			$this->user_update_data['timeformat'] = $db->escape_string($user['timeformat']);
}
if(isset($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']);

			$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']))
{
$this->user_update_data['away'] = $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['awayreason'] = $db->escape_string($user['away']['awayreason']);

		if(isset($user['away']))
{
$this->user_update_data['away'] = $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['awayreason'] = $db->escape_string($user['away']['awayreason']);

		}

		}

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

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

		{

		{

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

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

		}

		}

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

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

		{

		{

			foreach($user['options'] as $option => $value)
{
$this->user_update_data[$option] = $value;

			foreach($user['options'] as $option => $value)
{
$this->user_update_data[$option] = $value;

Zeile 1250Zeile 1269
		{
unset($this->user_update_data['pmnotice']);
}

		{
unset($this->user_update_data['pmnotice']);
}

		
if(method_exists($plugins, "run_hooks_by_ref"))
{
$plugins->run_hooks_by_ref("datahandler_user_update", $this);
}

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


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

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





if(count($this->user_update_data) > 0)
{
// Actual updating happens here.
$db->update_query("users", $this->user_update_data, "uid='{$user['uid']}'");
}


if(count($this->user_update_data) > 0)
{
// Actual updating happens here.
$db->update_query("users", $this->user_update_data, "uid='{$user['uid']}'");
}

		



		$cache->update_moderators();

		$cache->update_moderators();

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

		if(isset($user['bday']) || isset($user['username']))

		{
$cache->update_birthdays();
}

		{
$cache->update_birthdays();
}

Zeile 1312Zeile 1328
			$db->update_query("threads", $username_update, "uid='{$user['uid']}'");
$db->update_query("threads", $lastposter_update, "lastposteruid='{$user['uid']}'");
$db->update_query("forums", $lastposter_update, "lastposteruid='{$user['uid']}'");

			$db->update_query("threads", $username_update, "uid='{$user['uid']}'");
$db->update_query("threads", $lastposter_update, "lastposteruid='{$user['uid']}'");
$db->update_query("forums", $lastposter_update, "lastposteruid='{$user['uid']}'");

			



			$stats = $cache->read("stats");
if($stats['lastuid'] == $user['uid'])
{

			$stats = $cache->read("stats");
if($stats['lastuid'] == $user['uid'])
{