Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

flt_httpauth.c

Go to the documentation of this file.
00001 
00008 /* {{{ Initial comments */
00009 /*
00010  * $LastChangedDate: 2004-04-01 18:34:17 +0200 (Thu, 01 Apr 2004) $
00011  * $LastChangedRevision: 50 $
00012  * $LastChangedBy: ckruse $
00013  *
00014  */
00015 /* }}} */
00016 
00017 /* {{{ Includes */
00018 #include "config.h"
00019 #include "defines.h"
00020 
00021 #include <stdio.h>
00022 #include <stdlib.h>
00023 #include <string.h>
00024 #include <ctype.h>
00025 #include <time.h>
00026 #include <sys/types.h>
00027 
00028 #include "readline.h"
00029 #include "hashlib.h"
00030 #include "utils.h"
00031 #include "configparser.h"
00032 #include "cfcgi.h"
00033 #include "template.h"
00034 #include "clientlib.h"
00035 /* }}} */
00036 
00037 
00038 int flt_httpauth_run(t_cf_hash *head,t_configuration *dc,t_configuration *vc) {
00039   t_name_value *v = cfg_get_value(dc,"AuthMode");
00040   u_char *name,*path;
00041 
00042   if(!v || !v->values[0] || cf_strcmp(v->values[0],"http") != 0) {
00043     return FLT_DECLINE;
00044   }
00045 
00046   name = getenv("REMOTE_USER");
00047   if(name) {
00048     path = get_uconf_name(name);
00049 
00050     if(path) {
00051       free(path);
00052       cf_hash_set(GlobalValues,"UserName",8,name,strlen(name)+1);
00053     }
00054   }
00055 
00056   return FLT_OK;
00057 }
00058 
00059 
00060 t_conf_opt flt_httpauth_config[] = {
00061   { NULL, NULL, NULL }
00062 };
00063 
00064 t_handler_config flt_httpauth_handlers[] = {
00065   { AUTH_HANDLER, flt_httpauth_run },
00066   { 0, NULL }
00067 };
00068 
00069 t_module_config flt_httpauth = {
00070   flt_httpauth_config,
00071   flt_httpauth_handlers,
00072   NULL,
00073   NULL,
00074   NULL,
00075   NULL
00076 };
00077 
00078 
00079 /* eof */

Generated on Sun Apr 25 16:37:38 2004 for Classic Forum by doxygen 1.3.5