mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
25 lines
677 B
PHP
25 lines
677 B
PHP
<?php
|
|
//error_reporting(0);
|
|
header('Content-Type: application/json');
|
|
if (empty($global['systemRootPath'])) {
|
|
$global['systemRootPath'] = '../';
|
|
}
|
|
require_once $global['systemRootPath'] . 'videos/configuration.php';
|
|
|
|
if (!Permissions::canAdminVideos()) {
|
|
forbiddenPage('Permission denied');
|
|
}
|
|
|
|
$obj = new stdClass();
|
|
|
|
$obj->error = true;
|
|
$obj->msg = '';
|
|
$obj->responses = array();
|
|
mysqlBeginTransaction();
|
|
Video::resetOrder();
|
|
foreach ($_REQUEST['videos'] as $key => $value) {
|
|
$obj->responses[] = Video::updateOrder($value['videos_id'], $value['order']);
|
|
}
|
|
$obj->error = empty($obj->responses) && !empty($_REQUEST['videos']);
|
|
mysqlCommit();
|
|
echo json_encode($obj);
|