-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathengine.php
executable file
·39 lines (35 loc) · 1.28 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
<?php
require_once 'init.php';
class TApplication extends AdiantiCoreApplication
{
static public function run($debug = FALSE)
{
new TSession;
if ($_REQUEST)
{
$class = isset($_REQUEST['class']) ? $_REQUEST['class'] : '';
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, 'EmptyPage' => TRUE, 'MessageList'=>TRUE, 'SearchBox' => TRUE)); // default programs
if( isset($programs[$class]) )
{
parent::run($debug);
}
else
{
new TMessage('error', _t('Permission denied') );
}
}
else if ($class == 'LoginForm')
{
parent::run($debug);
}
else
{
new TMessage('error', _t('Permission denied'), new TAction(array('LoginForm','onLogout')) );
}
}
}
}
TApplication::run(TRUE);