* Set the auth username and password into the session. * * If either the username, or the password are NULL, the username * and/or password will be removed from the session. */
| 518 | * and/or password will be removed from the session. |
| 519 | */ |
| 520 | static apr_status_t set_session_auth(request_rec * r, |
| 521 | const char *user, const char *pw, const char *site) |
| 522 | { |
| 523 | const char *hash = NULL; |
| 524 | const char *authname = ap_auth_name(r); |
| 525 | session_rec *z = NULL; |
| 526 | |
| 527 | if (site) { |
| 528 | hash = ap_md5(r->pool, |
| 529 | (unsigned char *) apr_pstrcat(r->pool, user, ":", site, NULL)); |
| 530 | } |
| 531 | |
| 532 | ap_session_load_fn(r, &z); |
| 533 | ap_session_set_fn(r, z, apr_pstrcat(r->pool, authname, "-" MOD_SESSION_USER, NULL), user); |
| 534 | ap_session_set_fn(r, z, apr_pstrcat(r->pool, authname, "-" MOD_SESSION_PW, NULL), pw); |
| 535 | ap_session_set_fn(r, z, apr_pstrcat(r->pool, authname, "-" MOD_AUTH_FORM_HASH, NULL), hash); |
| 536 | |
| 537 | return APR_SUCCESS; |
| 538 | |
| 539 | } |
| 540 | |
| 541 | /** |
| 542 | * Get the auth username and password from the main request |
no test coverage detected