Fossil SCM
Improvements to the "Notification" setup screen. Take steps to ensure that the email address does not get cleared when editing subscriber preferences.
Commit
60d40d5b586eecafb297c5b7bdac05ba9c3d3609906339a27015d2ddcfcd4c42
Parent
c2c998d9cc74d12…
1 file changed
+11
-9
+11
-9
| --- src/alerts.c | ||
| +++ src/alerts.c | ||
| @@ -46,10 +46,11 @@ | ||
| 46 | 46 | @ -- |
| 47 | 47 | @ -- The ssub field is a string where each character indicates a particular |
| 48 | 48 | @ -- type of event to subscribe to. Choices: |
| 49 | 49 | @ -- a - Announcements |
| 50 | 50 | @ -- c - Check-ins |
| 51 | +@ -- f - Forum posts | |
| 51 | 52 | @ -- t - Ticket changes |
| 52 | 53 | @ -- w - Wiki changes |
| 53 | 54 | @ -- Probably different codes will be added in the future. In the future |
| 54 | 55 | @ -- we might also add a separate table that allows subscribing to email |
| 55 | 56 | @ -- notifications for specific branches or tags or tickets. |
| @@ -238,10 +239,17 @@ | ||
| 238 | 239 | @ This is URL used as the basename for hyperlinks included in |
| 239 | 240 | @ email alert text. Omit the trailing "/". |
| 240 | 241 | @ Suggested value: "%h(g.zBaseURL)" |
| 241 | 242 | @ (Property: "email-url")</p> |
| 242 | 243 | @ <hr> |
| 244 | + | |
| 245 | + entry_attribute("Administrator email address", 40, "email-admin", | |
| 246 | + "eadmin", "", 0); | |
| 247 | + @ <p>This is the email for the human administrator for the system. | |
| 248 | + @ Abuse and trouble reports and password reset requests are send here. | |
| 249 | + @ (Property: "email-admin")</p> | |
| 250 | + @ <hr> | |
| 243 | 251 | |
| 244 | 252 | entry_attribute("\"Return-Path\" email address", 20, "email-self", |
| 245 | 253 | "eself", "", 0); |
| 246 | 254 | @ <p><b>Required.</b> |
| 247 | 255 | @ This is the email to which email notification bounces should be sent. |
| @@ -297,17 +305,10 @@ | ||
| 297 | 305 | @ append a colon and TCP port number (ex: smtp.example.com:587). |
| 298 | 306 | @ The default TCP port number is 25. |
| 299 | 307 | @ (Property: "email-send-relayhost")</p> |
| 300 | 308 | @ <hr> |
| 301 | 309 | |
| 302 | - entry_attribute("Administrator email address", 40, "email-admin", | |
| 303 | - "eadmin", "", 0); | |
| 304 | - @ <p>This is the email for the human administrator for the system. | |
| 305 | - @ Abuse and trouble reports are send here. | |
| 306 | - @ (Property: "email-admin")</p> | |
| 307 | - @ <hr> | |
| 308 | - | |
| 309 | 310 | @ <p><input type="submit" name="submit" value="Apply Changes" /></p> |
| 310 | 311 | @ </div></form> |
| 311 | 312 | db_end_transaction(0); |
| 312 | 313 | style_footer(); |
| 313 | 314 | } |
| @@ -1543,10 +1544,11 @@ | ||
| 1543 | 1544 | } |
| 1544 | 1545 | alert_submenu_common(); |
| 1545 | 1546 | if( P("submit")!=0 && cgi_csrf_safe(1) ){ |
| 1546 | 1547 | int sdonotcall = PB("sdonotcall"); |
| 1547 | 1548 | int sdigest = PB("sdigest"); |
| 1549 | + const char *zEmail = P("semail"); | |
| 1548 | 1550 | char ssub[10]; |
| 1549 | 1551 | int nsub = 0; |
| 1550 | 1552 | Blob update; |
| 1551 | 1553 | if( PB("sa") ) ssub[nsub++] = 'a'; |
| 1552 | 1554 | if( g.perm.Read && PB("sc") ) ssub[nsub++] = 'c'; |
| @@ -1575,12 +1577,12 @@ | ||
| 1575 | 1577 | " sverified=%d", |
| 1576 | 1578 | suname, |
| 1577 | 1579 | sverified |
| 1578 | 1580 | ); |
| 1579 | 1581 | } |
| 1580 | - if( isLogin ){ | |
| 1581 | - blob_append_sql(&update, ", semail=%Q", P("semail")); | |
| 1582 | + if( isLogin && zEmail && zEmail[0] ){ | |
| 1583 | + blob_append_sql(&update, ", semail=%Q", zEmail); | |
| 1582 | 1584 | } |
| 1583 | 1585 | blob_append_sql(&update," WHERE subscriberCode=hextoblob(%Q)", zName); |
| 1584 | 1586 | db_exec_sql(blob_str(&update)); |
| 1585 | 1587 | blob_reset(&update); |
| 1586 | 1588 | } |
| 1587 | 1589 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -46,10 +46,11 @@ | |
| 46 | @ -- |
| 47 | @ -- The ssub field is a string where each character indicates a particular |
| 48 | @ -- type of event to subscribe to. Choices: |
| 49 | @ -- a - Announcements |
| 50 | @ -- c - Check-ins |
| 51 | @ -- t - Ticket changes |
| 52 | @ -- w - Wiki changes |
| 53 | @ -- Probably different codes will be added in the future. In the future |
| 54 | @ -- we might also add a separate table that allows subscribing to email |
| 55 | @ -- notifications for specific branches or tags or tickets. |
| @@ -238,10 +239,17 @@ | |
| 238 | @ This is URL used as the basename for hyperlinks included in |
| 239 | @ email alert text. Omit the trailing "/". |
| 240 | @ Suggested value: "%h(g.zBaseURL)" |
| 241 | @ (Property: "email-url")</p> |
| 242 | @ <hr> |
| 243 | |
| 244 | entry_attribute("\"Return-Path\" email address", 20, "email-self", |
| 245 | "eself", "", 0); |
| 246 | @ <p><b>Required.</b> |
| 247 | @ This is the email to which email notification bounces should be sent. |
| @@ -297,17 +305,10 @@ | |
| 297 | @ append a colon and TCP port number (ex: smtp.example.com:587). |
| 298 | @ The default TCP port number is 25. |
| 299 | @ (Property: "email-send-relayhost")</p> |
| 300 | @ <hr> |
| 301 | |
| 302 | entry_attribute("Administrator email address", 40, "email-admin", |
| 303 | "eadmin", "", 0); |
| 304 | @ <p>This is the email for the human administrator for the system. |
| 305 | @ Abuse and trouble reports are send here. |
| 306 | @ (Property: "email-admin")</p> |
| 307 | @ <hr> |
| 308 | |
| 309 | @ <p><input type="submit" name="submit" value="Apply Changes" /></p> |
| 310 | @ </div></form> |
| 311 | db_end_transaction(0); |
| 312 | style_footer(); |
| 313 | } |
| @@ -1543,10 +1544,11 @@ | |
| 1543 | } |
| 1544 | alert_submenu_common(); |
| 1545 | if( P("submit")!=0 && cgi_csrf_safe(1) ){ |
| 1546 | int sdonotcall = PB("sdonotcall"); |
| 1547 | int sdigest = PB("sdigest"); |
| 1548 | char ssub[10]; |
| 1549 | int nsub = 0; |
| 1550 | Blob update; |
| 1551 | if( PB("sa") ) ssub[nsub++] = 'a'; |
| 1552 | if( g.perm.Read && PB("sc") ) ssub[nsub++] = 'c'; |
| @@ -1575,12 +1577,12 @@ | |
| 1575 | " sverified=%d", |
| 1576 | suname, |
| 1577 | sverified |
| 1578 | ); |
| 1579 | } |
| 1580 | if( isLogin ){ |
| 1581 | blob_append_sql(&update, ", semail=%Q", P("semail")); |
| 1582 | } |
| 1583 | blob_append_sql(&update," WHERE subscriberCode=hextoblob(%Q)", zName); |
| 1584 | db_exec_sql(blob_str(&update)); |
| 1585 | blob_reset(&update); |
| 1586 | } |
| 1587 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -46,10 +46,11 @@ | |
| 46 | @ -- |
| 47 | @ -- The ssub field is a string where each character indicates a particular |
| 48 | @ -- type of event to subscribe to. Choices: |
| 49 | @ -- a - Announcements |
| 50 | @ -- c - Check-ins |
| 51 | @ -- f - Forum posts |
| 52 | @ -- t - Ticket changes |
| 53 | @ -- w - Wiki changes |
| 54 | @ -- Probably different codes will be added in the future. In the future |
| 55 | @ -- we might also add a separate table that allows subscribing to email |
| 56 | @ -- notifications for specific branches or tags or tickets. |
| @@ -238,10 +239,17 @@ | |
| 239 | @ This is URL used as the basename for hyperlinks included in |
| 240 | @ email alert text. Omit the trailing "/". |
| 241 | @ Suggested value: "%h(g.zBaseURL)" |
| 242 | @ (Property: "email-url")</p> |
| 243 | @ <hr> |
| 244 | |
| 245 | entry_attribute("Administrator email address", 40, "email-admin", |
| 246 | "eadmin", "", 0); |
| 247 | @ <p>This is the email for the human administrator for the system. |
| 248 | @ Abuse and trouble reports and password reset requests are send here. |
| 249 | @ (Property: "email-admin")</p> |
| 250 | @ <hr> |
| 251 | |
| 252 | entry_attribute("\"Return-Path\" email address", 20, "email-self", |
| 253 | "eself", "", 0); |
| 254 | @ <p><b>Required.</b> |
| 255 | @ This is the email to which email notification bounces should be sent. |
| @@ -297,17 +305,10 @@ | |
| 305 | @ append a colon and TCP port number (ex: smtp.example.com:587). |
| 306 | @ The default TCP port number is 25. |
| 307 | @ (Property: "email-send-relayhost")</p> |
| 308 | @ <hr> |
| 309 | |
| 310 | @ <p><input type="submit" name="submit" value="Apply Changes" /></p> |
| 311 | @ </div></form> |
| 312 | db_end_transaction(0); |
| 313 | style_footer(); |
| 314 | } |
| @@ -1543,10 +1544,11 @@ | |
| 1544 | } |
| 1545 | alert_submenu_common(); |
| 1546 | if( P("submit")!=0 && cgi_csrf_safe(1) ){ |
| 1547 | int sdonotcall = PB("sdonotcall"); |
| 1548 | int sdigest = PB("sdigest"); |
| 1549 | const char *zEmail = P("semail"); |
| 1550 | char ssub[10]; |
| 1551 | int nsub = 0; |
| 1552 | Blob update; |
| 1553 | if( PB("sa") ) ssub[nsub++] = 'a'; |
| 1554 | if( g.perm.Read && PB("sc") ) ssub[nsub++] = 'c'; |
| @@ -1575,12 +1577,12 @@ | |
| 1577 | " sverified=%d", |
| 1578 | suname, |
| 1579 | sverified |
| 1580 | ); |
| 1581 | } |
| 1582 | if( isLogin && zEmail && zEmail[0] ){ |
| 1583 | blob_append_sql(&update, ", semail=%Q", zEmail); |
| 1584 | } |
| 1585 | blob_append_sql(&update," WHERE subscriberCode=hextoblob(%Q)", zName); |
| 1586 | db_exec_sql(blob_str(&update)); |
| 1587 | blob_reset(&update); |
| 1588 | } |
| 1589 |