From d0060968b77c39bdf8abffb071c971c166b59edb Mon Sep 17 00:00:00 2001 From: Nicolas BERNSTEIN Date: Sat, 17 Sep 2011 16:48:29 +0200 Subject: First commit. --- lib/functions.php | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 lib/functions.php (limited to 'lib/functions.php') diff --git a/lib/functions.php b/lib/functions.php new file mode 100644 index 0000000..549ed3b --- /dev/null +++ b/lib/functions.php @@ -0,0 +1,52 @@ + $url . '-' . $_SESSION['token'], + "No" => $no_url); + require("tpl/general/choice.php"); + } +} + +function token_clear() { + global $url, $args; + if (isset($_SESSION['token']) && $_SESSION['token'] != $args[count($args) - 1]) unset($_SESSION['token']); +} + +function assert_redir($a, $u) { + if (!$a) { + header("Location: $u"); + die(); + } +} + +function assert_error($a, $e, $t = "") { + global $title; + if (!$a) { + if (!isset($title) or $t != "") { + $title = ($t == "" ? "Error" : "Error : $t"); + } + $error = $e; + require("tpl/general/empty.php"); + die(); + } +} -- cgit v1.2.3