コード例 #1
0
ファイル: index.php プロジェクト: joyeop/Monsta-FTP
function processActions()
{
    $ftpAction = '';
    if (isset($_POST["ftpAction"]) && !empty($_POST["ftpAction"])) {
        $ftpAction = $_POST["ftpAction"];
    } elseif (isset($_GET["ftpAction"]) && !empty($_GET["ftpAction"])) {
        $ftpAction = $_GET["ftpAction"];
    } else {
        $ftpAction = 'error';
    }
    // Open folder (always called)
    if (openFolder() == 1) {
        // New file
        if ($ftpAction == "newFile") {
            newFile();
        }
        // New folder
        if ($ftpAction == "newFolder") {
            newFolder();
        }
        // Upload file
        if ($ftpAction == "upload") {
            uploadFile();
        }
        // Cut
        if ($ftpAction == "cut") {
            cutFilesPre();
        }
        // Copy
        if ($ftpAction == "copy") {
            copyFilesPre();
        }
        // Paste
        if ($ftpAction == "paste") {
            pasteFiles();
        }
        // Delete
        if ($ftpAction == "delete") {
            deleteFiles();
        }
        // Rename
        if ($ftpAction == "rename") {
            renameFiles();
        }
        // Chmod
        if ($ftpAction == "chmod") {
            chmodFiles();
        }
        // Drag & Drop
        if ($ftpAction == "dragDrop") {
            dragDropFiles();
        }
        // Edit
        if ($ftpAction == "edit") {
            editFile();
        }
    }
}
コード例 #2
0
     //echo $sTempFileName . " - " . file_exists($sTempFileName) . "!!!";
     if (!file_exists($sTempFileName)) {
         break;
     }
     //echo "before convert";
     if (!convert($sId)) {
         deleteTempFiles($sId);
         break;
     }
     //echo "after convert";
     $sAutoApprove = getSettingValue($sModule, "autoApprove");
     $sUri = genUri($sTitle);
     getResult("INSERT INTO `" . MODULE_DB_PREFIX . "Files`(`CategoryId`, `Title`, `Uri`, `Tags`, `Description`, `Date`, `Owner`, `Approved`) VALUES ('" . $sCategory . "', '" . $sTitle . "', '" . $sUri . "', '" . $sTags . "', '" . $sDesc . "', '" . time() . "', '" . $sId . "', '" . $sAutoApprove . "')");
     $sFileId = getLastInsertId();
     //echo "before rename";
     if (!renameFiles($sId, $sFileId)) {
         deleteTempFiles($sId);
         getResult("DELETE FROM `" . MODULE_DB_PREFIX . "Files` WHERE `ID`='" . $sFileId . "' LIMIT 1");
         break;
     }
     //echo "after rename";
     deleteTempFiles($sId, true);
     parseTags($sFileId);
     if ($sId != "0") {
         getResult("UPDATE `" . MODULE_DB_PREFIX . "PlayLists` SET `Order`=`Order`+1 WHERE `Owner` = '" . $sId . "'");
         getResult("INSERT INTO `" . MODULE_DB_PREFIX . "PlayLists` VALUES('" . $sFileId . "', '" . $sId . "', '1')");
     }
     $sContents = parseXml($aXmlTemplates['result'], "", SUCCESS_VAL);
     $sContents .= parseXml($aXmlTemplates['file'], $sFileId, $sFileId . PLAY_EXTENSION, $sFileId . SAVE_EXTENSION, $sFileId . IMAGE_EXTENSION, $sFileId . THUMB_FILE_NAME . IMAGE_EXTENSION);
     break;
 case 'screenshot':