X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fsearch.php;h=9f26a73fd9d4f218b94a4d904d3e84324cbcde42;hb=b40deec06338bd63a5b4d6b9ead0166506ce049d;hp=e7a2a9d7750d5439611c240f32377763239c99c9;hpb=0d2ceeffea379e48bb64373855d35ea9f42b96d8;p=platal.git diff --git a/modules/search.php b/modules/search.php index e7a2a9d..9f26a73 100644 --- a/modules/search.php +++ b/modules/search.php @@ -88,6 +88,35 @@ class SearchModule extends PLModule $page->assign('promo_max', $max); if (Env::has('quick') || $action == 'geoloc') { + $quick = trim(Env::v('quick')); + $list = 'profile|prf|fiche|fic|referent|ref|mentor'; + if (S::has_perms()) { + $list .= '|admin|adm|ax'; + } + if (preg_match('/^(' . $list . '):([-a-z]+(\.[-a-z]+(\.\d{2,4})?)?)$/', $quick, $matches)) { + $forlife = $matches[2]; + switch($matches[1]) { + case 'admin': case 'adm': + $base = 'admin/user/'; + break; + case 'ax': + $base = 'profile/ax/'; + break; + case 'profile': case 'prf': case 'fiche': case 'fic': + $base = 'profile/'; + break; + case 'referent': case 'ref': case 'mentor': + $base = 'referent/'; + break; + } + pl_redirect($base . $forlife); + } elseif (strpos($quick, 'doc:') === 0) { + $url = 'Docs/Recherche?'; + $url .= 'action=search&q=' . urlencode(substr($quick, 4)); + $url .= '&group=' . urlencode('-Equipe,-Main,-PmWiki,-Site'); + pl_redirect($url); + } + $page->assign('formulaire', 0); require_once 'userset.inc.php';