/app/app_controller.php
PHP | 18 lines | 10 code | 4 blank | 4 comment | 1 complexity | ad11c79129fb8000fdc57d27190369d4 MD5 | raw file
- <?php
-
- class AppController extends Controller {
-
-
- function check_users() {
- // get user data from session
- $user = $this->Session->read('User');
-
- // if empty
- if(empty($user)) {
- // set a flash message
- $this->Session->setFlash('ERROR: You must be logged to access the admin area.', 'flash_bad');
- // redirect user
- $this->redirect('index');
- }
- }
- }