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

  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 2194 2006-09-03 12:46:22Z chris $

 * $Id: user.php 3030 2007-04-26 00:19:47Z 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 31Zeile 37
	
/**
* Array of data inserted in to a user.

	
/**
* Array of data inserted in to a user.

	 *
* @var array

	 *
* @var array

	 */
var $user_insert_data = array();

/**
* Array of data used to update a user.

	 */
var $user_insert_data = array();

/**
* Array of data used to update a user.

	 *

	 *

	 * @var array
*/
var $user_update_data = array();

	 * @var array
*/
var $user_update_data = array();

Zeile 57Zeile 63
	 */
function verify_username()
{

	 */
function verify_username()
{

 
		global $mybb;


		$username = &$this->data['username'];
require_once MYBB_ROOT.'inc/functions_user.php';

// Fix bad characters

		$username = &$this->data['username'];
require_once MYBB_ROOT.'inc/functions_user.php';

// Fix bad characters

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

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


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


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

Zeile 74Zeile 82
		}

// Check if the username belongs to the list of banned usernames.

		}

// Check if the username belongs to the list of banned usernames.

		$bannedusernames = get_banned_usernames();
if(in_array($username, $bannedusernames))

		if(is_banned_username($username))


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

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

Zeile 109Zeile 116

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



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


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

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

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

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

Zeile 163Zeile 170
		$user['md5password'] = md5($user['password']);

// Generate our salt

		$user['md5password'] = md5($user['password']);

// Generate our salt

		$user['salt'] = generate_salt();





		if(!$user['salt'])
{
$user['salt'] = generate_salt();
}


		// Combine the password and salt
$user['saltedpw'] = salt_password($user['md5password'], $user['salt']);

		// Combine the password and salt
$user['saltedpw'] = salt_password($user['md5password'], $user['salt']);





		// Generate the user login key
$user['loginkey'] = generate_loginkey();

		// Generate the user login key
$user['loginkey'] = generate_loginkey();


return true;
}

/**


return true;
}

/**

	* Verifies usergroup selections and other group details.
*
* @return boolean True when valid, false when invalid.
*/
function verify_usergroup()

	* Verifies usergroup selections and other group details.
*
* @return boolean True when valid, false when invalid.
*/
function verify_usergroup()

	{
$user = &$this->data;
return true;
}
/**

	{
$user = &$this->data;
return true;
}
/**

	* Verifies if an email address is valid or not.
*
* @return boolean True when valid, false when invalid.
*/
function verify_email()
{

	* Verifies if an email address is valid or not.
*
* @return boolean True when valid, false when invalid.
*/
function verify_email()
{

 
		global $mybb;


		$user = &$this->data;

// Check if an email address has actually been entered.

		$user = &$this->data;

// Check if an email address has actually been entered.

Zeile 204Zeile 216
		if(validate_email_format($user['email']) === false)
{
$this->set_error('invalid_email_format');

		if(validate_email_format($user['email']) === false)
{
$this->set_error('invalid_email_format');

			return false;
}

			return false;
}


// Check banned emails


// Check banned emails

		$bannedemails = explode(" ", $mybb->settings['bannedemails']);
if(is_array($bannedemails))
{
foreach($bannedemails as $bannedemail)
{
$bannedemail = strtolower(trim($bannedemail));
if($bannedemail != '')
{
if(strstr($user['email'], $bannedemail) != '')
{
$this->set_error('banned_email');
return false;
}
}
}

		if(is_banned_email($user['email']))
{
$this->set_error('banned_email');
return false;












		}

// If we have an "email2", verify it matches the existing email

		}

// If we have an "email2", verify it matches the existing email

Zeile 230Zeile 231
		{
$this->set_error("emails_dont_match");
return false;

		{
$this->set_error("emails_dont_match");
return false;

		}

		}

	}

	}





	/**
* Verifies if a website is valid or not.
*

	/**
* Verifies if a website is valid or not.
*

Zeile 241Zeile 242
	function verify_website()
{
$website = &$this->data['website'];

	function verify_website()
{
$website = &$this->data['website'];





		if($website == '' || $website == 'http://')
{
$website = '';

		if($website == '' || $website == 'http://')
{
$website = '';

Zeile 265Zeile 266

/**
* Verifies if an ICQ number is valid or not.


/**
* Verifies if an ICQ number is valid or not.

	 *

	 *

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

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

Zeile 278Zeile 279
			return false;
}
$icq = intval($icq);

			return false;
}
$icq = intval($icq);

		return true;
}

		return true;
}


/**
* Verifies if an MSN Messenger address is valid or not.


/**
* Verifies if an MSN Messenger address is valid or not.

Zeile 293Zeile 294
		if($msn != '' && validate_email_format($msn) == false)
{
$this->set_error("invalid_msn_address");

		if($msn != '' && validate_email_format($msn) == false)
{
$this->set_error("invalid_msn_address");

			return false;

			return false;

		}
return true;
}

		}
return true;
}

Zeile 307Zeile 308
	{
$user = &$this->data;
$birthday = &$user['birthday'];

	{
$user = &$this->data;
$birthday = &$user['birthday'];





		if(!is_array($birthday))
{
return true;
}

		if(!is_array($birthday))
{
return true;
}





		// Sanitize any input we have
$birthday['day'] = intval($birthday['day']);
$birthday['month'] = intval($birthday['month']);

		// Sanitize any input we have
$birthday['day'] = intval($birthday['day']);
$birthday['month'] = intval($birthday['month']);

Zeile 320Zeile 321

// Error if a day and month exists, and the birthday day and range is not in range
if($birthday['day'] && $birthday['month'])


// Error if a day and month exists, and the birthday day and range is not in range
if($birthday['day'] && $birthday['month'])

		{ 

		{ 

			if($birthday['day'] < 1 || $birthday['day'] > 31 || $birthday['month'] < 1 || $birthday['month'] > 12 || ($birthday['month'] == 2 && $birthday['day'] > 29))

			if($birthday['day'] < 1 || $birthday['day'] > 31 || $birthday['month'] < 1 || $birthday['month'] > 12 || ($birthday['month'] == 2 && $birthday['day'] > 29))

			{
$this->set_error("invalid_birthday");
return false;

			{
$this->set_error("invalid_birthday");
return false;

			}

// Check if the day actually exists.

			}

// Check if the day actually exists.

Zeile 334Zeile 335
				$this->set_error("invalid_birthday");
return false;
}

				$this->set_error("invalid_birthday");
return false;
}

		}

		}

				
// Error if a year exists and the year is out of range
if($birthday['year'] != 0 && ($birthday['year'] < (date("Y")-100)) || $birthday['year'] > date("Y"))

				
// Error if a year exists and the year is out of range
if($birthday['year'] != 0 && ($birthday['year'] < (date("Y")-100)) || $birthday['year'] > date("Y"))

		{

		{ 

			$this->set_error("invalid_birthday");
return false;
}

			$this->set_error("invalid_birthday");
return false;
}

Zeile 348Zeile 349
		{
// If the year is specified, put together a d-m-y string
$user['bday'] = $birthday['day']."-".$birthday['month']."-".$birthday['year'];

		{
// If the year is specified, put together a d-m-y string
$user['bday'] = $birthday['day']."-".$birthday['month']."-".$birthday['year'];

		}

		}

		elseif($birthday['day'] && $birthday['month'])
{
// If only a day and month are specified, put together a d-m string

		elseif($birthday['day'] && $birthday['month'])
{
// If only a day and month are specified, put together a d-m string

			$user['bday'] = $birthday['day']."-".$birthday['month'];

			$user['bday'] = $birthday['day']."-".$birthday['month']."-";

		}
else
{

		}
else
{

Zeile 377Zeile 378
		// Loop through profile fields checking if they exist or not and are filled in.
$userfields = array();
$comma = '';

		// Loop through profile fields checking if they exist or not and are filled in.
$userfields = array();
$comma = '';

 
		$editable = '';

if(!$this->data['profile_fields_editable'])
{
$editable = "editable='yes'";
}


// Fetch all profile fields first.
$options = array(
'order_by' => 'disporder'
);


// Fetch all profile fields first.
$options = array(
'order_by' => 'disporder'
);

		$query = $db->simple_select(TABLE_PREFIX.'profilefields', 'name, type, fid, required', "editable='yes'", $options);

		$query = $db->simple_select(TABLE_PREFIX.'profilefields', 'name, type, fid, required', $editable, $options);


// Then loop through the profile fields.
while($profilefield = $db->fetch_array($query))


// Then loop through the profile fields.
while($profilefield = $db->fetch_array($query))

Zeile 390Zeile 397
			$profilefield['type'] = htmlspecialchars_uni($profilefield['type']);
$thing = explode("\n", $profilefield['type'], "2");
$type = trim($thing[0]);

			$profilefield['type'] = htmlspecialchars_uni($profilefield['type']);
$thing = explode("\n", $profilefield['type'], "2");
$type = trim($thing[0]);

			$field = "fid$profilefield[fid]";

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


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


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

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

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

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

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

Zeile 421Zeile 428
			{
$expoptions = explode("\n", $thing[1]);
$expoptions = array_map('trim', $expoptions);

			{
$expoptions = explode("\n", $thing[1]);
$expoptions = array_map('trim', $expoptions);

				if(!in_array($profile_fields[$field], $expoptions) && $profile_fields[$field] != "")

				if(!in_array(htmlspecialchars_uni($profile_fields[$field]), $expoptions) && $profile_fields[$field] != "")

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

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

Zeile 444Zeile 451
	*/
function verify_referrer()
{

	*/
function verify_referrer()
{

		global $db;

		global $db, $mybb;


$user = &$this->data;



$user = &$this->data;


Zeile 460Zeile 467
			{
$this->set_error('invalid_referrer', array($user['referrer']));
return false;

			{
$this->set_error('invalid_referrer', array($user['referrer']));
return false;

			}
}

			}
}

		$user['referrer_uid'] = $referrer['uid'];

return true;

		$user['referrer_uid'] = $referrer['uid'];

return true;

Zeile 480Zeile 487
		$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 491Zeile 499
		$this->verify_yesno_option($options, 'showquickreply', 'yes');
$this->verify_yesno_option($options, 'showredirect', 'yes');


		$this->verify_yesno_option($options, 'showquickreply', 'yes');
$this->verify_yesno_option($options, 'showredirect', 'yes');


		if($this->method == "insert" || (array_key_exists('showcodebuttons', $options) && $options['showcodebuttons'] != 0))
{
$options['showcodebuttons'] = 1;
}










		if(isset($options['showcodebuttons']))
{
$options['showcodebuttons'] = intval($options['showcodebuttons']);
if($options['showcodebuttons'] != 0)
{
$options['showcodebuttons'] = 1;
}
}
else if($this->method == "insert")
{
$options['showcodebuttons'] = 1;
}


		if($this->method == "insert" || (isset($options['threadmode']) && $options['threadmode'] != "threaded"))
{
$options['threadmode'] = 'linear';

		if($this->method == "insert" || (isset($options['threadmode']) && $options['threadmode'] != "threaded"))
{
$options['threadmode'] = 'linear';

		}

		}


// Verify the "threads per page" option.
if($this->method == "insert" || (array_key_exists('tpp', $options) && $mybb->settings['usetppoptions']))


// Verify the "threads per page" option.
if($this->method == "insert" || (array_key_exists('tpp', $options) && $mybb->settings['usetppoptions']))

Zeile 515Zeile 532
				}
}
$options['tpp'] = intval($options['tpp']);

				}
}
$options['tpp'] = intval($options['tpp']);

		}

		}

		// Verify the "posts per page" option.

		// Verify the "posts per page" option.

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

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

		{
$explodedppp = explode(",", $mybb->settings['userpppoptions']);
if(is_array($explodedppp))
{
@asort($explodedppp);

		{
$explodedppp = explode(",", $mybb->settings['userpppoptions']);
if(is_array($explodedppp))
{
@asort($explodedppp);

				$biggest = $explodedtpp[count($explodedppp)-1];

				$biggest = $explodedppp[count($explodedppp)-1];

				// Is the selected option greater than the allowed options?
if($options['ppp'] > $biggest)
{

				// Is the selected option greater than the allowed options?
if($options['ppp'] > $biggest)
{

Zeile 533Zeile 550
			$options['ppp'] = intval($options['ppp']);
}
// Is our selected "days prune" option valid or not?

			$options['ppp'] = intval($options['ppp']);
}
// Is our selected "days prune" option valid or not?

		if($this->method == "insert" || isset($options['daysprune']))
{

		if($this->method == "insert" || array_key_exists('daysprune', $options))
{

			$options['daysprune'] = intval($options['daysprune']);
if($options['daysprune'] < 0)
{

			$options['daysprune'] = intval($options['daysprune']);
if($options['daysprune'] < 0)
{

Zeile 577Zeile 594
		if($lastvisit <= 0)
{
$lastvisit = time();

		if($lastvisit <= 0)
{
$lastvisit = time();

		}
return true;


		}
return true;


	}

/**

	}

/**

Zeile 640Zeile 657
		global $lang;

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

		global $lang;

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





		// An invalid language has been specified?
if($language != '' && !$lang->language_exists($language))
{

		// An invalid language has been specified?
if($language != '' && !$lang->language_exists($language))
{

Zeile 654Zeile 671
	* Validate all user assets.
*
* @return boolean True when valid, false when invalid.

	* Validate all user assets.
*
* @return boolean True when valid, false when invalid.

	*/

	*/

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

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

Zeile 667Zeile 684
			$old_user = get_user($user['uid']);
}


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


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

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

		{
// If the username is the same - no need to verify
if(!$old_user['username'] || $user['username'] != $old_user['username'])

		{
// If the username is the same - no need to verify
if(!$old_user['username'] || $user['username'] != $old_user['username'])

Zeile 685Zeile 702
			$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();
}
if($this->method == "insert" || array_key_exists('email', $user))

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

Zeile 715Zeile 732
		if($this->method == "insert" || array_key_exists('referrer', $user))
{
$this->verify_referrer();

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

		}

		}

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

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

Zeile 761Zeile 778
	function insert_user()
{
global $db, $cache, $plugins;

	function insert_user()
{
global $db, $cache, $plugins;


// Yes, validating is required.


// Yes, validating is required.

		if(!$this->get_validated())

		if(!$this->get_validated())

		{

		{

			die("The user needs to be validated before inserting it into the DB.");

			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.");

		if(count($this->get_errors()) > 0)
{
die("The user is not valid.");

Zeile 778Zeile 795
			"username" => $db->escape_string($user['username']),
"password" => $user['saltedpw'],
"salt" => $user['salt'],

			"username" => $db->escape_string($user['username']),
"password" => $user['saltedpw'],
"salt" => $user['salt'],

			"loginkey" => $user['loginkey'],

			"loginkey" => $user['loginkey'],

			"email" => $db->escape_string($user['email']),
"postnum" => intval($user['postnum']),
"avatar" => $db->escape_string($user['avatar']),

			"email" => $db->escape_string($user['email']),
"postnum" => intval($user['postnum']),
"avatar" => $db->escape_string($user['avatar']),

Zeile 818Zeile 835
			"daysprune" => intval($user['options']['daysprune']),
"dateformat" => $db->escape_string($user['dateformat']),
"timeformat" => $db->escape_string($user['timeformat']),

			"daysprune" => intval($user['options']['daysprune']),
"dateformat" => $db->escape_string($user['dateformat']),
"timeformat" => $db->escape_string($user['timeformat']),

			"regip" => $user['regip'],

			"regip" => $db->escape_string($user['regip']),

			"language" => $db->escape_string($user['language']),
"showcodebuttons" => $user['options']['showcodebuttons'],
"away" => $user['away']['away'],

			"language" => $db->escape_string($user['language']),
"showcodebuttons" => $user['options']['showcodebuttons'],
"away" => $user['away']['away'],

Zeile 826Zeile 843
			"returndate" => $user['away']['returndate'],
"awayreason" => $db->escape_string($user['away']['awayreason']),
"notepad" => $db->escape_string($user['notepad']),

			"returndate" => $user['away']['returndate'],
"awayreason" => $db->escape_string($user['away']['awayreason']),
"notepad" => $db->escape_string($user['notepad']),

			"referrer" => intval($user['referrer_uid'])





			"referrer" => intval($user['referrer_uid']),
"buddylist" => '',
"ignorelist" => '',
"pmfolders" => '',
"notepad" => ''

		);

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

		);

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

Zeile 835Zeile 856
		$this->uid = $db->insert_id();

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

		$this->uid = $db->insert_id();

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

 
		
$query = $db->query("SHOW FIELDS FROM ".TABLE_PREFIX."userfields");
while($field = $db->fetch_array($query))
{
if($field['Field'] == 'ufid' || array_key_exists($field['Field'], $user['user_fields']))
{
continue;
}
$user['user_fields'][$field['Field']] = '';
}


		$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 856Zeile 888
	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 887Zeile 920
			$this->user_update_data['email'] = $user['email'];
}
if(isset($user['postnum']))

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

		{

		{

			$this->user_update_data['postnum'] = intval($user['postnum']);
}
if(isset($user['avatar']))

			$this->user_update_data['postnum'] = intval($user['postnum']);
}
if(isset($user['avatar']))

Zeile 918Zeile 951
		if(isset($user['lastactive']))
{
$this->user_update_data['lastactive'] = intval($user['lastactive']);

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

		}

		}

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

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

Zeile 948Zeile 981
			$this->user_update_data['msn'] = $db->escape_string(htmlspecialchars($user['msn']));
}
if(isset($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['birthday'] = $user['bday'];
}
if(isset($user['style']))

Zeile 992Zeile 1025
			{
$this->user_update_data[$option] = $value;
}

			{
$this->user_update_data[$option] = $value;
}

		}


		}


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

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

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

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

 

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


// Actual updating happens here.
$db->update_query(TABLE_PREFIX."users", $this->user_update_data, "uid='{$user['uid']}'");


// Actual updating happens here.
$db->update_query(TABLE_PREFIX."users", $this->user_update_data, "uid='{$user['uid']}'");





		// 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 1009Zeile 1047
			$fields = $db->fetch_array($query);
if(!$fields['ufid'])
{

			$fields = $db->fetch_array($query);
if(!$fields['ufid'])
{

				$db->insert_query(TABLE_PREFIX."userfields", array('ufid' => $user['uid']));














				$user_fields = array(
'ufid' => $user['uid']
);

$query = $db->query("SHOW FIELDS FROM ".TABLE_PREFIX."userfields");
while($field = $db->fetch_array($query))
{
if($field['Field'] == 'ufid')
{
continue;
}
$user_fields[$field['Field']] = '';
}
$db->insert_query(TABLE_PREFIX."userfields", $user_fields);

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

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

Zeile 1018Zeile 1069
		if($this->user_update_data['username'] != $old_user['username'] && $this->user_update_data['username'] != '')
{
$username_update = array(

		if($this->user_update_data['username'] != $old_user['username'] && $this->user_update_data['username'] != '')
{
$username_update = array(

				"username" => $db->escape_string($this->user_update_data['username'])

				"username" => $this->user_update_data['username']

			);
$lastposter_update = array(

			);
$lastposter_update = array(

				"lastposter" => $db->escape_string($this->user_update_data['username'])

				"lastposter" => $this->user_update_data['username']

			);

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

			);

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