From: x2003bruneau Date: Mon, 13 Nov 2006 22:57:55 +0000 (+0000) Subject: Close #540: Profile of unregistered users redirects to the public marketing page X-Git-Tag: xorg/0.9.12~121 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=924b4ba7e1a769eaadd34f899f91028babba7a40;p=platal.git Close #540: Profile of unregistered users redirects to the public marketing page git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1076 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/ChangeLog b/ChangeLog index d3206c3..fe549cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -46,6 +46,7 @@ Bug/Wish: - #451: vCard are RFC compliant -FRU - #502: Use 'alias' instead of 'aka' to specify the nickname -FRU - #536: Can use login.promo as a valid user identifier -FRU + - #540: Profile of unregistered user redirects to marketing -FRU * Xnet: - #511: Migrate ML subscription when changing email of a non-X -FRU diff --git a/modules/profile.php b/modules/profile.php index e676872..fdaa2a7 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -186,6 +186,18 @@ class ProfileModule extends PLModule } if (empty($login)) { + if (preg_match('/([-a-z]+)\.([-a-z]+)\.([0-9]{4})/i', $x, $matches)) { + $matches = str_replace('-', '_', $matches); + $res = XDB::query("SELECT user_id + FROM auth_user_md5 + WHERE prenom LIKE {?} AND nom LIKE {?} AND promo = {?} + AND perms = 'pending'", + $matches[1], $matches[2], $matches[3]); + if ($res->numRows() == 1) { + $uid = $res->fetchOneCell(); + pl_redirect('marketing/public/' . $uid); + } + } return PL_NOT_FOUND; }