-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathfunction.php
More file actions
47 lines (39 loc) · 1.11 KB
/
function.php
File metadata and controls
47 lines (39 loc) · 1.11 KB
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
<?php $debugMode = (file_exists(__DIR__ . '/debug.flag') || true);
$RUNDIR = __DIR__ . '/';
// phpinfo();
include_once 'config.php';
include_once 'function/ui.php';
include_once 'function/uiConfig.php';
include_once 'function/terminal.php';
include_once 'function/tool.php';
include_once 'function/request.php';
include_once 'function/terminal.php';
include_once 'function/curl.php';
include_once 'function/space.php';
include_once 'function/user.php';
include_once 'function/subuser.php';
session_start();
$configFile = __DIR__ . '/user/users.php';
if (isset($_GET['login'])) {
if ($ALLOWINUSER)
include_once 'function/user/login.php';
exit;
} else if (isset($_GET['regist'])) {
if ($ALLOWREG)
include_once 'function/user/regist.php';
exit;
} else {
// OAuth用户登录
if (isset($_GET['code'])) {
$accessToken = user::handleLogin($_GET['code']);
header('Location: /');
exit;
}
// 用户信息
if ($ALLOWOAUTH || $debugMode) {
$debugMode ? $userData = user::debug() : $userData = user::getUserInfo();
user::setSession($userData);
}
}
// 请求处理
request::handleRequest();