-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathengine.php
executable file
·51 lines (46 loc) · 2.02 KB
/
engine.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
require_once 'init.php';
class TApplication extends AdiantiCoreApplication
{
static public function run($debug = FALSE)
{
new TSession;
if ($_REQUEST)
{
$ini = AdiantiApplicationConfig::get();
$class = isset($_REQUEST['class']) ? $_REQUEST['class'] : '';
$public = in_array($class, $ini['permission']['public_classes']);
if (TSession::getValue('logged')) // logged
{
$programs = (array) TSession::getValue('programs'); // programs with permission
$programs = array_merge($programs, array('Adianti\Base\TStandardSeek' => TRUE,
'LoginForm' => TRUE,
'AdiantiMultiSearchService' => TRUE,
'AdiantiUploaderService' => TRUE,
'AdiantiAutocompleteService' => TRUE,
'EmptyPage' => TRUE,
'MessageList' => TRUE,
'SystemDocumentUploaderService' => TRUE,
'NotificationList' => TRUE,
'SearchBox' => TRUE));
if( isset($programs[$class]) OR $public )
{
parent::run($debug);
}
else
{
new TMessage('error', _t('Permission denied') );
}
}
else if ($class == 'LoginForm' OR $public )
{
parent::run($debug);
}
else
{
new TMessage('error', _t('Permission denied'), new TAction(array('LoginForm','onLogout')) );
}
}
}
}
TApplication::run(TRUE);