Vergleich inc/datahandlers/user.php - 1.2.8 - 1.2.12

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

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

 * $Id: user.php 3030 2007-04-26 00:19:47Z Tikitiki $

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

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 69Zeile 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), chr(0xCA), dec_to_utf8(8238), dec_to_utf8(8237)), 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 96Zeile 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 116Zeile 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 213Zeile 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 400Zeile 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 888Zeile 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 983Zeile 983
		if(isset($user['bday']))
{
$this->user_update_data['birthday'] = $user['bday'];

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

		}

		}

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

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

		{

		{

			$this->user_update_data['timezone'] = $db->escape_string($user['timezone']);
}
if(isset($user['dateformat']))
{
$this->user_update_data['dateformat'] = $db->escape_string($user['dateformat']);

			$this->user_update_data['timezone'] = $db->escape_string($user['timezone']);
}
if(isset($user['dateformat']))
{
$this->user_update_data['dateformat'] = $db->escape_string($user['dateformat']);

		}

		}

		if(isset($user['timeformat']))
{
$this->user_update_data['timeformat'] = $db->escape_string($user['timeformat']);
}
if(isset($user['regip']))

		if(isset($user['timeformat']))
{
$this->user_update_data['timeformat'] = $db->escape_string($user['timeformat']);
}
if(isset($user['regip']))

		{

		{

			$this->user_update_data['regip'] = $db->escape_string($user['regip']);
}
if(isset($user['language']))
{
$this->user_update_data['language'] = $user['language'];

			$this->user_update_data['regip'] = $db->escape_string($user['regip']);
}
if(isset($user['language']))
{
$this->user_update_data['language'] = $user['language'];

		}

		}

		if(isset($user['away']))
{
$this->user_update_data['away'] = $user['away']['away'];

		if(isset($user['away']))
{
$this->user_update_data['away'] = $user['away']['away'];

Zeile 1016Zeile 1016
			$this->user_update_data['awayreason'] = $db->escape_string($user['away']['awayreason']);
}
if(isset($user['notepad']))

			$this->user_update_data['awayreason'] = $db->escape_string($user['away']['awayreason']);
}
if(isset($user['notepad']))

		{

		{

			$this->user_update_data['notepad'] = $db->escape_string($user['notepad']);
}
if(is_array($user['options']))

			$this->user_update_data['notepad'] = $db->escape_string($user['notepad']);
}
if(is_array($user['options']))

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

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

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

$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 1079Zeile 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"));
}

		}

}

		}

}