forked from WWBN/AVideo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotifications.json.php
32 lines (27 loc) · 1008 Bytes
/
notifications.json.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
<?php
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: Content-Type');
header('Content-Type: application/json');
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
// Getting the mobile submitted value
$inputJSON = url_get_contents('php://input');
$input = _json_decode($inputJSON, true); //convert JSON into array
if (!empty($input) && empty($_POST)) {
foreach ($input as $key => $value) {
$_POST[$key]=$value;
}
}
if (!empty($_POST['user']) && !empty($_POST['pass'])) {
$user = new User(0, $_POST['user'], $_POST['pass']);
$user->login(false, true);
}
$obj = new stdClass();
if (AVideoPlugin::loadPluginIfEnabled("Live")) {
//$liveStats = url_get_contents("{$global['webSiteRootURL']}plugin/Live/stats.json.php");
$obj->live = getStatsNotifications();
}
echo json_encode($obj);