"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Upload/private.php" between
mybb_1822.zip and mybb_1823.zip

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

private.php  (mybb_1822):private.php  (mybb_1823)
skipping to change at line 45 skipping to change at line 45
if($mybb->settings['enablepms'] == 0) if($mybb->settings['enablepms'] == 0)
{ {
error($lang->pms_disabled); error($lang->pms_disabled);
} }
if($mybb->user['uid'] == '/' || $mybb->user['uid'] == 0 || $mybb->usergroup['can usepms'] == 0) if($mybb->user['uid'] == '/' || $mybb->user['uid'] == 0 || $mybb->usergroup['can usepms'] == 0)
{ {
error_no_permission(); error_no_permission();
} }
$update = false;
if(!$mybb->user['pmfolders'])
{
$update = true;
$mybb->user['pmfolders'] = "0**$%%$1**$%%$2**$%%$3**$%%$4**";
}
elseif ((int)my_substr($mybb->user['pmfolders'], 0, 1) != 0)
{
// Old folder structure. Need to update
// Since MyBB 1.8.20 fid[0] represents 'Inbox' and fid[1] represents 'Unr
ead'
$update = true;
$mybb->user['pmfolders'] = '0'. ltrim(str_replace("$%%$2**", "$%%$1**$%%$
2**", $mybb->user['pmfolders']), '1');
}
// Folder structure update required?
if($update)
{
$sql_array = array(
"pmfolders" => $db->escape_string($mybb->user['pmfolders']),
);
$db->update_query("users", $sql_array, "uid = ".$mybb->user['uid']);
}
$mybb->input['fid'] = $mybb->get_input('fid', MyBB::INPUT_INT); $mybb->input['fid'] = $mybb->get_input('fid', MyBB::INPUT_INT);
$folder_id = $folder_name = ''; $folder_id = $folder_name = '';
$foldernames = array(); $foldernames = array();
$foldersexploded = explode("$%%$", $mybb->user['pmfolders']); $foldersexploded = explode("$%%$", $mybb->user['pmfolders']);
foreach($foldersexploded as $key => $folders) foreach($foldersexploded as $key => $folders)
{ {
$folderinfo = explode("**", $folders, 2); $folderinfo = explode("**", $folders, 2);
if($mybb->input['fid'] == $folderinfo[0]) if($mybb->input['fid'] == $folderinfo[0])
skipping to change at line 92 skipping to change at line 69
{ {
$sel = ''; $sel = '';
} }
$folderinfo[1] = get_pm_folder_name($folderinfo[0], $folderinfo[1]); $folderinfo[1] = get_pm_folder_name($folderinfo[0], $folderinfo[1]);
$foldernames[$folderinfo[0]] = $folderinfo[1]; $foldernames[$folderinfo[0]] = $folderinfo[1];
$folder_id = $folderinfo[0]; $folder_id = $folderinfo[0];
$folder_name = $folderinfo[1]; $folder_name = $folderinfo[1];
eval("\$folderjump_folder .= \"".$templates->get("private_jump_folders_fo lder")."\";"); eval("\$folderjump_folder .= \"".$templates->get("private_jump_folders_fo lder")."\";");
eval("\$folderoplist_folder .= \"".$templates->get("private_jump_folders_
folder")."\";"); // Manipulate search folder selection & move selector to omit "Unread"
// Manipulate search folder selection to omit "Unread"
if($folder_id != 1) if($folder_id != 1)
{ {
if($folder_id == 0) if($folder_id == 0)
{ {
$folder_id = 1; $folder_id = 1;
} }
eval("\$folderoplist_folder .= \"".$templates->get("private_jump_ folders_folder")."\";");
eval("\$foldersearch_folder .= \"".$templates->get("private_jump_ folders_folder")."\";"); eval("\$foldersearch_folder .= \"".$templates->get("private_jump_ folders_folder")."\";");
} }
} }
$from_fid = $mybb->input['fid']; $from_fid = $mybb->input['fid'];
eval("\$folderjump = \"".$templates->get("private_jump_folders")."\";"); eval("\$folderjump = \"".$templates->get("private_jump_folders")."\";");
eval("\$folderoplist = \"".$templates->get("private_move")."\";"); eval("\$folderoplist = \"".$templates->get("private_move")."\";");
eval("\$foldersearch = \"".$templates->get("private_advanced_search_folders")."\ ";"); eval("\$foldersearch = \"".$templates->get("private_advanced_search_folders")."\ ";");
skipping to change at line 1688 skipping to change at line 1666
verify_post_check($mybb->get_input('my_post_key')); verify_post_check($mybb->get_input('my_post_key'));
$plugins->run_hooks("private_do_stuff"); $plugins->run_hooks("private_do_stuff");
if(!empty($mybb->input['hop'])) if(!empty($mybb->input['hop']))
{ {
header("Location: private.php?fid=".$mybb->get_input('jumpto')); header("Location: private.php?fid=".$mybb->get_input('jumpto'));
} }
elseif(!empty($mybb->input['moveto'])) elseif(!empty($mybb->input['moveto']))
{ {
$mybb->input['check'] = $mybb->get_input('check', MyBB::INPUT_ARR $pms = array_map('intval', array_keys($mybb->get_input('check', M
AY); yBB::INPUT_ARRAY)));
if(!empty($mybb->input['check'])) if(!empty($pms))
{ {
foreach($mybb->input['check'] as $key => $val) if(!$mybb->input['fid'])
{ {
$sql_array = array( $mybb->input['fid'] = 1;
"folder" => $mybb->input['fid'] }
);
$db->update_query("privatemessages", $sql_array, if(array_key_exists($mybb->input['fid'], $foldernames))
"pmid='".(int)$key."' AND uid='".$mybb->user['uid']."'"); {
$db->update_query("privatemessages", array("folde
r" => $mybb->input['fid']), "pmid IN (".implode(",", $pms).") AND uid='".$mybb->
user['uid']."'");
update_pm_count();
}
else
{
error($lang->error_invalidmovefid);
} }
} }
// Update PM count
update_pm_count();
if(!empty($mybb->input['fromfid'])) if(!empty($mybb->input['fromfid']))
{ {
redirect("private.php?fid=".$mybb->get_input('fromfid', M yBB::INPUT_INT), $lang->redirect_pmsmoved); redirect("private.php?fid=".$mybb->get_input('fromfid', M yBB::INPUT_INT), $lang->redirect_pmsmoved);
} }
else else
{ {
redirect("private.php", $lang->redirect_pmsmoved); redirect("private.php", $lang->redirect_pmsmoved);
} }
} }
 End of changes. 7 change blocks. 
39 lines changed or deleted 20 lines changed or added

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