| Zeile 90 | Zeile 90 |
|---|
}
// Check for certain characters in username (<, >, &, commas and slashes)
|
}
// Check for certain characters in username (<, >, &, commas and slashes)
|
if(strpos($username, "<") !== false || strpos($username, ">") !== false || strpos($username, "&") !== false || my_strpos($username, "\\") !== false || strpos($username, ";") !== false || strpos($username, ",") !== false)
| if(strpos($username, "<") !== false || strpos($username, ">") !== false || strpos($username, "&") !== false || my_strpos($username, "\\") !== false || strpos($username, ";") !== false || strpos($username, ",") !== false || utf8_handle_4byte_string($username, false) == false)
|
{ $this->set_error("bad_characters_username"); return false;
| { $this->set_error("bad_characters_username"); return false;
|
| Zeile 116 | Zeile 116 |
|---|
global $mybb;
$usertitle = &$this->data['usertitle'];
|
global $mybb;
$usertitle = &$this->data['usertitle'];
|
| | $usertitle = utf8_handle_4byte_string($usertitle);
|
// Check if the usertitle is of the correct length. if($mybb->settings['customtitlemaxlength'] != 0 && my_strlen($usertitle) > $mybb->settings['customtitlemaxlength'])
| // Check if the usertitle is of the correct length. if($mybb->settings['customtitlemaxlength'] != 0 && my_strlen($usertitle) > $mybb->settings['customtitlemaxlength'])
|
| Zeile 126 | Zeile 127 |
|---|
return true; }
|
return true; }
|
|
|
/** * Verifies if a username is already in use or not. *
| /** * Verifies if a username is already in use or not. *
|
| Zeile 138 | Zeile 139 |
|---|
$username = &$this->data['username'];
|
$username = &$this->data['username'];
|
$uid_check = "";
| $uid_check = "";
|
if($this->data['uid']) { $uid_check = " AND uid!='{$this->data['uid']}'"; }
|
if($this->data['uid']) { $uid_check = " AND uid!='{$this->data['uid']}'"; }
|
|
|
$query = $db->simple_select("users", "COUNT(uid) AS count", "LOWER(username)='".$db->escape_string(strtolower(trim($username)))."'{$uid_check}");
|
$query = $db->simple_select("users", "COUNT(uid) AS count", "LOWER(username)='".$db->escape_string(strtolower(trim($username)))."'{$uid_check}");
|
|
|
$user_count = $db->fetch_field($query, "count"); if($user_count > 0) {
| $user_count = $db->fetch_field($query, "count"); if($user_count > 0) {
|
| Zeile 251 | Zeile 252 |
|---|
$this->set_error('banned_email'); return false; }
|
$this->set_error('banned_email'); return false; }
|
|
|
// Check signed up emails // Ignore the ACP because the Merge System sometimes produces users with duplicate email addresses (Not A Bug) if($mybb->settings['allowmultipleemails'] == 0 && !defined("IN_ADMINCP"))
| // Check signed up emails // Ignore the ACP because the Merge System sometimes produces users with duplicate email addresses (Not A Bug) if($mybb->settings['allowmultipleemails'] == 0 && !defined("IN_ADMINCP"))
|
| Zeile 282 | Zeile 283 |
|---|
{ $website = &$this->data['website'];
|
{ $website = &$this->data['website'];
|
if(empty($website) || my_strtolower($website) == 'http://' || my_strtolower($website) == 'https://')
| if(empty($website) || my_strtolower($website) == 'http://' || my_strtolower($website) == 'https://' || utf8_handle_4byte_string($website, false) == false)
|
{ $website = ''; return true;
| { $website = ''; return true;
|
| Zeile 449 | Zeile 450 |
|---|
function verify_postnum() { $user = &$this->data;
|
function verify_postnum() { $user = &$this->data;
|
|
|
if($user['postnum'] < 0) { $this->set_error("invalid_postnum"); return false; }
|
if($user['postnum'] < 0) { $this->set_error("invalid_postnum"); return false; }
|
|
|
return true; }
| return true; }
|
| Zeile 475 | Zeile 476 |
|---|
$userfields = array(); $comma = ''; $editable = '';
|
$userfields = array(); $comma = ''; $editable = '';
|
|
|
if(!$this->data['profile_fields_editable']) { $editable = "editable=1";
| if(!$this->data['profile_fields_editable']) { $editable = "editable=1";
|
| Zeile 544 | Zeile 545 |
|---|
$this->set_error('max_limit_reached', array($profilefield['name'], $profilefield['maxlength'])); }
|
$this->set_error('max_limit_reached', array($profilefield['name'], $profilefield['maxlength'])); }
|
| | $profile_fields[$field] = utf8_handle_4byte_string($profile_fields[$field]);
|
$options = $db->escape_string($profile_fields[$field]); } else {
|
$options = $db->escape_string($profile_fields[$field]); } else {
|
| | $profile_fields[$field] = utf8_handle_4byte_string($profile_fields[$field]);
|
if($profilefield['maxlength'] > 0 && my_strlen($profile_fields[$field]) > $profilefield['maxlength']) { $this->set_error('max_limit_reached', array($profilefield['name'], $profilefield['maxlength']));
| if($profilefield['maxlength'] > 0 && my_strlen($profile_fields[$field]) > $profilefield['maxlength']) { $this->set_error('max_limit_reached', array($profilefield['name'], $profilefield['maxlength']));
|
| Zeile 596 | Zeile 600 |
|---|
function verify_options() { global $mybb;
|
function verify_options() { global $mybb;
|
|
|
$options = &$this->data['options'];
// Verify yes/no options.
| $options = &$this->data['options'];
// Verify yes/no options.
|
| Zeile 612 | Zeile 616 |
|---|
$this->verify_yesno_option($options, 'showavatars', 1); $this->verify_yesno_option($options, 'showquickreply', 1); $this->verify_yesno_option($options, 'showredirect', 1);
|
$this->verify_yesno_option($options, 'showavatars', 1); $this->verify_yesno_option($options, 'showquickreply', 1); $this->verify_yesno_option($options, 'showredirect', 1);
|
|
|
if($mybb->settings['postlayout'] == 'classic') { $this->verify_yesno_option($options, 'classicpostbit', 1);
| if($mybb->settings['postlayout'] == 'classic') { $this->verify_yesno_option($options, 'classicpostbit', 1);
|
| Zeile 621 | Zeile 625 |
|---|
{ $this->verify_yesno_option($options, 'classicpostbit', 0); }
|
{ $this->verify_yesno_option($options, 'classicpostbit', 0); }
|
|
|
if(array_key_exists('subscriptionmethod', $options)) { // Value out of range
| if(array_key_exists('subscriptionmethod', $options)) { // Value out of range
|
| Zeile 641 | Zeile 645 |
|---|
$options['dstcorrection'] = 0; } }
|
$options['dstcorrection'] = 0; } }
|
|
|
if($options['dstcorrection'] == 1) { $options['dst'] = 1;
| if($options['dstcorrection'] == 1) { $options['dst'] = 1;
|
| Zeile 663 | Zeile 667 |
|---|
{ $options['showcodebuttons'] = 1; }
|
{ $options['showcodebuttons'] = 1; }
|
|
|
if($this->method == "insert" || (isset($options['threadmode']) && $options['threadmode'] != "linear" && $options['threadmode'] != "threaded")) { if($mybb->settings['threadusenetstyle'])
| if($this->method == "insert" || (isset($options['threadmode']) && $options['threadmode'] != "linear" && $options['threadmode'] != "threaded")) { if($mybb->settings['threadusenetstyle'])
|
| Zeile 803 | Zeile 807 |
|---|
$this->set_error("missing_returndate"); return false; }
|
$this->set_error("missing_returndate"); return false; }
|
|
|
// Validate the return date lengths $user['away']['returndate'] = substr($returnday, 0, 2).'-'.substr($returnmonth, 0, 2).'-'.substr($returnyear, 0, 4); }
| // Validate the return date lengths $user['away']['returndate'] = substr($returnday, 0, 2).'-'.substr($returnmonth, 0, 2).'-'.substr($returnyear, 0, 4); }
|
| Zeile 829 | Zeile 833 |
|---|
} return true; }
|
} return true; }
|
|
|
/** * Verifies if this is coming from a spam bot or not *
| /** * Verifies if this is coming from a spam bot or not *
|
| Zeile 838 | Zeile 842 |
|---|
function verify_checkfields() { $user = &$this->data;
|
function verify_checkfields() { $user = &$this->data;
|
|
|
// An invalid language has been specified? if($user['regcheck1'] !== "" || $user['regcheck2'] !== "true") {
| // An invalid language has been specified? if($user['regcheck1'] !== "" || $user['regcheck2'] !== "true") {
|
| Zeile 954 | Zeile 958 |
|---|
{ $this->verify_birthday_privacy(); }
|
{ $this->verify_birthday_privacy(); }
|
|
|
$plugins->run_hooks("datahandler_user_validate", $this);
|
$plugins->run_hooks("datahandler_user_validate", $this);
|
|
|
// We are done validating, return. $this->set_validated(true); if(count($this->get_errors()) > 0)
| // We are done validating, return. $this->set_validated(true); if(count($this->get_errors()) > 0)
|
| Zeile 1056 | Zeile 1060 |
|---|
"classicpostbit" => $user['options']['classicpostbit'], "usernotes" => '' );
|
"classicpostbit" => $user['options']['classicpostbit'], "usernotes" => '' );
|
|
|
if($user['options']['dstcorrection'] == 1) { $this->user_insert_data['dst'] = 1;
| if($user['options']['dstcorrection'] == 1) { $this->user_insert_data['dst'] = 1;
|
| Zeile 1067 | Zeile 1071 |
|---|
}
$plugins->run_hooks("datahandler_user_insert", $this);
|
}
$plugins->run_hooks("datahandler_user_insert", $this);
|
|
|
$this->uid = $db->insert_query("users", $this->user_insert_data);
|
$this->uid = $db->insert_query("users", $this->user_insert_data);
|
|
|
$user['user_fields']['ufid'] = $this->uid;
|
$user['user_fields']['ufid'] = $this->uid;
|
|
|
$query = $db->simple_select("profilefields", "fid"); while($profile_field = $db->fetch_array($query)) {
| $query = $db->simple_select("profilefields", "fid"); while($profile_field = $db->fetch_array($query)) {
|
| Zeile 1083 | Zeile 1087 |
|---|
}
$db->insert_query("userfields", $user['user_fields'], false);
|
}
$db->insert_query("userfields", $user['user_fields'], false);
|
|
|
if($this->user_insert_data['referrer'] != 0) { $db->write_query("
| if($this->user_insert_data['referrer'] != 0) { $db->write_query("
|
| Zeile 1269 | Zeile 1273 |
|---|
{ unset($this->user_update_data['pmnotice']); }
|
{ 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'])) {
|
| Zeile 1328 | Zeile 1332 |
|---|
$db->update_query("threads", $username_update, "uid='{$user['uid']}'"); $db->update_query("threads", $lastposter_update, "lastposteruid='{$user['uid']}'"); $db->update_query("forums", $lastposter_update, "lastposteruid='{$user['uid']}'");
|
$db->update_query("threads", $username_update, "uid='{$user['uid']}'"); $db->update_query("threads", $lastposter_update, "lastposteruid='{$user['uid']}'"); $db->update_query("forums", $lastposter_update, "lastposteruid='{$user['uid']}'");
|
|
|
$stats = $cache->read("stats"); if($stats['lastuid'] == $user['uid']) {
| $stats = $cache->read("stats"); if($stats['lastuid'] == $user['uid']) {
|