function authUser($name, $password) { $password = md5($password); $user = User::sql("SELECT * FROM :table WHERE name = '{$name}' AND password = '******'", SimpleOrm::FETCH_ONE); if ($user) { setAuthUser($user->id); return true; } return false; }
public function search() { RoutingEngine::setPage("runnDAILY", "PV__300"); if (!isset($_POST["u_search"]) || $_POST["u_search"] == "") { echo "<p>Please enter a search term.</p>"; exit; } //$user_list = User::searchForUser($_POST["u_search"]); $user = $_POST["u_search"]; $user_list = User::sql()->select("u_uid, u_username")->where("u_username LIKE ? OR u_email LIKE ?", "%" . $user . "%", "%" . $user . "%")->limit(40)->execute(false, true); RoutingEngine::getSmarty()->assign("user_list", $user_list); $output = RoutingEngine::getSmarty()->fetch("community/_user_search_result.tpl"); echo $output; exit; }