aboutsummaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php52
1 files changed, 41 insertions, 11 deletions
diff --git a/functions.php b/functions.php
index efb173c..854489f 100644
--- a/functions.php
+++ b/functions.php
@@ -37,10 +37,12 @@ function failure($reason, $httpcode, $ajax = true, $heading = NULL){
}
function print_login($option = false){
-if(isset($_GET["goto"]) && $_GET["goto"] != "")
+if( isset($_GET["goto"]) && $_GET["goto"] != "" ) {
$goto = htmlentities($_GET["goto"]);
-else
+
+} else {
$goto = "index";
+}
global $user;
if ( $user->isLoggedIn() ){
@@ -110,11 +112,11 @@ else
function print_logout(){
global $user;
- $user->logout();
- /*
- global $c;
- $c->flush();
- */
+ if ( $user->isLoggedIn() ){
+ $user->logout();
+ header($_SERVER["SERVER_PROTOCOL"] . " 301 Moved");
+ header("Location: ".DOMAIN."/?page=logout");
+ }
print_login("logout");
}
@@ -191,8 +193,6 @@ function print_list($option = false){
?>
</tbody>
</table>
- <p>Downloade als <a href="/?page=action&task=download&type=plain">[plain text]</a> oder als <a href="/?page=action&task=download&type=csv">[csv]</a> Datei.</p>
- <br>
</div>
<form method="POST" action="/?page=add&_flush="<?php echo $c->token; ?>>
<button id="singlebutton" class="btn btn-info" type="submit">Füge jemanden hinzu</button>
@@ -333,9 +333,18 @@ function _add_entry(){
function print_404(){
header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');
?>
-<h1>404 - Not Found</h1>
+<!--h1 style="color:red;font-size:3.0em;">404 - Not Found</h1-->
+<h1>Error 404 - Not Found</h1>
+ <!--h4>The requested page (<?php echo htmlentities($_SERVER['REQUEST_URI']); ?>) wasn't found on this server.</h4-->
<br>
-<h4>The requested page (<?php echo htmlentities($_SERVER['REQUEST_URI']); ?>) wasn't found on this server.</h4>
+</div>
+<div class="row video">
+ <div class="embed-responsive embed-responsive-16by9">
+ <video class="embed-responsive-item" src="/static/error.webm" controls autoplay loop></video>
+ </div>
+ <br>
+ <p>Wir haben die Seite <strong>'<?php echo htmlentities($_SERVER['REQUEST_URI']); ?>'</strong> nicht gefunden!</p>
+ <a href="javascript:history.go(-1)" title="Index">Geh eins zurück!</a>
</div>
<?php
}
@@ -583,6 +592,27 @@ function print_recover($option = false){
<?php
}
+function print_download(){
+ if ( ! isset($_GET["type"]) || $_GET["type"] == "plain" )
+ $type = "plain";
+ else
+ $type = "csv";
+
+ lredirect("download;type=".$type);
+ header($_SERVER["SERVER_PROTOCOL"] . " 301 Moved");
+ header("Refresh: 2; ".DOMAIN."/?page=action&task=download&type=".$type);
+?>
+<h1>Download</h1>
+<h4>Der Download der Adressliste (vom Typ 'text/<?php echo $type; ?>') sollte automatisch starten.</h4>
+<hr>
+</div>
+<div class="row">
+<strong><p>Ansonsten klick hier</p></strong>
+<a href="/?page=action&task=download&type=<?php echo $type; ?>" class="btn btn-primary" title="Download Link"><span class="glyphicon glyphicon-arrow-down"></span> Download</a>
+</div>
+<?php
+}
+
function minify($buffer){
$search = array(
'/\>[^\S ]+/s', // strip whitespaces after tags, except space