objtype == "user") return true; return $user->canAccess($obj); } /* * Respond to users' requests for dynamic files */ function main(string $dir, string $guid) : void { try { if (basename($guid) != $guid || $guid == "") return; if (!checkPermissions($guid, $dir == "heads")) return; switch ($dir) { case "heads": if (file_exists("dynmic/heads/" . $guid)) serveResource("dynmic/heads/" . $guid); else serveResource("static/img/null.jpg"); break; case "bgs": serveResource("dynmic/bgs/" . $guid); break; case "thumbs": serveResource("dynmic/thumbs/" . $guid); break; case "attach": $mesg = new mesg($guid); serveResource("dynmic/attach/" . $guid, $mesg->attachment); break; } } catch (Exception $e) { /* fail silently */ } } main($_REQUEST['d'], $_REQUEST['f']); ?>