Example #1
0
<?php

require_once 'config.php';
require_once 'users.php';
require_once 'class.php';
require_once 'remember.php';
$cookies = new Cookies();
$encodeExplorer = new EncodeExplorer();
$encodeExplorer->init();
$gateKeeper = new GateKeeper();
$gateKeeper->init();
$setUp = new SetUp();
$timeconfig = $setUp->getConfig('default_timezone');
$timezone = strlen($timeconfig) > 0 ? $timeconfig : "UTC";
date_default_timezone_set($timezone);
$downloader = new Downloader();
$utils = new Utils();
$logger = new Logger();
$actions = new Actions();
$getcloud = $_POST["setdel"];
$hash = filter_input(INPUT_POST, "h", FILTER_SANITIZE_STRING);
$doit = filter_input(INPUT_POST, "doit", FILTER_SANITIZE_STRING);
$time = filter_input(INPUT_POST, "t", FILTER_SANITIZE_STRING);
if ($doit != $time * 12) {
    die('Direct access not permitted');
}
$alt = $setUp->getConfig('salt');
$altone = $setUp->getConfig('session_name');
if ($hash && $time && $gateKeeper->isUserLoggedIn() && $gateKeeper->isAllowed('delete_enable')) {
    if (md5($alt . $time) === $hash && $downloader->checkTime($time) == true) {
        foreach ($getcloud as $pezzo) {
Example #2
0
}
require "translations/" . $lang . ".php";
$gateKeeper = new GateKeeper();
if ($gateKeeper->isAccessAllowed() && $gateKeeper->isAllowed('upload_enable')) {
    if ($_SERVER['REQUEST_METHOD'] === 'GET') {
        if ($_GET['resumableChunkNumber'] == 1) {
            $firstChunk = true;
        } else {
            $firstChunk = false;
        }
        $resumabledata = $chunk->setupFilename($_GET['resumableFilename'], $_GET['resumableIdentifier']);
        $resumableFilename = $resumabledata['filename'];
        $extension = $resumabledata['extension'];
        $basename = $resumabledata['basename'];
        $fullfilepath = $_GET['loc'] . $resumableFilename;
        if (Utils::notList($extension, SetUp::getConfig("upload_allow_type")) == true || Utils::inList($extension, SetUp::getConfig("upload_reject_extension")) == true || Utils::inList($resumableFilename, array('.htaccess', '.htpasswd', '.ftpquota')) == true || substr($resumableFilename, 0, 1) === ".") {
            if ($_GET['resumableChunkNumber'] == 1) {
                $chunk->setError("<span><i class=\"fa fa-exclamation-triangle\"></i> " . $basename . "<strong>." . $extension . "</strong> " . SetUp::getLangString("upload_type_not_allowed") . "</span> ");
            }
            header("HTTP/1.0 200 Ok");
        } elseif (file_exists($fullfilepath)) {
            if ($_GET['resumableChunkNumber'] == 1) {
                $chunk->setWarning(" <span><i class=\"fa fa-info-circle\"></i> <strong>" . $resumableFilename . "</strong> " . SetUp::getLangString("file_exists") . "</span> ");
            }
            header("HTTP/1.0 200 Ok");
        } elseif ($chunk->checkUserUp($_GET['resumableTotalSize']) == false) {
            if ($_GET['resumableChunkNumber'] == 1) {
                $chunk->setError("<span><i class=\"fa fa-exclamation-triangle\"></i>" . " <strong>" . SetUp::getLangString("upload_exceeded") . "</strong>: " . $_GET['resumableFilename'] . "</span> ");
            }
            header("HTTP/1.0 200 Ok");
        } else {
Example #3
0
<?php

$encodeExplorer = new EncodeExplorer();
$setUp = new SetUp();
$updater = new Updater();
$timeconfig = $setUp->getConfig('default_timezone');
$timezone = strlen($timeconfig) > 0 ? $timeconfig : "UTC";
date_default_timezone_set($timezone);
global $baselang;
$baselang = $_TRANSLATIONS;
$posteditlang = filter_input(INPUT_POST, "editlang", FILTER_SANITIZE_STRING);
$postnewlang = filter_input(INPUT_POST, "newlang", FILTER_SANITIZE_STRING);
$thelang = $posteditlang ? $posteditlang : "en";
$thenewlang = $postnewlang ? $postnewlang : null;
$editlang = $thenewlang ? $thenewlang : $thelang;
global $_TRANSLATIONSEDIT;
if ($posteditlang) {
    include 'translations/' . $editlang . '.php';
    $_TRANSLATIONSEDIT = $_TRANSLATIONS;
} else {
    $_TRANSLATIONSEDIT = $baselang;
}
/**
* Get lang
*/
if (isset($_GET['lang'])) {
    $lang = $_GET['lang'];
    $_SESSION['lang'] = $_GET['lang'];
}
if (isset($_SESSION['lang'])) {
    $lang = $_SESSION['lang'];
Example #4
0
require 'class.php';
session_name($_CONFIG["session_name"]);
session_start();
$lang = filter_input(INPUT_POST, 'thislang', FILTER_SANITIZE_STRING);
require 'translations/' . $lang . '.php';
$setUp = new SetUp();
$utils = new Utils();
$updater = new Updater();
$resetter = new Resetter();
$encodeExplorer = new EncodeExplorer();
$dest = filter_input(INPUT_POST, "user_email", FILTER_VALIDATE_EMAIL);
$pulito = filter_input(INPUT_POST, 'cleanurl', FILTER_SANITIZE_STRING);
$postcaptcha = filter_input(INPUT_POST, "captcha", FILTER_SANITIZE_STRING);
global $_USERS;
global $_TOKENS;
if (!$dest || $setUp->getConfig("show_captcha_reset") == true && !$postcaptcha) {
    print "<div class=\"alert alert-warning\">" . $encodeExplorer->getString("fill_all_fields") . "</div>";
    exit;
}
if (Utils::checkCaptchaReset($postcaptcha) !== true) {
    print "<div class=\"alert alert-danger\">" . $encodeExplorer->getString("wrong_captcha") . "</div>";
    exit;
}
if (!$updater->findEmail($dest)) {
    print "<div class=\"alert alert-danger\">" . $encodeExplorer->getString("email_not_exist") . "</div>";
    exit;
}
if (!$resetter->setToken($dest)) {
    print "<div class=\"alert alert-danger\">Error: token not set</div>";
    exit;
}
Example #5
0
global $_REMEMBER;
$cookies = new Cookies();
$encodeExplorer = new EncodeExplorer();
$encodeExplorer->init();
require_once 'doc-admin/translations/' . $encodeExplorer->lang . '.php';
global $_TRANSLATIONS;
$gateKeeper = new GateKeeper();
$gateKeeper->init();
$setUp = new SetUp();
$location = new Location();
$location->init();
$downloader = new Downloader();
$updater = new Updater();
$updater->init();
$template = new Template();
$timeconfig = $setUp->getConfig('default_timezone');
$timezone = strlen($timeconfig) > 0 ? $timeconfig : "UTC";
date_default_timezone_set($timezone);
require_once 'doc-admin/token.php';
global $_TOKENS;
$resetter = new Resetter();
$resetter->init();
if ($gateKeeper->isAccessAllowed()) {
    $fileManager = new FileManager();
    $fileManager->run($location);
    $encodeExplorer->run($location);
}
unset($_SESSION['upcoda']);
$_SESSION['upcoda'] = array();
unset($_SESSION['uplist']);
$_SESSION['uplist'] = array();
Example #6
0
error_reporting(E_ALL ^ E_NOTICE);
// error_reporting(E_ALL);
// ini_set('display_errors', 1);
require 'config.php';
session_name($_CONFIG["session_name"]);
session_start();
if (isset($_GET['logout'])) {
    unset($_SESSION['doc_admin_name']);
    unset($_SESSION['doc_admin_pass']);
}
require 'users.php';
require 'class.php';
$encodeExplorer = new EncodeExplorer();
$setUp = new SetUp();
$timeconfig = $setUp->getConfig('default_timezone');
$timezone = strlen($timeconfig) > 0 ? $timeconfig : "UTC";
date_default_timezone_set($timezone);
$template = new Template();
$gateKeeper = new GateKeeper();
$logged = false;
$error = null;
$captchaerror = null;
if (isset($_SESSION['doc_admin_name'])) {
    $logged = true;
}
$postusername = filter_input(INPUT_POST, "doc_admin_name", FILTER_SANITIZE_STRING);
$postuserpass = filter_input(INPUT_POST, "doc_admin_pass", FILTER_SANITIZE_STRING);
if ($postusername && $postuserpass) {
    if (logIn($postusername, $postuserpass)) {
        $logged = true;
Example #7
0
require_once 'config.php';
require_once 'users.php';
require_once 'class.php';
require_once 'remember.php';
$cookies = new Cookies();
$encodeExplorer = new EncodeExplorer();
$encodeExplorer->init();
require_once 'translations/' . $encodeExplorer->lang . '.php';
$gateKeeper = new GateKeeper();
$gateKeeper->init();
$setUp = new SetUp();
$downloader = new Downloader();
$utils = new Utils();
$logger = new Logger();
$actions = new Actions();
$timeconfig = $setUp->getConfig('default_timezone');
$timezone = strlen($timeconfig) > 0 ? $timeconfig : "UTC";
date_default_timezone_set($timezone);
$script_url = $setUp->getConfig('script_url');
$getfile = filter_input(INPUT_GET, "q", FILTER_SANITIZE_STRING);
$getfilelist = filter_input(INPUT_GET, "dl", FILTER_SANITIZE_STRING);
$getcloud = filter_input(INPUT_GET, "d", FILTER_SANITIZE_STRING);
$hash = filter_input(INPUT_GET, "h", FILTER_SANITIZE_STRING);
$supah = filter_input(INPUT_GET, "sh", FILTER_SANITIZE_STRING);
$playmp3 = filter_input(INPUT_GET, "audio", FILTER_SANITIZE_STRING);
$getpass = filter_input(INPUT_GET, "pw", FILTER_SANITIZE_STRING);
if ($getpass) {
    $getpass = urldecode($getpass);
}
$alt = $setUp->getConfig('salt');
$altone = $setUp->getConfig('session_name');
Example #8
0
 /**
  * Check if all the parts exist, and 
  * gather all the parts of the file together
  *
  * @param string $location  - the final location
  * @param string $temp_dir  - the temporary directory holding all the parts of the file
  * @param string $fileName  - the original file name
  * @param string $chunkSize - each chunk size (in bytes)
  * @param string $totalSize - original file size (in bytes)
  * @param string $logloc    - relative location for log file
  *
  * @return uploaded file
  */
 public function createFileFromChunks($location, $temp_dir, $fileName, $chunkSize, $totalSize, $logloc)
 {
     global $chunk;
     $upload_dir = str_replace('\\', '', $location);
     $extension = File::getFileExtension($fileName);
     // count all the parts of this file
     $total_files = 0;
     foreach (scandir($temp_dir) as $file) {
         if (stripos($file, $fileName) !== false) {
             $total_files++;
         }
     }
     $finalfile = FileManager::safeExtension($fileName, $extension);
     // check that all the parts are present
     // the size of the last part is between chunkSize and 2*$chunkSize
     if ($total_files * $chunkSize >= $totalSize - $chunkSize + 1) {
         // create the final file
         if (($openfile = fopen($upload_dir . $finalfile, 'w')) !== false) {
             for ($i = 1; $i <= $total_files; $i++) {
                 fwrite($openfile, file_get_contents($temp_dir . '/' . $fileName . '.part' . $i));
             }
             fclose($openfile);
             // rename the temporary directory (to avoid access from other
             // concurrent chunks uploads) and than delete it
             if (rename($temp_dir, $temp_dir . '_UNUSED')) {
                 Actions::deleteDir($temp_dir . '_UNUSED');
             } else {
                 Actions::deleteDir($temp_dir);
             }
             $chunk->setSuccess(" <span><i class=\"fa fa-check-circle\"></i> " . $finalfile . " </span> ", "yep");
             $chunk->setUserUp($totalSize);
             $message = array('user' => GateKeeper::getUserInfo('name'), 'action' => 'ADD', 'type' => 'file', 'item' => $logloc . $finalfile);
             Logger::log($message, "");
             if (SetUp::getConfig("notify_upload")) {
                 Logger::emailNotification($logloc . $finalfile, 'upload');
             }
         } else {
             setError(" <span><i class=\"fa fa-exclamation-triangle\"></i> cannot create the destination file", "nope");
             return false;
         }
     }
 }
Example #9
0
require 'config.php';
require 'class.php';
$lang = filter_input(INPUT_POST, 'thislang', FILTER_SANITIZE_STRING);
require 'translations/' . $lang . '.php';
$setUp = new SetUp();
$utils = new Utils();
$encodeExplorer = new EncodeExplorer();
$from = filter_input(INPUT_POST, "mitt", FILTER_VALIDATE_EMAIL);
$dest = filter_input(INPUT_POST, "dest", FILTER_VALIDATE_EMAIL);
$link = filter_input(INPUT_POST, "sharelink", FILTER_SANITIZE_STRING);
$attachments = explode(",", filter_input(INPUT_POST, "attach", FILTER_SANITIZE_STRING));
$text_message = filter_input(INPUT_POST, "message", FILTER_SANITIZE_STRING);
$passlink = filter_input(INPUT_POST, "passlink", FILTER_SANITIZE_STRING);
$bcc = filter_input(INPUT_POST, 'send_cc', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY);
if ($from && $dest && $link) {
    $setfrom = $setUp->getConfig('email_from');
    $mail = new PHPMailer();
    $mail->CharSet = 'UTF-8';
    if ($setUp->getConfig('smtp_enable') == true) {
        $timeconfig = $setUp->getConfig('default_timezone');
        $timezone = strlen($timeconfig) > 0 ? $timeconfig : "UTC";
        date_default_timezone_set($timezone);
        $mail->isSMTP();
        $mail->SMTPDebug = 0;
        $smtp_auth = $setUp->getConfig('smtp_auth');
        $mail->Host = $setUp->getConfig('smtp_server');
        $mail->Port = (int) $setUp->getConfig('port');
        if ($setUp->getConfig('secure_conn') !== "none") {
            $mail->SMTPSecure = $setUp->getConfig('secure_conn');
        }
        $mail->SMTPAuth = $smtp_auth;