aboutsummaryrefslogtreecommitdiff
path: root/www/functions/notused/func_rewrite.php
diff options
context:
space:
mode:
authorroot2014-04-14 08:35:13 +0200
committerroot2014-04-14 08:35:13 +0200
commit12734da8826299ffd24c0a15f6dbf205892d7221 (patch)
tree3b894dd30e332df23a564ce44e42ce164c8abd78 /www/functions/notused/func_rewrite.php
parent7b9d516cd3bcdb8eaa5f1eb533d71010061c681b (diff)
downloadjungegemeinde-12734da8826299ffd24c0a15f6dbf205892d7221.tar.gz
Pushed to v3
Diffstat (limited to 'www/functions/notused/func_rewrite.php')
-rwxr-xr-xwww/functions/notused/func_rewrite.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/www/functions/notused/func_rewrite.php b/www/functions/notused/func_rewrite.php
new file mode 100755
index 0000000..0a123d6
--- /dev/null
+++ b/www/functions/notused/func_rewrite.php
@@ -0,0 +1,30 @@
+<?php
+function rewrite($db){
+
+ /* test if first argument a username or folder */
+
+ $name = user_id($db, $_GET["name"]);
+
+ if($name == ""){
+
+ /* if first argument wasn't valid, rewrite the URL to include the username */
+
+ $folder = $_GET["folder"];
+
+ if(preg_match("/\/$/", $_GET["folder"])){
+ $folder = substr($_GET["folder"], 0, -1);
+ }
+
+ if($_SESSION["login"]){
+ $scheme = $GLOBALS["scheme"];
+ header("Refresh: 0; ".$scheme.$_SERVER["HTTP_HOST"]."/" . $_SESSION['username'] . "/" . $_GET["name"] . "/" . $folder . "");
+ exit;
+ }
+
+ return false;
+
+ } else {
+ return true;
+ }
+}
+