Roxen.git
/
server
/
etc
/
modules
/
Roxen.pmod
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/etc/modules/Roxen.pmod:1:
// This is a roxen pike module. Copyright © 1999 - 2004, Roxen IS. //
-
// $Id: Roxen.pmod,v 1.
192
2005/
10
/
27
17
:
40
:
25
grubba
Exp $
+
// $Id: Roxen.pmod,v 1.
193
2005/
12
/
13
15
:
45
:
53
anders
Exp $
#include <roxen.h> #include <config.h> #include <version.h> #include <module.h> #include <variables.h> #include <stat.h> #define roxen roxenp() #ifdef HTTP_DEBUG
Roxen.git/server/etc/modules/Roxen.pmod:806:
message = "<h1>Authentication failed.\n</h1>"; HTTP_WERR(sprintf("Auth required (%O)", challenge)); string digest_challenge = ""; foreach(challenge; string key; string val) { digest_challenge += sprintf(" %s=%O", key, val); } return http_low_answer(401, message) + ([ "extra_heads":([ "WWW-Authenticate":"Digest "+digest_challenge,]),]); }
-
mapping http_auth_required(string realm, string|void message)
+
mapping http_auth_required(string realm, string|void message
,
+
void|RequestID id
)
//! Generates a result mapping that will instruct the web browser that //! the user needs to authorize himself before being allowed access. //! `realm' is the name of the realm on the server, which will //! typically end up in the browser's prompt for a name and password //! (e g "Enter username for <i>realm</i> at <i>hostname</i>:"). The //! optional message is the message body that the client typically //! shows the user, should he decide not to authenticate himself, but //! rather refraim from trying to authenticate himself. //! //! In HTTP terms, this sends a <tt>401 Auth Required</tt> response //! with the header <tt>WWW-Authenticate: basic realm="`realm'"</tt>. //! For more info, see RFC 2617. {
-
+
HTTP_WERR("Auth required ("+realm+")");
+
if (id) {
+
return id->conf->auth_failed_file( id, message )
+
+ ([ "extra_heads":([ "WWW-Authenticate":"basic realm=\""+realm+"\"",]),]);
+
}
if(!message) message = "<h1>Authentication failed.</h1>";
-
HTTP_WERR("Auth required ("+realm+")");
+
return http_low_answer(401, message) + ([ "extra_heads":([ "WWW-Authenticate":"basic realm=\""+realm+"\"",]),]); } mapping http_proxy_auth_required(string realm, void|string message) //! Generates a result mapping that will instruct the client end that //! it needs to authenticate itself before being allowed access. //! `realm' is the name of the realm on the server, which will //! typically end up in the browser's prompt for a name and password //! (e g "Enter username for <i>realm</i> at <i>hostname</i>:"). The