rathena/src/webserver/generate.c
Valaris 2178a86317 AS OF SVN REV. 5901, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.  EVERYTHING ELSE
GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5094 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-01-29 16:10:48 +00:00

39 lines
1003 B
C

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);
}
}