e140ce7632dd6dad22106555d8b123dab883d0c6
[pkgsrc.git] / mail / squirrelmail / patches / patch-af
1 $NetBSD: patch-af,v 1.3 2010/03/04 16:00:37 taca Exp $
2
3 --- src/search.php.orig 2009-08-12 17:29:53.000000000 +0900
4 +++ src/search.php
5 @@ -226,7 +226,7 @@ function printSearchMessages($msgs,$mail
6          if ((!empty($allow_server_sort) && $allow_server_sort) || (!empty($allow_server_thread) && $allow_server_thread)) {
7              $msort = $msgs;
8          } else {
9 -            $msort = calc_msort($msgs, $sort);
10 +            $msort = calc_msort($msgs, $sort, $mailbox);
11          }
12  
13          if ( $mailbox == 'INBOX' ) {
14 @@ -368,6 +368,7 @@ if ($saved_count > 0) {
15          .     '?mailbox=' . urlencode($saved_attributes['saved_folder'][$i + 1])
16          .     '&what=' . urlencode($saved_attributes['saved_what'][$i + 1])
17          .     '&where=' . urlencode($saved_attributes['saved_where'][$i + 1])
18 +        .     '&smtoken=' . sm_generate_security_token()
19          .   '">' . _("edit") . '</a>'
20          .   '&nbsp;|&nbsp;'
21          .   '<a href="search.php'
22 @@ -375,9 +376,10 @@ if ($saved_count > 0) {
23          .     '&amp;what=' . urlencode($saved_attributes['saved_what'][$i + 1])
24          .     '&amp;where=' . urlencode($saved_attributes['saved_where'][$i + 1])
25          .     '&amp;submit=Search_no_update'
26 +        .     '&amp;smtoken=' . sm_generate_security_token()
27          .   '">' . _("search") . '</a>'
28          .   '&nbsp;|&nbsp;'
29 -        .   "<a href=\"search.php?count=$i&amp;submit=delete\">"
30 +        .   "<a href=\"search.php?count=$i&amp;submit=delete&amp;smtoken=" . sm_generate_security_token() .'">'
31          .     _("delete")
32          .   '</a>'
33          . '</td></tr>';
34 @@ -395,7 +397,7 @@ if ($recent_count > 0) {
35         . html_tag( 'td' )
36         . html_tag( 'table', '', 'center', '', 'width="100%" cellpadding="0" cellspacing="0" border="0"' );
37      for ($i=1; $i <= $recent_count; ++$i) {
38 -            if (isset($attributes['search_folder'][$i])) { 
39 +            if (isset($attributes['search_folder'][$i])) {
40              if ($attributes['search_folder'][$i] == "") {
41                  $attributes['search_folder'][$i] = "INBOX";
42              }
43 @@ -411,7 +413,7 @@ if ($recent_count > 0) {
44                 . html_tag( 'td', htmlspecialchars($attributes['search_what'][$i]), 'left' )
45                 . html_tag( 'td', htmlspecialchars($attributes['search_where'][$i]), 'center' )
46                 . html_tag( 'td', '', 'right' )
47 -               .   "<a href=\"search.php?count=$i&amp;submit=save\">"
48 +               .   "<a href=\"search.php?count=$i&amp;submit=save&amp;smtoken=" . sm_generate_security_token() . '">'
49                 .     _("save")
50                 .   '</a>'
51                 .   '&nbsp;|&nbsp;'
52 @@ -420,9 +422,10 @@ if ($recent_count > 0) {
53                 .     '&amp;what=' . urlencode($attributes['search_what'][$i])
54                 .     '&amp;where=' . urlencode($attributes['search_where'][$i])
55                 .     '&amp;submit=Search_no_update'
56 +               .     '&amp;smtoken=' . sm_generate_security_token()
57                 .   '">' . _("search") . '</a>'
58                 .   '&nbsp;|&nbsp;'
59 -               .   "<a href=\"search.php?count=$i&amp;submit=forget\">"
60 +               .   "<a href=\"search.php?count=$i&amp;submit=forget&amp;smtoken=" . sm_generate_security_token() . '">'
61                 .     _("forget")
62                 .   '</a>'
63                 . '</td></tr>';