From e9e9306b81a5493276c9e817cdcd083a1add72e7 Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Wed, 2 Aug 2006 21:15:37 +0000 Subject: [PATCH] merge things from scripts into htdocs. the apache conf will change, this is already ready (non commited) on djali git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@778 839d8a87-29fc-0310-9880-83ba4fa771e5 --- .../listes_redirect.php | 40 ++++++++++++++++------ {scripts => htdocs}/webredirect.php | 30 +++++++--------- htdocs/xnet.php | 2 +- htdocs/xorg.php | 2 +- scripts/listes_redirect.php | 19 ---------- 5 files changed, 45 insertions(+), 48 deletions(-) rename scripts/webredirect_error.php => htdocs/listes_redirect.php (63%) rename {scripts => htdocs}/webredirect.php (77%) delete mode 100644 scripts/listes_redirect.php diff --git a/scripts/webredirect_error.php b/htdocs/listes_redirect.php similarity index 63% rename from scripts/webredirect_error.php rename to htdocs/listes_redirect.php index a467718..35d72f1 100644 --- a/scripts/webredirect_error.php +++ b/htdocs/listes_redirect.php @@ -19,15 +19,35 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -header("HTTP/1.0 404 Not Found"); -?> +require_once dirname(__FILE__).'/../include/xorg.inc.php'; + +preg_match('/^\/(moderate|admin|members)\/(.*)_([^_]*)$/', $_SERVER['REQUEST_URI'], $matches); + +if ($matches) { + $action = $matches[1]; + $mbox = $matches[2]; + $fqdn = strtolower($matches[3]); + + if ($fqdn == 'polytechnique.org') { + http_redirect("https://www.polytechnique.org/lists/$action/$mbox"); + } + + $res = XDB::query("select diminutif from groupex.asso where mail_domain = {?}", $fqdn); + if ($gpx = $res->fetchOneCell()) { + http_redirect("http://www.polytechnique.net/$gpx/lists/$action/$mbox"); + } +} +?> - -404 Not Found - -

Not Found

-The requested URL was not found on this server.

-


-
Apache Server at www.carva.org Port 80
- + + + 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/webredirect.php b/htdocs/webredirect.php similarity index 77% rename from scripts/webredirect.php rename to htdocs/webredirect.php index f834e07..95c478e 100644 --- a/scripts/webredirect.php +++ b/htdocs/webredirect.php @@ -19,12 +19,8 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -require("../include/xorg.inc.php"); +require_once dirname(__FILE__).'/../include/xorg.inc.php'; -// 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); $res = XDB::query( "SELECT redirecturl @@ -34,25 +30,25 @@ $res = XDB::query( if ($url = $res->fetchOneCell()) { $url = preg_replace('@/+$@', '', $url); - if($path) { + if ($path) { http_redirect("http://$url/$path"); } else { http_redirect("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
- + + + 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/htdocs/xnet.php b/htdocs/xnet.php index 0b06746..bb96044 100644 --- a/htdocs/xnet.php +++ b/htdocs/xnet.php @@ -26,7 +26,7 @@ require_once dirname(__FILE__).'/../classes/Xnet.php'; require_once dirname(__FILE__).'/../classes/PLModule.php'; require_once dirname(__FILE__).'/../classes/CoreLogger.php'; -require 'xnet.inc.php'; +require_once dirname(__FILE__).'/../include/xnet.inc.php'; if (!($path = Env::v('n')) || substr($path, 0, 4) != 'Xnet') { $platal = new Xnet('xnet', 'xnetgrp', 'xnetlists', 'xnetevents', 'geoloc'); diff --git a/htdocs/xorg.php b/htdocs/xorg.php index 077faba..08dcbb0 100644 --- a/htdocs/xorg.php +++ b/htdocs/xorg.php @@ -26,7 +26,7 @@ require_once dirname(__FILE__).'/../classes/Platal.php'; require_once dirname(__FILE__).'/../classes/PLModule.php'; require_once dirname(__FILE__).'/../classes/CoreLogger.php'; -require_once 'xorg.inc.php'; +require_once dirname(__FILE__).'/../include/xorg.inc.php'; if (!($path = Env::v('n')) || ($path{0} < 'A' || $path{0} > 'Z')) { diff --git a/scripts/listes_redirect.php b/scripts/listes_redirect.php deleted file mode 100644 index 450b451..0000000 --- a/scripts/listes_redirect.php +++ /dev/null @@ -1,19 +0,0 @@ -fetchOneCell()) { - header("Location: http://www.polytechnique.net/$gpx/lists/$action/$mbox"); - } - } -} -?> -- 2.1.4