Fossil SCM

Improvements to the "Notification" setup screen. Take steps to ensure that the email address does not get cleared when editing subscriber preferences.

drh 2020-03-26 13:11 trunk
Commit 60d40d5b586eecafb297c5b7bdac05ba9c3d3609906339a27015d2ddcfcd4c42
1 file changed +11 -9
+11 -9
--- src/alerts.c
+++ src/alerts.c
@@ -46,10 +46,11 @@
4646
@ --
4747
@ -- The ssub field is a string where each character indicates a particular
4848
@ -- type of event to subscribe to. Choices:
4949
@ -- a - Announcements
5050
@ -- c - Check-ins
51
+@ -- f - Forum posts
5152
@ -- t - Ticket changes
5253
@ -- w - Wiki changes
5354
@ -- Probably different codes will be added in the future. In the future
5455
@ -- we might also add a separate table that allows subscribing to email
5556
@ -- notifications for specific branches or tags or tickets.
@@ -238,10 +239,17 @@
238239
@ This is URL used as the basename for hyperlinks included in
239240
@ email alert text. Omit the trailing "/".
240241
@ Suggested value: "%h(g.zBaseURL)"
241242
@ (Property: "email-url")</p>
242243
@ <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>
243251
244252
entry_attribute("\"Return-Path\" email address", 20, "email-self",
245253
"eself", "", 0);
246254
@ <p><b>Required.</b>
247255
@ This is the email to which email notification bounces should be sent.
@@ -297,17 +305,10 @@
297305
@ append a colon and TCP port number (ex: smtp.example.com:587).
298306
@ The default TCP port number is 25.
299307
@ (Property: "email-send-relayhost")</p>
300308
@ <hr>
301309
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
-
309310
@ <p><input type="submit" name="submit" value="Apply Changes" /></p>
310311
@ </div></form>
311312
db_end_transaction(0);
312313
style_footer();
313314
}
@@ -1543,10 +1544,11 @@
15431544
}
15441545
alert_submenu_common();
15451546
if( P("submit")!=0 && cgi_csrf_safe(1) ){
15461547
int sdonotcall = PB("sdonotcall");
15471548
int sdigest = PB("sdigest");
1549
+ const char *zEmail = P("semail");
15481550
char ssub[10];
15491551
int nsub = 0;
15501552
Blob update;
15511553
if( PB("sa") ) ssub[nsub++] = 'a';
15521554
if( g.perm.Read && PB("sc") ) ssub[nsub++] = 'c';
@@ -1575,12 +1577,12 @@
15751577
" sverified=%d",
15761578
suname,
15771579
sverified
15781580
);
15791581
}
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);
15821584
}
15831585
blob_append_sql(&update," WHERE subscriberCode=hextoblob(%Q)", zName);
15841586
db_exec_sql(blob_str(&update));
15851587
blob_reset(&update);
15861588
}
15871589
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button