[prev in list] [next in list] [prev in thread] [next in thread]
List: squirrelmail-cvs
Subject: [SM-CVS] SF.net SVN: squirrelmail:[13905]
From: pdontthink () users ! sourceforge ! net
Date: 2010-02-13 22:49:59
Message-ID: E1NgQoJ-0005yh-0F () sfp-svn-2 ! v30 ! ch3 ! sourceforge ! com
[Download RAW message or body]
Revision: 13905
http://squirrelmail.svn.sourceforge.net/squirrelmail/?rev=13905&view=rev
Author: pdontthink
Date: 2010-02-13 22:49:58 +0000 (Sat, 13 Feb 2010)
Log Message:
-----------
Add unread links in message view
Modified Paths:
--------------
branches/SM-1_4-STABLE/squirrelmail/doc/ChangeLog
branches/SM-1_4-STABLE/squirrelmail/plugins/delete_move_next/setup.php
branches/SM-1_4-STABLE/squirrelmail/src/read_body.php
branches/SM-1_4-STABLE/squirrelmail/src/right_main.php
branches/SM-1_4-STABLE/squirrelmail/src/search.php
Modified: branches/SM-1_4-STABLE/squirrelmail/doc/ChangeLog
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/doc/ChangeLog 2010-02-13 16:28:10 UTC (rev \
13904)
+++ branches/SM-1_4-STABLE/squirrelmail/doc/ChangeLog 2010-02-13 22:49:58 UTC (rev \
13905) @@ -4,20 +4,21 @@
Version 1.4.20 - SVN
--------------------
- - Fix issue with search not using literals correctly (#2846511).
- - Fix issue with returning to search results due to new security token code.
- - Fix issue with multi-part related messages not showing all attachments \
(#2830140).
- - Fix for security token missing in newmail plugin (#2919418).
- - Fix sort in Sent folder to sort by "To" field instead of "From" field \
(#2907412).
- - Fix for mailto: urls containing + characters, thanks to Michael Puls II for the
+ - Fixed issue with search not using literals correctly (#2846511).
+ - Fixed issue with returning to search results due to new security token code.
+ - Fixed issue with multi-part related messages not showing all attachments \
(#2830140). + - Fixed for security token missing in newmail plugin (#2919418).
+ - Fixed sort in Sent folder to sort by "To" field instead of "From" field \
(#2907412). + - Fixed mailto: urls containing + characters. Thanks to Michael Puls \
II for the patch.
- - Make base URL autodetection more robust; fixes some lighttpd issues
+ - Made base URL autodetection more robust; fixes some lighttpd issues
(probably #1741469).
- - Encoded From headers now properly quoted (#2830141).
+ - Encoded From headers are now properly quoted (#2830141).
- Multibyte strings (notably subjects) are now handled correctly (#2824813,
#2925731).
- - Send X-DNS-Prefetch-Control: off header to browsers to prevent information
+ - X-DNS-Prefetch-Control: off header is now sent to browsers to prevent \
information
leakage when Firefox does DNS prefetching for URL's contained in emails.
+ - Added unread links in message view.
Version 1.4.20 RC2 - 17 Aug 2009
--------------------------------
Modified: branches/SM-1_4-STABLE/squirrelmail/plugins/delete_move_next/setup.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/plugins/delete_move_next/setup.php 2010-02-13 \
16:28:10 UTC (rev 13904)
+++ branches/SM-1_4-STABLE/squirrelmail/plugins/delete_move_next/setup.php 2010-02-13 \
22:49:58 UTC (rev 13905) @@ -15,6 +15,8 @@
* @subpackage delete_move_next
*/
+//FIXME: all functionality needs to be moved out of the setup.php file!
+
/**
* Initialize the plugin
* @return void
@@ -122,10 +124,12 @@
function delete_move_next_action() {
- if ( sqgetGlobalVar('delete_id', $delete_id, SQ_GET) ) {
+ if ( sqgetGlobalVar('unread_id', $unread_id, SQ_GET) ) {
+ delete_move_next_unread();
+ } else if ( sqgetGlobalVar('delete_id', $delete_id, SQ_GET) ) {
delete_move_next_delete();
fix_sort_array();
- } elseif ( sqgetGlobalVar('move_id', $move_id, SQ_POST) ) {
+ } else if ( sqgetGlobalVar('move_id', $move_id, SQ_POST) ) {
delete_move_next_move();
fix_sort_array();
}
@@ -154,7 +158,7 @@
$color, $where, $what, $currentArrayIndex, $passed_id,
$mailbox, $sort, $startMessage, $delete_id, $move_id,
$imapConnection, $auto_expunge, $move_to_trash, $mbx_response,
- $uid_support, $passed_ent_id;
+ $uid_support, $passed_ent_id, $delete_move_next_show_unread;
$urlMailbox = urlencode($mailbox);
@@ -182,15 +186,27 @@
"<td bgcolor=\"$color[9]\" width=\"100%\" \
align=\"center\"><small>";
if ($prev > 0){
- echo "<a \
href=\"read_body.php?passed_id=$prev_if_del&mailbox=$urlMailbox&sort=$sort& \
;startMessage=$startMessage&show_more=0&delete_id=$passed_id&smtoken=" . \
sm_generate_security_token() . "\">" . _("Delete & Prev") . "</a>" . \
" | \n"; + echo "<a \
href=\"read_body.php?passed_id=$prev_if_del&mailbox=$urlMailbox&sort=$sort& \
;startMessage=$startMessage&show_more=0&delete_id=$passed_id&smtoken=" . \
sm_generate_security_token() . "\">" . _("Delete & Prev") . "</a>" . \
" | "; + if ($delete_move_next_show_unread == 'on') {
+ echo "<a \
href=\"read_body.php?passed_id=$prev_if_del&mailbox=$urlMailbox&sort=$sort& \
;startMessage=$startMessage&show_more=0&unread_id=$passed_id&smtoken=" . \
sm_generate_security_token() . "\">" . _("Unread & Prev") . "</a>" . \
" | "; + }
}
else {
echo _("Delete & Prev") . " | ";
+ if ($delete_move_next_show_unread == 'on') {
+ echo _("Unread & Prev") . " | ";
+ }
}
if ($next > 0){
- echo "<a \
href=\"read_body.php?passed_id=$next_if_del&mailbox=$urlMailbox&sort=$sort& \
;startMessage=$startMessage&show_more=0&delete_id=$passed_id&smtoken=" . \
sm_generate_security_token() . "\">" . _("Delete & Next") . "</a>\n"; + \
echo "<a href=\"read_body.php?passed_id=$next_if_del&mailbox=$urlMailbox&sort= \
$sort&startMessage=$startMessage&show_more=0&unread_id=$passed_id&smtoken=" \
. sm_generate_security_token() . "\">" . _("Unread & Next") . "</a>"; + \
if ($delete_move_next_show_unread == 'on') { + echo " | <a \
href=\"read_body.php?passed_id=$next_if_del&mailbox=$urlMailbox&sort=$sort& \
;startMessage=$startMessage&show_more=0&delete_id=$passed_id&smtoken=" . \
sm_generate_security_token() . "\">" . _("Delete & Next") . "</a>"; + \
} } else {
echo _("Delete & Next");
+ if ($delete_move_next_show_unread == 'on') {
+ echo " | " . _("Unread & Next");
+ }
}
echo '</small></td></tr>';
@@ -274,6 +290,20 @@
'</tr>';
}
+function delete_move_next_unread() {
+ global $imapConnection;
+
+ sqgetGlobalVar('unread_id', $unread_id, SQ_GET);
+ if (!sqgetGlobalVar('smtoken',$submitted_token, SQ_GET)) {
+ $submitted_token = '';
+ }
+
+ // first, validate security token
+ sm_validate_security_token($submitted_token, 3600, TRUE);
+
+ sqimap_toggle_flag($imapConnection, $unread_id, '\\Seen', false, true);
+}
+
function delete_move_next_delete() {
global $imapConnection, $auto_expunge;
@@ -320,11 +350,12 @@
}
function delete_move_next_display_inside() {
- global $username,$data_dir,
+ global $username,$data_dir, $delete_move_next_show_unread,
$delete_move_next_t, $delete_move_next_formATtop,
$delete_move_next_b, $delete_move_next_formATbottom;
- echo "<tr>" . html_tag('td',_("Delete/Move/Next \
Buttons:"),'right','','valign=top') . "\n". +//FIXME: This HTML really needs to be \
fixed... + echo "<tr>" . html_tag('td',_("Delete/Unread/Move/Next \
Buttons:"),'right','','valign=top') . "\n". "<td><input type=checkbox \
name=delete_move_next_ti";
if ($delete_move_next_t == 'on') {
@@ -349,6 +380,11 @@
echo ' checked';
}
echo '> ' . _("with move option") . '<br>'.
+ '<input type=checkbox name=delete_move_next_show_unread';
+ if($delete_move_next_show_unread != 'off') {
+ echo ' checked';
+ }
+ echo '> ' . _("Show unread options") .
"</td></tr>\n";
}
@@ -380,10 +416,16 @@
} else {
setPref($data_dir, $username, 'delete_move_next_formATbottom', "off");
}
+
+ if ( sqgetGlobalVar('delete_move_next_show_unread', \
$delete_move_next_show_unread, SQ_POST) ) { + setPref($data_dir, $username, \
'delete_move_next_show_unread', 'on'); + } else {
+ setPref($data_dir, $username, 'delete_move_next_show_unread', "off");
+ }
}
function delete_move_next_loading_prefs() {
- global $username,$data_dir,
+ global $username,$data_dir, $delete_move_next_show_unread,
$delete_move_next_t, $delete_move_next_formATtop,
$delete_move_next_b, $delete_move_next_formATbottom;
@@ -391,7 +433,7 @@
$delete_move_next_b = getPref($data_dir, $username, 'delete_move_next_b');
$delete_move_next_formATtop = getPref($data_dir, $username, \
'delete_move_next_formATtop');
$delete_move_next_formATbottom = getPref($data_dir, $username, \
'delete_move_next_formATbottom'); + $delete_move_next_show_unread = \
getPref($data_dir, $username, 'delete_move_next_show_unread');
}
-?>
Modified: branches/SM-1_4-STABLE/squirrelmail/src/read_body.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/src/read_body.php 2010-02-13 16:28:10 UTC \
(rev 13904)
+++ branches/SM-1_4-STABLE/squirrelmail/src/read_body.php 2010-02-13 22:49:58 UTC \
(rev 13905) @@ -545,8 +545,17 @@
$delete_url = $base_uri . 'src/delete_message.php?mailbox=' . $urlMailbox .
'&message=' . $passed_id . '&smtoken=' . \
sm_generate_security_token() . '&'; + $unread_url = $base_uri . 'src/';
if (!(isset($passed_ent_id) && $passed_ent_id)) {
if ($where && $what) {
+ $unread_url .= 'search.php?unread_passed_id=' . $passed_id . \
'&smtoken=' . sm_generate_security_token() . '&where=' . urlencode($where) . \
'&what=' . urlencode($what) . '&mailbox=' . $urlMailbox; + } else {
+ $unread_url .= 'right_main.php?unread_passed_id=' . $passed_id . \
'&sort=' . $sort . '&startMessage=' . $startMessage . '&mailbox=' . \
$urlMailbox; + }
+ $s .= $topbar_delimiter;
+ $s .= '<a href="' . $unread_url . '">' . _("Unread") . '</a>';
+
+ if ($where && $what) {
$delete_url .= 'where=' . urlencode($where) . '&what=' . \
urlencode($what); } else {
$delete_url .= 'sort=' . $sort . '&startMessage=' . $startMessage;
Modified: branches/SM-1_4-STABLE/squirrelmail/src/right_main.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/src/right_main.php 2010-02-13 16:28:10 UTC \
(rev 13904)
+++ branches/SM-1_4-STABLE/squirrelmail/src/right_main.php 2010-02-13 22:49:58 UTC \
(rev 13905) @@ -152,6 +152,13 @@
sqimap_mailbox_select($imapConnection, $mailbox);
+// the preg_match() is a fix for Dovecot wherein UIDs can be bigger than
+// normal integers - this isn't in 1.4 yet, but when adding new code, why not...
+if (sqgetGlobalVar('unread_passed_id', $unread_passed_id, SQ_GET)
+ && preg_match('/^[0-9]+$/', $unread_passed_id)) {
+ sqimap_toggle_flag($imapConnection, $unread_passed_id, '\\Seen', false, true);
+}
+
if ($composenew) {
$comp_uri = SM_PATH . 'src/compose.php?mailbox='. urlencode($mailbox).
"&session=" .urlencode($session);
Modified: branches/SM-1_4-STABLE/squirrelmail/src/search.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/src/search.php 2010-02-13 16:28:10 UTC (rev \
13904)
+++ branches/SM-1_4-STABLE/squirrelmail/src/search.php 2010-02-13 22:49:58 UTC (rev \
13905) @@ -294,6 +294,14 @@
$search_all = 'all';
}
+// the preg_match() is a fix for Dovecot wherein UIDs can be bigger than
+// normal integers - this isn't in 1.4 yet, but when adding new code, why not...
+if (sqgetGlobalVar('unread_passed_id', $unread_passed_id, SQ_GET)
+ && preg_match('/^[0-9]+$/', $unread_passed_id)) {
+ sqimap_mailbox_select($imapConnection, $mailbox);
+ sqimap_toggle_flag($imapConnection, $unread_passed_id, '\\Seen', false, true);
+}
+
if (isset($composenew) && $composenew) {
$comp_uri = "../src/compose.php?mailbox=". urlencode($mailbox).
"&session=$composesession&";
This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
-----
squirrelmail-cvs mailing list
List address: squirrelmail-cvs@lists.sourceforge.net
List info (subscribe/unsubscribe/change options): \
https://lists.sourceforge.net/lists/listinfo/squirrelmail-cvs
Repository: http://squirrelmail.org/svn
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic