91a9562004-05-14Marcus Wellhardh // This is a roxen module. Copyright © 2004, Roxen IS. // #include <module.h> inherit "module";
d592af2004-05-14Marcus Wellhardh constant cvs_version = "$Id: kerberos.pike,v 1.2 2004/05/14 13:55:03 wellhard Exp $";
91a9562004-05-14Marcus Wellhardh constant thread_safe = 1; constant module_type = MODULE_TAG; constant module_name = "Tags: Support for kerberos authentication"; constant module_doc = ("Adds a couple of tags to enable simple kerberos " "authentication."); constant module_unique = 1;
d592af2004-05-14Marcus Wellhardh #if constant(Kerberos.Context)
91a9562004-05-14Marcus Wellhardh Kerberos.Context ctx = Kerberos.Context(); class TagIfKerberosAuth { inherit RXML.Tag; constant name = "if"; constant plugin_name = "kerberos-auth"; int eval(string user, RequestID id, mapping args) { if(!args->password) RXML.parse_error("No password attribute specified.\n"); NOCACHE(); return ctx->authenticate(user, args->password); } }
d592af2004-05-14Marcus Wellhardh #lese /* !constant(Kerberos.Context) */ constant dont_dump_program = 1; string status() { return "<font color='&usr.warncolor;'>Kerberos not available in this roxen.</font>"; } #endif /* constant(Kerberos.Context) */
91a9562004-05-14Marcus Wellhardh TAGDOCUMENTATION; #ifdef manual constant tagdoc=([ "if#kerberos-auth;":#"<desc type='plugin'><p><short> Returns true if the kerberos authentication is sucessful. The username is provided in the plugin attribute. Example:</p> <ex-box> <if kerberos-auth=\"username\" password=\"password\"> <p>The user is authenticated.</p> </if> </ex-box> </desc> <attr name='password' value='string' required='required'><p> Specifies the password.</p> </attr>", ]); #endif