"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Upload/usercp.php" between
mybb_1821.zip and mybb_1822.zip

About: MyBB is a multilingual, standards-compliant and free forum (discussion board) software.

usercp.php  (mybb_1821):usercp.php  (mybb_1822)
skipping to change at line 61 skipping to change at line 61
} }
$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"); $plugins->run_hooks("usercp_start");
if($mybb->input['action'] == "do_editsig" && $mybb->request_method == "post") if($mybb->input['action'] == "do_editsig" && $mybb->request_method == "post")
{ {
require_once MYBB_ROOT."inc/datahandlers/user.php"; require_once MYBB_ROOT."inc/datahandlers/user.php";
$userhandler = new UserDataHandler(); $userhandler = new UserDataHandler();
$data = array( $data = array(
'uid' => $mybb->user['uid'], 'uid' => $mybb->user['uid'],
'signature' => $mybb->get_input('signature'), 'signature' => $mybb->get_input('signature'),
); );
skipping to change at line 220 skipping to change at line 230
$user = array( $user = array(
"uid" => $mybb->user['uid'], "uid" => $mybb->user['uid'],
"postnum" => $mybb->user['postnum'], "postnum" => $mybb->user['postnum'],
"usergroup" => $mybb->user['usergroup'], "usergroup" => $mybb->user['usergroup'],
"additionalgroups" => $mybb->user['additionalgroups'], "additionalgroups" => $mybb->user['additionalgroups'],
"birthday" => $bday, "birthday" => $bday,
"birthdayprivacy" => $mybb->get_input('birthdayprivacy'), "birthdayprivacy" => $mybb->get_input('birthdayprivacy'),
"away" => $away, "away" => $away,
"profile_fields" => $mybb->get_input('profile_fields', MyBB::INPU T_ARRAY) "profile_fields" => $mybb->get_input('profile_fields', MyBB::INPU T_ARRAY)
); );
foreach(array('icq', 'yahoo', 'skype', 'google') as $cfield) foreach(array('icq', 'skype', 'google') as $cfield)
{ {
$csetting = 'allow'.$cfield.'field'; $csetting = 'allow'.$cfield.'field';
if($mybb->settings[$csetting] == '') if($mybb->settings[$csetting] == '')
{ {
continue; continue;
} }
if(!is_member($mybb->settings[$csetting])) if(!is_member($mybb->settings[$csetting]))
{ {
continue; continue;
skipping to change at line 369 skipping to change at line 379
if($user['icq'] == 0) if($user['icq'] == 0)
{ {
$user['icq'] = ''; $user['icq'] = '';
} }
if($errors) if($errors)
{ {
$user['skype'] = htmlspecialchars_uni($user['skype']); $user['skype'] = htmlspecialchars_uni($user['skype']);
$user['google'] = htmlspecialchars_uni($user['google']); $user['google'] = htmlspecialchars_uni($user['google']);
$user['yahoo'] = htmlspecialchars_uni($user['yahoo']);
} }
$contact_fields = array(); $contact_fields = array();
$contactfields = ''; $contactfields = '';
$cfieldsshow = false; $cfieldsshow = false;
foreach(array('icq', 'yahoo', 'skype', 'google') as $cfield) foreach(array('icq', 'skype', 'google') as $cfield)
{ {
$contact_fields[$cfield] = ''; $contact_fields[$cfield] = '';
$csetting = 'allow'.$cfield.'field'; $csetting = 'allow'.$cfield.'field';
if($mybb->settings[$csetting] == '') if($mybb->settings[$csetting] == '')
{ {
continue; continue;
} }
if(!is_member($mybb->settings[$csetting])) if(!is_member($mybb->settings[$csetting]))
{ {
skipping to change at line 1371 skipping to change at line 1380
eval("\$editpassword = \"".$templates->get("usercp_password")."\";"); eval("\$editpassword = \"".$templates->get("usercp_password")."\";");
output_page($editpassword); output_page($editpassword);
} }
if($mybb->input['action'] == "do_changename" && $mybb->request_method == "post") if($mybb->input['action'] == "do_changename" && $mybb->request_method == "post")
{ {
// Verify incoming POST request // Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key')); verify_post_check($mybb->get_input('my_post_key'));
$errors = array();
$plugins->run_hooks("usercp_do_changename_start"); $plugins->run_hooks("usercp_do_changename_start");
if($mybb->usergroup['canchangename'] != 1) if($mybb->usergroup['canchangename'] != 1)
{ {
error_no_permission(); error_no_permission();
} }
if(validate_password_from_uid($mybb->user['uid'], $mybb->get_input('passw ord')) == false) if(validate_password_from_uid($mybb->user['uid'], $mybb->get_input('passw ord')) == false)
{ {
$errors[] = $lang->error_invalidpassword; $errors[] = $lang->error_invalidpassword;
} }
skipping to change at line 1421 skipping to change at line 1432
} }
if($mybb->input['action'] == "changename") if($mybb->input['action'] == "changename")
{ {
$plugins->run_hooks("usercp_changename_start"); $plugins->run_hooks("usercp_changename_start");
if($mybb->usergroup['canchangename'] != 1) if($mybb->usergroup['canchangename'] != 1)
{ {
error_no_permission(); error_no_permission();
} }
// Coming back to this page after one or more errors were experienced, sh
ow 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");
eval("\$changename = \"".$templates->get("usercp_changename")."\";"); eval("\$changename = \"".$templates->get("usercp_changename")."\";");
output_page($changename); output_page($changename);
} }
if($mybb->input['action'] == "do_subscriptions") if($mybb->input['action'] == "do_subscriptions")
{ {
// Verify incoming POST request // Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key')); verify_post_check($mybb->get_input('my_post_key'));
skipping to change at line 1947 skipping to change at line 1968
// check if the forum requires a password to view. If so, we need to show a form to the user // 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_forum_password($thread['fid']);
// 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_do_addsubscription"); $plugins->run_hooks("usercp2_do_addsubscription");
add_subscribed_thread($thread['tid'], $mybb->get_input('notification', My BB::INPUT_INT)); add_subscribed_thread($thread['tid'], $mybb->get_input('notification', My BB::INPUT_INT));
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'].'/'.e
nd($url_segments);
}
$url = htmlspecialchars_uni($mybb->input['referrer']);
} }
else else
{ {
$url = get_thread_link($thread['tid']); $url = get_thread_link($thread['tid']);
} }
redirect($url, $lang->redirect_subscriptionadded); redirect($url, $lang->redirect_subscriptionadded);
} }
if($mybb->input['action'] == "addsubscription") if($mybb->input['action'] == "addsubscription")
{ {
 End of changes. 7 change blocks. 
4 lines changed or deleted 41 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)