| | @@ -632,11 +632,18 @@ |
| 632 | 632 | @ to access page <b>%h(zAbbrev)</b>. |
| 633 | 633 | }else{ |
| 634 | 634 | @ <p>Login as a named user to access page <b>%h(zAbbrev)</b>. |
| 635 | 635 | } |
| 636 | 636 | } |
| 637 | | - form_begin(0, "%R/login"); |
| 637 | + if( g.sslNotAvailable==0 |
| 638 | + && strncmp(g.zBaseURL,"https:",6)!=0 |
| 639 | + && db_get_boolean("https-login",0) |
| 640 | + ){ |
| 641 | + form_begin(0, "https:%s/login", g.zBaseURL+5); |
| 642 | + }else{ |
| 643 | + form_begin(0, "%R/login"); |
| 644 | + } |
| 638 | 645 | if( zGoto ){ |
| 639 | 646 | @ <input type="hidden" name="g" value="%h(zGoto)" /> |
| 640 | 647 | }else if( zReferer && strncmp(g.zBaseURL, zReferer, strlen(g.zBaseURL))==0 ){ |
| 641 | 648 | @ <input type="hidden" name="g" value="%h(zReferer)" /> |
| 642 | 649 | } |
| | @@ -667,28 +674,13 @@ |
| 667 | 674 | " WHERE login='anonymous'" |
| 668 | 675 | " AND cap!=''"); |
| 669 | 676 | } |
| 670 | 677 | @ <tr> |
| 671 | 678 | @ <td></td> |
| 672 | | - @ <td><input type="submit" name="in" value="Login" |
| 673 | | - @ onClick="chngAction(this.form)" /></td> |
| 679 | + @ <td><input type="submit" name="in" value="Login"> |
| 674 | 680 | @ </tr> |
| 675 | 681 | @ </table> |
| 676 | | - @ <script> |
| 677 | | - @ gebi('u').focus() |
| 678 | | - @ function chngAction(form){ |
| 679 | | - if( g.sslNotAvailable==0 |
| 680 | | - && strncmp(g.zBaseURL,"https:",6)!=0 |
| 681 | | - && db_get_boolean("https-login",0) |
| 682 | | - ){ |
| 683 | | - char *zSSL = mprintf("https:%s", &g.zBaseURL[5]); |
| 684 | | - @ if( form.u.value!="anonymous" ){ |
| 685 | | - @ form.action = "%h(zSSL)/login"; |
| 686 | | - @ } |
| 687 | | - } |
| 688 | | - @ } |
| 689 | | - @ </script> |
| 690 | 682 | @ <p>Pressing the Login button grants permission to store a cookie.</p> |
| 691 | 683 | if( db_get_boolean("self-register", 0) ){ |
| 692 | 684 | @ <p>If you do not have an account, you can |
| 693 | 685 | @ <a href="%R/register?g=%T(P("G"))">create one</a>. |
| 694 | 686 | } |
| | @@ -703,12 +695,13 @@ |
| 703 | 695 | @ the 8-character hexadecimal password shown below:</p> |
| 704 | 696 | @ <div class="captcha"><table class="captcha"><tr><td><pre> |
| 705 | 697 | @ %h(zCaptcha) |
| 706 | 698 | @ </pre></td></tr></table> |
| 707 | 699 | if( bAutoCaptcha ) { |
| 708 | | - @ <input type="button" value="Fill out captcha" |
| 709 | | - @ onclick="gebi('u').value='anonymous'; gebi('p').value='%s(zDecoded)';" /> |
| 700 | + @ <input type="button" value="Fill out captcha" id='autofillButton' \ |
| 701 | + @ data-af='%s(zDecoded)' /> |
| 702 | + style_load_one_js_file("login.js"); |
| 710 | 703 | } |
| 711 | 704 | @ </div> |
| 712 | 705 | free(zCaptcha); |
| 713 | 706 | } |
| 714 | 707 | @ </form> |
| 715 | 708 | |
| 716 | 709 | ADDED src/login.js |