Fossil SCM

Fix self-registration so that it can work even if email alerts are not enabled. See forum post [https://www.fossil-scm.org/forum/info/e012e702de4ed1e2].

drh 2020-08-06 20:26 trunk
Commit 02c3080bb24f2d7ddbff2da51831274c30eff889b0325e398e8d48f2e240f4c9
1 file changed +4 -3
+4 -3
--- src/login.c
+++ src/login.c
@@ -1591,13 +1591,14 @@
15911591
/* If the email is found anywhere in USER.INFO... */
15921592
db_exists("SELECT 1 FROM user WHERE info LIKE '%%%q%%'", zEAddr)
15931593
||
15941594
/* Or if the email is a verify subscriber email with an associated
15951595
** user... */
1596
- db_exists(
1597
- "SELECT 1 FROM subscriber WHERE semail=%Q AND suname IS NOT NULL"
1598
- " AND sverified",zEAddr)
1596
+ (alert_tables_exist() &&
1597
+ db_exists(
1598
+ "SELECT 1 FROM subscriber WHERE semail=%Q AND suname IS NOT NULL"
1599
+ " AND sverified",zEAddr))
15991600
){
16001601
iErrLine = 3;
16011602
zErr = "This email address is already claimed by another user";
16021603
}else{
16031604
/* If all of the tests above have passed, that means that the submitted
16041605
--- src/login.c
+++ src/login.c
@@ -1591,13 +1591,14 @@
1591 /* If the email is found anywhere in USER.INFO... */
1592 db_exists("SELECT 1 FROM user WHERE info LIKE '%%%q%%'", zEAddr)
1593 ||
1594 /* Or if the email is a verify subscriber email with an associated
1595 ** user... */
1596 db_exists(
1597 "SELECT 1 FROM subscriber WHERE semail=%Q AND suname IS NOT NULL"
1598 " AND sverified",zEAddr)
 
1599 ){
1600 iErrLine = 3;
1601 zErr = "This email address is already claimed by another user";
1602 }else{
1603 /* If all of the tests above have passed, that means that the submitted
1604
--- src/login.c
+++ src/login.c
@@ -1591,13 +1591,14 @@
1591 /* If the email is found anywhere in USER.INFO... */
1592 db_exists("SELECT 1 FROM user WHERE info LIKE '%%%q%%'", zEAddr)
1593 ||
1594 /* Or if the email is a verify subscriber email with an associated
1595 ** user... */
1596 (alert_tables_exist() &&
1597 db_exists(
1598 "SELECT 1 FROM subscriber WHERE semail=%Q AND suname IS NOT NULL"
1599 " AND sverified",zEAddr))
1600 ){
1601 iErrLine = 3;
1602 zErr = "This email address is already claimed by another user";
1603 }else{
1604 /* If all of the tests above have passed, that means that the submitted
1605

Keyboard Shortcuts

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