- More information why people have no access to app. Users often think they did not log in

- Replace html with error msg in code with savant template
This commit is contained in:
Pim Snel 2007-03-29 21:01:11 +00:00
parent 84737d0d70
commit e464fc3304
3 changed files with 34 additions and 17 deletions

View File

@ -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 '<p><center><b>'.lang('Access not permitted').'</b></center>';
$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);
}
}

View File

@ -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)

View File

@ -0,0 +1,6 @@
<div align="center">
<div style="line-height:160%;text-align:center;padding-top:20px;padding-bottom:100px;width:400px;">
<h2><?=lang('Access not permitted')?></h2>
<?=lang('You\'ve tried to open the eGroupWare application: %1, but you have no permission to access this application.', '<i>'.$this->currentapp.'</i>')?>
</div>
</div>