public function index() { if (!Groups::check('site', Groups::getAuth('site', 'show_admin'))) { Router::redirect('home.index'); } $this->render('admin/home', 'home.admin.title'); }
private function checker($name, $ajax = false) { if (!Groups::check('site', Groups::getAuth('site', $name))) { if ($ajax) { echo "Vous n'avez pas les droits !"; } else { Router::redirect('home.index'); } } }
private function ajaxSub($id = 0) { if (!Groups::check('site', Groups::getAuth('site', 'update_full_admin'))) { return; } $group = Groups::findOrCreate('id', $id); $get = []; foreach (Groups::$authorization as $k => $v) { if (!isset($get[$k])) { $get[$k] = []; } $name = "auth_{$k}"; foreach ($v as $key => $value) { $get[$k][$key] = $this->isActive($k, $key, $group->{$name}); } $this->set($k, $get[$k]); } if ($group->id == 0) { $url = Router::url('admin:group.insert'); } else { $url = Router::url('admin:group.update', ['id' => $group->id]); } $this->set(['group' => $group, 'url' => $url]); $this->render('admin/groups_spec'); }