Fixes a SQL query in modules/axletter/axletter.inc.php.
[platal.git] / modules / search.php
index 2ab0e37..f700672 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -24,11 +24,11 @@ class SearchModule extends PLModule
     function handlers()
     {
         return array(
-            'search'     => $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),
         );
     }
 
@@ -107,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));
@@ -167,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),