function processAction() { $action = assign_input('action', 'R'); $folderID = assign_input('folderID', 'R'); $noteID = assign_input('noteID', 'R'); $parentFolder = assign_input('parentFolder', 'R'); $date = assign_input('date', 'R'); $name = assign_input('name', 'R'); $note = assign_input('note', 'P', 1); $sortByDate = assign_input('sortByDate', 'R'); switch ($action) { case 'newFolder': $res = newFolder($name, $parentFolder); break; case 'newNote': $res = newNote($name, $note, $parentFolder); break; case 'toNewFolder': $res = addToNewFolder($parentFolder, $noteID); break; case 'delete': $res = delete_($noteID ? $noteID : $folderID, $folderID); break; case 'rename': $res = rename_($name, $noteID ? $noteID : $folderID, $folderID); break; case 'save': $res = save($noteID, $note); break; case 'get': $res = getContent($parentFolder, $sortByDate ? 1 : 0); break; case 'loadNote': $res = loadNote($noteID); break; case 'search': break; default: $res = array("error" => "no action"); } /* if(( isset($res['error']))&&($res['error'])){echo 'Error occured : '.$res['error'].'<br/>';} if($action=='get'){ echo json_encode($res); } */ echo json_encode($res); }
echo $to_text; clean($cookieName); exit; } $r_data = base64_decode($value['id_report']); $r_data = explode('###', $r_data); $text = _('Scheduled Report') . ': ' . $value['name_report'] . ' - Created by: ' . $value['user'] . " - Time: " . gmdate("H:i:s") . " (UTC)\n"; $to_text = sprintf("%-20s", $text); echo $to_text; $text = _('Schedule Method') . ':' . " " . $value['schedule_name'] . " [" . $value['current_launch'] . "(UTC)]"; $to_text = sprintf("\n%-20s", $text); echo $to_text; // Path to save PDF $dirUser = $uuid . '/' . $value['id'] . '/'; $dirUserPdf = $urlPdf . '/' . $dirUser; newFolder($dirUserPdf); if ($value['save_in_repository'] == '0') { // Delete reports list echo "\n\tDelete reports list from: {$dirUserPdf}\n\n"; clean(null, $dirUserPdf); } // Set name $str_to_replace = array(" ", ":", ".", "&", "/"); //var_dump($value["assets"]); if (preg_match("/ENTITY\\:(\\d+)/", $value["assets"], $fnd)) { $conn = $db->connect(); $e_name = Acl::get_entity_name($conn, $fnd[1]); $assets = "ENTITY: " . $e_name; $db->close($conn); } else { $assets = $value['assets'];
folderRename($_POST['path'], $_POST['name'], $_POST['newname']); } break; case "folderMove": if (isset($_POST['name'], $_POST['path'], $_POST['where'])) { folderMove($_POST['name'], $_POST['path'], $_POST['where']); } break; case "folderDelete": if (isset($_POST['folder'])) { folderDelete($_POST['folder']); } break; case "newFolder": if (isset($_POST['name'], $_POST['path'])) { newFolder($_POST['name'], $_POST['path']); } break; case "fileUpload": if (isset($_POST['path'])) { uploadFiles($_POST['path']); } break; case "upload": if (isset($_POST['dir'])) { upload($_POST['dir']); } break; case "uploadSmart": uploadSmart(); break;
public function getUploadPath($dateString) { $filePath = PUBLISHER_TRAFFIC_REPORT_FILE_PATH . $dateString; newFolder($filePath); return $filePath; }
//prevent direct activation if (!isset($page)) { die("403: Not authorized to call this page directly"); } $GLOBALS["addjs_assets"] .= ",jquery.knob.js,jquery.fileupload.js"; $GLOBALS["addjs_modules"] .= ",file-manager.js"; switch ($_GET["arg"]) { case "load-path": displayFiles($_POST["path"]); break; case "update-breadcrumb": displayBreadcrumbs($_POST["path"]); break; case "new-folder": newFolder($_POST["path"]); break; case "delete-folder": if (delTree("../" . $_POST["path"])) { echo "success"; } else { echo "500: Internal Server Error"; } break; case "delete-file": deleteFile($_POST["path"]); break; case "edit-folder": renameFileFolder("../" . $_POST["path"], $_POST["name"]); break; default:
//Filtrate URL pattern: controller.php?operation=filter&suffix=???&displayInvisible=??? } else { if ('filter' == $operation) { filter($_POST['suffix'], $_POST['displayInvisible']); //Delete URL pattern: controller.php?operation=delete&fileName=??? } else { if ('delete' == $operation) { deleteFile($_POST['fileName'], getCurrentPath()); //Rename URL pattern: controller.php?operation=rename&originalFileName=???&newFileName=??? } else { if ('rename' == $operation) { renameFile($_POST['originalFileName'], $_POST['newFileName'], getCurrentPath()); //New Folder URL pattern: controller.php?operation=newFolder$folderName=??? } else { if ('newFolder' == $operation) { newFolder($_POST['folderName'], getCurrentPath()); //Change Readonly Password URL patterm: controller.php?operation=changePassword&oldPassword=???&newPassword=??? } else { if ('changePassword' == $operation) { changePassword($_POST['oldPassword'], $_POST['newPassword']); } } } } } } } } } } } else {
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(); } } }
public static function saveVideo(Apartment $ad) { $className = get_class($ad); if (isset($_FILES[$className]['name']['video_file']) && $_FILES[$className]['name']['video_file']) { $ad->scenario = 'video_file'; $ad->videoUpload = CUploadedFile::getInstance($ad, 'video_file'); $videoFile = md5(uniqid()) . '.' . $ad->videoUpload->extensionName; $pathVideo = Yii::getPathOfAlias('webroot.uploads.video') . DIRECTORY_SEPARATOR . $ad->id; if (newFolder($pathVideo)) { $ad->videoUpload->saveAs($pathVideo . '/' . $videoFile); $sql = 'INSERT INTO {{apartment_video}} (apartment_id, video_file, video_html, date_updated) VALUES ("' . $ad->id . '", "' . $videoFile . '", "", NOW())'; Yii::app()->db->createCommand($sql)->execute(); //return true; } else { $ad->addError('videoUpload', tt('not_create_folder_to_save.', 'apartments')); return false; } } if (isset($_POST[$className]['video_html']) && $_POST[$className]['video_html']) { $ad->video_html = $_POST[$className]['video_html']; $ad->scenario = 'video_html'; if ($ad->validate()) { $sql = 'INSERT INTO {{apartment_video}} (apartment_id, video_file, video_html, date_updated) VALUES ("' . $ad->id . '", "", "' . CHtml::encode($ad->video_html) . '", NOW())'; Yii::app()->db->createCommand($sql)->execute(); } else { return false; } } return true; }
public function actionUpdate($id) { $this->setActiveMenu('my_listings'); $model = $this->loadModelUserAd($id); if (issetModule('bookingcalendar')) { $model = $model->with(array('bookingCalendar')); } $this->performAjaxValidation($model); if (isset($_GET['type'])) { $type = self::getReqType(); $model->type = $type; } if (isset($_POST[$this->modelName])) { $originalActive = $model->active; $model->attributes = $_POST[$this->modelName]; if ($model->type != Apartment::TYPE_BUY && $model->type != Apartment::TYPE_RENTING) { // video $videoFileValidate = true; if (isset($_FILES[$this->modelName]['name']['video_file']) && $_FILES[$this->modelName]['name']['video_file']) { $model->scenario = 'video_file'; if ($model->validate()) { $model->videoUpload = CUploadedFile::getInstance($model, 'video_file'); $videoFile = md5(uniqid()) . '.' . $model->videoUpload->extensionName; $pathVideo = Yii::getPathOfAlias('webroot.uploads.video') . DIRECTORY_SEPARATOR . $id; if (newFolder($pathVideo)) { $model->videoUpload->saveAs($pathVideo . '/' . $videoFile); $sql = 'INSERT INTO {{apartment_video}} (apartment_id, video_file, video_html, date_updated) VALUES ("' . $id . '", "' . $videoFile . '", "", NOW())'; Yii::app()->db->createCommand($sql)->execute(); } else { Yii::app()->user->setFlash('error', tt('not_create_folder_to_save.', 'apartments')); $this->redirect(array('update', 'id' => $id)); } } else { $videoFileValidate = false; } } if ($videoFileValidate) { // html code $videoHtmlValidate = true; if (isset($_POST[$this->modelName]['video_html']) && $_POST[$this->modelName]['video_html']) { $model->video_html = $_POST[$this->modelName]['video_html']; $model->scenario = 'video_html'; if ($model->validate()) { $sql = 'INSERT INTO {{apartment_video}} (apartment_id, video_file, video_html, date_updated) VALUES ("' . $id . '", "", "' . CHtml::encode($model->video_html) . '", NOW())'; Yii::app()->db->createCommand($sql)->execute(); } else { $videoHtmlValidate = false; } } } if ($videoFileValidate && $videoHtmlValidate) { $panoramaValidate = true; $model->panoramaFile = CUploadedFile::getInstance($model, 'panoramaFile'); $model->scenario = 'panorama'; if (!$model->validate()) { $panoramaValidate = false; } } $city = ""; if (issetModule('location') && param('useLocation', 1)) { $city .= $model->locCountry ? $model->locCountry->getStrByLang('name') : ""; $city .= $city && $model->locCity ? ", " : ""; $city .= $model->locCity ? $model->locCity->getStrByLang('name') : ""; } else { $city = $model->city ? $model->city->getStrByLang('name') : ""; } // data if ($videoFileValidate && $videoHtmlValidate && $panoramaValidate) { if ($model->address && $city && (param('useGoogleMap', 1) || param('useYandexMap', 1) || param('useOSMMap', 1))) { if (!$model->lat && !$model->lng) { # уже есть $coords = Geocoding::getCoordsByAddress($model->address, $city); if (isset($coords['lat']) && isset($coords['lng'])) { $model->lat = $coords['lat']; $model->lng = $coords['lng']; } } } } } $model->scenario = 'savecat'; $model->owner_active = Apartment::STATUS_ACTIVE; $isUpdate = Yii::app()->request->getPost('is_update'); if ($isUpdate) { $model->save(false); } elseif ($model->validate()) { if (param('useUseradsModeration', 1)) { $model->active = Apartment::STATUS_MODERATION; } else { $model->active = Apartment::STATUS_ACTIVE; } if ($model->save(false)) { $this->redirect(array('/apartments/main/view', 'id' => $model->id)); } } else { $model->active = $originalActive; } } $model->getCategoriesForUpdate(); if ($model->active == Apartment::STATUS_DRAFT) { Yii::app()->user->setState('menu_active', 'apartments.create'); $this->render('create', array('model' => $model, 'supportvideoext' => ApartmentVideo::model()->supportExt, 'supportvideomaxsize' => ApartmentVideo::model()->fileMaxSize)); return; } $this->render('update', array('model' => $model, 'supportvideoext' => ApartmentVideo::model()->supportExt, 'supportvideomaxsize' => ApartmentVideo::model()->fileMaxSize)); }
case "load-path": $path = findPath($connection->escape_string($_POST["folder"])); displayFiles($path); break; case "update-breadcrumb": $path = findPath($connection->escape_string($_POST["folder"])); displayBreadcrumbs($path); break; case "delete-file": deleteFile($connection->escape_string($_POST["path"]), $connection->escape_string($_POST["container"])); break; case "delete-folder": deleteFolder($connection->escape_string($_POST["id"])); break; case "new-folder": newFolder($connection->escape_string($_POST["name"]), $connection->escape_string($_POST["path"])); break; case "edit-folder": editFolder($connection->escape_string($_POST["name"]), $connection->escape_string($_POST["id"])); break; case "get-usage": getDiskUsage(); break; case "get-edit-user": populateEditModal(); break; case "update-user": updateUser($connection->escape_string($_POST["user"])); break; } }