Go to the documentation of this file.00001 <?php
00010 class security_public extends security_abstract {
00011
00012 public function isLogged() {
00013 return false;
00014 }
00015
00016 public function login($prm = null, $page = null) {
00017 $this->hook('login');
00018 return false;
00019 }
00020
00021 public function logout($prm = null) {
00022 $this->hook('logout');
00023 return true;
00024 }
00025
00026 public function addRole($role) {
00027 return false;
00028 }
00029
00030 public function hasRole($role=null) {
00031 return false;
00032 }
00033
00034 public function delRole($role=null) {
00035 return true;
00036 }
00037
00038 public function check(array $url = null, $redirect=true) {
00039 if (is_null($url))
00040 $url = request::get();
00041
00042 $hasRight = !$this->isContained($url, $this->cfg->spec);
00043
00044 if (!$hasRight && $redirect) {
00045 $request = request::removeLangOutUrl('/'.request::get('request'));
00046 if ($request != $this->getPage('forbidden') && $request != $this->getPage('login')) {
00047 session::setFlash('nyroError', 'Don\'t have the permission to access to this page.');
00048 response::getInstance()->redirect($this->getPage('forbidden', true), 403);
00049 }
00050 }
00051
00052 return $hasRight;
00053 }
00054
00055 public function getLoginForm(array $prm = array()) {
00056 return null;
00057 }
00058
00059 }