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 172 | Zeile 178 |
---|
if($return_year < my_date('Y', $awaydate) || ($returntimestamp < $awaytimestamp && $return_year == my_date('Y', $awaydate))) { error($lang->error_usercp_return_date_past);
|
if($return_year < my_date('Y', $awaydate) || ($returntimestamp < $awaytimestamp && $return_year == my_date('Y', $awaydate))) { error($lang->error_usercp_return_date_past);
|
}
| }
|
$returndate = "{$return_day}-{$return_month}-{$return_year}"; } else
| $returndate = "{$return_day}-{$return_month}-{$return_year}"; } else
|
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)
| )); foreach(array('icq', 'skype', 'google') as $cfield)
|
{ $csetting = 'allow'.$cfield.'field'; if($mybb->settings[$csetting] == '')
|
{ $csetting = 'allow'.$cfield.'field'; if($mybb->settings[$csetting] == '')
|
{ continue; }
| { continue; }
|
if(!is_member($mybb->settings[$csetting])) { continue; }
if($cfield == 'icq')
|
if(!is_member($mybb->settings[$csetting])) { continue; }
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); } } }
|
if($mybb->usergroup['canchangewebsite'] == 1) {
| if($mybb->usergroup['canchangewebsite'] == 1) {
|
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 428 | Zeile 443 |
---|
$awaydate = my_date($mybb->settings['dateformat'], $mybb->user['awaydate']); $awaycheck[1] = "checked=\"checked\""; $awaynotice = $lang->sprintf($lang->away_notice_away, $awaydate);
|
$awaydate = my_date($mybb->settings['dateformat'], $mybb->user['awaydate']); $awaycheck[1] = "checked=\"checked\""; $awaynotice = $lang->sprintf($lang->away_notice_away, $awaydate);
|
} else {
| } else {
|
$awaynotice = $lang->away_notice; $awaycheck[0] = "checked=\"checked\""; }
| $awaynotice = $lang->away_notice; $awaycheck[0] = "checked=\"checked\""; }
|
Zeile 556 | Zeile 571 |
---|
} } elseif($type == "select")
|
} } elseif($type == "select")
|
{
| {
|
$expoptions = explode("\n", $options); if(is_array($expoptions)) {
| $expoptions = explode("\n", $options); if(is_array($expoptions)) {
|
Zeile 741 | Zeile 756 |
---|
{ // 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_options_start");
| $plugins->run_hooks("usercp_do_options_start");
|
Zeile 748 | Zeile 765 |
---|
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'], "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 != '')
|
if($errors != '')
|
{
| {
|
$user = $mybb->input; } else { $user = $mybb->user; }
|
$user = $mybb->input; } else { $user = $mybb->user; }
|
| $plugins->run_hooks("usercp_options_start");
|
$languages = $lang->get_languages(); $board_language = $langoptions = '';
| $languages = $lang->get_languages(); $board_language = $langoptions = '';
|
Zeile 937 | Zeile 954 |
---|
}
if(isset($user['receivepms']) && $user['receivepms'] == 1)
|
}
if(isset($user['receivepms']) && $user['receivepms'] == 1)
|
{
| {
|
$receivepmscheck = "checked=\"checked\"";
|
$receivepmscheck = "checked=\"checked\"";
|
}
| }
|
else { $receivepmscheck = "";
|
else { $receivepmscheck = "";
|
}
| }
|
if(isset($user['receivefrombuddy']) && $user['receivefrombuddy'] == 1)
|
if(isset($user['receivefrombuddy']) && $user['receivefrombuddy'] == 1)
|
{
| {
|
$receivefrombuddycheck = "checked=\"checked\""; } else { $receivefrombuddycheck = "";
|
$receivefrombuddycheck = "checked=\"checked\""; } 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 967 | Zeile 984 |
---|
if(isset($user['dstcorrection']) && $user['dstcorrection'] == 2) { $dst_auto_selected = "selected=\"selected\"";
|
if(isset($user['dstcorrection']) && $user['dstcorrection'] == 2) { $dst_auto_selected = "selected=\"selected\"";
|
}
| }
|
elseif(isset($user['dstcorrection']) && $user['dstcorrection'] == 1)
|
elseif(isset($user['dstcorrection']) && $user['dstcorrection'] == 1)
|
{
| {
|
$dst_enabled_selected = "selected=\"selected\"";
|
$dst_enabled_selected = "selected=\"selected\"";
|
}
| }
|
else { $dst_disabled_selected = "selected=\"selected\"";
|
else { $dst_disabled_selected = "selected=\"selected\"";
|
}
| }
|
if(isset($user['showcodebuttons']) && $user['showcodebuttons'] == 1)
|
if(isset($user['showcodebuttons']) && $user['showcodebuttons'] == 1)
|
{
| {
|
$showcodebuttonscheck = "checked=\"checked\"";
|
$showcodebuttonscheck = "checked=\"checked\"";
|
} else {
| } else {
|
$showcodebuttonscheck = ""; }
if(isset($user['sourceeditor']) && $user['sourceeditor'] == 1) { $sourcemodecheck = "checked=\"checked\"";
|
$showcodebuttonscheck = ""; }
if(isset($user['sourceeditor']) && $user['sourceeditor'] == 1) { $sourcemodecheck = "checked=\"checked\"";
|
} else {
| } else {
|
$sourcemodecheck = "";
|
$sourcemodecheck = "";
|
}
| }
|
if(isset($user['showredirect']) && $user['showredirect'] != 0)
|
if(isset($user['showredirect']) && $user['showredirect'] != 0)
|
{
| {
|
$showredirectcheck = "checked=\"checked\"";
|
$showredirectcheck = "checked=\"checked\"";
|
} else {
| } else {
|
$showredirectcheck = ""; }
if(isset($user['pmnotify']) && $user['pmnotify'] != 0) { $pmnotifycheck = "checked=\"checked\"";
|
$showredirectcheck = ""; }
if(isset($user['pmnotify']) && $user['pmnotify'] != 0) { $pmnotifycheck = "checked=\"checked\"";
|
} else {
| } else {
|
$pmnotifycheck = ''; }
if(isset($user['buddyrequestspm']) && $user['buddyrequestspm'] != 0) { $buddyrequestspmcheck = "checked=\"checked\"";
|
$pmnotifycheck = ''; }
if(isset($user['buddyrequestspm']) && $user['buddyrequestspm'] != 0) { $buddyrequestspmcheck = "checked=\"checked\"";
|
}
| }
|
else { $buddyrequestspmcheck = '';
| else { $buddyrequestspmcheck = '';
|
Zeile 1032 | Zeile 1049 |
---|
}
if(!isset($user['threadmode']) || ($user['threadmode'] != "threaded" && $user['threadmode'] != "linear"))
|
}
if(!isset($user['threadmode']) || ($user['threadmode'] != "threaded" && $user['threadmode'] != "linear"))
|
{
| {
|
$user['threadmode'] = ''; // Leave blank to show default }
| $user['threadmode'] = ''; // Leave blank to show default }
|
Zeile 1047 | Zeile 1064 |
---|
$date_format_options = $dateformat = ''; foreach($date_formats as $key => $format)
|
$date_format_options = $dateformat = ''; foreach($date_formats as $key => $format)
|
{ $selected = '';
| { $selected = '';
|
if(isset($user['dateformat']) && $user['dateformat'] == $key) { $selected = " selected=\"selected\"";
| if(isset($user['dateformat']) && $user['dateformat'] == $key) { $selected = " selected=\"selected\"";
|
Zeile 1063 | Zeile 1080 |
---|
{ $selected = ''; if(isset($user['timeformat']) && $user['timeformat'] == $key)
|
{ $selected = ''; if(isset($user['timeformat']) && $user['timeformat'] == $key)
|
{
| {
|
$selected = " selected=\"selected\""; }
$timeformat = my_date($format, TIME_NOW, "", 0); eval("\$time_format_options .= \"".$templates->get("usercp_options_time_format")."\";");
|
$selected = " selected=\"selected\""; }
$timeformat = my_date($format, TIME_NOW, "", 0); eval("\$time_format_options .= \"".$templates->get("usercp_options_time_format")."\";");
|
}
| }
|
$tzselect = build_timezone_select("timezoneoffset", $mybb->user['timezone'], true);
$pms_from_buddys = ''; if($mybb->settings['allowbuddyonly'] == 1)
|
$tzselect = build_timezone_select("timezoneoffset", $mybb->user['timezone'], true);
$pms_from_buddys = ''; if($mybb->settings['allowbuddyonly'] == 1)
|
{
| {
|
eval("\$pms_from_buddys = \"".$templates->get("usercp_options_pms_from_buddys")."\";"); }
$pms = ''; if($mybb->settings['enablepms'] != 0 && $mybb->usergroup['canusepms'] == 1)
|
eval("\$pms_from_buddys = \"".$templates->get("usercp_options_pms_from_buddys")."\";"); }
$pms = ''; if($mybb->settings['enablepms'] != 0 && $mybb->usergroup['canusepms'] == 1)
|
{
| {
|
eval("\$pms = \"".$templates->get("usercp_options_pms")."\";"); }
$quick_reply = ''; if($mybb->settings['quickreply'] == 1)
|
eval("\$pms = \"".$templates->get("usercp_options_pms")."\";"); }
$quick_reply = ''; if($mybb->settings['quickreply'] == 1)
|
{
| {
|
eval("\$quick_reply = \"".$templates->get("usercp_options_quick_reply")."\";"); }
$threadview = array('linear' => '', 'threaded' => ''); if(isset($user['threadmode']) && is_scalar($user['threadmode']))
|
eval("\$quick_reply = \"".$templates->get("usercp_options_quick_reply")."\";"); }
$threadview = array('linear' => '', 'threaded' => ''); if(isset($user['threadmode']) && is_scalar($user['threadmode']))
|
{
| {
|
$threadview[$user['threadmode']] = 'selected="selected"'; } $daysprunesel = array(1 => '', 5 => '', 10 => '', 20 => '', 50 => '', 75 => '', 100 => '', 365 => '', 9999 => '');
| $threadview[$user['threadmode']] = 'selected="selected"'; } $daysprunesel = array(1 => '', 5 => '', 10 => '', 20 => '', 50 => '', 75 => '', 100 => '', 365 => '', 9999 => '');
|
Zeile 1105 | Zeile 1122 |
---|
{ $user['style'] = ''; }
|
{ $user['style'] = ''; }
|
|
|
$board_style = $stylelist = ''; $stylelist = build_theme_select("style", $user['style']);
if(!empty($stylelist))
|
$board_style = $stylelist = ''; $stylelist = build_theme_select("style", $user['style']);
if(!empty($stylelist))
|
{
| {
|
eval('$board_style = "'.$templates->get('usercp_options_style').'";'); }
| eval('$board_style = "'.$templates->get('usercp_options_style').'";'); }
|
Zeile 1203 | Zeile 1220 |
---|
{ $query = $db->simple_select("awaitingactivation", "*", "uid='".$mybb->user['uid']."' AND (type='r' OR type='b')"); $activation = $db->fetch_array($query);
|
{ $query = $db->simple_select("awaitingactivation", "*", "uid='".$mybb->user['uid']."' AND (type='r' OR type='b')"); $activation = $db->fetch_array($query);
|
}
| }
|
if($activation) { $userhandler->update_user();
| if($activation) { $userhandler->update_user();
|
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");
| $errors = array();
$plugins->run_hooks("usercp_do_password_start");
|
Zeile 1322 | Zeile 1340 |
---|
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'], "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);
|
|
|
if(!$userhandler->validate_user()) { $errors = $userhandler->get_friendly_errors();
| if(!$userhandler->validate_user()) { $errors = $userhandler->get_friendly_errors();
|
Zeile 1342 | Zeile 1360 |
---|
// Notify the user by email that their password has been changed $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']);
|
// Notify the user by email that their password has been changed $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);
| 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 1352 | Zeile 1370 |
---|
{ $mybb->input['action'] = "password"; $errors = inline_error($errors);
|
{ $mybb->input['action'] = "password"; $errors = inline_error($errors);
|
} }
| } }
|
if($mybb->input['action'] == "password") { $plugins->run_hooks("usercp_password");
| if($mybb->input['action'] == "password") { $plugins->run_hooks("usercp_password");
|
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)
| } } if(count($errors) > 0)
|
Zeile 1411 | Zeile 1433 |
---|
}
if($mybb->input['action'] == "changename")
|
}
if($mybb->input['action'] == "changename")
|
{
| {
|
$plugins->run_hooks("usercp_changename_start"); if($mybb->usergroup['canchangename'] != 1) { error_no_permission();
|
$plugins->run_hooks("usercp_changename_start"); 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");
eval("\$changename = \"".$templates->get("usercp_changename")."\";"); output_page($changename); }
|
$plugins->run_hooks("usercp_changename_end");
eval("\$changename = \"".$templates->get("usercp_changename")."\";"); output_page($changename); }
|
|
|
if($mybb->input['action'] == "do_subscriptions") { // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
if($mybb->input['action'] == "do_subscriptions") { // 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 1944 | Zeile 1976 |
---|
if($mybb->get_input('referrer')) {
|
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 1952 | Zeile 1996 |
---|
} redirect($url, $lang->redirect_subscriptionadded); }
|
} redirect($url, $lang->redirect_subscriptionadded); }
|
|
|
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)
| { // 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); }
| { error($lang->error_invalidforum); }
|
Zeile 1992 | Zeile 2036 |
---|
{ $thread = get_thread($mybb->get_input('tid', MyBB::INPUT_INT)); if(!$thread || $thread['visible'] == -1)
|
{ $thread = get_thread($mybb->get_input('tid', MyBB::INPUT_INT)); if(!$thread || $thread['visible'] == -1)
|
{ error($lang->error_invalidthread); }
| { error($lang->error_invalidthread); }
|
// Is the currently logged in user a moderator of this forum? $ismod = is_moderator($thread['fid']);
|
// 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); }
|
// 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);
$forumpermissions = forum_permissions($thread['fid']); if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0 || (isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] != 0 && $thread['uid'] != $mybb->user['uid']))
|
add_breadcrumb($lang->nav_subthreads, "usercp.php?action=subscriptions"); add_breadcrumb($lang->nav_addsubscription);
$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(); }
| error_no_permission(); }
|
Zeile 2041 | Zeile 2085 |
---|
elseif($mybb->user['subscriptionmethod'] == 3) { $notification_pm_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");
| }
// 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);
| eval("\$add_subscription = \"".$templates->get("usercp_addsubscription_thread")."\";"); output_page($add_subscription);
|
Zeile 2052 | Zeile 2096 |
---|
} }
|
} }
|
if($mybb->input['action'] == "removesubscription")
| 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'));
| { // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
Zeile 2072 | Zeile 2116 |
---|
$plugins->run_hooks("usercp2_removesubscription_forum");
remove_subscribed_forum($forum['fid']);
|
$plugins->run_hooks("usercp2_removesubscription_forum");
remove_subscribed_forum($forum['fid']);
|
if($server_http_referer && $mybb->request_method != 'post') { $url = $server_http_referer; }
| if($server_http_referer && $mybb->request_method != 'post') { $url = $server_http_referer; }
|
else { $url = "usercp.php?action=forumsubscriptions"; } redirect($url, $lang->redirect_forumsubscriptionremoved);
|
else { $url = "usercp.php?action=forumsubscriptions"; } redirect($url, $lang->redirect_forumsubscriptionremoved);
|
} 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) {
|
Zeile 2101 | Zeile 2145 |
---|
// 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);
| // 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") { $referrer = ''; 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']);
$lang->unsubscribe_from_forum = $lang->sprintf($lang->unsubscribe_from_forum, $forum['name']);
// Naming of the hook retained for backward compatibility while dropping usercp2.php $plugins->run_hooks("usercp2_removesubscription_display_forum");
eval("\$remove_forum_subscription = \"".$templates->get("usercp_removesubscription_forum")."\";"); output_page($remove_forum_subscription); exit; } else { $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? $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); }
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']);
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 2138 | Zeile 2259 |
---|
$url = "usercp.php?action=forumsubscriptions"; } redirect($url, $lang->redirect_forumsubscriptionsremoved);
|
$url = "usercp.php?action=forumsubscriptions"; } redirect($url, $lang->redirect_forumsubscriptionsremoved);
|
} else
| } else
|
{ // Naming of the hook retained for backward compatibility while dropping usercp2.php $plugins->run_hooks("usercp2_removesubscriptions_thread");
| { // Naming of the hook retained for backward compatibility while dropping usercp2.php $plugins->run_hooks("usercp2_removesubscriptions_thread");
|
Zeile 2154 | Zeile 2275 |
---|
$url = "usercp.php?action=subscriptions"; } redirect($url, $lang->redirect_subscriptionsremoved);
|
$url = "usercp.php?action=subscriptions"; } redirect($url, $lang->redirect_subscriptionsremoved);
|
} }
| } }
|
if($mybb->input['action'] == "do_editsig" && $mybb->request_method == "post") { // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
if($mybb->input['action'] == "do_editsig" && $mybb->request_method == "post") { // 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")
|
{
| {
|
$update_signature = array( "includesig" => 1 );
| $update_signature = array( "includesig" => 1 );
|
Zeile 2202 | Zeile 2323 |
---|
$template = "usercp_editsig_preview"; } elseif(empty($error))
|
$template = "usercp_editsig_preview"; } elseif(empty($error))
|
{
| {
|
$sig = $mybb->user['signature']; $template = "usercp_editsig_current"; }
| $sig = $mybb->user['signature']; $template = "usercp_editsig_current"; }
|
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 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 2519 | Zeile 2646 |
---|
elseif($mybb->settings['avatarresizing'] == "user") { eval("\$auto_resize = \"".$templates->get("usercp_avatar_auto_resize_user")."\";");
|
elseif($mybb->settings['avatarresizing'] == "user") { eval("\$auto_resize = \"".$templates->get("usercp_avatar_auto_resize_user")."\";");
|
}
| }
|
$avatarupload = ''; if($mybb->usergroup['canuploadavatars'] == 1)
| $avatarupload = ''; if($mybb->usergroup['canuploadavatars'] == 1)
|
Zeile 2535 | Zeile 2662 |
---|
$removeavatar = ''; if(!empty($mybb->user['avatar']))
|
$removeavatar = ''; if(!empty($mybb->user['avatar']))
|
{
| {
|
eval("\$removeavatar = \"".$templates->get("usercp_avatar_remove")."\";"); }
| eval("\$removeavatar = \"".$templates->get("usercp_avatar_remove")."\";"); }
|
Zeile 2559 | Zeile 2686 |
---|
$query = $db->simple_select('buddyrequests', '*', 'id='.$mybb->get_input('id', MyBB::INPUT_INT).' AND touid='.(int)$mybb->user['uid']); $request = $db->fetch_array($query); if(empty($request))
|
$query = $db->simple_select('buddyrequests', '*', 'id='.$mybb->get_input('id', MyBB::INPUT_INT).' AND touid='.(int)$mybb->user['uid']); $request = $db->fetch_array($query); if(empty($request))
|
{
| {
|
error($lang->invalid_request); }
| error($lang->invalid_request); }
|
Zeile 2582 | Zeile 2709 |
---|
// Now we have the new list, so throw it all back together $new_list = implode(",", $user['buddylist']);
|
// 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, -1) == ",") { $new_list = my_substr($new_list, 0, my_strlen($new_list)-2); }
$user['buddylist'] = $db->escape_string($new_list);
| // 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, -1) == ",") { $new_list = my_substr($new_list, 0, my_strlen($new_list)-2); }
$user['buddylist'] = $db->escape_string($new_list);
|
$db->update_query("users", array('buddylist' => $user['buddylist']), "uid='".(int)$user['uid']."'");
|
$db->update_query("users", array('buddylist' => $user['buddylist']), "uid='".(int)$user['uid']."'");
|
|
|
// We want to add the user to our buddy list
|
// We want to add the user to our buddy list
|
if($mybb->user['buddylist'] != '') { $mybb->user['buddylist'] = explode(',', $mybb->user['buddylist']); }
| if($mybb->user['buddylist'] != '') { $mybb->user['buddylist'] = explode(',', $mybb->user['buddylist']); }
|
else { $mybb->user['buddylist'] = array(); }
$mybb->user['buddylist'][] = (int)$request['uid'];
|
else { $mybb->user['buddylist'] = array(); }
$mybb->user['buddylist'][] = (int)$request['uid'];
|
|
|
// Now we have the new list, so throw it all back together $new_list = implode(",", $mybb->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(",", $mybb->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 2642 | Zeile 2769 |
---|
);
send_pm($pm, $mybb->user['uid'], true);
|
);
send_pm($pm, $mybb->user['uid'], true);
|
$db->delete_query('buddyrequests', 'id='.(int)$request['id']); }
| $db->delete_query('buddyrequests', 'id='.(int)$request['id']); }
|
else { error($lang->user_doesnt_exist);
| else { error($lang->user_doesnt_exist);
|
Zeile 2770 | Zeile 2897 |
---|
continue; } $users[$key] = $db->escape_string($username);
|
continue; } $users[$key] = $db->escape_string($username);
|
}
| }
|
// Get the requests we have sent that are still pending $query = $db->simple_select('buddyrequests', 'touid', 'uid='.(int)$mybb->user['uid']);
| // Get the requests we have sent that are still pending $query = $db->simple_select('buddyrequests', 'touid', 'uid='.(int)$mybb->user['uid']);
|
Zeile 2833 | Zeile 2960 |
---|
}
if(isset($requests[$user['uid']]))
|
}
if(isset($requests[$user['uid']]))
|
{
| {
|
if($mybb->get_input('manage') != "ignored") { $error_message = $lang->users_already_sent_request;
| if($mybb->get_input('manage') != "ignored") { $error_message = $lang->users_already_sent_request;
|
Zeile 3069 | Zeile 3196 |
---|
if($new_list == "") { echo "\$(\"#".$mybb->get_input('manage')."_count\").html(\"0\");\n";
|
if($new_list == "") { echo "\$(\"#".$mybb->get_input('manage')."_count\").html(\"0\");\n";
|
| echo "\$(\"#buddylink\").remove();\n";
|
if($mybb->get_input('manage') == "ignored") { echo "\$(\"#ignore_list\").html(\"<li>{$lang->ignore_list_empty}</li>\");\n";
| if($mybb->get_input('manage') == "ignored") { echo "\$(\"#ignore_list\").html(\"<li>{$lang->ignore_list_empty}</li>\");\n";
|
Zeile 3086 | Zeile 3215 |
---|
exit; } $mybb->input['action'] = "editlists";
|
exit; } $mybb->input['action'] = "editlists";
|
} else {
| } else {
|
if($error_message) { $message .= "<br />".$error_message;
| if($error_message) { $message .= "<br />".$error_message;
|
Zeile 3215 | Zeile 3344 |
---|
FROM ".TABLE_PREFIX."buddyrequests r LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=r.uid) WHERE r.touid=".(int)$mybb->user['uid']);
|
FROM ".TABLE_PREFIX."buddyrequests r LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=r.uid) WHERE r.touid=".(int)$mybb->user['uid']);
|
|
|
while($request = $db->fetch_array($query)) { $bgcolor = alt_trow();
| while($request = $db->fetch_array($query)) { $bgcolor = alt_trow();
|
Zeile 3326 | Zeile 3455 |
---|
// 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_drafts_start");
| |
$mybb->input['deletedraft'] = $mybb->get_input('deletedraft', MyBB::INPUT_ARRAY); if(empty($mybb->input['deletedraft']))
|
$mybb->input['deletedraft'] = $mybb->get_input('deletedraft', MyBB::INPUT_ARRAY); if(empty($mybb->input['deletedraft']))
|
{
| {
|
error($lang->no_drafts_selected); }
|
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 3341 | Zeile 3473 |
---|
$pidin[] = "'".(int)$id."'"; } elseif($val == "thread")
|
$pidin[] = "'".(int)$id."'"; } elseif($val == "thread")
|
{
| {
|
$tidin[] = "'".(int)$id."'"; } } if($tidin)
|
$tidin[] = "'".(int)$id."'"; } } if($tidin)
|
{
| {
|
$tidin = implode(",", $tidin); $db->delete_query("threads", "tid IN ($tidin) AND visible='-2' AND uid='".$mybb->user['uid']."'"); $tidinp = "OR tid IN ($tidin)";
|
$tidin = implode(",", $tidin); $db->delete_query("threads", "tid IN ($tidin) AND visible='-2' AND uid='".$mybb->user['uid']."'"); $tidinp = "OR tid IN ($tidin)";
|
}
| }
|
if($pidin || $tidinp) { $pidinq = $tidin = '';
| if($pidin || $tidinp) { $pidinq = $tidin = '';
|
Zeile 3358 | Zeile 3490 |
---|
{ $pidin = implode(",", $pidin); $pidinq = "pid IN ($pidin)";
|
{ $pidin = implode(",", $pidin); $pidinq = "pid IN ($pidin)";
|
}
| }
|
else { $pidinq = "1=0";
| else { $pidinq = "1=0";
|
Zeile 3371 | Zeile 3503 |
---|
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 3468 | Zeile 3601 |
---|
if($joinrequest['rid']) { error($lang->already_sent_join_request);
|
if($joinrequest['rid']) { error($lang->already_sent_join_request);
|
}
| }
|
if($mybb->get_input('do') == "joingroup" && $usergroup['type'] == 4) {
| if($mybb->get_input('do') == "joingroup" && $usergroup['type'] == 4) {
|
Zeile 3531 | Zeile 3664 |
---|
{ // 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'));
|
|
|
$usergroup = $usergroups[$mybb->get_input('acceptinvite', MyBB::INPUT_INT)];
if(my_strpos($ingroups, ",".$mybb->get_input('acceptinvite', MyBB::INPUT_INT).",") !== false)
| $usergroup = $usergroups[$mybb->get_input('acceptinvite', MyBB::INPUT_INT)];
if(my_strpos($ingroups, ",".$mybb->get_input('acceptinvite', MyBB::INPUT_INT).",") !== false)
|
Zeile 3547 | Zeile 3680 |
---|
$db->delete_query("joinrequests", "uid='{$mybb->user['uid']}' AND gid='".$mybb->get_input('acceptinvite', MyBB::INPUT_INT)."'"); $plugins->run_hooks("usercp_usergroups_accept_invite"); redirect("usercp.php?action=usergroups", $lang->joined_group);
|
$db->delete_query("joinrequests", "uid='{$mybb->user['uid']}' AND gid='".$mybb->get_input('acceptinvite', MyBB::INPUT_INT)."'"); $plugins->run_hooks("usercp_usergroups_accept_invite"); redirect("usercp.php?action=usergroups", $lang->joined_group);
|
}
| }
|
else { error($lang->no_pending_invitation);
| else { error($lang->no_pending_invitation);
|
Zeile 3562 | Zeile 3695 |
---|
{ case "pgsql": case "sqlite":
|
{ case "pgsql": case "sqlite":
|
$query = $db->query(" SELECT g.title, g.gid, g.type, COUNT(DISTINCT u.uid) AS users, COUNT(DISTINCT j.rid) AS joinrequests, l.canmanagerequests, l.canmanagemembers, l.caninvitemembers
| $query = $db->query(" SELECT g.title, g.gid, g.type, COUNT(DISTINCT u.uid) AS users, COUNT(DISTINCT j.rid) AS joinrequests, l.canmanagerequests, l.canmanagemembers, l.caninvitemembers
|
FROM ".TABLE_PREFIX."groupleaders l LEFT JOIN ".TABLE_PREFIX."usergroups g ON(g.gid=l.gid) LEFT JOIN ".TABLE_PREFIX."users u ON(((','|| u.additionalgroups|| ',' LIKE '%,'|| g.gid|| ',%') OR u.usergroup = g.gid))
| FROM ".TABLE_PREFIX."groupleaders l LEFT JOIN ".TABLE_PREFIX."usergroups g ON(g.gid=l.gid) LEFT JOIN ".TABLE_PREFIX."users u ON(((','|| u.additionalgroups|| ',' LIKE '%,'|| g.gid|| ',%') OR u.usergroup = g.gid))
|
Zeile 3594 | Zeile 3727 |
---|
$usergroup['joinrequests'] = '--'; } if($usergroup['joinrequests'] > 0 && $usergroup['canmanagerequests'] == 1)
|
$usergroup['joinrequests'] = '--'; } if($usergroup['joinrequests'] > 0 && $usergroup['canmanagerequests'] == 1)
|
{
| {
|
eval("\$moderaterequestslink = \"".$templates->get("usercp_usergroups_leader_usergroup_moderaterequests")."\";"); } $groupleader[$usergroup['gid']] = 1;
| eval("\$moderaterequestslink = \"".$templates->get("usercp_usergroups_leader_usergroup_moderaterequests")."\";"); } $groupleader[$usergroup['gid']] = 1;
|
Zeile 3769 | Zeile 3902 |
---|
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) { error($lang->attachments_disabled); }
|
require_once MYBB_ROOT."inc/functions_upload.php";
if($mybb->settings['enableattachments'] == 0) { error($lang->attachments_disabled); }
|
| $plugins->run_hooks("usercp_attachments_start");
|
// Get unviewable forums $f_perm_sql = '';
| // Get unviewable forums $f_perm_sql = '';
|
Zeile 3784 | Zeile 3918 |
---|
if($unviewable_forums) { $f_perm_sql = " AND t.fid NOT IN ($unviewable_forums)";
|
if($unviewable_forums) { $f_perm_sql = " AND t.fid NOT IN ($unviewable_forums)";
|
}
| }
|
if($inactiveforums)
|
if($inactiveforums)
|
{
| {
|
$f_perm_sql .= " AND t.fid NOT IN ($inactiveforums)";
|
$f_perm_sql .= " AND t.fid NOT IN ($inactiveforums)";
|
}
$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'];
| }
$attachments = '';
|
// Pagination if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1) {
| // Pagination if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1) {
|
Zeile 3808 | Zeile 3938 |
---|
if($page > 0) { $start = ($page-1) * $perpage;
|
if($page > 0) { $start = ($page-1) * $perpage;
|
$pages = ceil($totalattachments / $perpage); if($page > $pages) { $start = 0; $page = 1; }
| |
} else {
| } else {
|
Zeile 3833 | Zeile 3957 |
---|
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'])
|
Zeile 3856 | Zeile 3980 |
---|
// 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 3877 | Zeile 4019 |
---|
{ $attachquota = $lang->unlimited; $usagenote = $lang->sprintf($lang->attachments_usage, $friendlyusage, $totalattachments);
|
{ $attachquota = $lang->unlimited; $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 3898 | Zeile 4039 |
---|
{ // 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 = '';
|
Zeile 3917 | Zeile 4059 |
---|
if($inactiveforums) { $f_perm_sql .= " AND p.fid NOT IN ($inactiveforums)";
|
if($inactiveforums) { $f_perm_sql .= " AND p.fid NOT IN ($inactiveforums)";
|
}
| }
|
$aids = implode(',', array_map('intval', $mybb->input['attachments']));
$query = $db->query("
| $aids = implode(',', array_map('intval', $mybb->input['attachments']));
$query = $db->query("
|
Zeile 3934 | Zeile 4076 |
---|
} $plugins->run_hooks("usercp_do_attachments_end"); redirect("usercp.php?action=attachments", $lang->attachments_deleted);
|
} $plugins->run_hooks("usercp_do_attachments_end"); redirect("usercp.php?action=attachments", $lang->attachments_deleted);
|
}
| }
|
if($mybb->input['action'] == "do_notepad" && $mybb->request_method == "post") {
| if($mybb->input['action'] == "do_notepad" && $mybb->request_method == "post") {
|
Zeile 3966 | Zeile 4108 |
---|
$perday = $mybb->user['postnum'] / $daysreg; $perday = round($perday, 2); if($perday > $mybb->user['postnum'])
|
$perday = $mybb->user['postnum'] / $daysreg; $perday = round($perday, 2); if($perday > $mybb->user['postnum'])
|
{
| {
|
$perday = $mybb->user['postnum']; }
| $perday = $mybb->user['postnum']; }
|
Zeile 3980 | Zeile 4122 |
---|
{ $percent = $mybb->user['postnum']*100/$posts; $percent = round($percent, 2);
|
{ $percent = $mybb->user['postnum']*100/$posts; $percent = round($percent, 2);
|
}
| }
|
$colspan = 2; $lang->posts_day = $lang->sprintf($lang->posts_day, my_number_format($perday), $percent); $regdate = my_date('relative', $mybb->user['regdate']);
| $colspan = 2; $lang->posts_day = $lang->sprintf($lang->posts_day, my_number_format($perday), $percent); $regdate = my_date('relative', $mybb->user['regdate']);
|
Zeile 4108 | Zeile 4250 |
---|
if($mybb->settings['usereferrals'] == 1) { $referral_link = $lang->sprintf($lang->referral_link, $settings['bburl'], $mybb->user['uid']);
|
if($mybb->settings['usereferrals'] == 1) { $referral_link = $lang->sprintf($lang->referral_link, $settings['bburl'], $mybb->user['uid']);
|
| $referral_count = (int) $mybb->user['referrals']; if($referral_count > 0) { $uid = (int) $mybb->user['uid']; eval("\$mybb->user['referrals'] = \"".$templates->get('member_referrals_link')."\";"); }
|
eval("\$referral_info = \"".$templates->get("usercp_referrals")."\";"); }
| eval("\$referral_info = \"".$templates->get("usercp_referrals")."\";"); }
|
Zeile 4185 | Zeile 4335 |
---|
foreach($subscriptions as $thread) {
|
foreach($subscriptions as $thread) {
|
| $plugins->run_hooks("usercp_thread_subscriptions_thread");
|
$folder = ''; $folder_label = ''; $gotounread = '';
| $folder = ''; $folder_label = ''; $gotounread = '';
|
Zeile 4377 | Zeile 4528 |
---|
$latest_threads_threads = ''; foreach($threadcache as $thread) {
|
$latest_threads_threads = ''; foreach($threadcache as $thread) {
|
| $plugins->run_hooks("usercp_latest_threads_thread");
|
if($thread['tid']) { $bgcolor = alt_trow();
| if($thread['tid']) { $bgcolor = alt_trow();
|
Zeile 4493 | Zeile 4645 |
---|
if($thread['closed'] == 1) {
|
if($thread['closed'] == 1) {
|
$folder .= "lock"; $folder_label .= $lang->icon_lock;
| $folder .= "close"; $folder_label .= $lang->icon_close;
|
}
$folder .= "folder";
| }
$folder .= "folder";
|