fileshare/templates.h
Thomas Kolb 6cd65091ff Initial commit
- Working version with the following features:
  - Directory listing and navigation
  - Download files
  - HTTP error pages (403, 404, 500)
  - Verbose logging
2013-01-17 21:13:15 +01:00

80 lines
2.3 KiB
C

#ifndef TEMPLATES_H
#define TEMPLATES_H
// generic definitions
#define HEADER1 \
"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\"" \
" \"http://www.w3.org/TR/html4/strict.dtd\">" \
"<html>" \
" <head>"
#define HEADER2 \
" <meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" >" \
" </head>" \
" <body>"
#define FOOTER \
" </body>" \
"</html>"
// error page definitions
#define ERROR_404 \
HEADER1 \
" <title>Error 404*i - File is imaginary</title>" \
HEADER2 \
" <h1>Error 404*i - File is imaginary</h1>" \
" <p>This page cannot be displayed because it is imaginary.<p>" \
" <p>To view this page in the real world, turn your screen by <sup>&pi;</sup>/<sub>2</sub> .</p>" \
" <pre>" \
" ^ Im\n" \
" |\n" \
" | +j\n" \
" __--+--__\n" \
" _- | -_\n" \
" / X \\\n" \
" | | |\n" \
"----+-------+-------+-----> Re\n" \
" -1 | | +1 |\n" \
" \\ | /\n" \
" --__ | __--\n" \
" --+-- \n" \
" | -j\n" \
" |\n" \
" </pre>" \
FOOTER
#define ERROR_500 \
HEADER1 \
" <title>Error 500 - Internal Server Error</title>" \
HEADER2 \
" <h1>Error 500 - Internal Server Error</h1>" \
" <pre>" \
" _______________________________________ \n" \
"/ Oops. Something went wrong. \\\n" \
"| Please contact the administrator and |\n" \
"\\ tell him how to reproduce this error. /\n" \
" --------------------------------------- \n" \
" \\ \\_______\n" \
" v__v \\ \\ O )\n" \
" (oo) ||----w |\n" \
" (__) || || \\/\\\n" \
" </pre>" \
FOOTER
#define ERROR_403 \
HEADER1 \
" <title>Error 403 - Forbidden</title>" \
HEADER2 \
" <h1>Error 403 - Forbidden</h1>" \
" <p>You are not allowed to access this file or directory.<p>" \
" <p>This error is shown under the following conditions:<p>" \
" <ul>" \
" <li>You are trying to access a file that the server isn't allowed to read</li>" \
" <li>The target filesystem entry is not a regular file or directory</li>" \
" <li>The URL contains \"/..\", which is blocked for security reasons</li>" \
" </ul>" \
FOOTER
#endif // TEMPLATES_H