Vergleich inc/datahandlers/user.php - 1.8.30 - 1.8.39

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 314Zeile 314
			return false;
}


			return false;
}


		return true;
}

/**
* Verifies if an ICQ number is valid or not.
*
* @return boolean True when valid, false when invalid.
*/
function verify_icq()
{
$icq = &$this->data['icq'];

if($icq != '' && !is_numeric($icq))
{
$this->set_error("invalid_icq_number");
return false;
}
$icq = (int)$icq;

 
		return true;
}


		return true;
}


Zeile 400Zeile 382
		elseif(($mybb->settings['coppa'] == "deny" && $birthday['year'] > (date("Y")-13)) && !is_moderator())
{
$this->set_error("invalid_birthday_coppa2");

		elseif(($mybb->settings['coppa'] == "deny" && $birthday['year'] > (date("Y")-13)) && !is_moderator())
{
$this->set_error("invalid_birthday_coppa2");

			return false;

			return false;

		}

// Make the user's birthday field

		}

// Make the user's birthday field

Zeile 464Zeile 446
		if(isset($user['postnum']) && $user['postnum'] < 0)
{
$this->set_error("invalid_postnum");

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

			return false;

			return false;

		}

		}





		return true;
}


		return true;
}


Zeile 480Zeile 462
		$user = &$this->data;

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

		$user = &$this->data;

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

		{

		{

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

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





		return true;
}


		return true;
}


Zeile 496Zeile 478
	function verify_profile_fields()
{
global $db, $cache;

	function verify_profile_fields()
{
global $db, $cache;





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


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


Zeile 528Zeile 510
					$additionalgroups = $user['additionalgroups'];
}
else

					$additionalgroups = $user['additionalgroups'];
}
else

				{

				{

					$additionalgroups = '';
}


					$additionalgroups = '';
}


Zeile 560Zeile 542
					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']));

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

					}

					}

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

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

Zeile 576Zeile 558
					foreach($profile_fields[$field] as $value)
{
if(!in_array(htmlspecialchars_uni($value), $expoptions))

					foreach($profile_fields[$field] as $value)
{
if(!in_array(htmlspecialchars_uni($value), $expoptions))

						{

						{

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

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

						}

						}

						if($options)
{
$options .= "\n";
}
$options .= $db->escape_string($value);

						if($options)
{
$options .= "\n";
}
$options .= $db->escape_string($value);

					}

					}

				}
elseif($type == "select" || $type == "radio")
{

				}
elseif($type == "select" || $type == "radio")
{

Zeile 593Zeile 575
					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

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

Zeile 633Zeile 615
		{
$referrer = get_user_by_username($user['referrer']);


		{
$referrer = get_user_by_username($user['referrer']);


			if(empty($referrer['uid']))

			if(!$referrer)

			{
$this->set_error('invalid_referrer', array($user['referrer']));
return false;

			{
$this->set_error('invalid_referrer', array($user['referrer']));
return false;

Zeile 851Zeile 833
		$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 || !isset($user['away']['away']) || $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 || !isset($user['away']['away']) || $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 865Zeile 847
			if($reasonlength > 200)
{
$this->set_error("away_too_long", array($reasonlength - 200));

			if($reasonlength > 200)
{
$this->set_error("away_too_long", array($reasonlength - 200));

				return false;
}


				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 883Zeile 865

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


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

	 *

	 *

	 * @return boolean True when valid, false when invalid.
*/
function verify_language()
{
global $lang;

	 * @return boolean True when valid, false when invalid.
*/
function verify_language()
{
global $lang;





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

// An invalid language has been specified?
if($language != '' && !$lang->language_exists($language))
{
$this->set_error("invalid_language");

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

// An invalid language has been specified?
if($language != '' && !$lang->language_exists($language))
{
$this->set_error("invalid_language");

			return false;
}
return true;
}

			return false;
}
return true;
}


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


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

Zeile 909Zeile 891
	function verify_style()
{
global $lang;

	function verify_style()
{
global $lang;





		$user = &$this->data;

if(!empty($user['style']))

		$user = &$this->data;

if(!empty($user['style']))

		{
$theme = get_theme($user['style']);


		{
$theme = get_theme($user['style']);


			if(empty($theme) || !is_member($theme['allowedgroups'], $user) && $theme['allowedgroups'] != 'all')
{
$this->set_error('invalid_style');

			if(empty($theme) || !is_member($theme['allowedgroups'], $user) && $theme['allowedgroups'] != 'all')
{
$this->set_error('invalid_style');

Zeile 963Zeile 945
			$user['timezone'] = $mybb->settings['timezoneoffset'];
return false;
}

			$user['timezone'] = $mybb->settings['timezoneoffset'];
return false;
}





		return true;
}


		return true;
}


Zeile 975Zeile 957
	function validate_user()
{
global $mybb, $plugins;

	function validate_user()
{
global $mybb, $plugins;





		$user = &$this->data;

// First, grab the old user details if this user exists
if(!empty($user['uid']))

		$user = &$this->data;

// First, grab the old user details if this user exists
if(!empty($user['uid']))

		{

		{

			$old_user = get_user($user['uid']);
}


			$old_user = get_user($user['uid']);
}


Zeile 1016Zeile 998
		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" || (isset($user['birthday']) && is_array($user['birthday'])))
{

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

Zeile 1044Zeile 1022
		if($this->method == "insert" || array_key_exists('options', $user))
{
$this->verify_options();

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

		}

		}

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

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

		{

		{

			$this->verify_regdate();

			$this->verify_regdate();

		}

		}

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

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

		{

		{

			$this->verify_lastvisit();

			$this->verify_lastvisit();

		}

		}

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

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

		{

		{

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

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

		}

		}

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

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

		{

		{

			$this->verify_language();

			$this->verify_language();

		}

		}

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

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

		{

		{

			$this->verify_timezone();

			$this->verify_timezone();

		}

		}

		if($this->method == "insert" && array_key_exists('regcheck1', $user) && array_key_exists('regcheck2', $user))

		if($this->method == "insert" && array_key_exists('regcheck1', $user) && array_key_exists('regcheck2', $user))

		{

		{

			$this->verify_checkfields();
}
if(array_key_exists('birthdayprivacy', $user))
{
$this->verify_birthday_privacy();

			$this->verify_checkfields();
}
if(array_key_exists('birthdayprivacy', $user))
{
$this->verify_birthday_privacy();

		}

		}

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

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

Zeile 1108Zeile 1086
	function insert_user()
{
global $db, $cache, $plugins;

	function insert_user()
{
global $db, $cache, $plugins;


// Yes, validating is required.
if(!$this->get_validated())
{
die("The user needs to be validated before inserting it into the DB.");


// Yes, validating is required.
if(!$this->get_validated())
{
die("The user needs to be validated before inserting it into the DB.");

		}
if(count($this->get_errors()) > 0)
{

		}
if(count($this->get_errors()) > 0)
{

Zeile 1121Zeile 1099

$user = &$this->data;



$user = &$this->data;


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

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

		foreach($array as $value)
{
if(!isset($user[$value]))

		foreach($array as $value)
{
if(!isset($user[$value]))

Zeile 1163Zeile 1141
			"lastactive" => (int)$user['lastactive'],
"lastvisit" => (int)$user['lastvisit'],
"website" => $db->escape_string($user['website']),

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

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

 
			"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 1372Zeile 1349
		if(isset($user['website']))
{
$this->user_update_data['website'] = $db->escape_string($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'];

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

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

Zeile 1411Zeile 1384
		}
if(isset($user['regip']))
{

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

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

			$this->user_update_data['regip'] = $db->escape_binary($user['regip']);

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

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

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

			$this->user_update_data['lastip'] = $db->escape_binary($user['lastip']);

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

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

Zeile 1451Zeile 1424
		$old_user = get_user($user['uid']);

// If old user has new pmnotice and new user has = yes, keep old value

		$old_user = get_user($user['uid']);

// If old user has new pmnotice and new user has = yes, keep old value

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

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

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

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

Zeile 1788Zeile 1761
		$update = array(
"website" => "",
"birthday" => "",

		$update = array(
"website" => "",
"birthday" => "",

			"icq" => "",

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

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