Fossil SCM
Fixes to the /webmail screen
Commit
a24de3f9fc4f3eb36a4b811d06bb1723ccc4b076c66fac94ca2ebc84b6787dfc
Parent
a4419c6c022e03f…
1 file changed
+7
-7
+7
-7
| --- src/webmail.c | ||
| +++ src/webmail.c | ||
| @@ -620,11 +620,11 @@ | ||
| 620 | 620 | } |
| 621 | 621 | add_content_sql_commands(g.db); |
| 622 | 622 | emailid = atoi(PD("id","0")); |
| 623 | 623 | url_initialize(&url, "webmail"); |
| 624 | 624 | if( g.perm.Admin ){ |
| 625 | - zUser = P("user"); | |
| 625 | + zUser = PD("user",g.zLogin); | |
| 626 | 626 | if( zUser ){ |
| 627 | 627 | url_add_parameter(&url, "user", zUser); |
| 628 | 628 | if( fossil_strcmp(zUser,"*")==0 ){ |
| 629 | 629 | showAll = 1; |
| 630 | 630 | zUser = 0; |
| @@ -702,13 +702,13 @@ | ||
| 702 | 702 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 703 | 703 | got = db_int(0, "SELECT count(*) FROM tmbox"); |
| 704 | 704 | db_prepare(&q, "SELECT * FROM tmbox LIMIT %d", N); |
| 705 | 705 | blob_reset(&sql); |
| 706 | 706 | @ <form action="%R/webmail" method="POST"> |
| 707 | - @ <table border="0" width="100%%"> | |
| 708 | 707 | @ <input type="hidden" name="d" value="%d(d)"> |
| 709 | - @ <input type="hidden" name="user" value="%h(zUser)"> | |
| 708 | + @ <input type="hidden" name="user" value="%h(zUser?zUser:"*")"> | |
| 709 | + @ <table border="0" width="100%%"> | |
| 710 | 710 | @ <tr><td align="left"> |
| 711 | 711 | if( d==2 ){ |
| 712 | 712 | @ <input type="submit" name="read" value="Undelete"> |
| 713 | 713 | @ <input type="submit" name="purge" value="Delete Permanently"> |
| 714 | 714 | }else{ |
| @@ -717,11 +717,11 @@ | ||
| 717 | 717 | @ <input type="submit" name="unread" value="Mark as unread"> |
| 718 | 718 | } |
| 719 | 719 | @ <input type="submit" name="read" value="Mark as read"> |
| 720 | 720 | } |
| 721 | 721 | @ <button onclick="webmailSelectAll(); return false;">Select All</button> |
| 722 | - @ <a href="%s(url_render(&url,0,0,0,0))">refresh</a> | |
| 722 | + @ <a href="%h(url_render(&url,0,0,0,0))">refresh</a> | |
| 723 | 723 | @ </td><td align="right"> |
| 724 | 724 | if( pg>0 ){ |
| 725 | 725 | sqlite3_snprintf(sizeof(zPPg), zPPg, "%d", pg-1); |
| 726 | 726 | @ <a href="%s(url_render(&url,"pg",zPPg,0,0))">< Newer</a> |
| 727 | 727 | } |
| @@ -738,30 +738,30 @@ | ||
| 738 | 738 | const char *zSubject = db_column_text(&q, 4); |
| 739 | 739 | if( zSubject==0 || zSubject[0]==0 ) zSubject = "(no subject)"; |
| 740 | 740 | @ <tr> |
| 741 | 741 | @ <td><input type="checkbox" class="webmailckbox" name="e%s(zId)"></td> |
| 742 | 742 | @ <td>%h(zFrom)</td> |
| 743 | - @ <td><a href="%s(url_render(&url,"id",zId,0,0))">%h(zSubject)</a> \ | |
| 743 | + @ <td><a href="%h(url_render(&url,"id",zId,0,0))">%h(zSubject)</a> \ | |
| 744 | 744 | @ %s(zDate)</td> |
| 745 | 745 | if( showAll ){ |
| 746 | 746 | const char *zTo = db_column_text(&q,5); |
| 747 | - @ <td><a href="%s(url_render(&url,"user",zTo,0,0))">%h(zTo)</a></td> | |
| 747 | + @ <td><a href="%h(url_render(&url,"user",zTo,0,0))">%h(zTo)</a></td> | |
| 748 | 748 | } |
| 749 | 749 | @ </tr> |
| 750 | 750 | } |
| 751 | 751 | db_finalize(&q); |
| 752 | 752 | @ </table> |
| 753 | 753 | @ </form> |
| 754 | - style_footer(); | |
| 755 | 754 | @ <script> |
| 756 | 755 | @ function webmailSelectAll(){ |
| 757 | 756 | @ var x = document.getElementsByClassName("webmailckbox"); |
| 758 | 757 | @ for(i=0; i<x.length; i++){ |
| 759 | 758 | @ x[i].checked = true; |
| 760 | 759 | @ } |
| 761 | 760 | @ } |
| 762 | 761 | @ </script> |
| 762 | + style_footer(); | |
| 763 | 763 | db_end_transaction(0); |
| 764 | 764 | } |
| 765 | 765 | |
| 766 | 766 | /* |
| 767 | 767 | ** WEBPAGE: emailblob |
| 768 | 768 |
| --- src/webmail.c | |
| +++ src/webmail.c | |
| @@ -620,11 +620,11 @@ | |
| 620 | } |
| 621 | add_content_sql_commands(g.db); |
| 622 | emailid = atoi(PD("id","0")); |
| 623 | url_initialize(&url, "webmail"); |
| 624 | if( g.perm.Admin ){ |
| 625 | zUser = P("user"); |
| 626 | if( zUser ){ |
| 627 | url_add_parameter(&url, "user", zUser); |
| 628 | if( fossil_strcmp(zUser,"*")==0 ){ |
| 629 | showAll = 1; |
| 630 | zUser = 0; |
| @@ -702,13 +702,13 @@ | |
| 702 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 703 | got = db_int(0, "SELECT count(*) FROM tmbox"); |
| 704 | db_prepare(&q, "SELECT * FROM tmbox LIMIT %d", N); |
| 705 | blob_reset(&sql); |
| 706 | @ <form action="%R/webmail" method="POST"> |
| 707 | @ <table border="0" width="100%%"> |
| 708 | @ <input type="hidden" name="d" value="%d(d)"> |
| 709 | @ <input type="hidden" name="user" value="%h(zUser)"> |
| 710 | @ <tr><td align="left"> |
| 711 | if( d==2 ){ |
| 712 | @ <input type="submit" name="read" value="Undelete"> |
| 713 | @ <input type="submit" name="purge" value="Delete Permanently"> |
| 714 | }else{ |
| @@ -717,11 +717,11 @@ | |
| 717 | @ <input type="submit" name="unread" value="Mark as unread"> |
| 718 | } |
| 719 | @ <input type="submit" name="read" value="Mark as read"> |
| 720 | } |
| 721 | @ <button onclick="webmailSelectAll(); return false;">Select All</button> |
| 722 | @ <a href="%s(url_render(&url,0,0,0,0))">refresh</a> |
| 723 | @ </td><td align="right"> |
| 724 | if( pg>0 ){ |
| 725 | sqlite3_snprintf(sizeof(zPPg), zPPg, "%d", pg-1); |
| 726 | @ <a href="%s(url_render(&url,"pg",zPPg,0,0))">< Newer</a> |
| 727 | } |
| @@ -738,30 +738,30 @@ | |
| 738 | const char *zSubject = db_column_text(&q, 4); |
| 739 | if( zSubject==0 || zSubject[0]==0 ) zSubject = "(no subject)"; |
| 740 | @ <tr> |
| 741 | @ <td><input type="checkbox" class="webmailckbox" name="e%s(zId)"></td> |
| 742 | @ <td>%h(zFrom)</td> |
| 743 | @ <td><a href="%s(url_render(&url,"id",zId,0,0))">%h(zSubject)</a> \ |
| 744 | @ %s(zDate)</td> |
| 745 | if( showAll ){ |
| 746 | const char *zTo = db_column_text(&q,5); |
| 747 | @ <td><a href="%s(url_render(&url,"user",zTo,0,0))">%h(zTo)</a></td> |
| 748 | } |
| 749 | @ </tr> |
| 750 | } |
| 751 | db_finalize(&q); |
| 752 | @ </table> |
| 753 | @ </form> |
| 754 | style_footer(); |
| 755 | @ <script> |
| 756 | @ function webmailSelectAll(){ |
| 757 | @ var x = document.getElementsByClassName("webmailckbox"); |
| 758 | @ for(i=0; i<x.length; i++){ |
| 759 | @ x[i].checked = true; |
| 760 | @ } |
| 761 | @ } |
| 762 | @ </script> |
| 763 | db_end_transaction(0); |
| 764 | } |
| 765 | |
| 766 | /* |
| 767 | ** WEBPAGE: emailblob |
| 768 |
| --- src/webmail.c | |
| +++ src/webmail.c | |
| @@ -620,11 +620,11 @@ | |
| 620 | } |
| 621 | add_content_sql_commands(g.db); |
| 622 | emailid = atoi(PD("id","0")); |
| 623 | url_initialize(&url, "webmail"); |
| 624 | if( g.perm.Admin ){ |
| 625 | zUser = PD("user",g.zLogin); |
| 626 | if( zUser ){ |
| 627 | url_add_parameter(&url, "user", zUser); |
| 628 | if( fossil_strcmp(zUser,"*")==0 ){ |
| 629 | showAll = 1; |
| 630 | zUser = 0; |
| @@ -702,13 +702,13 @@ | |
| 702 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 703 | got = db_int(0, "SELECT count(*) FROM tmbox"); |
| 704 | db_prepare(&q, "SELECT * FROM tmbox LIMIT %d", N); |
| 705 | blob_reset(&sql); |
| 706 | @ <form action="%R/webmail" method="POST"> |
| 707 | @ <input type="hidden" name="d" value="%d(d)"> |
| 708 | @ <input type="hidden" name="user" value="%h(zUser?zUser:"*")"> |
| 709 | @ <table border="0" width="100%%"> |
| 710 | @ <tr><td align="left"> |
| 711 | if( d==2 ){ |
| 712 | @ <input type="submit" name="read" value="Undelete"> |
| 713 | @ <input type="submit" name="purge" value="Delete Permanently"> |
| 714 | }else{ |
| @@ -717,11 +717,11 @@ | |
| 717 | @ <input type="submit" name="unread" value="Mark as unread"> |
| 718 | } |
| 719 | @ <input type="submit" name="read" value="Mark as read"> |
| 720 | } |
| 721 | @ <button onclick="webmailSelectAll(); return false;">Select All</button> |
| 722 | @ <a href="%h(url_render(&url,0,0,0,0))">refresh</a> |
| 723 | @ </td><td align="right"> |
| 724 | if( pg>0 ){ |
| 725 | sqlite3_snprintf(sizeof(zPPg), zPPg, "%d", pg-1); |
| 726 | @ <a href="%s(url_render(&url,"pg",zPPg,0,0))">< Newer</a> |
| 727 | } |
| @@ -738,30 +738,30 @@ | |
| 738 | const char *zSubject = db_column_text(&q, 4); |
| 739 | if( zSubject==0 || zSubject[0]==0 ) zSubject = "(no subject)"; |
| 740 | @ <tr> |
| 741 | @ <td><input type="checkbox" class="webmailckbox" name="e%s(zId)"></td> |
| 742 | @ <td>%h(zFrom)</td> |
| 743 | @ <td><a href="%h(url_render(&url,"id",zId,0,0))">%h(zSubject)</a> \ |
| 744 | @ %s(zDate)</td> |
| 745 | if( showAll ){ |
| 746 | const char *zTo = db_column_text(&q,5); |
| 747 | @ <td><a href="%h(url_render(&url,"user",zTo,0,0))">%h(zTo)</a></td> |
| 748 | } |
| 749 | @ </tr> |
| 750 | } |
| 751 | db_finalize(&q); |
| 752 | @ </table> |
| 753 | @ </form> |
| 754 | @ <script> |
| 755 | @ function webmailSelectAll(){ |
| 756 | @ var x = document.getElementsByClassName("webmailckbox"); |
| 757 | @ for(i=0; i<x.length; i++){ |
| 758 | @ x[i].checked = true; |
| 759 | @ } |
| 760 | @ } |
| 761 | @ </script> |
| 762 | style_footer(); |
| 763 | db_end_transaction(0); |
| 764 | } |
| 765 | |
| 766 | /* |
| 767 | ** WEBPAGE: emailblob |
| 768 |