Proposal: func_tiki_p_denied()
Inspecting various Tiki base PHP scripts, I found that many have similar logic which eventually determine whether page access is permitted. The code for denying page access should be consisent. Assuming that it is, it can still be annoying to do multi-file search and replace, if it is ever needed.
For instance, IMO, if Anonymous access is not permitted to a particular page, rather than being shown the message 'Permission denied you cannot view this page,' the person should be redirected to a Log In page.
I propose incorporating a global function 'func_tiki_p_denied()':
<?php function func_tiki_p_denied() { // Insufficient permissions to view if (isset($user)) {// If logged in, deny page access $smarty->assign('msg',tra('Permission denied you cannot view this page')); } else {// If not logged in, redirect to log in $smarty->assign('msg',$smarty->fetch('modules/mod-login_box.tpl')); $smarty->assign('errortitle',tra("Please login")); } $smarty->display("error.tpl"); die; } ?>
-Tagg