From: web Date: Fri, 8 Oct 2004 19:43:29 +0000 (+0000) Subject: initial commit (yann) X-Git-Tag: xorg/old~1407 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=e4185f5341d90f7a8cf39e1ebc3ce3b2525fabcc;p=platal.git initial commit (yann) --- diff --git a/scripts/carva/error.php b/scripts/carva/error.php new file mode 100644 index 0000000..c24f771 --- /dev/null +++ b/scripts/carva/error.php @@ -0,0 +1,13 @@ + + + + +404 Not Found + +

Not Found

+The requested URL was not found on this server.

+


+
Apache Server at www.carva.org Port 80
+ diff --git a/scripts/carva/redirect.php b/scripts/carva/redirect.php new file mode 100644 index 0000000..3d07587 --- /dev/null +++ b/scripts/carva/redirect.php @@ -0,0 +1,41 @@ +"; +var_dump($_SERVER); +echo "";*/ + +// on coupe la chaîne REQUEST_URI selon les / et on ne garde que +// le premier non vide et éventuellement le second +// la config d'apache impose la forme suivante pour REQUEST_URI : +// REQUEST_URI = /prenom.nom(/path/fichier.hmtl)? +list($username, $path) = preg_split('/\//', $_SERVER["REQUEST_URI"], 2, PREG_SPLIT_NO_EMPTY); + +$result = mysql_query("SELECT redirecturl FROM auth_user_md5 AS a INNER JOIN aliases AS al ON (al.id = a.user_id AND (al.type='a_vie' OR al.type='alias' OR al.type='epouse')) where al.alias= '$username'"); +if ($result and list($url) = mysql_fetch_row($result) and $url != '') { + // on envoie un redirect (PHP met automatiquement le code de retour 302 + if (!empty($path)) { + if (substr($url, -1, 1) == "/") + $url .= $path; + else + $url .= "/" . $path; + } + header("Location: http://$url"); + exit(); +} + +// si on est ici, il y a eu un erreur ou on n'a pas trouvé le redirect +header("HTTP/1.0 404 Not Found"); + +?> + + + +404 Not Found + +

Not Found

+The requested URL was not found on this server.

+


+
Apache Server at www.carva.org Port 80
+