Vergleich inc/datahandlers/user.php - 1.6.9 - 1.6.10

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
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 419Zeile 419
		}
return true;
}

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


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

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

Zeile 546Zeile 567
	* @return boolean True when valid, false when invalid.
*/
function verify_referrer()

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

	{

	{

		global $db, $mybb;

		global $db, $mybb;





		$user = &$this->data;

// Does the referrer exist or not?
if($mybb->settings['usereferrals'] == 1 && $user['referrer'] != '')

		$user = &$this->data;

// Does the referrer exist or not?
if($mybb->settings['usereferrals'] == 1 && $user['referrer'] != '')

		{

		{

			$query = $db->simple_select('users', 'uid', "username='".$db->escape_string($user['referrer'])."'", array('limit' => 1));
$referrer = $db->fetch_array($query);
if(!$referrer['uid'])
{
$this->set_error('invalid_referrer', array($user['referrer']));
return false;

			$query = $db->simple_select('users', 'uid', "username='".$db->escape_string($user['referrer'])."'", array('limit' => 1));
$referrer = $db->fetch_array($query);
if(!$referrer['uid'])
{
$this->set_error('invalid_referrer', array($user['referrer']));
return false;

			}
}

			}
}

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

return true;

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

return true;

Zeile 608Zeile 629
			if($options['subscriptionmethod'] < 0 || $options['subscriptionmethod'] > 2)
{
$options['subscriptionmethod'] = 0;

			if($options['subscriptionmethod'] < 0 || $options['subscriptionmethod'] > 2)
{
$options['subscriptionmethod'] = 0;

			}
}

			}
}


if(array_key_exists('dstcorrection', $options))
{


if(array_key_exists('dstcorrection', $options))
{

Zeile 673Zeile 694
		}
// Verify the "posts per page" option.
if($this->method == "insert" || (array_key_exists('ppp', $options) && $mybb->settings['userpppoptions']))

		}
// Verify the "posts per page" option.
if($this->method == "insert" || (array_key_exists('ppp', $options) && $mybb->settings['userpppoptions']))

		{

		{

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

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

Zeile 797Zeile 818
	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?

		if($language != '' && !$lang->language_exists($language))
{
$this->set_error("invalid_language");

		if($language != '' && !$lang->language_exists($language))
{
$this->set_error("invalid_language");

Zeile 815Zeile 836
	 * @return boolean True when valid, false when invalid.
*/
function verify_checkfields()

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

	{
$user = &$this->data;

	{
$user = &$this->data;

		
// An invalid language has been specified?
if($user['regcheck1'] !== "" || $user['regcheck2'] !== "true")

		
// An invalid language has been specified?
if($user['regcheck1'] !== "" || $user['regcheck2'] !== "true")

Zeile 840Zeile 861

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


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

		{

		{

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


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


Zeile 848Zeile 869
		{
// If the username is the same - no need to verify
if(!$old_user['username'] || $user['username'] != $old_user['username'])

		{
// If the username is the same - no need to verify
if(!$old_user['username'] || $user['username'] != $old_user['username'])

			{

			{

				$this->verify_username();
$this->verify_username_exists();

				$this->verify_username();
$this->verify_username_exists();

			}

			}

			else
{
unset($user['username']);
}

			else
{
unset($user['username']);
}

		}

		}

		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_password();

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

		}

		}

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

		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))

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

		{

		{

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

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

		}

		}

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

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

		{

		{

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

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

		}

		}

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

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

		{

		{

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

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

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

		{

		{

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

			$this->verify_referrer();
}
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();
}
if($this->method == "insert" || array_key_exists('lastvisit', $user))
{
$this->verify_lastvisit();

			$this->verify_regdate();
}
if($this->method == "insert" || array_key_exists('lastvisit', $user))
{
$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('regcheck1', $user) && array_key_exists('regcheck2', $user))

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

		{

		{

			$this->verify_checkfields();

			$this->verify_checkfields();

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

		}

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

		}

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

Zeile 979Zeile 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 1160Zeile 1185
		}
if(isset($user['website']))
{

		}
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']))
{

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

Zeile 1168Zeile 1193
		}
if(isset($user['aim']))
{

		}
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']))
{