summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-09-11 19:34:35 +0200
committerAleksander Machniak <alec@alec.pl>2012-09-11 19:36:32 +0200
commit8361a48bdd2c365a82ed67ce652a83663149713c (patch)
tree4c2d9c1540c8f4cf6bea7d4968f1303d46bd4f99
parent1424e53b96e79ad212b67d74eb5d372c14e8b1b3 (diff)
Fix error where session wasn't updated after folder rename/delete (#1488692)
Conflicts: CHANGELOG
-rw-r--r--CHANGELOG1
-rw-r--r--program/steps/settings/folders.inc14
-rw-r--r--program/steps/settings/save_folder.inc11
3 files changed, 21 insertions, 5 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 3852c0d9e..0d6ca413d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
+- Fix error where session wasn't updated after folder rename/delete (#1488692)
- Fix PLAIN authentication for some IMAP servers (#1488674)
- Fix encoding vCard file when contains PHOTO;ENCODING=b (#1488683)
- Fix focus issue in IE when selecting message row (#1488620)
diff --git a/program/steps/settings/folders.inc b/program/steps/settings/folders.inc
index 1739c273b..d97666f2a 100644
--- a/program/steps/settings/folders.inc
+++ b/program/steps/settings/folders.inc
@@ -88,6 +88,11 @@ else if ($RCMAIL->action == 'delete-folder')
else {
$deleted = $plugin['result'];
}
+
+ // #1488692: update session
+ if ($deleted && $_SESSION['mbox'] === $mbox) {
+ $RCMAIL->session->remove('mbox');
+ }
}
if ($OUTPUT->ajax_call && $deleted) {
@@ -396,15 +401,20 @@ function rcmail_rename_folder($oldname, $newname)
foreach ($a_threaded as $key => $val) {
if ($key == $oldname) {
unset($a_threaded[$key]);
- $a_threaded[$newname] = true;
+ $a_threaded[$newname] = true;
}
else if (preg_match($oldprefix, $key)) {
unset($a_threaded[$key]);
- $a_threaded[preg_replace($oldprefix, $newname.$delimiter, $key)] = true;
+ $a_threaded[preg_replace($oldprefix, $newname.$delimiter, $key)] = true;
}
}
$RCMAIL->user->save_prefs(array('message_threading' => $a_threaded));
+ // #1488692: update session
+ if ($_SESSION['mbox'] === $oldname) {
+ $_SESSION['mbox'] = $newname;
+ }
+
return true;
}
diff --git a/program/steps/settings/save_folder.inc b/program/steps/settings/save_folder.inc
index f3692de30..84a4a44eb 100644
--- a/program/steps/settings/save_folder.inc
+++ b/program/steps/settings/save_folder.inc
@@ -1,11 +1,11 @@
<?php
-/*
+/**
+-----------------------------------------------------------------------+
| program/steps/settings/save_folder.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2009, The Roundcube Dev Team |
+ | Copyright (C) 2005-2012, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -173,7 +173,7 @@ else if (!$error) {
}
else if (preg_match($oldprefix, $key)) {
unset($a_threaded[$key]);
- $a_threaded[preg_replace($oldprefix, $folder['name'].$delimiter, $key)] = true;
+ $a_threaded[preg_replace($oldprefix, $folder['name'].$delimiter, $key)] = true;
}
}
}
@@ -186,7 +186,12 @@ else if (!$error) {
}
$OUTPUT->show_message('folderupdated', 'confirmation');
+
if ($rename) {
+ // #1488692: update session
+ if ($_SESSION['mbox'] === $folder['oldname']) {
+ $_SESSION['mbox'] = $folder['name'];
+ }
rcmail_update_folder_row($folder['name'], $folder['oldname'], $folder['subscribe'], $folder['class']);
$OUTPUT->send('iframe');
}