From 1fe76ba743a3418da9a0883b29756d442384d0bc Mon Sep 17 00:00:00 2001 From: Horus3 Date: Thu, 25 Sep 2014 10:33:47 +0200 Subject: init --- functions.php | 578 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 578 insertions(+) create mode 100644 functions.php (limited to 'functions.php') diff --git a/functions.php b/functions.php new file mode 100644 index 0000000..3e937d2 --- /dev/null +++ b/functions.php @@ -0,0 +1,578 @@ +isLoggedIn() != 1){ + redirect("login&goto=".$goto); + } +} + +function redirect($goto){ + header($_SERVER["SERVER_PROTOCOL"] . " 302 Moved"); + header("Location: /?page=".$goto); + ob_clean(); + exit; +} +function failure($reason, $httpcode, $ajax = true, $heading = NULL){ + + # send header with $httpcode + header($_SERVER['SERVER_PROTOCOL'] . " " . $httpcode); + + # just echo the reason to the ajax response + if($ajax){ + echo $reason; + exit; + } + + // TODO: Put pretty HTML here, please + + # print full error page + if($heading != NULL) + echo $heading; + + echo $reason; + + # exit the script here + exit; +} + +function print_login($option = false){ +if(isset($_GET["goto"]) && $_GET["goto"] != "") + $goto = htmlentities($_GET["goto"]); +else + $goto = "index"; + + global $user; + if ( $user->isLoggedIn() ){ + redirect("index"); + } +?> +
+Mit * markierte Felder sind Pflichtfelder.
+ + +logout(); + print_login("logout"); +} + +function print_index(){ +?> +
+ Wir sind die Junge Gemeinde in Adlershof.
+Wir treffen uns immer Donnerstags um 19:30 Uhr in der Remise Arndtstraße 12a.
+Am besten sind wir über unsere Aktiviere JavaScript um die E-Mail Adresse zu sehen! erreichbar.
+Mit * markierte Felder sind Pflichtfelder.
+ + + +Mit * markierte Felder sind Pflichtfelder.
+ + + + + +[^\S ]+/s', // strip whitespaces after tags, except space + '/[^\S ]+\', + '<', + '\\1' + ); + + $buffer = preg_replace($search, $replace, $buffer); + + return $buffer; +} -- cgit v1.2.3