Zeile 314 | 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 400 | 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
| }
// Make the user's birthday field
|
Zeile 464 | Zeile 446 |
---|
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 480 | Zeile 462 |
---|
$user = &$this->data;
if(isset($user['threadnum']) && $user['threadnum'] < 0)
|
$user = &$this->data;
if(isset($user['threadnum']) && $user['threadnum'] < 0)
|
{
| {
|
$this->set_error("invalid_threadnum"); return false; }
|
$this->set_error("invalid_threadnum"); return false; }
|
|
|
return true; }
| return true; }
|
Zeile 496 | Zeile 478 |
---|
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'];
|
Zeile 528 | Zeile 510 |
---|
$additionalgroups = $user['additionalgroups']; } else
|
$additionalgroups = $user['additionalgroups']; } else
|
{
| {
|
$additionalgroups = ''; }
| $additionalgroups = ''; }
|
Zeile 560 | Zeile 542 |
---|
if(trim($profile_fields[$field]) == "" && $profilefield['required'] == 1 && !defined('IN_ADMINCP') && THIS_SCRIPT != "modcp.php") { $this->set_error('missing_required_profile_field', array($profilefield['name']));
|
if(trim($profile_fields[$field]) == "" && $profilefield['required'] == 1 && !defined('IN_ADMINCP') && THIS_SCRIPT != "modcp.php") { $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_SCRIPT != "modcp.php") {
| } elseif(($type == "multiselect" || $type == "checkbox") && $profile_fields[$field] == "" && $profilefield['required'] == 1 && !defined('IN_ADMINCP') && THIS_SCRIPT != "modcp.php") {
|
Zeile 576 | Zeile 558 |
---|
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']));
|
$this->set_error('bad_profile_field_values', array($profilefield['name']));
|
}
| }
|
if($options) { $options .= "\n"; } $options .= $db->escape_string($value);
|
if($options) { $options .= "\n"; } $options .= $db->escape_string($value);
|
}
| }
|
} elseif($type == "select" || $type == "radio") {
| } elseif($type == "select" || $type == "radio") {
|
Zeile 593 | Zeile 575 |
---|
if(!in_array(htmlspecialchars_uni($profile_fields[$field]), $expoptions) && trim($profile_fields[$field]) != "") { $this->set_error('bad_profile_field_values', array($profilefield['name']));
|
if(!in_array(htmlspecialchars_uni($profile_fields[$field]), $expoptions) && trim($profile_fields[$field]) != "") { $this->set_error('bad_profile_field_values', array($profilefield['name']));
|
}
| }
|
$options = $db->escape_string($profile_fields[$field]); } else
| $options = $db->escape_string($profile_fields[$field]); } else
|
Zeile 1017 | Zeile 999 |
---|
{ $this->verify_website(); }
|
{ $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'])))
|
{ $this->verify_birthday();
|
{ $this->verify_birthday();
|
}
| }
|
if($this->method == "insert" || array_key_exists('postnum', $user))
|
if($this->method == "insert" || array_key_exists('postnum', $user))
|
{
| {
|
$this->verify_postnum(); } if($this->method == "insert" || array_key_exists('threadnum', $user))
|
$this->verify_postnum(); } if($this->method == "insert" || array_key_exists('threadnum', $user))
|
{
| {
|
$this->verify_threadnum(); } if($this->method == "insert" || array_key_exists('profile_fields', $user))
| $this->verify_threadnum(); } if($this->method == "insert" || array_key_exists('profile_fields', $user))
|
Zeile 1052 | Zeile 1030 |
---|
if($this->method == "insert" || array_key_exists('lastvisit', $user)) { $this->verify_lastvisit();
|
if($this->method == "insert" || array_key_exists('lastvisit', $user)) { $this->verify_lastvisit();
|
}
| }
|
if($this->method == "insert" || array_key_exists('lastactive', $user)) { $this->verify_lastactive();
| if($this->method == "insert" || array_key_exists('lastactive', $user)) { $this->verify_lastactive();
|
Zeile 1074 | Zeile 1052 |
---|
$this->verify_checkfields(); } if(array_key_exists('birthdayprivacy', $user))
|
$this->verify_checkfields(); } if(array_key_exists('birthdayprivacy', $user))
|
{
| {
|
$this->verify_birthday_privacy();
|
$this->verify_birthday_privacy();
|
}
| }
|
if($this->method == "insert" || array_key_exists('style', $user))
|
if($this->method == "insert" || array_key_exists('style', $user))
|
{
| {
|
$this->verify_style();
|
$this->verify_style();
|
}
| }
|
if($this->method == "insert" || array_key_exists('signature', $user)) { $this->verify_signature();
|
if($this->method == "insert" || array_key_exists('signature', $user)) { $this->verify_signature();
|
}
| }
|
$plugins->run_hooks("datahandler_user_validate", $this);
// We are done validating, return.
| $plugins->run_hooks("datahandler_user_validate", $this);
// We are done validating, return.
|
Zeile 1108 | Zeile 1086 |
---|
function insert_user() { global $db, $cache, $plugins;
|
function insert_user() { global $db, $cache, $plugins;
|
// Yes, validating is required. if(!$this->get_validated()) { die("The user needs to be validated before inserting it into the DB.");
| // Yes, validating is required. if(!$this->get_validated()) { die("The user needs to be validated before inserting it into the DB.");
|
} if(count($this->get_errors()) > 0) {
| } if(count($this->get_errors()) > 0) {
|
Zeile 1121 | Zeile 1099 |
---|
$user = &$this->data;
|
$user = &$this->data;
|
$array = array('postnum', 'threadnum', 'avatar', 'avatartype', 'additionalgroups', 'displaygroup', 'icq', 'skype', 'google', 'bday', 'signature', 'style', 'dateformat', 'timeformat', 'notepad', 'regip', 'lastip', 'coppa_user');
| $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]))
| foreach($array as $value) { if(!isset($user[$value]))
|
Zeile 1163 | 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'],
| |
"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 1372 | Zeile 1349 |
---|
if(isset($user['website'])) { $this->user_update_data['website'] = $db->escape_string($user['website']);
|
if(isset($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['skype'])) {
| } if(isset($user['skype'])) {
|
Zeile 1788 | Zeile 1761 |
---|
$update = array( "website" => "", "birthday" => "",
|
$update = array( "website" => "", "birthday" => "",
|
"icq" => "",
| |
"skype" => "", "google" => "", "usertitle" => "",
| "skype" => "", "google" => "", "usertitle" => "",
|