Fossil SCM
Typo fix and EOL whitespace cleanups. No functional changes.
Commit
55151f0024d38524e8612fd509b78f7d80802277a2f58f9bdf172f3f4303c542
Parent
b76320edee4986f…
1 file changed
+18
-19
+18
-19
| --- src/alerts.c | ||
| +++ src/alerts.c | ||
| @@ -86,11 +86,11 @@ | ||
| 86 | 86 | @ eventid TEXT PRIMARY KEY, -- Object that changed |
| 87 | 87 | @ sentSep BOOLEAN DEFAULT false, -- individual alert sent |
| 88 | 88 | @ sentDigest BOOLEAN DEFAULT false, -- digest alert sent |
| 89 | 89 | @ sentMod BOOLEAN DEFAULT false -- pending moderation alert sent |
| 90 | 90 | @ ) WITHOUT ROWID; |
| 91 | -@ | |
| 91 | +@ | |
| 92 | 92 | @ -- Obsolete table. No longer used. |
| 93 | 93 | @ DROP TABLE IF EXISTS repository.alert_bounce; |
| 94 | 94 | ; |
| 95 | 95 | |
| 96 | 96 | /* |
| @@ -875,11 +875,11 @@ | ||
| 875 | 875 | int nTo = 0; |
| 876 | 876 | char **azTo = 0; |
| 877 | 877 | Blob v; |
| 878 | 878 | char *z, *zAddr; |
| 879 | 879 | int i; |
| 880 | - | |
| 880 | + | |
| 881 | 881 | email_header_value(pMsg, "to", &v); |
| 882 | 882 | z = blob_str(&v); |
| 883 | 883 | for(i=0; z[i]; i++){ |
| 884 | 884 | if( z[i]=='<' && (zAddr = email_copy_addr(&z[i+1],'>'))!=0 ){ |
| 885 | 885 | azTo = fossil_realloc(azTo, sizeof(azTo[0])*(nTo+1) ); |
| @@ -889,11 +889,11 @@ | ||
| 889 | 889 | *pnTo = nTo; |
| 890 | 890 | *pazTo = azTo; |
| 891 | 891 | } |
| 892 | 892 | |
| 893 | 893 | /* |
| 894 | -** Free a list of To addresses obtained from a prior call to | |
| 894 | +** Free a list of To addresses obtained from a prior call to | |
| 895 | 895 | ** email_header_to() |
| 896 | 896 | */ |
| 897 | 897 | void email_header_to_free(int nTo, char **azTo){ |
| 898 | 898 | int i; |
| 899 | 899 | for(i=0; i<nTo; i++) fossil_free(azTo[i]); |
| @@ -915,11 +915,11 @@ | ||
| 915 | 915 | ** Message-Id: |
| 916 | 916 | ** Content-Type: |
| 917 | 917 | ** Content-Transfer-Encoding: |
| 918 | 918 | ** MIME-Version: |
| 919 | 919 | ** Sender: |
| 920 | -** | |
| 920 | +** | |
| 921 | 921 | ** The caller maintains ownership of the input Blobs. This routine will |
| 922 | 922 | ** read the Blobs and send them onward to the email system, but it will |
| 923 | 923 | ** not free them. |
| 924 | 924 | ** |
| 925 | 925 | ** The Message-Id: field is added if there is not already a Message-Id |
| @@ -928,11 +928,11 @@ | ||
| 928 | 928 | ** If the zFromName argument is not NULL, then it should be a human-readable |
| 929 | 929 | ** name or handle for the sender. In that case, "From:" becomes a made-up |
| 930 | 930 | ** email address based on a hash of zFromName and the domain of email-self, |
| 931 | 931 | ** and an additional "Sender:" field is inserted with the email-self |
| 932 | 932 | ** address. Downstream software might use the Sender header to set |
| 933 | -** the envelope-from address of the email. If zFromName is a NULL pointer, | |
| 933 | +** the envelope-from address of the email. If zFromName is a NULL pointer, | |
| 934 | 934 | ** then the "From:" is set to the email-self value and Sender is |
| 935 | 935 | ** omitted. |
| 936 | 936 | */ |
| 937 | 937 | void alert_send( |
| 938 | 938 | AlertSender *p, /* Emailer context */ |
| @@ -1045,11 +1045,11 @@ | ||
| 1045 | 1045 | ** a long-running server and will not be sending email notifications, |
| 1046 | 1046 | ** then leave this setting blank. |
| 1047 | 1047 | */ |
| 1048 | 1048 | /* |
| 1049 | 1049 | ** SETTING: email-admin width=40 |
| 1050 | -** This is the email address for the human administrator for the system. | |
| 1050 | +** This is the email address for the human administrator for the system. | |
| 1051 | 1051 | ** Abuse and trouble reports and password reset requests are send here. |
| 1052 | 1052 | */ |
| 1053 | 1053 | /* |
| 1054 | 1054 | ** SETTING: email-subname width=16 |
| 1055 | 1055 | ** This is a short name used to identifies the repository in the Subject: |
| @@ -1080,19 +1080,19 @@ | ||
| 1080 | 1080 | ** |
| 1081 | 1081 | ** email-renew-warning is the time (in days since 1970-01-01) when the |
| 1082 | 1082 | ** last batch of "your subscription is about to expire" emails were |
| 1083 | 1083 | ** sent out. |
| 1084 | 1084 | ** |
| 1085 | -** email-renew-cutoff is normally 7 days behind email-renew-warning. | |
| 1085 | +** email-renew-cutoff is normally 7 days behind email-renew-warning. | |
| 1086 | 1086 | */ |
| 1087 | 1087 | /* |
| 1088 | 1088 | ** SETTING: email-send-method width=5 default=off sensitive |
| 1089 | 1089 | ** Determine the method used to send email. Allowed values are |
| 1090 | 1090 | ** "off", "relay", "pipe", "dir", "db", and "stdout". The "off" value |
| 1091 | 1091 | ** means no email is ever sent. The "relay" value means emails are sent |
| 1092 | 1092 | ** to an Mail Sending Agent using SMTP located at email-send-relayhost. |
| 1093 | -** The "pipe" value means email messages are piped into a command | |
| 1093 | +** The "pipe" value means email messages are piped into a command | |
| 1094 | 1094 | ** determined by the email-send-command setting. The "dir" value means |
| 1095 | 1095 | ** emails are written to individual files in a directory determined |
| 1096 | 1096 | ** by the email-send-dir setting. The "db" value means that emails |
| 1097 | 1097 | ** are added to an SQLite database named by the* email-send-db setting. |
| 1098 | 1098 | ** The "stdout" value writes email text to standard output, for debugging. |
| @@ -1133,11 +1133,11 @@ | ||
| 1133 | 1133 | */ |
| 1134 | 1134 | |
| 1135 | 1135 | |
| 1136 | 1136 | /* |
| 1137 | 1137 | ** COMMAND: alerts* |
| 1138 | -** | |
| 1138 | +** | |
| 1139 | 1139 | ** Usage: %fossil alerts SUBCOMMAND ARGS... |
| 1140 | 1140 | ** |
| 1141 | 1141 | ** Subcommands: |
| 1142 | 1142 | ** |
| 1143 | 1143 | ** pending Show all pending alerts. Useful for debugging. |
| @@ -1759,11 +1759,10 @@ | ||
| 1759 | 1759 | style_set_current_feature("alerts"); |
| 1760 | 1760 | if( zEmail==0 ){ |
| 1761 | 1761 | style_header("Unsubscribe Fail"); |
| 1762 | 1762 | @ <p>Unable to locate a subscriber with the requested key</p> |
| 1763 | 1763 | }else{ |
| 1764 | - | |
| 1765 | 1764 | db_multi_exec( |
| 1766 | 1765 | "DELETE FROM subscriber WHERE subscriberId=%d", sid |
| 1767 | 1766 | ); |
| 1768 | 1767 | style_header("Unsubscribed"); |
| 1769 | 1768 | @ <p>The "%h(zEmail)" email address has been unsubscribed from all |
| @@ -1794,11 +1793,11 @@ | ||
| 1794 | 1793 | ** that constitutes verification of the email address. |
| 1795 | 1794 | ** |
| 1796 | 1795 | ** * The sid= query parameter contains an integer subscriberId. |
| 1797 | 1796 | ** This only works for the administrator. It allows the |
| 1798 | 1797 | ** administrator to edit any subscription. |
| 1799 | -** | |
| 1798 | +** | |
| 1800 | 1799 | ** * The user is logged into an account other than "nobody" or |
| 1801 | 1800 | ** "anonymous". In that case the notification settings |
| 1802 | 1801 | ** associated with that account can be edited without needing |
| 1803 | 1802 | ** to know the subscriber code. |
| 1804 | 1803 | ** |
| @@ -1926,11 +1925,11 @@ | ||
| 1926 | 1925 | zErr = mprintf("Select this checkbox and press \"Unsubscribe\" again to" |
| 1927 | 1926 | " unsubscribe"); |
| 1928 | 1927 | }else{ |
| 1929 | 1928 | alert_unsubscribe(sid); |
| 1930 | 1929 | db_commit_transaction(); |
| 1931 | - return; | |
| 1930 | + return; | |
| 1932 | 1931 | } |
| 1933 | 1932 | } |
| 1934 | 1933 | style_set_current_feature("alerts"); |
| 1935 | 1934 | style_header("Update Subscription"); |
| 1936 | 1935 | db_prepare(&q, |
| @@ -2183,11 +2182,11 @@ | ||
| 2183 | 2182 | |
| 2184 | 2183 | |
| 2185 | 2184 | /* This is the message that gets sent to describe how to change |
| 2186 | 2185 | ** or modify a subscription |
| 2187 | 2186 | */ |
| 2188 | -static const char zUnsubMsg[] = | |
| 2187 | +static const char zUnsubMsg[] = | |
| 2189 | 2188 | @ To changes your subscription settings at %s visit this link: |
| 2190 | 2189 | @ |
| 2191 | 2190 | @ %s/alerts/%s |
| 2192 | 2191 | @ |
| 2193 | 2192 | @ To completely unsubscribe from %s, visit the following link: |
| @@ -2224,13 +2223,13 @@ | ||
| 2224 | 2223 | int sid = 0; |
| 2225 | 2224 | |
| 2226 | 2225 | if( zName==0 ) zName = P("scode"); |
| 2227 | 2226 | |
| 2228 | 2227 | /* If a valid subscriber code is supplied, then either present the user |
| 2229 | - ** with a comformation, or if already confirmed, unsubscribe immediately. | |
| 2228 | + ** with a confirmation, or if already confirmed, unsubscribe immediately. | |
| 2230 | 2229 | */ |
| 2231 | - if( zName | |
| 2230 | + if( zName | |
| 2232 | 2231 | && (sid = db_int(0, "SELECT subscriberId FROM subscriber" |
| 2233 | 2232 | " WHERE subscriberCode=hextoblob(%Q)", zName))!=0 |
| 2234 | 2233 | ){ |
| 2235 | 2234 | char *zUnsubName = mprintf("confirm%04x", sid); |
| 2236 | 2235 | if( P(zUnsubName)!=0 ){ |
| @@ -2313,11 +2312,11 @@ | ||
| 2313 | 2312 | @ unsubscribe and/or modify your subscription settings</p> |
| 2314 | 2313 | } |
| 2315 | 2314 | alert_sender_free(pSender); |
| 2316 | 2315 | style_finish_page(); |
| 2317 | 2316 | return; |
| 2318 | - } | |
| 2317 | + } | |
| 2319 | 2318 | |
| 2320 | 2319 | /* Non-logged-in users have to enter an email address to which is |
| 2321 | 2320 | ** sent a message containing the unsubscribe link. |
| 2322 | 2321 | */ |
| 2323 | 2322 | style_header("Unsubscribe Request"); |
| @@ -2722,11 +2721,11 @@ | ||
| 2722 | 2721 | if( p->needMod ){ |
| 2723 | 2722 | blob_appendf(&p->hdr, "Subject: %s Pending Moderation: %s\r\n", |
| 2724 | 2723 | zSub, zTitle); |
| 2725 | 2724 | }else{ |
| 2726 | 2725 | blob_appendf(&p->hdr, "Subject: %s %s\r\n", zSub, zTitle); |
| 2727 | - blob_appendf(&p->hdr, "Message-Id: <%.32s@%s>\r\n", | |
| 2726 | + blob_appendf(&p->hdr, "Message-Id: <%.32s@%s>\r\n", | |
| 2728 | 2727 | zUuid, alert_hostname(zFrom)); |
| 2729 | 2728 | zIrt = db_column_text(&q, 4); |
| 2730 | 2729 | if( zIrt && zIrt[0] ){ |
| 2731 | 2730 | blob_appendf(&p->hdr, "In-Reply-To: <%.32s@%s>\r\n", |
| 2732 | 2731 | zIrt, alert_hostname(zFrom)); |
| @@ -3231,11 +3230,11 @@ | ||
| 3231 | 3230 | ); |
| 3232 | 3231 | while( db_step(&q)==SQLITE_ROW ){ |
| 3233 | 3232 | Blob hdr, body; |
| 3234 | 3233 | blob_init(&hdr, 0, 0); |
| 3235 | 3234 | blob_init(&body, 0, 0); |
| 3236 | - alert_renewal_msg(&hdr, &body, | |
| 3235 | + alert_renewal_msg(&hdr, &body, | |
| 3237 | 3236 | db_column_text(&q,0), |
| 3238 | 3237 | db_column_int(&q,1), |
| 3239 | 3238 | db_column_text(&q,2), |
| 3240 | 3239 | db_column_text(&q,3), |
| 3241 | 3240 | zRepoName, zUrl); |
| @@ -3301,11 +3300,11 @@ | ||
| 3301 | 3300 | style_header("Outbound Email Disabled"); |
| 3302 | 3301 | @ <p>Outbound email is disabled on this repository |
| 3303 | 3302 | style_finish_page(); |
| 3304 | 3303 | return; |
| 3305 | 3304 | } |
| 3306 | - if( P("submit")!=0 | |
| 3305 | + if( P("submit")!=0 | |
| 3307 | 3306 | && P("subject")!=0 |
| 3308 | 3307 | && P("msg")!=0 |
| 3309 | 3308 | && P("from")!=0 |
| 3310 | 3309 | && cgi_csrf_safe(2) |
| 3311 | 3310 | && captcha_is_correct(0) |
| 3312 | 3311 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -86,11 +86,11 @@ | |
| 86 | @ eventid TEXT PRIMARY KEY, -- Object that changed |
| 87 | @ sentSep BOOLEAN DEFAULT false, -- individual alert sent |
| 88 | @ sentDigest BOOLEAN DEFAULT false, -- digest alert sent |
| 89 | @ sentMod BOOLEAN DEFAULT false -- pending moderation alert sent |
| 90 | @ ) WITHOUT ROWID; |
| 91 | @ |
| 92 | @ -- Obsolete table. No longer used. |
| 93 | @ DROP TABLE IF EXISTS repository.alert_bounce; |
| 94 | ; |
| 95 | |
| 96 | /* |
| @@ -875,11 +875,11 @@ | |
| 875 | int nTo = 0; |
| 876 | char **azTo = 0; |
| 877 | Blob v; |
| 878 | char *z, *zAddr; |
| 879 | int i; |
| 880 | |
| 881 | email_header_value(pMsg, "to", &v); |
| 882 | z = blob_str(&v); |
| 883 | for(i=0; z[i]; i++){ |
| 884 | if( z[i]=='<' && (zAddr = email_copy_addr(&z[i+1],'>'))!=0 ){ |
| 885 | azTo = fossil_realloc(azTo, sizeof(azTo[0])*(nTo+1) ); |
| @@ -889,11 +889,11 @@ | |
| 889 | *pnTo = nTo; |
| 890 | *pazTo = azTo; |
| 891 | } |
| 892 | |
| 893 | /* |
| 894 | ** Free a list of To addresses obtained from a prior call to |
| 895 | ** email_header_to() |
| 896 | */ |
| 897 | void email_header_to_free(int nTo, char **azTo){ |
| 898 | int i; |
| 899 | for(i=0; i<nTo; i++) fossil_free(azTo[i]); |
| @@ -915,11 +915,11 @@ | |
| 915 | ** Message-Id: |
| 916 | ** Content-Type: |
| 917 | ** Content-Transfer-Encoding: |
| 918 | ** MIME-Version: |
| 919 | ** Sender: |
| 920 | ** |
| 921 | ** The caller maintains ownership of the input Blobs. This routine will |
| 922 | ** read the Blobs and send them onward to the email system, but it will |
| 923 | ** not free them. |
| 924 | ** |
| 925 | ** The Message-Id: field is added if there is not already a Message-Id |
| @@ -928,11 +928,11 @@ | |
| 928 | ** If the zFromName argument is not NULL, then it should be a human-readable |
| 929 | ** name or handle for the sender. In that case, "From:" becomes a made-up |
| 930 | ** email address based on a hash of zFromName and the domain of email-self, |
| 931 | ** and an additional "Sender:" field is inserted with the email-self |
| 932 | ** address. Downstream software might use the Sender header to set |
| 933 | ** the envelope-from address of the email. If zFromName is a NULL pointer, |
| 934 | ** then the "From:" is set to the email-self value and Sender is |
| 935 | ** omitted. |
| 936 | */ |
| 937 | void alert_send( |
| 938 | AlertSender *p, /* Emailer context */ |
| @@ -1045,11 +1045,11 @@ | |
| 1045 | ** a long-running server and will not be sending email notifications, |
| 1046 | ** then leave this setting blank. |
| 1047 | */ |
| 1048 | /* |
| 1049 | ** SETTING: email-admin width=40 |
| 1050 | ** This is the email address for the human administrator for the system. |
| 1051 | ** Abuse and trouble reports and password reset requests are send here. |
| 1052 | */ |
| 1053 | /* |
| 1054 | ** SETTING: email-subname width=16 |
| 1055 | ** This is a short name used to identifies the repository in the Subject: |
| @@ -1080,19 +1080,19 @@ | |
| 1080 | ** |
| 1081 | ** email-renew-warning is the time (in days since 1970-01-01) when the |
| 1082 | ** last batch of "your subscription is about to expire" emails were |
| 1083 | ** sent out. |
| 1084 | ** |
| 1085 | ** email-renew-cutoff is normally 7 days behind email-renew-warning. |
| 1086 | */ |
| 1087 | /* |
| 1088 | ** SETTING: email-send-method width=5 default=off sensitive |
| 1089 | ** Determine the method used to send email. Allowed values are |
| 1090 | ** "off", "relay", "pipe", "dir", "db", and "stdout". The "off" value |
| 1091 | ** means no email is ever sent. The "relay" value means emails are sent |
| 1092 | ** to an Mail Sending Agent using SMTP located at email-send-relayhost. |
| 1093 | ** The "pipe" value means email messages are piped into a command |
| 1094 | ** determined by the email-send-command setting. The "dir" value means |
| 1095 | ** emails are written to individual files in a directory determined |
| 1096 | ** by the email-send-dir setting. The "db" value means that emails |
| 1097 | ** are added to an SQLite database named by the* email-send-db setting. |
| 1098 | ** The "stdout" value writes email text to standard output, for debugging. |
| @@ -1133,11 +1133,11 @@ | |
| 1133 | */ |
| 1134 | |
| 1135 | |
| 1136 | /* |
| 1137 | ** COMMAND: alerts* |
| 1138 | ** |
| 1139 | ** Usage: %fossil alerts SUBCOMMAND ARGS... |
| 1140 | ** |
| 1141 | ** Subcommands: |
| 1142 | ** |
| 1143 | ** pending Show all pending alerts. Useful for debugging. |
| @@ -1759,11 +1759,10 @@ | |
| 1759 | style_set_current_feature("alerts"); |
| 1760 | if( zEmail==0 ){ |
| 1761 | style_header("Unsubscribe Fail"); |
| 1762 | @ <p>Unable to locate a subscriber with the requested key</p> |
| 1763 | }else{ |
| 1764 | |
| 1765 | db_multi_exec( |
| 1766 | "DELETE FROM subscriber WHERE subscriberId=%d", sid |
| 1767 | ); |
| 1768 | style_header("Unsubscribed"); |
| 1769 | @ <p>The "%h(zEmail)" email address has been unsubscribed from all |
| @@ -1794,11 +1793,11 @@ | |
| 1794 | ** that constitutes verification of the email address. |
| 1795 | ** |
| 1796 | ** * The sid= query parameter contains an integer subscriberId. |
| 1797 | ** This only works for the administrator. It allows the |
| 1798 | ** administrator to edit any subscription. |
| 1799 | ** |
| 1800 | ** * The user is logged into an account other than "nobody" or |
| 1801 | ** "anonymous". In that case the notification settings |
| 1802 | ** associated with that account can be edited without needing |
| 1803 | ** to know the subscriber code. |
| 1804 | ** |
| @@ -1926,11 +1925,11 @@ | |
| 1926 | zErr = mprintf("Select this checkbox and press \"Unsubscribe\" again to" |
| 1927 | " unsubscribe"); |
| 1928 | }else{ |
| 1929 | alert_unsubscribe(sid); |
| 1930 | db_commit_transaction(); |
| 1931 | return; |
| 1932 | } |
| 1933 | } |
| 1934 | style_set_current_feature("alerts"); |
| 1935 | style_header("Update Subscription"); |
| 1936 | db_prepare(&q, |
| @@ -2183,11 +2182,11 @@ | |
| 2183 | |
| 2184 | |
| 2185 | /* This is the message that gets sent to describe how to change |
| 2186 | ** or modify a subscription |
| 2187 | */ |
| 2188 | static const char zUnsubMsg[] = |
| 2189 | @ To changes your subscription settings at %s visit this link: |
| 2190 | @ |
| 2191 | @ %s/alerts/%s |
| 2192 | @ |
| 2193 | @ To completely unsubscribe from %s, visit the following link: |
| @@ -2224,13 +2223,13 @@ | |
| 2224 | int sid = 0; |
| 2225 | |
| 2226 | if( zName==0 ) zName = P("scode"); |
| 2227 | |
| 2228 | /* If a valid subscriber code is supplied, then either present the user |
| 2229 | ** with a comformation, or if already confirmed, unsubscribe immediately. |
| 2230 | */ |
| 2231 | if( zName |
| 2232 | && (sid = db_int(0, "SELECT subscriberId FROM subscriber" |
| 2233 | " WHERE subscriberCode=hextoblob(%Q)", zName))!=0 |
| 2234 | ){ |
| 2235 | char *zUnsubName = mprintf("confirm%04x", sid); |
| 2236 | if( P(zUnsubName)!=0 ){ |
| @@ -2313,11 +2312,11 @@ | |
| 2313 | @ unsubscribe and/or modify your subscription settings</p> |
| 2314 | } |
| 2315 | alert_sender_free(pSender); |
| 2316 | style_finish_page(); |
| 2317 | return; |
| 2318 | } |
| 2319 | |
| 2320 | /* Non-logged-in users have to enter an email address to which is |
| 2321 | ** sent a message containing the unsubscribe link. |
| 2322 | */ |
| 2323 | style_header("Unsubscribe Request"); |
| @@ -2722,11 +2721,11 @@ | |
| 2722 | if( p->needMod ){ |
| 2723 | blob_appendf(&p->hdr, "Subject: %s Pending Moderation: %s\r\n", |
| 2724 | zSub, zTitle); |
| 2725 | }else{ |
| 2726 | blob_appendf(&p->hdr, "Subject: %s %s\r\n", zSub, zTitle); |
| 2727 | blob_appendf(&p->hdr, "Message-Id: <%.32s@%s>\r\n", |
| 2728 | zUuid, alert_hostname(zFrom)); |
| 2729 | zIrt = db_column_text(&q, 4); |
| 2730 | if( zIrt && zIrt[0] ){ |
| 2731 | blob_appendf(&p->hdr, "In-Reply-To: <%.32s@%s>\r\n", |
| 2732 | zIrt, alert_hostname(zFrom)); |
| @@ -3231,11 +3230,11 @@ | |
| 3231 | ); |
| 3232 | while( db_step(&q)==SQLITE_ROW ){ |
| 3233 | Blob hdr, body; |
| 3234 | blob_init(&hdr, 0, 0); |
| 3235 | blob_init(&body, 0, 0); |
| 3236 | alert_renewal_msg(&hdr, &body, |
| 3237 | db_column_text(&q,0), |
| 3238 | db_column_int(&q,1), |
| 3239 | db_column_text(&q,2), |
| 3240 | db_column_text(&q,3), |
| 3241 | zRepoName, zUrl); |
| @@ -3301,11 +3300,11 @@ | |
| 3301 | style_header("Outbound Email Disabled"); |
| 3302 | @ <p>Outbound email is disabled on this repository |
| 3303 | style_finish_page(); |
| 3304 | return; |
| 3305 | } |
| 3306 | if( P("submit")!=0 |
| 3307 | && P("subject")!=0 |
| 3308 | && P("msg")!=0 |
| 3309 | && P("from")!=0 |
| 3310 | && cgi_csrf_safe(2) |
| 3311 | && captcha_is_correct(0) |
| 3312 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -86,11 +86,11 @@ | |
| 86 | @ eventid TEXT PRIMARY KEY, -- Object that changed |
| 87 | @ sentSep BOOLEAN DEFAULT false, -- individual alert sent |
| 88 | @ sentDigest BOOLEAN DEFAULT false, -- digest alert sent |
| 89 | @ sentMod BOOLEAN DEFAULT false -- pending moderation alert sent |
| 90 | @ ) WITHOUT ROWID; |
| 91 | @ |
| 92 | @ -- Obsolete table. No longer used. |
| 93 | @ DROP TABLE IF EXISTS repository.alert_bounce; |
| 94 | ; |
| 95 | |
| 96 | /* |
| @@ -875,11 +875,11 @@ | |
| 875 | int nTo = 0; |
| 876 | char **azTo = 0; |
| 877 | Blob v; |
| 878 | char *z, *zAddr; |
| 879 | int i; |
| 880 | |
| 881 | email_header_value(pMsg, "to", &v); |
| 882 | z = blob_str(&v); |
| 883 | for(i=0; z[i]; i++){ |
| 884 | if( z[i]=='<' && (zAddr = email_copy_addr(&z[i+1],'>'))!=0 ){ |
| 885 | azTo = fossil_realloc(azTo, sizeof(azTo[0])*(nTo+1) ); |
| @@ -889,11 +889,11 @@ | |
| 889 | *pnTo = nTo; |
| 890 | *pazTo = azTo; |
| 891 | } |
| 892 | |
| 893 | /* |
| 894 | ** Free a list of To addresses obtained from a prior call to |
| 895 | ** email_header_to() |
| 896 | */ |
| 897 | void email_header_to_free(int nTo, char **azTo){ |
| 898 | int i; |
| 899 | for(i=0; i<nTo; i++) fossil_free(azTo[i]); |
| @@ -915,11 +915,11 @@ | |
| 915 | ** Message-Id: |
| 916 | ** Content-Type: |
| 917 | ** Content-Transfer-Encoding: |
| 918 | ** MIME-Version: |
| 919 | ** Sender: |
| 920 | ** |
| 921 | ** The caller maintains ownership of the input Blobs. This routine will |
| 922 | ** read the Blobs and send them onward to the email system, but it will |
| 923 | ** not free them. |
| 924 | ** |
| 925 | ** The Message-Id: field is added if there is not already a Message-Id |
| @@ -928,11 +928,11 @@ | |
| 928 | ** If the zFromName argument is not NULL, then it should be a human-readable |
| 929 | ** name or handle for the sender. In that case, "From:" becomes a made-up |
| 930 | ** email address based on a hash of zFromName and the domain of email-self, |
| 931 | ** and an additional "Sender:" field is inserted with the email-self |
| 932 | ** address. Downstream software might use the Sender header to set |
| 933 | ** the envelope-from address of the email. If zFromName is a NULL pointer, |
| 934 | ** then the "From:" is set to the email-self value and Sender is |
| 935 | ** omitted. |
| 936 | */ |
| 937 | void alert_send( |
| 938 | AlertSender *p, /* Emailer context */ |
| @@ -1045,11 +1045,11 @@ | |
| 1045 | ** a long-running server and will not be sending email notifications, |
| 1046 | ** then leave this setting blank. |
| 1047 | */ |
| 1048 | /* |
| 1049 | ** SETTING: email-admin width=40 |
| 1050 | ** This is the email address for the human administrator for the system. |
| 1051 | ** Abuse and trouble reports and password reset requests are send here. |
| 1052 | */ |
| 1053 | /* |
| 1054 | ** SETTING: email-subname width=16 |
| 1055 | ** This is a short name used to identifies the repository in the Subject: |
| @@ -1080,19 +1080,19 @@ | |
| 1080 | ** |
| 1081 | ** email-renew-warning is the time (in days since 1970-01-01) when the |
| 1082 | ** last batch of "your subscription is about to expire" emails were |
| 1083 | ** sent out. |
| 1084 | ** |
| 1085 | ** email-renew-cutoff is normally 7 days behind email-renew-warning. |
| 1086 | */ |
| 1087 | /* |
| 1088 | ** SETTING: email-send-method width=5 default=off sensitive |
| 1089 | ** Determine the method used to send email. Allowed values are |
| 1090 | ** "off", "relay", "pipe", "dir", "db", and "stdout". The "off" value |
| 1091 | ** means no email is ever sent. The "relay" value means emails are sent |
| 1092 | ** to an Mail Sending Agent using SMTP located at email-send-relayhost. |
| 1093 | ** The "pipe" value means email messages are piped into a command |
| 1094 | ** determined by the email-send-command setting. The "dir" value means |
| 1095 | ** emails are written to individual files in a directory determined |
| 1096 | ** by the email-send-dir setting. The "db" value means that emails |
| 1097 | ** are added to an SQLite database named by the* email-send-db setting. |
| 1098 | ** The "stdout" value writes email text to standard output, for debugging. |
| @@ -1133,11 +1133,11 @@ | |
| 1133 | */ |
| 1134 | |
| 1135 | |
| 1136 | /* |
| 1137 | ** COMMAND: alerts* |
| 1138 | ** |
| 1139 | ** Usage: %fossil alerts SUBCOMMAND ARGS... |
| 1140 | ** |
| 1141 | ** Subcommands: |
| 1142 | ** |
| 1143 | ** pending Show all pending alerts. Useful for debugging. |
| @@ -1759,11 +1759,10 @@ | |
| 1759 | style_set_current_feature("alerts"); |
| 1760 | if( zEmail==0 ){ |
| 1761 | style_header("Unsubscribe Fail"); |
| 1762 | @ <p>Unable to locate a subscriber with the requested key</p> |
| 1763 | }else{ |
| 1764 | db_multi_exec( |
| 1765 | "DELETE FROM subscriber WHERE subscriberId=%d", sid |
| 1766 | ); |
| 1767 | style_header("Unsubscribed"); |
| 1768 | @ <p>The "%h(zEmail)" email address has been unsubscribed from all |
| @@ -1794,11 +1793,11 @@ | |
| 1793 | ** that constitutes verification of the email address. |
| 1794 | ** |
| 1795 | ** * The sid= query parameter contains an integer subscriberId. |
| 1796 | ** This only works for the administrator. It allows the |
| 1797 | ** administrator to edit any subscription. |
| 1798 | ** |
| 1799 | ** * The user is logged into an account other than "nobody" or |
| 1800 | ** "anonymous". In that case the notification settings |
| 1801 | ** associated with that account can be edited without needing |
| 1802 | ** to know the subscriber code. |
| 1803 | ** |
| @@ -1926,11 +1925,11 @@ | |
| 1925 | zErr = mprintf("Select this checkbox and press \"Unsubscribe\" again to" |
| 1926 | " unsubscribe"); |
| 1927 | }else{ |
| 1928 | alert_unsubscribe(sid); |
| 1929 | db_commit_transaction(); |
| 1930 | return; |
| 1931 | } |
| 1932 | } |
| 1933 | style_set_current_feature("alerts"); |
| 1934 | style_header("Update Subscription"); |
| 1935 | db_prepare(&q, |
| @@ -2183,11 +2182,11 @@ | |
| 2182 | |
| 2183 | |
| 2184 | /* This is the message that gets sent to describe how to change |
| 2185 | ** or modify a subscription |
| 2186 | */ |
| 2187 | static const char zUnsubMsg[] = |
| 2188 | @ To changes your subscription settings at %s visit this link: |
| 2189 | @ |
| 2190 | @ %s/alerts/%s |
| 2191 | @ |
| 2192 | @ To completely unsubscribe from %s, visit the following link: |
| @@ -2224,13 +2223,13 @@ | |
| 2223 | int sid = 0; |
| 2224 | |
| 2225 | if( zName==0 ) zName = P("scode"); |
| 2226 | |
| 2227 | /* If a valid subscriber code is supplied, then either present the user |
| 2228 | ** with a confirmation, or if already confirmed, unsubscribe immediately. |
| 2229 | */ |
| 2230 | if( zName |
| 2231 | && (sid = db_int(0, "SELECT subscriberId FROM subscriber" |
| 2232 | " WHERE subscriberCode=hextoblob(%Q)", zName))!=0 |
| 2233 | ){ |
| 2234 | char *zUnsubName = mprintf("confirm%04x", sid); |
| 2235 | if( P(zUnsubName)!=0 ){ |
| @@ -2313,11 +2312,11 @@ | |
| 2312 | @ unsubscribe and/or modify your subscription settings</p> |
| 2313 | } |
| 2314 | alert_sender_free(pSender); |
| 2315 | style_finish_page(); |
| 2316 | return; |
| 2317 | } |
| 2318 | |
| 2319 | /* Non-logged-in users have to enter an email address to which is |
| 2320 | ** sent a message containing the unsubscribe link. |
| 2321 | */ |
| 2322 | style_header("Unsubscribe Request"); |
| @@ -2722,11 +2721,11 @@ | |
| 2721 | if( p->needMod ){ |
| 2722 | blob_appendf(&p->hdr, "Subject: %s Pending Moderation: %s\r\n", |
| 2723 | zSub, zTitle); |
| 2724 | }else{ |
| 2725 | blob_appendf(&p->hdr, "Subject: %s %s\r\n", zSub, zTitle); |
| 2726 | blob_appendf(&p->hdr, "Message-Id: <%.32s@%s>\r\n", |
| 2727 | zUuid, alert_hostname(zFrom)); |
| 2728 | zIrt = db_column_text(&q, 4); |
| 2729 | if( zIrt && zIrt[0] ){ |
| 2730 | blob_appendf(&p->hdr, "In-Reply-To: <%.32s@%s>\r\n", |
| 2731 | zIrt, alert_hostname(zFrom)); |
| @@ -3231,11 +3230,11 @@ | |
| 3230 | ); |
| 3231 | while( db_step(&q)==SQLITE_ROW ){ |
| 3232 | Blob hdr, body; |
| 3233 | blob_init(&hdr, 0, 0); |
| 3234 | blob_init(&body, 0, 0); |
| 3235 | alert_renewal_msg(&hdr, &body, |
| 3236 | db_column_text(&q,0), |
| 3237 | db_column_int(&q,1), |
| 3238 | db_column_text(&q,2), |
| 3239 | db_column_text(&q,3), |
| 3240 | zRepoName, zUrl); |
| @@ -3301,11 +3300,11 @@ | |
| 3300 | style_header("Outbound Email Disabled"); |
| 3301 | @ <p>Outbound email is disabled on this repository |
| 3302 | style_finish_page(); |
| 3303 | return; |
| 3304 | } |
| 3305 | if( P("submit")!=0 |
| 3306 | && P("subject")!=0 |
| 3307 | && P("msg")!=0 |
| 3308 | && P("from")!=0 |
| 3309 | && cgi_csrf_safe(2) |
| 3310 | && captcha_is_correct(0) |
| 3311 |