Zeile 42 | Zeile 42 |
---|
if($mybb->user['uid'] == 0 || $mybb->usergroup['canusercp'] == 0) { error_no_permission();
|
if($mybb->user['uid'] == 0 || $mybb->usergroup['canusercp'] == 0) { error_no_permission();
|
}
if(!$mybb->user['pmfolders']) { $mybb->user['pmfolders'] = '1**$%%$2**$%%$3**$%%$4**'; $db->update_query('users', array('pmfolders' => $mybb->user['pmfolders']), "uid = {$mybb->user['uid']}");
| |
}
$errors = '';
|
}
$errors = '';
|
$mybb->input['action'] = $mybb->get_input('action');
| $mybb->input['action'] = $mybb->get_input('action');
|
usercp_menu();
|
usercp_menu();
|
|
|
$server_http_referer = htmlentities($_SERVER['HTTP_REFERER']);
|
$server_http_referer = htmlentities($_SERVER['HTTP_REFERER']);
|
| if(my_strpos($server_http_referer, $mybb->settings['bburl'].'/') !== 0) { if(my_strpos($server_http_referer, '/') === 0) { $server_http_referer = my_substr($server_http_referer, 1); } $url_segments = explode('/', $server_http_referer); $server_http_referer = $mybb->settings['bburl'].'/'.end($url_segments); }
|
$plugins->run_hooks("usercp_start"); if($mybb->input['action'] == "do_editsig" && $mybb->request_method == "post")
| $plugins->run_hooks("usercp_start"); if($mybb->input['action'] == "do_editsig" && $mybb->request_method == "post")
|
Zeile 144 | Zeile 148 |
---|
{ // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
{ // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
| $user = array();
|
$plugins->run_hooks("usercp_do_profile_start");
| $plugins->run_hooks("usercp_do_profile_start");
|
Zeile 207 | Zeile 213 |
---|
require_once MYBB_ROOT."inc/datahandlers/user.php"; $userhandler = new UserDataHandler("update");
|
require_once MYBB_ROOT."inc/datahandlers/user.php"; $userhandler = new UserDataHandler("update");
|
$user = array(
| $user = array_merge($user, array(
|
"uid" => $mybb->user['uid'], "postnum" => $mybb->user['postnum'], "usergroup" => $mybb->user['usergroup'],
| "uid" => $mybb->user['uid'], "postnum" => $mybb->user['postnum'], "usergroup" => $mybb->user['usergroup'],
|
Zeile 216 | Zeile 222 |
---|
"birthdayprivacy" => $mybb->get_input('birthdayprivacy'), "away" => $away, "profile_fields" => $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY)
|
"birthdayprivacy" => $mybb->get_input('birthdayprivacy'), "away" => $away, "profile_fields" => $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY)
|
); foreach(array('icq', 'yahoo', 'skype', 'google') as $cfield) { $csetting = 'allow'.$cfield.'field'; if($mybb->settings[$csetting] == '') { continue; }
if(!is_member($mybb->settings[$csetting])) { continue; }
| )); foreach(array('icq', 'skype', 'google') as $cfield) { $csetting = 'allow'.$cfield.'field'; if($mybb->settings[$csetting] == '') { continue; }
if(!is_member($mybb->settings[$csetting])) { continue; }
|
if($cfield == 'icq')
|
if($cfield == 'icq')
|
{
| {
|
$user[$cfield] = $mybb->get_input($cfield, 1);
|
$user[$cfield] = $mybb->get_input($cfield, 1);
|
| if(my_strlen($user[$cfield]) > 10) { error($lang->contact_field_icqerror); }
|
} else { $user[$cfield] = $mybb->get_input($cfield);
|
} else { $user[$cfield] = $mybb->get_input($cfield);
|
| if(my_strlen($user[$cfield]) > 75) { error($lang->contact_field_error); }
|
} }
| } }
|
Zeile 366 | Zeile 382 |
---|
{ $user['skype'] = htmlspecialchars_uni($user['skype']); $user['google'] = htmlspecialchars_uni($user['google']);
|
{ $user['skype'] = htmlspecialchars_uni($user['skype']); $user['google'] = htmlspecialchars_uni($user['google']);
|
$user['yahoo'] = htmlspecialchars_uni($user['yahoo']);
| |
}
$contact_fields = array(); $contactfields = ''; $cfieldsshow = false;
|
}
$contact_fields = array(); $contactfields = ''; $cfieldsshow = false;
|
foreach(array('icq', 'yahoo', 'skype', 'google') as $cfield)
| foreach(array('icq', 'skype', 'google') as $cfield)
|
{ $contact_fields[$cfield] = ''; $csetting = 'allow'.$cfield.'field';
| { $contact_fields[$cfield] = ''; $csetting = 'allow'.$cfield.'field';
|
Zeile 407 | Zeile 422 |
---|
if($errors) { if($user['away'] == 1)
|
if($errors) { if($user['away'] == 1)
|
{ $awaycheck[1] = "checked=\"checked\""; } else {
| { $awaycheck[1] = "checked=\"checked\""; } else {
|
$awaycheck[0] = "checked=\"checked\""; } $returndate = array();
| $awaycheck[0] = "checked=\"checked\""; } $returndate = array();
|
Zeile 528 | Zeile 543 |
---|
foreach($useropts as $key => $val) { $val = htmlspecialchars_uni($val);
|
foreach($useropts as $key => $val) { $val = htmlspecialchars_uni($val);
|
$seloptions[$val] = $val; } } $expoptions = explode("\n", $options); if(is_array($expoptions)) { foreach($expoptions as $key => $val) { $val = trim($val); $val = str_replace("\n", "\\n", $val);
$sel = ""; if(isset($seloptions[$val]) && $val == $seloptions[$val]) { $sel = " selected=\"selected\""; }
eval("\$select .= \"".$templates->get("usercp_profile_profilefields_select_option")."\";");
| $seloptions[$val] = $val; } } $expoptions = explode("\n", $options); if(is_array($expoptions)) { foreach($expoptions as $key => $val) { $val = trim($val); $val = str_replace("\n", "\\n", $val);
$sel = ""; if(isset($seloptions[$val]) && $val == $seloptions[$val]) { $sel = " selected=\"selected\""; }
eval("\$select .= \"".$templates->get("usercp_profile_profilefields_select_option")."\";");
|
} if(!$profilefield['length']) {
| } if(!$profilefield['length']) {
|
Zeile 553 | Zeile 568 |
---|
}
eval("\$code = \"".$templates->get("usercp_profile_profilefields_multiselect")."\";");
|
}
eval("\$code = \"".$templates->get("usercp_profile_profilefields_multiselect")."\";");
|
} }
| } }
|
elseif($type == "select")
|
elseif($type == "select")
|
{ $expoptions = explode("\n", $options); if(is_array($expoptions)) { foreach($expoptions as $key => $val) {
| { $expoptions = explode("\n", $options); if(is_array($expoptions)) { foreach($expoptions as $key => $val) {
|
$val = trim($val); $val = str_replace("\n", "\\n", $val); $sel = "";
| $val = trim($val); $val = str_replace("\n", "\\n", $val); $sel = "";
|
Zeile 569 | Zeile 584 |
---|
{ $sel = " selected=\"selected\""; }
|
{ $sel = " selected=\"selected\""; }
|
|
|
eval("\$select .= \"".$templates->get("usercp_profile_profilefields_select_option")."\";"); } if(!$profilefield['length'])
| eval("\$select .= \"".$templates->get("usercp_profile_profilefields_select_option")."\";"); } if(!$profilefield['length'])
|
Zeile 590 | Zeile 605 |
---|
{ $checked = ""; if($val == $userfield)
|
{ $checked = ""; if($val == $userfield)
|
{ $checked = " checked=\"checked\"";
| { $checked = " checked=\"checked\"";
|
}
eval("\$code .= \"".$templates->get("usercp_profile_profilefields_radio")."\";");
| }
eval("\$code .= \"".$templates->get("usercp_profile_profilefields_radio")."\";");
|
Zeile 599 | Zeile 614 |
---|
} } elseif($type == "checkbox")
|
} } elseif($type == "checkbox")
|
{
| {
|
$userfield = htmlspecialchars_uni($userfield); if($errors) { $useropts = $userfield; } else
|
$userfield = htmlspecialchars_uni($userfield); if($errors) { $useropts = $userfield; } else
|
{
| {
|
$useropts = explode("\n", $userfield); } if(is_array($useropts))
| $useropts = explode("\n", $userfield); } if(is_array($useropts))
|
Zeile 614 | Zeile 629 |
---|
foreach($useropts as $key => $val) { $seloptions[$val] = $val;
|
foreach($useropts as $key => $val) { $seloptions[$val] = $val;
|
}
| }
|
} $expoptions = explode("\n", $options); if(is_array($expoptions))
| } $expoptions = explode("\n", $options); if(is_array($expoptions))
|
Zeile 629 | Zeile 644 |
---|
eval("\$code .= \"".$templates->get("usercp_profile_profilefields_checkbox")."\";"); }
|
eval("\$code .= \"".$templates->get("usercp_profile_profilefields_checkbox")."\";"); }
|
}
| }
|
} elseif($type == "textarea") {
| } elseif($type == "textarea") {
|
Zeile 644 | Zeile 659 |
---|
{ $maxlength = " maxlength=\"{$profilefield['maxlength']}\""; }
|
{ $maxlength = " maxlength=\"{$profilefield['maxlength']}\""; }
|
|
|
eval("\$code = \"".$templates->get("usercp_profile_profilefields_text")."\";"); }
if($profilefield['required'] == 1) { eval("\$requiredfields .= \"".$templates->get("usercp_profile_customfield")."\";");
|
eval("\$code = \"".$templates->get("usercp_profile_profilefields_text")."\";"); }
if($profilefield['required'] == 1) { eval("\$requiredfields .= \"".$templates->get("usercp_profile_customfield")."\";");
|
}
| }
|
else { eval("\$customfields .= \"".$templates->get("usercp_profile_customfield")."\";");
| else { eval("\$customfields .= \"".$templates->get("usercp_profile_customfield")."\";");
|
Zeile 742 | Zeile 757 |
---|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
$plugins->run_hooks("usercp_do_options_start");
| $user = array();
$plugins->run_hooks("usercp_do_options_start");
|
// Set up user handler. require_once MYBB_ROOT."inc/datahandlers/user.php"; $userhandler = new UserDataHandler("update");
|
// Set up user handler. require_once MYBB_ROOT."inc/datahandlers/user.php"; $userhandler = new UserDataHandler("update");
|
$user = array(
| $user = array_merge($user, array(
|
"uid" => $mybb->user['uid'], "style" => $mybb->get_input('style', MyBB::INPUT_INT), "dateformat" => $mybb->get_input('dateformat', MyBB::INPUT_INT),
| "uid" => $mybb->user['uid'], "style" => $mybb->get_input('style', MyBB::INPUT_INT), "dateformat" => $mybb->get_input('dateformat', MyBB::INPUT_INT),
|
Zeile 757 | Zeile 774 |
---|
"language" => $mybb->get_input('language'), 'usergroup' => $mybb->user['usergroup'], 'additionalgroups' => $mybb->user['additionalgroups']
|
"language" => $mybb->get_input('language'), 'usergroup' => $mybb->user['usergroup'], 'additionalgroups' => $mybb->user['additionalgroups']
|
);
| ));
|
$user['options'] = array( "allownotices" => $mybb->get_input('allownotices', MyBB::INPUT_INT),
| $user['options'] = array( "allownotices" => $mybb->get_input('allownotices', MyBB::INPUT_INT),
|
Zeile 814 | Zeile 831 |
---|
if($mybb->input['action'] == "options") {
|
if($mybb->input['action'] == "options") {
|
$plugins->run_hooks("usercp_options_start");
| |
if($errors != '') { $user = $mybb->input;
| if($errors != '') { $user = $mybb->input;
|
Zeile 824 | Zeile 839 |
---|
{ $user = $mybb->user; }
|
{ $user = $mybb->user; }
|
| $plugins->run_hooks("usercp_options_start");
|
$languages = $lang->get_languages(); $board_language = $langoptions = '';
| $languages = $lang->get_languages(); $board_language = $langoptions = '';
|
Zeile 832 | Zeile 849 |
---|
foreach($languages as $name => $language) { $language = htmlspecialchars_uni($language);
|
foreach($languages as $name => $language) { $language = htmlspecialchars_uni($language);
|
|
|
$sel = ''; if(isset($user['language']) && $user['language'] == $name) {
| $sel = ''; if(isset($user['language']) && $user['language'] == $name) {
|
Zeile 853 | Zeile 870 |
---|
else { $allownoticescheck = "";
|
else { $allownoticescheck = "";
|
}
| }
|
if(isset($user['invisible']) && $user['invisible'] == 1)
|
if(isset($user['invisible']) && $user['invisible'] == 1)
|
{
| {
|
$invisiblecheck = "checked=\"checked\"";
|
$invisiblecheck = "checked=\"checked\"";
|
} else {
| } else {
|
$invisiblecheck = ""; }
if(isset($user['hideemail']) && $user['hideemail'] == 1) { $hideemailcheck = "checked=\"checked\"";
|
$invisiblecheck = ""; }
if(isset($user['hideemail']) && $user['hideemail'] == 1) { $hideemailcheck = "checked=\"checked\"";
|
}
| }
|
else { $hideemailcheck = "";
| else { $hideemailcheck = "";
|
Zeile 881 | Zeile 898 |
---|
elseif(isset($user['subscriptionmethod']) && $user['subscriptionmethod'] == 2) { $instant_email_subscribe_selected = "selected=\"selected\"";
|
elseif(isset($user['subscriptionmethod']) && $user['subscriptionmethod'] == 2) { $instant_email_subscribe_selected = "selected=\"selected\"";
|
}
| }
|
elseif(isset($user['subscriptionmethod']) && $user['subscriptionmethod'] == 3)
|
elseif(isset($user['subscriptionmethod']) && $user['subscriptionmethod'] == 3)
|
{
| {
|
$instant_pm_subscribe_selected = "selected=\"selected\"";
|
$instant_pm_subscribe_selected = "selected=\"selected\"";
|
}
| }
|
else
|
else
|
{
| {
|
$no_auto_subscribe_selected = "selected=\"selected\"";
|
$no_auto_subscribe_selected = "selected=\"selected\"";
|
}
if(isset($user['showimages']) && $user['showimages'] == 1) {
| }
if(isset($user['showimages']) && $user['showimages'] == 1) {
|
$showimagescheck = "checked=\"checked\""; } else { $showimagescheck = "";
|
$showimagescheck = "checked=\"checked\""; } else { $showimagescheck = "";
|
}
if(isset($user['showvideos']) && $user['showvideos'] == 1) {
| }
if(isset($user['showvideos']) && $user['showvideos'] == 1) {
|
$showvideoscheck = "checked=\"checked\""; } else { $showvideoscheck = "";
|
$showvideoscheck = "checked=\"checked\""; } else { $showvideoscheck = "";
|
}
| }
|
if(isset($user['showsigs']) && $user['showsigs'] == 1) {
| if(isset($user['showsigs']) && $user['showsigs'] == 1) {
|
Zeile 921 | Zeile 938 |
---|
if(isset($user['showavatars']) && $user['showavatars'] == 1) { $showavatarscheck = "checked=\"checked\"";
|
if(isset($user['showavatars']) && $user['showavatars'] == 1) { $showavatarscheck = "checked=\"checked\"";
|
} else {
| } else {
|
$showavatarscheck = ""; }
if(isset($user['showquickreply']) && $user['showquickreply'] == 1) { $showquickreplycheck = "checked=\"checked\"";
|
$showavatarscheck = ""; }
if(isset($user['showquickreply']) && $user['showquickreply'] == 1) { $showquickreplycheck = "checked=\"checked\"";
|
}
| }
|
else
|
else
|
{
| {
|
$showquickreplycheck = "";
|
$showquickreplycheck = "";
|
}
if(isset($user['receivepms']) && $user['receivepms'] == 1) {
| }
if(isset($user['receivepms']) && $user['receivepms'] == 1) {
|
$receivepmscheck = "checked=\"checked\""; } else
| $receivepmscheck = "checked=\"checked\""; } else
|
Zeile 952 | Zeile 969 |
---|
else { $receivefrombuddycheck = "";
|
else { $receivefrombuddycheck = "";
|
}
| }
|
if(isset($user['pmnotice']) && $user['pmnotice'] >= 1)
|
if(isset($user['pmnotice']) && $user['pmnotice'] >= 1)
|
{
| {
|
$pmnoticecheck = " checked=\"checked\"";
|
$pmnoticecheck = " checked=\"checked\"";
|
} else {
| } else {
|
$pmnoticecheck = ""; }
| $pmnoticecheck = ""; }
|
Zeile 980 | Zeile 997 |
---|
if(isset($user['showcodebuttons']) && $user['showcodebuttons'] == 1) { $showcodebuttonscheck = "checked=\"checked\"";
|
if(isset($user['showcodebuttons']) && $user['showcodebuttons'] == 1) { $showcodebuttonscheck = "checked=\"checked\"";
|
} else
| } else
|
{ $showcodebuttonscheck = ""; }
| { $showcodebuttonscheck = ""; }
|
Zeile 996 | Zeile 1013 |
---|
}
if(isset($user['showredirect']) && $user['showredirect'] != 0)
|
}
if(isset($user['showredirect']) && $user['showredirect'] != 0)
|
{
| {
|
$showredirectcheck = "checked=\"checked\"";
|
$showredirectcheck = "checked=\"checked\"";
|
}
| }
|
else { $showredirectcheck = "";
|
else { $showredirectcheck = "";
|
}
| }
|
if(isset($user['pmnotify']) && $user['pmnotify'] != 0)
|
if(isset($user['pmnotify']) && $user['pmnotify'] != 0)
|
{
| {
|
$pmnotifycheck = "checked=\"checked\"";
|
$pmnotifycheck = "checked=\"checked\"";
|
}
| }
|
else { $pmnotifycheck = '';
|
else { $pmnotifycheck = '';
|
}
| }
|
if(isset($user['buddyrequestspm']) && $user['buddyrequestspm'] != 0) { $buddyrequestspmcheck = "checked=\"checked\"";
| if(isset($user['buddyrequestspm']) && $user['buddyrequestspm'] != 0) { $buddyrequestspmcheck = "checked=\"checked\"";
|
Zeile 1132 | Zeile 1149 |
---|
$tpp_option = $lang->sprintf($lang->tpp_option, $val); eval("\$tppoptions .= \"".$templates->get("usercp_options_tppselect_option")."\";");
|
$tpp_option = $lang->sprintf($lang->tpp_option, $val); eval("\$tppoptions .= \"".$templates->get("usercp_options_tppselect_option")."\";");
|
} }
| } }
|
eval("\$tppselect = \"".$templates->get("usercp_options_tppselect")."\";"); }
if($mybb->settings['userpppoptions'])
|
eval("\$tppselect = \"".$templates->get("usercp_options_tppselect")."\";"); }
if($mybb->settings['userpppoptions'])
|
{
| {
|
$explodedppp = explode(",", $mybb->settings['userpppoptions']); $pppoptions = $ppp_option = ''; if(is_array($explodedppp))
| $explodedppp = explode(",", $mybb->settings['userpppoptions']); $pppoptions = $ppp_option = ''; if(is_array($explodedppp))
|
Zeile 1157 | Zeile 1174 |
---|
} } eval("\$pppselect = \"".$templates->get("usercp_options_pppselect")."\";");
|
} } eval("\$pppselect = \"".$templates->get("usercp_options_pppselect")."\";");
|
}
$plugins->run_hooks("usercp_options_end");
| }
$plugins->run_hooks("usercp_options_end");
|
eval("\$editprofile = \"".$templates->get("usercp_options")."\";"); output_page($editprofile);
| eval("\$editprofile = \"".$templates->get("usercp_options")."\";"); output_page($editprofile);
|
Zeile 1188 | Zeile 1205 |
---|
"email" => $mybb->get_input('email'), "email2" => $mybb->get_input('email2') );
|
"email" => $mybb->get_input('email'), "email2" => $mybb->get_input('email2') );
|
$userhandler->set_data($user);
if(!$userhandler->validate_user()) { $errors = $userhandler->get_friendly_errors();
| $userhandler->set_data($user);
if(!$userhandler->validate_user()) { $errors = $userhandler->get_friendly_errors();
|
} else {
| } else {
|
Zeile 1309 | Zeile 1326 |
---|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
| $user = array();
|
$errors = array();
$plugins->run_hooks("usercp_do_password_start"); if(validate_password_from_uid($mybb->user['uid'], $mybb->get_input('oldpassword')) == false)
|
$errors = array();
$plugins->run_hooks("usercp_do_password_start"); if(validate_password_from_uid($mybb->user['uid'], $mybb->get_input('oldpassword')) == false)
|
{
| {
|
$errors[] = $lang->error_invalidpassword; } else
| $errors[] = $lang->error_invalidpassword; } else
|
Zeile 1321 | Zeile 1339 |
---|
// Set up user handler. require_once MYBB_ROOT."inc/datahandlers/user.php"; $userhandler = new UserDataHandler("update");
|
// Set up user handler. require_once MYBB_ROOT."inc/datahandlers/user.php"; $userhandler = new UserDataHandler("update");
|
$user = array(
| $user = array_merge($user, array(
|
"uid" => $mybb->user['uid'], "password" => $mybb->get_input('password'), "password2" => $mybb->get_input('password2')
|
"uid" => $mybb->user['uid'], "password" => $mybb->get_input('password'), "password2" => $mybb->get_input('password2')
|
);
| ));
|
$userhandler->set_data($user);
| $userhandler->set_data($user);
|
Zeile 1343 | Zeile 1361 |
---|
$mail_message = $lang->sprintf($lang->email_changepassword, $mybb->user['username'], $mybb->user['email'], $mybb->settings['bbname'], $mybb->settings['bburl']); $lang->emailsubject_changepassword = $lang->sprintf($lang->emailsubject_changepassword, $mybb->settings['bbname']); my_mail($mybb->user['email'], $lang->emailsubject_changepassword, $mail_message);
|
$mail_message = $lang->sprintf($lang->email_changepassword, $mybb->user['username'], $mybb->user['email'], $mybb->settings['bbname'], $mybb->settings['bburl']); $lang->emailsubject_changepassword = $lang->sprintf($lang->emailsubject_changepassword, $mybb->settings['bbname']); my_mail($mybb->user['email'], $lang->emailsubject_changepassword, $mail_message);
|
|
|
$plugins->run_hooks("usercp_do_password_end"); redirect("usercp.php?action=password", $lang->redirect_passwordupdated); }
| $plugins->run_hooks("usercp_do_password_end"); redirect("usercp.php?action=password", $lang->redirect_passwordupdated); }
|
Zeile 1358 | Zeile 1376 |
---|
if($mybb->input['action'] == "password") { $plugins->run_hooks("usercp_password");
|
if($mybb->input['action'] == "password") { $plugins->run_hooks("usercp_password");
|
|
|
eval("\$editpassword = \"".$templates->get("usercp_password")."\";"); output_page($editpassword); }
| eval("\$editpassword = \"".$templates->get("usercp_password")."\";"); output_page($editpassword); }
|
Zeile 1368 | Zeile 1386 |
---|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
$plugins->run_hooks("usercp_do_changename_start");
| $errors = array();
|
if($mybb->usergroup['canchangename'] != 1) { error_no_permission(); }
|
if($mybb->usergroup['canchangename'] != 1) { error_no_permission(); }
|
| $user = array();
$plugins->run_hooks("usercp_do_changename_start");
|
if(validate_password_from_uid($mybb->user['uid'], $mybb->get_input('password')) == false) {
| if(validate_password_from_uid($mybb->user['uid'], $mybb->get_input('password')) == false) {
|
Zeile 1384 | Zeile 1407 |
---|
require_once MYBB_ROOT."inc/datahandlers/user.php"; $userhandler = new UserDataHandler("update");
|
require_once MYBB_ROOT."inc/datahandlers/user.php"; $userhandler = new UserDataHandler("update");
|
$user = array(
| $user = array_merge($user, array(
|
"uid" => $mybb->user['uid'], "username" => $mybb->get_input('username')
|
"uid" => $mybb->user['uid'], "username" => $mybb->get_input('username')
|
);
| ));
|
$userhandler->set_data($user);
if(!$userhandler->validate_user()) { $errors = $userhandler->get_friendly_errors();
|
$userhandler->set_data($user);
if(!$userhandler->validate_user()) { $errors = $userhandler->get_friendly_errors();
|
}
| }
|
else { $userhandler->update_user(); $plugins->run_hooks("usercp_do_changename_end"); redirect("usercp.php?action=changename", $lang->redirect_namechanged);
|
else { $userhandler->update_user(); $plugins->run_hooks("usercp_do_changename_end"); redirect("usercp.php?action=changename", $lang->redirect_namechanged);
|
| |
} } if(count($errors) > 0) { $errors = inline_error($errors); $mybb->input['action'] = "changename";
|
} } if(count($errors) > 0) { $errors = inline_error($errors); $mybb->input['action'] = "changename";
|
} }
| } }
|
if($mybb->input['action'] == "changename") {
| if($mybb->input['action'] == "changename") {
|
Zeile 1416 | Zeile 1438 |
---|
if($mybb->usergroup['canchangename'] != 1) { error_no_permission();
|
if($mybb->usergroup['canchangename'] != 1) { error_no_permission();
|
| }
// Coming back to this page after one or more errors were experienced, show field the user previously entered (with the exception of the password) if($errors) { $username = htmlspecialchars_uni($mybb->get_input('username')); } else { $username = '';
|
}
$plugins->run_hooks("usercp_changename_end");
| }
$plugins->run_hooks("usercp_changename_end");
|
Zeile 1428 | Zeile 1460 |
---|
{ // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
{ // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
$plugins->run_hooks("usercp_do_subscriptions_start");
| |
if(!isset($mybb->input['check']) || !is_array($mybb->input['check'])) { error($lang->no_subscriptions_selected); }
|
if(!isset($mybb->input['check']) || !is_array($mybb->input['check'])) { error($lang->no_subscriptions_selected); }
|
| $plugins->run_hooks("usercp_do_subscriptions_start");
|
// Clean input - only accept integers thanks! $mybb->input['check'] = array_map('intval', $mybb->get_input('check', MyBB::INPUT_ARRAY));
| // Clean input - only accept integers thanks! $mybb->input['check'] = array_map('intval', $mybb->get_input('check', MyBB::INPUT_ARRAY));
|
Zeile 1447 | Zeile 1479 |
---|
} // Changing subscription type else
|
} // Changing subscription type else
|
{
| {
|
if($mybb->get_input('do') == "no_notification") { $new_notification = 0;
| if($mybb->get_input('do') == "no_notification") { $new_notification = 0;
|
Zeile 1490 | Zeile 1522 |
---|
"); $threadcount = $db->fetch_field($query, "threads");
|
"); $threadcount = $db->fetch_field($query, "threads");
|
if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1) { $mybb->settings['threadsperpage'] = 20; }
| if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1) { $mybb->settings['threadsperpage'] = 20; }
|
$perpage = $mybb->settings['threadsperpage']; $page = $mybb->get_input('page', MyBB::INPUT_INT); if($page > 0)
| $perpage = $mybb->settings['threadsperpage']; $page = $mybb->get_input('page', MyBB::INPUT_INT); if($page > 0)
|
Zeile 1506 | Zeile 1538 |
---|
{ $start = 0; $page = 1;
|
{ $start = 0; $page = 1;
|
} }
| } }
|
else { $start = 0;
| else { $start = 0;
|
Zeile 1539 | Zeile 1571 |
---|
$forumpermissions = $fpermissions[$subscription['fid']];
if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0 || (isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] != 0 && $subscription['uid'] != $mybb->user['uid']))
|
$forumpermissions = $fpermissions[$subscription['fid']];
if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0 || (isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] != 0 && $subscription['uid'] != $mybb->user['uid']))
|
{
| {
|
// Hmm, you don't have permission to view this thread - unsubscribe! $del_subscriptions[] = $subscription['sid'];
|
// Hmm, you don't have permission to view this thread - unsubscribe! $del_subscriptions[] = $subscription['sid'];
|
}
| }
|
elseif($subscription['tid']) { $subscriptions[$subscription['tid']] = $subscription;
|
elseif($subscription['tid']) { $subscriptions[$subscription['tid']] = $subscription;
|
} }
| } }
|
if(!empty($del_subscriptions)) { $sids = implode(',', $del_subscriptions);
| if(!empty($del_subscriptions)) { $sids = implode(',', $del_subscriptions);
|
Zeile 1556 | Zeile 1588 |
---|
if($sids) { $db->delete_query("threadsubscriptions", "sid IN ({$sids}) AND uid='{$mybb->user['uid']}'");
|
if($sids) { $db->delete_query("threadsubscriptions", "sid IN ({$sids}) AND uid='{$mybb->user['uid']}'");
|
}
| }
|
$threadcount = $threadcount - count($del_subscriptions);
if($threadcount < 0) { $threadcount = 0;
|
$threadcount = $threadcount - count($del_subscriptions);
if($threadcount < 0) { $threadcount = 0;
|
}
| }
|
}
if(!empty($subscriptions))
| }
if(!empty($subscriptions))
|
Zeile 1592 | Zeile 1624 |
---|
while($post = $db->fetch_array($query)) { $subscriptions[$post['tid']]['doticon'] = 1;
|
while($post = $db->fetch_array($query)) { $subscriptions[$post['tid']]['doticon'] = 1;
|
} }
| } }
|
// Read threads if($mybb->settings['threadreadcut'] > 0)
| // Read threads if($mybb->settings['threadreadcut'] > 0)
|
Zeile 1606 | Zeile 1638 |
---|
}
$icon_cache = $cache->read("posticons");
|
}
$icon_cache = $cache->read("posticons");
|
$threadprefixes = build_prefixes();
| $threadprefixes = build_prefixes();
|
$threads = '';
|
$threads = '';
|
|
|
// Now we can build our subscription list foreach($subscriptions as $thread) { $bgcolor = alt_trow();
|
// Now we can build our subscription list foreach($subscriptions as $thread) { $bgcolor = alt_trow();
|
$folder = '';
| $folder = '';
|
$prefix = ''; $thread['threadprefix'] = '';
| $prefix = ''; $thread['threadprefix'] = '';
|
Zeile 1665 | Zeile 1697 |
---|
if($mybb->settings['threadreadcut'] > 0) { $forum_read = $readforums[$thread['fid']];
|
if($mybb->settings['threadreadcut'] > 0) { $forum_read = $readforums[$thread['fid']];
|
|
|
$read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24; if($forum_read == 0 || $forum_read < $read_cutoff) { $forum_read = $read_cutoff;
|
$read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24; if($forum_read == 0 || $forum_read < $read_cutoff) { $forum_read = $read_cutoff;
|
} }
| } }
|
$cutoff = 0; if($mybb->settings['threadreadcut'] > 0 && $thread['lastpost'] > $forum_read) {
| $cutoff = 0; if($mybb->settings['threadreadcut'] > 0 && $thread['lastpost'] > $forum_read) {
|
Zeile 1684 | Zeile 1716 |
---|
if($thread['lastread']) { $lastread = $thread['lastread'];
|
if($thread['lastread']) { $lastread = $thread['lastread'];
|
} else {
| } else {
|
$lastread = 1; } }
| $lastread = 1; } }
|
Zeile 1723 | Zeile 1755 |
---|
{ $folder .= "hot"; $folder_label .= $lang->icon_hot;
|
{ $folder .= "hot"; $folder_label .= $lang->icon_hot;
|
}
| }
|
if($thread['closed'] == 1) { $folder .= "close"; $folder_label .= $lang->icon_close;
|
if($thread['closed'] == 1) { $folder .= "close"; $folder_label .= $lang->icon_close;
|
}
| }
|
$folder .= "folder";
if($thread['visible'] == 0) { $bgcolor = "trow_shaded";
|
$folder .= "folder";
if($thread['visible'] == 0) { $bgcolor = "trow_shaded";
|
}
| }
|
// Build last post info $lastpostdate = my_date('relative', $thread['lastpost']); if(!$lastposteruid && !$thread['lastposter']) { $lastposter = htmlspecialchars_uni($lang->guest);
|
// Build last post info $lastpostdate = my_date('relative', $thread['lastpost']); if(!$lastposteruid && !$thread['lastposter']) { $lastposter = htmlspecialchars_uni($lang->guest);
|
} else
| } else
|
{ $lastposter = htmlspecialchars_uni($thread['lastposter']); }
| { $lastposter = htmlspecialchars_uni($thread['lastposter']); }
|
Zeile 1758 | Zeile 1790 |
---|
else { $lastposterlink = build_profile_link($lastposter, $lastposteruid);
|
else { $lastposterlink = build_profile_link($lastposter, $lastposteruid);
|
}
| }
|
$thread['replies'] = my_number_format($thread['replies']); $thread['views'] = my_number_format($thread['views']);
| $thread['replies'] = my_number_format($thread['replies']); $thread['views'] = my_number_format($thread['views']);
|
Zeile 1781 | Zeile 1813 |
---|
// Provide remove options eval("\$remove_options = \"".$templates->get("usercp_subscriptions_remove")."\";");
|
// Provide remove options eval("\$remove_options = \"".$templates->get("usercp_subscriptions_remove")."\";");
|
} else {
| } else {
|
$remove_options = ''; eval("\$threads = \"".$templates->get("usercp_subscriptions_none")."\";"); }
| $remove_options = ''; eval("\$threads = \"".$templates->get("usercp_subscriptions_none")."\";"); }
|
Zeile 1900 | Zeile 1932 |
---|
if(!$forums) { eval("\$forums = \"".$templates->get("usercp_forumsubscriptions_none")."\";");
|
if(!$forums) { eval("\$forums = \"".$templates->get("usercp_forumsubscriptions_none")."\";");
|
}
| }
|
$plugins->run_hooks("usercp_forumsubscriptions_end");
| $plugins->run_hooks("usercp_forumsubscriptions_end");
|
Zeile 1915 | Zeile 1947 |
---|
$thread = get_thread($mybb->get_input('tid')); if(!$thread || $thread['visible'] == -1)
|
$thread = get_thread($mybb->get_input('tid')); if(!$thread || $thread['visible'] == -1)
|
{
| {
|
error($lang->error_invalidthread); }
| error($lang->error_invalidthread); }
|
Zeile 1943 | Zeile 1975 |
---|
add_subscribed_thread($thread['tid'], $mybb->get_input('notification', MyBB::INPUT_INT));
if($mybb->get_input('referrer'))
|
add_subscribed_thread($thread['tid'], $mybb->get_input('notification', MyBB::INPUT_INT));
if($mybb->get_input('referrer'))
|
{ $url = htmlspecialchars_uni($mybb->get_input('referrer'));
| { $mybb->input['referrer'] = $mybb->get_input('referrer');
if(my_strpos($mybb->input['referrer'], $mybb->settings['bburl'].'/') !== 0) { if(my_strpos($mybb->input['referrer'], '/') === 0) { $mybb->input['referrer'] = my_substr($mybb->input['url'], 1); } $url_segments = explode('/', $mybb->input['referrer']); $mybb->input['referrer'] = $mybb->settings['bburl'].'/'.end($url_segments); }
$url = htmlspecialchars_uni($mybb->input['referrer']);
|
} else {
| } else {
|
Zeile 1954 | Zeile 1998 |
---|
}
if($mybb->input['action'] == "addsubscription")
|
}
if($mybb->input['action'] == "addsubscription")
|
{ // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if($mybb->get_input('type') == "forum") { $forum = get_forum($mybb->get_input('fid', MyBB::INPUT_INT)); if(!$forum) { error($lang->error_invalidforum); } $forumpermissions = forum_permissions($forum['fid']); if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0) { error_no_permission(); }
// check if the forum requires a password to view. If so, we need to show a form to the user check_forum_password($forum['fid']);
// Naming of the hook retained for backward compatibility while dropping usercp2.php
| { // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if($mybb->get_input('type') == "forum") { $forum = get_forum($mybb->get_input('fid', MyBB::INPUT_INT)); if(!$forum) { error($lang->error_invalidforum); } $forumpermissions = forum_permissions($forum['fid']); if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0) { error_no_permission(); }
// check if the forum requires a password to view. If so, we need to show a form to the user check_forum_password($forum['fid']);
// Naming of the hook retained for backward compatibility while dropping usercp2.php
|
$plugins->run_hooks("usercp2_addsubscription_forum");
add_subscribed_forum($forum['fid']);
| $plugins->run_hooks("usercp2_addsubscription_forum");
add_subscribed_forum($forum['fid']);
|
Zeile 1997 | Zeile 2041 |
---|
}
// Is the currently logged in user a moderator of this forum?
|
}
// Is the currently logged in user a moderator of this forum?
|
$ismod = is_moderator($thread['fid']);
| $ismod = is_moderator($thread['fid']);
|
// Make sure we are looking at a real thread here. if(($thread['visible'] != 1 && $ismod == false) || ($thread['visible'] > 1 && $ismod == true)) { error($lang->error_invalidthread);
|
// Make sure we are looking at a real thread here. if(($thread['visible'] != 1 && $ismod == false) || ($thread['visible'] > 1 && $ismod == true)) { error($lang->error_invalidthread);
|
}
| }
|
add_breadcrumb($lang->nav_subthreads, "usercp.php?action=subscriptions"); add_breadcrumb($lang->nav_addsubscription);
| add_breadcrumb($lang->nav_subthreads, "usercp.php?action=subscriptions"); add_breadcrumb($lang->nav_addsubscription);
|
Zeile 2019 | Zeile 2063 |
---|
$referrer = ''; if($server_http_referer)
|
$referrer = ''; if($server_http_referer)
|
{
| {
|
$referrer = $server_http_referer; }
| $referrer = $server_http_referer; }
|
Zeile 2033 | Zeile 2077 |
---|
if($mybb->user['subscriptionmethod'] == 1 || $mybb->user['subscriptionmethod'] == 0) { $notification_none_checked = "checked=\"checked\"";
|
if($mybb->user['subscriptionmethod'] == 1 || $mybb->user['subscriptionmethod'] == 0) { $notification_none_checked = "checked=\"checked\"";
|
}
| }
|
elseif($mybb->user['subscriptionmethod'] == 2)
|
elseif($mybb->user['subscriptionmethod'] == 2)
|
{
| {
|
$notification_email_checked = "checked=\"checked\""; } elseif($mybb->user['subscriptionmethod'] == 3) { $notification_pm_checked = "checked=\"checked\"";
|
$notification_email_checked = "checked=\"checked\""; } elseif($mybb->user['subscriptionmethod'] == 3) { $notification_pm_checked = "checked=\"checked\"";
|
}
| }
|
// Naming of the hook retained for backward compatibility while dropping usercp2.php $plugins->run_hooks("usercp2_addsubscription_thread");
eval("\$add_subscription = \"".$templates->get("usercp_addsubscription_thread")."\";"); output_page($add_subscription);
|
// Naming of the hook retained for backward compatibility while dropping usercp2.php $plugins->run_hooks("usercp2_addsubscription_thread");
eval("\$add_subscription = \"".$templates->get("usercp_addsubscription_thread")."\";"); output_page($add_subscription);
|
exit;
| exit; } }
if($mybb->input['action'] == "removesubscription" && ($mybb->request_method == "post" || verify_post_check($mybb->get_input('my_post_key'), true))) { // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if($mybb->get_input('type') == "forum") { $forum = get_forum($mybb->get_input('fid', MyBB::INPUT_INT)); if(!$forum) { error($lang->error_invalidforum); }
// check if the forum requires a password to view. If so, we need to show a form to the user check_forum_password($forum['fid']);
// Naming of the hook retained for backward compatibility while dropping usercp2.php $plugins->run_hooks("usercp2_removesubscription_forum");
remove_subscribed_forum($forum['fid']); if($server_http_referer && $mybb->request_method != 'post') { $url = $server_http_referer; } else { $url = "usercp.php?action=forumsubscriptions"; } redirect($url, $lang->redirect_forumsubscriptionremoved); } else { $thread = get_thread($mybb->get_input('tid', MyBB::INPUT_INT)); if(!$thread) { error($lang->error_invalidthread); }
// Is the currently logged in user a moderator of this forum? $ismod = is_moderator($thread['fid']);
// Make sure we are looking at a real thread here. if(($thread['visible'] != 1 && $ismod == false) || ($thread['visible'] > 1 && $ismod == true)) { error($lang->error_invalidthread); }
// check if the forum requires a password to view. If so, we need to show a form to the user check_forum_password($thread['fid']);
// Naming of the hook retained for backward compatibility while dropping usercp2.php $plugins->run_hooks("usercp2_removesubscription_thread");
remove_subscribed_thread($thread['tid']); if($server_http_referer && $mybb->request_method != 'post') { $url = $server_http_referer; } else { $url = "usercp.php?action=subscriptions"; } redirect($url, $lang->redirect_subscriptionremoved);
|
} }
|
} }
|
| // Show remove subscription form when GET method and without valid my_post_key
|
if($mybb->input['action'] == "removesubscription") {
|
if($mybb->input['action'] == "removesubscription") {
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
| $referrer = '';
|
if($mybb->get_input('type') == "forum") { $forum = get_forum($mybb->get_input('fid', MyBB::INPUT_INT)); if(!$forum) { error($lang->error_invalidforum);
|
if($mybb->get_input('type') == "forum") { $forum = get_forum($mybb->get_input('fid', MyBB::INPUT_INT)); if(!$forum) { error($lang->error_invalidforum);
|
| }
add_breadcrumb($lang->nav_forumsubscriptions, "usercp.php?action=forumsubscriptions"); add_breadcrumb($lang->nav_removesubscription);
$forumpermissions = forum_permissions($forum['fid']); if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0) { error_no_permission();
|
}
// check if the forum requires a password to view. If so, we need to show a form to the user check_forum_password($forum['fid']);
|
}
// check if the forum requires a password to view. If so, we need to show a form to the user check_forum_password($forum['fid']);
|
| $lang->unsubscribe_from_forum = $lang->sprintf($lang->unsubscribe_from_forum, $forum['name']);
|
// Naming of the hook retained for backward compatibility while dropping usercp2.php
|
// Naming of the hook retained for backward compatibility while dropping usercp2.php
|
$plugins->run_hooks("usercp2_removesubscription_forum");
remove_subscribed_forum($forum['fid']); if($server_http_referer && $mybb->request_method != 'post') { $url = $server_http_referer; } else { $url = "usercp.php?action=forumsubscriptions"; } redirect($url, $lang->redirect_forumsubscriptionremoved);
| $plugins->run_hooks("usercp2_removesubscription_display_forum");
eval("\$remove_forum_subscription = \"".$templates->get("usercp_removesubscription_forum")."\";"); output_page($remove_forum_subscription); exit;
|
} else {
|
} else {
|
$thread = get_thread($mybb->get_input('tid', MyBB::INPUT_INT)); if(!$thread)
| $thread = get_thread($mybb->get_input('tid', MyBB::INPUT_INT)); if(!$thread || $thread['visible'] == -1)
|
{ error($lang->error_invalidthread); }
// Is the currently logged in user a moderator of this forum?
|
{ error($lang->error_invalidthread); }
// Is the currently logged in user a moderator of this forum?
|
$ismod = is_moderator($thread['fid']);
| $ismod = is_moderator($thread['fid']);
|
// Make sure we are looking at a real thread here. if(($thread['visible'] != 1 && $ismod == false) || ($thread['visible'] > 1 && $ismod == true))
|
// Make sure we are looking at a real thread here. if(($thread['visible'] != 1 && $ismod == false) || ($thread['visible'] > 1 && $ismod == true))
|
{
| {
|
error($lang->error_invalidthread);
|
error($lang->error_invalidthread);
|
| }
add_breadcrumb($lang->nav_subthreads, "usercp.php?action=subscriptions"); add_breadcrumb($lang->nav_removesubscription);
$forumpermissions = forum_permissions($thread['fid']); if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0 || (isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] != 0 && $thread['uid'] != $mybb->user['uid'])) { error_no_permission();
|
}
// check if the forum requires a password to view. If so, we need to show a form to the user check_forum_password($thread['fid']);
|
}
// check if the forum requires a password to view. If so, we need to show a form to the user check_forum_password($thread['fid']);
|
// Naming of the hook retained for backward compatibility while dropping usercp2.php $plugins->run_hooks("usercp2_removesubscription_thread");
remove_subscribed_thread($thread['tid']); if($server_http_referer && $mybb->request_method != 'post') { $url = $server_http_referer; } else { $url = "usercp.php?action=subscriptions"; } redirect($url, $lang->redirect_subscriptionremoved);
| require_once MYBB_ROOT."inc/class_parser.php"; $parser = new postParser; $thread['subject'] = $parser->parse_badwords($thread['subject']); $thread['subject'] = htmlspecialchars_uni($thread['subject']); $lang->unsubscribe_from_thread = $lang->sprintf($lang->unsubscribe_from_thread, $thread['subject']);
// Naming of the hook retained for backward compatibility while dropping usercp2.php $plugins->run_hooks("usercp2_removesubscription_display_thread");
eval("\$remove_thread_subscription = \"".$templates->get("usercp_removesubscription_thread")."\";"); output_page($remove_thread_subscription); exit;
|
} }
| } }
|
Zeile 2148 | Zeile 2269 |
---|
if($server_http_referer) { $url = $server_http_referer;
|
if($server_http_referer) { $url = $server_http_referer;
|
} else {
| } else {
|
$url = "usercp.php?action=subscriptions"; } redirect($url, $lang->redirect_subscriptionsremoved);
| $url = "usercp.php?action=subscriptions"; } redirect($url, $lang->redirect_subscriptionsremoved);
|
Zeile 2161 | Zeile 2282 |
---|
{ // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
{ // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
$plugins->run_hooks("usercp_do_editsig_start");
| |
// User currently has a suspended signature if($mybb->user['suspendsignature'] == 1 && $mybb->user['suspendsigtime'] > TIME_NOW) { error_no_permission(); }
|
// User currently has a suspended signature if($mybb->user['suspendsignature'] == 1 && $mybb->user['suspendsigtime'] > TIME_NOW) { error_no_permission(); }
|
| $plugins->run_hooks("usercp_do_editsig_start");
|
if($mybb->get_input('updateposts') == "enable") {
| if($mybb->get_input('updateposts') == "enable") {
|
Zeile 2302 | Zeile 2423 |
---|
$sig = htmlspecialchars_uni($sig); $lang->edit_sig_note2 = $lang->sprintf($lang->edit_sig_note2, $sigsmilies, $sigmycode, $sigimgcode, $sightml, $mybb->settings['siglength']);
|
$sig = htmlspecialchars_uni($sig); $lang->edit_sig_note2 = $lang->sprintf($lang->edit_sig_note2, $sigsmilies, $sigmycode, $sigimgcode, $sightml, $mybb->settings['siglength']);
|
if($mybb->settings['bbcodeinserter'] != 0 || $mybb->user['showcodebuttons'] != 0)
| if($mybb->settings['sigmycode'] != 0 && $mybb->settings['bbcodeinserter'] != 0 && $mybb->user['showcodebuttons'] != 0)
|
{ $codebuttons = build_mycode_inserter("signature"); }
| { $codebuttons = build_mycode_inserter("signature"); }
|
Zeile 2326 | Zeile 2447 |
---|
$avatar_error = "";
if(!empty($mybb->input['remove'])) // remove avatar
|
$avatar_error = "";
if(!empty($mybb->input['remove'])) // remove avatar
|
{
| {
|
$updated_avatar = array( "avatar" => "", "avatardimensions" => "",
| $updated_avatar = array( "avatar" => "", "avatardimensions" => "",
|
Zeile 2334 | Zeile 2455 |
---|
); $db->update_query("users", $updated_avatar, "uid='".$mybb->user['uid']."'"); remove_avatars($mybb->user['uid']);
|
); $db->update_query("users", $updated_avatar, "uid='".$mybb->user['uid']."'"); remove_avatars($mybb->user['uid']);
|
}
| }
|
elseif($_FILES['avatarupload']['name']) // upload avatar { if($mybb->usergroup['canuploadavatars'] == 0)
| elseif($_FILES['avatarupload']['name']) // upload avatar { if($mybb->usergroup['canuploadavatars'] == 0)
|
Zeile 2370 | Zeile 2491 |
---|
// If user image does not exist, or is a higher rating, use the mystery man $email = md5($mybb->input['avatarurl']);
|
// If user image does not exist, or is a higher rating, use the mystery man $email = md5($mybb->input['avatarurl']);
|
|
|
$s = ''; if(!$mybb->settings['maxavatardims']) {
| $s = ''; if(!$mybb->settings['maxavatardims']) {
|
Zeile 2384 | Zeile 2505 |
---|
// Rating? $types = array('g', 'pg', 'r', 'x'); $rating = $mybb->settings['useravatarrating'];
|
// Rating? $types = array('g', 'pg', 'r', 'x'); $rating = $mybb->settings['useravatarrating'];
|
|
|
if(!in_array($rating, $types)) { $rating = 'g';
| if(!in_array($rating, $types)) { $rating = 'g';
|
Zeile 2428 | Zeile 2549 |
---|
if(!$type) { $avatar_error = $lang->error_invalidavatarurl;
|
if(!$type) { $avatar_error = $lang->error_invalidavatarurl;
|
}
| }
|
} }
| } }
|
Zeile 2443 | Zeile 2564 |
---|
$avatar_error = $lang->error_avatartoobig; } }
|
$avatar_error = $lang->error_avatartoobig; } }
|
| }
// Limiting URL string to stay within database limit if(strlen($mybb->input['avatarurl']) > 200) { $avatar_error = $lang->error_avatarurltoolong;
|
}
if(empty($avatar_error))
| }
if(empty($avatar_error))
|
Zeile 2934 | Zeile 3061 |
---|
else { $error_message = $lang->cant_add_self_to_buddy_list;
|
else { $error_message = $lang->cant_add_self_to_buddy_list;
|
} }
| } }
|
if(count($existing_users) == 0) { $message = "";
| if(count($existing_users) == 0) { $message = "";
|
Zeile 2971 | Zeile 3098 |
---|
$key = array_search($mybb->get_input('delete', MyBB::INPUT_INT), $user['buddylist']); unset($user['buddylist'][$key]);
|
$key = array_search($mybb->get_input('delete', MyBB::INPUT_INT), $user['buddylist']); unset($user['buddylist'][$key]);
|
|
|
// Now we have the new list, so throw it all back together $new_list = implode(",", $user['buddylist']);
// And clean it up a little to ensure there is no possibility of bad values $new_list = preg_replace("#,{2,}#", ",", $new_list); $new_list = preg_replace("#[^0-9,]#", "", $new_list);
|
// Now we have the new list, so throw it all back together $new_list = implode(",", $user['buddylist']);
// And clean it up a little to ensure there is no possibility of bad values $new_list = preg_replace("#,{2,}#", ",", $new_list); $new_list = preg_replace("#[^0-9,]#", "", $new_list);
|
|
|
if(my_substr($new_list, 0, 1) == ",") { $new_list = my_substr($new_list, 1);
| if(my_substr($new_list, 0, 1) == ",") { $new_list = my_substr($new_list, 1);
|
Zeile 2991 | Zeile 3118 |
---|
$user['buddylist'] = $db->escape_string($new_list);
$db->update_query("users", array('buddylist' => $user['buddylist']), "uid='".(int)$user['uid']."'");
|
$user['buddylist'] = $db->escape_string($new_list);
$db->update_query("users", array('buddylist' => $user['buddylist']), "uid='".(int)$user['uid']."'");
|
}
| }
|
if($mybb->get_input('manage') == "ignored") {
| if($mybb->get_input('manage') == "ignored") {
|
Zeile 3003 | Zeile 3130 |
---|
} $user['username'] = htmlspecialchars_uni($user['username']); $message = $lang->sprintf($message, $user['username']);
|
} $user['username'] = htmlspecialchars_uni($user['username']); $message = $lang->sprintf($message, $user['username']);
|
} }
| } }
|
// Now we have the new list, so throw it all back together $new_list = implode(",", $existing_users);
| // Now we have the new list, so throw it all back together $new_list = implode(",", $existing_users);
|
Zeile 3045 | Zeile 3172 |
---|
if($mybb->get_input('manage') == "ignored") { $list = "ignore";
|
if($mybb->get_input('manage') == "ignored") { $list = "ignore";
|
} else
| } else
|
{ $list = "buddy"; }
| { $list = "buddy"; }
|
Zeile 3156 | Zeile 3283 |
---|
} eval("\$ignore_list .= \"".$templates->get("usercp_editlists_user")."\";"); ++$ignore_count;
|
} eval("\$ignore_list .= \"".$templates->get("usercp_editlists_user")."\";"); ++$ignore_count;
|
}
| }
|
}
$lang->current_ignored_users = $lang->sprintf($lang->current_ignored_users, $ignore_count);
| }
$lang->current_ignored_users = $lang->sprintf($lang->current_ignored_users, $ignore_count);
|
Zeile 3321 | Zeile 3448 |
---|
eval("\$draftlist = \"".$templates->get("usercp_drafts")."\";"); output_page($draftlist);
|
eval("\$draftlist = \"".$templates->get("usercp_drafts")."\";"); output_page($draftlist);
|
}
| }
|
if($mybb->input['action'] == "do_drafts" && $mybb->request_method == "post") { // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
if($mybb->input['action'] == "do_drafts" && $mybb->request_method == "post") { // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
$plugins->run_hooks("usercp_do_drafts_start");
|
|
$mybb->input['deletedraft'] = $mybb->get_input('deletedraft', MyBB::INPUT_ARRAY); if(empty($mybb->input['deletedraft'])) { error($lang->no_drafts_selected); }
|
$mybb->input['deletedraft'] = $mybb->get_input('deletedraft', MyBB::INPUT_ARRAY); if(empty($mybb->input['deletedraft'])) { error($lang->no_drafts_selected); }
|
| $plugins->run_hooks("usercp_do_drafts_start");
|
$pidin = array(); $tidin = array();
|
$pidin = array(); $tidin = array();
|
|
|
foreach($mybb->input['deletedraft'] as $id => $val) { if($val == "post")
| foreach($mybb->input['deletedraft'] as $id => $val) { if($val == "post")
|
Zeile 3370 | Zeile 3500 |
---|
$plugins->run_hooks("usercp_do_drafts_end"); redirect("usercp.php?action=drafts", $lang->selected_drafts_deleted); }
|
$plugins->run_hooks("usercp_do_drafts_end"); redirect("usercp.php?action=drafts", $lang->selected_drafts_deleted); }
|
|
|
if($mybb->input['action'] == "usergroups") {
|
if($mybb->input['action'] == "usergroups") {
|
$plugins->run_hooks("usercp_usergroups_start");
| |
$ingroups = ",".$mybb->user['usergroup'].",".$mybb->user['additionalgroups'].",".$mybb->user['displaygroup'].",";
|
$ingroups = ",".$mybb->user['usergroup'].",".$mybb->user['additionalgroups'].",".$mybb->user['displaygroup'].",";
|
|
|
$usergroups = $mybb->cache->read('usergroups');
|
$usergroups = $mybb->cache->read('usergroups');
|
| $plugins->run_hooks("usercp_usergroups_start");
|
// Changing our display group if($mybb->get_input('displaygroup', MyBB::INPUT_INT))
| // Changing our display group if($mybb->get_input('displaygroup', MyBB::INPUT_INT))
|
Zeile 3634 | Zeile 3765 |
---|
$showmemberof = false; if($mybb->user['additionalgroups']) {
|
$showmemberof = false; if($mybb->user['additionalgroups']) {
|
$query = $db->simple_select("usergroups", "*", "gid IN (".$mybb->user['additionalgroups'].") AND gid !='".$mybb->user['usergroup']."'", array('order_by' => 'title'));
| $additionalgroups = implode( ',', array_map( 'intval', explode(',', $mybb->user['additionalgroups']) ) ); $query = $db->simple_select("usergroups", "*", "gid IN (".$additionalgroups.") AND gid !='".$mybb->user['usergroup']."'", array('order_by' => 'title'));
|
while($usergroup = $db->fetch_array($query)) { $showmemberof = true;
| while($usergroup = $db->fetch_array($query)) { $showmemberof = true;
|
Zeile 3689 | Zeile 3827 |
---|
$existinggroups = $mybb->user['usergroup']; if($mybb->user['additionalgroups']) {
|
$existinggroups = $mybb->user['usergroup']; if($mybb->user['additionalgroups']) {
|
$existinggroups .= ",".$mybb->user['additionalgroups'];
| $additionalgroups = implode( ',', array_map( 'intval', explode(',', $mybb->user['additionalgroups']) ) ); $existinggroups .= ",".$additionalgroups;
|
}
|
}
|
|
|
$joinablegroups = $joinablegrouplist = ''; $query = $db->simple_select("usergroups", "*", "(type='3' OR type='4' OR type='5') AND gid NOT IN ($existinggroups)", array('order_by' => 'title')); while($usergroup = $db->fetch_array($query))
| $joinablegroups = $joinablegrouplist = ''; $query = $db->simple_select("usergroups", "*", "(type='3' OR type='4' OR type='5') AND gid NOT IN ($existinggroups)", array('order_by' => 'title')); while($usergroup = $db->fetch_array($query))
|
Zeile 3701 | Zeile 3846 |
---|
$description = ''; $usergroup['title'] = htmlspecialchars_uni($usergroup['title']); if($usergroup['description'])
|
$description = ''; $usergroup['title'] = htmlspecialchars_uni($usergroup['title']); if($usergroup['description'])
|
{
| {
|
$usergroup['description'] = htmlspecialchars_uni($usergroup['description']); eval("\$description = \"".$templates->get("usercp_usergroups_joinable_usergroup_description")."\";");
|
$usergroup['description'] = htmlspecialchars_uni($usergroup['description']); eval("\$description = \"".$templates->get("usercp_usergroups_joinable_usergroup_description")."\";");
|
}
| }
|
// Moderating join requests? if($usergroup['type'] == 4)
|
// Moderating join requests? if($usergroup['type'] == 4)
|
{
| {
|
$conditions = $lang->usergroup_joins_moderated; }
|
$conditions = $lang->usergroup_joins_moderated; }
|
elseif($usergroup['type'] == 5) { $conditions = $lang->usergroup_joins_invite; } else
| elseif($usergroup['type'] == 5) { $conditions = $lang->usergroup_joins_invite; } else
|
{ $conditions = $lang->usergroup_joins_anyone; }
| { $conditions = $lang->usergroup_joins_anyone; }
|
Zeile 3724 | Zeile 3869 |
---|
{ $applydate = my_date('relative', $appliedjoin[$usergroup['gid']]); $joinlink = $lang->sprintf($lang->join_group_applied, $applydate);
|
{ $applydate = my_date('relative', $appliedjoin[$usergroup['gid']]); $joinlink = $lang->sprintf($lang->join_group_applied, $applydate);
|
}
| }
|
elseif(isset($appliedjoin[$usergroup['gid']]) && $usergroup['type'] == 5) { $joinlink = $lang->sprintf($lang->pending_invitation, $usergroup['gid'], $mybb->post_code);
|
elseif(isset($appliedjoin[$usergroup['gid']]) && $usergroup['type'] == 5) { $joinlink = $lang->sprintf($lang->pending_invitation, $usergroup['gid'], $mybb->post_code);
|
}
| }
|
elseif($usergroup['type'] == 5)
|
elseif($usergroup['type'] == 5)
|
{
| {
|
$joinlink = "--";
|
$joinlink = "--";
|
} else {
| } else {
|
eval("\$joinlink = \"".$templates->get("usercp_usergroups_joinable_usergroup_join")."\";"); }
| eval("\$joinlink = \"".$templates->get("usercp_usergroups_joinable_usergroup_join")."\";"); }
|
Zeile 3750 | Zeile 3895 |
---|
$comma = $lang->comma; } $usergroupleaders = $lang->usergroup_leaders." ".$usergroupleaders;
|
$comma = $lang->comma; } $usergroupleaders = $lang->usergroup_leaders." ".$usergroupleaders;
|
}
| }
|
if(my_strpos($usergroupleaders, $mybb->user['username']) === false) { // User is already a leader of the group, so don't show as a "Join Group"
| if(my_strpos($usergroupleaders, $mybb->user['username']) === false) { // User is already a leader of the group, so don't show as a "Join Group"
|
Zeile 3767 | Zeile 3912 |
---|
eval("\$groupmemberships = \"".$templates->get("usercp_usergroups")."\";"); output_page($groupmemberships);
|
eval("\$groupmemberships = \"".$templates->get("usercp_usergroups")."\";"); output_page($groupmemberships);
|
}
| }
|
if($mybb->input['action'] == "attachments") {
|
if($mybb->input['action'] == "attachments") {
|
$plugins->run_hooks("usercp_attachments_start");
| |
require_once MYBB_ROOT."inc/functions_upload.php";
if($mybb->settings['enableattachments'] == 0)
|
require_once MYBB_ROOT."inc/functions_upload.php";
if($mybb->settings['enableattachments'] == 0)
|
{
| {
|
error($lang->attachments_disabled);
|
error($lang->attachments_disabled);
|
}
| }
$plugins->run_hooks("usercp_attachments_start");
|
// Get unviewable forums $f_perm_sql = '';
| // Get unviewable forums $f_perm_sql = '';
|
Zeile 3793 | Zeile 3939 |
---|
}
$attachments = '';
|
}
$attachments = '';
|
$query = $db->simple_select("attachments", "SUM(filesize) AS ausage, COUNT(aid) AS acount", "uid='".$mybb->user['uid']."'"); $usage = $db->fetch_array($query); $totalattachments = $usage['acount'];
| |
// Pagination if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1) { $mybb->settings['threadsperpage'] = 20;
|
// Pagination if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1) { $mybb->settings['threadsperpage'] = 20;
|
}
| }
|
$perpage = $mybb->settings['threadsperpage']; $page = $mybb->get_input('page', MyBB::INPUT_INT);
if($page > 0) { $start = ($page-1) * $perpage;
|
$perpage = $mybb->settings['threadsperpage']; $page = $mybb->get_input('page', MyBB::INPUT_INT);
if($page > 0) { $start = ($page-1) * $perpage;
|
$pages = ceil($totalattachments / $perpage); if($page > $pages) { $start = 0; $page = 1; }
| |
} else { $start = 0; $page = 1; }
|
} else { $start = 0; $page = 1; }
|
|
|
$end = $start + $perpage; $lower = $start+1;
| $end = $start + $perpage; $lower = $start+1;
|
Zeile 3835 | Zeile 3971 |
---|
ORDER BY p.dateline DESC LIMIT {$start}, {$perpage} ");
|
ORDER BY p.dateline DESC LIMIT {$start}, {$perpage} ");
|
$bandwidth = $totaldownloads = 0;
| $bandwidth = $totaldownloads = $totalusage = $totalattachments = $processedattachments = 0;
|
while($attachment = $db->fetch_array($query)) { if($attachment['dateline'] && $attachment['tid'])
|
while($attachment = $db->fetch_array($query)) { if($attachment['dateline'] && $attachment['tid'])
|
{
| {
|
$attachment['subject'] = htmlspecialchars_uni($parser->parse_badwords($attachment['subject'])); $attachment['postlink'] = get_post_link($attachment['pid'], $attachment['tid']); $attachment['threadlink'] = get_thread_link($attachment['tid']);
| $attachment['subject'] = htmlspecialchars_uni($parser->parse_badwords($attachment['subject'])); $attachment['postlink'] = get_post_link($attachment['pid'], $attachment['tid']); $attachment['threadlink'] = get_thread_link($attachment['tid']);
|
Zeile 3848 | Zeile 3984 |
---|
$size = get_friendly_size($attachment['filesize']); $icon = get_attachment_icon(get_extension($attachment['filename'])); $attachment['filename'] = htmlspecialchars_uni($attachment['filename']);
|
$size = get_friendly_size($attachment['filesize']); $icon = get_attachment_icon(get_extension($attachment['filename'])); $attachment['filename'] = htmlspecialchars_uni($attachment['filename']);
|
|
|
$sizedownloads = $lang->sprintf($lang->attachment_size_downloads, $size, $attachment['downloads']); $attachdate = my_date('relative', $attachment['dateline']); $altbg = alt_trow();
eval("\$attachments .= \"".$templates->get("usercp_attachments_attachment")."\";");
|
$sizedownloads = $lang->sprintf($lang->attachment_size_downloads, $size, $attachment['downloads']); $attachdate = my_date('relative', $attachment['dateline']); $altbg = alt_trow();
eval("\$attachments .= \"".$templates->get("usercp_attachments_attachment")."\";");
|
|
|
// Add to bandwidth total $bandwidth += ($attachment['filesize'] * $attachment['downloads']); $totaldownloads += $attachment['downloads'];
|
// Add to bandwidth total $bandwidth += ($attachment['filesize'] * $attachment['downloads']); $totaldownloads += $attachment['downloads'];
|
| $totalusage += $attachment['filesize']; ++$totalattachments;
|
} else { // This little thing delets attachments without a thread/post remove_attachment($attachment['pid'], $attachment['posthash'], $attachment['aid']); }
|
} else { // This little thing delets attachments without a thread/post remove_attachment($attachment['pid'], $attachment['posthash'], $attachment['aid']); }
|
| ++$processedattachments; }
if($processedattachments >= $perpage || $page > 1) { $query = $db->query(" SELECT SUM(a.filesize) AS ausage, COUNT(a.aid) AS acount FROM ".TABLE_PREFIX."attachments a LEFT JOIN ".TABLE_PREFIX."posts p ON (a.pid=p.pid) LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) WHERE a.uid='".$mybb->user['uid']."' {$f_perm_sql} "); $usage = $db->fetch_array($query); $totalusage = $usage['ausage']; $totalattachments = $usage['acount'];
$multipage = multipage($totalattachments, $perpage, $page, "usercp.php?action=attachments");
|
}
|
}
|
$totalusage = $usage['ausage'];
| |
$friendlyusage = get_friendly_size((int)$totalusage); if($mybb->usergroup['attachquota']) {
| $friendlyusage = get_friendly_size((int)$totalusage); if($mybb->usergroup['attachquota']) {
|
Zeile 3881 | Zeile 4035 |
---|
$usagenote = $lang->sprintf($lang->attachments_usage, $friendlyusage, $totalattachments); }
|
$usagenote = $lang->sprintf($lang->attachments_usage, $friendlyusage, $totalattachments); }
|
$multipage = multipage($totalattachments, $perpage, $page, "usercp.php?action=attachments");
| |
$bandwidth = get_friendly_size($bandwidth);
if(!$attachments)
| $bandwidth = get_friendly_size($bandwidth);
if(!$attachments)
|
Zeile 3901 | Zeile 4054 |
---|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
$plugins->run_hooks("usercp_do_attachments_start");
| |
require_once MYBB_ROOT."inc/functions_upload.php"; if(!isset($mybb->input['attachments']) || !is_array($mybb->input['attachments'])) { error($lang->no_attachments_selected); }
|
require_once MYBB_ROOT."inc/functions_upload.php"; if(!isset($mybb->input['attachments']) || !is_array($mybb->input['attachments'])) { error($lang->no_attachments_selected); }
|
| $plugins->run_hooks("usercp_do_attachments_start");
|
// Get unviewable forums $f_perm_sql = '';
| // Get unviewable forums $f_perm_sql = '';
|