<?php
// +-------------------------------------------------+
// 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: searcher_authorities_authpersos_query.class.php,v 1.4.4.1 2026/01/23 13:39:40 dgoron Exp $
if (stristr($_SERVER['REQUEST_URI'], ".class.php"))
    die("no access");

require_once ($class_path . '/searcher/searcher_autorities.class.php');

class searcher_authorities_authpersos_query extends searcher_authorities_authpersos
{

    protected $query = "";

    protected $searcher_mode = 'query';

    public function _get_search_type()
    {
        return parent::_get_search_type() . "query";
    }

    protected function _analyse()
    {}

    public function get_raw_query()
    {
        return $this->_get_search_query();
    }

    protected function _get_search_query()
    {
        $user_query = $this->_get_user_query();
        if ($user_query !== "*") {
            $query = str_replace('!!p!!', pmb_mysql_escape_string($user_query), $this->query);
            return $query;
        }
        return "select 0 as $this->object_table_key";
    }

    protected function _get_sign($sorted = false)
    {
        $sign = parent::_get_sign($sorted);
        $sign .= md5('&query=' . $this->query);
        return $sign;
    }
}