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 379 | Zeile 361 |
---|
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;
|
} elseif($birthday['year'] == date("Y")) {
| } elseif($birthday['year'] == date("Y")) {
|
Zeile 389 | Zeile 371 |
---|
$this->set_error("invalid_birthday"); return false; }
|
$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']))
| // 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']))
|
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 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']."-";
|
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'] = '';
|
else { // No field is specified, so return an empty string for an unknown birthday $user['bday'] = '';
|
} return true; }
/**
| } return true; }
/**
|
* Verifies if the birthday privacy option is valid or not. * * @return boolean True when valid, false when invalid.
| * Verifies if the birthday privacy option is valid or not. * * @return boolean True when valid, false when invalid.
|
Zeile 438 | Zeile 420 |
---|
if(!in_array($birthdayprivacy, $accepted)) { $this->set_error("invalid_birthday_privacy");
|
if(!in_array($birthdayprivacy, $accepted)) { $this->set_error("invalid_birthday_privacy");
|
return false; } return true; }
| return false; } else if ($birthdayprivacy == 'age') { $birthdayyear = &$this->data['birthday']['year']; if(empty($birthdayyear)) { $this->set_error("conflicted_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 455 | 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 true; }
| return false; }
return true; }
|
/** * Verifies if the thread count field is filled in correctly. *
| /** * Verifies if the thread count field is filled in correctly. *
|
Zeile 504 | Zeile 495 |
---|
if(isset($this->data['profile_fields_editable']) || isset($this->data['registration']) && ($profilefield['required'] == 1 || $profilefield['registration'] == 1)) { $profilefield['editableby'] = -1;
|
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']))) { continue; }
| }
if(isset($user['usergroup'])) { $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 600 | Zeile 608 |
---|
{ global $db, $mybb;
|
{ global $db, $mybb;
|
$user = &$this->data;
| $user = &$this->data;
|
// Does the referrer exist or not?
|
// 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;
| { $this->set_error('invalid_referrer', array($user['referrer'])); return false;
|
Zeile 633 | Zeile 641 |
---|
global $mybb;
$options = &$this->data['options'];
|
global $mybb;
$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 669 | Zeile 682 |
---|
if($options['subscriptionmethod'] < 0 || $options['subscriptionmethod'] > 3) { $options['subscriptionmethod'] = 0;
|
if($options['subscriptionmethod'] < 0 || $options['subscriptionmethod'] > 3) { $options['subscriptionmethod'] = 0;
|
} }
| } }
|
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; } elseif($options['dstcorrection'] == 0) { $options['dst'] = 0;
|
} }
|
} }
|
if($options['dstcorrection'] == 1) { $options['dst'] = 1; } elseif($options['dstcorrection'] == 0) { $options['dst'] = 0; }
if($this->method == "insert" || (isset($options['threadmode']) && $options['threadmode'] != "linear" && $options['threadmode'] != "threaded"))
| if($this->method == "insert" || (isset($options['threadmode']) && $options['threadmode'] != "linear" && $options['threadmode'] != "threaded" && $options['threadmode'] != ''))
|
{
|
{
|
if($mybb->settings['threadusenetstyle']) { $options['threadmode'] = 'threaded'; } else { $options['threadmode'] = 'linear'; }
| $options['threadmode'] = '';
|
}
// Verify the "threads per page" option.
| }
// Verify the "threads per page" option.
|
Zeile 888 | Zeile 894 |
---|
$user = &$this->data;
|
$user = &$this->data;
|
if($user['style'])
| if(!empty($user['style']))
|
{ $theme = get_theme($user['style']);
if(empty($theme) || !is_member($theme['allowedgroups'], $user) && $theme['allowedgroups'] != 'all')
|
{ $theme = get_theme($user['style']);
if(empty($theme) || !is_member($theme['allowedgroups'], $user) && $theme['allowedgroups'] != 'all')
|
{
| {
|
$this->set_error('invalid_style'); return false; }
|
$this->set_error('invalid_style'); return false; }
|
}
| }
|
return true; }
|
return true; }
|
|
|
/** * Verifies if this is coming from a spam bot or not *
| /** * Verifies if this is coming from a spam bot or not *
|
Zeile 915 | Zeile 921 |
---|
if($user['regcheck1'] !== "" || $user['regcheck2'] !== "true") { $this->set_error("invalid_checkfield");
|
if($user['regcheck1'] !== "" || $user['regcheck2'] !== "true") { $this->set_error("invalid_checkfield");
|
return false; } return true;
| return false; } return true;
|
}
/**
| }
/**
|
Zeile 928 | Zeile 934 |
---|
*/ function verify_timezone() {
|
*/ 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; }
return true;
|
{ $user['timezone'] = $mybb->settings['timezoneoffset']; return false; }
return true;
|
}
/**
| }
/**
|
* Validate all user assets. * * @return boolean True when valid, false when invalid.
| * Validate all user assets. * * @return boolean True when valid, false when invalid.
|
Zeile 990 | 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 1036 | Zeile 1040 |
---|
$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();
|
$this->verify_language();
|
}
| }
|
if($this->method == "insert" || array_key_exists('timezone', $user)) { $this->verify_timezone(); } if($this->method == "insert" && array_key_exists('regcheck1', $user) && array_key_exists('regcheck2', $user))
|
if($this->method == "insert" || array_key_exists('timezone', $user)) { $this->verify_timezone(); } 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(); } if($this->method == "insert" || array_key_exists('style', $user))
|
if(array_key_exists('birthdayprivacy', $user)) { $this->verify_birthday_privacy(); } if($this->method == "insert" || array_key_exists('style', $user))
|
{
| {
|
$this->verify_style(); } if($this->method == "insert" || array_key_exists('signature', $user)) { $this->verify_signature();
|
$this->verify_style(); } if($this->method == "insert" || array_key_exists('signature', $user)) { $this->verify_signature();
|
}
| }
|
$plugins->run_hooks("datahandler_user_validate", $this);
// We are done validating, return. $this->set_validated(true); if(count($this->get_errors()) > 0)
|
$plugins->run_hooks("datahandler_user_validate", $this);
// We are done validating, return. $this->set_validated(true); if(count($this->get_errors()) > 0)
|
{
| {
|
return false; } else
| return false; } else
|
Zeile 1082 | Zeile 1086 |
---|
function insert_user() { global $db, $cache, $plugins;
|
function insert_user() { global $db, $cache, $plugins;
|
|
|
// Yes, validating is required. if(!$this->get_validated())
|
// Yes, validating is required. if(!$this->get_validated())
|
{
| {
|
die("The user needs to be validated before inserting it into the DB.");
|
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)
|
{
| {
|
die("The user is not valid.");
|
die("The user is not valid.");
|
}
| }
|
$user = &$this->data;
|
$user = &$this->data;
|
$array = array('postnum', 'threadnum', 'avatar', 'avatartype', 'additionalgroups', 'displaygroup', 'icq', '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] = ''; } }
$array = array('subscriptionmethod', 'dstcorrection');
|
foreach($array as $value)
|
foreach($array as $value)
|
{ if(!isset($user[$value]))
| { if(!isset($user['options'][$value]))
|
{
|
{
|
$user[$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 1122 | 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'], "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 1152 | 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 1161 | 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 1273 | Zeile 1290 |
---|
$this->user_update_data['password'] = $user['password']; } if(isset($user['salt']))
|
$this->user_update_data['password'] = $user['password']; } 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 1296 | Zeile 1313 |
---|
{ $this->user_update_data['avatar'] = $db->escape_string($user['avatar']); $this->user_update_data['avatartype'] = $db->escape_string($user['avatartype']);
|
{ $this->user_update_data['avatar'] = $db->escape_string($user['avatar']); $this->user_update_data['avatartype'] = $db->escape_string($user['avatartype']);
|
}
| }
|
if(isset($user['usergroup']))
|
if(isset($user['usergroup']))
|
{
| {
|
$this->user_update_data['usergroup'] = (int)$user['usergroup'];
|
$this->user_update_data['usergroup'] = (int)$user['usergroup'];
|
}
| }
|
if(isset($user['additionalgroups'])) { $this->user_update_data['additionalgroups'] = $db->escape_string($user['additionalgroups']);
|
if(isset($user['additionalgroups'])) { $this->user_update_data['additionalgroups'] = $db->escape_string($user['additionalgroups']);
|
}
| }
|
if(isset($user['displaygroup'])) { $this->user_update_data['displaygroup'] = (int)$user['displaygroup'];
|
if(isset($user['displaygroup'])) { $this->user_update_data['displaygroup'] = (int)$user['displaygroup'];
|
}
| }
|
if(isset($user['usertitle']))
|
if(isset($user['usertitle']))
|
{
| {
|
$this->user_update_data['usertitle'] = $db->escape_string($user['usertitle']);
|
$this->user_update_data['usertitle'] = $db->escape_string($user['usertitle']);
|
}
| }
|
if(isset($user['regdate'])) { $this->user_update_data['regdate'] = (int)$user['regdate'];
|
if(isset($user['regdate'])) { $this->user_update_data['regdate'] = (int)$user['regdate'];
|
}
| }
|
if(isset($user['lastactive'])) { $this->user_update_data['lastactive'] = (int)$user['lastactive'];
|
if(isset($user['lastactive'])) { $this->user_update_data['lastactive'] = (int)$user['lastactive'];
|
}
| }
|
if(isset($user['lastvisit']))
|
if(isset($user['lastvisit']))
|
{
| {
|
$this->user_update_data['lastvisit'] = (int)$user['lastvisit'];
|
$this->user_update_data['lastvisit'] = (int)$user['lastvisit'];
|
}
| }
|
if(isset($user['signature'])) { $this->user_update_data['signature'] = $db->escape_string($user['signature']);
|
if(isset($user['signature'])) { $this->user_update_data['signature'] = $db->escape_string($user['signature']);
|
}
| }
|
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['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'])) {
| } if(isset($user['language'])) {
|
Zeile 1411 | 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']); }
|
Zeile 1445 | 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 1590 | 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 1653 | Zeile 1665 |
---|
$db->delete_query('buddyrequests', "uid IN({$this->delete_uids}) OR touid IN({$this->delete_uids})"); $db->delete_query('posts', "uid IN({$this->delete_uids}) AND visible = -2"); $db->delete_query('threads', "uid IN({$this->delete_uids}) AND visible = -2");
|
$db->delete_query('buddyrequests', "uid IN({$this->delete_uids}) OR touid IN({$this->delete_uids})"); $db->delete_query('posts', "uid IN({$this->delete_uids}) AND visible = -2"); $db->delete_query('threads', "uid IN({$this->delete_uids}) AND visible = -2");
|
|
|
// Delete reports made to the profile or reputation of the deleted users (i.e. made by them) $db->delete_query('reportedcontent', "type='reputation' AND id3 IN({$this->delete_uids}) OR type='reputation' AND id2 IN({$this->delete_uids})"); $db->delete_query('reportedcontent', "type='profile' AND id IN({$this->delete_uids})");
| // Delete reports made to the profile or reputation of the deleted users (i.e. made by them) $db->delete_query('reportedcontent', "type='reputation' AND id3 IN({$this->delete_uids}) OR type='reputation' AND id2 IN({$this->delete_uids})"); $db->delete_query('reportedcontent', "type='profile' AND id IN({$this->delete_uids})");
|
Zeile 1675 | Zeile 1687 |
---|
* @param array|bool $delete_uids Array of user ids, false if they're already set (eg when using the delete_user function) */ function delete_posts($delete_uids=false)
|
* @param array|bool $delete_uids Array of user ids, false if they're already set (eg when using the delete_user function) */ function delete_posts($delete_uids=false)
|
{ global $db, $plugins, $mybb;
| { global $db, $plugins, $mybb;
|
if($delete_uids != false) { $this->delete_uids = array_map('intval', (array)$delete_uids);
| if($delete_uids != false) { $this->delete_uids = array_map('intval', (array)$delete_uids);
|
Zeile 1698 | Zeile 1710 |
---|
$moderation = new Moderation();
$plugins->run_hooks('datahandler_user_delete_posts', $this);
|
$moderation = new Moderation();
$plugins->run_hooks('datahandler_user_delete_posts', $this);
|
if(empty($this->delete_uids)) {
| if(empty($this->delete_uids)) {
|
return; }
| return; }
|
Zeile 1749 | Zeile 1761 |
---|
$update = array( "website" => "", "birthday" => "",
|
$update = array( "website" => "", "birthday" => "",
|
"icq" => "", "yahoo" => "",
| |
"skype" => "", "google" => "", "usertitle" => "",
| "skype" => "", "google" => "", "usertitle" => "",
|
Zeile 1769 | Zeile 1779 |
---|
if($gid > 0) { $update["usergroup"] = (int)$gid;
|
if($gid > 0) { $update["usergroup"] = (int)$gid;
|
}
$plugins->run_hooks('datahandler_user_clear_profile', $this);
| }
$plugins->run_hooks('datahandler_user_clear_profile', $this);
|
if(empty($this->delete_uids))
|
if(empty($this->delete_uids))
|
{
| {
|
return;
|
return;
|
}
| }
|
$db->update_query("users", $update, "uid IN({$this->delete_uids})"); $db->delete_query('userfields', "ufid IN({$this->delete_uids})");
|
$db->update_query("users", $update, "uid IN({$this->delete_uids})"); $db->delete_query('userfields', "ufid IN({$this->delete_uids})");
|
|
|
// Remove any of the user(s) uploaded avatars require_once MYBB_ROOT.'inc/functions_upload.php'; foreach(explode(',', $this->delete_uids) as $uid) { remove_avatars($uid);
|
// Remove any of the user(s) uploaded avatars require_once MYBB_ROOT.'inc/functions_upload.php'; foreach(explode(',', $this->delete_uids) as $uid) { remove_avatars($uid);
|
}
| }
|
}
public function verify_signature() { global $mybb, $parser;
|
}
public function verify_signature() { global $mybb, $parser;
|
| if(!isset($this->data['signature'])) { return true; }
|
if(!isset($parser))
|
if(!isset($parser))
|
{
| {
|
require_once MYBB_ROOT."inc/class_parser.php"; $parser = new postParser; }
$parser_options = array( 'allow_html' => $mybb->settings['sightml'],
|
require_once MYBB_ROOT."inc/class_parser.php"; $parser = new postParser; }
$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 1835 | Zeile 1849 |
---|
$parsed_sig = $this->data['signature']; }
|
$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']));
if($sig_length - $mybb->settings['siglength'] > 1)
| $parsed_sig = preg_replace("#\s#", "", $parsed_sig); $sig_length = my_strlen($parsed_sig);
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'); }
|
} }
| } }
|