Fossil SCM
Fix a bad redirect associated with Logout. Problem caused by [3571c8715d512a28]
Commit
85f87c8d308c3025cb275af14f667be4849a67608098ce8cd6345b17f16db322
Parent
874e7fa7bbf60a3…
1 file changed
+1
-5
+1
-5
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -549,11 +549,10 @@ | ||
| 549 | 549 | int anonFlag; /* Login as "anonymous" would be useful */ |
| 550 | 550 | char *zErrMsg = ""; |
| 551 | 551 | int uid; /* User id logged in user */ |
| 552 | 552 | char *zSha1Pw; |
| 553 | 553 | const char *zIpAddr; /* IP address of requestor */ |
| 554 | - const char *zReferer; | |
| 555 | 554 | const int noAnon = P("noanon")!=0; |
| 556 | 555 | int rememberMe; /* If true, use persistent cookie, else |
| 557 | 556 | session cookie. Toggled per |
| 558 | 557 | checkbox. */ |
| 559 | 558 | |
| @@ -640,11 +639,10 @@ | ||
| 640 | 639 | @ </span></p> |
| 641 | 640 | ; |
| 642 | 641 | } |
| 643 | 642 | } |
| 644 | 643 | zIpAddr = PD("REMOTE_ADDR","nil"); /* Complete IP address for logging */ |
| 645 | - zReferer = P("HTTP_REFERER"); | |
| 646 | 644 | uid = login_is_valid_anonymous(zUsername, zPasswd, P("cs")); |
| 647 | 645 | if(zUsername==0){ |
| 648 | 646 | /* Initial login page hit. */ |
| 649 | 647 | rememberMe = 0; |
| 650 | 648 | }else{ |
| @@ -708,12 +706,10 @@ | ||
| 708 | 706 | }else{ |
| 709 | 707 | form_begin(0, "%R/login"); |
| 710 | 708 | } |
| 711 | 709 | if( zGoto ){ |
| 712 | 710 | @ <input type="hidden" name="g" value="%h(zGoto)" /> |
| 713 | - }else if( zReferer && strncmp(g.zBaseURL, zReferer, strlen(g.zBaseURL))==0 ){ | |
| 714 | - @ <input type="hidden" name="g" value="%h(zReferer)" /> | |
| 715 | 711 | } |
| 716 | 712 | if( anonFlag ){ |
| 717 | 713 | @ <input type="hidden" name="anon" value="1" /> |
| 718 | 714 | } |
| 719 | 715 | if( g.zLogin ){ |
| @@ -1506,11 +1502,11 @@ | ||
| 1506 | 1502 | ** to inform the user that much more information is available by |
| 1507 | 1503 | ** logging in as anonymous. |
| 1508 | 1504 | */ |
| 1509 | 1505 | void login_anonymous_available(void){ |
| 1510 | 1506 | if( !g.perm.Hyperlink && g.anon.Hyperlink ){ |
| 1511 | - const char *zUrl = PD("REQUEST_URI", "index"); | |
| 1507 | + const char *zUrl = PD("PATH_INFO", ""); | |
| 1512 | 1508 | @ <p>Many <span class="disabled">hyperlinks are disabled.</span><br /> |
| 1513 | 1509 | @ Use <a href="%R/login?anon=1&g=%T(zUrl)">anonymous login</a> |
| 1514 | 1510 | @ to enable hyperlinks.</p> |
| 1515 | 1511 | } |
| 1516 | 1512 | } |
| 1517 | 1513 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -549,11 +549,10 @@ | |
| 549 | int anonFlag; /* Login as "anonymous" would be useful */ |
| 550 | char *zErrMsg = ""; |
| 551 | int uid; /* User id logged in user */ |
| 552 | char *zSha1Pw; |
| 553 | const char *zIpAddr; /* IP address of requestor */ |
| 554 | const char *zReferer; |
| 555 | const int noAnon = P("noanon")!=0; |
| 556 | int rememberMe; /* If true, use persistent cookie, else |
| 557 | session cookie. Toggled per |
| 558 | checkbox. */ |
| 559 | |
| @@ -640,11 +639,10 @@ | |
| 640 | @ </span></p> |
| 641 | ; |
| 642 | } |
| 643 | } |
| 644 | zIpAddr = PD("REMOTE_ADDR","nil"); /* Complete IP address for logging */ |
| 645 | zReferer = P("HTTP_REFERER"); |
| 646 | uid = login_is_valid_anonymous(zUsername, zPasswd, P("cs")); |
| 647 | if(zUsername==0){ |
| 648 | /* Initial login page hit. */ |
| 649 | rememberMe = 0; |
| 650 | }else{ |
| @@ -708,12 +706,10 @@ | |
| 708 | }else{ |
| 709 | form_begin(0, "%R/login"); |
| 710 | } |
| 711 | if( zGoto ){ |
| 712 | @ <input type="hidden" name="g" value="%h(zGoto)" /> |
| 713 | }else if( zReferer && strncmp(g.zBaseURL, zReferer, strlen(g.zBaseURL))==0 ){ |
| 714 | @ <input type="hidden" name="g" value="%h(zReferer)" /> |
| 715 | } |
| 716 | if( anonFlag ){ |
| 717 | @ <input type="hidden" name="anon" value="1" /> |
| 718 | } |
| 719 | if( g.zLogin ){ |
| @@ -1506,11 +1502,11 @@ | |
| 1506 | ** to inform the user that much more information is available by |
| 1507 | ** logging in as anonymous. |
| 1508 | */ |
| 1509 | void login_anonymous_available(void){ |
| 1510 | if( !g.perm.Hyperlink && g.anon.Hyperlink ){ |
| 1511 | const char *zUrl = PD("REQUEST_URI", "index"); |
| 1512 | @ <p>Many <span class="disabled">hyperlinks are disabled.</span><br /> |
| 1513 | @ Use <a href="%R/login?anon=1&g=%T(zUrl)">anonymous login</a> |
| 1514 | @ to enable hyperlinks.</p> |
| 1515 | } |
| 1516 | } |
| 1517 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -549,11 +549,10 @@ | |
| 549 | int anonFlag; /* Login as "anonymous" would be useful */ |
| 550 | char *zErrMsg = ""; |
| 551 | int uid; /* User id logged in user */ |
| 552 | char *zSha1Pw; |
| 553 | const char *zIpAddr; /* IP address of requestor */ |
| 554 | const int noAnon = P("noanon")!=0; |
| 555 | int rememberMe; /* If true, use persistent cookie, else |
| 556 | session cookie. Toggled per |
| 557 | checkbox. */ |
| 558 | |
| @@ -640,11 +639,10 @@ | |
| 639 | @ </span></p> |
| 640 | ; |
| 641 | } |
| 642 | } |
| 643 | zIpAddr = PD("REMOTE_ADDR","nil"); /* Complete IP address for logging */ |
| 644 | uid = login_is_valid_anonymous(zUsername, zPasswd, P("cs")); |
| 645 | if(zUsername==0){ |
| 646 | /* Initial login page hit. */ |
| 647 | rememberMe = 0; |
| 648 | }else{ |
| @@ -708,12 +706,10 @@ | |
| 706 | }else{ |
| 707 | form_begin(0, "%R/login"); |
| 708 | } |
| 709 | if( zGoto ){ |
| 710 | @ <input type="hidden" name="g" value="%h(zGoto)" /> |
| 711 | } |
| 712 | if( anonFlag ){ |
| 713 | @ <input type="hidden" name="anon" value="1" /> |
| 714 | } |
| 715 | if( g.zLogin ){ |
| @@ -1506,11 +1502,11 @@ | |
| 1502 | ** to inform the user that much more information is available by |
| 1503 | ** logging in as anonymous. |
| 1504 | */ |
| 1505 | void login_anonymous_available(void){ |
| 1506 | if( !g.perm.Hyperlink && g.anon.Hyperlink ){ |
| 1507 | const char *zUrl = PD("PATH_INFO", ""); |
| 1508 | @ <p>Many <span class="disabled">hyperlinks are disabled.</span><br /> |
| 1509 | @ Use <a href="%R/login?anon=1&g=%T(zUrl)">anonymous login</a> |
| 1510 | @ to enable hyperlinks.</p> |
| 1511 | } |
| 1512 | } |
| 1513 |