00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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