MrPowerGamerBR Maybe I'm wrong, but shouldn't trying to open the admin panel while logged out display a error message instead of showing a "PrettyPageHandler"?
Franz MrPowerGamerBR I'm pretty sure that's because of debug mode being enabled. What happens if you disable it in config.php? That said, it's probably valid to show the "pretty" error pages for cases like these even in debug mode.
MrPowerGamerBR Franz Yeah, I think you already seen what error happens if the debug is disabled. (because you liked the other post) I think a more "useful" error should be shown if debug is disabled, instead of showing "500 Internal Server Error" (I don't know... "You don't have permission to view the admin panel"?)
Franz MrPowerGamerBR Yep. In fact, we already do so for 404 errors. Can you send a pull request changing the logic in this file to always show pretty errors for 403 errors, too?
MrPowerGamerBR Franz while I know a bit of PHP,I don't know what do to in that file, sorry 🙁 (Unless you are saying to change if ($this->debug && $errorCode !== 404) { to if ($this->debug && ($errorCode !== 404 || $errorCode !== 403)) {, that was my first idea when you said that) EDIT: ...or add the 403.html page in the getErrorPage.
Franz Hmm, interesting, apparently that's not quite enough. We still need the error page template and we need to adapt the exception class accordingly. In that case, please open an issue, I can take care of it. P.S.: But yes, you were on the right path. 🙂
MrPowerGamerBR Franz Made a issue on flarum/core https://github.com/flarum/core/issues/719 Yeah, I was a bit confused on what to edit, because, if I set the 403 to not be handled by the PrettyPrintHandler, then it only would show the default error (Also, does the 404 error would be something... different? When a page 404 is shown on my forum it shows the same style for the 500 internal server error, but shows "404 Not Found")