public function before() { parent::before(); if (!$this->is_logged) { die(json_encode(['status' => 'error', 'message' => 'Login please'], JSON_UNESCAPED_UNICODE)); } $this->is_admin = $this->current_user['role_id'] == AuthModule::UR_ADMIN; }
public function before() { parent::before(); /* $this->is_logged = Auth::check(); $this->current_user = null; if ($this->is_logged) { $this->current_user = Auth::get_profile_fields(); $this->current_user['id'] = Auth::get('id'); $this->current_user['username'] = Auth::get('username'); }*/ if (!$this->is_logged) { die(json_encode(['status' => 'error', 'message' => 'Login please'], JSON_UNESCAPED_UNICODE)); } $this->is_admin = $this->current_user['role_id'] == AuthModule::UR_ADMIN; }