send(sock, "Content-Length: 0\r\n", 19, 0);
send(sock, "\r\n", 2, 0);
} else if(res == MS_AUTH_FAIL) {
-
+ char* type;
+ uint64_t len;
+ char* data = NULL;
+ char* s;
+
+ struct stat st;
+ char* lastmod = NULL;
+ const char* pth = mandshurica_strcat(webroot, "/login-fail/");
+ if(stat(pth, &st) == 0) {
+ if(S_ISDIR(st.st_mode)) {
+ if(data == NULL) {
+ s = mandshurica_strcat(pth, "/index.html.tmpl");
+ data = config->mandshurica_load(s, &type, &lastmod, &len);
+ free(s);
+ }
+ if(data == NULL) {
+ s = mandshurica_strcat(pth, "/index.html");
+ data = config->mandshurica_load(s, &type, &lastmod, &len);
+ free(s);
+ }
+ } else {
+ data = config->mandshurica_load(pth, &type, &lastmod, &len);
+ }
+ }
send(sock, "HTTP/1.1 403 Forbidden\r\n", 15 + 9, 0);
send(sock, "Connection: keep-alive\r\n", 24, 0);
send(sock, "Content-Length: 0\r\n", 19, 0);
--- /dev/null
+<!--@chdir_webroot@
+vim: syntax=html
+-->
+@include head-start.html@
+<title>Mandshurica - Failed to login</title>
+@include body-start.html@
+<h1>Mandshurica - Failed to login</h1>
+@include bar.html@
+Failed to login, <a href="/login">retry</a>?
+@include end.html@