Zeile 440 | Zeile 440 |
---|
$this->set_error("invalid_birthday_privacy"); return false; }
|
$this->set_error("invalid_birthday_privacy"); return false; }
|
return true; }
| 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 464 |
---|
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. * * @return boolean True when valid, false when invalid.
| * Verifies if the thread count field is filled in correctly. * * @return boolean True when valid, false when invalid.
|
Zeile 469 | Zeile 478 |
---|
function verify_threadnum() { $user = &$this->data;
|
function verify_threadnum() { $user = &$this->data;
|
|
|
if(isset($user['threadnum']) && $user['threadnum'] < 0) { $this->set_error("invalid_threadnum"); return false; }
|
if(isset($user['threadnum']) && $user['threadnum'] < 0) { $this->set_error("invalid_threadnum"); return false; }
|
|
|
return true; }
/** * Verifies if a profile fields are filled in correctly.
|
return true; }
/** * Verifies if a profile fields are filled in correctly.
|
* * @return boolean True when valid, false when invalid.
| * * @return boolean True when valid, false when invalid.
|
*/ function verify_profile_fields() {
| */ function verify_profile_fields() {
|
Zeile 506 | Zeile 515 |
---|
$profilefield['editableby'] = -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'])
|
{
| {
|
continue; }
|
continue; }
|
|
|
$profilefield['type'] = htmlspecialchars_uni($profilefield['type']); $profilefield['name'] = htmlspecialchars_uni($profilefield['name']); $thing = explode("\n", $profilefield['type'], "2");
| $profilefield['type'] = htmlspecialchars_uni($profilefield['type']); $profilefield['name'] = htmlspecialchars_uni($profilefield['name']); $thing = explode("\n", $profilefield['type'], "2");
|
Zeile 526 | Zeile 552 |
---|
if(!isset($profile_fields[$field])) { $profile_fields[$field] = '';
|
if(!isset($profile_fields[$field])) { $profile_fields[$field] = '';
|
}
| }
|
// If the profile field is required, but not filled in, present error. if($type != "multiselect" && $type != "checkbox")
| // If the profile field is required, but not filled in, present error. if($type != "multiselect" && $type != "checkbox")
|
Zeile 535 | Zeile 561 |
---|
{ $this->set_error('missing_required_profile_field', array($profilefield['name'])); }
|
{ $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")
|
{
| {
|
$this->set_error('missing_required_profile_field', array($profilefield['name'])); }
| $this->set_error('missing_required_profile_field', array($profilefield['name'])); }
|
Zeile 548 | Zeile 574 |
---|
$expoptions = explode("\n", $thing[1]); $expoptions = array_map('trim', $expoptions); foreach($profile_fields[$field] as $value)
|
$expoptions = explode("\n", $thing[1]); $expoptions = array_map('trim', $expoptions); foreach($profile_fields[$field] as $value)
|
{
| {
|
if(!in_array(htmlspecialchars_uni($value), $expoptions))
|
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") { $expoptions = explode("\n", $thing[1]);
| elseif($type == "select" || $type == "radio") { $expoptions = explode("\n", $thing[1]);
|
Zeile 567 | Zeile 593 |
---|
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]); }
| } $options = $db->escape_string($profile_fields[$field]); }
|
else { if($profilefield['maxlength'] > 0 && my_strlen($profile_fields[$field]) > $profilefield['maxlength'])
| else { if($profilefield['maxlength'] > 0 && my_strlen($profile_fields[$field]) > $profilefield['maxlength'])
|
Zeile 603 | Zeile 629 |
---|
$user = &$this->data;
// Does the referrer exist or not?
|
$user = &$this->data;
// 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; }
$user['referrer_uid'] = $referrer['uid'];
|
{ $this->set_error('invalid_referrer', array($user['referrer'])); return false; }
$user['referrer_uid'] = $referrer['uid'];
|
}
| }
|
else { $user['referrer_uid'] = 0; }
|
else { $user['referrer_uid'] = 0; }
|
|
|
return true; }
| return true; }
|
Zeile 633 | Zeile 659 |
---|
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 652 | Zeile 683 |
---|
$this->verify_yesno_option($options, 'sourceeditor', 0); $this->verify_yesno_option($options, 'buddyrequestspm', 1); $this->verify_yesno_option($options, 'buddyrequestsauto', 0);
|
$this->verify_yesno_option($options, 'sourceeditor', 0); $this->verify_yesno_option($options, 'buddyrequestspm', 1); $this->verify_yesno_option($options, 'buddyrequestsauto', 0);
|
|
|
if($mybb->settings['postlayout'] == 'classic')
|
if($mybb->settings['postlayout'] == 'classic')
|
{
| {
|
$this->verify_yesno_option($options, 'classicpostbit', 1); } else
| $this->verify_yesno_option($options, 'classicpostbit', 1); } else
|
Zeile 673 | Zeile 704 |
---|
}
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($this->method == "insert" || (isset($options['threadmode']) && $options['threadmode'] != "linear" && $options['threadmode'] != "threaded")) { if($mybb->settings['threadusenetstyle']) { $options['threadmode'] = 'threaded'; } else
| if($options['dstcorrection'] == 1)
|
{
|
{
|
$options['threadmode'] = 'linear';
| $options['dst'] = 1; } elseif($options['dstcorrection'] == 0) { $options['dst'] = 0;
|
}
|
}
|
| }
if($this->method == "insert" || (isset($options['threadmode']) && $options['threadmode'] != "linear" && $options['threadmode'] != "threaded" && $options['threadmode'] != '')) { $options['threadmode'] = '';
|
}
// Verify the "threads per page" option. if($this->method == "insert" || (array_key_exists('tpp', $options) && $mybb->settings['usertppoptions'])) { if(!isset($options['tpp']))
|
}
// Verify the "threads per page" option. if($this->method == "insert" || (array_key_exists('tpp', $options) && $mybb->settings['usertppoptions'])) { if(!isset($options['tpp']))
|
{
| {
|
$options['tpp'] = 0; } $explodedtpp = explode(",", $mybb->settings['usertppoptions']);
| $options['tpp'] = 0; } $explodedtpp = explode(",", $mybb->settings['usertppoptions']);
|
Zeile 747 | Zeile 771 |
---|
if($this->method == "insert" || array_key_exists('daysprune', $options)) { if(!isset($options['daysprune']))
|
if($this->method == "insert" || array_key_exists('daysprune', $options)) { if(!isset($options['daysprune']))
|
{ $options['daysprune'] = 0; }
| { $options['daysprune'] = 0; }
|
$options['daysprune'] = (int)$options['daysprune']; if($options['daysprune'] < 0) {
| $options['daysprune'] = (int)$options['daysprune']; if($options['daysprune'] < 0) {
|
Zeile 791 | Zeile 815 |
---|
if($lastvisit <= 0) { $lastvisit = TIME_NOW;
|
if($lastvisit <= 0) { $lastvisit = TIME_NOW;
|
} return true;
}
| } return true;
}
|
/** * Verifies if a last active date is valid or not.
| /** * Verifies if a last active date is valid or not.
|
Zeile 810 | Zeile 834 |
---|
if($lastactive <= 0) { $lastactive = TIME_NOW;
|
if($lastactive <= 0) { $lastactive = TIME_NOW;
|
} return true;
| } return true;
|
}
| }
|
Zeile 827 | Zeile 851 |
---|
$user = &$this->data; // If the board does not allow "away mode" or the user is marking as not away, set defaults. if($mybb->settings['allowaway'] == 0 || !isset($user['away']['away']) || $user['away']['away'] != 1)
|
$user = &$this->data; // If the board does not allow "away mode" or the user is marking as not away, set defaults. if($mybb->settings['allowaway'] == 0 || !isset($user['away']['away']) || $user['away']['away'] != 1)
|
{
| {
|
$user['away']['away'] = 0; $user['away']['date'] = 0; $user['away']['returndate'] = 0;
| $user['away']['away'] = 0; $user['away']['date'] = 0; $user['away']['returndate'] = 0;
|
Zeile 859 | Zeile 883 |
---|
/** * Verifies if a language is valid for this user or not.
|
/** * Verifies if a language 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() { global $lang;
|
*/ function verify_language() { global $lang;
|
|
|
$language = &$this->data['language'];
|
$language = &$this->data['language'];
|
|
|
// An invalid language has been specified? if($language != '' && !$lang->language_exists($language)) { $this->set_error("invalid_language");
|
// An invalid language has been specified? if($language != '' && !$lang->language_exists($language)) { $this->set_error("invalid_language");
|
return false; } return true; }
/**
| return false; } return true; }
/**
|
* Verifies if a style is valid for this user or not. * * @return boolean True when valid, false when invalid.
| * Verifies if a style is valid for this user or not. * * @return boolean True when valid, false when invalid.
|
Zeile 888 | Zeile 912 |
---|
$user = &$this->data;
|
$user = &$this->data;
|
if($user['style'])
| if(!empty($user['style']))
|
{ $theme = get_theme($user['style']);
| { $theme = get_theme($user['style']);
|
Zeile 928 | Zeile 952 |
---|
*/ function verify_timezone() {
|
*/ function verify_timezone() {
|
| global $mybb;
|
$user = &$this->data;
$timezones = get_supported_timezones();
|
$user = &$this->data;
$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;
| { $user['timezone'] = $mybb->settings['timezoneoffset']; return false;
|
Zeile 1095 | Zeile 1121 |
---|
$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', 'icq', 'skype', 'google', 'bday', 'signature', 'style', 'dateformat', 'timeformat', 'notepad', 'regip', 'lastip', 'coppa_user');
|
foreach($array as $value) { if(!isset($user[$value])) { $user[$value] = ''; }
|
foreach($array as $value) { if(!isset($user[$value])) { $user[$value] = ''; }
|
| }
$array = array('subscriptionmethod', 'dstcorrection'); foreach($array as $value) { if(!isset($user['options'][$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 1123 | Zeile 1164 |
---|
"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'],
|
"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 1192 |
---|
"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 1202 |
---|
"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 1282 | Zeile 1322 |
---|
} if(isset($user['email'])) {
|
} if(isset($user['email'])) {
|
$this->user_update_data['email'] = $user['email'];
| $this->user_update_data['email'] = $db->escape_string($user['email']);
|
} if(isset($user['postnum'])) {
| } if(isset($user['postnum'])) {
|
Zeile 1336 | Zeile 1376 |
---|
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['yahoo'])) { $this->user_update_data['yahoo'] = $db->escape_string($user['yahoo']);
| |
} if(isset($user['skype'])) {
| } if(isset($user['skype'])) {
|
Zeile 1352 | Zeile 1388 |
---|
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']);
|
}
| }
|
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']);
|
Zeile 1375 | Zeile 1411 |
---|
} 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 1451 |
---|
$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 1485 |
---|
{ $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 1630 |
---|
$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 1661 | Zeile 1700 |
---|
// Update the reports made by the deleted users by setting the uid to 0 $db->update_query('reportedcontent', array('uid' => 0), "uid IN({$this->delete_uids})");
|
// Update the reports made by the deleted users by setting the uid to 0 $db->update_query('reportedcontent', array('uid' => 0), "uid 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); } }
|
/** * Provides a method to delete an users posts and threads * * @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)
|
/** * Provides a method to delete an users posts and threads * * @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;
if($delete_uids != false) { $this->delete_uids = array_map('intval', (array)$delete_uids);
foreach($this->delete_uids as $key => $uid) { if(!$uid || is_super_admin($uid) || $uid == $mybb->user['uid']) { // Remove super admins unset($this->delete_uids[$key]); } }
| { global $db, $plugins, $mybb;
if($delete_uids != false) { $this->delete_uids = array_map('intval', (array)$delete_uids);
foreach($this->delete_uids as $key => $uid) { if(!$uid || is_super_admin($uid) || $uid == $mybb->user['uid']) { // Remove super admins unset($this->delete_uids[$key]); } }
|
$this->delete_uids = implode(',', $this->delete_uids); }
| $this->delete_uids = implode(',', $this->delete_uids); }
|
Zeile 1750 | Zeile 1789 |
---|
"website" => "", "birthday" => "", "icq" => "",
|
"website" => "", "birthday" => "", "icq" => "",
|
"yahoo" => "",
| |
"skype" => "", "google" => "", "usertitle" => "",
| "skype" => "", "google" => "", "usertitle" => "",
|
Zeile 1776 | Zeile 1814 |
---|
if(empty($this->delete_uids)) { return;
|
if(empty($this->delete_uids)) { 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})");
|
Zeile 1784 | Zeile 1822 |
---|
// Remove any of the user(s) uploaded avatars require_once MYBB_ROOT.'inc/functions_upload.php'; foreach(explode(',', $this->delete_uids) as $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); } }
| remove_avatars($uid); } }
|
Zeile 1792 | Zeile 1830 |
---|
public function verify_signature() { global $mybb, $parser;
|
public function verify_signature() { global $mybb, $parser;
|
| if(!isset($this->data['signature'])) { return true; }
|
if(!isset($parser)) { require_once MYBB_ROOT."inc/class_parser.php"; $parser = new postParser;
|
if(!isset($parser)) { require_once MYBB_ROOT."inc/class_parser.php"; $parser = new postParser;
|
}
| }
|
$parser_options = array( 'allow_html' => $mybb->settings['sightml'],
|
$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 1809 | Zeile 1851 |
---|
);
$parsed_sig = $parser->parse_message($this->data['signature'], $parser_options);
|
);
$parsed_sig = $parser->parse_message($this->data['signature'], $parser_options);
|
|
|
if((($mybb->settings['sigimgcode'] == 0 && $mybb->settings['sigsmilies'] != 1) && substr_count($parsed_sig, "<img") > 0) || (($mybb->settings['sigimgcode'] == 1 || $mybb->settings['sigsmilies'] == 1) &&
| if((($mybb->settings['sigimgcode'] == 0 && $mybb->settings['sigsmilies'] != 1) && substr_count($parsed_sig, "<img") > 0) || (($mybb->settings['sigimgcode'] == 1 || $mybb->settings['sigsmilies'] == 1) &&
|
Zeile 1819 | Zeile 1861 |
---|
$imgsallowed = 0;
if($mybb->settings['sigimgcode'] == 1)
|
$imgsallowed = 0;
if($mybb->settings['sigimgcode'] == 1)
|
{
| {
|
$imgsallowed = $mybb->settings['maxsigimages']; }
|
$imgsallowed = $mybb->settings['maxsigimages']; }
|
|
|
$this->set_error('too_many_sig_images2', array($imgsallowed));
|
$this->set_error('too_many_sig_images2', array($imgsallowed));
|
}
| }
|
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
|
{
| {
|
$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']));
| $parsed_sig = preg_replace("#\s#", "", $parsed_sig); $sig_length = my_strlen($parsed_sig);
|
|
|
if($sig_length - $mybb->settings['siglength'] > 1)
| 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'); }
|
} }
| } }
|