Vergleich inc/datahandlers/user.php - 1.4.0 - 1.4.5

  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 4052 2008-07-29 15:45:49Z 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 686Zeile 695

/**
* Verifies if an away mode status is valid or not.


/**
* Verifies if an away mode status is valid or not.

	 *

	 *

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

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

Zeile 696Zeile 705
		$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 715Zeile 724

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


/**
* Verifies if a langage 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_language()
{

	 */
function verify_language()
{

Zeile 764Zeile 773

// 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 784Zeile 793
		if($this->method == "insert" || array_key_exists('usertitle', $user))
{
$this->verify_usertitle();

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

		}

		}

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

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

		{

		{

			$this->verify_password();

			$this->verify_password();

		}

		}

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

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

Zeile 842Zeile 851
			$this->verify_away();
}
if($this->method == "insert" || array_key_exists('language', $user))

			$this->verify_away();
}
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();
}


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





		$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 972Zeile 987
			{
continue;
}

			{
continue;
}

			$user['user_fields']["ufid{$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 1003Zeile 1018
			die("The user needs to be validated before inserting it into the DB.");
}
if(count($this->get_errors()) > 0)

			die("The user needs to be validated before inserting it into the DB.");
}
if(count($this->get_errors()) > 0)

		{

		{

			die("The user is not valid.");
}


			die("The user is not valid.");
}


Zeile 1149Zeile 1164
		{
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) 
{
return false;

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

Zeile 1161Zeile 1179
		$db->update_query("users", $this->user_update_data, "uid='{$user['uid']}'");

$cache->update_moderators();

		$db->update_query("users", $this->user_update_data, "uid='{$user['uid']}'");

$cache->update_moderators();

 
		if(isset($user['bday']))
{
$cache->update_birthdays();
}


// Maybe some userfields need to be updated?
if(is_array($user['user_fields']))


// Maybe some userfields need to be updated?
if(is_array($user['user_fields']))

Zeile 1184Zeile 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.