<?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 *
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),
);
}
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);
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)) {
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));
'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),