I am new in cakephp.. I am making a website , there no users hierarchy , there is only the admin and public users. I want to disallow the public users from entering a certain static page. of course the page is located in view/pages , so its view/pages/adminPanel.ctp . please specify where I should include the code you will give. Thank you in advance
here's my display function
function __checkLayout($pageName)
{
//$pageName = "";
$temp = "";
switch ($pageName)
{
case "home":
$temp = "atheer";
break;
case "":
$temp = "atheer";
break;
case "adminpanel":
$temp = "adminview";
break;
}
return $temp;
}
public function display() {
$path = func_get_args();
//$this->layout='atheer';
//$this->layout = Configure::read('layout.'.$page);
$count = count($path);
if (!$count) {
return $this->redirect('/');
}
$page = $subpage = $title_for_layout = null;
if (!empty($path[0])) {
$page = $path[0];
}
if (!empty($path[1])) {
$subpage = $path[1];
}
if (!empty($path[$count - 1])) {
$title_for_layout = Inflector::humanize($path[$count - 1]);
}
$this->layout = $this->__checkLayout($page);
$this->set(compact('page', 'subpage', 'title_for_layout'));
try {
$this->render(implode('/', $path));
} catch (MissingViewException $e) {
if (Configure::read('debug')) {
throw $e;
}
throw new NotFoundException();
}
}