1
static MP_INLINE SV *mpxs_ap_requires(pTHX_ request_rec *r)
6
const apr_array_header_t *reqs_arr = ap_requires(r);
13
reqs = (require_line *)reqs_arr->elts;
16
for (x=0; x < reqs_arr->nelts; x++) {
17
/* XXX should we do this or let PerlAuthzHandler? */
18
if (! (reqs[x].method_mask & (1 << r->method_number))) {
24
hv_store(hv, "method_mask", 11,
25
newSViv((IV)reqs[x].method_mask), 0);
27
hv_store(hv, "requirement", 11,
28
newSVpv(reqs[x].requirement,0), 0);
30
av_push(av, newRV_noinc((SV*)hv));
33
return newRV_noinc((SV*)av);
37
void mpxs_ap_allow_methods(pTHX_ I32 items, SV **MARK, SV **SP)
42
mpxs_usage_va_2(r, reset, "$r->allow_methods(reset, ...)");
45
ap_clear_method_list(r->allowed_methods);
50
char *method = SvPV(*MARK, n_a);
51
ap_method_list_add(r->allowed_methods, method);
56
static MP_INLINE void mpxs_insert_auth_cfg(pTHX_ request_rec *r,
63
av_push(config, Perl_newSVpvf(aTHX_ "%s %s", directive, val));
66
modperl_config_insert_request(aTHX_ r,
67
newRV_noinc((SV*)config),
68
r->filename, OR_AUTHCFG);
71
Perl_warn(aTHX_ "Can't change %s to '%s'\n", directive, val);
74
SvREFCNT_dec((SV*)config);
78
const char *mpxs_Apache__RequestRec_auth_type(pTHX_ request_rec *r,
82
mpxs_insert_auth_cfg(aTHX_ r, "AuthType", type);
85
return ap_auth_type(r);
89
const char *mpxs_Apache__RequestRec_auth_name(pTHX_ request_rec *r,
93
mpxs_insert_auth_cfg(aTHX_ r, "AuthName", name);
96
return ap_auth_name(r);
99
static XS(MPXS_ap_get_basic_auth_pw)
103
const char *sent_pw = NULL;
106
mpxs_usage_items_1("r");
109
r = mp_xs_sv2_r(ST(0));
111
/* Default auth-type to Basic */
112
if (!ap_auth_type(r)) {
113
mpxs_Apache__RequestRec_auth_type(aTHX_ r, "Basic");
116
rc = ap_get_basic_auth_pw(r, &sent_pw);
121
PUSHs_mortal_pv(sent_pw);