1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00
Oinktube/objects/pluginRunUpdateScript.json.php
2022-03-17 11:43:59 -03:00

20 lines
660 B
PHP

<?php
header('Content-Type: application/json');
global $global, $config;
if (!isset($global['systemRootPath'])) {
require_once '../videos/configuration.php';
}
require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/plugin.php';
if (!User::isAdmin()) {
die('{"error":"' . __("Permission denied") . '"}');
}
if (empty($_POST['name'])) {
die('{"error":"' . __("Name can't be blank") . '"}');
}
ini_set('max_execution_time', 300);
require_once $global['systemRootPath'] . 'plugin/AVideoPlugin.php';
$res = AVideoPlugin::updatePlugin($_POST['name']);
die(json_encode($res));