X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fsearch.php;h=2912a492357c17f1fd05ab49ee0c16289403006b;hb=0bc0dd468b3fe81e296f0b711ea7020d18d19764;hp=4bbbfc035cc6e4997978911c99900a99f0464b11;hpb=a1cec8694f46c786d38564105711d78abc39c187;p=platal.git diff --git a/modules/search.php b/modules/search.php index 4bbbfc0..2912a49 100644 --- a/modules/search.php +++ b/modules/search.php @@ -1,6 +1,6 @@ $this->make_hook('quick', AUTH_PUBLIC), - 'search/adv' => $this->make_hook('advanced', AUTH_COOKIE), + 'search' => $this->make_hook('quick', AUTH_PUBLIC), + 'search/adv' => $this->make_hook('advanced', AUTH_COOKIE), 'advanced_search.php' => $this->make_hook('redir_advanced', AUTH_PUBLIC), - 'search/autocomplete' => $this->make_hook('autocomplete', AUTH_COOKIE, 'user', NO_AUTH), - 'search/list' => $this->make_hook('list', AUTH_COOKIE, 'user', NO_AUTH), + 'search/autocomplete' => $this->make_hook('autocomplete', AUTH_COOKIE, 'user', NO_AUTH), + 'search/list' => $this->make_hook('list', AUTH_COOKIE, 'user', NO_AUTH), ); } @@ -38,13 +38,6 @@ class SearchModule extends PLModule exit; } - function on_subscribe($forlife, $uid, $promo, $pass) - { - require_once 'user.func.inc.php'; - user_reindex($uid); - } - - function form_prepare() { Platal::page()->assign('formulaire',1); @@ -90,7 +83,7 @@ class SearchModule extends PLModule S::logger()->log('search', 'quick=' . $quick); } $list = 'profile|prf|fiche|fic|referent|ref|mentor'; - if (S::has_perms()) { + if (S::admin()) { $list .= '|admin|adm|ax'; } if (preg_match('/^(' . $list . '):([-a-z]+(\.[-a-z]+(\.\d{2,4})?)?)$/', replace_accent($quick), $matches)) { @@ -114,8 +107,8 @@ class SearchModule extends PLModule if ($user) { pl_redirect($base . $user->login()); } - $_REQUEST['quick'] = $forlife; - $_GET['quick'] = $forlife; + $_REQUEST['quick'] = $login; + $_GET['quick'] = $login; } elseif (strpos($quick, 'doc:') === 0) { $url = 'Docs/Recherche?'; $url .= 'action=search&q=' . urlencode(substr($quick, 4)); @@ -151,7 +144,7 @@ class SearchModule extends PLModule $page->addJsLink('ajax.js'); } - require_once dirname(__FILE__) . '/search/search.inc.php'; + $this->load('search.inc.php'); $page->changeTpl('search/index.tpl'); $page->setTitle('Annuaire'); } @@ -160,7 +153,7 @@ class SearchModule extends PLModule { global $globals; require_once 'geoloc.inc.php'; - require_once dirname(__FILE__) . '/search/search.inc.php'; + $this->load('search.inc.php'); $page->assign('advanced',1); $page->addJsLink('jquery.autocomplete.js'); @@ -174,7 +167,7 @@ class SearchModule extends PLModule 'nationalite' => array('field' => 'a2', 'table' => 'geoloc_pays', 'text' => 'nat', 'exact' => 'false'), 'binet' => array('field' => 'id', 'table' => 'binets_def', 'text' => 'text', 'exact' => false), 'groupex' => array('field' => 'id', 'table' => 'groupex.asso', - 'text' => "(a.cat = 'GroupesX' OR a.cat = 'Institutions') AND pub = 'public' AND nom", + 'text' => "(cat = 'GroupesX' OR cat = 'Institutions') AND pub = 'public' AND nom", 'exact' => false), 'section' => array('field' => 'id', 'table' => 'sections', 'text' => 'text', 'exact' => false), 'school' => array('field' => 'id', 'table' => 'applis_def', 'text' => 'text', 'exact' => false),