* Get the auth username and password from the main request * notes table, if present. */
| 543 | * notes table, if present. |
| 544 | */ |
| 545 | static apr_status_t get_session_auth(request_rec * r, |
| 546 | const char **user, const char **pw, const char **hash) |
| 547 | { |
| 548 | const char *authname = ap_auth_name(r); |
| 549 | session_rec *z = NULL; |
| 550 | |
| 551 | ap_session_load_fn(r, &z); |
| 552 | |
| 553 | if (user) { |
| 554 | ap_session_get_fn(r, z, apr_pstrcat(r->pool, authname, "-" MOD_SESSION_USER, NULL), user); |
| 555 | } |
| 556 | if (pw) { |
| 557 | ap_session_get_fn(r, z, apr_pstrcat(r->pool, authname, "-" MOD_SESSION_PW, NULL), pw); |
| 558 | } |
| 559 | if (hash) { |
| 560 | ap_session_get_fn(r, z, apr_pstrcat(r->pool, authname, "-" MOD_AUTH_FORM_HASH, NULL), hash); |
| 561 | } |
| 562 | |
| 563 | /* set the user, even though the user is unauthenticated at this point */ |
| 564 | if (user && *user) { |
| 565 | r->user = (char *) *user; |
| 566 | } |
| 567 | |
| 568 | ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, |
| 569 | "from session: " MOD_SESSION_USER ": %s, " MOD_SESSION_PW |
| 570 | ": %s, " MOD_AUTH_FORM_HASH ": %s", |
| 571 | user ? *user : "<null>", pw ? *pw : "<null>", |
| 572 | hash ? *hash : "<null>"); |
| 573 | |
| 574 | return APR_SUCCESS; |
| 575 | |
| 576 | } |
| 577 | |
| 578 | /** |
| 579 | * Isolate the username and password in a POSTed form with the |
no test coverage detected