apache2::access.3

来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· 3 代码 · 共 663 行 · 第 1/2 页

3
663
字号
.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05).\".\" Standard preamble:.\" ========================================================================.de Sh \" Subsection heading.br.if t .Sp.ne 5.PP\fB\\$1\fR.PP...de Sp \" Vertical space (when we can't use .PP).if t .sp .5v.if n .sp...de Vb \" Begin verbatim text.ft CW.nf.ne \\$1...de Ve \" End verbatim text.ft R.fi...\" Set up some character translations and predefined strings.  \*(-- will.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left.\" double quote, and \*(R" will give a right double quote.  \*(C+ will.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,.\" nothing in troff, for use with C<>..tr \(*W-.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'.ie n \{\.    ds -- \(*W-.    ds PI pi.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch.    ds L" "".    ds R" "".    ds C` "".    ds C' ""'br\}.el\{\.    ds -- \|\(em\|.    ds PI \(*p.    ds L" ``.    ds R" '''br\}.\".\" Escape single quotes in literal strings from groff's Unicode transform..ie \n(.g .ds Aq \(aq.el       .ds Aq '.\".\" If the F register is turned on, we'll generate index entries on stderr for.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index.\" entries marked with X<> in POD.  Of course, you'll have to process the.\" output yourself in some meaningful fashion..ie \nF \{\.    de IX.    tm Index:\\$1\t\\n%\t"\\$2"...    nr % 0.    rr F.\}.el \{\.    de IX...\}.\".\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2)..\" Fear.  Run.  Save yourself.  No user-serviceable parts..    \" fudge factors for nroff and troff.if n \{\.    ds #H 0.    ds #V .8m.    ds #F .3m.    ds #[ \f1.    ds #] \fP.\}.if t \{\.    ds #H ((1u-(\\\\n(.fu%2u))*.13m).    ds #V .6m.    ds #F 0.    ds #[ \&.    ds #] \&.\}.    \" simple accents for nroff and troff.if n \{\.    ds ' \&.    ds ` \&.    ds ^ \&.    ds , \&.    ds ~ ~.    ds /.\}.if t \{\.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u".    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'.\}.    \" troff and (daisy-wheel) nroff accents.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'.ds 8 \h'\*(#H'\(*b\h'-\*(#H'.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#].ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#].ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#].ds ae a\h'-(\w'a'u*4/10)'e.ds Ae A\h'-(\w'A'u*4/10)'E.    \" corrections for vroff.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'.    \" for low resolution devices (crt and lpr).if \n(.H>23 .if \n(.V>19 \\{\.    ds : e.    ds 8 ss.    ds o a.    ds d- d\h'-1'\(ga.    ds D- D\h'-1'\(hy.    ds th \o'bp'.    ds Th \o'LP'.    ds ae ae.    ds Ae AE.\}.rm #[ #] #H #V #F C.\" ========================================================================.\".IX Title "mod_perl-2.0.2::docs::api::Apache2::Access 3".TH mod_perl-2.0.2::docs::api::Apache2::Access 3 "2005-10-21" "perl v5.10.0" "User Contributed Perl Documentation".\" For nroff, turn off justification.  Always turn off hyphenation; it makes.\" way too many mistakes in technical documents..if n .ad l.nh.SH "NAME"Apache2::Access \- A Perl API for Apache request object: Access,Authentication and Authorization..SH "Synopsis".IX Header "Synopsis".Vb 1\&  use Apache2::Access ();\&  \&  # allow only GET method\&  $r\->allow_methods(1, qw(GET));\&  \&  # Apache Options value\&  $options = $r\->allow_options();\&  \&  # Apache AllowOverride value\&  $allow_override = $r\->allow_overrides();\&  \&  # auth name ("foo bar")\&  $auth_name = $r\->auth_name();\&  \&  # auth type\&  $auth_type = $r\->auth_type();\&  $r\->auth_type("Digest");\&  \&  # Basic authentication process\&  my ($rc, $passwd) = $r\->get_basic_auth_pw();\&  \&  # the login name of the remote user (RFC1413)\&  $remote_logname = $r\->get_remote_logname();\&  \&  # dynamically figure out which auth has failed\&  $r\->note_auth_failure();\&  \&  # note Basic auth failure\&  $r\->note_basic_auth_failure();\&  \&  # note Digest auth failure\&  $r\->note_digest_auth_failure();\&  \&  # Apache Request value(s)\&  $requires = $r\->requires();\&  \&  # Apache Satisfy value (as a number)\&  $satisfy = $r\->satisfies();\&  \&  # check whether some auth is configured\&  $need_auth = $r\->some_auth_required();.Ve.SH "Description".IX Header "Description"The \s-1API\s0 provided by this module deals with access, authentication andauthorization phases..PP\&\f(CW\*(C`Apache2::Access\*(C'\fR extends\&\f(CW\*(C`Apache2::RequestRec\*(C'\fR..SH "API".IX Header "API"\&\f(CW\*(C`Apache2::Access\*(C'\fR provides the following functions and/or methods:.ie n .Sh """allow_methods""".el .Sh "\f(CWallow_methods\fP".IX Subsection "allow_methods"Specify which \s-1HTTP\s0 methods are allowed.PP.Vb 2\&  $r\->allow_methods($reset);\&  $r\->allow_methods($reset, @methods);.Ve.ie n .IP "obj: $r\fR ( \f(CW""Apache2::RequestRec object"" )" 4.el .IP "obj: \f(CW$r\fR ( \f(CWApache2::RequestRec object\fR )" 4.IX Item "obj: $r ( Apache2::RequestRec object )"The current request.ie n .IP "arg1: $reset ( boolean )" 4.el .IP "arg1: \f(CW$reset\fR ( boolean )" 4.IX Item "arg1: $reset ( boolean )"If a true value is passed all the previously allowed methods areremoved. Otherwise the list is left intact..ie n .IP "opt arg2: @methods ( array of strings )" 4.el .IP "opt arg2: \f(CW@methods\fR ( array of strings )" 4.IX Item "opt arg2: @methods ( array of strings )"a list of \s-1HTTP\s0 methods to be allowed (e.g. \f(CW\*(C`GET\*(C'\fR and \f(CW\*(C`POST\*(C'\fR).IP "ret: no return value" 4.IX Item "ret: no return value".PD 0.IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PD.PPFor example: here is how to allow only \f(CW\*(C`GET\*(C'\fR and \f(CW\*(C`POST\*(C'\fR methods,regardless to what was the previous setting:.PP.Vb 1\&  $r\->allow_methods(1, qw(GET POST));.Ve.ie n .Sh """allow_options""".el .Sh "\f(CWallow_options\fP".IX Subsection "allow_options"Retrieve the value of \f(CW\*(C`Options\*(C'\fR for this request.PP.Vb 1\&  $options = $r\->allow_options();.Ve.ie n .IP "obj: $r\fR ( \f(CW""Apache2::RequestRec object"" )" 4.el .IP "obj: \f(CW$r\fR ( \f(CWApache2::RequestRec object\fR )" 4.IX Item "obj: $r ( Apache2::RequestRec object )"The current request.ie n .IP "ret: $options ( integer )" 4.el .IP "ret: \f(CW$options\fR ( integer )" 4.IX Item "ret: $options ( integer )"the \f(CW\*(C`Options\*(C'\fR bitmask. Normally used with bitlogic operators against\&\f(CW\*(C`Apache2::Const :optionsconstants\*(C'\fR..IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PPFor example if the configuration for the current request was:.PP.Vb 2\&  Options None\&  Options Indexes FollowSymLinks.Ve.PPThe following applies:.PP.Vb 4\&  use Apache2::Const \-compile => qw(:options);\&  $r\->allow_options & Apache2::Const::OPT_INDEXES;   # TRUE\&  $r\->allow_options & Apache2::Const::OPT_SYM_LINKS; # TRUE\&  $r\->allow_options & Apache2::Const::OPT_EXECCGI;   # FALSE.Ve.ie n .Sh """allow_overrides""".el .Sh "\f(CWallow_overrides\fP".IX Subsection "allow_overrides"Retrieve the value of \f(CW\*(C`AllowOverride\*(C'\fR for this request.PP.Vb 1\&  $allow_override = $r\->allow_overrides();.Ve.ie n .IP "obj: $r\fR ( \f(CW""Apache2::RequestRec object"" )" 4.el .IP "obj: \f(CW$r\fR ( \f(CWApache2::RequestRec object\fR )" 4.IX Item "obj: $r ( Apache2::RequestRec object )"The current request.ie n .IP "ret: $allow_override ( integer )" 4.el .IP "ret: \f(CW$allow_override\fR ( integer )" 4.IX Item "ret: $allow_override ( integer )"the \f(CW\*(C`AllowOverride\*(C'\fR bitmask. Normally used with bitlogic operatorsagainst \f(CW\*(C`Apache2::Const :overrideconstants\*(C'\fR..IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PPFor example if the configuration for the current request was:.PP.Vb 1\&  AllowOverride AuthConfig.Ve.PPThe following applies:.PP.Vb 3\&  use Apache2::Const \-compile => qw(:override);\&  $r\->allow_overrides & Apache2::Const::OR_AUTHCFG; # TRUE\&  $r\->allow_overrides & Apache2::Const::OR_LIMIT; # FALSE.Ve.ie n .Sh """auth_name""".el .Sh "\f(CWauth_name\fP".IX Subsection "auth_name"Get/set the current Authorization realm (the per directoryconfiguration directive \f(CW\*(C`AuthName\*(C'\fR):.PP.Vb 2\&  $auth_name = $r\->auth_name();\&  $auth_name = $r\->auth_name($new_auth_name);.Ve.ie n .IP "obj: $r\fR ( \f(CW""Apache2::RequestRec object"" )" 4.el .IP "obj: \f(CW$r\fR ( \f(CWApache2::RequestRec object\fR )" 4.IX Item "obj: $r ( Apache2::RequestRec object )"The current request.ie n .IP "opt arg1: $new_auth_name ( string )" 4.el .IP "opt arg1: \f(CW$new_auth_name\fR ( string )" 4.IX Item "opt arg1: $new_auth_name ( string )"If \f(CW$new_auth_name\fR is passed a new \f(CW\*(C`AuthName\*(C'\fR value is set.ie n .IP "ret: ""$"" ( integer )" 4.el .IP "ret: \f(CW$\fR ( integer )" 4.IX Item "ret: $ ( integer )"The current value of \f(CW\*(C`AuthName\*(C'\fR.IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PPThe \f(CW\*(C`AuthName\*(C'\fR directive creates protection realm within the serverdocument space. To quote \s-1RFC\s0 1945 \*(L"These realms allow the protectedresources on a server to be partitioned into a set of protectionspaces, each with its own authentication scheme and/or authorizationdatabase.\*(R" The client uses the root \s-1URL\s0 of the server to determine

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?