* qascript@ifsoft.co.uk * * Copyright 2012-2016 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk) */ include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php"; include_once $_SERVER['DOCUMENT_ROOT'] . "/config/api.inc.php"; if (!empty($_POST)) { $clientId = isset($_POST['clientId']) ? $_POST['clientId'] : 0; $accountId = isset($_POST['accountId']) ? $_POST['accountId'] : 0; $accessToken = isset($_POST['accessToken']) ? $_POST['accessToken'] : ''; $profileId = isset($_POST['profileId']) ? $_POST['profileId'] : 0; $photoId = isset($_POST['photoId']) ? $_POST['photoId'] : 0; $clientId = helper::clearInt($clientId); $accountId = helper::clearInt($accountId); $profileId = helper::clearInt($profileId); $photoId = helper::clearInt($photoId); $result = array("error" => true, "error_code" => ERROR_UNKNOWN); $auth = new auth($dbo); if (!$auth->authorize($accountId, $accessToken)) { api::printError(ERROR_ACCESS_TOKEN, "Error authorization."); } $photos = new photos($dbo); $photos->setRequestFrom($accountId); $accessMode = 0; if ($accountId == $profileId) { $accessMode = 1; } $result = $photos->get($profileId, $photoId, $accessMode); echo json_encode($result); exit; }
/*! * ifsoft.co.uk engine v1.0 * * http://ifsoft.com.ua, http://ifsoft.co.uk * qascript@ifsoft.co.uk * * Copyright 2012-2016 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk) */ include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php"; if (!admin::isSession()) { header("Location: /admin/login.php"); } $stats = new stats($dbo); $admin = new admin($dbo); $report = new report($dbo); $photoId = 0; $photoInfo = array(); if (isset($_GET['id'])) { $photoId = isset($_GET['id']) ? $_GET['id'] : 0; $accessToken = isset($_GET['access_token']) ? $_GET['access_token'] : ''; $fromUserId = isset($_GET['fromUserId']) ? $_GET['fromUserId'] : 0; $photoId = helper::clearInt($photoId); $fromUserId = helper::clearInt($fromUserId); $photos = new photos($dbo); $photos->setRequestFrom($fromUserId); $photos->remove($photoId); $report->removePhotoReports($photoId); } else { header("Location: /admin/main.php"); exit; }