-
Notifications
You must be signed in to change notification settings - Fork 0
/
ajax.php
75 lines (54 loc) · 1.67 KB
/
ajax.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
include 'conf/env_router.php';
$conf = Conf::getActive();
/*
if($conf->preview_sec){
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="Preview Mode"');
header('HTTP/1.0 401 Unauthorized');
echo 'Zugriff nur mit Passwort';
exit;
} else {
if (!isset($conf->preview_sec[$_SERVER['PHP_AUTH_USER']])) {
header('WWW-Authenticate: Basic realm="Preview Mode"');
header('HTTP/1.0 401 Unauthorized');
echo 'Zugriff nur mit Passwort';
exit;
}
if ( $conf->preview_sec[$_SERVER['PHP_AUTH_USER']] !== $_SERVER['PHP_AUTH_PW'] ){
header('WWW-Authenticate: Basic realm="Preview Mode"');
header('HTTP/1.0 401 Unauthorized');
echo 'Zugriff nur mit Passwort';
exit;
}
}
}
*/
$page = $request->param( 'page', Validator::FOLDERNAME );
$request->ajax = true;
if (isset($conf->routes[$page])) {
$request->service = $conf->routes[$page];
}
$conClass = $request->service.'_Controller';
if( SimFi::classLoadable( $conClass ) ) {
$controller = new $conClass();
/* @var $controller MvcController */
$controller->setRequest( $request );
$controller->setConsole( $console );
try {
$controller->execute( $request->action );
} catch( SimFiException $exc ) {
$console->error( $exc->getMessage() );
}
} else {
$controller = new Error_Controller();
/* @var $controller MvcController */
$controller->setRequest( $request );
$controller->setConsole( $console );
try {
$controller->missingService( $request->service );
} catch( SimFiException $exc ) {
$console->error( $exc->getMessage() );
}
}
$console->publish();