Fossil SCM

Do not show the "Change user:" form on the /logout page. It adds little value but much confusion.

drh 2018-06-20 22:53 trunk
Commit 00bed59b694c7bf0f3f1f3555a4b3f2e302e283df5d4eafc2cb403d072e391b3
1 file changed +72 -73
+72 -73
--- src/login.c
+++ src/login.c
@@ -665,85 +665,84 @@
665665
@ <input type="hidden" name="anon" value="1" />
666666
}
667667
if( g.zLogin ){
668668
@ <p>Currently logged in as <b>%h(g.zLogin)</b>.
669669
@ <input type="submit" name="out" value="Logout"></p>
670
- @ <hr />
671
- @ <p>Change user:
672
- }
673
- @ <table class="login_out">
674
- @ <tr>
675
- @ <td class="login_out_label">User ID:</td>
676
- if( anonFlag ){
677
- @ <td><input type="text" id="u" name="u" value="anonymous" size="30" /></td>
678
- }else{
679
- @ <td><input type="text" id="u" name="u" value="" size="30" /></td>
680
- }
681
- if( P("HTTPS")==0 ){
682
- @ <td width="15"><td rowspan="3">
683
- @ <p class='securityWarning'>
684
- @ Warning: Your password will be sent in the clear over an
685
- @ unencrypted connection.
686
- if( g.sslNotAvailable ){
687
- @ No encrypted connection is available on this server.
688
- }else{
689
- @ Consider logging in at
690
- @ <a href='%s(g.zHttpsURL)'>%h(g.zHttpsURL)</a> instead.
691
- }
692
- @ </p>
693
- }
694
- @ </tr>
695
- @ <tr>
696
- @ <td class="login_out_label">Password:</td>
697
- @ <td><input type="password" id="p" name="p" value="" size="30" /></td>
698
- @ </tr>
699
- if( g.zLogin==0 && (anonFlag || zGoto==0) ){
700
- zAnonPw = db_text(0, "SELECT pw FROM user"
701
- " WHERE login='anonymous'"
702
- " AND cap!=''");
703
- }
704
- @ <tr>
705
- @ <td></td>
706
- @ <td><input type="submit" name="in" value="Login">
707
- @ </tr>
708
- @ </table>
709
- @ <p>Pressing the Login button grants permission to store a cookie.</p>
710
- if( db_get_boolean("self-register", 0) ){
711
- @ <p>If you do not have an account, you can
712
- @ <a href="%R/register?g=%T(P("G"))">create one</a>.
713
- }
714
- if( zAnonPw ){
715
- unsigned int uSeed = captcha_seed();
716
- const char *zDecoded = captcha_decode(uSeed);
717
- int bAutoCaptcha = db_get_boolean("auto-captcha", 0);
718
- char *zCaptcha = captcha_render(zDecoded);
719
-
720
- @ <p><input type="hidden" name="cs" value="%u(uSeed)" />
721
- @ Visitors may enter <b>anonymous</b> as the user-ID with
722
- @ the 8-character hexadecimal password shown below:</p>
723
- @ <div class="captcha"><table class="captcha"><tr><td><pre>
724
- @ %h(zCaptcha)
725
- @ </pre></td></tr></table>
726
- if( bAutoCaptcha ) {
727
- @ <input type="button" value="Fill out captcha" id='autofillButton' \
728
- @ data-af='%s(zDecoded)' />
729
- style_load_one_js_file("login.js");
730
- }
731
- @ </div>
732
- free(zCaptcha);
733
- }
734
- @ </form>
670
+ }else{
671
+ @ <table class="login_out">
672
+ @ <tr>
673
+ @ <td class="form_label">User ID:</td>
674
+ if( anonFlag ){
675
+ @ <td><input type="text" id="u" name="u" value="anonymous" size="30"></td>
676
+ }else{
677
+ @ <td><input type="text" id="u" name="u" value="" size="30" /></td>
678
+ }
679
+ if( P("HTTPS")==0 ){
680
+ @ <td width="15"><td rowspan="3">
681
+ @ <p class='securityWarning'>
682
+ @ Warning: Your password will be sent in the clear over an
683
+ @ unencrypted connection.
684
+ if( g.sslNotAvailable ){
685
+ @ No encrypted connection is available on this server.
686
+ }else{
687
+ @ Consider logging in at
688
+ @ <a href='%s(g.zHttpsURL)'>%h(g.zHttpsURL)</a> instead.
689
+ }
690
+ @ </p>
691
+ }
692
+ @ </tr>
693
+ @ <tr>
694
+ @ <td class="form_label">Password:</td>
695
+ @ <td><input type="password" id="p" name="p" value="" size="30" /></td>
696
+ @ </tr>
697
+ if( g.zLogin==0 && (anonFlag || zGoto==0) ){
698
+ zAnonPw = db_text(0, "SELECT pw FROM user"
699
+ " WHERE login='anonymous'"
700
+ " AND cap!=''");
701
+ }
702
+ @ <tr>
703
+ @ <td></td>
704
+ @ <td><input type="submit" name="in" value="Login">
705
+ @ </tr>
706
+ @ </table>
707
+ @ <p>Pressing the Login button grants permission to store a cookie.</p>
708
+ if( db_get_boolean("self-register", 0) ){
709
+ @ <p>If you do not have an account, you can
710
+ @ <a href="%R/register?g=%T(P("G"))">create one</a>.
711
+ }
712
+ if( zAnonPw ){
713
+ unsigned int uSeed = captcha_seed();
714
+ const char *zDecoded = captcha_decode(uSeed);
715
+ int bAutoCaptcha = db_get_boolean("auto-captcha", 0);
716
+ char *zCaptcha = captcha_render(zDecoded);
717
+
718
+ @ <p><input type="hidden" name="cs" value="%u(uSeed)" />
719
+ @ Visitors may enter <b>anonymous</b> as the user-ID with
720
+ @ the 8-character hexadecimal password shown below:</p>
721
+ @ <div class="captcha"><table class="captcha"><tr><td><pre>
722
+ @ %h(zCaptcha)
723
+ @ </pre></td></tr></table>
724
+ if( bAutoCaptcha ) {
725
+ @ <input type="button" value="Fill out captcha" id='autofillButton' \
726
+ @ data-af='%s(zDecoded)' />
727
+ style_load_one_js_file("login.js");
728
+ }
729
+ @ </div>
730
+ free(zCaptcha);
731
+ }
732
+ @ </form>
733
+ }
735734
if( g.zLogin && g.perm.Password ){
736735
@ <hr />
737736
@ <p>Change Password for user <b>%h(g.zLogin)</b>:</p>
738737
form_begin(0, "%R/login");
739738
@ <table>
740
- @ <tr><td class="login_out_label">Old Password:</td>
739
+ @ <tr><td class="form_label">Old Password:</td>
741740
@ <td><input type="password" name="p" size="30" /></td></tr>
742
- @ <tr><td class="login_out_label">New Password:</td>
741
+ @ <tr><td class="form_label">New Password:</td>
743742
@ <td><input type="password" name="n1" size="30" /></td></tr>
744
- @ <tr><td class="login_out_label">Repeat New Password:</td>
743
+ @ <tr><td class="form_label">Repeat New Password:</td>
745744
@ <td><input type="password" name="n2" size="30" /></td></tr>
746745
@ <tr><td></td>
747746
@ <td><input type="submit" value="Change Password" /></td></tr>
748747
@ </table>
749748
@ </form>
@@ -1523,27 +1522,27 @@
15231522
@ <input type="hidden" name="g" value="%h(P("g"))" />
15241523
}
15251524
@ <p><input type="hidden" name="cs" value="%u(uSeed)" />
15261525
@ <table class="login_out">
15271526
@ <tr>
1528
- @ <td class="login_out_label" align="right">User ID:</td>
1527
+ @ <td class="form_label" align="right">User ID:</td>
15291528
@ <td><input type="text" id="u" name="u" value="" size="30" /></td>
15301529
@ </tr>
15311530
@ <tr>
1532
- @ <td class="login_out_label" align="right">Password:</td>
1531
+ @ <td class="form_label" align="right">Password:</td>
15331532
@ <td><input type="password" id="p" name="p" value="" size="30" /></td>
15341533
@ </tr>
15351534
@ <tr>
1536
- @ <td class="login_out_label" align="right">Confirm password:</td>
1535
+ @ <td class="form_label" align="right">Confirm password:</td>
15371536
@ <td><input type="password" id="cp" name="cp" value="" size="30" /></td>
15381537
@ </tr>
15391538
@ <tr>
1540
- @ <td class="login_out_label" align="right">Contact info:</td>
1539
+ @ <td class="form_label" align="right">Contact info:</td>
15411540
@ <td><input type="text" id="c" name="c" value="" size="30" /></td>
15421541
@ </tr>
15431542
@ <tr>
1544
- @ <td class="login_out_label" align="right">Captcha text (below):</td>
1543
+ @ <td class="form_label" align="right">Captcha text (below):</td>
15451544
@ <td><input type="text" id="cap" name="cap" value="" size="30" /></td>
15461545
@ </tr>
15471546
@ <tr><td></td>
15481547
@ <td><input type="submit" name="new" value="Register" /></td></tr>
15491548
@ </table>
15501549
--- src/login.c
+++ src/login.c
@@ -665,85 +665,84 @@
665 @ <input type="hidden" name="anon" value="1" />
666 }
667 if( g.zLogin ){
668 @ <p>Currently logged in as <b>%h(g.zLogin)</b>.
669 @ <input type="submit" name="out" value="Logout"></p>
670 @ <hr />
671 @ <p>Change user:
672 }
673 @ <table class="login_out">
674 @ <tr>
675 @ <td class="login_out_label">User ID:</td>
676 if( anonFlag ){
677 @ <td><input type="text" id="u" name="u" value="anonymous" size="30" /></td>
678 }else{
679 @ <td><input type="text" id="u" name="u" value="" size="30" /></td>
680 }
681 if( P("HTTPS")==0 ){
682 @ <td width="15"><td rowspan="3">
683 @ <p class='securityWarning'>
684 @ Warning: Your password will be sent in the clear over an
685 @ unencrypted connection.
686 if( g.sslNotAvailable ){
687 @ No encrypted connection is available on this server.
688 }else{
689 @ Consider logging in at
690 @ <a href='%s(g.zHttpsURL)'>%h(g.zHttpsURL)</a> instead.
691 }
692 @ </p>
693 }
694 @ </tr>
695 @ <tr>
696 @ <td class="login_out_label">Password:</td>
697 @ <td><input type="password" id="p" name="p" value="" size="30" /></td>
698 @ </tr>
699 if( g.zLogin==0 && (anonFlag || zGoto==0) ){
700 zAnonPw = db_text(0, "SELECT pw FROM user"
701 " WHERE login='anonymous'"
702 " AND cap!=''");
703 }
704 @ <tr>
705 @ <td></td>
706 @ <td><input type="submit" name="in" value="Login">
707 @ </tr>
708 @ </table>
709 @ <p>Pressing the Login button grants permission to store a cookie.</p>
710 if( db_get_boolean("self-register", 0) ){
711 @ <p>If you do not have an account, you can
712 @ <a href="%R/register?g=%T(P("G"))">create one</a>.
713 }
714 if( zAnonPw ){
715 unsigned int uSeed = captcha_seed();
716 const char *zDecoded = captcha_decode(uSeed);
717 int bAutoCaptcha = db_get_boolean("auto-captcha", 0);
718 char *zCaptcha = captcha_render(zDecoded);
719
720 @ <p><input type="hidden" name="cs" value="%u(uSeed)" />
721 @ Visitors may enter <b>anonymous</b> as the user-ID with
722 @ the 8-character hexadecimal password shown below:</p>
723 @ <div class="captcha"><table class="captcha"><tr><td><pre>
724 @ %h(zCaptcha)
725 @ </pre></td></tr></table>
726 if( bAutoCaptcha ) {
727 @ <input type="button" value="Fill out captcha" id='autofillButton' \
728 @ data-af='%s(zDecoded)' />
729 style_load_one_js_file("login.js");
730 }
731 @ </div>
732 free(zCaptcha);
733 }
734 @ </form>
735 if( g.zLogin && g.perm.Password ){
736 @ <hr />
737 @ <p>Change Password for user <b>%h(g.zLogin)</b>:</p>
738 form_begin(0, "%R/login");
739 @ <table>
740 @ <tr><td class="login_out_label">Old Password:</td>
741 @ <td><input type="password" name="p" size="30" /></td></tr>
742 @ <tr><td class="login_out_label">New Password:</td>
743 @ <td><input type="password" name="n1" size="30" /></td></tr>
744 @ <tr><td class="login_out_label">Repeat New Password:</td>
745 @ <td><input type="password" name="n2" size="30" /></td></tr>
746 @ <tr><td></td>
747 @ <td><input type="submit" value="Change Password" /></td></tr>
748 @ </table>
749 @ </form>
@@ -1523,27 +1522,27 @@
1523 @ <input type="hidden" name="g" value="%h(P("g"))" />
1524 }
1525 @ <p><input type="hidden" name="cs" value="%u(uSeed)" />
1526 @ <table class="login_out">
1527 @ <tr>
1528 @ <td class="login_out_label" align="right">User ID:</td>
1529 @ <td><input type="text" id="u" name="u" value="" size="30" /></td>
1530 @ </tr>
1531 @ <tr>
1532 @ <td class="login_out_label" align="right">Password:</td>
1533 @ <td><input type="password" id="p" name="p" value="" size="30" /></td>
1534 @ </tr>
1535 @ <tr>
1536 @ <td class="login_out_label" align="right">Confirm password:</td>
1537 @ <td><input type="password" id="cp" name="cp" value="" size="30" /></td>
1538 @ </tr>
1539 @ <tr>
1540 @ <td class="login_out_label" align="right">Contact info:</td>
1541 @ <td><input type="text" id="c" name="c" value="" size="30" /></td>
1542 @ </tr>
1543 @ <tr>
1544 @ <td class="login_out_label" align="right">Captcha text (below):</td>
1545 @ <td><input type="text" id="cap" name="cap" value="" size="30" /></td>
1546 @ </tr>
1547 @ <tr><td></td>
1548 @ <td><input type="submit" name="new" value="Register" /></td></tr>
1549 @ </table>
1550
--- src/login.c
+++ src/login.c
@@ -665,85 +665,84 @@
665 @ <input type="hidden" name="anon" value="1" />
666 }
667 if( g.zLogin ){
668 @ <p>Currently logged in as <b>%h(g.zLogin)</b>.
669 @ <input type="submit" name="out" value="Logout"></p>
670 }else{
671 @ <table class="login_out">
672 @ <tr>
673 @ <td class="form_label">User ID:</td>
674 if( anonFlag ){
675 @ <td><input type="text" id="u" name="u" value="anonymous" size="30"></td>
676 }else{
677 @ <td><input type="text" id="u" name="u" value="" size="30" /></td>
678 }
679 if( P("HTTPS")==0 ){
680 @ <td width="15"><td rowspan="3">
681 @ <p class='securityWarning'>
682 @ Warning: Your password will be sent in the clear over an
683 @ unencrypted connection.
684 if( g.sslNotAvailable ){
685 @ No encrypted connection is available on this server.
686 }else{
687 @ Consider logging in at
688 @ <a href='%s(g.zHttpsURL)'>%h(g.zHttpsURL)</a> instead.
689 }
690 @ </p>
691 }
692 @ </tr>
693 @ <tr>
694 @ <td class="form_label">Password:</td>
695 @ <td><input type="password" id="p" name="p" value="" size="30" /></td>
696 @ </tr>
697 if( g.zLogin==0 && (anonFlag || zGoto==0) ){
698 zAnonPw = db_text(0, "SELECT pw FROM user"
699 " WHERE login='anonymous'"
700 " AND cap!=''");
701 }
702 @ <tr>
703 @ <td></td>
704 @ <td><input type="submit" name="in" value="Login">
705 @ </tr>
706 @ </table>
707 @ <p>Pressing the Login button grants permission to store a cookie.</p>
708 if( db_get_boolean("self-register", 0) ){
709 @ <p>If you do not have an account, you can
710 @ <a href="%R/register?g=%T(P("G"))">create one</a>.
711 }
712 if( zAnonPw ){
713 unsigned int uSeed = captcha_seed();
714 const char *zDecoded = captcha_decode(uSeed);
715 int bAutoCaptcha = db_get_boolean("auto-captcha", 0);
716 char *zCaptcha = captcha_render(zDecoded);
717
718 @ <p><input type="hidden" name="cs" value="%u(uSeed)" />
719 @ Visitors may enter <b>anonymous</b> as the user-ID with
720 @ the 8-character hexadecimal password shown below:</p>
721 @ <div class="captcha"><table class="captcha"><tr><td><pre>
722 @ %h(zCaptcha)
723 @ </pre></td></tr></table>
724 if( bAutoCaptcha ) {
725 @ <input type="button" value="Fill out captcha" id='autofillButton' \
726 @ data-af='%s(zDecoded)' />
727 style_load_one_js_file("login.js");
728 }
729 @ </div>
730 free(zCaptcha);
731 }
732 @ </form>
733 }
 
734 if( g.zLogin && g.perm.Password ){
735 @ <hr />
736 @ <p>Change Password for user <b>%h(g.zLogin)</b>:</p>
737 form_begin(0, "%R/login");
738 @ <table>
739 @ <tr><td class="form_label">Old Password:</td>
740 @ <td><input type="password" name="p" size="30" /></td></tr>
741 @ <tr><td class="form_label">New Password:</td>
742 @ <td><input type="password" name="n1" size="30" /></td></tr>
743 @ <tr><td class="form_label">Repeat New Password:</td>
744 @ <td><input type="password" name="n2" size="30" /></td></tr>
745 @ <tr><td></td>
746 @ <td><input type="submit" value="Change Password" /></td></tr>
747 @ </table>
748 @ </form>
@@ -1523,27 +1522,27 @@
1522 @ <input type="hidden" name="g" value="%h(P("g"))" />
1523 }
1524 @ <p><input type="hidden" name="cs" value="%u(uSeed)" />
1525 @ <table class="login_out">
1526 @ <tr>
1527 @ <td class="form_label" align="right">User ID:</td>
1528 @ <td><input type="text" id="u" name="u" value="" size="30" /></td>
1529 @ </tr>
1530 @ <tr>
1531 @ <td class="form_label" align="right">Password:</td>
1532 @ <td><input type="password" id="p" name="p" value="" size="30" /></td>
1533 @ </tr>
1534 @ <tr>
1535 @ <td class="form_label" align="right">Confirm password:</td>
1536 @ <td><input type="password" id="cp" name="cp" value="" size="30" /></td>
1537 @ </tr>
1538 @ <tr>
1539 @ <td class="form_label" align="right">Contact info:</td>
1540 @ <td><input type="text" id="c" name="c" value="" size="30" /></td>
1541 @ </tr>
1542 @ <tr>
1543 @ <td class="form_label" align="right">Captcha text (below):</td>
1544 @ <td><input type="text" id="cap" name="cap" value="" size="30" /></td>
1545 @ </tr>
1546 @ <tr><td></td>
1547 @ <td><input type="submit" name="new" value="Register" /></td></tr>
1548 @ </table>
1549

Keyboard Shortcuts

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