diff options
Diffstat (limited to 'application/views')
-rw-r--r-- | application/views/errors/cli/error_404.php | 8 | ||||
-rw-r--r-- | application/views/errors/cli/error_db.php | 8 | ||||
-rw-r--r-- | application/views/errors/cli/error_exception.php | 21 | ||||
-rw-r--r-- | application/views/errors/cli/error_general.php | 8 | ||||
-rw-r--r-- | application/views/errors/cli/error_php.php | 21 | ||||
-rw-r--r-- | application/views/errors/cli/index.html | 11 | ||||
-rw-r--r-- | application/views/errors/html/error_404.php | 3 | ||||
-rw-r--r-- | application/views/errors/html/error_db.php | 3 | ||||
-rw-r--r-- | application/views/errors/html/error_exception.php | 32 | ||||
-rw-r--r-- | application/views/errors/html/error_general.php | 127 | ||||
-rw-r--r-- | application/views/errors/html/error_php.php | 33 | ||||
-rw-r--r-- | application/views/errors/html/index.html | 11 | ||||
-rw-r--r-- | application/views/errors/index.html | 11 | ||||
-rw-r--r-- | application/views/file/deleted.php | 2 | ||||
-rw-r--r-- | application/views/file/upload_form.php | 16 | ||||
-rw-r--r-- | application/views/index.html | 5 | ||||
-rw-r--r-- | application/views/user/invite.php | 6 | ||||
-rw-r--r-- | application/views/user/register.php | 1 |
18 files changed, 319 insertions, 8 deletions
diff --git a/application/views/errors/cli/error_404.php b/application/views/errors/cli/error_404.php new file mode 100644 index 000000000..6984b61e9 --- /dev/null +++ b/application/views/errors/cli/error_404.php @@ -0,0 +1,8 @@ +<?php +defined('BASEPATH') OR exit('No direct script access allowed'); + +echo "\nERROR: ", + $heading, + "\n\n", + $message, + "\n\n";
\ No newline at end of file diff --git a/application/views/errors/cli/error_db.php b/application/views/errors/cli/error_db.php new file mode 100644 index 000000000..2ff43ffc7 --- /dev/null +++ b/application/views/errors/cli/error_db.php @@ -0,0 +1,8 @@ +<?php +defined('BASEPATH') OR exit('No direct script access allowed'); + +echo "\nDatabase error: ", + $heading, + "\n\n", + $message, + "\n\n";
\ No newline at end of file diff --git a/application/views/errors/cli/error_exception.php b/application/views/errors/cli/error_exception.php new file mode 100644 index 000000000..efa6a66d1 --- /dev/null +++ b/application/views/errors/cli/error_exception.php @@ -0,0 +1,21 @@ +<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?> + +An uncaught Exception was encountered + +Type: <?php echo get_class($exception), "\n"; ?> +Message: <?php echo $message, "\n"; ?> +Filename: <?php echo $exception->getFile(), "\n"; ?> +Line Number: <?php echo $exception->getLine(); ?> + +<?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?> + +Backtrace: +<?php foreach ($exception->getTrace() as $error): ?> +<?php if (isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0): ?> + File: <?php echo $error['file'], "\n"; ?> + Line: <?php echo $error['line'], "\n"; ?> + Function: <?php echo $error['function'], "\n\n"; ?> +<?php endif ?> +<?php endforeach ?> + +<?php endif ?> diff --git a/application/views/errors/cli/error_general.php b/application/views/errors/cli/error_general.php new file mode 100644 index 000000000..6984b61e9 --- /dev/null +++ b/application/views/errors/cli/error_general.php @@ -0,0 +1,8 @@ +<?php +defined('BASEPATH') OR exit('No direct script access allowed'); + +echo "\nERROR: ", + $heading, + "\n\n", + $message, + "\n\n";
\ No newline at end of file diff --git a/application/views/errors/cli/error_php.php b/application/views/errors/cli/error_php.php new file mode 100644 index 000000000..8a24b6491 --- /dev/null +++ b/application/views/errors/cli/error_php.php @@ -0,0 +1,21 @@ +<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?> + +A PHP Error was encountered + +Severity: <?php echo $severity, "\n"; ?> +Message: <?php echo $message, "\n"; ?> +Filename: <?php echo $filepath, "\n"; ?> +Line Number: <?php echo $line; ?> + +<?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?> + +Backtrace: +<?php foreach (debug_backtrace() as $error): ?> +<?php if (isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0): ?> + File: <?php echo $error['file'], "\n"; ?> + Line: <?php echo $error['line'], "\n"; ?> + Function: <?php echo $error['function'], "\n\n"; ?> +<?php endif ?> +<?php endforeach ?> + +<?php endif ?> diff --git a/application/views/errors/cli/index.html b/application/views/errors/cli/index.html new file mode 100644 index 000000000..bcb7cae34 --- /dev/null +++ b/application/views/errors/cli/index.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <title>403 Forbidden</title> +</head> +<body> + +<p>Directory access is forbidden.</p> + +</body> +</html> diff --git a/application/views/errors/html/error_404.php b/application/views/errors/html/error_404.php new file mode 100644 index 000000000..b71da106d --- /dev/null +++ b/application/views/errors/html/error_404.php @@ -0,0 +1,3 @@ +<?php +$title = "404 Page Not Found"; +include VIEWPATH."errors/html/error_general.php"; diff --git a/application/views/errors/html/error_db.php b/application/views/errors/html/error_db.php new file mode 100644 index 000000000..adff63559 --- /dev/null +++ b/application/views/errors/html/error_db.php @@ -0,0 +1,3 @@ +<?php +$title = "Database Error"; +include VIEWPATH."errors/html/error_general.php"; diff --git a/application/views/errors/html/error_exception.php b/application/views/errors/html/error_exception.php new file mode 100644 index 000000000..befa12955 --- /dev/null +++ b/application/views/errors/html/error_exception.php @@ -0,0 +1,32 @@ +<?php +defined('BASEPATH') OR exit('No direct script access allowed'); +?> + +<div style="border:1px solid #dd4814;padding-left:20px;margin:10px 0;"> + + <h4>An uncaught Exception was encountered</h4> + + <p>Type: <?php echo get_class($exception); ?></p> + <p>Message: <?php echo $message; ?></p> + <p>Filename: <?php echo $exception->getFile(); ?></p> + <p>Line Number: <?php echo $exception->getLine(); ?></p> + + <?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?> + + <p>Backtrace:</p> + <?php foreach ($exception->getTrace() as $error): ?> + + <?php if (isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0): ?> + + <p style="margin-left:10px"> + File: <?php echo $error['file']; ?><br /> + Line: <?php echo $error['line']; ?><br /> + Function: <?php echo $error['function']; ?> + </p> + <?php endif ?> + + <?php endforeach ?> + + <?php endif ?> + +</div> diff --git a/application/views/errors/html/error_general.php b/application/views/errors/html/error_general.php new file mode 100644 index 000000000..637a1fd35 --- /dev/null +++ b/application/views/errors/html/error_general.php @@ -0,0 +1,127 @@ +<?php +defined('BASEPATH') OR exit('No direct script access allowed'); + +// fancy error page only works if we can load helpers +if (class_exists("CI_Controller") && !isset($GLOBALS["is_error_page"]) && isset(get_instance()->load)) { + if (!isset($title)) { + $title = "Error"; + } + $GLOBALS["is_error_page"] = true; + + $CI =& get_instance(); + $CI->load->helper("filebin"); + $CI->load->helper("url"); + + if (is_cli()) { + $message = str_replace("</p>", "</p>\n", $message); + $message = strip_tags($message); + echo "$heading: $message\n"; + exit(); + } + + include APPPATH.'views/header.php'; + + ?> + <div class="error"> + <h1><?php echo $heading; ?></h1> + <?php echo $message; ?> + </div> + + <?php + include APPPATH.'views/footer.php'; +} elseif (php_sapi_name() === 'cli' OR defined('STDIN')) { + echo "# $heading\n"; + $msg = strip_tags(str_replace("<br>", "\n", $message)); + foreach (explode("\n", $msg) as $line) { + echo "# $line\n"; + } + exit(255); +} else { + // default CI error page +?><!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title>Error</title> + <style type="text/css"> + + ::selection { background-color: #f07746; color: #fff; } + ::-moz-selection { background-color: #f07746; color: #fff; } + + body { + background-color: #fff; + margin: 40px auto; + max-width: 1024px; + font: 16px/24px normal "Helvetica Neue", Helvetica, Arial, sans-serif; + color: #808080; + } + + a { + color: #dd4814; + background-color: transparent; + font-weight: normal; + text-decoration: none; + } + + a:hover { + color: #97310e; + } + + h1 { + color: #fff; + background-color: #dd4814; + border-bottom: 1px solid #d0d0d0; + font-size: 22px; + font-weight: bold; + margin: 0 0 14px 0; + padding: 5px 15px; + line-height: 40px; + } + + h2 { + color:#404040; + margin:0; + padding:0 0 10px 0; + } + + code { + font-family: Consolas, Monaco, Courier New, Courier, monospace; + font-size: 13px; + background-color: #f5f5f5; + border: 1px solid #e3e3e3; + border-radius: 4px; + color: #002166; + display: block; + margin: 14px 0 14px 0; + padding: 12px 10px 12px 10px; + } + + #container { + margin: 10px; + border: 1px solid #d0d0d0; + box-shadow: 0 0 8px #d0d0d0; + border-radius: 4px; + } + + p { + margin: 0 0 10px; + padding:0; + } + + #body { + margin: 0 15px 0 15px; + min-height: 96px; + } + </style> +</head> +<body> + <div id="container"> + <h1><?php echo $heading; ?></h1> + <div id="body"> + <?php echo $message; ?> + </div> + </div> +</body> +</html> +<?php +} diff --git a/application/views/errors/html/error_php.php b/application/views/errors/html/error_php.php new file mode 100644 index 000000000..8b445ef39 --- /dev/null +++ b/application/views/errors/html/error_php.php @@ -0,0 +1,33 @@ +<?php +defined('BASEPATH') OR exit('No direct script access allowed'); +?> + +<div style="border:1px solid #dd4814;padding-left:20px;margin:10px 0;"> + + <h4>A PHP Error was encountered</h4> + + <p>Severity: <?php echo $severity; ?></p> + <p>Message: <?php echo $message; ?></p> + <p>Filename: <?php echo $filepath; ?></p> + <p>Line Number: <?php echo $line; ?></p> + + <?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?> + + <p>Backtrace:</p> + <?php foreach (debug_backtrace() as $error): ?> + + <?php if (isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0): ?> + + <p style="margin-left:10px"> + File: <?php echo $error['file'] ?><br /> + Line: <?php echo $error['line'] ?><br /> + Function: <?php echo $error['function'] ?> + </p> + + <?php endif ?> + + <?php endforeach ?> + + <?php endif ?> + +</div> diff --git a/application/views/errors/html/index.html b/application/views/errors/html/index.html new file mode 100644 index 000000000..bcb7cae34 --- /dev/null +++ b/application/views/errors/html/index.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <title>403 Forbidden</title> +</head> +<body> + +<p>Directory access is forbidden.</p> + +</body> +</html> diff --git a/application/views/errors/index.html b/application/views/errors/index.html new file mode 100644 index 000000000..bcb7cae34 --- /dev/null +++ b/application/views/errors/index.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <title>403 Forbidden</title> +</head> +<body> + +<p>Directory access is forbidden.</p> + +</body> +</html> diff --git a/application/views/file/deleted.php b/application/views/file/deleted.php index 8a5818f2d..741824e58 100644 --- a/application/views/file/deleted.php +++ b/application/views/file/deleted.php @@ -2,7 +2,7 @@ <?php if (!empty($errors)) { echo "<p>"; foreach ($errors as $error) { - echo "${error["id"]}: ${error["reason"]}<br>\n"; + echo "{$error["id"]}: {$error["reason"]}<br>\n"; } echo "</p>"; } ?> diff --git a/application/views/file/upload_form.php b/application/views/file/upload_form.php index b7d6fbabd..a466e6640 100644 --- a/application/views/file/upload_form.php +++ b/application/views/file/upload_form.php @@ -14,7 +14,7 @@ <div class="tab-pane active" id="text-upload-tab-1"> <div class="panel panel-default"> <div class="panel-heading"> - <input type="text" name="filename[1]" class="form-control" placeholder="Filename/title (default: stdin)"> + <input type="text" name="filename[1]" class="form-control" placeholder="Filename/title (default: stdin)" value="<?php if (isset($textarea_filename)) { echo htmlspecialchars($textarea_filename); } ?>"> </div> <textarea name="content[1]" class="form-control text-upload" placeholder="Paste content"><?php if (isset($textarea_content)) { @@ -53,7 +53,7 @@ <p><button type="submit" id="upload_button" class="btn btn-primary">Upload/Paste it!</button></p> <p> Uploads/pastes are <?php if ($upload_max_age > 0) { - echo "deleted after ".$upload_max_age." days"; + echo "deleted after ".expiration_duration($upload_max_age); if ($small_upload_size > 0) { echo " unless they are smaller than ".format_bytes($small_upload_size); } @@ -119,7 +119,7 @@ <h3>Special filenames:</h3> <dl class="dl-horizontal"> - <dt>*.asciinema.json</dt><dd>treat the file as an <a href="https://asciinema.org/">asciinema screencast</a> and display a videoplayer for it</dd> + <dt>*.asciinema.json<br>or *.cast</dt><dd>treat the file as an <a href="https://asciinema.org/">asciinema screencast</a> and display a videoplayer for it</dd> </dl> </div> @@ -155,14 +155,20 @@ <p> Arch Linux: <code>pacman -S fb-client</code><br /> - Gentoo: Add <a href="https://git.holgersson.xyz/holgersson-overlay/tree/README">this overlay</a> and run <code>emerge -a fb-client</code><br /> + Gentoo: Add <a href="https://git.holgersson.xyz/foss/holgersson-overlay/src/branch/master/README.rst">this overlay</a> and run <code>emerge -a fb-client</code><br /> FreeBSD: <code>pkg install fb</code><br /> + OpenSUSE: <a href="https://build.opensuse.org/package/show/home:mwilhelmy/fb-client">home:mwilhelmy / fb-client</a> </p> <h4>Android</h4> <p> + Development: <a href="https://git.myservermanager.com/varakh/fbmobile">v4rakh/fbmobile @ git.myservermanager.com</a><br> + Google Play: <a href="https://play.google.com/store/apps/details?id=de.varakh.fbmobile">FileBin @ Google Play</a><br> + </p> + + <p> + Unmaintained Legacy Client:<br> Development: <a href="https://github.com/sebastianrakel/fb-client-android">sebastianrakel/fb-client-android @ Github</a><br> - Google Playstore: <a href="https://play.google.com/store/apps/details?id=eu.devunit.fb_client">fb-client Android @ Google Play</a><br> F-Droid Store: <a href="https://f-droid.org/repository/browse/?fdid=eu.devunit.fb_client">fb-client Android @ F-Droid</a><br> </p> </div> diff --git a/application/views/index.html b/application/views/index.html index c942a79ce..bcb7cae34 100644 --- a/application/views/index.html +++ b/application/views/index.html @@ -1,4 +1,5 @@ -<html> +<!DOCTYPE html> +<html lang="en"> <head> <title>403 Forbidden</title> </head> @@ -7,4 +8,4 @@ <p>Directory access is forbidden.</p> </body> -</html>
\ No newline at end of file +</html> diff --git a/application/views/user/invite.php b/application/views/user/invite.php index d3e2fb7a6..042ba0b61 100644 --- a/application/views/user/invite.php +++ b/application/views/user/invite.php @@ -26,6 +26,12 @@ <td><?php echo $i++; ?></td> <td><?php echo anchor("user/register/".$item["key"], $item["key"]) ?></td> <td><?php echo date("Y/m/d H:i", $item["date"]) ?></td> + <td> + <?php echo form_open('user/delete_invitation_key'); ?> + <input class="btn btn-danger btn-xs" type="submit" value="Delete" name="delete" /> + <input type="hidden" name="key" value="<?php echo $item["key"]; ?>" /> + </form> + </td> </tr> <?php endforeach; ?> </tbody> diff --git a/application/views/user/register.php b/application/views/user/register.php index af4558ff9..0f03a2f00 100644 --- a/application/views/user/register.php +++ b/application/views/user/register.php @@ -9,6 +9,7 @@ <label class="control-label col-lg-2 col-md-2" for="inputUsername">Username</label> <div class="col-lg-5 col-md-5"> <input type="text" id="inputUsername" name="username" placeholder="Username" value="<?php echo $values["username"]; ?>" class="form-control"> + <span class="help-block">The username may contain up to 32 chars of a-z0-9 (only lowercase characters).</span> </div> </div> </div> |