Vergleich inc/datahandlers/user.php - 1.8.17 - 1.8.30

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 440Zeile 440
			$this->set_error("invalid_birthday_privacy");
return false;
}

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

		return true;
}











		else if ($birthdayprivacy == 'age')
{
$birthdayyear = &$this->data['birthday']['year'];
if(empty($birthdayyear))
{
$this->set_error("conflicted_birthday_privacy");
return false;
}
}
return true;
}


	/**
* Verifies if the post count field is filled in correctly.
*

	/**
* Verifies if the post count field is filled in correctly.
*

Zeile 455Zeile 464
		if(isset($user['postnum']) && $user['postnum'] < 0)
{
$this->set_error("invalid_postnum");

		if(isset($user['postnum']) && $user['postnum'] < 0)
{
$this->set_error("invalid_postnum");

			return false;
}

return true;
}

/**

			return false;
}

return true;
}

/**

	* Verifies if the thread count field is filled in correctly.
*
* @return boolean True when valid, false when invalid.

	* Verifies if the thread count field is filled in correctly.
*
* @return boolean True when valid, false when invalid.

Zeile 475Zeile 484
			$this->set_error("invalid_threadnum");
return false;
}

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





		return true;
}

/**
* Verifies if a profile fields are filled in correctly.

		return true;
}

/**
* Verifies if a profile fields are filled in correctly.

	*
* @return boolean True when valid, false when invalid.
*/

	*
* @return boolean True when valid, false when invalid.
*/

	function verify_profile_fields()
{
global $db, $cache;

	function verify_profile_fields()
{
global $db, $cache;

Zeile 506Zeile 515
					$profilefield['editableby'] = -1;
}


					$profilefield['editableby'] = -1;
}


				if(!is_member($profilefield['editableby'], array('usergroup' => $user['usergroup'], 'additionalgroups' => $user['additionalgroups'])))
{
continue;
}



















				if(isset($user['usergroup']))
{
$usergroup = $user['usergroup'];
}
else
{
$usergroup = '';
}
if(isset($user['additionalgroups']))
{
$additionalgroups = $user['additionalgroups'];
}
else
{
$additionalgroups = '';
}

if(!is_member($profilefield['editableby'], array('usergroup' => $usergroup, 'additionalgroups' => $additionalgroups)))
{
continue;
}


				// Does this field have a minimum post count?
if(!isset($this->data['profile_fields_editable']) && !empty($profilefield['postnum']) && $profilefield['postnum'] > $user['postnum'])
{
continue;
}

				// Does this field have a minimum post count?
if(!isset($this->data['profile_fields_editable']) && !empty($profilefield['postnum']) && $profilefield['postnum'] > $user['postnum'])
{
continue;
}





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

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

Zeile 526Zeile 552
				if(!isset($profile_fields[$field]))
{
$profile_fields[$field] = '';

				if(!isset($profile_fields[$field]))
{
$profile_fields[$field] = '';

				}


				}


				// If the profile field is required, but not filled in, present error.
if($type != "multiselect" && $type != "checkbox")
{

				// If the profile field is required, but not filled in, present error.
if($type != "multiselect" && $type != "checkbox")
{

Zeile 603Zeile 629
		$user = &$this->data;

// Does the referrer exist or not?

		$user = &$this->data;

// Does the referrer exist or not?

		if($mybb->settings['usereferrals'] == 1 && $user['referrer'] != '')

		if($mybb->settings['usereferrals'] == 1 && !empty($user['referrer']))

		{
$referrer = get_user_by_username($user['referrer']);


		{
$referrer = get_user_by_username($user['referrer']);


Zeile 614Zeile 640
			}

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

			}

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

		}

		}

		else
{
$user['referrer_uid'] = 0;
}

		else
{
$user['referrer_uid'] = 0;
}





		return true;
}


		return true;
}


Zeile 633Zeile 659
		global $mybb;

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

		global $mybb;

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

 

if(!is_array($options))
{
$options = array();
}


// Verify yes/no options.
$this->verify_yesno_option($options, 'allownotices', 1);


// Verify yes/no options.
$this->verify_yesno_option($options, 'allownotices', 1);

Zeile 652Zeile 683
		$this->verify_yesno_option($options, 'sourceeditor', 0);
$this->verify_yesno_option($options, 'buddyrequestspm', 1);
$this->verify_yesno_option($options, 'buddyrequestsauto', 0);

		$this->verify_yesno_option($options, 'sourceeditor', 0);
$this->verify_yesno_option($options, 'buddyrequestspm', 1);
$this->verify_yesno_option($options, 'buddyrequestsauto', 0);





		if($mybb->settings['postlayout'] == 'classic')

		if($mybb->settings['postlayout'] == 'classic')

		{

		{

			$this->verify_yesno_option($options, 'classicpostbit', 1);
}
else

			$this->verify_yesno_option($options, 'classicpostbit', 1);
}
else

Zeile 673Zeile 704
		}

if(array_key_exists('dstcorrection', $options))

		}

if(array_key_exists('dstcorrection', $options))

		{

		{

			// Value out of range
$options['dstcorrection'] = (int)$options['dstcorrection'];
if($options['dstcorrection'] < 0 || $options['dstcorrection'] > 2)
{
$options['dstcorrection'] = 0;

			// Value out of range
$options['dstcorrection'] = (int)$options['dstcorrection'];
if($options['dstcorrection'] < 0 || $options['dstcorrection'] > 2)
{
$options['dstcorrection'] = 0;

			}
}

if($options['dstcorrection'] == 1)
{
$options['dst'] = 1;
}
elseif($options['dstcorrection'] == 0)
{
$options['dst'] = 0;
}

			}















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

			if($options['dstcorrection'] == 1)







			{

			{

				$options['threadmode'] = 'linear';





				$options['dst'] = 1;
}
elseif($options['dstcorrection'] == 0)
{
$options['dst'] = 0;

			}

			}

 
		}

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

		}

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

		}

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

			{

			{

				$options['tpp'] = 0;
}
$explodedtpp = explode(",", $mybb->settings['usertppoptions']);

				$options['tpp'] = 0;
}
$explodedtpp = explode(",", $mybb->settings['usertppoptions']);

Zeile 747Zeile 771
		if($this->method == "insert" || array_key_exists('daysprune', $options))
{
if(!isset($options['daysprune']))

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

			{
$options['daysprune'] = 0;
}

			{
$options['daysprune'] = 0;
}

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

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

Zeile 791Zeile 815
		if($lastvisit <= 0)
{
$lastvisit = TIME_NOW;

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

		}
return true;

}

		}
return true;

}


/**
* Verifies if a last active date is valid or not.


/**
* Verifies if a last active date is valid or not.

Zeile 810Zeile 834
		if($lastactive <= 0)
{
$lastactive = TIME_NOW;

		if($lastactive <= 0)
{
$lastactive = TIME_NOW;

		}
return true;

		}
return true;


}



}


Zeile 827Zeile 851
		$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 || !isset($user['away']['away']) || $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 || !isset($user['away']['away']) || $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 859Zeile 883

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


/**
* Verifies if a language 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()
{
global $lang;

	 */
function verify_language()
{
global $lang;





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

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





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

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

			return false;
}
return true;
}

/**

			return false;
}
return true;
}

/**

	 * Verifies if a style is valid for this user or not.
*
* @return boolean True when valid, false when invalid.

	 * Verifies if a style is valid for this user or not.
*
* @return boolean True when valid, false when invalid.

Zeile 888Zeile 912

$user = &$this->data;



$user = &$this->data;


		if($user['style'])

		if(!empty($user['style']))

		{
$theme = get_theme($user['style']);


		{
$theme = get_theme($user['style']);


Zeile 928Zeile 952
	 */
function verify_timezone()
{

	 */
function verify_timezone()
{

 
		global $mybb;


		$user = &$this->data;

$timezones = get_supported_timezones();


		$user = &$this->data;

$timezones = get_supported_timezones();


		if(!array_key_exists($user['timezone'], $timezones))

		if(!isset($user['timezone']) || !array_key_exists($user['timezone'], $timezones))

		{
$user['timezone'] = $mybb->settings['timezoneoffset'];
return false;

		{
$user['timezone'] = $mybb->settings['timezoneoffset'];
return false;

Zeile 1095Zeile 1121

$user = &$this->data;



$user = &$this->data;


		$array = array('postnum', 'threadnum', 'avatar', 'avatartype', 'additionalgroups', 'displaygroup', 'icq', 'yahoo', 'skype', 'google', 'bday', 'signature', 'style', 'dateformat', 'timeformat', 'notepad');

		$array = array('postnum', 'threadnum', 'avatar', 'avatartype', 'additionalgroups', 'displaygroup', 'icq', 'skype', 'google', 'bday', 'signature', 'style', 'dateformat', 'timeformat', 'notepad', 'regip', 'lastip', 'coppa_user');

		foreach($array as $value)
{
if(!isset($user[$value]))
{
$user[$value] = '';
}

		foreach($array as $value)
{
if(!isset($user[$value]))
{
$user[$value] = '';
}

 
		}

$array = array('subscriptionmethod', 'dstcorrection');
foreach($array as $value)
{
if(!isset($user['options'][$value]))
{
$user['options'][$value] = '';
}
}

// If user is being created from ACP, there is no last visit or last active
if(defined('IN_ADMINCP'))
{
$user['lastvisit'] = $user['lastactive'] = 0;

		}

$this->user_insert_data = array(

		}

$this->user_insert_data = array(

Zeile 1123Zeile 1164
			"lastvisit" => (int)$user['lastvisit'],
"website" => $db->escape_string($user['website']),
"icq" => (int)$user['icq'],

			"lastvisit" => (int)$user['lastvisit'],
"website" => $db->escape_string($user['website']),
"icq" => (int)$user['icq'],

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

 
			"skype" => $db->escape_string($user['skype']),
"google" => $db->escape_string($user['google']),
"birthday" => $user['bday'],

			"skype" => $db->escape_string($user['skype']),
"google" => $db->escape_string($user['google']),
"birthday" => $user['bday'],

Zeile 1152Zeile 1192
			"dateformat" => $db->escape_string($user['dateformat']),
"timeformat" => $db->escape_string($user['timeformat']),
"regip" => $db->escape_binary($user['regip']),

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

 
			"lastip" => $db->escape_binary($user['lastip']),

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

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

Zeile 1161Zeile 1202
			"awaydate" => (int)$user['away']['date'],
"returndate" => $user['away']['returndate'],
"awayreason" => $db->escape_string($user['away']['awayreason']),

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

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

 
			"referrer" => (int)$user['referrer_uid'],
"referrals" => 0,
"buddylist" => '',
"ignorelist" => '',

			"referrer" => (int)$user['referrer_uid'],
"referrals" => 0,
"buddylist" => '',
"ignorelist" => '',

			"pmfolders" => '',

			"pmfolders" => "0**$%%$1**$%%$2**$%%$3**$%%$4**",

			"notepad" => '',
"warningpoints" => 0,
"moderateposts" => 0,

			"notepad" => '',
"warningpoints" => 0,
"moderateposts" => 0,

Zeile 1282Zeile 1322
		}
if(isset($user['email']))
{

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

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

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

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

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

Zeile 1318Zeile 1358
			$this->user_update_data['regdate'] = (int)$user['regdate'];
}
if(isset($user['lastactive']))

			$this->user_update_data['regdate'] = (int)$user['regdate'];
}
if(isset($user['lastactive']))

		{

		{

			$this->user_update_data['lastactive'] = (int)$user['lastactive'];

			$this->user_update_data['lastactive'] = (int)$user['lastactive'];

		}

		}

		if(isset($user['lastvisit']))

		if(isset($user['lastvisit']))

		{

		{

			$this->user_update_data['lastvisit'] = (int)$user['lastvisit'];
}
if(isset($user['signature']))

			$this->user_update_data['lastvisit'] = (int)$user['lastvisit'];
}
if(isset($user['signature']))

Zeile 1330Zeile 1370
			$this->user_update_data['signature'] = $db->escape_string($user['signature']);
}
if(isset($user['website']))

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

		{

		{

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

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

		}

		}

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

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

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

 
		}
if(isset($user['skype']))

		}
if(isset($user['skype']))

		{

		{

			$this->user_update_data['skype'] = $db->escape_string($user['skype']);
}
if(isset($user['google']))

			$this->user_update_data['skype'] = $db->escape_string($user['skype']);
}
if(isset($user['google']))

Zeile 1376Zeile 1412
		if(isset($user['regip']))
{
$this->user_update_data['regip'] = $db->escape_string($user['regip']);

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

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

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

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

Zeile 1406Zeile 1446
		if(array_key_exists('coppa_user', $user))
{
$this->user_update_data['coppauser'] = (int)$user['coppa_user'];

		if(array_key_exists('coppa_user', $user))
{
$this->user_update_data['coppauser'] = (int)$user['coppa_user'];

		}

		}

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


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


Zeile 1414Zeile 1454
		if($old_user['pmnotice'] == "2" && $this->user_update_data['pmnotice'] == 1)
{
unset($this->user_update_data['pmnotice']);

		if($old_user['pmnotice'] == "2" && $this->user_update_data['pmnotice'] == 1)
{
unset($this->user_update_data['pmnotice']);

		}

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

		}

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


if(count($this->user_update_data) < 1 && empty($user['user_fields']))


if(count($this->user_update_data) < 1 && empty($user['user_fields']))

		{

		{

			return false;

			return false;

		}

		}


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


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

		}


		}


		$cache->update_moderators();
if(isset($user['bday']) || isset($user['username']))

		$cache->update_moderators();
if(isset($user['bday']) || isset($user['username']))

		{

		{

			$cache->update_birthdays();

			$cache->update_birthdays();

		}


		}


		if(isset($user['usergroup']) && (int)$user['usergroup'] == 5)

		if(isset($user['usergroup']) && (int)$user['usergroup'] == 5)

		{

		{

			$cache->update_awaitingactivation();
}


			$cache->update_awaitingactivation();
}


Zeile 1445Zeile 1485
		{
$query = $db->simple_select("userfields", "*", "ufid='{$user['uid']}'");
$fields = $db->fetch_array($query);

		{
$query = $db->simple_select("userfields", "*", "ufid='{$user['uid']}'");
$fields = $db->fetch_array($query);

			if(!$fields['ufid'])

			if(empty($fields['ufid']))

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

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





				$fields_array = $db->show_fields_from("userfields");
foreach($fields_array as $field)
{

				$fields_array = $db->show_fields_from("userfields");
foreach($fields_array as $field)
{

Zeile 1493Zeile 1533

/**
* Provides a method to completely delete a user.


/**
* Provides a method to completely delete a user.

	 *

	 *

	 * @param array $delete_uids Array of user information
* @param integer $prunecontent Whether if delete threads/posts or not
* @return array

	 * @param array $delete_uids Array of user information
* @param integer $prunecontent Whether if delete threads/posts or not
* @return array

Zeile 1501Zeile 1541
	function delete_user($delete_uids, $prunecontent=0)
{
global $db, $plugins, $mybb, $cache;

	function delete_user($delete_uids, $prunecontent=0)
{
global $db, $plugins, $mybb, $cache;





		// Yes, validating is required.
if(count($this->get_errors()) > 0)
{

		// Yes, validating is required.
if(count($this->get_errors()) > 0)
{

Zeile 1513Zeile 1553
		foreach($this->delete_uids as $key => $uid)
{
if(!$uid || is_super_admin($uid) || $uid == $mybb->user['uid'])

		foreach($this->delete_uids as $key => $uid)
{
if(!$uid || is_super_admin($uid) || $uid == $mybb->user['uid'])

			{

			{

				// Remove super admins
unset($this->delete_uids[$key]);
}

				// Remove super admins
unset($this->delete_uids[$key]);
}

		}

$plugins->run_hooks('datahandler_user_delete_start', $this);


		}

$plugins->run_hooks('datahandler_user_delete_start', $this);


		$this->delete_uids = implode(',', $this->delete_uids);

if(empty($this->delete_uids))

		$this->delete_uids = implode(',', $this->delete_uids);

if(empty($this->delete_uids))

Zeile 1534Zeile 1574
		}

$this->delete_content();

		}

$this->delete_content();





		// Delete the user
$query = $db->delete_query('users', "uid IN({$this->delete_uids})");
$this->deleted_users = $db->affected_rows($query);

		// Delete the user
$query = $db->delete_query('users', "uid IN({$this->delete_uids})");
$this->deleted_users = $db->affected_rows($query);

Zeile 1575Zeile 1615
		}

$db->delete_query('threadratings', "uid IN({$this->delete_uids})");

		}

$db->delete_query('threadratings', "uid IN({$this->delete_uids})");





		// Update forums & threads if user is the lastposter
$db->update_query('forums', array('lastposteruid' => 0), "lastposteruid IN({$this->delete_uids})");
$db->update_query('threads', array('lastposteruid' => 0), "lastposteruid IN({$this->delete_uids})");

		// Update forums & threads if user is the lastposter
$db->update_query('forums', array('lastposteruid' => 0), "lastposteruid IN({$this->delete_uids})");
$db->update_query('threads', array('lastposteruid' => 0), "lastposteruid IN({$this->delete_uids})");

Zeile 1590Zeile 1630
		$plugins->run_hooks("datahandler_user_delete_end", $this);

// Update cache

		$plugins->run_hooks("datahandler_user_delete_end", $this);

// Update cache

		$cache->update_banned();

 
		$cache->update_moderators();
$cache->update_forumsdisplay();
$cache->update_reportedcontent();

		$cache->update_moderators();
$cache->update_forumsdisplay();
$cache->update_reportedcontent();

Zeile 1660Zeile 1699

// Update the reports made by the deleted users by setting the uid to 0
$db->update_query('reportedcontent', array('uid' => 0), "uid IN({$this->delete_uids})");


// Update the reports made by the deleted users by setting the uid to 0
$db->update_query('reportedcontent', array('uid' => 0), "uid IN({$this->delete_uids})");


// Remove any of the user(s) uploaded avatars
require_once MYBB_ROOT.'inc/functions_upload.php';
foreach(explode(',', $this->delete_uids) as $uid)
{
remove_avatars($uid);
}


// Remove any of the user(s) uploaded avatars
require_once MYBB_ROOT.'inc/functions_upload.php';
foreach(explode(',', $this->delete_uids) as $uid)
{
remove_avatars($uid);
}

	}

/**

	}

/**

Zeile 1675Zeile 1714
	 * @param array|bool $delete_uids Array of user ids, false if they're already set (eg when using the delete_user function)
*/
function delete_posts($delete_uids=false)

	 * @param array|bool $delete_uids Array of user ids, false if they're already set (eg when using the delete_user function)
*/
function delete_posts($delete_uids=false)

	{
global $db, $plugins, $mybb;

if($delete_uids != false)
{
$this->delete_uids = array_map('intval', (array)$delete_uids);

foreach($this->delete_uids as $key => $uid)
{
if(!$uid || is_super_admin($uid) || $uid == $mybb->user['uid'])
{
// Remove super admins
unset($this->delete_uids[$key]);
}

	{
global $db, $plugins, $mybb;

if($delete_uids != false)
{
$this->delete_uids = array_map('intval', (array)$delete_uids);

foreach($this->delete_uids as $key => $uid)
{
if(!$uid || is_super_admin($uid) || $uid == $mybb->user['uid'])
{
// Remove super admins
unset($this->delete_uids[$key]);
}

			}

$this->delete_uids = implode(',', $this->delete_uids);

			}

$this->delete_uids = implode(',', $this->delete_uids);

Zeile 1696Zeile 1735

require_once MYBB_ROOT.'inc/class_moderation.php';
$moderation = new Moderation();


require_once MYBB_ROOT.'inc/class_moderation.php';
$moderation = new Moderation();





		$plugins->run_hooks('datahandler_user_delete_posts', $this);

if(empty($this->delete_uids))

		$plugins->run_hooks('datahandler_user_delete_posts', $this);

if(empty($this->delete_uids))

Zeile 1707Zeile 1746
		// Threads
$query = $db->simple_select('threads', 'tid', "uid IN({$this->delete_uids})");
while($tid = $db->fetch_field($query, 'tid'))

		// Threads
$query = $db->simple_select('threads', 'tid', "uid IN({$this->delete_uids})");
while($tid = $db->fetch_field($query, 'tid'))

		{
$moderation->delete_thread($tid);
}

		{
$moderation->delete_thread($tid);
}


// Posts
$query = $db->simple_select('posts', 'pid', "uid IN({$this->delete_uids})");


// Posts
$query = $db->simple_select('posts', 'pid', "uid IN({$this->delete_uids})");

Zeile 1718Zeile 1757
			$moderation->delete_post($pid);
}
}

			$moderation->delete_post($pid);
}
}





	/**
* Provides a method to clear an users profile
*

	/**
* Provides a method to clear an users profile
*

Zeile 1731Zeile 1770

// delete_uids isn't a nice name, but it's used as the functions above use the same
if($delete_uids != false)


// delete_uids isn't a nice name, but it's used as the functions above use the same
if($delete_uids != false)

		{

		{

			$this->delete_uids = array_map('intval', (array)$delete_uids);

foreach($this->delete_uids as $key => $uid)

			$this->delete_uids = array_map('intval', (array)$delete_uids);

foreach($this->delete_uids as $key => $uid)

Zeile 1750Zeile 1789
			"website" => "",
"birthday" => "",
"icq" => "",

			"website" => "",
"birthday" => "",
"icq" => "",

			"yahoo" => "",

 
			"skype" => "",
"google" => "",
"usertitle" => "",

			"skype" => "",
"google" => "",
"usertitle" => "",

Zeile 1792Zeile 1830
	public function verify_signature()
{
global $mybb, $parser;

	public function verify_signature()
{
global $mybb, $parser;

 

if(!isset($this->data['signature']))
{
return true;
}


if(!isset($parser))
{


if(!isset($parser))
{

Zeile 1801Zeile 1844

$parser_options = array(
'allow_html' => $mybb->settings['sightml'],


$parser_options = array(
'allow_html' => $mybb->settings['sightml'],

			'filter_badwords' => 1,

 
			'allow_mycode' => $mybb->settings['sigmycode'],
'allow_smilies' => $mybb->settings['sigsmilies'],
'allow_imgcode' => $mybb->settings['sigimgcode'],

			'allow_mycode' => $mybb->settings['sigmycode'],
'allow_smilies' => $mybb->settings['sigsmilies'],
'allow_imgcode' => $mybb->settings['sigimgcode'],

Zeile 1819Zeile 1861
			$imgsallowed = 0;

if($mybb->settings['sigimgcode'] == 1)

			$imgsallowed = 0;

if($mybb->settings['sigimgcode'] == 1)

			{

			{

				$imgsallowed = $mybb->settings['maxsigimages'];
}

				$imgsallowed = $mybb->settings['maxsigimages'];
}





			$this->set_error('too_many_sig_images2', array($imgsallowed));

			$this->set_error('too_many_sig_images2', array($imgsallowed));

		}


		}


		if($mybb->settings['sigcountmycode'] == 0)

		if($mybb->settings['sigcountmycode'] == 0)

		{
$parsed_sig = $parser->text_parse_message($this->data['signature']);

		{
$parsed_sig = $parser->text_parse_message($this->data['signature'], array('signature_parse' => '1'));

		}
else

		}
else

		{

		{

			$parsed_sig = $this->data['signature'];
}


			$parsed_sig = $this->data['signature'];
}


		$parsed_sig = preg_replace("#\s#", "", $parsed_sig);
$sig_length = my_strlen($parsed_sig);

if($sig_length > $mybb->settings['siglength'])

		if($mybb->settings['siglength'] > 0)




		{

		{

			$this->set_error('sig_too_long', array($mybb->settings['siglength']));


			$parsed_sig = preg_replace("#\s#", "", $parsed_sig);
$sig_length = my_strlen($parsed_sig);





			if($sig_length - $mybb->settings['siglength'] > 1)

			if($sig_length > $mybb->settings['siglength'])

			{

			{

				$this->set_error('sig_remove_chars_plural', array($sig_length-$mybb->settings['siglength']));
}
else
{
$this->set_error('sig_remove_chars_singular');






				$this->set_error('sig_too_long', array($mybb->settings['siglength']));

if($sig_length - $mybb->settings['siglength'] > 1)
{
$this->set_error('sig_remove_chars_plural', array($sig_length-$mybb->settings['siglength']));
}
else
{
$this->set_error('sig_remove_chars_singular');
}

			}
}


			}
}