Fossil

Changes On Branch fix-login-needed-add-anon
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch fix-login-needed-add-anon Excluding Merge-Ins

This is equivalent to a diff from 0872ecbe to 1650a643

2020-12-13
05:32
Factored the iteration count out of the encrypted backup solution in backup.md, so it isn't repeated between the backup and restore cases. ... (check-in: fc300d5a user: wyoung tags: trunk)
2020-12-12
23:20
fix duplication of QUERY_STRING in the redirection URL in login_needed function, append "&anon" if needed ... (Closed-Leaf check-in: 1650a643 user: sdr tags: fix-login-needed-add-anon)
19:48
merged forks ... (check-in: 0872ecbe user: sdr tags: trunk)
19:37
Omit the TCP port from the SERVER_NAME environment variable for the "fossil ui" and "fossil server" commands. ... (check-in: c728509f user: drh tags: trunk)
19:06
fixed a typo in a comment ... (check-in: 02c3468b user: sdr tags: trunk)

Changes to src/login.c.

1420
1421
1422
1423
1424
1425
1426




1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
    json_err( FSL_JSON_E_DENIED, NULL, 1 );
    fossil_exit(0);
    /* NOTREACHED */
    assert(0);
  }else
#endif /* FOSSIL_ENABLE_JSON */
  {




    const char *zUrl = PD("REQUEST_URI", "index");
    const char *zQS = P("QUERY_STRING");
    Blob redir;
    blob_init(&redir, 0, 0);
    if( fossil_wants_https(1) ){
      blob_appendf(&redir, "%s/login?g=%T", g.zHttpsURL, zUrl);
    }else{
      blob_appendf(&redir, "%R/login?g=%T", zUrl);
    }
    if( zQS && zQS[0] ){
      blob_appendf(&redir, "%%3f%T", zQS);
    }
    if( anonOk ) blob_append(&redir, "&anon", 5);
    cgi_redirect(blob_str(&redir));
    /* NOTREACHED */
    assert(0);
  }
}








>
>
>
>

<







<
<
<







1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431

1432
1433
1434
1435
1436
1437
1438



1439
1440
1441
1442
1443
1444
1445
    json_err( FSL_JSON_E_DENIED, NULL, 1 );
    fossil_exit(0);
    /* NOTREACHED */
    assert(0);
  }else
#endif /* FOSSIL_ENABLE_JSON */
  {
    /*
    ** Note: REQUEST_URI already includes QUERY_STRING, so there
    ** is no need to append the QUERY_STRING to the redir blob.
    */
    const char *zUrl = PD("REQUEST_URI", "index");

    Blob redir;
    blob_init(&redir, 0, 0);
    if( fossil_wants_https(1) ){
      blob_appendf(&redir, "%s/login?g=%T", g.zHttpsURL, zUrl);
    }else{
      blob_appendf(&redir, "%R/login?g=%T", zUrl);
    }



    if( anonOk ) blob_append(&redir, "&anon", 5);
    cgi_redirect(blob_str(&redir));
    /* NOTREACHED */
    assert(0);
  }
}