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.
| }
// See if the board has "require complex passwords" enabled.
|
Zeile 376 | Zeile 381 |
---|
$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 468 | Zeile 473 |
---|
if(isset($user['threadnum']) && $user['threadnum'] < 0) { $this->set_error("invalid_threadnum");
|
if(isset($user['threadnum']) && $user['threadnum'] < 0) { $this->set_error("invalid_threadnum");
|
return false; }
return true; }
| return false; }
return true; }
|
/** * Verifies if a profile fields are filled in correctly. *
| /** * Verifies if a profile fields are filled in correctly. *
|
Zeile 482 | Zeile 487 |
---|
function verify_profile_fields() { global $db, $cache;
|
function verify_profile_fields() { global $db, $cache;
|
|
|
$user = &$this->data; $profile_fields = &$this->data['profile_fields'];
|
$user = &$this->data; $profile_fields = &$this->data['profile_fields'];
|
|
|
// Loop through profile fields checking if they exist or not and are filled in.
|
// Loop through profile fields checking if they exist or not and are filled in.
|
|
|
// Fetch all profile fields first. $pfcache = $cache->read('profilefields');
| // Fetch all profile fields first. $pfcache = $cache->read('profilefields');
|
Zeile 497 | Zeile 502 |
---|
foreach($pfcache as $profilefield) { if(isset($this->data['profile_fields_editable']) || isset($this->data['registration']) && ($profilefield['required'] == 1 || $profilefield['registration'] == 1))
|
foreach($pfcache as $profilefield) { if(isset($this->data['profile_fields_editable']) || isset($this->data['registration']) && ($profilefield['required'] == 1 || $profilefield['registration'] == 1))
|
{
| {
|
$profilefield['editableby'] = -1; }
if(!is_member($profilefield['editableby'], array('usergroup' => $user['usergroup'], 'additionalgroups' => $user['additionalgroups'])))
|
$profilefield['editableby'] = -1; }
if(!is_member($profilefield['editableby'], array('usergroup' => $user['usergroup'], 'additionalgroups' => $user['additionalgroups'])))
|
{
| {
|
continue; }
| continue; }
|
Zeile 572 | Zeile 577 |
---|
$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 609 | Zeile 614 |
---|
}
$user['referrer_uid'] = $referrer['uid'];
|
}
$user['referrer_uid'] = $referrer['uid'];
|
} else { $user['referrer_uid'] = 0; }
return true;
| } else { $user['referrer_uid'] = 0; }
return true;
|
}
/**
| }
/**
|
Zeile 651 | Zeile 656 |
---|
if($mybb->settings['postlayout'] == 'classic') { $this->verify_yesno_option($options, 'classicpostbit', 1);
|
if($mybb->settings['postlayout'] == 'classic') { $this->verify_yesno_option($options, 'classicpostbit', 1);
|
}
| }
|
else { $this->verify_yesno_option($options, 'classicpostbit', 0);
|
else { $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 668 | Zeile 673 |
---|
}
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;
|
if($options['dstcorrection'] == 1) { $options['dst'] = 1;
|
} else if($options['dstcorrection'] == 0)
| } elseif($options['dstcorrection'] == 0)
|
{ $options['dst'] = 0; }
if($this->method == "insert" || (isset($options['threadmode']) && $options['threadmode'] != "linear" && $options['threadmode'] != "threaded"))
|
{ $options['dst'] = 0; }
if($this->method == "insert" || (isset($options['threadmode']) && $options['threadmode'] != "linear" && $options['threadmode'] != "threaded"))
|
{
| {
|
if($mybb->settings['threadusenetstyle']) { $options['threadmode'] = 'threaded';
| if($mybb->settings['threadusenetstyle']) { $options['threadmode'] = 'threaded';
|
Zeile 722 | Zeile 727 |
---|
if($this->method == "insert" || (array_key_exists('ppp', $options) && $mybb->settings['userpppoptions'])) { if(!isset($options['ppp']))
|
if($this->method == "insert" || (array_key_exists('ppp', $options) && $mybb->settings['userpppoptions'])) { if(!isset($options['ppp']))
|
{
| {
|
$options['ppp'] = 0; } $explodedppp = explode(",", $mybb->settings['userpppoptions']);
| $options['ppp'] = 0; } $explodedppp = explode(",", $mybb->settings['userpppoptions']);
|
Zeile 756 | Zeile 761 |
---|
/** * 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() {
| */ function verify_regdate() {
|
Zeile 766 | Zeile 771 |
---|
$regdate = (int)$regdate; // If the timestamp is below 0, set it to the current time. if($regdate <= 0)
|
$regdate = (int)$regdate; // If the timestamp is below 0, set it to the current time. if($regdate <= 0)
|
{
| {
|
$regdate = TIME_NOW; } return true;
| $regdate = TIME_NOW; } return true;
|
Zeile 774 | Zeile 779 |
---|
/** * Verifies if a last visit date is valid or not.
|
/** * Verifies if a last visit date is valid or not.
|
* * @return boolean True when valid, false when invalid.
| * * @return boolean True when valid, false when invalid.
|
*/ function verify_lastvisit() {
| */ function verify_lastvisit() {
|
Zeile 784 | Zeile 789 |
---|
$lastvisit = (int)$lastvisit; // If the timestamp is below 0, set it to the current time. if($lastvisit <= 0)
|
$lastvisit = (int)$lastvisit; // If the timestamp is below 0, set it to the current time. if($lastvisit <= 0)
|
{
| {
|
$lastvisit = TIME_NOW; } return true;
|
$lastvisit = TIME_NOW; } return true;
|
|
|
}
/** * Verifies if a last active date is valid or not.
|
}
/** * Verifies if a last active date is valid or not.
|
*
| *
|
* @return boolean True when valid, false when invalid. */ function verify_lastactive()
| * @return boolean True when valid, false when invalid. */ function verify_lastactive()
|
Zeile 829 | Zeile 834 |
---|
$user['away']['awayreason'] = ''; return true; }
|
$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 1082 | Zeile 1095 |
---|
$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', 'icq', 'yahoo', 'skype', 'google', 'bday', 'signature', 'style', 'dateformat', 'timeformat', 'notepad');
|
foreach($array as $value) { if(!isset($user[$value]))
| foreach($array as $value) { if(!isset($user[$value]))
|
Zeile 1110 | Zeile 1123 |
---|
"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'],
|
"aim" => $db->escape_string($user['aim']),
| |
"yahoo" => $db->escape_string($user['yahoo']), "skype" => $db->escape_string($user['skype']), "google" => $db->escape_string($user['google']),
| "yahoo" => $db->escape_string($user['yahoo']), "skype" => $db->escape_string($user['skype']), "google" => $db->escape_string($user['google']),
|
Zeile 1170 | Zeile 1182 |
---|
{ $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 1184 | Zeile 1196 |
---|
$pfcache = $cache->read('profilefields');
if(is_array($pfcache))
|
$pfcache = $cache->read('profilefields');
if(is_array($pfcache))
|
{
| {
|
foreach($pfcache as $profile_field) { if(array_key_exists("fid{$profile_field['fid']}", $user['user_fields']))
| foreach($pfcache as $profile_field) { if(array_key_exists("fid{$profile_field['fid']}", $user['user_fields']))
|
Zeile 1236 | Zeile 1248 |
---|
function update_user() { global $db, $plugins, $cache;
|
function update_user() { global $db, $plugins, $cache;
|
|
|
// Yes, validating is required. if(!$this->get_validated()) {
| // Yes, validating is required. if(!$this->get_validated()) {
|
Zeile 1246 | Zeile 1258 |
---|
{ die("The user is not valid."); }
|
{ die("The user is not valid."); }
|
|
|
$user = &$this->data; $user['uid'] = (int)$user['uid']; $this->uid = $user['uid'];
// Set up the update data. if(isset($user['username']))
|
$user = &$this->data; $user['uid'] = (int)$user['uid']; $this->uid = $user['uid'];
// Set up the update data. if(isset($user['username']))
|
{
| {
|
$this->user_update_data['username'] = $db->escape_string($user['username']);
|
$this->user_update_data['username'] = $db->escape_string($user['username']);
|
}
| }
|
if(isset($user['password']))
|
if(isset($user['password']))
|
{
| {
|
$this->user_update_data['password'] = $user['password'];
|
$this->user_update_data['password'] = $user['password'];
|
}
| }
|
if(isset($user['salt']))
|
if(isset($user['salt']))
|
{
| {
|
$this->user_update_data['salt'] = $user['salt']; } if(isset($user['loginkey']))
| $this->user_update_data['salt'] = $user['salt']; } if(isset($user['loginkey']))
|
Zeile 1271 | Zeile 1283 |
---|
if(isset($user['email'])) { $this->user_update_data['email'] = $user['email'];
|
if(isset($user['email'])) { $this->user_update_data['email'] = $user['email'];
|
}
| }
|
if(isset($user['postnum']))
|
if(isset($user['postnum']))
|
{
| {
|
$this->user_update_data['postnum'] = (int)$user['postnum'];
|
$this->user_update_data['postnum'] = (int)$user['postnum'];
|
}
| }
|
if(isset($user['threadnum']))
|
if(isset($user['threadnum']))
|
{
| {
|
$this->user_update_data['threadnum'] = (int)$user['threadnum'];
|
$this->user_update_data['threadnum'] = (int)$user['threadnum'];
|
}
| }
|
if(isset($user['avatar']))
|
if(isset($user['avatar']))
|
{
| {
|
$this->user_update_data['avatar'] = $db->escape_string($user['avatar']); $this->user_update_data['avatartype'] = $db->escape_string($user['avatartype']); } if(isset($user['usergroup'])) { $this->user_update_data['usergroup'] = (int)$user['usergroup'];
|
$this->user_update_data['avatar'] = $db->escape_string($user['avatar']); $this->user_update_data['avatartype'] = $db->escape_string($user['avatartype']); } if(isset($user['usergroup'])) { $this->user_update_data['usergroup'] = (int)$user['usergroup'];
|
}
| }
|
if(isset($user['additionalgroups']))
|
if(isset($user['additionalgroups']))
|
{
| {
|
$this->user_update_data['additionalgroups'] = $db->escape_string($user['additionalgroups']);
|
$this->user_update_data['additionalgroups'] = $db->escape_string($user['additionalgroups']);
|
}
| }
|
if(isset($user['displaygroup']))
|
if(isset($user['displaygroup']))
|
{
| {
|
$this->user_update_data['displaygroup'] = (int)$user['displaygroup'];
|
$this->user_update_data['displaygroup'] = (int)$user['displaygroup'];
|
}
| }
|
if(isset($user['usertitle'])) { $this->user_update_data['usertitle'] = $db->escape_string($user['usertitle']);
| if(isset($user['usertitle'])) { $this->user_update_data['usertitle'] = $db->escape_string($user['usertitle']);
|
Zeile 1306 | Zeile 1318 |
---|
$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']; } if(isset($user['lastvisit']))
| $this->user_update_data['lastactive'] = (int)$user['lastactive']; } if(isset($user['lastvisit']))
|
Zeile 1324 | Zeile 1336 |
---|
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['aim'])) { $this->user_update_data['aim'] = $db->escape_string($user['aim']);
| |
} if(isset($user['yahoo'])) {
| } if(isset($user['yahoo'])) {
|
Zeile 1742 | Zeile 1750 |
---|
"website" => "", "birthday" => "", "icq" => "",
|
"website" => "", "birthday" => "", "icq" => "",
|
"aim" => "",
| |
"yahoo" => "", "skype" => "", "google" => "",
| "yahoo" => "", "skype" => "", "google" => "",
|
Zeile 1821 | Zeile 1828 |
---|
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 {
|