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

  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 3006 2007-04-11 06:14:56Z 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 959Zeile 959
		if(isset($user['signature']))
{
$this->user_update_data['signature'] = $db->escape_string($user['signature']);

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

		}

		}

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

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

		{

		{

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

			$this->user_update_data['icq'] = intval($user['icq']);
}
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']));
}
if(isset($user['msn']))

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

		{

		{

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

			$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['style']))
{
$this->user_update_data['style'] = intval($user['style']);

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

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

		}

}

		}

}