<?php use mystic\forum\orm\User; $userHandle = $_GET["handle"] ?? call_user_func(function() { http_response_code(400); msg_error(__("Missing handle")); exit; }); $user = new User(); $user->name = $userHandle; if (!$db->fetchWhere($user, "name")) { http_response_code(404); msg_error(__("No user with name @%user_handle%", [ "user_handle" => $userHandle ])); exit; } header("Location: ./?_action=viewuser&user=" . urlencode($user->id));