Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: user.php 4384 2009-06-19 11:49:42Z Tomm $
| * $Id: user.php 5379 2011-02-21 11:06:42Z Tomm $
|
*/
// Disallow direct access to this file for security reasons
| */
// Disallow direct access to this file for security reasons
|
Zeile 170 | Zeile 170 |
---|
$user = &$this->data;
// Always check for the length of the password.
|
$user = &$this->data;
// Always check for the length of the password.
|
if(my_strlen($user['password']) < $mybb->settings['minpasswordlength'])
| if(my_strlen($user['password']) < $mybb->settings['minpasswordlength'] || my_strlen($user['password']) > $mybb->settings['maxpasswordlength'])
|
{ $this->set_error('invalid_password_length', array($mybb->settings['minpasswordlength'], $mybb->settings['maxpasswordlength'])); return false;
| { $this->set_error('invalid_password_length', array($mybb->settings['minpasswordlength'], $mybb->settings['maxpasswordlength'])); return false;
|
Zeile 270 | Zeile 270 |
---|
$this->set_error("emails_dont_match"); return false; }
|
$this->set_error("emails_dont_match"); return false; }
|
| return true;
|
}
/**
| }
/**
|
Zeile 355 | Zeile 357 |
---|
$birthday['year'] = intval($birthday['year']);
// Error if a day and month exists, and the birthday day and range is not in range
|
$birthday['year'] = intval($birthday['year']);
// Error if a day and month exists, and the birthday day and range is not in range
|
if($birthday['day'] < 1 || $birthday['day'] > 31 || $birthday['month'] < 1 || $birthday['month'] > 12 || ($birthday['month'] == 2 && $birthday['day'] > 29))
| if($birthday['day'] != 0 || $birthday['month'] != 0)
|
{
|
{
|
$this->set_error("invalid_birthday"); return false;
| if($birthday['day'] < 1 || $birthday['day'] > 31 || $birthday['month'] < 1 || $birthday['month'] > 12 || ($birthday['month'] == 2 && $birthday['day'] > 29)) { $this->set_error("invalid_birthday"); return false; }
|
}
// Check if the day actually exists.
| }
// Check if the day actually exists.
|
Zeile 373 | Zeile 378 |
---|
if($birthday['year'] != 0 && ($birthday['year'] < (date("Y")-100)) || $birthday['year'] > date("Y")) { $this->set_error("invalid_birthday");
|
if($birthday['year'] != 0 && ($birthday['year'] < (date("Y")-100)) || $birthday['year'] > date("Y")) { $this->set_error("invalid_birthday");
|
return false; }
| return false; } else if($birthday['year'] == date("Y")) { // Error if birth date is in future if($birthday['month'] > date("m") || ($birthday['month'] == date("m") && $bithday['day'] > date("d"))) { $this->set_error("invalid_birthday"); return false; } }
// Error if COPPA is on, and the user hasn't verified their age / under 13 if($mybb->settings['coppa'] == "enabled" && ($birthday['year'] == 0 || !$birthday['year'])) { $this->set_error("invalid_birthday_coppa"); return false; } elseif(($mybb->settings['coppa'] == "deny" || $mybb->settings['coppa'] == "enabled") && $birthday['year'] > (date("Y")-13)) { $this->set_error("invalid_birthday_coppa2"); return false; }
|
// Make the user's birthday field if($birthday['year'] != 0) { // If the year is specified, put together a d-m-y string $user['bday'] = $birthday['day']."-".$birthday['month']."-".$birthday['year'];
|
// Make the user's birthday field if($birthday['year'] != 0) { // If the year is specified, put together a d-m-y string $user['bday'] = $birthday['day']."-".$birthday['month']."-".$birthday['year'];
|
}
| }
|
elseif($birthday['day'] && $birthday['month']) { // If only a day and month are specified, put together a d-m string $user['bday'] = $birthday['day']."-".$birthday['month']."-"; } else
|
elseif($birthday['day'] && $birthday['month']) { // If only a day and month are specified, put together a d-m string $user['bday'] = $birthday['day']."-".$birthday['month']."-"; } else
|
{
| {
|
// No field is specified, so return an empty string for an unknown birthday $user['bday'] = ''; } return true; }
|
// No field is specified, so return an empty string for an unknown birthday $user['bday'] = ''; } return true; }
|
| /** * Verifies if the post count field is filled in correctly. * * @return boolean True when valid, false when invalid. */ function verify_postnum() { $user = &$this->data; if($user['postnum'] < 0) { $this->set_error("invalid_postnum"); return false; } return true; }
|
/** * Verifies if a profile fields are filled in correctly. *
| /** * Verifies if a profile fields are filled in correctly. *
|
Zeile 406 | Zeile 450 |
---|
$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. $userfields = array(); $comma = '';
| // Loop through profile fields checking if they exist or not and are filled in. $userfields = array(); $comma = '';
|
Zeile 432 | Zeile 476 |
---|
$field = "fid{$profilefield['fid']}";
// If the profile field is required, but not filled in, present error.
|
$field = "fid{$profilefield['fid']}";
// If the profile field is required, but not filled in, present error.
|
if(trim($profile_fields[$field]) == "" && $profilefield['required'] == 1 && !defined('IN_ADMINCP')) {
| if($type != "multiselect" && $type != "checkbox") { if(trim($profile_fields[$field]) == "" && $profilefield['required'] == 1 && !defined('IN_ADMINCP')) { $this->set_error('missing_required_profile_field', array($profilefield['name'])); } } elseif(($type == "multiselect" || $type == "checkbox") && $profile_fields[$field] == "" && $profilefield['required'] == 1 && !defined('IN_ADMINCP')) {
|
$this->set_error('missing_required_profile_field', array($profilefield['name'])); }
// Sort out multiselect/checkbox profile fields. $options = ''; if(($type == "multiselect" || $type == "checkbox") && is_array($profile_fields[$field]))
|
$this->set_error('missing_required_profile_field', array($profilefield['name'])); }
// Sort out multiselect/checkbox profile fields. $options = ''; if(($type == "multiselect" || $type == "checkbox") && is_array($profile_fields[$field]))
|
{ $expoptions = explode("\n", $thing[1]);
| { $expoptions = explode("\n", $thing[1]);
|
$expoptions = array_map('trim', $expoptions); foreach($profile_fields[$field] as $value) {
| $expoptions = array_map('trim', $expoptions); foreach($profile_fields[$field] as $value) {
|
Zeile 464 | Zeile 515 |
---|
{ $this->set_error('bad_profile_field_values', array($profilefield['name'])); }
|
{ $this->set_error('bad_profile_field_values', array($profilefield['name'])); }
|
| $options = $db->escape_string($profile_fields[$field]); } elseif($type == "textarea") { if($profilefield['maxlength'] > 0 && my_strlen($profile_fields[$field]) > $profilefield['maxlength']) { $this->set_error('max_limit_reached', array($profilefield['name'], $profilefield['maxlength'])); }
|
$options = $db->escape_string($profile_fields[$field]); } else
| $options = $db->escape_string($profile_fields[$field]); } else
|
Zeile 471 | Zeile 531 |
---|
$options = $db->escape_string($profile_fields[$field]); } $user['user_fields'][$field] = $options;
|
$options = $db->escape_string($profile_fields[$field]); } $user['user_fields'][$field] = $options;
|
}
return true; }
| }
return true; }
|
/** * Verifies if an optionally entered referrer exists or not. *
| /** * Verifies if an optionally entered referrer exists or not. *
|
Zeile 716 | Zeile 776 |
---|
if(!$returnday || !$returnmonth || !$returnyear) { $this->set_error("missing_returndate");
|
if(!$returnday || !$returnmonth || !$returnyear) { $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); } return true; }
|
/** * Verifies if a langage is valid for this user or not.
|
/** * Verifies if a langage 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() {
| */ function verify_language() {
|
Zeile 746 | Zeile 811 |
---|
* @return boolean True when valid, false when invalid. */ function verify_checkfields()
|
* @return boolean True when valid, false when invalid. */ function verify_checkfields()
|
{ $user = &$this->data;
| { $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 773 | Zeile 838 |
---|
if($user['uid']) { $old_user = get_user($user['uid']);
|
if($user['uid']) { $old_user = get_user($user['uid']);
|
}
| }
|
if($this->method == "insert" || array_key_exists('username', $user)) {
| if($this->method == "insert" || array_key_exists('username', $user)) {
|
Zeile 789 | Zeile 854 |
---|
} } if($this->method == "insert" || array_key_exists('usertitle', $user))
|
} } if($this->method == "insert" || array_key_exists('usertitle', $user))
|
{
| {
|
$this->verify_usertitle(); } if($this->method == "insert" || array_key_exists('password', $user))
| $this->verify_usertitle(); } if($this->method == "insert" || array_key_exists('password', $user))
|
Zeile 815 | Zeile 880 |
---|
if($this->method == "insert" || array_key_exists('msn', $user)) { $this->verify_msn();
|
if($this->method == "insert" || array_key_exists('msn', $user)) { $this->verify_msn();
|
| } if($this->method == "insert" || array_key_exists('postnum', $user)) { $this->verify_postnum();
|
} if($this->method == "insert" || is_array($user['birthday'])) {
| } if($this->method == "insert" || is_array($user['birthday'])) {
|
Zeile 1158 | Zeile 1227 |
---|
$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'] == "new" && $this->user_update_data['pmnotice'] == 1)
| if($old_user['pmnotice'] == "2" && $this->user_update_data['pmnotice'] == 1)
|
{ unset($this->user_update_data['pmnotice']); }
| { unset($this->user_update_data['pmnotice']); }
|