* 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");
+ }
+}
+?>
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
-<html><head>
-<title>404 Not Found</title>
-</head><body>
-<h1>Not Found</h1>
-The requested URL <?php echo $_SERVER['REQUEST_URI'] ?> was not found on this server.<p>
-<hr>
-<address>Apache Server at www.carva.org Port 80</address>
-</body></html>
+<html>
+ <head>
+ <title>404 Not Found</title>
+ </head>
+ <body>
+ <h1>Not Found</h1>
+ The requested URL <?php echo $_SERVER['REQUEST_URI'] ?> was not found on this server.<p>
+ <hr>
+ <address>Apache Server at www.carva.org Port 80</address>
+ </body>
+</html>
* 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
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");
?>
-
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
-<html><head>
-<title>404 Not Found</title>
-</head><body>
-<h1>Not Found</h1>
-The requested URL <?php echo $_SERVER['REQUEST_URI'] ?> was not found on this server.<p>
-<hr>
-<address>Apache Server at www.carva.org Port 80</address>
-</body></html>
+<html>
+ <head>
+ <title>404 Not Found</title>
+ </head>
+ <body>
+ <h1>Not Found</h1>
+ The requested URL <?php echo $_SERVER['REQUEST_URI'] ?> was not found on this server.<p>
+ <hr>
+ <address>Apache Server at www.carva.org Port 80</address>
+ </body>
+</html>
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');
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')) {
+++ /dev/null
-<?php
-preg_match("/^\/(moderate|admin|members)\/(.*)_([^_]*)$/", $_SERVER["REQUEST_URI"], $matches);
-if (empty($matches)) {
- exit();
-} else {
- $action = $matches[1];
- $mbox = $matches[2];
- $fqdn = strtolower($matches[3]);
- if ($fqdn == 'polytechnique.org') {
- header("Location: https://www.polytechnique.org/lists/$action/$mbox");
- } else {
- require("../include/xorg.inc.php");
- $res = XDB::query("select diminutif from groupex.asso where mail_domain = {?}", $fqdn);
- if ($gpx = $res->fetchOneCell()) {
- header("Location: http://www.polytechnique.net/$gpx/lists/$action/$mbox");
- }
- }
-}
-?>