summaryrefslogtreecommitdiff
path: root/src/webserver/generate.cpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2012-08-30 16:16:25 -0700
committerBen Longbons <b.r.longbons@gmail.com>2012-08-30 17:03:31 -0700
commit41974ae5265fbc23a06f276f9e008d5dad020e0b (patch)
tree9d595215172e87e2d83b74f7bf3430b3040e780e /src/webserver/generate.cpp
parent21742909143df9159b2401c3e2a39cc0b2bad620 (diff)
downloadtmwa-41974ae5265fbc23a06f276f9e008d5dad020e0b.tar.gz
tmwa-41974ae5265fbc23a06f276f9e008d5dad020e0b.tar.bz2
tmwa-41974ae5265fbc23a06f276f9e008d5dad020e0b.tar.xz
tmwa-41974ae5265fbc23a06f276f9e008d5dad020e0b.zip
Rename files for C++ conversion. Does not compile.
After updating, you can remove these files, as shown in 'git status': Untracked files: (use "git add <file>..." to include in what will be committed) src/map/magic-interpreter-lexer.c src/map/magic-interpreter-parser.c src/map/magic-interpreter-parser.h
Diffstat (limited to 'src/webserver/generate.cpp')
-rw-r--r--src/webserver/generate.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/webserver/generate.cpp b/src/webserver/generate.cpp
new file mode 100644
index 0000000..1fed224
--- /dev/null
+++ b/src/webserver/generate.cpp
@@ -0,0 +1,35 @@
+
+void generate_page (char password[25], int sock_in, char *query, char *ip)
+{
+ char *page = get_param (query, 0);
+ char *ppass = get_param (query, "password");
+
+ if ((ppass == 0) || (strcmp (password, ppass) != 0))
+ {
+ web_send (sock_in, html_header ("Enter your password"));
+ web_send (sock_in,
+ "<H1>NOT LOGGED IN!</H1><form action=\"/\" method=\"GET\">\n");
+ web_send (sock_in,
+ "Enter your password:<br>\n<input type=\"text\" name=\"password\">\n");
+ web_send (sock_in, "<input type=\"submit\" value=\"Login\">\n");
+ }
+ else
+ {
+
+ //To make this simple, we will have a bunch of if statements
+ //that then shoot out data off into functions.
+
+ //The 'index'
+ if (strcmp (page, "/") == 0)
+ generate_notdone (sock_in, query, ip);
+
+ //About page:
+ if (strcmp (page, "/about.html") == 0)
+ generate_about (sock_in, query, ip);
+
+ //Test page:
+ if (strcmp (page, "/testing/") == 0)
+ generate_sample (sock_in, query, ip);
+
+ }
+}