mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
- 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:
parent
84737d0d70
commit
e464fc3304
@ -42,6 +42,13 @@
|
|||||||
var $db;
|
var $db;
|
||||||
var $config_table = 'egw_config';
|
var $config_table = 'egw_config';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* tplsav2 savant2 templating object
|
||||||
|
*
|
||||||
|
* @var object
|
||||||
|
*/
|
||||||
|
var $tplsav2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor: Instantiates the sub-classes
|
* Constructor: Instantiates the sub-classes
|
||||||
*
|
*
|
||||||
@ -328,6 +335,8 @@
|
|||||||
*/
|
*/
|
||||||
function check_app_rights()
|
function check_app_rights()
|
||||||
{
|
{
|
||||||
|
$this->tplsav2 = CreateObject('phpgwapi.tplsavant2');
|
||||||
|
|
||||||
if ($GLOBALS['egw_info']['flags']['currentapp'] != 'about')
|
if ($GLOBALS['egw_info']['flags']['currentapp'] != 'about')
|
||||||
{
|
{
|
||||||
// This will need to use ACL in the future
|
// 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']);
|
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']));
|
$this->log->write(array('text'=>'W-Permissions, Attempted to access %1','p1'=>$GLOBALS['egw_info']['flags']['currentapp']));
|
||||||
|
$this->tplsav2->assign('currentapp',$GLOBALS['egw_info']['flags']['currentapp']);
|
||||||
echo '<p><center><b>'.lang('Access not permitted').'</b></center>';
|
$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);
|
$this->common->egw_exit(True);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,13 +79,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/*!
|
* set_tpl_path sets the preferred and fallback template search paths
|
||||||
@function set_tpl_path
|
*
|
||||||
@abstract sets the preferred and fallback template search paths
|
* @param string $man_dir custom manual given template path in filesystem
|
||||||
@return void
|
* @access public
|
||||||
*/
|
* @return void
|
||||||
function set_tpl_path($man_dir=false)
|
*/
|
||||||
|
function set_tpl_path($man_dir=null)
|
||||||
{
|
{
|
||||||
$preferred_dir=$this->get_tpl_dir();
|
$preferred_dir=$this->get_tpl_dir();
|
||||||
$fallback_dir=$this->get_tpl_dir(true);
|
$fallback_dir=$this->get_tpl_dir(true);
|
||||||
@ -110,17 +111,17 @@
|
|||||||
{
|
{
|
||||||
$this->addPath('template',$man_dir);
|
$this->addPath('template',$man_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
@function get_tpl_dir
|
* get_tpl_dir get template dir of an application
|
||||||
@abstract get template dir of an application
|
*
|
||||||
@param $fallback if true the default fallback template dir is returned
|
* @param bool $fallback if true the default fallback template dir is returned
|
||||||
@param $appname appication name optional can be derived from $GLOBALS['egw_info']['flags']['currentapp'];
|
* @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 = '')
|
function get_tpl_dir($fallback=false,$appname = '')
|
||||||
{
|
{
|
||||||
if (! $appname)
|
if (! $appname)
|
||||||
|
@ -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>
|
Loading…
Reference in New Issue
Block a user