-
Notifications
You must be signed in to change notification settings - Fork 37
/
index.php
67 lines (60 loc) · 2.04 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
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
<?php
$configFile = "./configuration.php";
require_once './functions.php';
$exists = false;
if(file_exists($configFile)){
require_once $configFile;
require_once './objects/Login.php';
$exists = true;
$url = $global['aVideoURL'] . 'plugin/YPTStorage/status.php?url='.urlencode($global['aVideoStorageURL']);
$status = url_get_contents($url);
error_log($url);
error_log($status);
$status = json_decode($status);
if (!empty($_REQUEST['inputUser']) && !empty($_REQUEST['inputPassword'])) {
Login::run($_REQUEST['inputUser'], $_REQUEST['inputPassword']);
}
}else
if(!empty($_POST['inputURL'])){
if (substr($_POST['inputURL'], -1) !== '/') {
$_POST['inputURL'] .= "/";
}
$url = $_POST['inputURL'] . 'plugin/YPTStorage/addSite.json.php?url='.urlencode(getURLToApplication());
$status = url_get_contents($url);
error_log("inputURL: ".$url);
error_log("inputURL: ".$status);
$status = json_decode($status);
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Storage</title>
<!-- Bootstrap core CSS -->
<link href="bootstrap-4.0.0/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
</head>
<body class="text-center">
<?php
if(!$exists){
include './install.php';
}else if (empty($status) || $status->error) {
echo "<h3>Your Streamer Answer an error!</h3>";
if(!empty($status->msg)){
echo $status->msg;
}else{
var_dump($status);
}
var_dump($url);
} else if (!Login::isAdmin()) {
Login::logoff();
include './login.php';
} else {
include './tabs.php';
}
?>
<script src="jquery-3.4.1.min.js" type="text/javascript"></script>
<script src="bootstrap-4.0.0/js/bootstrap.min.js" type="text/javascript"></script>
</body>
</html>