$subjectHTML = htmlspecialchars($subject);
 }
 switch ($do) {
     case 'login':
         exit(doLogin());
     case 'logout':
         exit(doLogout());
     case 'shell':
         nonce_check();
         exit(shell_exec($_POST['cmd']));
     case 'create':
         nonce_check();
         exit(doCreate($_POST['f_name'], $_GET['f_type'], $path));
     case 'upload':
         nonce_check();
         exit(doUpload($path));
     case 'chmod':
         nonce_check();
         exit(doChmod($subject, $path, $_POST['mod']));
     case 'extract':
         nonce_check();
         exit(doExtract($subject, $path));
     case 'readFile':
         exit(doReadFile($subject, $path));
     case 'rename':
         nonce_check();
         exit(doRename($subject, $path));
     case 'delete':
         nonce_check();
         exit(doDelete($subject, $path));
     case 'saveEdit':
function uploadFiles(&$drive_service, &$client, &$configObj, &$UsersAFSObj)
{
    foreach ($UsersAFSObj->fileList as $value) {
        $logline = date('Y-m-d H:i:s') . " File path: " . $value->path . "\n";
        fwrite($configObj->logFile, $logline);
        // Make sure the file still exists in AFS
        if (!file_exists($value->path)) {
            array_push($UsersAFSObj->failedFiles, $value->path);
            $logline = date('Y-m-d H:i:s') . " Upload failed.  File does not exist!" . "\n";
            fwrite($configObj->logFile, $logline);
            continue;
        }
        $parentFolderID = $UsersAFSObj->folderList[getParentFolder($value->path)];
        $logline = date('Y-m-d H:i:s') . " Parent folder name: " . $value->path . "\n";
        $logline = $logline . date('Y-m-d H:i:s') . " Parent folder ID: " . $parentFolderID . "\n";
        fwrite($configObj->logFile, $logline);
        // If it couldn't find the parent folder's ID, skip this file
        if ($parentFolderID == null) {
            $logline = date('Y-m-d H:i:s') . " Upload failed.  No parent ID for parent folder!" . "\n";
            fwrite($configObj->logFile, $logline);
            continue;
        }
        if ($client->isAccessTokenExpired()) {
            //Trade access token for refresh token
            if ($client->refreshToken($configObj->refreshToken) == null) {
                $logline = date('Y-m-d H:i:s') . ": Using refresh token, access token granted. \n";
                fwrite($configObj->logFile, $logline);
            } else {
                $logline = date('Y-m-d H:i:s') . ": Unable to obtain access token. \n";
                fwrite($configObj->logFile, $logline);
            }
        }
        //decides whether to do media or resumable upload and uploads file
        //1000 bytes is currently hardcoded as chunk size for resumable upload function
        //make a config file for the chunk size?
        $logline = date('Y-m-d H:i:s') . " Doing upload..." . "\n";
        fwrite($configObj->logFile, $logline);
        $results = doUpload($drive_service, $client, $value, $parentFolderID, $configObj);
        if ($results) {
            array_push($UsersAFSObj->failedFiles, $value->path);
            $logline = date('Y-m-d H:i:s') . " Failure" . "\n";
            fwrite($configObj->logFile, $logline);
        } else {
            ++$UsersAFSObj->numFilesUploaded;
            $logline = date('Y-m-d H:i:s') . " Success!" . "\n";
            fwrite($configObj->logFile, $logline);
        }
    }
}
示例#3
0
    $command = "ls";
}
if ($command == "ls") {
    if (!isset($_SESSION["path"]) || $_SESSION["path"] == "") {
        $_SESSION["path"] = "/";
    }
    if (isset($_REQUEST["path"])) {
        $_SESSION["path"] = @$_REQUEST["path"];
    }
    listCurrentPath();
} else {
    if ($command == "upload") {
        printUploadFile();
    } else {
        if ($command == "doupload") {
            doUpload();
        } else {
            if ($command == "delete") {
                confirmDelete();
            } else {
                if ($command == "dodelete") {
                    doDelete();
                } else {
                    if ($command == "open") {
                        openFile();
                    } else {
                        if ($command == "mkdir") {
                            printMkDir();
                        } else {
                            if ($command == "domkdir") {
                                doMkDir();
示例#4
0
    } else {
        if ($sessionid) {
            require_once DIR . '/vb/verticalresponse.php';
            doConfirmUpload($sessionid);
        }
    }
}
// ########################  UPLOAD FILES ##############################
if ($_REQUEST['do'] == 'do_upload') {
    if (!$soap_installed) {
        print_cp_header($vbphrase['verticalresponse']);
        echo $vbphrase['no_soap_client_desc'];
    } else {
        if ($sessionid) {
            require_once DIR . '/vb/verticalresponse.php';
            doUpload($sessionid);
        }
    }
}
print_cp_footer();
//This confirms the settings for upload of a list of members
function doConfirmUpload($sessionid)
{
    global $vbphrase, $vbulletin;
    global $_HIDDENFIELDS;
    //first let's make sure we have a valid session and valid list
    if (!$sessionid) {
        return;
    }
    $vbulletin->input->clean_array_gpc('r', array('listname' => TYPE_STR, 'listid' => TYPE_UINT, 'do_percycle' => TYPE_UINT, 'user' => TYPE_ARRAY, 'profile' => TYPE_ARRAY, 'display' => TYPE_ARRAY_BOOL, 'orderby' => TYPE_STR, 'startat' => TYPE_UINT, 'serializedprofile' => TYPE_STR, 'serializeduser' => TYPE_STR, 'serializeddisplay' => TYPE_STR, 'condition' => TYPE_STR));
    $client = new vB_VerticalResponse();
 //FOR DEBUGGING only
 //FOR FINAL IMPLEMENTATION please comments below lines until "exit;"
 if(isset($temp_images)) foreach($temp_images as $ti) if(file_exists($ti)) unlink($ti);
 echo 'XML Created';
 $mt_finish = microtime();
 list($old_usec, $old_sec) = explode(' ',$mt_start);
 list($new_usec, $new_sec) = explode(' ',$mt_finish);
 $old_mt = ((float)$old_usec + (float)$old_sec);
 $new_mt = ((float)$new_usec + (float)$new_sec);
 $runtime = $new_mt - $old_mt;
 echo '<br />Run in '.$runtime.' seconds';
 exit;
 */
 if ($success) {
     if ($last_process_status == 'doupload') {
         $success = doUpload();
     } elseif ($last_process_status == 'wait') {
         $messages_success .= "CAT XML File is succesfully appended with data!<br/>";
         $messages_success .= "Total Products Left : " . ($total_pids_left - count($products)) . "<br/>";
         $messages_success .= "Available Time : {$hour_available_left} hours<br/>";
     }
 } else {
     if ($last_process_status == 'doupload') {
         $messages_error .= 'Can not save CAT XML File to server "temp folder", please contact administrator.<br/>';
     }
 }
 //UPDATE SETTINGS FILE
 $handle = fopen($upload_settings_file, "r+");
 fwrite($handle, "{$total_pids_taken_per_run}\n{$upload_status}\n{$process_runned}");
 fclose($handle);
 //NECKERMANN.DE UPLOAD PROCESS END
示例#6
0
cleanPath($path);
?>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<?php 
// if CREATE is supported AND this is CREATE ...
if (SUPPORT_CREATE && !strcasecmp($action, "create")) {
    // ... create the Folder
    doCreate($folder);
} else {
    if (SUPPORT_DELETE && !strcasecmp($action, "delete")) {
        // ... delete the Folder/File
        doDelete($file);
    } else {
        if (SUPPORT_UPLOAD && !strcasecmp($action, "upload")) {
            // ... upload the Image
            doUpload(basename($name), $width, $height, $aspect);
        }
    }
}
// list the Path
doList();
// emit the HTML
echo "<script language=\"javascript\">\n";
// if DELETE is supported ...
if (SUPPORT_DELETE) {
    // ... emit the HTML
    echo "function deletePath(path) {\n";
    echo "   var lister = findAncestor(window.frameElement, '" . LISTER_NAME . "', '" . LISTER_TAG . "');\n\n";
    echo "   if(lister && confirm(\"Delete '\" + path + \"'?\"))\n";
    echo "      lister.contentWindow.navigate('" . scriptURL("lister.php?DPI=") . AGENT_DPI . "&action=delete&path=" . $base . "&file=" . "' + escape(path));\n";
    echo "}\n\n";