Imanol Posted August 21, 2016 Report Share Posted August 21, 2016 Hi everyone, I am having issues with the tpl files pages_nopermission and pages_notfound. When pilots go to a wrong links in my website, they're redirected to the nopermission pagen instead of the notfound one. I have checked the Pages.php file and it seems to be correct. Do you know how I can solve it?. Thanks. <?php /** * phpVMS - Virtual Airline Administration Software * Copyright (c) 2008 Nabeel Shahzad * For more information, visit www.phpvms.net * Forums: http://www.phpvms.net/forum * Documentation: http://www.phpvms.net/docs * * phpVMS is licenced under the following license: * Creative Commons Attribution Non-commercial Share Alike (by-nc-sa) * View license.txt in the root, or visit http://creativecommons.org/licenses/by-nc-sa/3.0/ * * @author Nabeel Shahzad * @copyright Copyright (c) 2008, Nabeel Shahzad * @link http://www.phpvms.net * @license http://creativecommons.org/licenses/by-nc-sa/3.0/ */ class Pages extends CodonModule { public function NavBar() { $this->set('allpages', SiteData::getAllPages(true, Auth::$loggedin)); $this->render('pages_items.tpl'); } public function __call($name, $args) { // $name here is the filename, but we don't call it in directly // for security reasons $page = DB::escape($name); $pageinfo = SiteData::GetPageDataByName($page); if($pageinfo->public == 0 && Auth::LoggedIn() == false) { $this->render('pages_nopermission.tpl'); return; } $content = SiteData::GetPageContent($page); if(!$content) { $this->render('pages_notfound.tpl'); } else { // Do it this way, so then that this page/template // can be customized on a skin-by-skin basis $this->title = $content->pagename; $this->set('pagename', $content->pagename); # Do entity encoding, compensate for a html_entity_decode() in the templates $this->set('content', htmlentities($content->content)); $this->render('pages_content.tpl'); } } } Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted August 23, 2016 Moderators Report Share Posted August 23, 2016 Can you please give it a try maybe? Check this: if($pageinfo->public == 0 && Auth::LoggedIn() == false) with this: if(isset($pageinfo) && $pageinfo->public == 0 && Auth::LoggedIn() == false) Quote Link to comment Share on other sites More sharing options...
Imanol Posted September 4, 2016 Author Report Share Posted September 4, 2016 It works perfectely, thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.