Vergleich inc/datahandlers/user.php - 1.4.1 - 1.4.6

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: user.php 4111 2008-08-13 06:14:12Z Tikitiki $

 * $Id: user.php 4338 2009-04-03 23:26:21Z Tikitiki $

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 253Zeile 253
		}

// Check signed up emails

		}

// Check signed up emails

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


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

		{
if(email_already_in_use($user['email'], $user['uid']))
{

		{
if(email_already_in_use($user['email'], $user['uid']))
{

Zeile 528Zeile 529
		$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);

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










		
if($mybb->settings['postlayout'] == 'classic')
{
$this->verify_yesno_option($options, 'classicpostbit', 1);
}
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 585Zeile 594
		}

// Verify the "threads per page" option.

		}

// Verify the "threads per page" option.

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

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

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

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

Zeile 679Zeile 688
		if($lastactive <= 0)
{
$lastactive = TIME_NOW;

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

		}
return true;

}

/**

		}
return true;

}

/**

	 * Verifies if an away mode status is valid or not.
*
* @return boolean True when valid, false when invalid.

	 * Verifies if an away mode status is valid or not.
*
* @return boolean True when valid, false when invalid.

Zeile 704Zeile 713
			return true;
}
else if($user['away']['returndate'])

			return true;
}
else if($user['away']['returndate'])

		{

		{

			list($returnday, $returnmonth, $returnyear) = explode('-', $user['away']['returndate']);
if(!$returnday || !$returnmonth || !$returnyear)
{
$this->set_error("missing_returndate");
}

			list($returnday, $returnmonth, $returnyear) = explode('-', $user['away']['returndate']);
if(!$returnday || !$returnmonth || !$returnyear)
{
$this->set_error("missing_returndate");
}

		}
}

/**

		}
}

/**

	 * Verifies if a langage is valid for this user or not.
*
* @return boolean True when valid, false when invalid.

	 * Verifies if a langage is valid for this user or not.
*
* @return boolean True when valid, false when invalid.

Zeile 733Zeile 742
		return true;
}


		return true;
}


	/**

	/**

	 * Verifies if this is coming from a spam bot or not
*
* @return boolean True when valid, false when invalid.

	 * Verifies if this is coming from a spam bot or not
*
* @return boolean True when valid, false when invalid.

Zeile 759Zeile 768
	function validate_user()
{
global $mybb, $plugins;

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


$user = &$this->data;



$user = &$this->data;


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

Zeile 790Zeile 799
			$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();

			$this->verify_usergroup();

		}

		}

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

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

		{

		{

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

			$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('icq', $user))

		{

		{

			$this->verify_icq();

			$this->verify_icq();

		}

		}

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

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

		{

		{

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

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

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

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

		{

		{

			$this->verify_away();

			$this->verify_away();

		}

		}

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

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


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





		
if(method_exists($plugins, "run_hooks_by_ref"))
{
$plugins->run_hooks_by_ref("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 958Zeile 970
		{
$this->user_insert_data['dst'] = 0;
}

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


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





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


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

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

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

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

Zeile 975Zeile 990
			$user['user_fields']["fid{$profile_field['fid']}"] = '';
}


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


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

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


// Update forum stats
update_stats(array('numusers' => '+1'));


// Update forum stats
update_stats(array('numusers' => '+1'));

Zeile 1072Zeile 1087
			$this->user_update_data['website'] = $db->escape_string(htmlspecialchars($user['website']));
}
if(isset($user['icq']))

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

		{

		{

			$this->user_update_data['icq'] = intval($user['icq']);

			$this->user_update_data['icq'] = intval($user['icq']);

		}

		}

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

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

		{

		{

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

			$this->user_update_data['aim'] = $db->escape_string(htmlspecialchars($user['aim']));
}
if(isset($user['yahoo']))
{
$this->user_update_data['yahoo'] = $db->escape_string(htmlspecialchars($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($user['msn']));

		}

		}

		if(isset($user['bday']))
{
$this->user_update_data['birthday'] = $user['bday'];
}
if(isset($user['birthdayprivacy']))

		if(isset($user['bday']))
{
$this->user_update_data['birthday'] = $user['bday'];
}
if(isset($user['birthdayprivacy']))

		{

		{

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

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

Zeile 1140Zeile 1155
		if(array_key_exists('coppa_user', $user))
{
$this->user_update_data['coppauser'] = intval($user['coppa_user']);

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

		}

		}

		// First, grab the old user details for later use.
$old_user = get_user($user['uid']);

// If old user has new pmnotice and new user has = yes, keep old value
if($old_user['pmnotice'] == "new" && $this->user_update_data['pmnotice'] == 1)

		// First, grab the old user details for later use.
$old_user = get_user($user['uid']);

// If old user has new pmnotice and new user has = yes, keep old value
if($old_user['pmnotice'] == "new" && $this->user_update_data['pmnotice'] == 1)

		{

		{

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

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


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




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

		
if(count($this->user_update_data) < 1)
{

		
if(count($this->user_update_data) < 1)
{

Zeile 1188Zeile 1206
				}
$db->insert_query("userfields", $user_fields);
}

				}
$db->insert_query("userfields", $user_fields);
}

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

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

		}

// Let's make sure the user's name gets changed everywhere in the db if it changed.

		}

// Let's make sure the user's name gets changed everywhere in the db if it changed.