small fixes from previous
[platal.git] / scripts / listes_redirect.php
CommitLineData
0337d704 1<?php
2preg_match("/^\/(moderate|admin|members)\/(.*)_([^_]*)$/", $_SERVER["REQUEST_URI"], $matches);
3if (empty($matches)) {
4 exit();
5} else {
6 $action = $matches[1];
7 $mbox = $matches[2];
8 $fqdn = strtolower($matches[3]);
9 if ($fqdn == 'polytechnique.org') {
bc4ad6aa 10 header("Location: https://www.polytechnique.org/lists/$action/$mbox");
0337d704 11 } else {
12 require("../include/xorg.inc.php");
08cce2ff 13 $res = XDB::query("select diminutif from groupex.asso where mail_domain = {?}", $fqdn);
0337d704 14 if ($gpx = $res->fetchOneCell()) {
bc4ad6aa 15 header("Location: http://www.polytechnique.net/$gpx/lists/$action/$mbox");
0337d704 16 }
17 }
18}
19?>