public function submit() { if ($this->validateAction()) { $post = $this->request->request->all(); $fsl = FileStorageLocation::getByID($post['fslID']); if (is_object($fsl)) { $fIDs = $post['fID']; if (is_array($fIDs)) { foreach ($fIDs as $fID) { $f = File::getByID($fID); if (is_object($f)) { $fp = new Permissions($f); if ($fp->canEditFilePermissions()) { try { $f->setFileStorageLocation($fsl); } catch (\Exception $e) { $json = new \Concrete\Core\Application\EditResponse(); $err = \Core::make('error'); $err->add($e->getMessage()); $json->setError($err); $json->outputJSON(); } } } } } } else { $json = new \Concrete\Core\Application\EditResponse(); $err = \Core::make('error'); $err->add(t('Please select valid file storage location.')); $json->setError($err); $json->outputJSON(); } $response = new EditResponse(); $response->setFiles($this->files); $response->setMessage(t('File storage locations updated successfully.')); $response->outputJSON(); } }
$r->setMessage(t('File password saved successfully.')); $r->outputJSON(); } if ($_POST['task'] == 'set_location') { if (!$token->validate('set_location_' . $fileID)) { die(t('Invalid CSRF Token.')); } $fsl = FileStorageLocation::getByID($_POST['fslID']); if (is_object($fsl)) { try { $f->setFileStorageLocation($fsl); } catch (\Exception $e) { $json = new \Concrete\Core\Application\EditResponse(); $err = Core::make('error'); $err->add($e->getMessage()); $json->setError($err); $json->outputJSON(); } } $r->setMessage(t('File storage location saved successfully.')); $r->outputJSON(); } ?> <div class="ccm-ui" id="ccm-file-permissions-dialog-wrapper"> <ul class="nav nav-tabs" id="ccm-file-permissions-tabs"> <?php if (Config::get('concrete.permissions.model') != 'simple') { ?> <li class="active"><a href="javascript:void(0)" id="ccm-file-permissions-advanced"><?php