Fossil SCM
Attempt to make the /subscribe and /alerts forms less confusing.
Commit
6d04bab418cac24435ff59a06085df96d475d4245de162aa4c271cd4cb02fe8c
Parent
57e80ad20a12761…
1 file changed
+36
-15
+36
-15
| --- src/email.c | ||
| +++ src/email.c | ||
| @@ -1261,10 +1261,11 @@ | ||
| 1261 | 1261 | unsigned int uSeed; |
| 1262 | 1262 | const char *zDecoded; |
| 1263 | 1263 | char *zCaptcha = 0; |
| 1264 | 1264 | char *zErr = 0; |
| 1265 | 1265 | int eErr = 0; |
| 1266 | + int di; | |
| 1266 | 1267 | |
| 1267 | 1268 | if( email_webpages_disabled() ) return; |
| 1268 | 1269 | login_check_credentials(); |
| 1269 | 1270 | if( !g.perm.EmailAlert ){ |
| 1270 | 1271 | login_needed(g.anon.EmailAlert); |
| @@ -1404,11 +1405,11 @@ | ||
| 1404 | 1405 | @ <td><span class="loginError">← %h(zErr)</span></td> |
| 1405 | 1406 | } |
| 1406 | 1407 | @ </tr> |
| 1407 | 1408 | } |
| 1408 | 1409 | @ <tr> |
| 1409 | - @ <td class="form_label">Options:</td> | |
| 1410 | + @ <td class="form_label">Topics:</td> | |
| 1410 | 1411 | @ <td><label><input type="checkbox" name="sa" %s(PCK("sa"))> \ |
| 1411 | 1412 | @ Announcements</label><br> |
| 1412 | 1413 | if( g.perm.Read ){ |
| 1413 | 1414 | @ <label><input type="checkbox" name="sc" %s(PCK("sc"))> \ |
| 1414 | 1415 | @ Check-ins</label><br> |
| @@ -1423,20 +1424,27 @@ | ||
| 1423 | 1424 | } |
| 1424 | 1425 | if( g.perm.RdWiki ){ |
| 1425 | 1426 | @ <label><input type="checkbox" name="sw" %s(PCK("sw"))> \ |
| 1426 | 1427 | @ Wiki</label><br> |
| 1427 | 1428 | } |
| 1428 | - @ <label><input type="checkbox" name="di" %s(PCK("di"))> \ | |
| 1429 | - @ Daily digest only</label><br> | |
| 1429 | + di = PB("di"); | |
| 1430 | + @ </td></tr> | |
| 1431 | + @ <tr> | |
| 1432 | + @ <td class="form_label">Delivery:</td> | |
| 1433 | + @ <td><select size="1" name="di"> | |
| 1434 | + @ <option value="0" %s(di?"":"selected")>Individual Emails</option> | |
| 1435 | + @ <option value="1" %s(di?"selected":"")>Daily Digest</option> | |
| 1436 | + @ </select></td> | |
| 1437 | + @ </tr> | |
| 1430 | 1438 | if( g.perm.Admin ){ |
| 1439 | + @ <tr> | |
| 1440 | + @ <td class="form_label">Admin Options:</td><td> | |
| 1431 | 1441 | @ <label><input type="checkbox" name="vi" %s(PCK("vi"))> \ |
| 1432 | 1442 | @ Verified</label><br> |
| 1433 | 1443 | @ <label><input type="checkbox" name="dnc" %s(PCK("dnc"))> \ |
| 1434 | - @ Do not call</label><br> | |
| 1444 | + @ Do not call</label></td></tr> | |
| 1435 | 1445 | } |
| 1436 | - @ </td> | |
| 1437 | - @ </tr> | |
| 1438 | 1446 | @ <tr> |
| 1439 | 1447 | @ <td></td> |
| 1440 | 1448 | if( needCaptcha && !email_enabled() ){ |
| 1441 | 1449 | @ <td><input type="submit" name="submit" value="Submit" disabled> |
| 1442 | 1450 | @ (Email current disabled)</td> |
| @@ -1572,11 +1580,11 @@ | ||
| 1572 | 1580 | } |
| 1573 | 1581 | } |
| 1574 | 1582 | if( P("delete")!=0 && cgi_csrf_safe(1) ){ |
| 1575 | 1583 | if( !PB("dodelete") ){ |
| 1576 | 1584 | eErr = 9; |
| 1577 | - zErr = mprintf("Select this checkbox and press \"Unsubscribe\" to" | |
| 1585 | + zErr = mprintf("Select this checkbox and press \"Unsubscribe\" again to" | |
| 1578 | 1586 | " unsubscribe"); |
| 1579 | 1587 | }else{ |
| 1580 | 1588 | email_unsubscribe(zName); |
| 1581 | 1589 | return; |
| 1582 | 1590 | } |
| @@ -1650,11 +1658,11 @@ | ||
| 1650 | 1658 | @ <td><input type="text" name="suname" value="%h(suname?suname:"")" \ |
| 1651 | 1659 | @ size="30"></td> |
| 1652 | 1660 | @ </tr> |
| 1653 | 1661 | } |
| 1654 | 1662 | @ <tr> |
| 1655 | - @ <td class="form_label">Options:</td> | |
| 1663 | + @ <td class="form_label">Topics:</td> | |
| 1656 | 1664 | @ <td><label><input type="checkbox" name="sa" %s(sa?"checked":"")>\ |
| 1657 | 1665 | @ Announcements</label><br> |
| 1658 | 1666 | if( g.perm.Read ){ |
| 1659 | 1667 | @ <label><input type="checkbox" name="sc" %s(sc?"checked":"")>\ |
| 1660 | 1668 | @ Check-ins</label><br> |
| @@ -1667,28 +1675,41 @@ | ||
| 1667 | 1675 | @ <label><input type="checkbox" name="st" %s(st?"checked":"")>\ |
| 1668 | 1676 | @ Ticket changes</label><br> |
| 1669 | 1677 | } |
| 1670 | 1678 | if( g.perm.RdWiki ){ |
| 1671 | 1679 | @ <label><input type="checkbox" name="sw" %s(sw?"checked":"")>\ |
| 1672 | - @ Wiki</label><br> | |
| 1680 | + @ Wiki</label> | |
| 1673 | 1681 | } |
| 1682 | + @ </td></tr> | |
| 1683 | + @ <tr> | |
| 1684 | + @ <td class="form_label">Delivery:</td> | |
| 1685 | + @ <td><select size="1" name="sdigest"> | |
| 1686 | + @ <option value="0" %s(sdigest?"":"selected")>Individual Emails</option> | |
| 1687 | + @ <option value="1" %s(sdigest?"selected":"")>Daily Digest</option> | |
| 1688 | + @ </select></td> | |
| 1689 | + @ </tr> | |
| 1690 | +#if 0 | |
| 1674 | 1691 | @ <label><input type="checkbox" name="sdigest" %s(sdigest?"checked":"")>\ |
| 1675 | 1692 | @ Daily digest only</label><br> |
| 1693 | +#endif | |
| 1676 | 1694 | if( g.perm.Admin ){ |
| 1695 | + @ <tr> | |
| 1696 | + @ <td class="form_label">Admin Options:</td><td> | |
| 1677 | 1697 | @ <label><input type="checkbox" name="sdonotcall" \ |
| 1678 | 1698 | @ %s(sdonotcall?"checked":"")> Do not call</label><br> |
| 1679 | 1699 | @ <label><input type="checkbox" name="sverified" \ |
| 1680 | 1700 | @ %s(sverified?"checked":"")>\ |
| 1681 | - @ Verified</label><br> | |
| 1701 | + @ Verified</label></td></tr> | |
| 1682 | 1702 | } |
| 1683 | - @ <label><input type="checkbox" name="dodelete"> | |
| 1684 | - @ Unsubscribe</label> \ | |
| 1685 | 1703 | if( eErr==9 ){ |
| 1686 | - @ <span class="loginError">← %h(zErr)</span>\ | |
| 1704 | + @ <tr> | |
| 1705 | + @ <td class="form_label">Verify:</td><td> | |
| 1706 | + @ <label><input type="checkbox" name="dodelete"> | |
| 1707 | + @ Unsubscribe</label> | |
| 1708 | + @ <span class="loginError">← %h(zErr)</span> | |
| 1709 | + @ </td></tr> | |
| 1687 | 1710 | } |
| 1688 | - @ <br> | |
| 1689 | - @ </td></tr> | |
| 1690 | 1711 | @ <tr> |
| 1691 | 1712 | @ <td></td> |
| 1692 | 1713 | @ <td><input type="submit" name="submit" value="Submit"> |
| 1693 | 1714 | @ <input type="submit" name="delete" value="Unsubscribe"> |
| 1694 | 1715 | @ </tr> |
| 1695 | 1716 |
| --- src/email.c | |
| +++ src/email.c | |
| @@ -1261,10 +1261,11 @@ | |
| 1261 | unsigned int uSeed; |
| 1262 | const char *zDecoded; |
| 1263 | char *zCaptcha = 0; |
| 1264 | char *zErr = 0; |
| 1265 | int eErr = 0; |
| 1266 | |
| 1267 | if( email_webpages_disabled() ) return; |
| 1268 | login_check_credentials(); |
| 1269 | if( !g.perm.EmailAlert ){ |
| 1270 | login_needed(g.anon.EmailAlert); |
| @@ -1404,11 +1405,11 @@ | |
| 1404 | @ <td><span class="loginError">← %h(zErr)</span></td> |
| 1405 | } |
| 1406 | @ </tr> |
| 1407 | } |
| 1408 | @ <tr> |
| 1409 | @ <td class="form_label">Options:</td> |
| 1410 | @ <td><label><input type="checkbox" name="sa" %s(PCK("sa"))> \ |
| 1411 | @ Announcements</label><br> |
| 1412 | if( g.perm.Read ){ |
| 1413 | @ <label><input type="checkbox" name="sc" %s(PCK("sc"))> \ |
| 1414 | @ Check-ins</label><br> |
| @@ -1423,20 +1424,27 @@ | |
| 1423 | } |
| 1424 | if( g.perm.RdWiki ){ |
| 1425 | @ <label><input type="checkbox" name="sw" %s(PCK("sw"))> \ |
| 1426 | @ Wiki</label><br> |
| 1427 | } |
| 1428 | @ <label><input type="checkbox" name="di" %s(PCK("di"))> \ |
| 1429 | @ Daily digest only</label><br> |
| 1430 | if( g.perm.Admin ){ |
| 1431 | @ <label><input type="checkbox" name="vi" %s(PCK("vi"))> \ |
| 1432 | @ Verified</label><br> |
| 1433 | @ <label><input type="checkbox" name="dnc" %s(PCK("dnc"))> \ |
| 1434 | @ Do not call</label><br> |
| 1435 | } |
| 1436 | @ </td> |
| 1437 | @ </tr> |
| 1438 | @ <tr> |
| 1439 | @ <td></td> |
| 1440 | if( needCaptcha && !email_enabled() ){ |
| 1441 | @ <td><input type="submit" name="submit" value="Submit" disabled> |
| 1442 | @ (Email current disabled)</td> |
| @@ -1572,11 +1580,11 @@ | |
| 1572 | } |
| 1573 | } |
| 1574 | if( P("delete")!=0 && cgi_csrf_safe(1) ){ |
| 1575 | if( !PB("dodelete") ){ |
| 1576 | eErr = 9; |
| 1577 | zErr = mprintf("Select this checkbox and press \"Unsubscribe\" to" |
| 1578 | " unsubscribe"); |
| 1579 | }else{ |
| 1580 | email_unsubscribe(zName); |
| 1581 | return; |
| 1582 | } |
| @@ -1650,11 +1658,11 @@ | |
| 1650 | @ <td><input type="text" name="suname" value="%h(suname?suname:"")" \ |
| 1651 | @ size="30"></td> |
| 1652 | @ </tr> |
| 1653 | } |
| 1654 | @ <tr> |
| 1655 | @ <td class="form_label">Options:</td> |
| 1656 | @ <td><label><input type="checkbox" name="sa" %s(sa?"checked":"")>\ |
| 1657 | @ Announcements</label><br> |
| 1658 | if( g.perm.Read ){ |
| 1659 | @ <label><input type="checkbox" name="sc" %s(sc?"checked":"")>\ |
| 1660 | @ Check-ins</label><br> |
| @@ -1667,28 +1675,41 @@ | |
| 1667 | @ <label><input type="checkbox" name="st" %s(st?"checked":"")>\ |
| 1668 | @ Ticket changes</label><br> |
| 1669 | } |
| 1670 | if( g.perm.RdWiki ){ |
| 1671 | @ <label><input type="checkbox" name="sw" %s(sw?"checked":"")>\ |
| 1672 | @ Wiki</label><br> |
| 1673 | } |
| 1674 | @ <label><input type="checkbox" name="sdigest" %s(sdigest?"checked":"")>\ |
| 1675 | @ Daily digest only</label><br> |
| 1676 | if( g.perm.Admin ){ |
| 1677 | @ <label><input type="checkbox" name="sdonotcall" \ |
| 1678 | @ %s(sdonotcall?"checked":"")> Do not call</label><br> |
| 1679 | @ <label><input type="checkbox" name="sverified" \ |
| 1680 | @ %s(sverified?"checked":"")>\ |
| 1681 | @ Verified</label><br> |
| 1682 | } |
| 1683 | @ <label><input type="checkbox" name="dodelete"> |
| 1684 | @ Unsubscribe</label> \ |
| 1685 | if( eErr==9 ){ |
| 1686 | @ <span class="loginError">← %h(zErr)</span>\ |
| 1687 | } |
| 1688 | @ <br> |
| 1689 | @ </td></tr> |
| 1690 | @ <tr> |
| 1691 | @ <td></td> |
| 1692 | @ <td><input type="submit" name="submit" value="Submit"> |
| 1693 | @ <input type="submit" name="delete" value="Unsubscribe"> |
| 1694 | @ </tr> |
| 1695 |
| --- src/email.c | |
| +++ src/email.c | |
| @@ -1261,10 +1261,11 @@ | |
| 1261 | unsigned int uSeed; |
| 1262 | const char *zDecoded; |
| 1263 | char *zCaptcha = 0; |
| 1264 | char *zErr = 0; |
| 1265 | int eErr = 0; |
| 1266 | int di; |
| 1267 | |
| 1268 | if( email_webpages_disabled() ) return; |
| 1269 | login_check_credentials(); |
| 1270 | if( !g.perm.EmailAlert ){ |
| 1271 | login_needed(g.anon.EmailAlert); |
| @@ -1404,11 +1405,11 @@ | |
| 1405 | @ <td><span class="loginError">← %h(zErr)</span></td> |
| 1406 | } |
| 1407 | @ </tr> |
| 1408 | } |
| 1409 | @ <tr> |
| 1410 | @ <td class="form_label">Topics:</td> |
| 1411 | @ <td><label><input type="checkbox" name="sa" %s(PCK("sa"))> \ |
| 1412 | @ Announcements</label><br> |
| 1413 | if( g.perm.Read ){ |
| 1414 | @ <label><input type="checkbox" name="sc" %s(PCK("sc"))> \ |
| 1415 | @ Check-ins</label><br> |
| @@ -1423,20 +1424,27 @@ | |
| 1424 | } |
| 1425 | if( g.perm.RdWiki ){ |
| 1426 | @ <label><input type="checkbox" name="sw" %s(PCK("sw"))> \ |
| 1427 | @ Wiki</label><br> |
| 1428 | } |
| 1429 | di = PB("di"); |
| 1430 | @ </td></tr> |
| 1431 | @ <tr> |
| 1432 | @ <td class="form_label">Delivery:</td> |
| 1433 | @ <td><select size="1" name="di"> |
| 1434 | @ <option value="0" %s(di?"":"selected")>Individual Emails</option> |
| 1435 | @ <option value="1" %s(di?"selected":"")>Daily Digest</option> |
| 1436 | @ </select></td> |
| 1437 | @ </tr> |
| 1438 | if( g.perm.Admin ){ |
| 1439 | @ <tr> |
| 1440 | @ <td class="form_label">Admin Options:</td><td> |
| 1441 | @ <label><input type="checkbox" name="vi" %s(PCK("vi"))> \ |
| 1442 | @ Verified</label><br> |
| 1443 | @ <label><input type="checkbox" name="dnc" %s(PCK("dnc"))> \ |
| 1444 | @ Do not call</label></td></tr> |
| 1445 | } |
| 1446 | @ <tr> |
| 1447 | @ <td></td> |
| 1448 | if( needCaptcha && !email_enabled() ){ |
| 1449 | @ <td><input type="submit" name="submit" value="Submit" disabled> |
| 1450 | @ (Email current disabled)</td> |
| @@ -1572,11 +1580,11 @@ | |
| 1580 | } |
| 1581 | } |
| 1582 | if( P("delete")!=0 && cgi_csrf_safe(1) ){ |
| 1583 | if( !PB("dodelete") ){ |
| 1584 | eErr = 9; |
| 1585 | zErr = mprintf("Select this checkbox and press \"Unsubscribe\" again to" |
| 1586 | " unsubscribe"); |
| 1587 | }else{ |
| 1588 | email_unsubscribe(zName); |
| 1589 | return; |
| 1590 | } |
| @@ -1650,11 +1658,11 @@ | |
| 1658 | @ <td><input type="text" name="suname" value="%h(suname?suname:"")" \ |
| 1659 | @ size="30"></td> |
| 1660 | @ </tr> |
| 1661 | } |
| 1662 | @ <tr> |
| 1663 | @ <td class="form_label">Topics:</td> |
| 1664 | @ <td><label><input type="checkbox" name="sa" %s(sa?"checked":"")>\ |
| 1665 | @ Announcements</label><br> |
| 1666 | if( g.perm.Read ){ |
| 1667 | @ <label><input type="checkbox" name="sc" %s(sc?"checked":"")>\ |
| 1668 | @ Check-ins</label><br> |
| @@ -1667,28 +1675,41 @@ | |
| 1675 | @ <label><input type="checkbox" name="st" %s(st?"checked":"")>\ |
| 1676 | @ Ticket changes</label><br> |
| 1677 | } |
| 1678 | if( g.perm.RdWiki ){ |
| 1679 | @ <label><input type="checkbox" name="sw" %s(sw?"checked":"")>\ |
| 1680 | @ Wiki</label> |
| 1681 | } |
| 1682 | @ </td></tr> |
| 1683 | @ <tr> |
| 1684 | @ <td class="form_label">Delivery:</td> |
| 1685 | @ <td><select size="1" name="sdigest"> |
| 1686 | @ <option value="0" %s(sdigest?"":"selected")>Individual Emails</option> |
| 1687 | @ <option value="1" %s(sdigest?"selected":"")>Daily Digest</option> |
| 1688 | @ </select></td> |
| 1689 | @ </tr> |
| 1690 | #if 0 |
| 1691 | @ <label><input type="checkbox" name="sdigest" %s(sdigest?"checked":"")>\ |
| 1692 | @ Daily digest only</label><br> |
| 1693 | #endif |
| 1694 | if( g.perm.Admin ){ |
| 1695 | @ <tr> |
| 1696 | @ <td class="form_label">Admin Options:</td><td> |
| 1697 | @ <label><input type="checkbox" name="sdonotcall" \ |
| 1698 | @ %s(sdonotcall?"checked":"")> Do not call</label><br> |
| 1699 | @ <label><input type="checkbox" name="sverified" \ |
| 1700 | @ %s(sverified?"checked":"")>\ |
| 1701 | @ Verified</label></td></tr> |
| 1702 | } |
| 1703 | if( eErr==9 ){ |
| 1704 | @ <tr> |
| 1705 | @ <td class="form_label">Verify:</td><td> |
| 1706 | @ <label><input type="checkbox" name="dodelete"> |
| 1707 | @ Unsubscribe</label> |
| 1708 | @ <span class="loginError">← %h(zErr)</span> |
| 1709 | @ </td></tr> |
| 1710 | } |
| 1711 | @ <tr> |
| 1712 | @ <td></td> |
| 1713 | @ <td><input type="submit" name="submit" value="Submit"> |
| 1714 | @ <input type="submit" name="delete" value="Unsubscribe"> |
| 1715 | @ </tr> |
| 1716 |