Vergleich inc/datahandlers/user.php - 1.2.3 - 1.2.13

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 3Zeile 3
 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * Website: http://www.mybboard.com
* License: http://www.mybboard.com/eula.html

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html

 *

 *

 * $Id: user.php 2663 2007-01-21 18:30:14Z Tikitiki $

 * $Id: user.php 3514 2007-11-24 09:02:58Z Tikitiki $

 */

 */

 

// Disallow direct access to this file for security reasons
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}


/**
* User handling class, provides common structure to handle user data.


/**
* User handling class, provides common structure to handle user data.

Zeile 63Zeile 69
		require_once MYBB_ROOT.'inc/functions_user.php';

// Fix bad characters

		require_once MYBB_ROOT.'inc/functions_user.php';

// Fix bad characters

		$username = str_replace(array(chr(160), chr(173)), array(" ", "-"), $username);


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


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

// Check if the username is not empty.


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

// Check if the username is not empty.

		if(trim($username) == '')

		if($username == '')

		{
$this->set_error('missing_username');
return false;

		{
$this->set_error('missing_username');
return false;

Zeile 90Zeile 97
		}

// Check if the username is of the correct length.

		}

// Check if the username is of the correct length.

		if(($mybb->settings['maxnamelength'] != 0 && my_strlen($username) > $mybb->settings['maxnamelength']) || ($mybb->settings['minnamelength'] != 0 && my_strlen($username) < $mybb->settings['minnamelength']) && !$bannedusername && !$missingname)

		if(($mybb->settings['maxnamelength'] != 0 && my_strlen($username) > $mybb->settings['maxnamelength']) || ($mybb->settings['minnamelength'] != 0 && my_strlen($username) < $mybb->settings['minnamelength']))

		{
$this->set_error('invalid_username_length', array($mybb->settings['minnamelength'], $mybb->settings['maxnamelength']));
return false;

		{
$this->set_error('invalid_username_length', array($mybb->settings['minnamelength'], $mybb->settings['maxnamelength']));
return false;

Zeile 110Zeile 117

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



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


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

		$query = $db->simple_select(TABLE_PREFIX."users", "COUNT(uid) AS count", "LOWER(username)='".$db->escape_string(strtolower(trim($username)))."' AND uid!='{$this->data['uid']}'");

		$user_count = $db->fetch_field($query, "count");
if($user_count > 0)
{

		$user_count = $db->fetch_field($query, "count");
if($user_count > 0)
{

Zeile 207Zeile 214
		}

// Check if this is a proper email address.

		}

// Check if this is a proper email address.

		if(validate_email_format($user['email']) === false)

		if(!validate_email_format($user['email']))

		{
$this->set_error('invalid_email_format');
return false;

		{
$this->set_error('invalid_email_format');
return false;

Zeile 394Zeile 401
			$field = "fid{$profilefield['fid']}";

// If the profile field is required, but not filled in, present error.

			$field = "fid{$profilefield['fid']}";

// If the profile field is required, but not filled in, present error.

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

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

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

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

Zeile 410Zeile 417
					if(!in_array($value, $expoptions))
{
$this->set_error('bad_profile_field_values', array($profilefield['name']));

					if(!in_array($value, $expoptions))
{
$this->set_error('bad_profile_field_values', array($profilefield['name']));

					}

					}

					if($options)
{
$options .= "\n";

					if($options)
{
$options .= "\n";

Zeile 481Zeile 488
		$this->verify_yesno_option($options, 'allownotices', 'yes');
$this->verify_yesno_option($options, 'hideemail', 'no');
$this->verify_yesno_option($options, 'emailnotify', 'no');

		$this->verify_yesno_option($options, 'allownotices', 'yes');
$this->verify_yesno_option($options, 'hideemail', 'no');
$this->verify_yesno_option($options, 'emailnotify', 'no');

 
		$this->verify_yesno_option($options, 'emailpmnotify', 'no');

		$this->verify_yesno_option($options, 'receivepms', 'yes');
$this->verify_yesno_option($options, 'pmpopup', 'yes');
$this->verify_yesno_option($options, 'pmnotify', 'yes');

		$this->verify_yesno_option($options, 'receivepms', 'yes');
$this->verify_yesno_option($options, 'pmpopup', 'yes');
$this->verify_yesno_option($options, 'pmnotify', 'yes');

Zeile 863Zeile 871
		$db->insert_query(TABLE_PREFIX."userfields", $user['user_fields']);

// Update forum stats

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

// Update forum stats

		$cache->updatestats();

		update_stats(array('numusers' => '+1'));


return array(
"uid" => $this->uid,


return array(
"uid" => $this->uid,

Zeile 881Zeile 889
	function update_user()
{
global $db, $plugins;

	function update_user()
{
global $db, $plugins;



 

// Yes, validating is required.
if(!$this->get_validated())


// Yes, validating is required.
if(!$this->get_validated())

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

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

			$this->user_update_data['language'] = $user['language'];

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

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

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

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

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

 

global $cache;
$stats = $cache->read("stats");
if($stats['lastuid'] == $user['uid'])
{
// User was latest to register, update stats
update_stats(array("numusers" => "+0"));
}

		}

}

		}

}