Vergleich inc/datahandlers/user.php - 1.8.7 - 1.8.8

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 303Zeile 303
	{
$website = &$this->data['website'];


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


		if(empty($website) || my_strtolower($website) == 'http://' || my_strtolower($website) == 'https://')

		if(!empty($website) && !my_validate_url($website))

		{

		{

			$website = '';
return true;
}

// Does the website start with http(s)://?
if(my_strtolower(substr($website, 0, 4)) != "http")
{
// Website does not start with http://, let's see if the user forgot.
$website = "http://".$website;

			$website = 'http://'.$website;









		}


		}


		if(!filter_var($website, FILTER_VALIDATE_URL))

		if(!empty($website) && !my_validate_url($website))

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

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

Zeile 677Zeile 669
			if($options['subscriptionmethod'] < 0 || $options['subscriptionmethod'] > 3)
{
$options['subscriptionmethod'] = 0;

			if($options['subscriptionmethod'] < 0 || $options['subscriptionmethod'] > 3)
{
$options['subscriptionmethod'] = 0;

			}

			}

		}

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

		}

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

Zeile 765Zeile 757
			}
}
$this->data['options'] = $options;

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

	}

/**

	}

/**

	 * Verifies if a registration date is valid or not.
*
* @return boolean True when valid, false when invalid.

	 * Verifies if a registration date is valid or not.
*
* @return boolean True when valid, false when invalid.

Zeile 859Zeile 851

/**
* 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;

Zeile 921Zeile 913
	}

/**

	}

/**

	 * Verifies if the user timezone is valid. 

	 * Verifies if the user timezone is valid.

	 * If the timezone is invalid, the board default is used.
*
* @return boolean True when timezone was valid, false otherwise

	 * If the timezone is invalid, the board default is used.
*
* @return boolean True when timezone was valid, false otherwise

Zeile 1054Zeile 1046
		if($this->method == "insert" || array_key_exists('style', $user))
{
$this->verify_style();

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

 
		}
if($this->method == "insert" || array_key_exists('signature', $user))
{
$this->verify_signature();

		}

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

		}

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

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

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

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

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

			$this->user_update_data['awaydate'] = $db->escape_string($user['away']['date']);
$this->user_update_data['returndate'] = $db->escape_string($user['away']['returndate']);
$this->user_update_data['awayreason'] = $db->escape_string($user['away']['awayreason']);

			$this->user_update_data['awaydate'] = $db->escape_string($user['away']['date']);
$this->user_update_data['returndate'] = $db->escape_string($user['away']['returndate']);
$this->user_update_data['awayreason'] = $db->escape_string($user['away']['awayreason']);

Zeile 1596Zeile 1592

/**
* Provides a method to delete users' content


/**
* Provides a method to delete users' content

	 *

	 *

	 * @param array|bool $delete_uids Array of user ids, false if they're already set (eg when using the delete_user function)
*/
function delete_content($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_content($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]);
}
}

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

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

if(empty($this->delete_uids))

	{
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);
}

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

if(empty($this->delete_uids))

		{
return;
}

		{
return;
}

Zeile 1665Zeile 1661

/**
* Provides a method to delete an users posts and threads


/**
* Provides a method to delete an users posts and threads

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

	 *
* @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;

	function delete_posts($delete_uids=false)
{
global $db, $plugins, $mybb;

Zeile 1690Zeile 1686

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 1735Zeile 1731
					// Remove super admins
unset($this->delete_uids[$key]);
}

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

			}


			}


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


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


Zeile 1759Zeile 1755
			"avatar" => "",
'avatardimensions' => '',
'avatartype' => ''

			"avatar" => "",
'avatardimensions' => '',
'avatartype' => ''

		);

		);


if($gid > 0)


if($gid > 0)

		{

		{

			$update["usergroup"] = (int)$gid;

			$update["usergroup"] = (int)$gid;

		}


		}


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

if(empty($this->delete_uids))

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

if(empty($this->delete_uids))

Zeile 1779Zeile 1775
		// Remove any of the user(s) uploaded avatars
require_once MYBB_ROOT.'inc/functions_upload.php';
foreach(explode(',', $this->delete_uids) as $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);
}

			remove_avatars($uid);
}

 
	}

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

if(!isset($parser))
{
require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;
}

$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'],
"filter_badwords" => 1
);

$parsed_sig = $parser->parse_message($this->data['signature'], $parser_options);

if((($mybb->settings['sigimgcode'] == 0 && $mybb->settings['sigsmilies'] != 1) &&
substr_count($parsed_sig, "<img") > 0) ||
(($mybb->settings['sigimgcode'] == 1 || $mybb->settings['sigsmilies'] == 1) &&
substr_count($parsed_sig, "<img") > $mybb->settings['maxsigimages'])
)
{
$imgsallowed = 0;

if($mybb->settings['sigimgcode'] == 1)
{
$imgsallowed = $mybb->settings['maxsigimages'];
}

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

if($mybb->settings['sigcountmycode'] == 0)
{
$parsed_sig = $parser->text_parse_message($this->data['signature']);
}
else
{
$parsed_sig = $this->data['signature'];
}

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

if($sig_length > $mybb->settings['siglength'])
{
$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');
}
}

if(count($this->get_errors()) > 0)
{
return false;
}
return true;

	}
}

	}
}