diff --git a/phpgwapi/inc/class.egw.inc.php b/phpgwapi/inc/class.egw.inc.php index c4e325caab..fe6995ef87 100644 --- a/phpgwapi/inc/class.egw.inc.php +++ b/phpgwapi/inc/class.egw.inc.php @@ -42,6 +42,13 @@ var $db; var $config_table = 'egw_config'; + /** + * tplsav2 savant2 templating object + * + * @var object + */ + var $tplsav2; + /** * Constructor: Instantiates the sub-classes * @@ -328,6 +335,8 @@ */ function check_app_rights() { + $this->tplsav2 = CreateObject('phpgwapi.tplsavant2'); + if ($GLOBALS['egw_info']['flags']['currentapp'] != 'about') { // This will need to use ACL in the future @@ -341,8 +350,9 @@ } error_log('Permission denied, attempted to access '.$GLOBALS['egw_info']['flags']['currentapp']); $this->log->write(array('text'=>'W-Permissions, Attempted to access %1','p1'=>$GLOBALS['egw_info']['flags']['currentapp'])); - - echo '

'.lang('Access not permitted').'
'; + $this->tplsav2->assign('currentapp',$GLOBALS['egw_info']['flags']['currentapp']); + $this->tplsav2->set_tpl_path($this->tplsav2->get_tpl_dir(false,'phpgwapi')); + $this->tplsav2->display('appl_access_not_permitted.tpl.php'); $this->common->egw_exit(True); } } diff --git a/phpgwapi/inc/class.tplsavant2.inc.php b/phpgwapi/inc/class.tplsavant2.inc.php index 78c0f03d50..840f558832 100755 --- a/phpgwapi/inc/class.tplsavant2.inc.php +++ b/phpgwapi/inc/class.tplsavant2.inc.php @@ -79,13 +79,14 @@ } } - - /*! - @function set_tpl_path - @abstract sets the preferred and fallback template search paths - @return void - */ - function set_tpl_path($man_dir=false) + /** + * set_tpl_path sets the preferred and fallback template search paths + * + * @param string $man_dir custom manual given template path in filesystem + * @access public + * @return void + */ + function set_tpl_path($man_dir=null) { $preferred_dir=$this->get_tpl_dir(); $fallback_dir=$this->get_tpl_dir(true); @@ -110,17 +111,17 @@ { $this->addPath('template',$man_dir); } - } - } - /*! - @function get_tpl_dir - @abstract get template dir of an application - @param $fallback if true the default fallback template dir is returned - @param $appname appication name optional can be derived from $GLOBALS['egw_info']['flags']['currentapp']; - */ + /** + * get_tpl_dir get template dir of an application + * + * @param bool $fallback if true the default fallback template dir is returned + * @param string $appname appication name optional can be derived from $GLOBALS['egw_info']['flags']['currentapp']; + * @access public + * @return void + */ function get_tpl_dir($fallback=false,$appname = '') { if (! $appname) diff --git a/phpgwapi/templatesSavant2/default/appl_access_not_permitted.tpl.php b/phpgwapi/templatesSavant2/default/appl_access_not_permitted.tpl.php new file mode 100644 index 0000000000..be17690786 --- /dev/null +++ b/phpgwapi/templatesSavant2/default/appl_access_not_permitted.tpl.php @@ -0,0 +1,6 @@ +
+
+

+ '.$this->currentapp.'')?> +
+