307 | | Also the difference in the code is that we check if admin only can access this page. The '''$GLOBALS['logged']['admin']''' variable is set to true if admin is logged in. Additionally, you can check if regular members are logged in by using the '''$GLOBALS['logged']['member']''' variable. If none of these values are true, then a guest is accessing your page. The '''displayAccessDenied''' function displays a page with an "access denied" message - in this case, we don't need to care much about that, and we can just return from the function or even exit. The '''$GLOBALS['logged']''' does not always exist, and is initialized in the '''check_logged''' function. In our case this function is called in the '''bloggie/request.php''' file. |
| 307 | Also the difference in the code is that we check if admin only can access this page. The !'''$GLOBALS['logged']['admin']''' variable is set to true if admin is logged in. Additionally, you can check if regular members are logged in by using the '''$GLOBALS['logged']['member']''' variable. If none of these values are true, then a guest is accessing your page. The '''displayAccessDenied''' function displays a page with an "access denied" message - in this case, we don't need to care much about that, and we can just return from the function or even exit. The '''$GLOBALS['logged']''' does not always exist, and is initialized in the '''check_logged''' function. In our case this function is called in the '''bloggie/request.php''' file. |