Zeile 187 | Zeile 187 |
---|
}
// Has the user tried to use their email address or username as a password?
|
}
// Has the user tried to use their email address or username as a password?
|
if($user['email'] === $user['password'] || $user['username'] === $user['password'])
| if(!empty($user['email']) && !empty($user['username']))
|
{
|
{
|
$this->set_error('bad_password_security'); return false; }
| if($user['email'] === $user['password'] || $user['username'] === $user['password'] || strpos($user['password'], $user['email']) !== false || strpos($user['password'], $user['username']) !== false || strpos($user['email'], $user['password']) !== false || strpos($user['username'], $user['password']) !== false) { $this->set_error('bad_password_security'); return false; } }
|
// See if the board has "require complex passwords" enabled. if($mybb->settings['requirecomplexpasswords'] == 1) {
| // See if the board has "require complex passwords" enabled. if($mybb->settings['requirecomplexpasswords'] == 1) {
|
Zeile 203 | Zeile 208 |
---|
$this->set_error('no_complex_characters', array($mybb->settings['minpasswordlength'])); return false; }
|
$this->set_error('no_complex_characters', array($mybb->settings['minpasswordlength'])); return false; }
|
}
| }
|
// If we have a "password2" check if they both match if(isset($user['password2']) && $user['password'] !== $user['password2']) { $this->set_error("passwords_dont_match");
|
// If we have a "password2" check if they both match if(isset($user['password2']) && $user['password'] !== $user['password2']) { $this->set_error("passwords_dont_match");
|
return false; }
| return false; }
|
// Generate the user login key $user['loginkey'] = generate_loginkey();
|
// Generate the user login key $user['loginkey'] = generate_loginkey();
|
|
|
// Combine the password and salt $password_fields = create_password($user['password'], false, $user); $user = array_merge($user, $password_fields);
|
// Combine the password and salt $password_fields = create_password($user['password'], false, $user); $user = array_merge($user, $password_fields);
|
return true; }
| return true; }
|
/** * Verifies usergroup selections and other group details.
| /** * Verifies usergroup selections and other group details.
|
Zeile 233 | Zeile 238 |
---|
} /** * Verifies if an email address is valid or not.
|
} /** * Verifies if an email address is valid or not.
|
* * @return boolean True when valid, false when invalid.
| * * @return boolean True when valid, false when invalid.
|
*/ function verify_email() {
| */ function verify_email() {
|
Zeile 246 | Zeile 251 |
---|
if(trim_blank_chrs($user['email']) == '') { $this->set_error('missing_email');
|
if(trim_blank_chrs($user['email']) == '') { $this->set_error('missing_email');
|
return false;
| return false;
|
}
// Check if this is a proper email address.
| }
// Check if this is a proper email address.
|
Zeile 258 | Zeile 263 |
---|
// Check banned emails if(is_banned_email($user['email'], true))
|
// Check banned emails if(is_banned_email($user['email'], true))
|
{
| {
|
$this->set_error('banned_email'); return false; }
| $this->set_error('banned_email'); return false; }
|
Zeile 266 | Zeile 271 |
---|
// 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"))
|
{
| {
|
$uid = 0; if(isset($user['uid']))
|
$uid = 0; if(isset($user['uid']))
|
{
| {
|
$uid = $user['uid']; } if(email_already_in_use($user['email'], $uid))
| $uid = $user['uid']; } if(email_already_in_use($user['email'], $uid))
|
Zeile 281 | Zeile 286 |
---|
// If we have an "email2", verify it matches the existing email if(isset($user['email2']) && $user['email'] != $user['email2'])
|
// If we have an "email2", verify it matches the existing email if(isset($user['email2']) && $user['email'] != $user['email2'])
|
{
| {
|
$this->set_error("emails_dont_match"); return false; }
| $this->set_error("emails_dont_match"); return false; }
|
Zeile 309 | Zeile 314 |
---|
return false; }
|
return false; }
|
return true; }
/** * Verifies if an ICQ number is valid or not. * * @return boolean True when valid, false when invalid. */ function verify_icq() { $icq = &$this->data['icq'];
if($icq != '' && !is_numeric($icq)) { $this->set_error("invalid_icq_number"); return false; } $icq = (int)$icq;
| |
return true; }
| return true; }
|
Zeile 338 | Zeile 325 |
---|
function verify_birthday() { global $mybb;
|
function verify_birthday() { global $mybb;
|
|
|
$user = &$this->data; $birthday = &$user['birthday'];
if(!is_array($birthday)) { return true;
|
$user = &$this->data; $birthday = &$user['birthday'];
if(!is_array($birthday)) { return true;
|
}
| }
|
// Sanitize any input we have $birthday['day'] = (int)$birthday['day']; $birthday['month'] = (int)$birthday['month'];
| // Sanitize any input we have $birthday['day'] = (int)$birthday['day']; $birthday['month'] = (int)$birthday['month'];
|
Zeile 376 | Zeile 363 |
---|
$this->set_error("invalid_birthday"); return false; }
|
$this->set_error("invalid_birthday"); return false; }
|
else if($birthday['year'] == date("Y"))
| elseif($birthday['year'] == date("Y"))
|
{ // Error if birth date is in future if($birthday['month'] > date("m") || ($birthday['month'] == date("m") && $birthday['day'] > date("d")))
| { // Error if birth date is in future if($birthday['month'] > date("m") || ($birthday['month'] == date("m") && $birthday['day'] > date("d")))
|
Zeile 395 | Zeile 382 |
---|
elseif(($mybb->settings['coppa'] == "deny" && $birthday['year'] > (date("Y")-13)) && !is_moderator()) { $this->set_error("invalid_birthday_coppa2");
|
elseif(($mybb->settings['coppa'] == "deny" && $birthday['year'] > (date("Y")-13)) && !is_moderator()) { $this->set_error("invalid_birthday_coppa2");
|
return false; }
| return false; }
|
// Make the user's birthday field if($birthday['year'] != 0)
| // Make the user's birthday field if($birthday['year'] != 0)
|
Zeile 434 | Zeile 421 |
---|
{ $this->set_error("invalid_birthday_privacy"); return false;
|
{ $this->set_error("invalid_birthday_privacy"); return false;
|
| } else if ($birthdayprivacy == 'age') { $birthdayyear = &$this->data['birthday']['year']; if(empty($birthdayyear)) { $this->set_error("conflicted_birthday_privacy"); return false; }
|
} return true; }
| } return true; }
|
Zeile 444 | Zeile 440 |
---|
* @return boolean True when valid, false when invalid. */ function verify_postnum()
|
* @return boolean True when valid, false when invalid. */ function verify_postnum()
|
{ $user = &$this->data;
| { $user = &$this->data;
|
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 false;
|
}
return true;
| }
return true;
|
Zeile 469 | Zeile 465 |
---|
{ $this->set_error("invalid_threadnum"); return false;
|
{ $this->set_error("invalid_threadnum"); return false;
|
}
return true;
| }
return true;
|
}
/**
| }
/**
|
Zeile 501 | Zeile 497 |
---|
$profilefield['editableby'] = -1; }
|
$profilefield['editableby'] = -1; }
|
if(!is_member($profilefield['editableby'], array('usergroup' => $user['usergroup'], 'additionalgroups' => $user['additionalgroups'])))
| if(isset($user['usergroup']))
|
{
|
{
|
continue; }
| $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']) {
| // Does this field have a minimum post count? if(!isset($this->data['profile_fields_editable']) && !empty($profilefield['postnum']) && $profilefield['postnum'] > $user['postnum']) {
|
Zeile 521 | Zeile 534 |
---|
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 532 | Zeile 545 |
---|
} } elseif(($type == "multiselect" || $type == "checkbox") && $profile_fields[$field] == "" && $profilefield['required'] == 1 && !defined('IN_ADMINCP') && THIS_SCRIPT != "modcp.php")
|
} } elseif(($type == "multiselect" || $type == "checkbox") && $profile_fields[$field] == "" && $profilefield['required'] == 1 && !defined('IN_ADMINCP') && THIS_SCRIPT != "modcp.php")
|
{
| {
|
$this->set_error('missing_required_profile_field', array($profilefield['name'])); }
| $this->set_error('missing_required_profile_field', array($profilefield['name'])); }
|
Zeile 547 | Zeile 560 |
---|
if(!in_array(htmlspecialchars_uni($value), $expoptions)) { $this->set_error('bad_profile_field_values', array($profilefield['name']));
|
if(!in_array(htmlspecialchars_uni($value), $expoptions)) { $this->set_error('bad_profile_field_values', array($profilefield['name']));
|
}
| }
|
if($options) { $options .= "\n";
| if($options) { $options .= "\n";
|
Zeile 572 | Zeile 585 |
---|
$this->set_error('max_limit_reached', array($profilefield['name'], $profilefield['maxlength'])); }
|
$this->set_error('max_limit_reached', array($profilefield['name'], $profilefield['maxlength'])); }
|
if(!empty($profilefield['regex']) && !preg_match("#".$profilefield['regex']."#i", $profile_fields[$field]))
| if(!empty($profilefield['regex']) && !empty($profile_fields[$field]) && !preg_match("#".$profilefield['regex']."#i", $profile_fields[$field]))
|
{ $this->set_error('bad_profile_field_value', array($profilefield['name'])); }
| { $this->set_error('bad_profile_field_value', array($profilefield['name'])); }
|
Zeile 598 | Zeile 611 |
---|
$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']);
|
if(empty($referrer['uid']))
| if(!$referrer)
|
{ $this->set_error('invalid_referrer', array($user['referrer'])); return false; }
$user['referrer_uid'] = $referrer['uid'];
|
{ $this->set_error('invalid_referrer', array($user['referrer'])); return false; }
$user['referrer_uid'] = $referrer['uid'];
|
}
| }
|
else { $user['referrer_uid'] = 0;
| else { $user['referrer_uid'] = 0;
|
Zeile 624 | Zeile 637 |
---|
* @return boolean True when valid, false when invalid. */ function verify_options()
|
* @return boolean True when valid, false when invalid. */ function verify_options()
|
{
| {
|
global $mybb;
|
global $mybb;
|
|
|
$options = &$this->data['options'];
|
$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 675 | Zeile 693 |
---|
{ $options['dstcorrection'] = 0; }
|
{ $options['dstcorrection'] = 0; }
|
}
if($options['dstcorrection'] == 1) { $options['dst'] = 1; } else if($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['dst'] = 1; } elseif($options['dstcorrection'] == 0)
|
{
|
{
|
$options['threadmode'] = 'linear';
| $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.
| }
// Verify the "threads per page" option.
|
Zeile 707 | Zeile 718 |
---|
} $explodedtpp = explode(",", $mybb->settings['usertppoptions']); if(is_array($explodedtpp))
|
} $explodedtpp = explode(",", $mybb->settings['usertppoptions']); if(is_array($explodedtpp))
|
{
| {
|
@asort($explodedtpp); $biggest = $explodedtpp[count($explodedtpp)-1]; // Is the selected option greater than the allowed options?
| @asort($explodedtpp); $biggest = $explodedtpp[count($explodedtpp)-1]; // Is the selected option greater than the allowed options?
|
Zeile 756 | Zeile 767 |
---|
/** * Verifies if a registration date is valid or not.
|
/** * Verifies if a registration date is valid or not.
|
* * @return boolean True when valid, false when invalid. */
| * * @return boolean True when valid, false when invalid. */
|
function verify_regdate() { $regdate = &$this->data['regdate'];
| function verify_regdate() { $regdate = &$this->data['regdate'];
|
Zeile 780 | Zeile 791 |
---|
function verify_lastvisit() { $lastvisit = &$this->data['lastvisit'];
|
function verify_lastvisit() { $lastvisit = &$this->data['lastvisit'];
|
|
|
$lastvisit = (int)$lastvisit; // If the timestamp is below 0, set it to the current time. if($lastvisit <= 0) { $lastvisit = TIME_NOW;
|
$lastvisit = (int)$lastvisit; // If the timestamp is below 0, set it to the current time. 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 805 | Zeile 816 |
---|
if($lastactive <= 0) { $lastactive = TIME_NOW;
|
if($lastactive <= 0) { $lastactive = TIME_NOW;
|
} return true;
}
| } return true;
}
|
/** * Verifies if an away mode status is valid or not.
| /** * Verifies if an away mode status is valid or not.
|
Zeile 828 | Zeile 839 |
---|
$user['away']['returndate'] = 0; $user['away']['awayreason'] = ''; return true;
|
$user['away']['returndate'] = 0; $user['away']['awayreason'] = ''; return true;
|
} else if($user['away']['returndate']) {
| } elseif($user['away']['returndate']) { // Validate the awayreason length, since the db holds 200 chars for this field $reasonlength = my_strlen($user['away']['awayreason']); if($reasonlength > 200) { $this->set_error("away_too_long", array($reasonlength - 200)); return false; }
|
list($returnday, $returnmonth, $returnyear) = explode('-', $user['away']['returndate']); if(!$returnday || !$returnmonth || !$returnyear) {
| list($returnday, $returnmonth, $returnyear) = explode('-', $user['away']['returndate']); if(!$returnday || !$returnmonth || !$returnyear) {
|
Zeile 850 | Zeile 869 |
---|
* @return boolean True when valid, false when invalid. */ function verify_language()
|
* @return boolean True when valid, false when invalid. */ function verify_language()
|
{ global $lang;
| { global $lang;
|
$language = &$this->data['language'];
|
$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 872 | Zeile 891 |
---|
function verify_style() { global $lang;
|
function verify_style() { global $lang;
|
|
|
$user = &$this->data;
|
$user = &$this->data;
|
if($user['style'])
| if(!empty($user['style']))
|
{ $theme = get_theme($user['style']);
| { $theme = get_theme($user['style']);
|
Zeile 914 | Zeile 933 |
---|
* @return boolean True when timezone was valid, false otherwise */ function verify_timezone()
|
* @return boolean True when timezone was valid, false otherwise */ function verify_timezone()
|
{ $user = &$this->data;
| { global $mybb;
$user = &$this->data;
|
$timezones = get_supported_timezones();
|
$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 977 | Zeile 998 |
---|
if($this->method == "insert" || array_key_exists('website', $user)) { $this->verify_website();
|
if($this->method == "insert" || array_key_exists('website', $user)) { $this->verify_website();
|
} if($this->method == "insert" || array_key_exists('icq', $user)) { $this->verify_icq();
| |
} if($this->method == "insert" || (isset($user['birthday']) && is_array($user['birthday']))) {
| } if($this->method == "insert" || (isset($user['birthday']) && is_array($user['birthday']))) {
|
Zeile 1082 | Zeile 1099 |
---|
$user = &$this->data;
|
$user = &$this->data;
|
$array = array('postnum', 'threadnum', 'avatar', 'avatartype', 'additionalgroups', 'displaygroup', 'icq', 'aim', 'yahoo', 'skype', 'google', 'bday', 'signature', 'style', 'dateformat', 'timeformat', 'notepad');
| $array = array('postnum', 'threadnum', 'avatar', 'avatartype', 'additionalgroups', 'displaygroup', '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 1109 | Zeile 1141 |
---|
"lastactive" => (int)$user['lastactive'], "lastvisit" => (int)$user['lastvisit'], "website" => $db->escape_string($user['website']),
|
"lastactive" => (int)$user['lastactive'], "lastvisit" => (int)$user['lastvisit'], "website" => $db->escape_string($user['website']),
|
"icq" => (int)$user['icq'], "aim" => $db->escape_string($user['aim']), "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 1140 | Zeile 1169 |
---|
"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 1149 | Zeile 1179 |
---|
"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 1170 | Zeile 1199 |
---|
{ $this->user_insert_data['dst'] = 1; }
|
{ $this->user_insert_data['dst'] = 1; }
|
else if($user['options']['dstcorrection'] == 0)
| elseif($user['options']['dstcorrection'] == 0)
|
{ $this->user_insert_data['dst'] = 0; }
| { $this->user_insert_data['dst'] = 0; }
|
Zeile 1270 | Zeile 1299 |
---|
} 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 1321 | Zeile 1350 |
---|
{ $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['aim'])) { $this->user_update_data['aim'] = $db->escape_string($user['aim']); } 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']))
|
{
| {
|
$this->user_update_data['google'] = $db->escape_string($user['google']); } if(isset($user['bday'])) { $this->user_update_data['birthday'] = $user['bday'];
|
$this->user_update_data['google'] = $db->escape_string($user['google']); } if(isset($user['bday'])) { $this->user_update_data['birthday'] = $user['bday'];
|
}
| }
|
if(isset($user['birthdayprivacy']))
|
if(isset($user['birthdayprivacy']))
|
{
| {
|
$this->user_update_data['birthdayprivacy'] = $db->escape_string($user['birthdayprivacy']);
|
$this->user_update_data['birthdayprivacy'] = $db->escape_string($user['birthdayprivacy']);
|
}
| }
|
if(isset($user['style'])) { $this->user_update_data['style'] = (int)$user['style'];
|
if(isset($user['style'])) { $this->user_update_data['style'] = (int)$user['style'];
|
}
| }
|
if(isset($user['timezone'])) { $this->user_update_data['timezone'] = $db->escape_string($user['timezone']);
|
if(isset($user['timezone'])) { $this->user_update_data['timezone'] = $db->escape_string($user['timezone']);
|
}
| }
|
if(isset($user['dateformat']))
|
if(isset($user['dateformat']))
|
{
| {
|
$this->user_update_data['dateformat'] = $db->escape_string($user['dateformat']);
|
$this->user_update_data['dateformat'] = $db->escape_string($user['dateformat']);
|
}
| }
|
if(isset($user['timeformat']))
|
if(isset($user['timeformat']))
|
{
| {
|
$this->user_update_data['timeformat'] = $db->escape_string($user['timeformat']);
|
$this->user_update_data['timeformat'] = $db->escape_string($user['timeformat']);
|
}
| }
|
if(isset($user['regip']))
|
if(isset($user['regip']))
|
{ $this->user_update_data['regip'] = $db->escape_string($user['regip']); }
| { $this->user_update_data['regip'] = $db->escape_binary($user['regip']); } if(isset($user['lastip'])) { $this->user_update_data['lastip'] = $db->escape_binary($user['lastip']); }
|
if(isset($user['language'])) { $this->user_update_data['language'] = $db->escape_string($user['language']);
|
if(isset($user['language'])) { $this->user_update_data['language'] = $db->escape_string($user['language']);
|
}
| }
|
if(isset($user['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']);
|
if(isset($user['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']);
|
}
| }
|
if(isset($user['notepad'])) { $this->user_update_data['notepad'] = $db->escape_string($user['notepad']);
| if(isset($user['notepad'])) { $this->user_update_data['notepad'] = $db->escape_string($user['notepad']);
|
Zeile 1403 | Zeile 1424 |
---|
$old_user = get_user($user['uid']);
// If old user has new pmnotice and new user has = yes, keep old value
|
$old_user = get_user($user['uid']);
// If old user has new pmnotice and new user has = yes, keep old value
|
if($old_user['pmnotice'] == "2" && $this->user_update_data['pmnotice'] == 1) {
| if(isset($this->user_update_data['pmnotice']) && $old_user['pmnotice'] == "2" && $this->user_update_data['pmnotice'] == 1) {
|
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; }
if(count($this->user_update_data) > 0)
|
return false; }
if(count($this->user_update_data) > 0)
|
{
| {
|
// Actual updating happens here. $db->update_query("users", $this->user_update_data, "uid='{$user['uid']}'");
|
// 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(); }
if(isset($user['usergroup']) && (int)$user['usergroup'] == 5)
|
$cache->update_birthdays(); }
if(isset($user['usergroup']) && (int)$user['usergroup'] == 5)
|
{
| {
|
$cache->update_awaitingactivation(); }
| $cache->update_awaitingactivation(); }
|
Zeile 1437 | Zeile 1458 |
---|
{ $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']
|
Zeile 1582 | Zeile 1603 |
---|
$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 1741 | Zeile 1761 |
---|
$update = array( "website" => "", "birthday" => "",
|
$update = array( "website" => "", "birthday" => "",
|
"icq" => "", "aim" => "", "yahoo" => "",
| |
"skype" => "", "google" => "", "usertitle" => "",
| "skype" => "", "google" => "", "usertitle" => "",
|
Zeile 1785 | Zeile 1802 |
---|
public function verify_signature() { global $mybb, $parser;
|
public function verify_signature() { global $mybb, $parser;
|
| if(!isset($this->data['signature'])) { return true; }
|
if(!isset($parser)) { require_once MYBB_ROOT."inc/class_parser.php"; $parser = new postParser;
|
if(!isset($parser)) { require_once MYBB_ROOT."inc/class_parser.php"; $parser = new postParser;
|
}
| }
|
$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 1810 | Zeile 1831 |
---|
) { $imgsallowed = 0;
|
) { $imgsallowed = 0;
|
|
|
if($mybb->settings['sigimgcode'] == 1) { $imgsallowed = $mybb->settings['maxsigimages'];
| if($mybb->settings['sigimgcode'] == 1) { $imgsallowed = $mybb->settings['maxsigimages'];
|
Zeile 1821 | Zeile 1842 |
---|
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 { $parsed_sig = $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'])
| 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'); }
|
} }
| } }
|