fprintf(f, "# Generated by Mandshurica " MANDSHURICA_VERSION "\n");
fprintf(f, "ServerRoot %s\n", PREFIX);
fprintf(f, "\n");
- fprintf(f, "Set BasicDB %s/passwd.db\n", PREFIX);
+ fprintf(f, "Set CookieDB %s/passwd.db\n", PREFIX);
fprintf(f, "Set HTTPPort 1024\n");
fprintf(f, "Set HTTPRoot %s\n", WEBROOT_PREFIX);
fprintf(f, "\n");
fprintf(f, "Set HTTPMIME.html text/html\n");
fprintf(f, "Set HTTPMIME.gif image/gif\n");
fprintf(f, "\n");
- fprintf(f, "LoadModule %s/basic.so\n", MODULE_PREFIX);
+ fprintf(f, "LoadModule %s/cookie.so\n", MODULE_PREFIX);
fprintf(f, "LoadModule %s/http.so\n", MODULE_PREFIX);
fprintf(f, "LoadModule %s/subversion.so\n", MODULE_PREFIX);
fprintf(f, "LoadModule %s/syslog.so\n", MODULE_PREFIX);
EXTRA_LIBS += -ldl
endif
-all: ./subversion.so ./syslog.so ./http.so ./basic.so
+all: ./subversion.so ./syslog.so ./http.so ./cookie.so
./%.so: ./%.o ./util.o
$(CC) $(LDFLAGS) $(EXTRA_LDFLAGS) -o $@ $^ $(LIBS) $(EXTRA_LIBS)
const char mod_type[] = MS_MOD_AUTH;
-const char mod_auth_type[] = "Basic";
+const char mod_auth_type[] = "Cookie";
struct mandshurica_config* config;
int mod_init(struct mandshurica_config* _config) {
config = _config;
- config->mandshurica_log(MS_INFO, "Basic authentication Module init");
+ config->mandshurica_log(MS_INFO, "Cookie authentication Module init");
- char* db = config->mandshurica_get_param("BasicDB");
+ char* db = config->mandshurica_get_param("CookieDB");
if(db == NULL) {
- config->mandshurica_log(MS_ERROR, "Basic authentication Database path is not set!");
+ config->mandshurica_log(MS_ERROR, "Cookie authentication Database path is not set!");
return 1;
}
- char* log = mandshurica_strcat("Basic authentication Database is ", db);
+ char* log = mandshurica_strcat("Cookie authentication Database is ", db);
config->mandshurica_log(MS_INFO, log);
free(log);
}
config->mandshurica_log(MS_INFO, log);
free(log);
- free(auth);
if(auth[0] == 0) {
config->mandshurica_log(MS_ERROR, "Authentication module was not loaded!");
+ free(auth);
return 1;
}
+ free(auth);
return 0;
}
<body>
<img src="/mandshurica.gif">
<h1>Mandshurica</h1>
+ <hr>
</body>
</html>