Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: user.php 5625 2011-10-02 19:16:35Z ralgith $
| * $Id$
|
*/
// Disallow direct access to this file for security reasons
| */
// Disallow direct access to this file for security reasons
|
Zeile 183 | Zeile 183 |
---|
// First, see if there is one or more complex character(s) in the password. if(!preg_match("/^.*(?=.{".$mybb->settings['minpasswordlength'].",})(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).*$/", $user['password'])) {
|
// First, see if there is one or more complex character(s) in the password. if(!preg_match("/^.*(?=.{".$mybb->settings['minpasswordlength'].",})(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).*$/", $user['password'])) {
|
$this->set_error('no_complex_characters');
| $this->set_error('no_complex_characters', array($mybb->settings['minpasswordlength']));
|
return false; } }
| return false; } }
|
Zeile 419 | Zeile 419 |
---|
} return true; }
|
} return true; }
|
| /** * Verifies if the birthday privacy option is valid or not. * * @return boolean True when valid, false when invalid. */ function verify_birthday_privacy() { $birthdayprivacy = &$this->data['birthdayprivacy']; $accepted = array( 'none', 'age', 'all');
if(!in_array($birthdayprivacy, $accepted)) { $this->set_error("invalid_birthday_privacy"); return false; } return true; }
|
/** * Verifies if the post count field is filled in correctly. *
| /** * Verifies if the post count field is filled in correctly. *
|
Zeile 483 | Zeile 504 |
---|
} } 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 496 | Zeile 517 |
---|
foreach($profile_fields[$field] as $value) { if(!in_array(htmlspecialchars_uni($value), $expoptions))
|
foreach($profile_fields[$field] as $value) { if(!in_array(htmlspecialchars_uni($value), $expoptions))
|
{
| {
|
$this->set_error('bad_profile_field_values', array($profilefield['name'])); } if($options)
| $this->set_error('bad_profile_field_values', array($profilefield['name'])); } if($options)
|
Zeile 523 | Zeile 544 |
---|
$this->set_error('max_limit_reached', array($profilefield['name'], $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 { 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]); } $user['user_fields'][$field] = $options;
| $options = $db->escape_string($profile_fields[$field]); } $user['user_fields'][$field] = $options;
|
Zeile 726 | Zeile 752 |
---|
if($lastvisit <= 0) { $lastvisit = TIME_NOW;
|
if($lastvisit <= 0) { $lastvisit = TIME_NOW;
|
} return true;
| } return true;
|
}
/**
| }
/**
|
Zeile 752 | Zeile 778 |
---|
/** * Verifies if an away mode status is valid or not.
|
/** * Verifies if an away mode status is valid or not.
|
* * @return boolean True when valid, false when invalid. */
| * * @return boolean True when valid, false when invalid. */
|
function verify_away() { global $mybb;
| function verify_away() { global $mybb;
|
Zeile 780 | Zeile 806 |
---|
// 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);
|
}
| }
|
return true; }
| return true; }
|
Zeile 793 | Zeile 819 |
---|
{ 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 831 | Zeile 857 |
---|
{ global $mybb, $plugins;
|
{ global $mybb, $plugins;
|
$user = &$this->data;
| $user = &$this->data;
|
// First, grab the old user details if this user exists if($user['uid']) {
| // First, grab the old user details if this user exists if($user['uid']) {
|
Zeile 855 | Zeile 881 |
---|
if($this->method == "insert" || array_key_exists('usertitle', $user)) { $this->verify_usertitle();
|
if($this->method == "insert" || array_key_exists('usertitle', $user)) { $this->verify_usertitle();
|
}
| }
|
if($this->method == "insert" || array_key_exists('password', $user)) { $this->verify_password();
| if($this->method == "insert" || array_key_exists('password', $user)) { $this->verify_password();
|
Zeile 877 | Zeile 903 |
---|
$this->verify_icq(); } if($this->method == "insert" || array_key_exists('msn', $user))
|
$this->verify_icq(); } if($this->method == "insert" || array_key_exists('msn', $user))
|
{
| {
|
$this->verify_msn();
|
$this->verify_msn();
|
}
| }
|
if($this->method == "insert" || is_array($user['birthday'])) { $this->verify_birthday();
|
if($this->method == "insert" || is_array($user['birthday'])) { $this->verify_birthday();
|
}
| }
|
if($this->method == "insert" || array_key_exists('postnum', $user)) { $this->verify_postnum(); } if($this->method == "insert" || array_key_exists('profile_fields', $user))
|
if($this->method == "insert" || array_key_exists('postnum', $user)) { $this->verify_postnum(); } if($this->method == "insert" || array_key_exists('profile_fields', $user))
|
{
| {
|
$this->verify_profile_fields(); } if($this->method == "insert" || array_key_exists('referrer', $user))
| $this->verify_profile_fields(); } if($this->method == "insert" || array_key_exists('referrer', $user))
|
Zeile 911 | Zeile 937 |
---|
if($this->method == "insert" || array_key_exists('lastactive', $user)) { $this->verify_lastactive();
|
if($this->method == "insert" || array_key_exists('lastactive', $user)) { $this->verify_lastactive();
|
}
| }
|
if($this->method == "insert" || array_key_exists('away', $user))
|
if($this->method == "insert" || array_key_exists('away', $user))
|
{
| {
|
$this->verify_away(); } if($this->method == "insert" || array_key_exists('language', $user))
|
$this->verify_away(); } if($this->method == "insert" || array_key_exists('language', $user))
|
{
| {
|
$this->verify_language(); } if($this->method == "insert" && array_key_exists('regcheck1', $user) && array_key_exists('regcheck2', $user))
|
$this->verify_language(); } if($this->method == "insert" && array_key_exists('regcheck1', $user) && array_key_exists('regcheck2', $user))
|
{
| {
|
$this->verify_checkfields();
|
$this->verify_checkfields();
|
| } if(array_key_exists('birthdayprivacy', $user)) { $this->verify_birthday_privacy();
|
}
|
}
|
$plugins->run_hooks_by_ref("datahandler_user_validate", $this);
| $plugins->run_hooks("datahandler_user_validate", $this);
|
// We are done validating, return. $this->set_validated(true);
| // We are done validating, return. $this->set_validated(true);
|
Zeile 974 | Zeile 1004 |
---|
"regdate" => intval($user['regdate']), "lastactive" => intval($user['lastactive']), "lastvisit" => intval($user['lastvisit']),
|
"regdate" => intval($user['regdate']), "lastactive" => intval($user['lastactive']), "lastvisit" => intval($user['lastvisit']),
|
"website" => $db->escape_string(htmlspecialchars($user['website'])),
| "website" => $db->escape_string(htmlspecialchars_uni($user['website'])),
|
"icq" => intval($user['icq']),
|
"icq" => intval($user['icq']),
|
"aim" => $db->escape_string(htmlspecialchars($user['aim'])), "yahoo" => $db->escape_string(htmlspecialchars($user['yahoo'])), "msn" => $db->escape_string(htmlspecialchars($user['msn'])),
| "aim" => $db->escape_string(htmlspecialchars_uni($user['aim'])), "yahoo" => $db->escape_string(htmlspecialchars_uni($user['yahoo'])), "msn" => $db->escape_string(htmlspecialchars_uni($user['msn'])),
|
"birthday" => $user['bday'], "signature" => $db->escape_string($user['signature']), "allownotices" => $user['options']['allownotices'],
| "birthday" => $user['bday'], "signature" => $db->escape_string($user['signature']), "allownotices" => $user['options']['allownotices'],
|
Zeile 1036 | Zeile 1066 |
---|
$this->user_insert_data['dst'] = 0; }
|
$this->user_insert_data['dst'] = 0; }
|
$plugins->run_hooks_by_ref("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);
|
Zeile 1146 | Zeile 1176 |
---|
$this->user_update_data['lastactive'] = intval($user['lastactive']); } if(isset($user['lastvisit']))
|
$this->user_update_data['lastactive'] = intval($user['lastactive']); } if(isset($user['lastvisit']))
|
{
| {
|
$this->user_update_data['lastvisit'] = intval($user['lastvisit']);
|
$this->user_update_data['lastvisit'] = intval($user['lastvisit']);
|
}
| }
|
if(isset($user['signature']))
|
if(isset($user['signature']))
|
{
| {
|
$this->user_update_data['signature'] = $db->escape_string($user['signature']); } if(isset($user['website'])) {
|
$this->user_update_data['signature'] = $db->escape_string($user['signature']); } if(isset($user['website'])) {
|
$this->user_update_data['website'] = $db->escape_string(htmlspecialchars($user['website']));
| $this->user_update_data['website'] = $db->escape_string(htmlspecialchars_uni($user['website']));
|
} if(isset($user['icq'])) { $this->user_update_data['icq'] = intval($user['icq']);
|
} if(isset($user['icq'])) { $this->user_update_data['icq'] = intval($user['icq']);
|
}
| }
|
if(isset($user['aim']))
|
if(isset($user['aim']))
|
{ $this->user_update_data['aim'] = $db->escape_string(htmlspecialchars($user['aim']));
| { $this->user_update_data['aim'] = $db->escape_string(htmlspecialchars_uni($user['aim']));
|
} if(isset($user['yahoo']))
|
} if(isset($user['yahoo']))
|
{ $this->user_update_data['yahoo'] = $db->escape_string(htmlspecialchars($user['yahoo']));
| { $this->user_update_data['yahoo'] = $db->escape_string(htmlspecialchars_uni($user['yahoo']));
|
} if(isset($user['msn'])) {
|
} if(isset($user['msn'])) {
|
$this->user_update_data['msn'] = $db->escape_string(htmlspecialchars($user['msn']));
| $this->user_update_data['msn'] = $db->escape_string(htmlspecialchars_uni($user['msn']));
|
} if(isset($user['bday'])) { $this->user_update_data['birthday'] = $user['bday'];
|
} if(isset($user['bday'])) { $this->user_update_data['birthday'] = $user['bday'];
|
}
| }
|
if(isset($user['birthdayprivacy'])) { $this->user_update_data['birthdayprivacy'] = $db->escape_string($user['birthdayprivacy']);
| if(isset($user['birthdayprivacy'])) { $this->user_update_data['birthdayprivacy'] = $db->escape_string($user['birthdayprivacy']);
|
Zeile 1202 | Zeile 1232 |
---|
$this->user_update_data['regip'] = $db->escape_string($user['regip']); } if(isset($user['language']))
|
$this->user_update_data['regip'] = $db->escape_string($user['regip']); } if(isset($user['language']))
|
{
| {
|
$this->user_update_data['language'] = $db->escape_string($user['language']);
|
$this->user_update_data['language'] = $db->escape_string($user['language']);
|
}
| }
|
if(isset($user['away']))
|
if(isset($user['away']))
|
{
| {
|
$this->user_update_data['away'] = $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['away'] = $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']);
|
Zeile 1215 | Zeile 1245 |
---|
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']);
|
}
| }
|
if(isset($user['usernotes']))
|
if(isset($user['usernotes']))
|
{
| {
|
$this->user_update_data['usernotes'] = $db->escape_string($user['usernotes']);
|
$this->user_update_data['usernotes'] = $db->escape_string($user['usernotes']);
|
}
| }
|
if(is_array($user['options'])) { foreach($user['options'] as $option => $value)
| if(is_array($user['options'])) { foreach($user['options'] as $option => $value)
|
Zeile 1228 | Zeile 1258 |
---|
} } if(array_key_exists('coppa_user', $user))
|
} } if(array_key_exists('coppa_user', $user))
|
{
| {
|
$this->user_update_data['coppauser'] = intval($user['coppa_user']); } // First, grab the old user details for later use.
| $this->user_update_data['coppauser'] = intval($user['coppa_user']); } // First, grab the old user details for later use.
|
Zeile 1240 | Zeile 1270 |
---|
unset($this->user_update_data['pmnotice']); }
|
unset($this->user_update_data['pmnotice']); }
|
$plugins->run_hooks_by_ref("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'])) {
|
Zeile 1254 | Zeile 1284 |
---|
} $cache->update_moderators();
|
} $cache->update_moderators();
|
if(isset($user['bday']))
| if(isset($user['bday']) || isset($user['username']))
|
{ $cache->update_birthdays(); }
| { $cache->update_birthdays(); }
|