* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. */ /** * Class of type SearchType used for searches with QuickSearch * (lib/classes/QuickSearch.php). You can search for people with a given * Stud.IP permission level, either globally or at an institute. * * @author Thomas Hackl * */ class PermissionSearch extends SQLSearch { private $search; private $presets; /** * * @param string $query: SQL with at least ":input" as parameter * @param array $presets: variables from the same form that should be used * in this search. array("input_name" => "placeholder_in_sql_query") * @return void */ public function __construct($search, $title = "", $avatarLike = "user_id", $presets = []) { $this->search = $search; $this->presets = $presets; $this->title = $title; $this->avatarLike = in_array($avatarLike, words('user_id, username')) ? $avatarLike : 'user_id'; } /** * returns the results of a search * Use the contextual_data variable to send more variables than just the input * to the SQL. QuickSearch for example sends all other variables of the same *