forked from Quareal/xCloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
executable file
·38 lines (32 loc) · 1.25 KB
/
index.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
<?php
try
{
// Connecting libraries and configuration
require_once __DIR__ . "/lib/main.class.php";
require_once __DIR__ . "/lib/guard.class.php";
require_once __DIR__ . "/lib/temp.class.php";
require_once __DIR__ . "/lib/app.class.php";
require_once __DIR__ . "/lib/system.class.php";
require_once __DIR__ . "/resources/config.php";
// Filling pointers and checking the database
Cloud::handshake($CONFIG);
if(!Cloud::$mysqli) exit(Cloud::error("Невозможно подключиться к бд."));
// Output of application content
if(isset($_GET['content']) && Cloud::$profile['is_login'])
exit(json_encode(include __DIR__ . "/resources/application.php"));
else if (isset($_GET['appstyle']) && Cloud::$profile['is_login'])
// Outputting an application style sheet
exit(include __DIR__ . "/resources/style.php");
// API for retrieving files
else if (isset($_GET['get']) && Cloud::$profile['is_login'])
exit(include __DIR__ . "/resources/filesource.php");
// Output of the interface of the specified controller
$interface = Cloud::__interface($CONFIG['controller']);
// Check for redirects
if($interface['status'] != 1)
header("Location: {$interface['location']}");
exit;
}catch (Exception $e)
{
exit(Cloud::error($e->getMessage()));
}