fileshare/include/templates.h

116 lines
3.9 KiB
C

/*
* vim: sw=2 ts=2 expandtab
*
* Copyright (c) 2013-2019 Thomas Kolb
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#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\" >" \
" <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.png\">" \
" </head>" \
" <body>"
#define FOOTER \
" <p><small>Generated by fileshare " VERSION ".</small></p>" \
" </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>" \
" <li>You are trying to upload a file, and uploads are not enabled for this server</li>" \
" </ul>" \
FOOTER
#define ERROR_401 \
HEADER1 \
" <title>Error 401 - Unauthorized</title>" \
HEADER2 \
" <h1>Error 401 - Unauthorized</h1>" \
" <p>You are not authorized to see the requested content.<p>" \
" <p>Enter the correct username and password!<p>" \
FOOTER
#endif // TEMPLATES_H