diff --git a/.gitignore b/.gitignore index 43f3cab9121ba3a64d453d6e51d82c0498ef94c0..be69107ca1fa8ea5e412651aee8005b35eb4aa90 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ /apps/inc.php # ignore all apps except core ones -/apps* +/apps*/* !/apps/files !/apps/files_encryption !/apps/files_external @@ -82,6 +82,9 @@ nbproject # Tests /tests/phpunit.xml +# Node Modules +/build/node_modules/ + # Tests - auto-generated files /data-autotest /tests/coverage* diff --git a/3rdparty b/3rdparty index 2f3ae9f56a9838b45254393e13c14f8a8c380d6b..98fdc3a4e2f56f7d231470418222162dbf95f46a 160000 --- a/3rdparty +++ b/3rdparty @@ -1 +1 @@ -Subproject commit 2f3ae9f56a9838b45254393e13c14f8a8c380d6b +Subproject commit 98fdc3a4e2f56f7d231470418222162dbf95f46a diff --git a/apps/files/ajax/delete.php b/apps/files/ajax/delete.php index 5f4856ec790a64f8dc52f6bb86b42266945afe5d..c69f5a8860c692218d1d07330852e0521b0a72f8 100644 --- a/apps/files/ajax/delete.php +++ b/apps/files/ajax/delete.php @@ -24,7 +24,7 @@ foreach ($files as $file) { } // get array with updated storage stats (e.g. max file size) after upload -$storageStats = \OCA\files\lib\Helper::buildFileStorageStatistics($dir); +$storageStats = \OCA\Files\Helper::buildFileStorageStatistics($dir); if ($success) { OCP\JSON::success(array("data" => array_merge(array("dir" => $dir, "files" => $files), $storageStats))); diff --git a/apps/files/ajax/getstoragestats.php b/apps/files/ajax/getstoragestats.php index 7a2b642a9bd11296f64bc16afd1fb559dbde2443..32a77bff6c3054961a364ce1561b5c5e82f04f85 100644 --- a/apps/files/ajax/getstoragestats.php +++ b/apps/files/ajax/getstoragestats.php @@ -6,4 +6,4 @@ $RUNTIME_APPTYPES = array('filesystem'); OCP\JSON::checkLoggedIn(); // send back json -OCP\JSON::success(array('data' => \OCA\files\lib\Helper::buildFileStorageStatistics('/'))); +OCP\JSON::success(array('data' => \OCA\Files\Helper::buildFileStorageStatistics('/'))); diff --git a/apps/files/ajax/list.php b/apps/files/ajax/list.php index c50e96b2429075f09fb3e42de2516a8fa4d67cf6..350fc7fa5f6512bac59c5d6996018ad935c7aec5 100644 --- a/apps/files/ajax/list.php +++ b/apps/files/ajax/list.php @@ -10,35 +10,38 @@ OCP\JSON::checkLoggedIn(); // Load the files $dir = isset( $_GET['dir'] ) ? $_GET['dir'] : ''; + +if (!\OC\Files\Filesystem::is_dir($dir . '/')) { + header("HTTP/1.0 404 Not Found"); + exit(); +} + $doBreadcrumb = isset($_GET['breadcrumb']); $data = array(); +$baseUrl = OCP\Util::linkTo('files', 'index.php') . '?dir='; + +$permissions = \OCA\Files\Helper::getDirPermissions($dir); // Make breadcrumb if($doBreadcrumb) { - $breadcrumb = array(); - $pathtohere = "/"; - foreach( explode( "/", $dir ) as $i ) { - if( $i != "" ) { - $pathtohere .= "$i/"; - $breadcrumb[] = array( "dir" => $pathtohere, "name" => $i ); - } - } - - $breadcrumbNav = new OCP\Template( "files", "part.breadcrumb", "" ); - $breadcrumbNav->assign( "breadcrumb", $breadcrumb, false ); + $breadcrumb = \OCA\Files\Helper::makeBreadcrumb($dir); + + $breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', ''); + $breadcrumbNav->assign('breadcrumb', $breadcrumb, false); + $breadcrumbNav->assign('baseURL', $baseUrl); $data['breadcrumb'] = $breadcrumbNav->fetchPage(); } // make filelist -$files = array(); -foreach( \OC\Files\Filesystem::getDirectoryContent( $dir ) as $i ) { - $i["date"] = OCP\Util::formatDate($i["mtime"] ); - $files[] = $i; -} - -$list = new OCP\Template( "files", "part.list", "" ); -$list->assign( "files", $files, false ); -$data = array('files' => $list->fetchPage()); +$files = \OCA\Files\Helper::getFiles($dir); + +$list = new OCP\Template("files", "part.list", ""); +$list->assign('files', $files, false); +$list->assign('baseURL', $baseUrl, false); +$list->assign('downloadURL', OCP\Util::linkToRoute('download', array('file' => '/'))); +$list->assign('isPublic', false); +$data['files'] = $list->fetchPage(); +$data['permissions'] = $permissions; OCP\JSON::success(array('data' => $data)); diff --git a/apps/files/ajax/newfile.php b/apps/files/ajax/newfile.php index d224e79d01ba2dca4be3fc254ac5f3186cd48249..76c03c87a51fae369584d99af1b93f86bd6adaf2 100644 --- a/apps/files/ajax/newfile.php +++ b/apps/files/ajax/newfile.php @@ -79,7 +79,7 @@ if($source) { $success = false; if (!$content) { $templateManager = OC_Helper::getFileTemplateManager(); - $mimeType = OC_Helper::getMimeType($target); + $mimeType = OC_Helper::getMimetypeDetector()->detectPath($target); $content = $templateManager->getTemplate($mimeType); } diff --git a/apps/files/ajax/rawlist.php b/apps/files/ajax/rawlist.php index f568afad4da44f87f4d74cd301cee93202c8aa9b..531481a84c00e98f46aaeb07ca730d0c91b4568e 100644 --- a/apps/files/ajax/rawlist.php +++ b/apps/files/ajax/rawlist.php @@ -11,22 +11,54 @@ OCP\JSON::checkLoggedIn(); // Load the files $dir = isset( $_GET['dir'] ) ? $_GET['dir'] : ''; -$mimetype = isset($_GET['mimetype']) ? $_GET['mimetype'] : ''; +$mimetypes = isset($_GET['mimetypes']) ? json_decode($_GET['mimetypes'], true) : ''; + +// Clean up duplicates from array and deal with non-array requests +if (is_array($mimetypes)) { + $mimetypes = array_unique($mimetypes); +} elseif (is_null($mimetypes)) { + $mimetypes = array($_GET['mimetypes']); +} // make filelist $files = array(); // If a type other than directory is requested first load them. -if($mimetype && strpos($mimetype, 'httpd/unix-directory') === false) { - foreach( \OC\Files\Filesystem::getDirectoryContent( $dir, 'httpd/unix-directory' ) as $i ) { - $i["date"] = OCP\Util::formatDate($i["mtime"] ); - $i['mimetype_icon'] = $i['type'] == 'dir' ? \mimetype_icon('dir'): \mimetype_icon($i['mimetype']); - $files[] = $i; +if($mimetypes && !in_array('httpd/unix-directory', $mimetypes)) { + foreach( \OC\Files\Filesystem::getDirectoryContent( $dir, 'httpd/unix-directory' ) as $file ) { + $file['directory'] = $dir; + $file['isPreviewAvailable'] = \OC::$server->getPreviewManager()->isMimeSupported($file['mimetype']); + $file["date"] = OCP\Util::formatDate($file["mtime"]); + $file['mimetype_icon'] = \OCA\Files\Helper::determineIcon($file); + $files[] = $file; } } -foreach( \OC\Files\Filesystem::getDirectoryContent( $dir, $mimetype ) as $i ) { - $i["date"] = OCP\Util::formatDate($i["mtime"] ); - $i['mimetype_icon'] = $i['type'] == 'dir' ? \mimetype_icon('dir'): \mimetype_icon($i['mimetype']); - $files[] = $i; + +if (is_array($mimetypes) && count($mimetypes)) { + foreach ($mimetypes as $mimetype) { + foreach( \OC\Files\Filesystem::getDirectoryContent( $dir, $mimetype ) as $file ) { + $file['directory'] = $dir; + $file['isPreviewAvailable'] = \OC::$server->getPreviewManager()->isMimeSupported($file['mimetype']); + $file["date"] = OCP\Util::formatDate($file["mtime"]); + $file['mimetype_icon'] = \OCA\Files\Helper::determineIcon($file); + $files[] = $file; + } + } +} else { + foreach( \OC\Files\Filesystem::getDirectoryContent( $dir ) as $file ) { + $file['directory'] = $dir; + $file['isPreviewAvailable'] = \OC::$server->getPreviewManager()->isMimeSupported($file['mimetype']); + $file["date"] = OCP\Util::formatDate($file["mtime"]); + $file['mimetype_icon'] = \OCA\Files\Helper::determineIcon($file); + $files[] = $file; + } } -OCP\JSON::success(array('data' => $files)); +// Sort by name +usort($files, function ($a, $b) { + if ($a['name'] === $b['name']) { + return 0; + } + return ($a['name'] < $b['name']) ? -1 : 1; +}); + +OC_JSON::success(array('data' => $files)); diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php index dde5d3c50af32e032567a812ce1be2465e96b13b..0920bf62109d7adcb42bb8523a2f69b525d06caa 100644 --- a/apps/files/ajax/upload.php +++ b/apps/files/ajax/upload.php @@ -53,7 +53,7 @@ OCP\JSON::callCheck(); // get array with current storage stats (e.g. max file size) -$storageStats = \OCA\files\lib\Helper::buildFileStorageStatistics($dir); +$storageStats = \OCA\Files\Helper::buildFileStorageStatistics($dir); if (!isset($_FILES['files'])) { OCP\JSON::error(array('data' => array_merge(array('message' => $l->t('No file was uploaded. Unknown error')), $storageStats))); @@ -78,7 +78,7 @@ foreach ($_FILES['files']['error'] as $error) { } $files = $_FILES['files']; -$error = ''; +$error = false; $maxUploadFileSize = $storageStats['uploadMaxFilesize']; $maxHumanFileSize = OCP\Util::humanFileSize($maxUploadFileSize); @@ -98,29 +98,71 @@ $result = array(); if (strpos($dir, '..') === false) { $fileCount = count($files['name']); for ($i = 0; $i < $fileCount; $i++) { - $target = OCP\Files::buildNotExistingFileName(stripslashes($dir), $files['name'][$i]); // $path needs to be normalized - this failed within drag'n'drop upload to a sub-folder - $target = \OC\Files\Filesystem::normalizePath($target); - if (is_uploaded_file($files['tmp_name'][$i]) and \OC\Files\Filesystem::fromTmpFile($files['tmp_name'][$i], $target)) { + if (isset($_POST['resolution']) && $_POST['resolution']==='autorename') { + // append a number in brackets like 'filename (2).ext' + $target = OCP\Files::buildNotExistingFileName(stripslashes($dir), $files['name'][$i]); + } else { + $target = \OC\Files\Filesystem::normalizePath(stripslashes($dir).'/'.$files['name'][$i]); + } + + if ( ! \OC\Files\Filesystem::file_exists($target) + || (isset($_POST['resolution']) && $_POST['resolution']==='replace') + ) { + // upload and overwrite file + if (is_uploaded_file($files['tmp_name'][$i]) and \OC\Files\Filesystem::fromTmpFile($files['tmp_name'][$i], $target)) { + + // updated max file size after upload + $storageStats = \OCA\Files\Helper::buildFileStorageStatistics($dir); + + $meta = \OC\Files\Filesystem::getFileInfo($target); + if ($meta === false) { + $error = $l->t('Upload failed. Could not get file info.'); + } else { + $result[] = array('status' => 'success', + 'mime' => $meta['mimetype'], + 'mtime' => $meta['mtime'], + 'size' => $meta['size'], + 'id' => $meta['fileid'], + 'name' => basename($target), + 'originalname' => $files['tmp_name'][$i], + 'uploadMaxFilesize' => $maxUploadFileSize, + 'maxHumanFilesize' => $maxHumanFileSize, + 'permissions' => $meta['permissions'], + ); + } + + } else { + $error = $l->t('Upload failed. Could not find uploaded file'); + } + + } else { + // file already exists $meta = \OC\Files\Filesystem::getFileInfo($target); - // updated max file size after upload - $storageStats = \OCA\files\lib\Helper::buildFileStorageStatistics($dir); - - $result[] = array('status' => 'success', - 'mime' => $meta['mimetype'], - 'size' => $meta['size'], - 'id' => $meta['fileid'], - 'name' => basename($target), - 'originalname' => $files['name'][$i], - 'uploadMaxFilesize' => $maxUploadFileSize, - 'maxHumanFilesize' => $maxHumanFileSize - ); + if ($meta === false) { + $error = $l->t('Upload failed. Could not get file info.'); + } else { + $result[] = array('status' => 'existserror', + 'mime' => $meta['mimetype'], + 'mtime' => $meta['mtime'], + 'size' => $meta['size'], + 'id' => $meta['fileid'], + 'name' => basename($target), + 'originalname' => $files['tmp_name'][$i], + 'uploadMaxFilesize' => $maxUploadFileSize, + 'maxHumanFilesize' => $maxHumanFileSize, + 'permissions' => $meta['permissions'], + ); + } } } - OCP\JSON::encodedPrint($result); - exit(); } else { $error = $l->t('Invalid directory.'); } -OCP\JSON::error(array('data' => array_merge(array('message' => $error), $storageStats))); +if ($error === false) { + OCP\JSON::encodedPrint($result); + exit(); +} else { + OCP\JSON::error(array('data' => array_merge(array('message' => $error), $storageStats))); +} diff --git a/apps/files/appinfo/app.php b/apps/files/appinfo/app.php index bd3245ded3f39a2b73e733653f3a593fb02fec66..909baca92ea7457050d53f6a0a242719836742e9 100644 --- a/apps/files/appinfo/app.php +++ b/apps/files/appinfo/app.php @@ -1,5 +1,4 @@ + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +$application->add(new OCA\Files\Command\Scan(OC_User::getManager())); diff --git a/apps/files/appinfo/remote.php b/apps/files/appinfo/remote.php index 9b114ca2e37209ddc8fd739ff99c5456c6341f23..0c1f2e6580c778f4fc995236b3c5c3929906db03 100644 --- a/apps/files/appinfo/remote.php +++ b/apps/files/appinfo/remote.php @@ -48,6 +48,7 @@ $defaults = new OC_Defaults(); $server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend, $defaults->getName())); $server->addPlugin(new Sabre_DAV_Locks_Plugin($lockBackend)); $server->addPlugin(new Sabre_DAV_Browser_Plugin(false)); // Show something in the Browser, but no upload +$server->addPlugin(new OC_Connector_Sabre_AbortedUploadDetectionPlugin()); $server->addPlugin(new OC_Connector_Sabre_QuotaPlugin()); $server->addPlugin(new OC_Connector_Sabre_MaintenancePlugin()); diff --git a/apps/files/command/scan.php b/apps/files/command/scan.php new file mode 100644 index 0000000000000000000000000000000000000000..25ab70af3629a7d50940c589f1b6cd41c52dd62b --- /dev/null +++ b/apps/files/command/scan.php @@ -0,0 +1,73 @@ + + * Copyright (c) 2013 Bart Visscher + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OCA\Files\Command; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +class Scan extends Command { + + /** + * @var \OC\User\Manager $userManager + */ + private $userManager; + + public function __construct(\OC\User\Manager $userManager) { + $this->userManager = $userManager; + parent::__construct(); + } + + protected function configure() { + $this + ->setName('files:scan') + ->setDescription('rescan filesystem') + ->addArgument( + 'user_id', + InputArgument::OPTIONAL | InputArgument::IS_ARRAY, + 'will rescan all files of the given user(s)' + ) + ->addOption( + 'all', + null, + InputOption::VALUE_NONE, + 'will rescan all files of all known users' + ) + ; + } + + protected function scanFiles($user, OutputInterface $output) { + $scanner = new \OC\Files\Utils\Scanner($user); + $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function($path) use ($output) { + $output->writeln("Scanning $path"); + }); + $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function($path) use ($output) { + $output->writeln("Scanning $path"); + }); + $scanner->scan(''); + } + + protected function execute(InputInterface $input, OutputInterface $output) { + if ($input->getOption('all')) { + $users = $this->userManager->search(''); + } else { + $users = $input->getArgument('user_id'); + } + + foreach ($users as $user) { + if (is_object($user)) { + $user = $user->getUID(); + } + $this->scanFiles($user, $output); + } + } +} diff --git a/apps/files/console/scan.php b/apps/files/console/scan.php deleted file mode 100644 index 70183fc888af90e21b912de1b85927afe866f031..0000000000000000000000000000000000000000 --- a/apps/files/console/scan.php +++ /dev/null @@ -1,31 +0,0 @@ -" . PHP_EOL; - echo " will rescan all files of the given user" . PHP_EOL; - echo " files:scan --all" . PHP_EOL; - echo " will rescan all files of all known users" . PHP_EOL; - return; -} - -function scanFiles($user) { - $scanner = new \OC\Files\Utils\Scanner($user); - $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function($path) { - echo "Scanning $path" . PHP_EOL; - }); - $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function($path) { - echo "Scanning $path" . PHP_EOL; - }); - $scanner->scan(''); -} - -if ($argv[1] === '--all') { - $users = OC_User::getUsers(); -} else { - $users = array($argv[1]); -} - -foreach ($users as $user) { - scanFiles($user); -} diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 7d5fe6445b7d04456a5b456b5d40d9d452606ba9..b3ecd1dab93e4cb62cb167881960c7b6aba9f49b 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -19,10 +19,13 @@ background:#f8f8f8; border:1px solid #ddd; border-radius:10px; border-top-left-radius:0; box-shadow:0 2px 7px rgba(170,170,170,.4); } -#new>ul>li { height:20px; margin:.3em; padding-left:2em; padding-bottom:0.1em; +#new>ul>li { height:36px; margin:.3em; padding-left:3em; padding-bottom:0.1em; background-repeat:no-repeat; cursor:pointer; } -#new>ul>li>p { cursor:pointer; } -#new>ul>li>form>input { padding:0.3em; margin:-0.3em; } +#new>ul>li>p { cursor:pointer; padding-top: 7px; padding-bottom: 7px;} +#new>ul>li>form>input { + padding: 5px; + margin: 2px 0; +} #trash { margin: 0 1em; z-index:1010; float: right; } @@ -65,74 +68,175 @@ /* FILE TABLE */ -#emptyfolder { - position:absolute; - margin:10em 0 0 10em; - font-size:1.5em; font-weight:bold; - color:#888; text-shadow:#fff 0 1px 0; -} #filestable { position: relative; top:37px; width:100%; } -tbody tr { background-color:#fff; height:2.5em; } -tbody tr:hover, tbody tr:active { +#filestable tbody tr { background-color:#fff; height:2.5em; } +#filestable tbody tr:hover, tbody tr:active { background-color: rgb(240,240,240); } -tbody tr.selected { +#filestable tbody tr.selected { background-color: rgb(230,230,230); } +#filestable tbody tr.searchresult { + background-color: rgb(240,240,240); +} tbody a { color:#000; } span.extension, span.uploading, td.date { color:#999; } span.extension { text-transform:lowercase; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)"; filter:alpha(opacity=70); opacity:.7; -webkit-transition:opacity 300ms; -moz-transition:opacity 300ms; -o-transition:opacity 300ms; transition:opacity 300ms; } tr:hover span.extension { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter:alpha(opacity=100); opacity:1; color:#777; } table tr.mouseOver td { background-color:#eee; } table th { height:2em; padding:0 .5em; color:#999; } -table th .name { float:left; margin-left:.5em; } +table th .name { + position: absolute; + left: 55px; + top: 15px; +} table th, table td { border-bottom:1px solid #ddd; text-align:left; font-weight:normal; } -table td { border-bottom:1px solid #eee; font-style:normal; background-position:1em .5em; background-repeat:no-repeat; } -table th#headerName { width:100em; /* not really sure why this works better than 100% … table styling */ } -table th#headerSize, table td.filesize { min-width:3em; padding:0 1em; text-align:right; } -table th#headerDate, table td.date { min-width:11em; padding:0 .1em 0 1em; text-align:left; } +table td { + border-bottom: 1px solid #eee; + font-style: normal; + background-position: 8px center; + background-repeat: no-repeat; +} +table th#headerName { + position: relative; + width: 100em; /* not really sure why this works better than 100% … table styling */ + padding: 0; +} +#headerName-container { + position: relative; + height: 50px; +} +table th#headerSize, table td.filesize { + min-width: 3em; + padding: 0 1em; + text-align: right; +} +table th#headerDate, table td.date { + -moz-box-sizing: border-box; + box-sizing: border-box; + position: relative; + min-width: 11em; + display: block; + height: 51px; +} /* Multiselect bar */ -#filestable.multiselect { top:63px; } +#filestable.multiselect { + top: 88px; +} table.multiselect thead { position:fixed; top:82px; z-index:1; -moz-box-sizing: border-box; box-sizing: border-box; left: 0; padding-left: 80px; width:100%; } + table.multiselect thead th { background-color: rgba(210,210,210,.7); color: #000; font-weight: bold; border-bottom: 0; } -table.multiselect #headerName { width: 100%; } +table.multiselect #headerName { + position: relative; + width: 100%; +} table td.selection, table th.selection, table td.fileaction { width:2em; text-align:center; } -table td.filename a.name { display:block; height:1.5em; vertical-align:middle; margin-left:3em; } +table td.filename a.name { + position:relative; /* Firefox needs to explicitly have this default set … */ + -moz-box-sizing: border-box; + box-sizing: border-box; + display: block; + height: 50px; + vertical-align: middle; + padding: 0; +} table tr[data-type="dir"] td.filename a.name span.nametext {font-weight:bold; } -table td.filename input.filename { width:100%; cursor:text; } -table td.filename a, table td.login, table td.logout, table td.download, table td.upload, table td.create, table td.delete { padding:.2em .5em .5em 0; } +table td.filename input.filename { + width: 80%; + font-size: 14px; + margin-top: 8px; + margin-left: 2px; + cursor: text; +} +table td.filename a, table td.login, table td.logout, table td.download, table td.upload, table td.create, table td.delete { padding:.2em .5em .5em .3em; } table td.filename .nametext, .uploadtext, .modified { float:left; padding:.3em 0; } + +#modified { + position: absolute; + top: 15px; +} +.modified { + position: relative; + top: 11px; + left: 5px; +} + /* TODO fix usability bug (accidental file/folder selection) */ -table td.filename .nametext { overflow:hidden; text-overflow:ellipsis; max-width:800px; } +table td.filename .nametext { + position: absolute; + top: 16px; + left: 55px; + padding: 0; + overflow: hidden; + text-overflow: ellipsis; + max-width: 800px; +} table td.filename .uploadtext { font-weight:normal; margin-left:.5em; } table td.filename form { font-size:.85em; margin-left:3em; margin-right:3em; } + /* File checkboxes */ -#fileList tr td.filename>input[type="checkbox"]:first-child { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter:alpha(opacity=0); opacity:0; float:left; margin:.7em 0 0 1em; /* bigger clickable area doesn’t work in FF width:2.8em; height:2.4em;*/ -webkit-transition:opacity 200ms; -moz-transition:opacity 200ms; -o-transition:opacity 200ms; transition:opacity 200ms; } -#fileList tr td.filename>input[type="checkbox"]:hover:first-child { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; filter:alpha(opacity=80); opacity:.8; } -/* Always show checkbox when selected */ -#fileList tr td.filename>input[type="checkbox"]:checked:first-child { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter:alpha(opacity=100); opacity:1; } -#fileList tr.selected td.filename>input[type="checkbox"]:first-child { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter:alpha(opacity=100); opacity:1; } +#fileList tr td.filename>input[type="checkbox"]:first-child { + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; + filter: alpha(opacity=0); + opacity: 0; + float: left; + margin: 32px 0 4px 32px; /* bigger clickable area doesn’t work in FF width:2.8em; height:2.4em;*/ +} +/* Show checkbox when hovering, checked, or selected */ +#fileList tr:hover td.filename>input[type="checkbox"]:first-child, +#fileList tr td.filename>input[type="checkbox"]:checked:first-child, +#fileList tr.selected td.filename>input[type="checkbox"]:first-child { + opacity: 1; +} +.lte9 #fileList tr:hover td.filename>input[type="checkbox"]:first-child, +.lte9 #fileList tr td.filename>input[type="checkbox"][checked=checked]:first-child, +.lte9 #fileList tr.selected td.filename>input[type="checkbox"]:first-child { + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; + filter: alpha(opacity=100); +} + +/* Use label to have bigger clickable size for checkbox */ +#fileList tr td.filename>input[type="checkbox"] + label, +#select_all + label { + height: 50px; + position: absolute; + width: 50px; + z-index: 5; +} +#fileList tr td.filename>input[type="checkbox"] + label { + left: 0; +} +#select_all + label { + top: 0; +} +#select_all { + position: absolute; + top: 18px; + left: 18px; +} + #fileList tr td.filename { position:relative; width:100%; -webkit-transition:background-image 500ms; -moz-transition:background-image 500ms; -o-transition:background-image 500ms; transition:background-image 500ms; } -#select_all { float:left; margin:.4em 0.6em 0 .5em; } + #uploadsize-message,#delete-confirm { display:none; } /* File actions */ .fileactions { - position:absolute; top:.6em; right:0; - font-size:.8em; + position: absolute; + top: 16px; + right: 0; + font-size: 11px; } -#fileList .name { position:relative; /* Firefox needs to explicitly have this default set … */ } #fileList tr:hover .fileactions { /* background to distinguish when overlaying with file names */ background-color: rgba(240,240,240,0.898); box-shadow: -5px 0 7px rgba(240,240,240,0.898); @@ -142,15 +246,39 @@ table td.filename form { font-size:.85em; margin-left:3em; margin-right:3em; } box-shadow: -5px 0 7px rgba(230,230,230,.9); } #fileList .fileactions a.action img { position:relative; top:.2em; } -#fileList a.action { display:inline; margin:-.5em 0; padding:1em .5em 1em .5em !important; } + #fileList img.move2trash { display:inline; margin:-.5em 0; padding:1em .5em 1em .5em !important; float:right; } -a.action.delete { float:right; } +#fileList a.action.delete { + position: absolute; + right: 0; + top: 0; + margin: 0; + padding: 15px 14px 19px !important; +} a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; } -.selectedActions { display:none; float:right; } -.selectedActions a { display:inline; margin:-.5em 0; padding:.5em !important; } -.selectedActions a img { position:relative; top:.3em; } + +/* Actions for selected files */ +.selectedActions { + display: none; + position: absolute; + top: -1px; + right: 0; + padding: 15px 8px; +} +.selectedActions a { + display: inline; + padding: 17px 5px; +} +.selectedActions a img { + position:relative; + top:.3em; +} + #fileList a.action { + display: inline; + margin: -.5em 0; + padding: 18px 8px !important; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter: alpha(opacity=0); opacity: 0; @@ -170,11 +298,23 @@ a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; } } .summary { - opacity: .5; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"; + filter: alpha(opacity=30); + opacity: .3; + height: 70px; +} + +.summary:hover, .summary, table tr.summary td { + background-color: transparent; } +.summary td { + padding-top: 8px; + padding-bottom: 8px; + border-bottom: none; +} .summary .info { - margin-left: 3em; + margin-left: 55px; } #scanning-message{ top:40%; left:40%; position:absolute; display:none; } @@ -199,3 +339,24 @@ table.dragshadow td.size { text-align: center; margin-left: -200px; } +.mask { + z-index: 50; + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: white; + background-repeat: no-repeat no-repeat; + background-position: 50%; + opacity: 0.7; + filter: alpha(opacity=70); + transition: opacity 100ms; + -moz-transition: opacity 100ms; + -o-transition: opacity 100ms; + -ms-transition: opacity 100ms; + -webkit-transition: opacity 100ms; +} +.mask.transparent{ + opacity: 0; +} diff --git a/apps/files/css/upload.css b/apps/files/css/upload.css new file mode 100644 index 0000000000000000000000000000000000000000..2d11e41ba88e3b09520d421d4decf28a95a6c339 --- /dev/null +++ b/apps/files/css/upload.css @@ -0,0 +1,119 @@ + +#upload { + height:27px; padding:0; margin-left:0.2em; overflow:hidden; + vertical-align: top; +} +#upload a { + position:relative; display:block; width:100%; height:27px; + cursor:pointer; z-index:10; + background-image:url('%webroot%/core/img/actions/upload.svg'); + background-repeat:no-repeat; + background-position:7px 6px; + opacity:0.65; +} +.file_upload_target { display:none; } +.file_upload_form { display:inline; float:left; margin:0; padding:0; cursor:pointer; overflow:visible; } +#file_upload_start { + float: left; + left:0; top:0; width:28px; height:27px; padding:0; + font-size:1em; + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter:alpha(opacity=0); opacity:0; + z-index:20; position:relative; cursor:pointer; overflow:hidden; +} + +#uploadprogresswrapper { + display: inline-block; + vertical-align: top; + margin:0.3em; + height: 29px; +} +#uploadprogressbar { + position:relative; + float: left; + margin-left: 12px; + width: 130px; + height: 26px; + display:inline-block; +} +#uploadprogressbar + stop { + font-size: 13px; +} + +.oc-dialog .fileexists table { + width: 100%; +} +.oc-dialog .fileexists th { + padding-left: 0; + padding-right: 0; +} +.oc-dialog .fileexists th input[type='checkbox'] { + margin-right: 3px; +} +.oc-dialog .fileexists th:first-child { + width: 230px; +} +.oc-dialog .fileexists th label { + font-weight: normal; + color:black; +} +.oc-dialog .fileexists th .count { + margin-left: 3px; +} +.oc-dialog .fileexists .conflicts .template { + display: none; +} +.oc-dialog .fileexists .conflict { + width: 100%; + height: 85px; +} +.oc-dialog .fileexists .conflict .filename { + color:#777; + word-break: break-all; + clear: left; +} +.oc-dialog .fileexists .icon { + width: 64px; + height: 64px; + margin: 0px 5px 5px 5px; + background-repeat: no-repeat; + background-size: 64px 64px; + float: left; +} +.oc-dialog .fileexists .replacement { + float: left; + width: 230px; +} +.oc-dialog .fileexists .original { + float: left; + width: 230px; +} +.oc-dialog .fileexists .conflicts { + overflow-y:scroll; + max-height: 225px; +} +.oc-dialog .fileexists .conflict input[type='checkbox'] { + float: left; +} +.oc-dialog .fileexists .toggle { + background-image: url('%webroot%/core/img/actions/triangle-e.png'); + width: 16px; + height: 16px; +} +.oc-dialog .fileexists #allfileslabel { + float:right; +} +.oc-dialog .fileexists #allfiles { + vertical-align: bottom; + position: relative; + top: -3px; +} +.oc-dialog .fileexists #allfiles + span{ + vertical-align: bottom; +} +.oc-dialog .oc-dialog-buttonrow { + width:100%; + text-align:right; +} +.oc-dialog .oc-dialog-buttonrow .cancel { + float:left; +} diff --git a/apps/files/index.php b/apps/files/index.php index e4d8e353858e185e3b5b654f8cd4814761080b12..6f22fdfdc19bb4fccfbfae5d0b8b5d2c7b2dd9d5 100644 --- a/apps/files/index.php +++ b/apps/files/index.php @@ -26,6 +26,7 @@ OCP\User::checkLoggedIn(); // Load the files we need OCP\Util::addStyle('files', 'files'); +OCP\Util::addStyle('files', 'upload'); OCP\Util::addscript('files', 'file-upload'); OCP\Util::addscript('files', 'jquery.iframe-transport'); OCP\Util::addscript('files', 'jquery.fileupload'); @@ -41,77 +42,58 @@ if (!\OC\Files\Filesystem::is_dir($dir . '/')) { exit(); } -function fileCmp($a, $b) { - if ($a['type'] == 'dir' and $b['type'] != 'dir') { - return -1; - } elseif ($a['type'] != 'dir' and $b['type'] == 'dir') { - return 1; - } else { - return strnatcasecmp($a['name'], $b['name']); +$isIE8 = false; +preg_match('/MSIE (.*?);/', $_SERVER['HTTP_USER_AGENT'], $matches); +if (count($matches) > 0 && $matches[1] <= 8){ + $isIE8 = true; +} + +// if IE8 and "?dir=path" was specified, reformat the URL to use a hash like "#?dir=path" +if ($isIE8 && isset($_GET['dir'])){ + if ($dir === ''){ + $dir = '/'; } + header('Location: ' . OCP\Util::linkTo('files', 'index.php') . '#?dir=' . \OCP\Util::encodePath($dir)); + exit(); } +$ajaxLoad = false; $files = array(); $user = OC_User::getUser(); if (\OC\Files\Cache\Upgrade::needUpgrade($user)) { //dont load anything if we need to upgrade the cache - $content = array(); $needUpgrade = true; $freeSpace = 0; } else { - $content = \OC\Files\Filesystem::getDirectoryContent($dir); + if ($isIE8){ + // after the redirect above, the URL will have a format + // like "files#?dir=path" which means that no path was given + // (dir is not set). In that specific case, we don't return any + // files because the client will take care of switching the dir + // to the one from the hash, then ajax-load the initial file list + $files = array(); + $ajaxLoad = true; + } + else{ + $files = \OCA\Files\Helper::getFiles($dir); + } $freeSpace = \OC\Files\Filesystem::free_space($dir); $needUpgrade = false; } -foreach ($content as $i) { - $i['date'] = OCP\Util::formatDate($i['mtime']); - if ($i['type'] == 'file') { - $fileinfo = pathinfo($i['name']); - $i['basename'] = $fileinfo['filename']; - if (!empty($fileinfo['extension'])) { - $i['extension'] = '.' . $fileinfo['extension']; - } else { - $i['extension'] = ''; - } - } - $i['directory'] = $dir; - $files[] = $i; -} - -usort($files, "fileCmp"); // Make breadcrumb -$breadcrumb = array(); -$pathtohere = ''; -foreach (explode('/', $dir) as $i) { - if ($i != '') { - $pathtohere .= '/' . $i; - $breadcrumb[] = array('dir' => $pathtohere, 'name' => $i); - } -} +$breadcrumb = \OCA\Files\Helper::makeBreadcrumb($dir); // make breadcrumb und filelist markup $list = new OCP\Template('files', 'part.list', ''); $list->assign('files', $files); $list->assign('baseURL', OCP\Util::linkTo('files', 'index.php') . '?dir='); $list->assign('downloadURL', OCP\Util::linkToRoute('download', array('file' => '/'))); -$list->assign('disableSharing', false); +$list->assign('isPublic', false); $breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', ''); $breadcrumbNav->assign('breadcrumb', $breadcrumb); $breadcrumbNav->assign('baseURL', OCP\Util::linkTo('files', 'index.php') . '?dir='); -$permissions = OCP\PERMISSION_READ; -if (\OC\Files\Filesystem::isCreatable($dir . '/')) { - $permissions |= OCP\PERMISSION_CREATE; -} -if (\OC\Files\Filesystem::isUpdatable($dir . '/')) { - $permissions |= OCP\PERMISSION_UPDATE; -} -if (\OC\Files\Filesystem::isDeletable($dir . '/')) { - $permissions |= OCP\PERMISSION_DELETE; -} -if (\OC\Files\Filesystem::isSharable($dir . '/')) { - $permissions |= OCP\PERMISSION_SHARE; -} +$permissions = \OCA\Files\Helper::getDirPermissions($dir); if ($needUpgrade) { OCP\Util::addscript('files', 'upgrade'); @@ -151,5 +133,7 @@ if ($needUpgrade) { $tmpl->assign('isPublic', false); $tmpl->assign('publicUploadEnabled', $publicUploadEnabled); $tmpl->assign("encryptedFiles", \OCP\Util::encryptedFiles()); + $tmpl->assign('disableSharing', false); + $tmpl->assign('ajaxLoad', $ajaxLoad); $tmpl->printPage(); } diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index f262f11f06539a112f3a13f6656127f1c743a63a..b52221ac1fc1953f234a62823c5cd54cffbab055 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -1,157 +1,436 @@ -$(document).ready(function() { - - var file_upload_param = { - dropZone: $('#content'), // restrict dropZone to content div - //singleFileUploads is on by default, so the data.files array will always have length 1 - add: function(e, data) { - - if(data.files[0].type === '' && data.files[0].size == 4096) - { - data.textStatus = 'dirorzero'; - data.errorThrown = t('files','Unable to upload your file as it is a directory or has 0 bytes'); - var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload'); - fu._trigger('fail', e, data); - return true; //don't upload this file but go on with next in queue - } +/** + * The file upload code uses several hooks to interact with blueimps jQuery file upload library: + * 1. the core upload handling hooks are added when initializing the plugin, + * 2. if the browser supports progress events they are added in a separate set after the initialization + * 3. every app can add it's own triggers for fileupload + * - files adds d'n'd handlers and also reacts to done events to add new rows to the filelist + * - TODO pictures upload button + * - TODO music upload button + */ - var totalSize=0; - $.each(data.originalFiles, function(i,file){ - totalSize+=file.size; - }); +/** + * Function that will allow us to know if Ajax uploads are supported + * @link https://github.com/New-Bamboo/example-ajax-upload/blob/master/public/index.html + * also see article @link http://blog.new-bamboo.co.uk/2012/01/10/ridiculously-simple-ajax-uploads-with-formdata + */ +function supportAjaxUploadWithProgress() { + return supportFileAPI() && supportAjaxUploadProgressEvents() && supportFormData(); - if(totalSize>$('#max_upload').val()){ - data.textStatus = 'notenoughspace'; - data.errorThrown = t('files','Not enough space available'); - var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload'); - fu._trigger('fail', e, data); - return false; //don't upload anything - } + // Is the File API supported? + function supportFileAPI() { + var fi = document.createElement('INPUT'); + fi.type = 'file'; + return 'files' in fi; + }; - // start the actual file upload - var jqXHR = data.submit(); + // Are progress events supported? + function supportAjaxUploadProgressEvents() { + var xhr = new XMLHttpRequest(); + return !! (xhr && ('upload' in xhr) && ('onprogress' in xhr.upload)); + }; - // remember jqXHR to show warning to user when he navigates away but an upload is still in progress - if (typeof data.context !== 'undefined' && data.context.data('type') === 'dir') { - var dirName = data.context.data('file'); - if(typeof uploadingFiles[dirName] === 'undefined') { - uploadingFiles[dirName] = {}; - } - uploadingFiles[dirName][data.files[0].name] = jqXHR; - } else { - uploadingFiles[data.files[0].name] = jqXHR; - } + // Is FormData supported? + function supportFormData() { + return !! window.FormData; + } +} - //show cancel button - if($('html.lte9').length === 0 && data.dataType !== 'iframe') { - $('#uploadprogresswrapper input.stop').show(); - } - }, - /** - * called after the first add, does NOT have the data param - * @param e - */ - start: function(e) { - //IE < 10 does not fire the necessary events for the progress bar. - if($('html.lte9').length > 0) { - return; - } - $('#uploadprogressbar').progressbar({value:0}); - $('#uploadprogressbar').fadeIn(); - }, - fail: function(e, data) { - if (typeof data.textStatus !== 'undefined' && data.textStatus !== 'success' ) { - if (data.textStatus === 'abort') { - $('#notification').text(t('files', 'Upload cancelled.')); - } else { - // HTTP connection problem - $('#notification').text(data.errorThrown); - } - $('#notification').fadeIn(); - //hide notification after 5 sec - setTimeout(function() { - $('#notification').fadeOut(); - }, 5000); +/** + * keeps track of uploads in progress and implements callbacks for the conflicts dialog + * @type {OC.Upload} + */ +OC.Upload = { + _uploads: [], + /** + * cancels a single upload, + * @deprecated because it was only used when a file currently beeing uploaded was deleted. Now they are added after + * they have been uploaded. + * @param {string} dir + * @param {string} filename + * @returns {unresolved} + */ + cancelUpload:function(dir, filename) { + var self = this; + var deleted = false; + //FIXME _selections + jQuery.each(this._uploads, function(i, jqXHR) { + if (selection.dir === dir && selection.uploads[filename]) { + deleted = self.deleteSelectionUpload(selection, filename); + return false; // end searching through selections } - delete uploadingFiles[data.files[0].name]; - }, - progress: function(e, data) { - // TODO: show nice progress bar in file row - }, - progressall: function(e, data) { - //IE < 10 does not fire the necessary events for the progress bar. - if($('html.lte9').length > 0) { - return; + }); + return deleted; + }, + /** + * deletes the jqHXR object from a data selection + * @param {object} data + */ + deleteUpload:function(data) { + delete data.jqXHR; + }, + /** + * cancels all uploads + */ + cancelUploads:function() { + this.log('canceling uploads'); + jQuery.each(this._uploads,function(i, jqXHR){ + jqXHR.abort(); + }); + this._uploads = []; + }, + rememberUpload:function(jqXHR){ + if (jqXHR) { + this._uploads.push(jqXHR); + } + }, + /** + * Checks the currently known uploads. + * returns true if any hxr has the state 'pending' + * @returns {boolean} + */ + isProcessing:function(){ + var count = 0; + + jQuery.each(this._uploads,function(i, data){ + if (data.state() === 'pending') { + count++; } - var progress = (data.loaded/data.total)*100; - $('#uploadprogressbar').progressbar('value',progress); - }, - /** - * called for every successful upload - * @param e - * @param data - */ - done:function(e, data) { - // handle different responses (json or body from iframe for ie) - var response; - if (typeof data.result === 'string') { - response = data.result; + }); + return count > 0; + }, + /** + * callback for the conflicts dialog + * @param {object} data + */ + onCancel:function(data) { + this.cancelUploads(); + }, + /** + * callback for the conflicts dialog + * calls onSkip, onReplace or onAutorename for each conflict + * @param {object} conflicts - list of conflict elements + */ + onContinue:function(conflicts) { + var self = this; + //iterate over all conflicts + jQuery.each(conflicts, function (i, conflict) { + conflict = $(conflict); + var keepOriginal = conflict.find('.original input[type="checkbox"]:checked').length === 1; + var keepReplacement = conflict.find('.replacement input[type="checkbox"]:checked').length === 1; + if (keepOriginal && keepReplacement) { + // when both selected -> autorename + self.onAutorename(conflict.data('data')); + } else if (keepReplacement) { + // when only replacement selected -> overwrite + self.onReplace(conflict.data('data')); } else { - //fetch response from iframe - response = data.result[0].body.innerText; + // when only original seleted -> skip + // when none selected -> skip + self.onSkip(conflict.data('data')); } - var result=$.parseJSON(response); + }); + }, + /** + * handle skipping an upload + * @param {object} data + */ + onSkip:function(data){ + this.log('skip', null, data); + this.deleteUpload(data); + }, + /** + * handle replacing a file on the server with an uploaded file + * @param {object} data + */ + onReplace:function(data){ + this.log('replace', null, data); + data.data.append('resolution', 'replace'); + data.submit(); + }, + /** + * handle uploading a file and letting the server decide a new name + * @param {object} data + */ + onAutorename:function(data){ + this.log('autorename', null, data); + if (data.data) { + data.data.append('resolution', 'autorename'); + } else { + data.formData.push({name:'resolution',value:'autorename'}); //hack for ie8 + } + data.submit(); + }, + _trace:false, //TODO implement log handler for JS per class? + log:function(caption, e, data) { + if (this._trace) { + console.log(caption); + console.log(data); + } + }, + /** + * TODO checks the list of existing files prior to uploading and shows a simple dialog to choose + * skip all, replace all or choose which files to keep + * @param {array} selection of files to upload + * @param {object} callbacks - object with several callback methods + * @param {function} callbacks.onNoConflicts + * @param {function} callbacks.onSkipConflicts + * @param {function} callbacks.onReplaceConflicts + * @param {function} callbacks.onChooseConflicts + * @param {function} callbacks.onCancel + */ + checkExistingFiles: function (selection, callbacks){ + // TODO check filelist before uploading and show dialog on conflicts, use callbacks + callbacks.onNoConflicts(selection); + } +}; - if(typeof result[0] !== 'undefined' && result[0].status === 'success') { - var file = result[0]; - } else { - data.textStatus = 'servererror'; - data.errorThrown = t('files', result.data.message); - var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload'); - fu._trigger('fail', e, data); - } +$(document).ready(function() { - var filename = result[0].originalname; + if ( $('#file_upload_start').exists() ) { - // delete jqXHR reference - if (typeof data.context !== 'undefined' && data.context.data('type') === 'dir') { - var dirName = data.context.data('file'); - delete uploadingFiles[dirName][filename]; - if ($.assocArraySize(uploadingFiles[dirName]) == 0) { - delete uploadingFiles[dirName]; + var file_upload_param = { + dropZone: $('#content'), // restrict dropZone to content div + autoUpload: false, + sequentialUploads: true, + //singleFileUploads is on by default, so the data.files array will always have length 1 + /** + * on first add of every selection + * - check all files of originalFiles array with files in dir + * - on conflict show dialog + * - skip all -> remember as single skip action for all conflicting files + * - replace all -> remember as single replace action for all conflicting files + * - choose -> show choose dialog + * - mark files to keep + * - when only existing -> remember as single skip action + * - when only new -> remember as single replace action + * - when both -> remember as single autorename action + * - start uploading selection + * @param {object} e + * @param {object} data + * @returns {boolean} + */ + add: function(e, data) { + OC.Upload.log('add', e, data); + var that = $(this); + + // we need to collect all data upload objects before starting the upload so we can check their existence + // and set individual conflict actions. unfortunately there is only one variable that we can use to identify + // the selection a data upload is part of, so we have to collect them in data.originalFiles + // turning singleFileUploads off is not an option because we want to gracefully handle server errors like + // already exists + + // create a container where we can store the data objects + if ( ! data.originalFiles.selection ) { + // initialize selection and remember number of files to upload + data.originalFiles.selection = { + uploads: [], + filesToUpload: data.originalFiles.length, + totalBytes: 0 + }; + } + var selection = data.originalFiles.selection; + + // add uploads + if ( selection.uploads.length < selection.filesToUpload ){ + // remember upload + selection.uploads.push(data); + } + + //examine file + var file = data.files[0]; + + if (file.type === '' && file.size === 4096) { + data.textStatus = 'dirorzero'; + data.errorThrown = t('files', 'Unable to upload {filename} as it is a directory or has 0 bytes', + {filename: file.name} + ); + } + + // add size + selection.totalBytes += file.size; + + //check max upload size + if (selection.totalBytes > $('#max_upload').val()) { + data.textStatus = 'notenoughspace'; + data.errorThrown = t('files', 'Not enough space available'); + } + + // end upload for whole selection on error + if (data.errorThrown) { + // trigger fileupload fail + var fu = that.data('blueimp-fileupload') || that.data('fileupload'); + fu._trigger('fail', e, data); + return false; //don't upload anything } - } else { - delete uploadingFiles[filename]; - } - }, - /** - * called after last upload - * @param e - * @param data - */ - stop: function(e, data) { - if(data.dataType !== 'iframe') { - $('#uploadprogresswrapper input.stop').hide(); - } + // check existing files when all is collected + if ( selection.uploads.length >= selection.filesToUpload ) { + + //remove our selection hack: + delete data.originalFiles.selection; + + var callbacks = { + + onNoConflicts: function (selection) { + $.each(selection.uploads, function(i, upload) { + upload.submit(); + }); + }, + onSkipConflicts: function (selection) { + //TODO mark conflicting files as toskip + }, + onReplaceConflicts: function (selection) { + //TODO mark conflicting files as toreplace + }, + onChooseConflicts: function (selection) { + //TODO mark conflicting files as chosen + }, + onCancel: function (selection) { + $.each(selection.uploads, function(i, upload) { + upload.abort(); + }); + } + }; + + OC.Upload.checkExistingFiles(selection, callbacks); + + } + + return true; // continue adding files + }, + /** + * called after the first add, does NOT have the data param + * @param {object} e + */ + start: function(e) { + OC.Upload.log('start', e, null); + }, + submit: function(e, data) { + OC.Upload.rememberUpload(data); + if ( ! data.formData ) { + // noone set update parameters, we set the minimum + data.formData = { + requesttoken: oc_requesttoken, + dir: $('#dir').val() + }; + } + }, + fail: function(e, data) { + OC.Upload.log('fail', e, data); + if (typeof data.textStatus !== 'undefined' && data.textStatus !== 'success' ) { + if (data.textStatus === 'abort') { + $('#notification').text(t('files', 'Upload cancelled.')); + } else { + // HTTP connection problem + $('#notification').text(data.errorThrown); + } + $('#notification').fadeIn(); + //hide notification after 5 sec + setTimeout(function() { + $('#notification').fadeOut(); + }, 5000); + } + OC.Upload.deleteUpload(data); + }, + /** + * called for every successful upload + * @param {object} e + * @param {object} data + */ + done:function(e, data) { + OC.Upload.log('done', e, data); + // handle different responses (json or body from iframe for ie) + var response; + if (typeof data.result === 'string') { + response = data.result; + } else { + //fetch response from iframe + response = data.result[0].body.innerText; + } + var result=$.parseJSON(response); - //IE < 10 does not fire the necessary events for the progress bar. - if($('html.lte9').length > 0) { - return; + delete data.jqXHR; + + if(typeof result[0] === 'undefined') { + data.textStatus = 'servererror'; + data.errorThrown = t('files', 'Could not get result from server.'); + var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload'); + fu._trigger('fail', e, data); + } else if (result[0].status === 'existserror') { + //show "file already exists" dialog + var original = result[0]; + var replacement = data.files[0]; + var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload'); + OC.dialogs.fileexists(data, original, replacement, OC.Upload, fu); + } else if (result[0].status !== 'success') { + //delete data.jqXHR; + data.textStatus = 'servererror'; + data.errorThrown = result.data.message; // error message has been translated on server + var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload'); + fu._trigger('fail', e, data); + } + }, + /** + * called after last upload + * @param {object} e + * @param {object} data + */ + stop: function(e, data) { + OC.Upload.log('stop', e, data); } + }; - $('#uploadprogressbar').progressbar('value',100); - $('#uploadprogressbar').fadeOut(); - } - }; - var file_upload_handler = function() { - $('#file_upload_start').fileupload(file_upload_param); - }; + // initialize jquery fileupload (blueimp) + var fileupload = $('#file_upload_start').fileupload(file_upload_param); + window.file_upload_param = fileupload; + if(supportAjaxUploadWithProgress()) { + // add progress handlers + fileupload.on('fileuploadadd', function(e, data) { + OC.Upload.log('progress handle fileuploadadd', e, data); + //show cancel button + //if(data.dataType !== 'iframe') { //FIXME when is iframe used? only for ie? + // $('#uploadprogresswrapper input.stop').show(); + //} + }); + // add progress handlers + fileupload.on('fileuploadstart', function(e, data) { + OC.Upload.log('progress handle fileuploadstart', e, data); + $('#uploadprogresswrapper input.stop').show(); + $('#uploadprogressbar').progressbar({value:0}); + $('#uploadprogressbar').fadeIn(); + }); + fileupload.on('fileuploadprogress', function(e, data) { + OC.Upload.log('progress handle fileuploadprogress', e, data); + //TODO progressbar in row + }); + fileupload.on('fileuploadprogressall', function(e, data) { + OC.Upload.log('progress handle fileuploadprogressall', e, data); + var progress = (data.loaded / data.total) * 100; + $('#uploadprogressbar').progressbar('value', progress); + }); + fileupload.on('fileuploadstop', function(e, data) { + OC.Upload.log('progress handle fileuploadstop', e, data); + + $('#uploadprogresswrapper input.stop').fadeOut(); + $('#uploadprogressbar').fadeOut(); + + }); + fileupload.on('fileuploadfail', function(e, data) { + OC.Upload.log('progress handle fileuploadfail', e, data); + //if user pressed cancel hide upload progress bar and cancel button + if (data.errorThrown === 'abort') { + $('#uploadprogresswrapper input.stop').fadeOut(); + $('#uploadprogressbar').fadeOut(); + } + }); - if ( document.getElementById('data-upload-form') ) { - $(file_upload_handler); + } else { + console.log('skipping file progress because your browser is broken'); + } } + $.assocArraySize = function(obj) { // http://stackoverflow.com/a/6700/11236 var size = 0, key; @@ -162,9 +441,9 @@ $(document).ready(function() { }; // warn user not to leave the page while upload is in progress - $(window).bind('beforeunload', function(e) { - if ($.assocArraySize(uploadingFiles) > 0) { - return t('files','File upload is in progress. Leaving the page now will cancel the upload.'); + $(window).on('beforeunload', function(e) { + if (OC.Upload.isProcessing()) { + return t('files', 'File upload is in progress. Leaving the page now will cancel the upload.'); } }); @@ -229,7 +508,7 @@ $(document).ready(function() { $(this).data('text',text); $(this).children('p').remove(); var form=$('
'); - var input=$(''); + var input=$(''); form.append(input); $(this).append(form); input.focus(); @@ -270,8 +549,9 @@ $(document).ready(function() { tr.attr('data-mime',result.data.mime); tr.attr('data-id', result.data.id); tr.find('.filesize').text(humanFileSize(result.data.size)); - getMimeIcon(result.data.mime,function(path){ - tr.find('td.filename').attr('style','background-image:url('+path+')'); + var path = getPathForPreview(name); + lazyLoadPreview(path, result.data.mime, function(previewpath){ + tr.find('td.filename').attr('style','background-image:url('+previewpath+')'); }); } else { OC.dialogs.alert(result.data.message, t('core', 'Error')); @@ -332,8 +612,9 @@ $(document).ready(function() { var tr=$('tr').filterAttr('data-file',localName); tr.data('mime',mime).data('id',id); tr.attr('data-id', id); - getMimeIcon(mime,function(path){ - tr.find('td.filename').attr('style','background-image:url('+path+')'); + var path = $('#dir').val()+'/'+localName; + lazyLoadPreview(path, mime, function(previewpath){ + tr.find('td.filename').attr('style','background-image:url('+previewpath+')'); }); }); eventSource.listen('error',function(error){ @@ -344,8 +625,12 @@ $(document).ready(function() { } var li=form.parent(); form.remove(); + /* workaround for IE 9&10 click event trap, 2 lines: */ + $('input').first().focus(); + $('#content').focus(); li.append('

'+li.data('text')+'

'); $('#new>a').click(); }); }); + window.file_upload_param = file_upload_param; }); diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index 097fe521aa63e767b375f43e22f3e5a283a5c05d..67d3d5ead8d87b935e99f379a005ae8a105abb57 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -68,6 +68,9 @@ var FileActions = { if ($('tr[data-file="'+file+'"]').data('renaming')) { return; } + + // recreate fileactions + parent.children('a.name').find('.fileactions').remove(); parent.children('a.name').append(''); var defaultAction = FileActions.getDefault(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions()); @@ -117,6 +120,8 @@ var FileActions = { addAction('Share', actions.Share); } + // remove the existing delete action + parent.parent().children().last().find('.action.delete').remove(); if (actions['Delete']) { var img = FileActions.icons['Delete']; if (img.call) { @@ -172,7 +177,7 @@ $(document).ready(function () { FileActions.register('all', 'Delete', OC.PERMISSION_DELETE, function () { return OC.imagePath('core', 'actions/delete'); }, function (filename) { - if (Files.cancelUpload(filename)) { + if (OC.Upload.cancelUpload($('#dir').val(), filename)) { if (filename.substr) { filename = [filename]; } @@ -196,13 +201,12 @@ FileActions.register('all', 'Rename', OC.PERMISSION_UPDATE, function () { FileList.rename(filename); }); - FileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename) { - var dir = $('#dir').val(); + var dir = $('#dir').val() || '/'; if (dir !== '/') { dir = dir + '/'; } - window.location = OC.linkTo('files', 'index.php') + '?dir=' + encodeURIComponent(dir + filename); + FileList.changeDirectory(dir + filename); }); FileActions.setDefault('dir', 'Open'); diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 10801af3eadd7fffd28d021d2c6b5bd1dd35b7bf..4fc1b95a0ab5612bc48560b2328589cc83ab3179 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -1,7 +1,28 @@ var FileList={ useUndo:true, + postProcessList: function(){ + $('#fileList tr').each(function(){ + //little hack to set unescape filenames in attribute + $(this).attr('data-file',decodeURIComponent($(this).attr('data-file'))); + }); + }, update:function(fileListHtml) { - $('#fileList').empty().html(fileListHtml); + var $fileList = $('#fileList'), + permissions = $('#permissions').val(), + isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0; + $fileList.empty().html(fileListHtml); + $('#emptycontent').toggleClass('hidden', !isCreatable || $fileList.find('tr').length > 0); + $fileList.find('tr').each(function () { + FileActions.display($(this).children('td.filename')); + }); + $fileList.trigger(jQuery.Event("fileActionsReady")); + FileList.postProcessList(); + // "Files" might not be loaded in extending apps + if (window.Files){ + Files.setupDragAndDrop(); + } + FileList.updateFileSummary(); + $fileList.trigger(jQuery.Event("updated")); }, createRow:function(type, name, iconurl, linktarget, size, lastModified, permissions){ var td, simpleSize, basename, extension; @@ -15,9 +36,10 @@ var FileList={ // filename td td = $('').attr({ "class": "filename", - "style": 'background-image:url('+iconurl+'); background-size: 16px;' + "style": 'background-image:url('+iconurl+'); background-size: 32px;' }); - td.append(''); + var rand = Math.random().toString(16).slice(2); + td.append(''); var link_elem = $('').attr({ "class": "name", "href": linktarget @@ -108,7 +130,6 @@ var FileList={ if (hidden) { tr.hide(); } - FileActions.display(tr.find('td.filename')); return tr; }, addDir:function(name,size,lastModified,hidden){ @@ -133,19 +154,109 @@ var FileList={ FileActions.display(tr.find('td.filename')); return tr; }, - refresh:function(data) { - var result = jQuery.parseJSON(data.responseText); + /** + * @brief Changes the current directory and reload the file list. + * @param targetDir target directory (non URL encoded) + * @param changeUrl false if the URL must not be changed (defaults to true) + */ + changeDirectory: function(targetDir, changeUrl, force){ + var $dir = $('#dir'), + url, + currentDir = $dir.val() || '/'; + targetDir = targetDir || '/'; + if (!force && currentDir === targetDir){ + return; + } + FileList.setCurrentDir(targetDir, changeUrl); + FileList.reload(); + }, + linkTo: function(dir){ + return OC.linkTo('files', 'index.php')+"?dir="+ encodeURIComponent(dir).replace(/%2F/g, '/'); + }, + setCurrentDir: function(targetDir, changeUrl){ + $('#dir').val(targetDir); + if (changeUrl !== false){ + if (window.history.pushState && changeUrl !== false){ + url = FileList.linkTo(targetDir); + window.history.pushState({dir: targetDir}, '', url); + } + // use URL hash for IE8 + else{ + window.location.hash = '?dir='+ encodeURIComponent(targetDir).replace(/%2F/g, '/'); + } + } + }, + /** + * @brief Reloads the file list using ajax call + */ + reload: function(){ + FileList.showMask(); + if (FileList._reloadCall){ + FileList._reloadCall.abort(); + } + FileList._reloadCall = $.ajax({ + url: OC.filePath('files','ajax','list.php'), + data: { + dir : $('#dir').val(), + breadcrumb: true + }, + error: function(result){ + FileList.reloadCallback(result); + }, + success: function(result) { + FileList.reloadCallback(result); + } + }); + }, + reloadCallback: function(result){ + var $controls = $('#controls'); + + delete FileList._reloadCall; + FileList.hideMask(); + + if (!result || result.status === 'error') { + OC.Notification.show(result.data.message); + return; + } + + if (result.status === 404){ + // go back home + FileList.changeDirectory('/'); + return; + } + + if (result.data.permissions){ + FileList.setDirectoryPermissions(result.data.permissions); + } + if(typeof(result.data.breadcrumb) != 'undefined'){ - updateBreadcrumb(result.data.breadcrumb); + $controls.find('.crumb').remove(); + $controls.prepend(result.data.breadcrumb); + + var width = $(window).width(); + Files.initBreadCrumbs(); + Files.resizeBreadcrumbs(width, true); + + // in case svg is not supported by the browser we need to execute the fallback mechanism + if(!SVGSupport()) { + replaceSVG(); + } } + FileList.update(result.data.files); - resetFileActionPanel(); + }, + setDirectoryPermissions: function(permissions){ + var isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0; + $('#permissions').val(permissions); + $('.creatable').toggleClass('hidden', !isCreatable); + $('.notCreatable').toggleClass('hidden', isCreatable); }, remove:function(name){ $('tr').filterAttr('data-file',name).find('td.filename').draggable('destroy'); $('tr').filterAttr('data-file',name).remove(); + FileList.updateFileSummary(); if($('tr[data-file]').length==0){ - $('#emptyfolder').show(); + $('#emptycontent').removeClass('hidden'); } }, insertElement:function(name,type,element){ @@ -175,7 +286,8 @@ var FileList={ }else{ $('#fileList').append(element); } - $('#emptyfolder').hide(); + $('#emptycontent').addClass('hidden'); + FileList.updateFileSummary(); }, loadingDone:function(name, id){ var mime, tr=$('tr').filterAttr('data-file',name); @@ -185,8 +297,9 @@ var FileList={ if (id != null) { tr.attr('data-id', id); } - getMimeIcon(mime,function(path){ - tr.find('td.filename').attr('style','background-image:url('+path+')'); + var path = getPathForPreview(name); + lazyLoadPreview(path, mime, function(previewpath){ + tr.find('td.filename').attr('style','background-image:url('+previewpath+')'); }); tr.find('td.filename').draggable(dragOptions); }, @@ -198,7 +311,7 @@ var FileList={ tr=$('tr').filterAttr('data-file',name); tr.data('renaming',true); td=tr.children('td.filename'); - input=$('').val(name); + input=$('').val(name); form=$('
'); form.append(input); td.children('a.name').hide(); @@ -391,6 +504,7 @@ var FileList={ }); procesSelection(); checkTrashStatus(); + FileList.updateFileSummary(); } else { $.each(files,function(index,file) { var deleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date").children(".action.delete"); @@ -398,6 +512,167 @@ var FileList={ }); } }); + }, + createFileSummary: function() { + if( $('#fileList tr').length > 0 ) { + var totalDirs = 0; + var totalFiles = 0; + var totalSize = 0; + + // Count types and filesize + $.each($('tr[data-file]'), function(index, value) { + if ($(value).data('type') === 'dir') { + totalDirs++; + } else if ($(value).data('type') === 'file') { + totalFiles++; + } + totalSize += parseInt($(value).data('size')); + }); + + // Get translations + var directoryInfo = n('files', '%n folder', '%n folders', totalDirs); + var fileInfo = n('files', '%n file', '%n files', totalFiles); + + var infoVars = { + dirs: ''+directoryInfo+'', + files: ''+fileInfo+'' + } + + var info = t('files', '{dirs} and {files}', infoVars); + + // don't show the filesize column, if filesize is NaN (e.g. in trashbin) + if (isNaN(totalSize)) { + var fileSize = ''; + } else { + var fileSize = ''+humanFileSize(totalSize)+''; + } + + $('#fileList').append(''+info+''+fileSize+''); + + var $dirInfo = $('.summary .dirinfo'); + var $fileInfo = $('.summary .fileinfo'); + var $connector = $('.summary .connector'); + + // Show only what's necessary, e.g.: no files: don't show "0 files" + if ($dirInfo.html().charAt(0) === "0") { + $dirInfo.hide(); + $connector.hide(); + } + if ($fileInfo.html().charAt(0) === "0") { + $fileInfo.hide(); + $connector.hide(); + } + } + }, + updateFileSummary: function() { + var $summary = $('.summary'); + + // Check if we should remove the summary to show "Upload something" + if ($('#fileList tr').length === 1 && $summary.length === 1) { + $summary.remove(); + } + // If there's no summary create one (createFileSummary checks if there's data) + else if ($summary.length === 0) { + FileList.createFileSummary(); + } + // There's a summary and data -> Update the summary + else if ($('#fileList tr').length > 1 && $summary.length === 1) { + var totalDirs = 0; + var totalFiles = 0; + var totalSize = 0; + $.each($('tr[data-file]'), function(index, value) { + if ($(value).data('type') === 'dir') { + totalDirs++; + } else if ($(value).data('type') === 'file') { + totalFiles++; + } + if ($(value).data('size') !== undefined) { + totalSize += parseInt($(value).data('size')); + } + }); + + var $dirInfo = $('.summary .dirinfo'); + var $fileInfo = $('.summary .fileinfo'); + var $connector = $('.summary .connector'); + + // Substitute old content with new translations + $dirInfo.html(n('files', '%n folder', '%n folders', totalDirs)); + $fileInfo.html(n('files', '%n file', '%n files', totalFiles)); + $('.summary .filesize').html(humanFileSize(totalSize)); + + // Show only what's necessary (may be hidden) + if ($dirInfo.html().charAt(0) === "0") { + $dirInfo.hide(); + $connector.hide(); + } else { + $dirInfo.show(); + } + if ($fileInfo.html().charAt(0) === "0") { + $fileInfo.hide(); + $connector.hide(); + } else { + $fileInfo.show(); + } + if ($dirInfo.html().charAt(0) !== "0" && $fileInfo.html().charAt(0) !== "0") { + $connector.show(); + } + } + }, + showMask: function(){ + // in case one was shown before + var $mask = $('#content .mask'); + if ($mask.length){ + return; + } + + $mask = $('
'); + + $mask.css('background-image', 'url('+ OC.imagePath('core', 'loading.gif') + ')'); + $mask.css('background-repeat', 'no-repeat'); + $('#content').append($mask); + + // block UI, but only make visible in case loading takes longer + FileList._maskTimeout = window.setTimeout(function(){ + // reset opacity + $mask.removeClass('transparent'); + }, 250); + }, + hideMask: function(){ + var $mask = $('#content .mask').remove(); + if (FileList._maskTimeout){ + window.clearTimeout(FileList._maskTimeout); + } + }, + scrollTo:function(file) { + //scroll to and highlight preselected file + var scrolltorow = $('tr[data-file="'+file+'"]'); + if (scrolltorow.length > 0) { + scrolltorow.addClass('searchresult'); + $(window).scrollTop(scrolltorow.position().top); + //remove highlight when hovered over + scrolltorow.one('hover', function(){ + scrolltorow.removeClass('searchresult'); + }); + } + }, + filter:function(query){ + $('#fileList tr:not(.summary)').each(function(i,e){ + if ($(e).data('file').toLowerCase().indexOf(query.toLowerCase()) !== -1) { + $(e).addClass("searchresult"); + } else { + $(e).removeClass("searchresult"); + } + }); + //do not use scrollto to prevent removing searchresult css class + var first = $('#fileList tr.searchresult').first(); + if (first.length !== 0) { + $(window).scrollTop(first.position().top); + } + }, + unfilter:function(){ + $('#fileList tr.searchresult').each(function(i,e){ + $(e).removeClass("searchresult"); + }); } }; @@ -405,147 +680,167 @@ $(document).ready(function(){ // handle upload events var file_upload_start = $('#file_upload_start'); + file_upload_start.on('fileuploaddrop', function(e, data) { - // only handle drop to dir if fileList exists - if ($('#fileList').length > 0) { - var dropTarget = $(e.originalEvent.target).closest('tr'); - if(dropTarget && dropTarget.data('type') === 'dir') { // drag&drop upload to folder - var dirName = dropTarget.data('file'); - // update folder in form - data.formData = function(form) { - var formArray = form.serializeArray(); - // array index 0 contains the max files size - // array index 1 contains the request token - // array index 2 contains the directory - var parentDir = formArray[2]['value']; - if (parentDir === '/') { - formArray[2]['value'] += dirName; - } else { - formArray[2]['value'] += '/'+dirName; - } - return formArray; + OC.Upload.log('filelist handle fileuploaddrop', e, data); + + var dropTarget = $(e.originalEvent.target).closest('tr'); + if(dropTarget && dropTarget.data('type') === 'dir') { // drag&drop upload to folder + + // remember as context + data.context = dropTarget; + + var dir = dropTarget.data('file'); + + // update folder in form + data.formData = function(form) { + var formArray = form.serializeArray(); + // array index 0 contains the max files size + // array index 1 contains the request token + // array index 2 contains the directory + var parentDir = formArray[2]['value']; + if (parentDir === '/') { + formArray[2]['value'] += dir; + } else { + formArray[2]['value'] += '/' + dir; } - } - } + + return formArray; + }; + } + }); file_upload_start.on('fileuploadadd', function(e, data) { - // only add to fileList if it exists - if ($('#fileList').length > 0) { + OC.Upload.log('filelist handle fileuploadadd', e, data); + + //finish delete if we are uploading a deleted file + if(FileList.deleteFiles && FileList.deleteFiles.indexOf(data.files[0].name)!==-1){ + FileList.finishDelete(null, true); //delete file before continuing + } + + // add ui visualization to existing folder + if(data.context && data.context.data('type') === 'dir') { + // add to existing folder + + // update upload counter ui + var uploadtext = data.context.find('.uploadtext'); + var currentUploads = parseInt(uploadtext.attr('currentUploads')); + currentUploads += 1; + uploadtext.attr('currentUploads', currentUploads); - if(FileList.deleteFiles && FileList.deleteFiles.indexOf(data.files[0].name)!=-1){//finish delete if we are uploading a deleted file - FileList.finishDelete(null, true); //delete file before continuing + var translatedText = n('files', 'Uploading %n file', 'Uploading %n files', currentUploads); + if(currentUploads === 1) { + var img = OC.imagePath('core', 'loading.gif'); + data.context.find('td.filename').attr('style','background-image:url('+img+')'); + uploadtext.text(translatedText); + uploadtext.show(); + } else { + uploadtext.text(translatedText); } + } - // add ui visualization to existing folder or as new stand-alone file? - var dropTarget = $(e.originalEvent.target).closest('tr'); - if(dropTarget && dropTarget.data('type') === 'dir') { - // add to existing folder - var dirName = dropTarget.data('file'); + }); + /* + * when file upload done successfully add row to filelist + * update counter when uploading to sub folder + */ + file_upload_start.on('fileuploaddone', function(e, data) { + OC.Upload.log('filelist handle fileuploaddone', e, data); + + var response; + if (typeof data.result === 'string') { + response = data.result; + } else { + // fetch response from iframe + response = data.result[0].body.innerText; + } + var result=$.parseJSON(response); - // set dir context - data.context = $('tr').filterAttr('data-type', 'dir').filterAttr('data-file', dirName); + if(typeof result[0] !== 'undefined' && result[0].status === 'success') { + var file = result[0]; + + if (data.context && data.context.data('type') === 'dir') { // update upload counter ui var uploadtext = data.context.find('.uploadtext'); var currentUploads = parseInt(uploadtext.attr('currentUploads')); - currentUploads += 1; + currentUploads -= 1; uploadtext.attr('currentUploads', currentUploads); var translatedText = n('files', 'Uploading %n file', 'Uploading %n files', currentUploads); - if(currentUploads === 1) { - var img = OC.imagePath('core', 'loading.gif'); + if(currentUploads === 0) { + var img = OC.imagePath('core', 'filetypes/folder.png'); data.context.find('td.filename').attr('style','background-image:url('+img+')'); uploadtext.text(translatedText); - uploadtext.show(); + uploadtext.hide(); } else { uploadtext.text(translatedText); } + + // update folder size + var size = parseInt(data.context.data('size')); + size += parseInt(file.size); + data.context.attr('data-size', size); + data.context.find('td.filesize').text(humanFileSize(size)); + } else { + // add as stand-alone row to filelist - var uniqueName = getUniqueName(data.files[0].name); - var size=t('files','Pending'); - if(data.files[0].size>=0){ + var size=t('files', 'Pending'); + if (data.files[0].size>=0){ size=data.files[0].size; } var date=new Date(); var param = {}; if ($('#publicUploadRequestToken').length) { - param.download_url = document.location.href + '&download&path=/' + $('#dir').val() + '/' + uniqueName; + param.download_url = document.location.href + '&download&path=/' + $('#dir').val() + '/' + file.name; } + //should the file exist in the list remove it + FileList.remove(file.name); + // create new file context - data.context = FileList.addFile(uniqueName,size,date,true,false,param); + data.context = FileList.addFile(file.name, file.size, date, false, false, param); + + // update file data + data.context.attr('data-mime',file.mime).attr('data-id',file.id); + var permissions = data.context.data('permissions'); + if(permissions != file.permissions) { + data.context.attr('data-permissions', file.permissions); + data.context.data('permissions', file.permissions); + } + FileActions.display(data.context.find('td.filename')); + + var path = getPathForPreview(file.name); + lazyLoadPreview(path, file.mime, function(previewpath){ + data.context.find('td.filename').attr('style','background-image:url('+previewpath+')'); + }); } } }); - file_upload_start.on('fileuploaddone', function(e, data) { - // only update the fileList if it exists - if ($('#fileList').length > 0) { - var response; - if (typeof data.result === 'string') { - response = data.result; - } else { - // fetch response from iframe - response = data.result[0].body.innerText; - } - var result=$.parseJSON(response); - - if(typeof result[0] !== 'undefined' && result[0].status === 'success') { - var file = result[0]; - - if (data.context.data('type') === 'file') { - // update file data - data.context.attr('data-mime',file.mime).attr('data-id',file.id); - var size = data.context.data('size'); - if(size!=file.size){ - data.context.attr('data-size', file.size); - data.context.find('td.filesize').text(humanFileSize(file.size)); - } - if (FileList.loadingDone) { - FileList.loadingDone(file.name, file.id); - } - } else { - // update upload counter ui - var uploadtext = data.context.find('.uploadtext'); - var currentUploads = parseInt(uploadtext.attr('currentUploads')); - currentUploads -= 1; - uploadtext.attr('currentUploads', currentUploads); - if(currentUploads === 0) { - var img = OC.imagePath('core', 'filetypes/folder.png'); - data.context.find('td.filename').attr('style','background-image:url('+img+')'); - uploadtext.text(''); - uploadtext.hide(); - } else { - uploadtext.text(currentUploads + ' ' + t('files', 'files uploading')); - } + file_upload_start.on('fileuploadstop', function(e, data) { + OC.Upload.log('filelist handle fileuploadstop', e, data); - // update folder size - var size = parseInt(data.context.data('size')); - size += parseInt(file.size) ; - data.context.attr('data-size', size); - data.context.find('td.filesize').text(humanFileSize(size)); - - } - } + //if user pressed cancel hide upload chrome + if (data.errorThrown === 'abort') { + //cleanup uploading to a dir + var uploadtext = $('tr .uploadtext'); + var img = OC.imagePath('core', 'filetypes/folder.png'); + uploadtext.parents('td.filename').attr('style','background-image:url('+img+')'); + uploadtext.fadeOut(); + uploadtext.attr('currentUploads', 0); } }); file_upload_start.on('fileuploadfail', function(e, data) { - // only update the fileList if it exists - // cleanup files, error notification has been shown by fileupload code - var tr = data.context; - if (typeof tr === 'undefined') { - tr = $('tr').filterAttr('data-file', data.files[0].name); - } - if (tr.attr('data-type') === 'dir') { + OC.Upload.log('filelist handle fileuploadfail', e, data); + + //if user pressed cancel hide upload chrome + if (data.errorThrown === 'abort') { //cleanup uploading to a dir - var uploadtext = tr.find('.uploadtext'); + var uploadtext = $('tr .uploadtext'); var img = OC.imagePath('core', 'filetypes/folder.png'); - tr.find('td.filename').attr('style','background-image:url('+img+')'); - uploadtext.text(''); - uploadtext.hide(); //TODO really hide already - } else { - //remove file - tr.fadeOut(); - tr.remove(); + uploadtext.parents('td.filename').attr('style','background-image:url('+img+')'); + uploadtext.fadeOut(); + uploadtext.attr('currentUploads', 0); } }); @@ -573,16 +868,16 @@ $(document).ready(function(){ FileList.replaceIsNewFile = null; } FileList.lastAction = null; - OC.Notification.hide(); + OC.Notification.hide(); }); $('#notification:first-child').on('click', '.replace', function() { - OC.Notification.hide(function() { - FileList.replace($('#notification > span').attr('data-oldName'), $('#notification > span').attr('data-newName'), $('#notification > span').attr('data-isNewFile')); - }); + OC.Notification.hide(function() { + FileList.replace($('#notification > span').attr('data-oldName'), $('#notification > span').attr('data-newName'), $('#notification > span').attr('data-isNewFile')); + }); }); $('#notification:first-child').on('click', '.suggest', function() { $('tr').filterAttr('data-file', $('#notification > span').attr('data-oldName')).show(); - OC.Notification.hide(); + OC.Notification.hide(); }); $('#notification:first-child').on('click', '.cancel', function() { if ($('#notification > span').attr('data-isNewFile')) { @@ -599,4 +894,56 @@ $(document).ready(function(){ $(window).unload(function (){ $(window).trigger('beforeunload'); }); + + function parseHashQuery(){ + var hash = window.location.hash, + pos = hash.indexOf('?'), + query; + if (pos >= 0){ + return hash.substr(pos + 1); + } + return ''; + } + + function parseCurrentDirFromUrl(){ + var query = parseHashQuery(), + params, + dir = '/'; + // try and parse from URL hash first + if (query){ + params = OC.parseQueryString(query); + } + // else read from query attributes + if (!params){ + params = OC.parseQueryString(location.search); + } + return (params && params.dir) || '/'; + } + + // fallback to hashchange when no history support + if (!window.history.pushState){ + $(window).on('hashchange', function(){ + FileList.changeDirectory(parseCurrentDirFromUrl(), false); + }); + } + window.onpopstate = function(e){ + var targetDir; + if (e.state && e.state.dir){ + targetDir = e.state.dir; + } + else{ + // read from URL + targetDir = parseCurrentDirFromUrl(); + } + if (targetDir){ + FileList.changeDirectory(targetDir, false); + } + } + + if (parseInt($('#ajaxLoad').val(), 10) === 1){ + // need to initially switch the dir to the one from the hash (IE8) + FileList.changeDirectory(parseCurrentDirFromUrl(), false, true); + } + + FileList.createFileSummary(); }); diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 87311237e36cf6c9300c0c4415457f95c8b2b02c..ec688eaf63efff3ea5d0dc70db8e85e08a45f2ac 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -1,31 +1,4 @@ -var uploadingFiles = {}; Files={ - cancelUpload:function(filename) { - if(uploadingFiles[filename]) { - uploadingFiles[filename].abort(); - delete uploadingFiles[filename]; - return true; - } - return false; - }, - cancelUploads:function() { - $.each(uploadingFiles,function(index,file) { - if(typeof file['abort'] === 'function') { - file.abort(); - var filename = $('tr').filterAttr('data-file',index); - filename.hide(); - filename.find('input[type="checkbox"]').removeAttr('checked'); - filename.removeClass('selected'); - } else { - $.each(file,function(i,f) { - f.abort(); - delete file[i]; - }); - } - delete uploadingFiles[index]; - }); - procesSelection(); - }, updateMaxUploadFilesize:function(response) { if(response == undefined) { return; @@ -94,29 +67,106 @@ Files={ OC.Notification.show(t('files_encryption', 'Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files.')); return; } + }, + + setupDragAndDrop: function(){ + var $fileList = $('#fileList'); + + //drag/drop of files + $fileList.find('tr td.filename').each(function(i,e){ + if ($(e).parent().data('permissions') & OC.PERMISSION_DELETE) { + $(e).draggable(dragOptions); + } + }); + + $fileList.find('tr[data-type="dir"] td.filename').each(function(i,e){ + if ($(e).parent().data('permissions') & OC.PERMISSION_CREATE){ + $(e).droppable(folderDropOptions); + } + }); + }, + + lastWidth: 0, + + initBreadCrumbs: function () { + Files.lastWidth = 0; + Files.breadcrumbs = []; + + // initialize with some extra space + Files.breadcrumbsWidth = 64; + if ( document.getElementById("navigation") ) { + Files.breadcrumbsWidth += $('#navigation').get(0).offsetWidth; + } + Files.hiddenBreadcrumbs = 0; + + $.each($('.crumb'), function(index, breadcrumb) { + Files.breadcrumbs[index] = breadcrumb; + Files.breadcrumbsWidth += $(breadcrumb).get(0).offsetWidth; + }); + + $.each($('#controls .actions>div'), function(index, action) { + Files.breadcrumbsWidth += $(action).get(0).offsetWidth; + }); + + // event handlers for breadcrumb items + $('#controls .crumb a').on('click', onClickBreadcrumb); + }, + + resizeBreadcrumbs: function (width, firstRun) { + if (width != Files.lastWidth) { + if ((width < Files.lastWidth || firstRun) && width < Files.breadcrumbsWidth) { + if (Files.hiddenBreadcrumbs == 0) { + Files.breadcrumbsWidth -= $(Files.breadcrumbs[1]).get(0).offsetWidth; + $(Files.breadcrumbs[1]).find('a').hide(); + $(Files.breadcrumbs[1]).append('...'); + Files.breadcrumbsWidth += $(Files.breadcrumbs[1]).get(0).offsetWidth; + Files.hiddenBreadcrumbs = 2; + } + var i = Files.hiddenBreadcrumbs; + while (width < Files.breadcrumbsWidth && i > 1 && i < Files.breadcrumbs.length - 1) { + Files.breadcrumbsWidth -= $(Files.breadcrumbs[i]).get(0).offsetWidth; + $(Files.breadcrumbs[i]).hide(); + Files.hiddenBreadcrumbs = i; + i++ + } + } else if (width > Files.lastWidth && Files.hiddenBreadcrumbs > 0) { + var i = Files.hiddenBreadcrumbs; + while (width > Files.breadcrumbsWidth && i > 0) { + if (Files.hiddenBreadcrumbs == 1) { + Files.breadcrumbsWidth -= $(Files.breadcrumbs[1]).get(0).offsetWidth; + $(Files.breadcrumbs[1]).find('span').remove(); + $(Files.breadcrumbs[1]).find('a').show(); + Files.breadcrumbsWidth += $(Files.breadcrumbs[1]).get(0).offsetWidth; + } else { + $(Files.breadcrumbs[i]).show(); + Files.breadcrumbsWidth += $(Files.breadcrumbs[i]).get(0).offsetWidth; + if (Files.breadcrumbsWidth > width) { + Files.breadcrumbsWidth -= $(Files.breadcrumbs[i]).get(0).offsetWidth; + $(Files.breadcrumbs[i]).hide(); + break; + } + } + i--; + Files.hiddenBreadcrumbs = i; + } + } + Files.lastWidth = width; + } } }; $(document).ready(function() { + // FIXME: workaround for trashbin app + if (window.trashBinApp){ + return; + } Files.displayEncryptionWarning(); Files.bindKeyboardShortcuts(document, jQuery); - $('#fileList tr').each(function(){ - //little hack to set unescape filenames in attribute - $(this).attr('data-file',decodeURIComponent($(this).attr('data-file'))); - }); + + FileList.postProcessList(); + Files.setupDragAndDrop(); $('#file_action_panel').attr('activeAction', false); - //drag/drop of files - $('#fileList tr td.filename').each(function(i,e){ - if ($(e).parent().data('permissions') & OC.PERMISSION_DELETE) { - $(e).draggable(dragOptions); - } - }); - $('#fileList tr[data-type="dir"] td.filename').each(function(i,e){ - if ($(e).parent().data('permissions') & OC.PERMISSION_CREATE){ - $(e).droppable(folderDropOptions); - } - }); $('div.crumb:not(.last)').droppable(crumbDropOptions); $('ul#apps>li:first-child').data('dir',''); if($('div.crumb').length){ @@ -131,7 +181,8 @@ $(document).ready(function() { // Trigger cancelling of file upload $('#uploadprogresswrapper .stop').on('click', function() { - Files.cancelUploads(); + OC.Upload.cancelUploads(); + procesSelection(); }); // Show trash bin @@ -268,72 +319,15 @@ $(document).ready(function() { //do a background scan if needed scanFiles(); - var lastWidth = 0; - var breadcrumbs = []; - var breadcrumbsWidth = 0; - if ( document.getElementById("navigation") ) { - breadcrumbsWidth = $('#navigation').get(0).offsetWidth; - } - var hiddenBreadcrumbs = 0; - - $.each($('.crumb'), function(index, breadcrumb) { - breadcrumbs[index] = breadcrumb; - breadcrumbsWidth += $(breadcrumb).get(0).offsetWidth; - }); - - - $.each($('#controls .actions>div'), function(index, action) { - breadcrumbsWidth += $(action).get(0).offsetWidth; - }); - - function resizeBreadcrumbs(firstRun) { - var width = $(this).width(); - if (width != lastWidth) { - if ((width < lastWidth || firstRun) && width < breadcrumbsWidth) { - if (hiddenBreadcrumbs == 0) { - breadcrumbsWidth -= $(breadcrumbs[1]).get(0).offsetWidth; - $(breadcrumbs[1]).find('a').hide(); - $(breadcrumbs[1]).append('...'); - breadcrumbsWidth += $(breadcrumbs[1]).get(0).offsetWidth; - hiddenBreadcrumbs = 2; - } - var i = hiddenBreadcrumbs; - while (width < breadcrumbsWidth && i > 1 && i < breadcrumbs.length - 1) { - breadcrumbsWidth -= $(breadcrumbs[i]).get(0).offsetWidth; - $(breadcrumbs[i]).hide(); - hiddenBreadcrumbs = i; - i++ - } - } else if (width > lastWidth && hiddenBreadcrumbs > 0) { - var i = hiddenBreadcrumbs; - while (width > breadcrumbsWidth && i > 0) { - if (hiddenBreadcrumbs == 1) { - breadcrumbsWidth -= $(breadcrumbs[1]).get(0).offsetWidth; - $(breadcrumbs[1]).find('span').remove(); - $(breadcrumbs[1]).find('a').show(); - breadcrumbsWidth += $(breadcrumbs[1]).get(0).offsetWidth; - } else { - $(breadcrumbs[i]).show(); - breadcrumbsWidth += $(breadcrumbs[i]).get(0).offsetWidth; - if (breadcrumbsWidth > width) { - breadcrumbsWidth -= $(breadcrumbs[i]).get(0).offsetWidth; - $(breadcrumbs[i]).hide(); - break; - } - } - i--; - hiddenBreadcrumbs = i; - } - } - lastWidth = width; - } - } + Files.initBreadCrumbs(); $(window).resize(function() { - resizeBreadcrumbs(false); + var width = $(this).width(); + Files.resizeBreadcrumbs(width, false); }); - resizeBreadcrumbs(true); + var width = $(this).width(); + Files.resizeBreadcrumbs(width, true); // display storage warnings setTimeout ( "Files.displayStorageWarnings()", 100 ); @@ -364,6 +358,11 @@ $(document).ready(function() { } }); } + + //scroll to and highlight preselected file + if (getURLParameter('scrollto')) { + FileList.scrollTo(getURLParameter('scrollto')); + } }); function scanFiles(force, dir, users){ @@ -415,10 +414,6 @@ function boolOperationFinished(data, callback) { } } -function updateBreadcrumb(breadcrumbHtml) { - $('p.nav').empty().html(breadcrumbHtml); -} - var createDragShadow = function(event){ //select dragged file var isDragSelected = $(event.target).parents('tr').find('td input:first').prop('checked'); @@ -454,8 +449,9 @@ var createDragShadow = function(event){ if (elem.type === 'dir') { newtr.find('td.filename').attr('style','background-image:url('+OC.imagePath('core', 'filetypes/folder.png')+')'); } else { - getMimeIcon(elem.mime,function(path){ - newtr.find('td.filename').attr('style','background-image:url('+path+')'); + var path = getPathForPreview(elem.name); + lazyLoadPreview(path, elem.mime, function(previewpath){ + newtr.find('td.filename').attr('style','background-image:url('+previewpath+')'); }); } }); @@ -508,7 +504,7 @@ var folderDropOptions={ $('#notification').fadeIn(); } } else { - OC.dialogs.alert(t('Error moving file'), t('core', 'Error')); + OC.dialogs.alert(t('files', 'Error moving file'), t('files', 'Error')); } }); }); @@ -546,7 +542,7 @@ var crumbDropOptions={ $('#notification').fadeIn(); } } else { - OC.dialogs.alert(t('Error moving file'), t('core', 'Error')); + OC.dialogs.alert(t('files', 'Error moving file'), t('files', 'Error')); } }); }); @@ -631,6 +627,37 @@ function getMimeIcon(mime, ready){ } getMimeIcon.cache={}; +function getPathForPreview(name) { + var path = $('#dir').val() + '/' + name; + return path; +} + +function lazyLoadPreview(path, mime, ready, width, height) { + // get mime icon url + getMimeIcon(mime, function(iconURL) { + ready(iconURL); // set mimeicon URL + + // now try getting a preview thumbnail URL + if ( ! width ) { + width = $('#filestable').data('preview-x'); + } + if ( ! height ) { + height = $('#filestable').data('preview-y'); + } + if( $('#publicUploadButtonMock').length ) { + var previewURL = OC.Router.generate('core_ajax_public_preview', {file: encodeURIComponent(path), x:width, y:height, t:$('#dirToken').val()}); + } else { + var previewURL = OC.Router.generate('core_ajax_preview', {file: encodeURIComponent(path), x:width, y:height}); + } + $.get(previewURL, function() { + previewURL = previewURL.replace('(', '%28'); + previewURL = previewURL.replace(')', '%29'); + //set preview thumbnail URL + ready(previewURL + '&reload=true'); + }); + }); +} + function getUniqueName(name){ if($('tr').filterAttr('data-file',name).length>0){ var parts=name.split('.'); @@ -663,3 +690,9 @@ function checkTrashStatus() { } }); } + +function onClickBreadcrumb(e){ + var $el = $(e.target).closest('.crumb'); + e.preventDefault(); + FileList.changeDirectory(decodeURIComponent($el.data('dir'))); +} diff --git a/apps/files/js/jquery.fileupload.js b/apps/files/js/jquery.fileupload.js index a89e9dc2c4498fe50c7d8a4985bd952c639310f1..f9f6cc3a3821d0cf0c44d231a5b81a9b09366541 100644 --- a/apps/files/js/jquery.fileupload.js +++ b/apps/files/js/jquery.fileupload.js @@ -1,5 +1,5 @@ /* - * jQuery File Upload Plugin 5.9 + * jQuery File Upload Plugin 5.32.2 * https://github.com/blueimp/jQuery-File-Upload * * Copyright 2010, Sebastian Tschan @@ -10,7 +10,7 @@ */ /*jslint nomen: true, unparam: true, regexp: true */ -/*global define, window, document, Blob, FormData, location */ +/*global define, window, document, location, File, Blob, FormData */ (function (factory) { 'use strict'; @@ -27,12 +27,28 @@ }(function ($) { 'use strict'; + // Detect file input support, based on + // http://viljamis.com/blog/2012/file-upload-support-on-mobile/ + $.support.fileInput = !(new RegExp( + // Handle devices which give false positives for the feature detection: + '(Android (1\\.[0156]|2\\.[01]))' + + '|(Windows Phone (OS 7|8\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)' + + '|(w(eb)?OSBrowser)|(webOS)' + + '|(Kindle/(1\\.0|2\\.[05]|3\\.0))' + ).test(window.navigator.userAgent) || + // Feature detection for all other devices: + $('').prop('disabled')); + // The FileReader API is not actually used, but works as feature detection, // as e.g. Safari supports XHR file uploads via the FormData API, // but not non-multipart XHR file uploads: $.support.xhrFileUpload = !!(window.XMLHttpRequestUpload && window.FileReader); $.support.xhrFormDataFileUpload = !!window.FormData; + // Detect support for Blob slicing (required for chunked uploads): + $.support.blobSlice = window.Blob && (Blob.prototype.slice || + Blob.prototype.webkitSlice || Blob.prototype.mozSlice); + // The fileupload widget listens for change events on file input fields defined // via fileInput setting and paste or drop events of the given dropZone. // In addition to the default jQuery Widget methods, the fileupload widget @@ -44,17 +60,16 @@ $.widget('blueimp.fileupload', { options: { - // The namespace used for event handler binding on the dropZone and - // fileInput collections. - // If not set, the name of the widget ("fileupload") is used. - namespace: undefined, - // The drop target collection, by the default the complete document. - // Set to null or an empty collection to disable drag & drop support: + // The drop target element(s), by the default the complete document. + // Set to null to disable drag & drop support: dropZone: $(document), - // The file input field collection, that is listened for change events. + // The paste target element(s), by the default the complete document. + // Set to null to disable paste support: + pasteZone: $(document), + // The file input field(s), that are listened to for change events. // If undefined, it is set to the file input fields inside // of the widget element on plugin initialization. - // Set to null or an empty collection to disable the change listener. + // Set to null to disable the change listener. fileInput: undefined, // By default, the file input field is replaced with a clone after // each input field change event. This is required for iframe transport @@ -63,7 +78,8 @@ replaceFileInput: true, // The parameter name for the file form data (the request argument name). // If undefined or empty, the name property of the file input field is - // used, or "files[]" if the file input name property is also empty: + // used, or "files[]" if the file input name property is also empty, + // can be a string or an array of strings: paramName: undefined, // By default, each file of a selection is uploaded using an individual // request for XHR type uploads. Set to false to upload file @@ -108,6 +124,29 @@ // global progress calculation. Set the following option to false to // prevent recalculating the global progress data: recalculateProgress: true, + // Interval in milliseconds to calculate and trigger progress events: + progressInterval: 100, + // Interval in milliseconds to calculate progress bitrate: + bitrateInterval: 500, + // By default, uploads are started automatically when adding files: + autoUpload: true, + + // Error and info messages: + messages: { + uploadedBytes: 'Uploaded bytes exceed file size' + }, + + // Translation function, gets the message key to be translated + // and an object with context specific data as arguments: + i18n: function (message, context) { + message = this.messages[message] || message.toString(); + if (context) { + $.each(context, function (key, value) { + message = message.replace('{' + key + '}', value); + }); + } + return message; + }, // Additional form data to be sent along with the file uploads can be set // using this option, which accepts an array of objects with name and @@ -121,48 +160,81 @@ // The add callback is invoked as soon as files are added to the fileupload // widget (via file input selection, drag & drop, paste or add API call). // If the singleFileUploads option is enabled, this callback will be - // called once for each file in the selection for XHR file uplaods, else + // called once for each file in the selection for XHR file uploads, else // once for each file selection. + // // The upload starts when the submit method is invoked on the data parameter. // The data object contains a files property holding the added files - // and allows to override plugin options as well as define ajax settings. + // and allows you to override plugin options as well as define ajax settings. + // // Listeners for this callback can also be bound the following way: // .bind('fileuploadadd', func); + // // data.submit() returns a Promise object and allows to attach additional // handlers using jQuery's Deferred callbacks: // data.submit().done(func).fail(func).always(func); add: function (e, data) { - data.submit(); + if (data.autoUpload || (data.autoUpload !== false && + $(this).fileupload('option', 'autoUpload'))) { + data.process().done(function () { + data.submit(); + }); + } }, // Other callbacks: + // Callback for the submit event of each file upload: // submit: function (e, data) {}, // .bind('fileuploadsubmit', func); + // Callback for the start of each file upload request: // send: function (e, data) {}, // .bind('fileuploadsend', func); + // Callback for successful uploads: // done: function (e, data) {}, // .bind('fileuploaddone', func); + // Callback for failed (abort or error) uploads: // fail: function (e, data) {}, // .bind('fileuploadfail', func); + // Callback for completed (success, abort or error) requests: // always: function (e, data) {}, // .bind('fileuploadalways', func); + // Callback for upload progress events: // progress: function (e, data) {}, // .bind('fileuploadprogress', func); + // Callback for global upload progress events: // progressall: function (e, data) {}, // .bind('fileuploadprogressall', func); + // Callback for uploads start, equivalent to the global ajaxStart event: // start: function (e) {}, // .bind('fileuploadstart', func); + // Callback for uploads stop, equivalent to the global ajaxStop event: // stop: function (e) {}, // .bind('fileuploadstop', func); - // Callback for change events of the fileInput collection: + + // Callback for change events of the fileInput(s): // change: function (e, data) {}, // .bind('fileuploadchange', func); - // Callback for paste events to the dropZone collection: + + // Callback for paste events to the pasteZone(s): // paste: function (e, data) {}, // .bind('fileuploadpaste', func); - // Callback for drop events of the dropZone collection: + + // Callback for drop events of the dropZone(s): // drop: function (e, data) {}, // .bind('fileuploaddrop', func); - // Callback for dragover events of the dropZone collection: + + // Callback for dragover events of the dropZone(s): // dragover: function (e) {}, // .bind('fileuploaddragover', func); + // Callback for the start of each chunk upload request: + // chunksend: function (e, data) {}, // .bind('fileuploadchunksend', func); + + // Callback for successful chunk uploads: + // chunkdone: function (e, data) {}, // .bind('fileuploadchunkdone', func); + + // Callback for failed (abort or error) chunk uploads: + // chunkfail: function (e, data) {}, // .bind('fileuploadchunkfail', func); + + // Callback for completed (success, abort or error) chunk upload requests: + // chunkalways: function (e, data) {}, // .bind('fileuploadchunkalways', func); + // The plugin options are used as settings object for the ajax calls. // The following are jQuery ajax settings required for the file uploads: processData: false, @@ -170,15 +242,36 @@ cache: false }, - // A list of options that require a refresh after assigning a new value: - _refreshOptionsList: [ - 'namespace', - 'dropZone', + // A list of options that require reinitializing event listeners and/or + // special initialization code: + _specialOptions: [ 'fileInput', + 'dropZone', + 'pasteZone', 'multipart', 'forceIframeTransport' ], + _blobSlice: $.support.blobSlice && function () { + var slice = this.slice || this.webkitSlice || this.mozSlice; + return slice.apply(this, arguments); + }, + + _BitrateTimer: function () { + this.timestamp = ((Date.now) ? Date.now() : (new Date()).getTime()); + this.loaded = 0; + this.bitrate = 0; + this.getBitrate = function (now, loaded, interval) { + var timeDiff = now - this.timestamp; + if (!this.bitrate || !interval || timeDiff > interval) { + this.bitrate = (loaded - this.loaded) * (1000 / timeDiff) * 8; + this.loaded = loaded; + this.timestamp = now; + } + return this.bitrate; + }; + }, + _isXHRUpload: function (options) { return !options.forceIframeTransport && ((!options.multipart && $.support.xhrFileUpload) || @@ -189,9 +282,11 @@ var formData; if (typeof options.formData === 'function') { return options.formData(options.form); - } else if ($.isArray(options.formData)) { + } + if ($.isArray(options.formData)) { return options.formData; - } else if (options.formData) { + } + if ($.type(options.formData) === 'object') { formData = []; $.each(options.formData, function (name, value) { formData.push({name: name, value: value}); @@ -209,28 +304,66 @@ return total; }, + _initProgressObject: function (obj) { + var progress = { + loaded: 0, + total: 0, + bitrate: 0 + }; + if (obj._progress) { + $.extend(obj._progress, progress); + } else { + obj._progress = progress; + } + }, + + _initResponseObject: function (obj) { + var prop; + if (obj._response) { + for (prop in obj._response) { + if (obj._response.hasOwnProperty(prop)) { + delete obj._response[prop]; + } + } + } else { + obj._response = {}; + } + }, + _onProgress: function (e, data) { if (e.lengthComputable) { - var total = data.total || this._getTotal(data.files), - loaded = parseInt( - e.loaded / e.total * (data.chunkSize || total), - 10 - ) + (data.uploadedBytes || 0); - this._loaded += loaded - (data.loaded || data.uploadedBytes || 0); - data.lengthComputable = true; - data.loaded = loaded; - data.total = total; + var now = ((Date.now) ? Date.now() : (new Date()).getTime()), + loaded; + if (data._time && data.progressInterval && + (now - data._time < data.progressInterval) && + e.loaded !== e.total) { + return; + } + data._time = now; + loaded = Math.floor( + e.loaded / e.total * (data.chunkSize || data._progress.total) + ) + (data.uploadedBytes || 0); + // Add the difference from the previously loaded state + // to the global loaded counter: + this._progress.loaded += (loaded - data._progress.loaded); + this._progress.bitrate = this._bitrateTimer.getBitrate( + now, + this._progress.loaded, + data.bitrateInterval + ); + data._progress.loaded = data.loaded = loaded; + data._progress.bitrate = data.bitrate = data._bitrateTimer.getBitrate( + now, + loaded, + data.bitrateInterval + ); // Trigger a custom progress event with a total data property set // to the file size(s) of the current upload and a loaded data // property calculated accordingly: this._trigger('progress', e, data); // Trigger a global progress event for all current file uploads, // including ajax calls queued for sequential file uploads: - this._trigger('progressall', e, { - lengthComputable: true, - loaded: this._loaded, - total: this._total - }); + this._trigger('progressall', e, this._progress); } }, @@ -254,34 +387,30 @@ } }, + _isInstanceOf: function (type, obj) { + // Cross-frame instanceof check + return Object.prototype.toString.call(obj) === '[object ' + type + ']'; + }, + _initXHRData: function (options) { - var formData, + var that = this, + formData, file = options.files[0], // Ignore non-multipart setting if not supported: - multipart = options.multipart || !$.support.xhrFileUpload; - if (!multipart || options.blob) { - // For non-multipart uploads and chunked uploads, - // file meta data is not part of the request body, - // so we transmit this data as part of the HTTP headers. - // For cross domain requests, these headers must be allowed - // via Access-Control-Allow-Headers or removed using - // the beforeSend callback: - options.headers = $.extend(options.headers, { - 'X-File-Name': file.name, - 'X-File-Type': file.type, - 'X-File-Size': file.size - }); - if (!options.blob) { - // Non-chunked non-multipart upload: - options.contentType = file.type; - options.data = file; - } else if (!multipart) { - // Chunked non-multipart upload: - options.contentType = 'application/octet-stream'; - options.data = options.blob; - } + multipart = options.multipart || !$.support.xhrFileUpload, + paramName = options.paramName[0]; + options.headers = options.headers || {}; + if (options.contentRange) { + options.headers['Content-Range'] = options.contentRange; + } + if (!multipart || options.blob || !this._isInstanceOf('File', file)) { + options.headers['Content-Disposition'] = 'attachment; filename="' + + encodeURI(file.name) + '"'; } - if (multipart && $.support.xhrFormDataFileUpload) { + if (!multipart) { + options.contentType = file.type; + options.data = options.blob || file; + } else if ($.support.xhrFormDataFileUpload) { if (options.postMessage) { // window.postMessage does not allow sending FormData // objects, so we just add the File/Blob objects to @@ -290,19 +419,19 @@ formData = this._getFormData(options); if (options.blob) { formData.push({ - name: options.paramName, + name: paramName, value: options.blob }); } else { $.each(options.files, function (index, file) { formData.push({ - name: options.paramName, + name: options.paramName[index] || paramName, value: file }); }); } } else { - if (options.formData instanceof FormData) { + if (that._isInstanceOf('FormData', options.formData)) { formData = options.formData; } else { formData = new FormData(); @@ -311,14 +440,18 @@ }); } if (options.blob) { - formData.append(options.paramName, options.blob, file.name); + formData.append(paramName, options.blob, file.name); } else { $.each(options.files, function (index, file) { - // File objects are also Blob instances. // This check allows the tests to run with // dummy objects: - if (file instanceof Blob) { - formData.append(options.paramName, file, file.name); + if (that._isInstanceOf('File', file) || + that._isInstanceOf('Blob', file)) { + formData.append( + options.paramName[index] || paramName, + file, + file.name + ); } }); } @@ -330,13 +463,13 @@ }, _initIframeSettings: function (options) { + var targetHost = $('').prop('href', options.url).prop('host'); // Setting the dataType to iframe enables the iframe transport: options.dataType = 'iframe ' + (options.dataType || ''); // The iframe transport accepts a serialized array as form data: options.formData = this._getFormData(options); // Add redirect url to form data on cross-domain uploads: - if (options.redirect && $('').prop('href', options.url) - .prop('host') !== location.host) { + if (options.redirect && targetHost && targetHost !== location.host) { options.formData.push({ name: options.redirectParamName || 'redirect', value: options.redirect @@ -358,29 +491,58 @@ options.dataType = 'postmessage ' + (options.dataType || ''); } } else { - this._initIframeSettings(options, 'iframe'); + this._initIframeSettings(options); } }, + _getParamName: function (options) { + var fileInput = $(options.fileInput), + paramName = options.paramName; + if (!paramName) { + paramName = []; + fileInput.each(function () { + var input = $(this), + name = input.prop('name') || 'files[]', + i = (input.prop('files') || [1]).length; + while (i) { + paramName.push(name); + i -= 1; + } + }); + if (!paramName.length) { + paramName = [fileInput.prop('name') || 'files[]']; + } + } else if (!$.isArray(paramName)) { + paramName = [paramName]; + } + return paramName; + }, + _initFormSettings: function (options) { // Retrieve missing options from the input field and the // associated form, if available: if (!options.form || !options.form.length) { options.form = $(options.fileInput.prop('form')); + // If the given file input doesn't have an associated form, + // use the default widget file input's form: + if (!options.form.length) { + options.form = $(this.options.fileInput.prop('form')); + } } - if (!options.paramName) { - options.paramName = options.fileInput.prop('name') || - 'files[]'; - } + options.paramName = this._getParamName(options); if (!options.url) { options.url = options.form.prop('action') || location.href; } // The HTTP request method must be "POST" or "PUT": options.type = (options.type || options.form.prop('method') || '') .toUpperCase(); - if (options.type !== 'POST' && options.type !== 'PUT') { + if (options.type !== 'POST' && options.type !== 'PUT' && + options.type !== 'PATCH') { options.type = 'POST'; } + if (!options.formAcceptCharset) { + options.formAcceptCharset = options.form.attr('accept-charset'); + } }, _getAJAXSettings: function (data) { @@ -390,6 +552,21 @@ return options; }, + // jQuery 1.6 doesn't provide .state(), + // while jQuery 1.8+ removed .isRejected() and .isResolved(): + _getDeferredState: function (deferred) { + if (deferred.state) { + return deferred.state(); + } + if (deferred.isResolved()) { + return 'resolved'; + } + if (deferred.isRejected()) { + return 'rejected'; + } + return 'pending'; + }, + // Maps jqXHR callbacks to the equivalent // methods of the given Promise object: _enhancePromise: function (promise) { @@ -414,24 +591,77 @@ return this._enhancePromise(promise); }, + // Adds convenience methods to the data callback argument: + _addConvenienceMethods: function (e, data) { + var that = this, + getPromise = function (data) { + return $.Deferred().resolveWith(that, [data]).promise(); + }; + data.process = function (resolveFunc, rejectFunc) { + if (resolveFunc || rejectFunc) { + data._processQueue = this._processQueue = + (this._processQueue || getPromise(this)) + .pipe(resolveFunc, rejectFunc); + } + return this._processQueue || getPromise(this); + }; + data.submit = function () { + if (this.state() !== 'pending') { + data.jqXHR = this.jqXHR = + (that._trigger('submit', e, this) !== false) && + that._onSend(e, this); + } + return this.jqXHR || that._getXHRPromise(); + }; + data.abort = function () { + if (this.jqXHR) { + return this.jqXHR.abort(); + } + return that._getXHRPromise(); + }; + data.state = function () { + if (this.jqXHR) { + return that._getDeferredState(this.jqXHR); + } + if (this._processQueue) { + return that._getDeferredState(this._processQueue); + } + }; + data.progress = function () { + return this._progress; + }; + data.response = function () { + return this._response; + }; + }, + + // Parses the Range header from the server response + // and returns the uploaded bytes: + _getUploadedBytes: function (jqXHR) { + var range = jqXHR.getResponseHeader('Range'), + parts = range && range.split('-'), + upperBytesPos = parts && parts.length > 1 && + parseInt(parts[1], 10); + return upperBytesPos && upperBytesPos + 1; + }, + // Uploads a file in multiple, sequential requests // by splitting the file up in multiple blob chunks. // If the second parameter is true, only tests if the file // should be uploaded in chunks, but does not invoke any // upload requests: _chunkedUpload: function (options, testOnly) { + options.uploadedBytes = options.uploadedBytes || 0; var that = this, file = options.files[0], fs = file.size, - ub = options.uploadedBytes = options.uploadedBytes || 0, + ub = options.uploadedBytes, mcs = options.maxChunkSize || fs, - // Use the Blob methods with the slice implementation - // according to the W3C Blob API specification: - slice = file.webkitSlice || file.mozSlice || file.slice, - upload, - n, + slice = this._blobSlice, + dfd = $.Deferred(), + promise = dfd.promise(), jqXHR, - pipe; + upload; if (!(this._isXHRUpload(options) && slice && (ub || mcs < fs)) || options.data) { return false; @@ -440,62 +670,84 @@ return true; } if (ub >= fs) { - file.error = 'uploadedBytes'; + file.error = options.i18n('uploadedBytes'); return this._getXHRPromise( false, options.context, [null, 'error', file.error] ); } - // n is the number of blobs to upload, - // calculated via filesize, uploaded bytes and max chunk size: - n = Math.ceil((fs - ub) / mcs); - // The chunk upload method accepting the chunk number as parameter: - upload = function (i) { - if (!i) { - return that._getXHRPromise(true, options.context); - } - // Upload the blobs in sequential order: - return upload(i -= 1).pipe(function () { - // Clone the options object for each chunk upload: - var o = $.extend({}, options); - o.blob = slice.call( - file, - ub + i * mcs, - ub + (i + 1) * mcs - ); - // Store the current chunk size, as the blob itself - // will be dereferenced after data processing: - o.chunkSize = o.blob.size; - // Process the upload data (the blob and potential form data): - that._initXHRData(o); - // Add progress listeners for this chunk upload: - that._initProgressListener(o); - jqXHR = ($.ajax(o) || that._getXHRPromise(false, o.context)) - .done(function () { - // Create a progress event if upload is done and - // no progress event has been invoked for this chunk: - if (!o.loaded) { - that._onProgress($.Event('progress', { - lengthComputable: true, - loaded: o.chunkSize, - total: o.chunkSize - }), o); - } - options.uploadedBytes = o.uploadedBytes += - o.chunkSize; - }); - return jqXHR; - }); + // The chunk upload method: + upload = function () { + // Clone the options object for each chunk upload: + var o = $.extend({}, options), + currentLoaded = o._progress.loaded; + o.blob = slice.call( + file, + ub, + ub + mcs, + file.type + ); + // Store the current chunk size, as the blob itself + // will be dereferenced after data processing: + o.chunkSize = o.blob.size; + // Expose the chunk bytes position range: + o.contentRange = 'bytes ' + ub + '-' + + (ub + o.chunkSize - 1) + '/' + fs; + // Process the upload data (the blob and potential form data): + that._initXHRData(o); + // Add progress listeners for this chunk upload: + that._initProgressListener(o); + jqXHR = ((that._trigger('chunksend', null, o) !== false && $.ajax(o)) || + that._getXHRPromise(false, o.context)) + .done(function (result, textStatus, jqXHR) { + ub = that._getUploadedBytes(jqXHR) || + (ub + o.chunkSize); + // Create a progress event if no final progress event + // with loaded equaling total has been triggered + // for this chunk: + if (currentLoaded + o.chunkSize - o._progress.loaded) { + that._onProgress($.Event('progress', { + lengthComputable: true, + loaded: ub - o.uploadedBytes, + total: ub - o.uploadedBytes + }), o); + } + options.uploadedBytes = o.uploadedBytes = ub; + o.result = result; + o.textStatus = textStatus; + o.jqXHR = jqXHR; + that._trigger('chunkdone', null, o); + that._trigger('chunkalways', null, o); + if (ub < fs) { + // File upload not yet complete, + // continue with the next chunk: + upload(); + } else { + dfd.resolveWith( + o.context, + [result, textStatus, jqXHR] + ); + } + }) + .fail(function (jqXHR, textStatus, errorThrown) { + o.jqXHR = jqXHR; + o.textStatus = textStatus; + o.errorThrown = errorThrown; + that._trigger('chunkfail', null, o); + that._trigger('chunkalways', null, o); + dfd.rejectWith( + o.context, + [jqXHR, textStatus, errorThrown] + ); + }); }; - // Return the piped Promise object, enhanced with an abort method, - // which is delegated to the jqXHR object of the current upload, - // and jqXHR callbacks mapped to the equivalent Promise methods: - pipe = upload(n); - pipe.abort = function () { + this._enhancePromise(promise); + promise.abort = function () { return jqXHR.abort(); }; - return this._enhancePromise(pipe); + upload(); + return promise; }, _beforeSend: function (e, data) { @@ -504,99 +756,113 @@ // and no other uploads are currently running, // equivalent to the global ajaxStart event: this._trigger('start'); + // Set timer for global bitrate progress calculation: + this._bitrateTimer = new this._BitrateTimer(); + // Reset the global progress values: + this._progress.loaded = this._progress.total = 0; + this._progress.bitrate = 0; } + // Make sure the container objects for the .response() and + // .progress() methods on the data object are available + // and reset to their initial state: + this._initResponseObject(data); + this._initProgressObject(data); + data._progress.loaded = data.loaded = data.uploadedBytes || 0; + data._progress.total = data.total = this._getTotal(data.files) || 1; + data._progress.bitrate = data.bitrate = 0; this._active += 1; // Initialize the global progress values: - this._loaded += data.uploadedBytes || 0; - this._total += this._getTotal(data.files); + this._progress.loaded += data.loaded; + this._progress.total += data.total; }, _onDone: function (result, textStatus, jqXHR, options) { - if (!this._isXHRUpload(options)) { - // Create a progress event for each iframe load: + var total = options._progress.total, + response = options._response; + if (options._progress.loaded < total) { + // Create a progress event if no final progress event + // with loaded equaling total has been triggered: this._onProgress($.Event('progress', { lengthComputable: true, - loaded: 1, - total: 1 + loaded: total, + total: total }), options); } - options.result = result; - options.textStatus = textStatus; - options.jqXHR = jqXHR; + response.result = options.result = result; + response.textStatus = options.textStatus = textStatus; + response.jqXHR = options.jqXHR = jqXHR; this._trigger('done', null, options); }, _onFail: function (jqXHR, textStatus, errorThrown, options) { - options.jqXHR = jqXHR; - options.textStatus = textStatus; - options.errorThrown = errorThrown; - this._trigger('fail', null, options); + var response = options._response; if (options.recalculateProgress) { // Remove the failed (error or abort) file upload from // the global progress calculation: - this._loaded -= options.loaded || options.uploadedBytes || 0; - this._total -= options.total || this._getTotal(options.files); + this._progress.loaded -= options._progress.loaded; + this._progress.total -= options._progress.total; } + response.jqXHR = options.jqXHR = jqXHR; + response.textStatus = options.textStatus = textStatus; + response.errorThrown = options.errorThrown = errorThrown; + this._trigger('fail', null, options); }, _onAlways: function (jqXHRorResult, textStatus, jqXHRorError, options) { - this._active -= 1; - options.textStatus = textStatus; - if (jqXHRorError && jqXHRorError.always) { - options.jqXHR = jqXHRorError; - options.result = jqXHRorResult; - } else { - options.jqXHR = jqXHRorResult; - options.errorThrown = jqXHRorError; - } + // jqXHRorResult, textStatus and jqXHRorError are added to the + // options object via done and fail callbacks this._trigger('always', null, options); - if (this._active === 0) { - // The stop callback is triggered when all uploads have - // been completed, equivalent to the global ajaxStop event: - this._trigger('stop'); - // Reset the global progress values: - this._loaded = this._total = 0; - } }, _onSend: function (e, data) { + if (!data.submit) { + this._addConvenienceMethods(e, data); + } var that = this, jqXHR, + aborted, slot, pipe, options = that._getAJAXSettings(data), - send = function (resolve, args) { + send = function () { that._sending += 1; + // Set timer for bitrate progress calculation: + options._bitrateTimer = new that._BitrateTimer(); jqXHR = jqXHR || ( - (resolve !== false && - that._trigger('send', e, options) !== false && - (that._chunkedUpload(options) || $.ajax(options))) || - that._getXHRPromise(false, options.context, args) + ((aborted || that._trigger('send', e, options) === false) && + that._getXHRPromise(false, options.context, aborted)) || + that._chunkedUpload(options) || $.ajax(options) ).done(function (result, textStatus, jqXHR) { that._onDone(result, textStatus, jqXHR, options); }).fail(function (jqXHR, textStatus, errorThrown) { that._onFail(jqXHR, textStatus, errorThrown, options); }).always(function (jqXHRorResult, textStatus, jqXHRorError) { - that._sending -= 1; that._onAlways( jqXHRorResult, textStatus, jqXHRorError, options ); + that._sending -= 1; + that._active -= 1; if (options.limitConcurrentUploads && options.limitConcurrentUploads > that._sending) { // Start the next queued upload, // that has not been aborted: var nextSlot = that._slots.shift(); while (nextSlot) { - if (!nextSlot.isRejected()) { + if (that._getDeferredState(nextSlot) === 'pending') { nextSlot.resolve(); break; } nextSlot = that._slots.shift(); } } + if (that._active === 0) { + // The stop callback is triggered when all uploads have + // been completed, equivalent to the global ajaxStop event: + that._trigger('stop'); + } }); return jqXHR; }; @@ -609,18 +875,19 @@ this._slots.push(slot); pipe = slot.pipe(send); } else { - pipe = (this._sequence = this._sequence.pipe(send, send)); + this._sequence = this._sequence.pipe(send, send); + pipe = this._sequence; } // Return the piped Promise object, enhanced with an abort method, // which is delegated to the jqXHR object of the current upload, // and jqXHR callbacks mapped to the equivalent Promise methods: pipe.abort = function () { - var args = [undefined, 'abort', 'abort']; + aborted = [undefined, 'abort', 'abort']; if (!jqXHR) { if (slot) { - slot.rejectWith(args); + slot.rejectWith(options.context, aborted); } - return send(false, args); + return send(); } return jqXHR.abort(); }; @@ -634,40 +901,43 @@ result = true, options = $.extend({}, this.options, data), limit = options.limitMultiFileUploads, + paramName = this._getParamName(options), + paramNameSet, + paramNameSlice, fileSet, i; if (!(options.singleFileUploads || limit) || !this._isXHRUpload(options)) { fileSet = [data.files]; + paramNameSet = [paramName]; } else if (!options.singleFileUploads && limit) { fileSet = []; + paramNameSet = []; for (i = 0; i < data.files.length; i += limit) { fileSet.push(data.files.slice(i, i + limit)); + paramNameSlice = paramName.slice(i, i + limit); + if (!paramNameSlice.length) { + paramNameSlice = paramName; + } + paramNameSet.push(paramNameSlice); } + } else { + paramNameSet = paramName; } data.originalFiles = data.files; $.each(fileSet || data.files, function (index, element) { - var files = fileSet ? element : [element], - newData = $.extend({}, data, {files: files}); - newData.submit = function () { - newData.jqXHR = this.jqXHR = - (that._trigger('submit', e, this) !== false) && - that._onSend(e, this); - return this.jqXHR; - }; - return (result = that._trigger('add', e, newData)); + var newData = $.extend({}, data); + newData.files = fileSet ? element : [element]; + newData.paramName = paramNameSet[index]; + that._initResponseObject(newData); + that._initProgressObject(newData); + that._addConvenienceMethods(e, newData); + result = that._trigger('add', e, newData); + return result; }); return result; }, - // File Normalization for Gecko 1.9.1 (Firefox 3.5) support: - _normalizeFile: function (index, file) { - if (file.name === undefined && file.size === undefined) { - file.name = file.fileName; - file.size = file.fileSize; - } - }, - _replaceFileInput: function (input) { var inputClone = input.clone(true); $('
').append(inputClone)[0].reset(); @@ -677,7 +947,7 @@ // Avoid memory leaks with the detached file input: $.cleanData(input.unbind('remove')); // Replace the original file input element in the fileInput - // collection with the clone, which has been copied including + // elements set with the clone, which has been copied including // event handlers: this.options.fileInput = this.options.fileInput.map(function (i, el) { if (el === input[0]) { @@ -692,102 +962,229 @@ } }, - _onChange: function (e) { - var that = e.data.fileupload, - data = { - files: $.each($.makeArray(e.target.files), that._normalizeFile), - fileInput: $(e.target), - form: $(e.target.form) - }; - if (!data.files.length) { + _handleFileTreeEntry: function (entry, path) { + var that = this, + dfd = $.Deferred(), + errorHandler = function (e) { + if (e && !e.entry) { + e.entry = entry; + } + // Since $.when returns immediately if one + // Deferred is rejected, we use resolve instead. + // This allows valid files and invalid items + // to be returned together in one set: + dfd.resolve([e]); + }, + dirReader; + path = path || ''; + if (entry.isFile) { + if (entry._file) { + // Workaround for Chrome bug #149735 + entry._file.relativePath = path; + dfd.resolve(entry._file); + } else { + entry.file(function (file) { + file.relativePath = path; + dfd.resolve(file); + }, errorHandler); + } + } else if (entry.isDirectory) { + dirReader = entry.createReader(); + dirReader.readEntries(function (entries) { + that._handleFileTreeEntries( + entries, + path + entry.name + '/' + ).done(function (files) { + dfd.resolve(files); + }).fail(errorHandler); + }, errorHandler); + } else { + // Return an empy list for file system items + // other than files or directories: + dfd.resolve([]); + } + return dfd.promise(); + }, + + _handleFileTreeEntries: function (entries, path) { + var that = this; + return $.when.apply( + $, + $.map(entries, function (entry) { + return that._handleFileTreeEntry(entry, path); + }) + ).pipe(function () { + return Array.prototype.concat.apply( + [], + arguments + ); + }); + }, + + _getDroppedFiles: function (dataTransfer) { + dataTransfer = dataTransfer || {}; + var items = dataTransfer.items; + if (items && items.length && (items[0].webkitGetAsEntry || + items[0].getAsEntry)) { + return this._handleFileTreeEntries( + $.map(items, function (item) { + var entry; + if (item.webkitGetAsEntry) { + entry = item.webkitGetAsEntry(); + if (entry) { + // Workaround for Chrome bug #149735: + entry._file = item.getAsFile(); + } + return entry; + } + return item.getAsEntry(); + }) + ); + } + return $.Deferred().resolve( + $.makeArray(dataTransfer.files) + ).promise(); + }, + + _getSingleFileInputFiles: function (fileInput) { + fileInput = $(fileInput); + var entries = fileInput.prop('webkitEntries') || + fileInput.prop('entries'), + files, + value; + if (entries && entries.length) { + return this._handleFileTreeEntries(entries); + } + files = $.makeArray(fileInput.prop('files')); + if (!files.length) { + value = fileInput.prop('value'); + if (!value) { + return $.Deferred().resolve([]).promise(); + } // If the files property is not available, the browser does not // support the File API and we add a pseudo File object with // the input value as name with path information removed: - data.files = [{name: e.target.value.replace(/^.*\\/, '')}]; - } - if (that.options.replaceFileInput) { - that._replaceFileInput(data.fileInput); + files = [{name: value.replace(/^.*\\/, '')}]; + } else if (files[0].name === undefined && files[0].fileName) { + // File normalization for Safari 4 and Firefox 3: + $.each(files, function (index, file) { + file.name = file.fileName; + file.size = file.fileSize; + }); } - if (that._trigger('change', e, data) === false || - that._onAdd(e, data) === false) { - return false; + return $.Deferred().resolve(files).promise(); + }, + + _getFileInputFiles: function (fileInput) { + if (!(fileInput instanceof $) || fileInput.length === 1) { + return this._getSingleFileInputFiles(fileInput); } + return $.when.apply( + $, + $.map(fileInput, this._getSingleFileInputFiles) + ).pipe(function () { + return Array.prototype.concat.apply( + [], + arguments + ); + }); + }, + + _onChange: function (e) { + var that = this, + data = { + fileInput: $(e.target), + form: $(e.target.form) + }; + this._getFileInputFiles(data.fileInput).always(function (files) { + data.files = files; + if (that.options.replaceFileInput) { + that._replaceFileInput(data.fileInput); + } + if (that._trigger('change', e, data) !== false) { + that._onAdd(e, data); + } + }); }, _onPaste: function (e) { - var that = e.data.fileupload, - cbd = e.originalEvent.clipboardData, - items = (cbd && cbd.items) || [], + var items = e.originalEvent && e.originalEvent.clipboardData && + e.originalEvent.clipboardData.items, data = {files: []}; - $.each(items, function (index, item) { - var file = item.getAsFile && item.getAsFile(); - if (file) { - data.files.push(file); + if (items && items.length) { + $.each(items, function (index, item) { + var file = item.getAsFile && item.getAsFile(); + if (file) { + data.files.push(file); + } + }); + if (this._trigger('paste', e, data) === false || + this._onAdd(e, data) === false) { + return false; } - }); - if (that._trigger('paste', e, data) === false || - that._onAdd(e, data) === false) { - return false; } }, _onDrop: function (e) { - var that = e.data.fileupload, - dataTransfer = e.dataTransfer = e.originalEvent.dataTransfer, - data = { - files: $.each( - $.makeArray(dataTransfer && dataTransfer.files), - that._normalizeFile - ) - }; - if (that._trigger('drop', e, data) === false || - that._onAdd(e, data) === false) { - return false; + e.dataTransfer = e.originalEvent && e.originalEvent.dataTransfer; + var that = this, + dataTransfer = e.dataTransfer, + data = {}; + if (dataTransfer && dataTransfer.files && dataTransfer.files.length) { + e.preventDefault(); + this._getDroppedFiles(dataTransfer).always(function (files) { + data.files = files; + if (that._trigger('drop', e, data) !== false) { + that._onAdd(e, data); + } + }); } - e.preventDefault(); }, _onDragOver: function (e) { - var that = e.data.fileupload, - dataTransfer = e.dataTransfer = e.originalEvent.dataTransfer; - if (that._trigger('dragover', e) === false) { - return false; - } + e.dataTransfer = e.originalEvent && e.originalEvent.dataTransfer; + var dataTransfer = e.dataTransfer; if (dataTransfer) { - dataTransfer.dropEffect = dataTransfer.effectAllowed = 'copy'; + if (this._trigger('dragover', e) === false) { + return false; + } + if ($.inArray('Files', dataTransfer.types) !== -1) { + dataTransfer.dropEffect = 'copy'; + e.preventDefault(); + } } - e.preventDefault(); }, _initEventHandlers: function () { - var ns = this.options.namespace; if (this._isXHRUpload(this.options)) { - this.options.dropZone - .bind('dragover.' + ns, {fileupload: this}, this._onDragOver) - .bind('drop.' + ns, {fileupload: this}, this._onDrop) - .bind('paste.' + ns, {fileupload: this}, this._onPaste); + this._on(this.options.dropZone, { + dragover: this._onDragOver, + drop: this._onDrop + }); + this._on(this.options.pasteZone, { + paste: this._onPaste + }); + } + if ($.support.fileInput) { + this._on(this.options.fileInput, { + change: this._onChange + }); } - this.options.fileInput - .bind('change.' + ns, {fileupload: this}, this._onChange); }, _destroyEventHandlers: function () { - var ns = this.options.namespace; - this.options.dropZone - .unbind('dragover.' + ns, this._onDragOver) - .unbind('drop.' + ns, this._onDrop) - .unbind('paste.' + ns, this._onPaste); - this.options.fileInput - .unbind('change.' + ns, this._onChange); + this._off(this.options.dropZone, 'dragover drop'); + this._off(this.options.pasteZone, 'paste'); + this._off(this.options.fileInput, 'change'); }, _setOption: function (key, value) { - var refresh = $.inArray(key, this._refreshOptionsList) !== -1; - if (refresh) { + var reinit = $.inArray(key, this._specialOptions) !== -1; + if (reinit) { this._destroyEventHandlers(); } - $.Widget.prototype._setOption.call(this, key, value); - if (refresh) { + this._super(key, value); + if (reinit) { this._initSpecialOptions(); this._initEventHandlers(); } @@ -796,42 +1193,68 @@ _initSpecialOptions: function () { var options = this.options; if (options.fileInput === undefined) { - options.fileInput = this.element.is('input:file') ? - this.element : this.element.find('input:file'); + options.fileInput = this.element.is('input[type="file"]') ? + this.element : this.element.find('input[type="file"]'); } else if (!(options.fileInput instanceof $)) { options.fileInput = $(options.fileInput); } if (!(options.dropZone instanceof $)) { options.dropZone = $(options.dropZone); } + if (!(options.pasteZone instanceof $)) { + options.pasteZone = $(options.pasteZone); + } + }, + + _getRegExp: function (str) { + var parts = str.split('/'), + modifiers = parts.pop(); + parts.shift(); + return new RegExp(parts.join('/'), modifiers); + }, + + _isRegExpOption: function (key, value) { + return key !== 'url' && $.type(value) === 'string' && + /^\/.*\/[igm]{0,3}$/.test(value); + }, + + _initDataAttributes: function () { + var that = this, + options = this.options; + // Initialize options set via HTML5 data-attributes: + $.each( + $(this.element[0].cloneNode(false)).data(), + function (key, value) { + if (that._isRegExpOption(key, value)) { + value = that._getRegExp(value); + } + options[key] = value; + } + ); }, _create: function () { - var options = this.options, - dataOpts = $.extend({}, this.element.data()); - dataOpts[this.widgetName] = undefined; - $.extend(options, dataOpts); - options.namespace = options.namespace || this.widgetName; + this._initDataAttributes(); this._initSpecialOptions(); this._slots = []; this._sequence = this._getXHRPromise(true); - this._sending = this._active = this._loaded = this._total = 0; + this._sending = this._active = 0; + this._initProgressObject(this); this._initEventHandlers(); }, - destroy: function () { - this._destroyEventHandlers(); - $.Widget.prototype.destroy.call(this); - }, - - enable: function () { - $.Widget.prototype.enable.call(this); - this._initEventHandlers(); + // This method is exposed to the widget API and allows to query + // the number of active uploads: + active: function () { + return this._active; }, - disable: function () { - this._destroyEventHandlers(); - $.Widget.prototype.disable.call(this); + // This method is exposed to the widget API and allows to query + // the widget upload progress. + // It returns an object with loaded, total and bitrate properties + // for the running uploads: + progress: function () { + return this._progress; }, // This method is exposed to the widget API and allows adding files @@ -839,21 +1262,65 @@ // must have a files property and can contain additional options: // .fileupload('add', {files: filesList}); add: function (data) { + var that = this; if (!data || this.options.disabled) { return; } - data.files = $.each($.makeArray(data.files), this._normalizeFile); - this._onAdd(null, data); + if (data.fileInput && !data.files) { + this._getFileInputFiles(data.fileInput).always(function (files) { + data.files = files; + that._onAdd(null, data); + }); + } else { + data.files = $.makeArray(data.files); + this._onAdd(null, data); + } }, // This method is exposed to the widget API and allows sending files // using the fileupload API. The data parameter accepts an object which - // must have a files property and can contain additional options: + // must have a files or fileInput property and can contain additional options: // .fileupload('send', {files: filesList}); // The method returns a Promise object for the file upload call. send: function (data) { if (data && !this.options.disabled) { - data.files = $.each($.makeArray(data.files), this._normalizeFile); + if (data.fileInput && !data.files) { + var that = this, + dfd = $.Deferred(), + promise = dfd.promise(), + jqXHR, + aborted; + promise.abort = function () { + aborted = true; + if (jqXHR) { + return jqXHR.abort(); + } + dfd.reject(null, 'abort', 'abort'); + return promise; + }; + this._getFileInputFiles(data.fileInput).always( + function (files) { + if (aborted) { + return; + } + if (!files.length) { + dfd.reject(); + return; + } + data.files = files; + jqXHR = that._onSend(null, data).then( + function (result, textStatus, jqXHR) { + dfd.resolve(result, textStatus, jqXHR); + }, + function (jqXHR, textStatus, errorThrown) { + dfd.reject(jqXHR, textStatus, errorThrown); + } + ); + } + ); + return this._enhancePromise(promise); + } + data.files = $.makeArray(data.files); if (data.files.length) { return this._onSend(null, data); } @@ -863,4 +1330,4 @@ }); -})); +})); \ No newline at end of file diff --git a/apps/files/js/jquery.iframe-transport.js b/apps/files/js/jquery.iframe-transport.js index d85c0c112973b2f6a433fb4a375adcb1c08f9bf6..5c9df77976bd9044702546dfec120a784c3bbd54 100644 --- a/apps/files/js/jquery.iframe-transport.js +++ b/apps/files/js/jquery.iframe-transport.js @@ -1,5 +1,5 @@ /* - * jQuery Iframe Transport Plugin 1.3 + * jQuery Iframe Transport Plugin 1.7 * https://github.com/blueimp/jQuery-File-Upload * * Copyright 2011, Sebastian Tschan @@ -30,27 +30,45 @@ // The iframe transport accepts three additional options: // options.fileInput: a jQuery collection of file input fields // options.paramName: the parameter name for the file form data, - // overrides the name property of the file input field(s) + // overrides the name property of the file input field(s), + // can be a string or an array of strings. // options.formData: an array of objects with name and value properties, // equivalent to the return data of .serializeArray(), e.g.: // [{name: 'a', value: 1}, {name: 'b', value: 2}] $.ajaxTransport('iframe', function (options) { - if (options.async && (options.type === 'POST' || options.type === 'GET')) { + if (options.async) { var form, - iframe; + iframe, + addParamChar; return { send: function (_, completeCallback) { form = $('
'); + form.attr('accept-charset', options.formAcceptCharset); + addParamChar = /\?/.test(options.url) ? '&' : '?'; + // XDomainRequest only supports GET and POST: + if (options.type === 'DELETE') { + options.url = options.url + addParamChar + '_method=DELETE'; + options.type = 'POST'; + } else if (options.type === 'PUT') { + options.url = options.url + addParamChar + '_method=PUT'; + options.type = 'POST'; + } else if (options.type === 'PATCH') { + options.url = options.url + addParamChar + '_method=PATCH'; + options.type = 'POST'; + } // javascript:false as initial iframe src // prevents warning popups on HTTPS in IE6. // IE versions below IE8 cannot set the name property of // elements that have already been added to the DOM, // so we set the name along with the iframe HTML markup: + counter += 1; iframe = $( '' + counter + '">' ).bind('load', function () { - var fileInputClones; + var fileInputClones, + paramNames = $.isArray(options.paramName) ? + options.paramName : [options.paramName]; iframe .unbind('load') .bind('load', function () { @@ -79,7 +97,12 @@ // (happens on form submits to iframe targets): $('') .appendTo(form); - form.remove(); + window.setTimeout(function () { + // Removing the form in a setTimeout call + // allows Chrome's developer tools to display + // the response result + form.remove(); + }, 0); }); form .prop('target', iframe.prop('name')) @@ -101,8 +124,11 @@ return fileInputClones[index]; }); if (options.paramName) { - options.fileInput.each(function () { - $(this).prop('name', options.paramName); + options.fileInput.each(function (index) { + $(this).prop( + 'name', + paramNames[index] || options.paramName + ); }); } // Appending the file input fields to the hidden form @@ -144,22 +170,36 @@ }); // The iframe transport returns the iframe content document as response. - // The following adds converters from iframe to text, json, html, and script: + // The following adds converters from iframe to text, json, html, xml + // and script. + // Please note that the Content-Type for JSON responses has to be text/plain + // or text/html, if the browser doesn't include application/json in the + // Accept header, else IE will show a download dialog. + // The Content-Type for XML responses on the other hand has to be always + // application/xml or text/xml, so IE properly parses the XML response. + // See also + // https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#content-type-negotiation $.ajaxSetup({ converters: { 'iframe text': function (iframe) { - return $(iframe[0].body).text(); + return iframe && $(iframe[0].body).text(); }, 'iframe json': function (iframe) { - return $.parseJSON($(iframe[0].body).text()); + return iframe && $.parseJSON($(iframe[0].body).text()); }, 'iframe html': function (iframe) { - return $(iframe[0].body).html(); + return iframe && $(iframe[0].body).html(); + }, + 'iframe xml': function (iframe) { + var xmlDoc = iframe && iframe[0]; + return xmlDoc && $.isXMLDoc(xmlDoc) ? xmlDoc : + $.parseXML((xmlDoc.XMLDocument && xmlDoc.XMLDocument.xml) || + $(xmlDoc.body).html()); }, 'iframe script': function (iframe) { - return $.globalEval($(iframe[0].body).text()); + return iframe && $.globalEval($(iframe[0].body).text()); } } }); -})); +})); \ No newline at end of file diff --git a/apps/files/l10n/ach.php b/apps/files/l10n/ach.php new file mode 100644 index 0000000000000000000000000000000000000000..3c711e6b78a257d953a010dc2feba5ae4d139369 --- /dev/null +++ b/apps/files/l10n/ach.php @@ -0,0 +1,7 @@ + array("",""), +"_%n file_::_%n files_" => array("",""), +"_Uploading %n file_::_Uploading %n files_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/apps/files/l10n/af_ZA.php b/apps/files/l10n/af_ZA.php new file mode 100644 index 0000000000000000000000000000000000000000..0157af093e92200cc7790497227e92e62d80165f --- /dev/null +++ b/apps/files/l10n/af_ZA.php @@ -0,0 +1,7 @@ + array("",""), +"_%n file_::_%n files_" => array("",""), +"_Uploading %n file_::_Uploading %n files_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/ar.php b/apps/files/l10n/ar.php index a6c4e65530ce4cc01c64c59a0a4697b3cfbc777a..67a3414819b7e16a320846e4ac01df5aa08d2d7c 100644 --- a/apps/files/l10n/ar.php +++ b/apps/files/l10n/ar.php @@ -2,6 +2,8 @@ $TRANSLATIONS = array( "Could not move %s - File with this name already exists" => "فشل في نقل الملف %s - يوجد ملف بنفس هذا الاسم", "Could not move %s" => "فشل في نقل %s", +"Unable to set upload directory." => "غير قادر على تحميل المجلد", +"Invalid Token" => "علامة غير صالحة", "No file was uploaded. Unknown error" => "لم يتم رفع أي ملف , خطأ غير معروف", "There is no error, the file uploaded with success" => "تم ترفيع الملفات بنجاح.", "The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "حجم الملف المرفوع تجاوز قيمة upload_max_filesize الموجودة في ملف php.ini ", @@ -13,10 +15,11 @@ $TRANSLATIONS = array( "Not enough storage available" => "لا يوجد مساحة تخزينية كافية", "Invalid directory." => "مسار غير صحيح.", "Files" => "الملفات", -"Unable to upload your file as it is a directory or has 0 bytes" => "فشل في رفع ملفاتك , إما أنها مجلد أو حجمها 0 بايت", +"Not enough space available" => "لا توجد مساحة كافية", "Upload cancelled." => "تم إلغاء عملية رفع الملفات .", "File upload is in progress. Leaving the page now will cancel the upload." => "عملية رفع الملفات قيد التنفيذ. اغلاق الصفحة سوف يلغي عملية رفع الملفات.", "URL cannot be empty." => "عنوان ال URL لا يجوز أن يكون فارغا.", +"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "تسمية ملف غير صالحة. استخدام الاسم \"shared\" محجوز بواسطة ownCloud", "Error" => "خطأ", "Share" => "شارك", "Delete permanently" => "حذف بشكل دائم", @@ -28,18 +31,20 @@ $TRANSLATIONS = array( "cancel" => "إلغاء", "replaced {new_name} with {old_name}" => "استبدل {new_name} بـ {old_name}", "undo" => "تراجع", +"_%n folder_::_%n folders_" => array("","","","","",""), +"_%n file_::_%n files_" => array("","","","","",""), +"{dirs} and {files}" => "{dirs} و {files}", "_Uploading %n file_::_Uploading %n files_" => array("","","","","",""), "'.' is an invalid file name." => "\".\" اسم ملف غير صحيح.", "File name cannot be empty." => "اسم الملف لا يجوز أن يكون فارغا", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "اسم غير صحيح , الرموز '\\', '/', '<', '>', ':', '\"', '|', '?' و \"*\" غير مسموح استخدامها", "Your storage is full, files can not be updated or synced anymore!" => "مساحتك التخزينية ممتلئة, لا يمكم تحديث ملفاتك أو مزامنتها بعد الآن !", "Your storage is almost full ({usedSpacePercent}%)" => "مساحتك التخزينية امتلأت تقريبا ", +"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "تم تعطيل التشفير لكن ملفاتك لا تزال مشفرة. فضلا اذهب إلى الإعدادات الشخصية لإزالة التشفير عن ملفاتك.", "Your download is being prepared. This might take some time if the files are big." => "جاري تجهيز عملية التحميل. قد تستغرق بعض الوقت اذا كان حجم الملفات كبير.", "Name" => "اسم", "Size" => "حجم", "Modified" => "معدل", -"_%n folder_::_%n folders_" => array("","","","","",""), -"_%n file_::_%n files_" => array("","","","","",""), "Upload" => "رفع", "File handling" => "التعامل مع الملف", "Maximum upload size" => "الحد الأقصى لحجم الملفات التي يمكن رفعها", diff --git a/apps/files/l10n/be.php b/apps/files/l10n/be.php new file mode 100644 index 0000000000000000000000000000000000000000..17262d2184dd3787640bf0bf218b7e715ea7b0b7 --- /dev/null +++ b/apps/files/l10n/be.php @@ -0,0 +1,7 @@ + array("","","",""), +"_%n file_::_%n files_" => array("","","",""), +"_Uploading %n file_::_Uploading %n files_" => array("","","","") +); +$PLURAL_FORMS = "nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/apps/files/l10n/bg_BG.php b/apps/files/l10n/bg_BG.php index 1e2104370ba5dc8042e8fdfbceaf9fbb2ded7bba..e7dafd1c43a584c5b7f0efed9c66c89d27f7de85 100644 --- a/apps/files/l10n/bg_BG.php +++ b/apps/files/l10n/bg_BG.php @@ -17,12 +17,12 @@ $TRANSLATIONS = array( "replace" => "препокриване", "cancel" => "отказ", "undo" => "възтановяване", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "_Uploading %n file_::_Uploading %n files_" => array("",""), "Name" => "Име", "Size" => "Размер", "Modified" => "Променено", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), "Upload" => "Качване", "Maximum upload size" => "Максимален размер за качване", "0 is unlimited" => "Ползвайте 0 за без ограничения", @@ -36,7 +36,6 @@ $TRANSLATIONS = array( "Delete" => "Изтриване", "Upload too large" => "Файлът който сте избрали за качване е прекалено голям", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Файловете които се опитвате да качите са по-големи от позволеното за сървъра.", -"Files are being scanned, please wait." => "Файловете се претърсват, изчакайте.", -"file" => "файл" +"Files are being scanned, please wait." => "Файловете се претърсват, изчакайте." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/bn_BD.php b/apps/files/l10n/bn_BD.php index 9efde85f0ce9ddda80dbe354620fda0173db158d..66ac3a2165f88e624e616ba8ed1623260a1200f2 100644 --- a/apps/files/l10n/bn_BD.php +++ b/apps/files/l10n/bn_BD.php @@ -12,7 +12,6 @@ $TRANSLATIONS = array( "Failed to write to disk" => "ডিস্কে লিখতে ব্যর্থ", "Invalid directory." => "ভুল ডিরেক্টরি", "Files" => "ফাইল", -"Unable to upload your file as it is a directory or has 0 bytes" => "আপনার ফাইলটি আপলোড করা সম্ভব হলো না, কেননা এটি হয় একটি ফোল্ডার কিংবা এর আকার ০ বাইট", "Not enough space available" => "যথেষ্ঠ পরিমাণ স্থান নেই", "Upload cancelled." => "আপলোড বাতিল করা হয়েছে।", "File upload is in progress. Leaving the page now will cancel the upload." => "ফাইল আপলোড চলমান। এই পৃষ্ঠা পরিত্যাগ করলে আপলোড বাতিল করা হবে।", @@ -27,6 +26,8 @@ $TRANSLATIONS = array( "cancel" => "বাতিল", "replaced {new_name} with {old_name}" => "{new_name} কে {old_name} নামে প্রতিস্থাপন করা হয়েছে", "undo" => "ক্রিয়া প্রত্যাহার", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "_Uploading %n file_::_Uploading %n files_" => array("",""), "'.' is an invalid file name." => "টি একটি অননুমোদিত নাম।", "File name cannot be empty." => "ফাইলের নামটি ফাঁকা রাখা যাবে না।", @@ -34,8 +35,6 @@ $TRANSLATIONS = array( "Name" => "রাম", "Size" => "আকার", "Modified" => "পরিবর্তিত", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), "Upload" => "আপলোড", "File handling" => "ফাইল হ্যার্ডলিং", "Maximum upload size" => "আপলোডের সর্বোচ্চ আকার", diff --git a/apps/files/l10n/bs.php b/apps/files/l10n/bs.php new file mode 100644 index 0000000000000000000000000000000000000000..8ab07a97761f1863952e9f09b0fd732c4a6d9509 --- /dev/null +++ b/apps/files/l10n/bs.php @@ -0,0 +1,12 @@ + "Podijeli", +"_%n folder_::_%n folders_" => array("","",""), +"_%n file_::_%n files_" => array("","",""), +"_Uploading %n file_::_Uploading %n files_" => array("","",""), +"Name" => "Ime", +"Size" => "Veličina", +"Save" => "Spasi", +"Folder" => "Fasikla" +); +$PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/apps/files/l10n/ca.php b/apps/files/l10n/ca.php index f7d0069217776a55cc6b16fe4af80d9c2433b3d1..5c2cade8d637df60c665026bbccd8f5d1e1aca91 100644 --- a/apps/files/l10n/ca.php +++ b/apps/files/l10n/ca.php @@ -13,11 +13,14 @@ $TRANSLATIONS = array( "Missing a temporary folder" => "Falta un fitxer temporal", "Failed to write to disk" => "Ha fallat en escriure al disc", "Not enough storage available" => "No hi ha prou espai disponible", +"Upload failed. Could not get file info." => "La pujada ha fallat. No s'ha pogut obtenir informació del fitxer.", +"Upload failed. Could not find uploaded file" => "La pujada ha fallat. El fitxer pujat no s'ha trobat.", "Invalid directory." => "Directori no vàlid.", "Files" => "Fitxers", -"Unable to upload your file as it is a directory or has 0 bytes" => "No es pot pujar el fitxer perquè és una carpeta o té 0 bytes", +"Unable to upload {filename} as it is a directory or has 0 bytes" => "No es pot pujar {filename} perquè és una carpeta o té 0 bytes", "Not enough space available" => "No hi ha prou espai disponible", "Upload cancelled." => "La pujada s'ha cancel·lat.", +"Could not get result from server." => "No hi ha resposta del servidor.", "File upload is in progress. Leaving the page now will cancel the upload." => "Hi ha una pujada en curs. Si abandoneu la pàgina la pujada es cancel·larà.", "URL cannot be empty." => "La URL no pot ser buida", "Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Nom de carpeta no vàlid. L'ús de 'Shared' està reservat per Owncloud", @@ -32,8 +35,10 @@ $TRANSLATIONS = array( "cancel" => "cancel·la", "replaced {new_name} with {old_name}" => "s'ha substituït {old_name} per {new_name}", "undo" => "desfés", +"_%n folder_::_%n folders_" => array("%n carpeta","%n carpetes"), +"_%n file_::_%n files_" => array("%n fitxer","%n fitxers"), +"{dirs} and {files}" => "{dirs} i {files}", "_Uploading %n file_::_Uploading %n files_" => array("Pujant %n fitxer","Pujant %n fitxers"), -"files uploading" => "fitxers pujant", "'.' is an invalid file name." => "'.' és un nom no vàlid per un fitxer.", "File name cannot be empty." => "El nom del fitxer no pot ser buit.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "El nóm no és vàlid, '\\', '/', '<', '>', ':', '\"', '|', '?' i '*' no estan permesos.", @@ -41,11 +46,10 @@ $TRANSLATIONS = array( "Your storage is almost full ({usedSpacePercent}%)" => "El vostre espai d'emmagatzemament és gairebé ple ({usedSpacePercent}%)", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "L'encriptació s'ha desactivat però els vostres fitxers segueixen encriptats. Aneu a la vostra configuració personal per desencriptar els vostres fitxers.", "Your download is being prepared. This might take some time if the files are big." => "S'està preparant la baixada. Pot trigar una estona si els fitxers són grans.", +"Error moving file" => "Error en moure el fitxer", "Name" => "Nom", "Size" => "Mida", "Modified" => "Modificat", -"_%n folder_::_%n folders_" => array("%n carpeta","%n carpetes"), -"_%n file_::_%n files_" => array("%n fitxer","%n fitxers"), "%s could not be renamed" => "%s no es pot canviar el nom", "Upload" => "Puja", "File handling" => "Gestió de fitxers", @@ -71,10 +75,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Els fitxers que esteu intentant pujar excedeixen la mida màxima de pujada del servidor", "Files are being scanned, please wait." => "S'estan escanejant els fitxers, espereu", "Current scanning" => "Actualment escanejant", -"directory" => "directori", -"directories" => "directoris", -"file" => "fitxer", -"files" => "fitxers", "Upgrading filesystem cache..." => "Actualitzant la memòria de cau del sistema de fitxers..." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/cs_CZ.php b/apps/files/l10n/cs_CZ.php index dd243eb5761276a74e91ed27bfefd1bbfaf75ee1..f1e54ee5fc39e9581300141c094827a05dc33022 100644 --- a/apps/files/l10n/cs_CZ.php +++ b/apps/files/l10n/cs_CZ.php @@ -15,7 +15,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "Nedostatek dostupného úložného prostoru", "Invalid directory." => "Neplatný adresář", "Files" => "Soubory", -"Unable to upload your file as it is a directory or has 0 bytes" => "Nelze odeslat Váš soubor, protože je to adresář nebo jeho velikost je 0 bajtů", "Not enough space available" => "Nedostatek volného místa", "Upload cancelled." => "Odesílání zrušeno.", "File upload is in progress. Leaving the page now will cancel the upload." => "Probíhá odesílání souboru. Opuštění stránky způsobí zrušení nahrávání.", @@ -32,20 +31,21 @@ $TRANSLATIONS = array( "cancel" => "zrušit", "replaced {new_name} with {old_name}" => "nahrazeno {new_name} s {old_name}", "undo" => "vrátit zpět", +"_%n folder_::_%n folders_" => array("%n složka","%n složky","%n složek"), +"_%n file_::_%n files_" => array("%n soubor","%n soubory","%n souborů"), +"{dirs} and {files}" => "{dirs} a {files}", "_Uploading %n file_::_Uploading %n files_" => array("Nahrávám %n soubor","Nahrávám %n soubory","Nahrávám %n souborů"), -"files uploading" => "soubory se odesílají", "'.' is an invalid file name." => "'.' je neplatným názvem souboru.", "File name cannot be empty." => "Název souboru nemůže být prázdný řetězec.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Neplatný název, znaky '\\', '/', '<', '>', ':', '\"', '|', '?' a '*' nejsou povoleny.", "Your storage is full, files can not be updated or synced anymore!" => "Vaše úložiště je plné, nelze aktualizovat ani synchronizovat soubory.", "Your storage is almost full ({usedSpacePercent}%)" => "Vaše úložiště je téměř plné ({usedSpacePercent}%)", -"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Šifrování bylo zrušeno, soubory jsou však stále zašifrované. Běžte prosím do osobního nastavení, kde si složky odšifrujete.", +"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Šifrování bylo vypnuto, vaše soubory jsou však stále zašifrované. Běžte prosím do osobního nastavení, kde soubory odšifrujete.", "Your download is being prepared. This might take some time if the files are big." => "Vaše soubory ke stažení se připravují. Pokud jsou velké, může to chvíli trvat.", +"Error moving file" => "Chyba při přesunu souboru", "Name" => "Název", "Size" => "Velikost", "Modified" => "Upraveno", -"_%n folder_::_%n folders_" => array("%n složka","%n složky","%n složek"), -"_%n file_::_%n files_" => array("%n soubor","%n soubory","%n souborů"), "%s could not be renamed" => "%s nemůže být přejmenován", "Upload" => "Odeslat", "File handling" => "Zacházení se soubory", @@ -71,10 +71,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Soubory, které se snažíte odeslat, překračují limit velikosti odesílání na tomto serveru.", "Files are being scanned, please wait." => "Soubory se prohledávají, prosím čekejte.", "Current scanning" => "Aktuální prohledávání", -"directory" => "adresář", -"directories" => "adresáře", -"file" => "soubor", -"files" => "soubory", "Upgrading filesystem cache..." => "Aktualizuji mezipaměť souborového systému..." ); $PLURAL_FORMS = "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"; diff --git a/apps/files/l10n/cy_GB.php b/apps/files/l10n/cy_GB.php index f614fbee47cf6b9fc3754856342b21b937f90a9e..86e5f65e7b0d3d46d037dc90dd1a2b459bfdf2ff 100644 --- a/apps/files/l10n/cy_GB.php +++ b/apps/files/l10n/cy_GB.php @@ -13,7 +13,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "Dim digon o le storio ar gael", "Invalid directory." => "Cyfeiriadur annilys.", "Files" => "Ffeiliau", -"Unable to upload your file as it is a directory or has 0 bytes" => "Methu llwytho'ch ffeil i fyny gan ei fod yn gyferiadur neu'n cynnwys 0 beit", "Not enough space available" => "Dim digon o le ar gael", "Upload cancelled." => "Diddymwyd llwytho i fyny.", "File upload is in progress. Leaving the page now will cancel the upload." => "Mae ffeiliau'n cael eu llwytho i fyny. Bydd gadael y dudalen hon nawr yn diddymu'r broses.", @@ -29,8 +28,9 @@ $TRANSLATIONS = array( "cancel" => "diddymu", "replaced {new_name} with {old_name}" => "newidiwyd {new_name} yn lle {old_name}", "undo" => "dadwneud", +"_%n folder_::_%n folders_" => array("","","",""), +"_%n file_::_%n files_" => array("","","",""), "_Uploading %n file_::_Uploading %n files_" => array("","","",""), -"files uploading" => "ffeiliau'n llwytho i fyny", "'.' is an invalid file name." => "Mae '.' yn enw ffeil annilys.", "File name cannot be empty." => "Does dim hawl cael enw ffeil gwag.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Enw annilys, ni chaniateir, '\\', '/', '<', '>', ':', '\"', '|', '?' na '*'.", @@ -40,8 +40,6 @@ $TRANSLATIONS = array( "Name" => "Enw", "Size" => "Maint", "Modified" => "Addaswyd", -"_%n folder_::_%n folders_" => array("","","",""), -"_%n file_::_%n files_" => array("","","",""), "Upload" => "Llwytho i fyny", "File handling" => "Trafod ffeiliau", "Maximum upload size" => "Maint mwyaf llwytho i fyny", diff --git a/apps/files/l10n/da.php b/apps/files/l10n/da.php index a891bcfb378348ecdd531139fae77dc973a44989..c2a20931ba0457c0657b4a9b6073ca5aba6c4f3d 100644 --- a/apps/files/l10n/da.php +++ b/apps/files/l10n/da.php @@ -15,7 +15,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "Der er ikke nok plads til rådlighed", "Invalid directory." => "Ugyldig mappe.", "Files" => "Filer", -"Unable to upload your file as it is a directory or has 0 bytes" => "Kan ikke uploade din fil - det er enten en mappe eller en fil med et indhold på 0 bytes.", "Not enough space available" => "ikke nok tilgængelig ledig plads ", "Upload cancelled." => "Upload afbrudt.", "File upload is in progress. Leaving the page now will cancel the upload." => "Fil upload kører. Hvis du forlader siden nu, vil uploadet blive annuleret.", @@ -32,8 +31,10 @@ $TRANSLATIONS = array( "cancel" => "fortryd", "replaced {new_name} with {old_name}" => "erstattede {new_name} med {old_name}", "undo" => "fortryd", +"_%n folder_::_%n folders_" => array("%n mappe","%n mapper"), +"_%n file_::_%n files_" => array("%n fil","%n filer"), +"{dirs} and {files}" => "{dirs} og {files}", "_Uploading %n file_::_Uploading %n files_" => array("Uploader %n fil","Uploader %n filer"), -"files uploading" => "uploader filer", "'.' is an invalid file name." => "'.' er et ugyldigt filnavn.", "File name cannot be empty." => "Filnavnet kan ikke stå tomt.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ugyldigt navn, '\\', '/', '<', '>', ':' | '?', '\"', '', og '*' er ikke tilladt.", @@ -44,8 +45,6 @@ $TRANSLATIONS = array( "Name" => "Navn", "Size" => "Størrelse", "Modified" => "Ændret", -"_%n folder_::_%n folders_" => array("%n mappe","%n mapper"), -"_%n file_::_%n files_" => array("%n fil","%n filer"), "%s could not be renamed" => "%s kunne ikke omdøbes", "Upload" => "Upload", "File handling" => "Filhåndtering", @@ -71,10 +70,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Filerne, du prøver at uploade, er større end den maksimale størrelse for fil-upload på denne server.", "Files are being scanned, please wait." => "Filerne bliver indlæst, vent venligst.", "Current scanning" => "Indlæser", -"directory" => "mappe", -"directories" => "Mapper", -"file" => "fil", -"files" => "filer", "Upgrading filesystem cache..." => "Opgraderer filsystems cachen..." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/de.php b/apps/files/l10n/de.php index 53f9b1a23645d6342415c60bac4336464096ddb1..143a5efc3da07ac4dc2e38dfbc3c5aba5cd42a91 100644 --- a/apps/files/l10n/de.php +++ b/apps/files/l10n/de.php @@ -13,11 +13,14 @@ $TRANSLATIONS = array( "Missing a temporary folder" => "Kein temporärer Ordner vorhanden", "Failed to write to disk" => "Fehler beim Schreiben auf die Festplatte", "Not enough storage available" => "Nicht genug Speicher vorhanden.", +"Upload failed. Could not get file info." => "Hochladen fehlgeschlagen. Dateiinformationen konnten nicht abgerufen werden.", +"Upload failed. Could not find uploaded file" => "Hochladen fehlgeschlagen. Hochgeladene Datei konnte nicht gefunden werden.", "Invalid directory." => "Ungültiges Verzeichnis.", "Files" => "Dateien", -"Unable to upload your file as it is a directory or has 0 bytes" => "Deine Datei kann nicht hochgeladen werden, weil es sich um einen Ordner handelt oder 0 Bytes groß ist.", +"Unable to upload {filename} as it is a directory or has 0 bytes" => "Datei {filename} kann nicht hochgeladen werden, da sie entweder ein Verzeichnis oder 0 Bytes groß ist", "Not enough space available" => "Nicht genug Speicherplatz verfügbar", "Upload cancelled." => "Upload abgebrochen.", +"Could not get result from server." => "Ergebnis konnte nicht vom Server abgerufen werden.", "File upload is in progress. Leaving the page now will cancel the upload." => "Dateiupload läuft. Wenn Du die Seite jetzt verlässt, wird der Upload abgebrochen.", "URL cannot be empty." => "Die URL darf nicht leer sein.", "Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Der Ordnername ist ungültig. Nur ownCloud kann den Ordner \"Shared\" anlegen", @@ -32,8 +35,10 @@ $TRANSLATIONS = array( "cancel" => "abbrechen", "replaced {new_name} with {old_name}" => "{old_name} ersetzt durch {new_name}", "undo" => "rückgängig machen", +"_%n folder_::_%n folders_" => array("%n Ordner","%n Ordner"), +"_%n file_::_%n files_" => array("%n Datei","%n Dateien"), +"{dirs} and {files}" => "{dirs} und {files}", "_Uploading %n file_::_Uploading %n files_" => array("%n Datei wird hochgeladen","%n Dateien werden hochgeladen"), -"files uploading" => "Dateien werden hoch geladen", "'.' is an invalid file name." => "'.' ist kein gültiger Dateiname.", "File name cannot be empty." => "Der Dateiname darf nicht leer sein.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ungültiger Name, '\\', '/', '<', '>', ':', '\"', '|', '?' und '*' sind nicht zulässig.", @@ -41,11 +46,10 @@ $TRANSLATIONS = array( "Your storage is almost full ({usedSpacePercent}%)" => "Dein Speicher ist fast voll ({usedSpacePercent}%)", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Die Verschlüsselung wurde deaktiviert, jedoch sind deine Dateien nach wie vor verschlüsselt. Bitte gehe zu deinen persönlichen Einstellungen, um deine Dateien zu entschlüsseln.", "Your download is being prepared. This might take some time if the files are big." => "Dein Download wird vorbereitet. Dies kann bei größeren Dateien etwas dauern.", +"Error moving file" => "Fehler beim Verschieben der Datei", "Name" => "Name", "Size" => "Größe", "Modified" => "Geändert", -"_%n folder_::_%n folders_" => array("%n Ordner","%n Ordner"), -"_%n file_::_%n files_" => array("%n Datei","%n Dateien"), "%s could not be renamed" => "%s konnte nicht umbenannt werden", "Upload" => "Hochladen", "File handling" => "Dateibehandlung", @@ -71,10 +75,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Die Datei überschreitet die Maximalgröße für Uploads auf diesem Server.", "Files are being scanned, please wait." => "Dateien werden gescannt, bitte warten.", "Current scanning" => "Scanne", -"directory" => "Verzeichnis", -"directories" => "Verzeichnisse", -"file" => "Datei", -"files" => "Dateien", "Upgrading filesystem cache..." => "Dateisystem-Cache wird aktualisiert ..." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/de_AT.php b/apps/files/l10n/de_AT.php new file mode 100644 index 0000000000000000000000000000000000000000..0157af093e92200cc7790497227e92e62d80165f --- /dev/null +++ b/apps/files/l10n/de_AT.php @@ -0,0 +1,7 @@ + array("",""), +"_%n file_::_%n files_" => array("",""), +"_Uploading %n file_::_Uploading %n files_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/de_CH.php b/apps/files/l10n/de_CH.php new file mode 100644 index 0000000000000000000000000000000000000000..a7074a8b1ccb758ef8d4f6ed79f0634099750daf --- /dev/null +++ b/apps/files/l10n/de_CH.php @@ -0,0 +1,74 @@ + "%s konnte nicht verschoben werden. Eine Datei mit diesem Namen existiert bereits.", +"Could not move %s" => "Konnte %s nicht verschieben", +"Unable to set upload directory." => "Das Upload-Verzeichnis konnte nicht gesetzt werden.", +"Invalid Token" => "Ungültiges Merkmal", +"No file was uploaded. Unknown error" => "Keine Datei hochgeladen. Unbekannter Fehler", +"There is no error, the file uploaded with success" => "Es ist kein Fehler aufgetreten. Die Datei wurde erfolgreich hochgeladen.", +"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "Die hochgeladene Datei überschreitet die upload_max_filesize Vorgabe in php.ini", +"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Die Datei ist grösser, als die MAX_FILE_SIZE Vorgabe erlaubt, die im HTML-Formular spezifiziert ist", +"The uploaded file was only partially uploaded" => "Die Datei konnte nur teilweise übertragen werden", +"No file was uploaded" => "Keine Datei konnte übertragen werden.", +"Missing a temporary folder" => "Kein temporärer Ordner vorhanden", +"Failed to write to disk" => "Fehler beim Schreiben auf die Festplatte", +"Not enough storage available" => "Nicht genug Speicher vorhanden.", +"Invalid directory." => "Ungültiges Verzeichnis.", +"Files" => "Dateien", +"Not enough space available" => "Nicht genügend Speicherplatz verfügbar", +"Upload cancelled." => "Upload abgebrochen.", +"File upload is in progress. Leaving the page now will cancel the upload." => "Dateiupload läuft. Wenn Sie die Seite jetzt verlassen, wird der Upload abgebrochen.", +"URL cannot be empty." => "Die URL darf nicht leer sein.", +"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Ungültiger Ordnername. Die Verwendung von «Shared» ist ownCloud vorbehalten.", +"Error" => "Fehler", +"Share" => "Teilen", +"Delete permanently" => "Endgültig löschen", +"Rename" => "Umbenennen", +"Pending" => "Ausstehend", +"{new_name} already exists" => "{new_name} existiert bereits", +"replace" => "ersetzen", +"suggest name" => "Namen vorschlagen", +"cancel" => "abbrechen", +"replaced {new_name} with {old_name}" => "{old_name} wurde ersetzt durch {new_name}", +"undo" => "rückgängig machen", +"_%n folder_::_%n folders_" => array("","%n Ordner"), +"_%n file_::_%n files_" => array("","%n Dateien"), +"_Uploading %n file_::_Uploading %n files_" => array("%n Datei wird hochgeladen","%n Dateien werden hochgeladen"), +"'.' is an invalid file name." => "'.' ist kein gültiger Dateiname.", +"File name cannot be empty." => "Der Dateiname darf nicht leer sein.", +"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ungültiger Name, «\\», «/», «<», «>», «:», «\"», «|», «?» und «*» sind nicht zulässig.", +"Your storage is full, files can not be updated or synced anymore!" => "Ihr Speicher ist voll, daher können keine Dateien mehr aktualisiert oder synchronisiert werden!", +"Your storage is almost full ({usedSpacePercent}%)" => "Ihr Speicher ist fast voll ({usedSpacePercent}%)", +"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Die Verschlüsselung wurde deaktiviert, jedoch sind Ihre Dateien nach wie vor verschlüsselt. Bitte gehen Sie zu Ihren persönlichen Einstellungen, um Ihre Dateien zu entschlüsseln.", +"Your download is being prepared. This might take some time if the files are big." => "Ihr Download wird vorbereitet. Dies kann bei grösseren Dateien etwas dauern.", +"Name" => "Name", +"Size" => "Grösse", +"Modified" => "Geändert", +"%s could not be renamed" => "%s konnte nicht umbenannt werden", +"Upload" => "Hochladen", +"File handling" => "Dateibehandlung", +"Maximum upload size" => "Maximale Upload-Grösse", +"max. possible: " => "maximal möglich:", +"Needed for multi-file and folder downloads." => "Für Mehrfachdatei- und Ordnerdownloads benötigt:", +"Enable ZIP-download" => "ZIP-Download aktivieren", +"0 is unlimited" => "0 bedeutet unbegrenzt", +"Maximum input size for ZIP files" => "Maximale Grösse für ZIP-Dateien", +"Save" => "Speichern", +"New" => "Neu", +"Text file" => "Textdatei", +"Folder" => "Ordner", +"From link" => "Von einem Link", +"Deleted files" => "Gelöschte Dateien", +"Cancel upload" => "Upload abbrechen", +"You don’t have write permissions here." => "Sie haben hier keine Schreib-Berechtigungen.", +"Nothing in here. Upload something!" => "Alles leer. Laden Sie etwas hoch!", +"Download" => "Herunterladen", +"Unshare" => "Freigabe aufheben", +"Delete" => "Löschen", +"Upload too large" => "Der Upload ist zu gross", +"The files you are trying to upload exceed the maximum size for file uploads on this server." => "Die Datei überschreitet die Maximalgrösse für Uploads auf diesem Server.", +"Files are being scanned, please wait." => "Dateien werden gescannt, bitte warten.", +"Current scanning" => "Scanne", +"Upgrading filesystem cache..." => "Dateisystem-Cache wird aktualisiert ..." +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/de_DE.php b/apps/files/l10n/de_DE.php index 8ea824c9c1af6bd7d589e102590c09263cb1aa27..c58cb4bbe3e23d2c5e11db5a730d944d4cad75d3 100644 --- a/apps/files/l10n/de_DE.php +++ b/apps/files/l10n/de_DE.php @@ -13,11 +13,14 @@ $TRANSLATIONS = array( "Missing a temporary folder" => "Kein temporärer Ordner vorhanden", "Failed to write to disk" => "Fehler beim Schreiben auf die Festplatte", "Not enough storage available" => "Nicht genug Speicher vorhanden.", +"Upload failed. Could not get file info." => "Hochladen fehlgeschlagen. Dateiinformationen konnten nicht abgerufen werden.", +"Upload failed. Could not find uploaded file" => "Hochladen fehlgeschlagen. Hochgeladene Datei konnte nicht gefunden werden.", "Invalid directory." => "Ungültiges Verzeichnis.", "Files" => "Dateien", -"Unable to upload your file as it is a directory or has 0 bytes" => "Ihre Datei kann nicht hochgeladen werden, weil es sich um einen Ordner handelt oder 0 Bytes groß ist.", +"Unable to upload {filename} as it is a directory or has 0 bytes" => "Datei {filename} kann nicht hochgeladen werden, da sie entweder ein Verzeichnis oder 0 Bytes groß ist", "Not enough space available" => "Nicht genügend Speicherplatz verfügbar", "Upload cancelled." => "Upload abgebrochen.", +"Could not get result from server." => "Ergebnis konnte nicht vom Server abgerufen werden.", "File upload is in progress. Leaving the page now will cancel the upload." => "Dateiupload läuft. Wenn Sie die Seite jetzt verlassen, wird der Upload abgebrochen.", "URL cannot be empty." => "Die URL darf nicht leer sein.", "Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Ungültiger Ordnername. Die Verwendung von \"Shared\" ist ownCloud vorbehalten.", @@ -32,8 +35,10 @@ $TRANSLATIONS = array( "cancel" => "abbrechen", "replaced {new_name} with {old_name}" => "{old_name} wurde ersetzt durch {new_name}", "undo" => "rückgängig machen", +"_%n folder_::_%n folders_" => array("%n Ordner","%n Ordner"), +"_%n file_::_%n files_" => array("%n Datei","%n Dateien"), +"{dirs} and {files}" => "{dirs} und {files}", "_Uploading %n file_::_Uploading %n files_" => array("%n Datei wird hoch geladen","%n Dateien werden hoch geladen"), -"files uploading" => "Dateien werden hoch geladen", "'.' is an invalid file name." => "'.' ist kein gültiger Dateiname.", "File name cannot be empty." => "Der Dateiname darf nicht leer sein.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ungültiger Name, '\\', '/', '<', '>', ':', '\"', '|', '?' und '*' sind nicht zulässig.", @@ -41,11 +46,10 @@ $TRANSLATIONS = array( "Your storage is almost full ({usedSpacePercent}%)" => "Ihr Speicher ist fast voll ({usedSpacePercent}%)", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Die Verschlüsselung wurde deaktiviert, jedoch sind Ihre Dateien nach wie vor verschlüsselt. Bitte gehen Sie zu Ihren persönlichen Einstellungen, um Ihre Dateien zu entschlüsseln.", "Your download is being prepared. This might take some time if the files are big." => "Ihr Download wird vorbereitet. Dies kann bei größeren Dateien etwas dauern.", +"Error moving file" => "Fehler beim Verschieben der Datei", "Name" => "Name", "Size" => "Größe", "Modified" => "Geändert", -"_%n folder_::_%n folders_" => array("%n Ordner","%n Ordner"), -"_%n file_::_%n files_" => array("%n Datei","%n Dateien"), "%s could not be renamed" => "%s konnte nicht umbenannt werden", "Upload" => "Hochladen", "File handling" => "Dateibehandlung", @@ -71,10 +75,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Die Datei überschreitet die Maximalgröße für Uploads auf diesem Server.", "Files are being scanned, please wait." => "Dateien werden gescannt, bitte warten.", "Current scanning" => "Scanne", -"directory" => "Verzeichnis", -"directories" => "Verzeichnisse", -"file" => "Datei", -"files" => "Dateien", "Upgrading filesystem cache..." => "Dateisystem-Cache wird aktualisiert ..." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/el.php b/apps/files/l10n/el.php index 41645acb522b517bd2f7a35306a6d0933a2bd4ff..de524f4dd904a5b1f46e5f93bca243f0e0d8fc58 100644 --- a/apps/files/l10n/el.php +++ b/apps/files/l10n/el.php @@ -15,7 +15,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "Μη επαρκής διαθέσιμος αποθηκευτικός χώρος", "Invalid directory." => "Μη έγκυρος φάκελος.", "Files" => "Αρχεία", -"Unable to upload your file as it is a directory or has 0 bytes" => "Αδυναμία στην αποστολή του αρχείου σας αφού είναι φάκελος ή έχει 0 bytes", "Not enough space available" => "Δεν υπάρχει αρκετός διαθέσιμος χώρος", "Upload cancelled." => "Η αποστολή ακυρώθηκε.", "File upload is in progress. Leaving the page now will cancel the upload." => "Η αποστολή του αρχείου βρίσκεται σε εξέλιξη. Το κλείσιμο της σελίδας θα ακυρώσει την αποστολή.", @@ -32,19 +31,20 @@ $TRANSLATIONS = array( "cancel" => "ακύρωση", "replaced {new_name} with {old_name}" => "αντικαταστάθηκε το {new_name} με {old_name}", "undo" => "αναίρεση", -"_Uploading %n file_::_Uploading %n files_" => array("",""), -"files uploading" => "αρχεία ανεβαίνουν", +"_%n folder_::_%n folders_" => array("%n φάκελος","%n φάκελοι"), +"_%n file_::_%n files_" => array("%n αρχείο","%n αρχεία"), +"_Uploading %n file_::_Uploading %n files_" => array("Ανέβασμα %n αρχείου","Ανέβασμα %n αρχείων"), "'.' is an invalid file name." => "'.' είναι μη έγκυρο όνομα αρχείου.", "File name cannot be empty." => "Το όνομα αρχείου δεν μπορεί να είναι κενό.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Μη έγκυρο όνομα, '\\', '/', '<', '>', ':', '\"', '|', '?' και '*' δεν επιτρέπονται.", "Your storage is full, files can not be updated or synced anymore!" => "Ο αποθηκευτικός σας χώρος είναι γεμάτος, τα αρχεία δεν μπορούν να ενημερωθούν ή να συγχρονιστούν πια!", "Your storage is almost full ({usedSpacePercent}%)" => "Ο αποθηκευτικός χώρος είναι σχεδόν γεμάτος ({usedSpacePercent}%)", +"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Η κρυπτογράφηση απενεργοποιήθηκε, αλλά τα αρχεία σας είναι ακόμα κρυπτογραφημένα. Παρακαλούμε απενεργοποιήσετε την κρυπτογράφηση αρχείων από τις προσωπικές σας ρυθμίσεις", "Your download is being prepared. This might take some time if the files are big." => "Η λήψη προετοιμάζεται. Αυτό μπορεί να πάρει ώρα εάν τα αρχεία έχουν μεγάλο μέγεθος.", +"Error moving file" => "Σφάλμα κατά τη μετακίνηση του αρχείου", "Name" => "Όνομα", "Size" => "Μέγεθος", "Modified" => "Τροποποιήθηκε", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), "%s could not be renamed" => "Αδυναμία μετονομασίας του %s", "Upload" => "Μεταφόρτωση", "File handling" => "Διαχείριση αρχείων", @@ -70,10 +70,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Τα αρχεία που προσπαθείτε να ανεβάσετε υπερβαίνουν το μέγιστο μέγεθος αποστολής αρχείων σε αυτόν τον διακομιστή.", "Files are being scanned, please wait." => "Τα αρχεία σαρώνονται, παρακαλώ περιμένετε.", "Current scanning" => "Τρέχουσα ανίχνευση", -"directory" => "κατάλογος", -"directories" => "κατάλογοι", -"file" => "αρχείο", -"files" => "αρχεία", "Upgrading filesystem cache..." => "Ενημέρωση της μνήμης cache του συστήματος αρχείων..." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/en@pirate.php b/apps/files/l10n/en@pirate.php index 83351f265f09031629b06b63f476892adfdbb7af..128f527aef186c5afc9d7418d1ff130f10a9b22f 100644 --- a/apps/files/l10n/en@pirate.php +++ b/apps/files/l10n/en@pirate.php @@ -1,8 +1,8 @@ array("",""), "_%n folder_::_%n folders_" => array("",""), "_%n file_::_%n files_" => array("",""), +"_Uploading %n file_::_Uploading %n files_" => array("",""), "Download" => "Download" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/en_GB.php b/apps/files/l10n/en_GB.php new file mode 100644 index 0000000000000000000000000000000000000000..c747555e40be799f635d098e9e4268a973f8342b --- /dev/null +++ b/apps/files/l10n/en_GB.php @@ -0,0 +1,80 @@ + "Could not move %s - File with this name already exists", +"Could not move %s" => "Could not move %s", +"Unable to set upload directory." => "Unable to set upload directory.", +"Invalid Token" => "Invalid Token", +"No file was uploaded. Unknown error" => "No file was uploaded. Unknown error", +"There is no error, the file uploaded with success" => "There is no error, the file uploaded successfully", +"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "The uploaded file exceeds the upload_max_filesize directive in php.ini: ", +"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form", +"The uploaded file was only partially uploaded" => "The uploaded file was only partially uploaded", +"No file was uploaded" => "No file was uploaded", +"Missing a temporary folder" => "Missing a temporary folder", +"Failed to write to disk" => "Failed to write to disk", +"Not enough storage available" => "Not enough storage available", +"Upload failed. Could not get file info." => "Upload failed. Could not get file info.", +"Upload failed. Could not find uploaded file" => "Upload failed. Could not find uploaded file", +"Invalid directory." => "Invalid directory.", +"Files" => "Files", +"Unable to upload {filename} as it is a directory or has 0 bytes" => "Unable to upload {filename} as it is a directory or has 0 bytes", +"Not enough space available" => "Not enough space available", +"Upload cancelled." => "Upload cancelled.", +"Could not get result from server." => "Could not get result from server.", +"File upload is in progress. Leaving the page now will cancel the upload." => "File upload is in progress. Leaving the page now will cancel the upload.", +"URL cannot be empty." => "URL cannot be empty.", +"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Invalid folder name. Usage of 'Shared' is reserved by ownCloud", +"Error" => "Error", +"Share" => "Share", +"Delete permanently" => "Delete permanently", +"Rename" => "Rename", +"Pending" => "Pending", +"{new_name} already exists" => "{new_name} already exists", +"replace" => "replace", +"suggest name" => "suggest name", +"cancel" => "cancel", +"replaced {new_name} with {old_name}" => "replaced {new_name} with {old_name}", +"undo" => "undo", +"_%n folder_::_%n folders_" => array("%n folder","%n folders"), +"_%n file_::_%n files_" => array("%n file","%n files"), +"{dirs} and {files}" => "{dirs} and {files}", +"_Uploading %n file_::_Uploading %n files_" => array("Uploading %n file","Uploading %n files"), +"'.' is an invalid file name." => "'.' is an invalid file name.", +"File name cannot be empty." => "File name cannot be empty.", +"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Invalid name: '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed.", +"Your storage is full, files can not be updated or synced anymore!" => "Your storage is full, files can not be updated or synced anymore!", +"Your storage is almost full ({usedSpacePercent}%)" => "Your storage is almost full ({usedSpacePercent}%)", +"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files.", +"Your download is being prepared. This might take some time if the files are big." => "Your download is being prepared. This might take some time if the files are big.", +"Error moving file" => "Error moving file", +"Name" => "Name", +"Size" => "Size", +"Modified" => "Modified", +"%s could not be renamed" => "%s could not be renamed", +"Upload" => "Upload", +"File handling" => "File handling", +"Maximum upload size" => "Maximum upload size", +"max. possible: " => "max. possible: ", +"Needed for multi-file and folder downloads." => "Needed for multi-file and folder downloads.", +"Enable ZIP-download" => "Enable ZIP-download", +"0 is unlimited" => "0 is unlimited", +"Maximum input size for ZIP files" => "Maximum input size for ZIP files", +"Save" => "Save", +"New" => "New", +"Text file" => "Text file", +"Folder" => "Folder", +"From link" => "From link", +"Deleted files" => "Deleted files", +"Cancel upload" => "Cancel upload", +"You don’t have write permissions here." => "You don’t have write permission here.", +"Nothing in here. Upload something!" => "Nothing in here. Upload something!", +"Download" => "Download", +"Unshare" => "Unshare", +"Delete" => "Delete", +"Upload too large" => "Upload too large", +"The files you are trying to upload exceed the maximum size for file uploads on this server." => "The files you are trying to upload exceed the maximum size for file uploads on this server.", +"Files are being scanned, please wait." => "Files are being scanned, please wait.", +"Current scanning" => "Current scanning", +"Upgrading filesystem cache..." => "Upgrading filesystem cache..." +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/eo.php b/apps/files/l10n/eo.php index 59ac4e1c398ba4a097258ca1222e3bb70d033302..eb6e6ba2d3905b60c52ed624baaab8699031b78b 100644 --- a/apps/files/l10n/eo.php +++ b/apps/files/l10n/eo.php @@ -13,7 +13,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "Ne haveblas sufiĉa memoro", "Invalid directory." => "Nevalida dosierujo.", "Files" => "Dosieroj", -"Unable to upload your file as it is a directory or has 0 bytes" => "Ne eblis alŝuti vian dosieron ĉar ĝi estas dosierujo aŭ havas 0 duumokojn", "Not enough space available" => "Ne haveblas sufiĉa spaco", "Upload cancelled." => "La alŝuto nuliĝis.", "File upload is in progress. Leaving the page now will cancel the upload." => "Dosieralŝuto plenumiĝas. Lasi la paĝon nun nuligus la alŝuton.", @@ -30,8 +29,9 @@ $TRANSLATIONS = array( "cancel" => "nuligi", "replaced {new_name} with {old_name}" => "anstataŭiĝis {new_name} per {old_name}", "undo" => "malfari", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "_Uploading %n file_::_Uploading %n files_" => array("",""), -"files uploading" => "dosieroj estas alŝutataj", "'.' is an invalid file name." => "'.' ne estas valida dosiernomo.", "File name cannot be empty." => "Dosiernomo devas ne malpleni.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nevalida nomo: “\\”, “/”, “<”, “>”, “:”, “\"”, “|”, “?” kaj “*” ne permesatas.", @@ -41,8 +41,6 @@ $TRANSLATIONS = array( "Name" => "Nomo", "Size" => "Grando", "Modified" => "Modifita", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), "Upload" => "Alŝuti", "File handling" => "Dosieradministro", "Maximum upload size" => "Maksimuma alŝutogrando", @@ -67,8 +65,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "La dosieroj, kiujn vi provas alŝuti, transpasas la maksimuman grandon por dosieralŝutoj en ĉi tiu servilo.", "Files are being scanned, please wait." => "Dosieroj estas skanataj, bonvolu atendi.", "Current scanning" => "Nuna skano", -"file" => "dosiero", -"files" => "dosieroj", "Upgrading filesystem cache..." => "Ĝisdatiĝas dosiersistema kaŝmemoro..." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/es.php b/apps/files/l10n/es.php index 415d23ae890598dfbd3de9e19c47e674cfb5b353..90d760587d9ccd97274e42005b39bd163f407250 100644 --- a/apps/files/l10n/es.php +++ b/apps/files/l10n/es.php @@ -15,7 +15,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "No hay suficiente espacio disponible", "Invalid directory." => "Directorio inválido.", "Files" => "Archivos", -"Unable to upload your file as it is a directory or has 0 bytes" => "Incapaz de subir su archivo, es un directorio o tiene 0 bytes", "Not enough space available" => "No hay suficiente espacio disponible", "Upload cancelled." => "Subida cancelada.", "File upload is in progress. Leaving the page now will cancel the upload." => "La subida del archivo está en proceso. Si sale de la página ahora cancelará la subida.", @@ -32,19 +31,20 @@ $TRANSLATIONS = array( "cancel" => "cancelar", "replaced {new_name} with {old_name}" => "reemplazado {new_name} con {old_name}", "undo" => "deshacer", -"_Uploading %n file_::_Uploading %n files_" => array("",""), -"files uploading" => "subiendo archivos", +"_%n folder_::_%n folders_" => array("","%n carpetas"), +"_%n file_::_%n files_" => array("","%n archivos"), +"{dirs} and {files}" => "{dirs} y {files}", +"_Uploading %n file_::_Uploading %n files_" => array("Subiendo %n archivo","Subiendo %n archivos"), "'.' is an invalid file name." => "'.' no es un nombre de archivo válido.", "File name cannot be empty." => "El nombre de archivo no puede estar vacío.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nombre Invalido, \"\\\", \"/\", \"<\", \">\", \":\", \"\", \"|\" \"?\" y \"*\" no están permitidos ", "Your storage is full, files can not be updated or synced anymore!" => "Su almacenamiento está lleno, ¡no se pueden actualizar o sincronizar más!", "Your storage is almost full ({usedSpacePercent}%)" => "Su almacenamiento está casi lleno ({usedSpacePercent}%)", +"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "El cifrado ha sido deshabilitado pero tus archivos permanecen cifrados. Por favor, ve a tus ajustes personales para descifrar tus archivos.", "Your download is being prepared. This might take some time if the files are big." => "Su descarga está siendo preparada. Esto puede tardar algún tiempo si los archivos son grandes.", "Name" => "Nombre", "Size" => "Tamaño", "Modified" => "Modificado", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), "%s could not be renamed" => "%s no se pudo renombrar", "Upload" => "Subir", "File handling" => "Manejo de archivos", @@ -70,10 +70,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Los archivos que estás intentando subir sobrepasan el tamaño máximo permitido en este servidor.", "Files are being scanned, please wait." => "Los archivos están siendo escaneados, por favor espere.", "Current scanning" => "Escaneo actual", -"directory" => "carpeta", -"directories" => "carpetas", -"file" => "archivo", -"files" => "archivos", "Upgrading filesystem cache..." => "Actualizando caché del sistema de archivos" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/es_AR.php b/apps/files/l10n/es_AR.php index 4c0eb691f67eaf0665089171d97a066c4aa8491b..be16f3f99ae8bed39884062348cdf87687b429a6 100644 --- a/apps/files/l10n/es_AR.php +++ b/apps/files/l10n/es_AR.php @@ -15,7 +15,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "No hay suficiente almacenamiento", "Invalid directory." => "Directorio inválido.", "Files" => "Archivos", -"Unable to upload your file as it is a directory or has 0 bytes" => "No fue posible subir el archivo porque es un directorio o porque su tamaño es 0 bytes", "Not enough space available" => "No hay suficiente espacio disponible", "Upload cancelled." => "La subida fue cancelada", "File upload is in progress. Leaving the page now will cancel the upload." => "La subida del archivo está en proceso. Si salís de la página ahora, la subida se cancelará.", @@ -32,19 +31,20 @@ $TRANSLATIONS = array( "cancel" => "cancelar", "replaced {new_name} with {old_name}" => "se reemplazó {new_name} con {old_name}", "undo" => "deshacer", -"_Uploading %n file_::_Uploading %n files_" => array("",""), -"files uploading" => "Subiendo archivos", +"_%n folder_::_%n folders_" => array("%n carpeta","%n carpetas"), +"_%n file_::_%n files_" => array("%n archivo","%n archivos"), +"{dirs} and {files}" => "{carpetas} y {archivos}", +"_Uploading %n file_::_Uploading %n files_" => array("Subiendo %n archivo","Subiendo %n archivos"), "'.' is an invalid file name." => "'.' es un nombre de archivo inválido.", "File name cannot be empty." => "El nombre del archivo no puede quedar vacío.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nombre invalido, '\\', '/', '<', '>', ':', '\"', '|', '?' y '*' no están permitidos.", "Your storage is full, files can not be updated or synced anymore!" => "El almacenamiento está lleno, los archivos no se pueden seguir actualizando ni sincronizando", "Your storage is almost full ({usedSpacePercent}%)" => "El almacenamiento está casi lleno ({usedSpacePercent}%)", +"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "El proceso de cifrado se ha desactivado, pero los archivos aún están encriptados. Por favor, vaya a la configuración personal para descifrar los archivos.", "Your download is being prepared. This might take some time if the files are big." => "Tu descarga se está preparando. Esto puede demorar si los archivos son muy grandes.", "Name" => "Nombre", "Size" => "Tamaño", "Modified" => "Modificado", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), "%s could not be renamed" => "No se pudo renombrar %s", "Upload" => "Subir", "File handling" => "Tratamiento de archivos", @@ -70,10 +70,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Los archivos que intentás subir sobrepasan el tamaño máximo ", "Files are being scanned, please wait." => "Se están escaneando los archivos, por favor esperá.", "Current scanning" => "Escaneo actual", -"directory" => "directorio", -"directories" => "directorios", -"file" => "archivo", -"files" => "archivos", "Upgrading filesystem cache..." => "Actualizando el cache del sistema de archivos" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/es_MX.php b/apps/files/l10n/es_MX.php new file mode 100644 index 0000000000000000000000000000000000000000..0157af093e92200cc7790497227e92e62d80165f --- /dev/null +++ b/apps/files/l10n/es_MX.php @@ -0,0 +1,7 @@ + array("",""), +"_%n file_::_%n files_" => array("",""), +"_Uploading %n file_::_Uploading %n files_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/et_EE.php b/apps/files/l10n/et_EE.php index 13198a9f881b15f1eb1c9c93c95ca54b758c07f6..9f674b27e63ac577b96ac76ec6005ddd6979959b 100644 --- a/apps/files/l10n/et_EE.php +++ b/apps/files/l10n/et_EE.php @@ -15,7 +15,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "Saadaval pole piisavalt ruumi", "Invalid directory." => "Vigane kaust.", "Files" => "Failid", -"Unable to upload your file as it is a directory or has 0 bytes" => "Faili ei saa üles laadida, kuna see on kaust või selle suurus on 0 baiti", "Not enough space available" => "Pole piisavalt ruumi", "Upload cancelled." => "Üleslaadimine tühistati.", "File upload is in progress. Leaving the page now will cancel the upload." => "Faili üleslaadimine on töös. Lehelt lahkumine katkestab selle üleslaadimise.", @@ -32,8 +31,10 @@ $TRANSLATIONS = array( "cancel" => "loobu", "replaced {new_name} with {old_name}" => "asendas nime {old_name} nimega {new_name}", "undo" => "tagasi", +"_%n folder_::_%n folders_" => array("%n kataloog","%n kataloogi"), +"_%n file_::_%n files_" => array("%n fail","%n faili"), +"{dirs} and {files}" => "{dirs} ja {files}", "_Uploading %n file_::_Uploading %n files_" => array("Laadin üles %n faili","Laadin üles %n faili"), -"files uploading" => "faili üleslaadimisel", "'.' is an invalid file name." => "'.' on vigane failinimi.", "File name cannot be empty." => "Faili nimi ei saa olla tühi.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Vigane nimi, '\\', '/', '<', '>', ':', '\"', '|', '?' ja '*' pole lubatud.", @@ -44,8 +45,6 @@ $TRANSLATIONS = array( "Name" => "Nimi", "Size" => "Suurus", "Modified" => "Muudetud", -"_%n folder_::_%n folders_" => array("%n kataloog","%n kataloogi"), -"_%n file_::_%n files_" => array("%n fail","%n faili"), "%s could not be renamed" => "%s ümbernimetamine ebaõnnestus", "Upload" => "Lae üles", "File handling" => "Failide käsitlemine", @@ -71,10 +70,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Failid, mida sa proovid üles laadida, ületab serveri poolt üleslaetavatele failidele määratud maksimaalse suuruse.", "Files are being scanned, please wait." => "Faile skannitakse, palun oota.", "Current scanning" => "Praegune skannimine", -"directory" => "kaust", -"directories" => "kaustad", -"file" => "fail", -"files" => "faili", "Upgrading filesystem cache..." => "Failisüsteemi puhvri uuendamine..." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/eu.php b/apps/files/l10n/eu.php index 359b40ddefd3feb7cd0caa977d03d9ccbf5a2aa6..33ea47d5f04b35fc96567d042eadb091b8e6d67e 100644 --- a/apps/files/l10n/eu.php +++ b/apps/files/l10n/eu.php @@ -15,7 +15,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "Ez dago behar aina leku erabilgarri,", "Invalid directory." => "Baliogabeko karpeta.", "Files" => "Fitxategiak", -"Unable to upload your file as it is a directory or has 0 bytes" => "Ezin izan da zure fitxategia igo karpeta bat delako edo 0 byte dituelako", "Not enough space available" => "Ez dago leku nahikorik.", "Upload cancelled." => "Igoera ezeztatuta", "File upload is in progress. Leaving the page now will cancel the upload." => "Fitxategien igoera martxan da. Orria orain uzteak igoera ezeztatutko du.", @@ -32,8 +31,9 @@ $TRANSLATIONS = array( "cancel" => "ezeztatu", "replaced {new_name} with {old_name}" => " {new_name}-k {old_name} ordezkatu du", "undo" => "desegin", +"_%n folder_::_%n folders_" => array("karpeta %n","%n karpeta"), +"_%n file_::_%n files_" => array("fitxategi %n","%n fitxategi"), "_Uploading %n file_::_Uploading %n files_" => array("Fitxategi %n igotzen","%n fitxategi igotzen"), -"files uploading" => "fitxategiak igotzen", "'.' is an invalid file name." => "'.' ez da fitxategi izen baliogarria.", "File name cannot be empty." => "Fitxategi izena ezin da hutsa izan.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "IZen aliogabea, '\\', '/', '<', '>', ':', '\"', '|', '?' eta '*' ez daude baimenduta.", @@ -44,8 +44,6 @@ $TRANSLATIONS = array( "Name" => "Izena", "Size" => "Tamaina", "Modified" => "Aldatuta", -"_%n folder_::_%n folders_" => array("karpeta %n","%n karpeta"), -"_%n file_::_%n files_" => array("fitxategi %n","%n fitxategi"), "%s could not be renamed" => "%s ezin da berrizendatu", "Upload" => "Igo", "File handling" => "Fitxategien kudeaketa", @@ -71,10 +69,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Igotzen saiatzen ari zaren fitxategiak zerbitzari honek igotzeko onartzen duena baino handiagoak dira.", "Files are being scanned, please wait." => "Fitxategiak eskaneatzen ari da, itxoin mezedez.", "Current scanning" => "Orain eskaneatzen ari da", -"directory" => "direktorioa", -"directories" => "direktorioak", -"file" => "fitxategia", -"files" => "fitxategiak", "Upgrading filesystem cache..." => "Fitxategi sistemaren katxea eguneratzen..." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/fa.php b/apps/files/l10n/fa.php index e0b9fe028166e94ccc501292203eb129fc44fe26..46d7cfe73efef0518dbe1d76b17970df8e9ec06d 100644 --- a/apps/files/l10n/fa.php +++ b/apps/files/l10n/fa.php @@ -15,7 +15,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "فضای کافی در دسترس نیست", "Invalid directory." => "فهرست راهنما نامعتبر می باشد.", "Files" => "پرونده‌ها", -"Unable to upload your file as it is a directory or has 0 bytes" => "ناتوان در بارگذاری یا فایل یک پوشه است یا 0بایت دارد", "Not enough space available" => "فضای کافی در دسترس نیست", "Upload cancelled." => "بار گذاری لغو شد", "File upload is in progress. Leaving the page now will cancel the upload." => "آپلودکردن پرونده در حال پیشرفت است. در صورت خروج از صفحه آپلود لغو میگردد. ", @@ -32,8 +31,9 @@ $TRANSLATIONS = array( "cancel" => "لغو", "replaced {new_name} with {old_name}" => "{نام_جدید} با { نام_قدیمی} جایگزین شد.", "undo" => "بازگشت", +"_%n folder_::_%n folders_" => array(""), +"_%n file_::_%n files_" => array(""), "_Uploading %n file_::_Uploading %n files_" => array(""), -"files uploading" => "بارگذاری فایل ها", "'.' is an invalid file name." => "'.' یک نام پرونده نامعتبر است.", "File name cannot be empty." => "نام پرونده نمی تواند خالی باشد.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "نام نامعتبر ، '\\', '/', '<', '>', ':', '\"', '|', '?' و '*' مجاز نمی باشند.", @@ -43,8 +43,6 @@ $TRANSLATIONS = array( "Name" => "نام", "Size" => "اندازه", "Modified" => "تاریخ", -"_%n folder_::_%n folders_" => array(""), -"_%n file_::_%n files_" => array(""), "%s could not be renamed" => "%s نمیتواند تغییر نام دهد.", "Upload" => "بارگزاری", "File handling" => "اداره پرونده ها", @@ -70,10 +68,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "فایلها بیش از حد تعیین شده در این سرور هستند\nمترجم:با تغییر فایل php,ini میتوان این محدودیت را برطرف کرد", "Files are being scanned, please wait." => "پرونده ها در حال بازرسی هستند لطفا صبر کنید", "Current scanning" => "بازرسی کنونی", -"directory" => "پوشه", -"directories" => "پوشه ها", -"file" => "پرونده", -"files" => "پرونده ها", "Upgrading filesystem cache..." => "بهبود فایل سیستمی ذخیره گاه..." ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/l10n/fi_FI.php b/apps/files/l10n/fi_FI.php index b48f44665bc282e9a164fac4d22127f0460e0c1e..5345bad902b392b0668dc96219398fb9e341cf8c 100644 --- a/apps/files/l10n/fi_FI.php +++ b/apps/files/l10n/fi_FI.php @@ -13,9 +13,10 @@ $TRANSLATIONS = array( "Not enough storage available" => "Tallennustilaa ei ole riittävästi käytettävissä", "Invalid directory." => "Virheellinen kansio.", "Files" => "Tiedostot", -"Unable to upload your file as it is a directory or has 0 bytes" => "Tiedoston lähetys epäonnistui, koska sen koko on 0 tavua tai kyseessä on kansio.", +"Unable to upload {filename} as it is a directory or has 0 bytes" => "Kohdetta {filename} ei voi lähettää, koska se on joko kansio tai sen koko on 0 tavua", "Not enough space available" => "Tilaa ei ole riittävästi", "Upload cancelled." => "Lähetys peruttu.", +"Could not get result from server." => "Tuloksien saaminen palvelimelta ei onnistunut.", "File upload is in progress. Leaving the page now will cancel the upload." => "Tiedoston lähetys on meneillään. Sivulta poistuminen nyt peruu tiedoston lähetyksen.", "URL cannot be empty." => "Verkko-osoite ei voi olla tyhjä", "Error" => "Virhe", @@ -28,6 +29,9 @@ $TRANSLATIONS = array( "suggest name" => "ehdota nimeä", "cancel" => "peru", "undo" => "kumoa", +"_%n folder_::_%n folders_" => array("%n kansio","%n kansiota"), +"_%n file_::_%n files_" => array("%n tiedosto","%n tiedostoa"), +"{dirs} and {files}" => "{dirs} ja {files}", "_Uploading %n file_::_Uploading %n files_" => array("Lähetetään %n tiedosto","Lähetetään %n tiedostoa"), "'.' is an invalid file name." => "'.' on virheellinen nimi tiedostolle.", "File name cannot be empty." => "Tiedoston nimi ei voi olla tyhjä.", @@ -35,11 +39,10 @@ $TRANSLATIONS = array( "Your storage is full, files can not be updated or synced anymore!" => "Tallennustila on loppu, tiedostoja ei voi enää päivittää tai synkronoida!", "Your storage is almost full ({usedSpacePercent}%)" => "Tallennustila on melkein loppu ({usedSpacePercent}%)", "Your download is being prepared. This might take some time if the files are big." => "Lataustasi valmistellaan. Tämä saattaa kestää hetken, jos tiedostot ovat suuria kooltaan.", +"Error moving file" => "Virhe tiedostoa siirrettäessä", "Name" => "Nimi", "Size" => "Koko", "Modified" => "Muokattu", -"_%n folder_::_%n folders_" => array("%n kansio","%n kansiota"), -"_%n file_::_%n files_" => array("%n tiedosto","%n tiedostoa"), "Upload" => "Lähetä", "File handling" => "Tiedostonhallinta", "Maximum upload size" => "Lähetettävän tiedoston suurin sallittu koko", @@ -64,10 +67,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Lähetettäväksi valitsemasi tiedostot ylittävät palvelimen salliman tiedostokoon rajan.", "Files are being scanned, please wait." => "Tiedostoja tarkistetaan, odota hetki.", "Current scanning" => "Tämänhetkinen tutkinta", -"directory" => "kansio", -"directories" => "kansiota", -"file" => "tiedosto", -"files" => "tiedostoa", "Upgrading filesystem cache..." => "Päivitetään tiedostojärjestelmän välimuistia..." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/fr.php b/apps/files/l10n/fr.php index 44895eab28e3651c757e00fc1c574c65cf59e03c..03505a2a26988aef322b7f0210b10705b3f5a1fa 100644 --- a/apps/files/l10n/fr.php +++ b/apps/files/l10n/fr.php @@ -6,18 +6,21 @@ $TRANSLATIONS = array( "Invalid Token" => "Jeton non valide", "No file was uploaded. Unknown error" => "Aucun fichier n'a été envoyé. Erreur inconnue", "There is no error, the file uploaded with success" => "Aucune erreur, le fichier a été envoyé avec succès.", -"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "Le fichier envoyé dépasse la valeur upload_max_filesize située dans le fichier php.ini:", -"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Le fichier envoyé dépasse la directive MAX_FILE_SIZE qui est spécifiée dans le formulaire HTML.", +"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "Le fichier envoyé dépasse l'instruction upload_max_filesize située dans le fichier php.ini:", +"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Le fichier envoyé dépasse l'instruction MAX_FILE_SIZE qui est spécifiée dans le formulaire HTML.", "The uploaded file was only partially uploaded" => "Le fichier n'a été que partiellement envoyé.", "No file was uploaded" => "Pas de fichier envoyé.", "Missing a temporary folder" => "Absence de dossier temporaire.", "Failed to write to disk" => "Erreur d'écriture sur le disque", "Not enough storage available" => "Plus assez d'espace de stockage disponible", +"Upload failed. Could not get file info." => "L'envoi a échoué. Impossible d'obtenir les informations du fichier.", +"Upload failed. Could not find uploaded file" => "L'envoi a échoué. Impossible de trouver le fichier envoyé.", "Invalid directory." => "Dossier invalide.", "Files" => "Fichiers", -"Unable to upload your file as it is a directory or has 0 bytes" => "Impossible d'envoyer votre fichier dans la mesure où il s'agit d'un répertoire ou d'un fichier de taille nulle", +"Unable to upload {filename} as it is a directory or has 0 bytes" => "Impossible d'envoyer {filename} car il s'agit d'un répertoire ou d'un fichier de taille nulle", "Not enough space available" => "Espace disponible insuffisant", "Upload cancelled." => "Envoi annulé.", +"Could not get result from server." => "Ne peut recevoir les résultats du serveur.", "File upload is in progress. Leaving the page now will cancel the upload." => "L'envoi du fichier est en cours. Quitter cette page maintenant annulera l'envoi du fichier.", "URL cannot be empty." => "L'URL ne peut-être vide", "Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Nom de dossier invalide. L'utilisation du mot 'Shared' est réservée à Owncloud", @@ -32,19 +35,21 @@ $TRANSLATIONS = array( "cancel" => "annuler", "replaced {new_name} with {old_name}" => "{new_name} a été remplacé par {old_name}", "undo" => "annuler", -"_Uploading %n file_::_Uploading %n files_" => array("",""), -"files uploading" => "fichiers en cours d'envoi", +"_%n folder_::_%n folders_" => array("%n dossier","%n dossiers"), +"_%n file_::_%n files_" => array("%n fichier","%n fichiers"), +"{dirs} and {files}" => "{dir} et {files}", +"_Uploading %n file_::_Uploading %n files_" => array("Téléversement de %n fichier","Téléversement de %n fichiers"), "'.' is an invalid file name." => "'.' n'est pas un nom de fichier valide.", "File name cannot be empty." => "Le nom de fichier ne peut être vide.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nom invalide, les caractères '\\', '/', '<', '>', ':', '\"', '|', '?' et '*' ne sont pas autorisés.", "Your storage is full, files can not be updated or synced anymore!" => "Votre espage de stockage est plein, les fichiers ne peuvent plus être téléversés ou synchronisés !", "Your storage is almost full ({usedSpacePercent}%)" => "Votre espace de stockage est presque plein ({usedSpacePercent}%)", +"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Le chiffrement était désactivé mais vos fichiers sont toujours chiffrés. Veuillez vous rendre sur vos Paramètres personnels pour déchiffrer vos fichiers.", "Your download is being prepared. This might take some time if the files are big." => "Votre téléchargement est cours de préparation. Ceci peut nécessiter un certain temps si les fichiers sont volumineux.", +"Error moving file" => "Erreur lors du déplacement du fichier", "Name" => "Nom", "Size" => "Taille", "Modified" => "Modifié", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), "%s could not be renamed" => "%s ne peut être renommé", "Upload" => "Envoyer", "File handling" => "Gestion des fichiers", @@ -70,10 +75,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Les fichiers que vous essayez d'envoyer dépassent la taille maximale permise par ce serveur.", "Files are being scanned, please wait." => "Les fichiers sont en cours d'analyse, veuillez patienter.", "Current scanning" => "Analyse en cours", -"directory" => "dossier", -"directories" => "dossiers", -"file" => "fichier", -"files" => "fichiers", "Upgrading filesystem cache..." => "Mise à niveau du cache du système de fichier" ); $PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/apps/files/l10n/gl.php b/apps/files/l10n/gl.php index c98263c08ff3e8ba42d571daefaa2f13b26514c8..2766478650a31d707dc2179e6a2d72dae577eda3 100644 --- a/apps/files/l10n/gl.php +++ b/apps/files/l10n/gl.php @@ -13,11 +13,14 @@ $TRANSLATIONS = array( "Missing a temporary folder" => "Falta o cartafol temporal", "Failed to write to disk" => "Produciuse un erro ao escribir no disco", "Not enough storage available" => "Non hai espazo de almacenamento abondo", +"Upload failed. Could not get file info." => "O envío fracasou. Non foi posíbel obter información do ficheiro.", +"Upload failed. Could not find uploaded file" => "O envío fracasou. Non foi posíbel atopar o ficheiro enviado", "Invalid directory." => "O directorio é incorrecto.", "Files" => "Ficheiros", -"Unable to upload your file as it is a directory or has 0 bytes" => "Non foi posíbel enviar o ficheiro pois ou é un directorio ou ten 0 bytes", +"Unable to upload {filename} as it is a directory or has 0 bytes" => "Non é posíbel enviar {filename}, xa que ou é un directorio ou ten 0 bytes", "Not enough space available" => "O espazo dispoñíbel é insuficiente", "Upload cancelled." => "Envío cancelado.", +"Could not get result from server." => "Non foi posíbel obter o resultado do servidor.", "File upload is in progress. Leaving the page now will cancel the upload." => "O envío do ficheiro está en proceso. Saír agora da páxina cancelará o envío.", "URL cannot be empty." => "O URL non pode quedar baleiro.", "Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Nome de cartafol incorrecto. O uso de «Compartido» e «Shared» está reservado para o ownClod", @@ -32,8 +35,10 @@ $TRANSLATIONS = array( "cancel" => "cancelar", "replaced {new_name} with {old_name}" => "substituír {new_name} por {old_name}", "undo" => "desfacer", +"_%n folder_::_%n folders_" => array("%n cartafol","%n cartafoles"), +"_%n file_::_%n files_" => array("%n ficheiro","%n ficheiros"), +"{dirs} and {files}" => "{dirs} e {files}", "_Uploading %n file_::_Uploading %n files_" => array("Cargando %n ficheiro","Cargando %n ficheiros"), -"files uploading" => "ficheiros enviándose", "'.' is an invalid file name." => "«.» é un nome de ficheiro incorrecto", "File name cannot be empty." => "O nome de ficheiro non pode estar baleiro", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nome incorrecto, non se permite «\\», «/», «<», «>», «:», «\"», «|», «?» e «*».", @@ -41,11 +46,10 @@ $TRANSLATIONS = array( "Your storage is almost full ({usedSpacePercent}%)" => "O seu espazo de almacenamento está case cheo ({usedSpacePercent}%)", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "O cifrado foi desactivado, mais os ficheiros están cifrados. Vaia á configuración persoal para descifrar os ficheiros.", "Your download is being prepared. This might take some time if the files are big." => "Está a prepararse a súa descarga. Isto pode levar bastante tempo se os ficheiros son grandes.", +"Error moving file" => "Produciuse un erro ao mover o ficheiro", "Name" => "Nome", "Size" => "Tamaño", "Modified" => "Modificado", -"_%n folder_::_%n folders_" => array("%n cartafol","%n cartafoles"), -"_%n file_::_%n files_" => array("%n ficheiro","%n ficheiros"), "%s could not be renamed" => "%s non pode cambiar de nome", "Upload" => "Enviar", "File handling" => "Manexo de ficheiro", @@ -71,10 +75,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Os ficheiros que tenta enviar exceden do tamaño máximo permitido neste servidor", "Files are being scanned, please wait." => "Estanse analizando os ficheiros. Agarde.", "Current scanning" => "Análise actual", -"directory" => "directorio", -"directories" => "directorios", -"file" => "ficheiro", -"files" => "ficheiros", "Upgrading filesystem cache..." => "Anovando a caché do sistema de ficheiros..." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/he.php b/apps/files/l10n/he.php index ef98e2d2188fd2c46ff41ece7aec0efe4dbd250c..bc7ecdb0716512d64396497514536800d747fa48 100644 --- a/apps/files/l10n/he.php +++ b/apps/files/l10n/he.php @@ -13,7 +13,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "אין די שטח פנוי באחסון", "Invalid directory." => "תיקייה שגויה.", "Files" => "קבצים", -"Unable to upload your file as it is a directory or has 0 bytes" => "לא יכול להעלות את הקובץ מכיוון שזו תקיה או שמשקל הקובץ 0 בתים", "Upload cancelled." => "ההעלאה בוטלה.", "File upload is in progress. Leaving the page now will cancel the upload." => "מתבצעת כעת העלאת קבצים. עזיבה של העמוד תבטל את ההעלאה.", "URL cannot be empty." => "קישור אינו יכול להיות ריק.", @@ -28,14 +27,13 @@ $TRANSLATIONS = array( "cancel" => "ביטול", "replaced {new_name} with {old_name}" => "{new_name} הוחלף ב־{old_name}", "undo" => "ביטול", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "_Uploading %n file_::_Uploading %n files_" => array("",""), -"files uploading" => "קבצים בהעלאה", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "השם שגוי, אסור להשתמש בתווים '\\', '/', '<', '>', ':', '\"', '|', '?' ו־'*'.", "Name" => "שם", "Size" => "גודל", "Modified" => "זמן שינוי", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), "Upload" => "העלאה", "File handling" => "טיפול בקבצים", "Maximum upload size" => "גודל העלאה מקסימלי", @@ -57,8 +55,6 @@ $TRANSLATIONS = array( "Upload too large" => "העלאה גדולה מידי", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "הקבצים שניסית להעלות חרגו מהגודל המקסימלי להעלאת קבצים על שרת זה.", "Files are being scanned, please wait." => "הקבצים נסרקים, נא להמתין.", -"Current scanning" => "הסריקה הנוכחית", -"file" => "קובץ", -"files" => "קבצים" +"Current scanning" => "הסריקה הנוכחית" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/hi.php b/apps/files/l10n/hi.php index 7fb5a5b09d3c98629a280914bab27f3295451256..549c928320d2c788764605ce69f055dd4d9c1699 100644 --- a/apps/files/l10n/hi.php +++ b/apps/files/l10n/hi.php @@ -2,9 +2,10 @@ $TRANSLATIONS = array( "Error" => "त्रुटि", "Share" => "साझा करें", -"_Uploading %n file_::_Uploading %n files_" => array("",""), "_%n folder_::_%n folders_" => array("",""), "_%n file_::_%n files_" => array("",""), +"_Uploading %n file_::_Uploading %n files_" => array("",""), +"Upload" => "अपलोड ", "Save" => "सहेजें" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/hr.php b/apps/files/l10n/hr.php index 8f74dea092f0bd332e108cbc3ca1295cc182c7e9..60f1da844091fb75b639d4776b9a38fb96f17e2c 100644 --- a/apps/files/l10n/hr.php +++ b/apps/files/l10n/hr.php @@ -7,7 +7,6 @@ $TRANSLATIONS = array( "Missing a temporary folder" => "Nedostaje privremeni direktorij", "Failed to write to disk" => "Neuspjelo pisanje na disk", "Files" => "Datoteke", -"Unable to upload your file as it is a directory or has 0 bytes" => "Nemoguće poslati datoteku jer je prazna ili je direktorij", "Upload cancelled." => "Slanje poništeno.", "File upload is in progress. Leaving the page now will cancel the upload." => "Učitavanje datoteke. Napuštanjem stranice će prekinuti učitavanje.", "Error" => "Greška", @@ -18,13 +17,12 @@ $TRANSLATIONS = array( "suggest name" => "predloži ime", "cancel" => "odustani", "undo" => "vrati", +"_%n folder_::_%n folders_" => array("","",""), +"_%n file_::_%n files_" => array("","",""), "_Uploading %n file_::_Uploading %n files_" => array("","",""), -"files uploading" => "datoteke se učitavaju", "Name" => "Ime", "Size" => "Veličina", "Modified" => "Zadnja promjena", -"_%n folder_::_%n folders_" => array("","",""), -"_%n file_::_%n files_" => array("","",""), "Upload" => "Učitaj", "File handling" => "datoteka za rukovanje", "Maximum upload size" => "Maksimalna veličina prijenosa", @@ -45,8 +43,6 @@ $TRANSLATIONS = array( "Upload too large" => "Prijenos je preobiman", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Datoteke koje pokušavate prenijeti prelaze maksimalnu veličinu za prijenos datoteka na ovom poslužitelju.", "Files are being scanned, please wait." => "Datoteke se skeniraju, molimo pričekajte.", -"Current scanning" => "Trenutno skeniranje", -"file" => "datoteka", -"files" => "datoteke" +"Current scanning" => "Trenutno skeniranje" ); $PLURAL_FORMS = "nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;"; diff --git a/apps/files/l10n/hu_HU.php b/apps/files/l10n/hu_HU.php index e8d3b8c86766db555b970954a939fb3630243f26..4dd6a13d320f34831efecfe648df757caefe8eec 100644 --- a/apps/files/l10n/hu_HU.php +++ b/apps/files/l10n/hu_HU.php @@ -13,11 +13,14 @@ $TRANSLATIONS = array( "Missing a temporary folder" => "Hiányzik egy ideiglenes mappa", "Failed to write to disk" => "Nem sikerült a lemezre történő írás", "Not enough storage available" => "Nincs elég szabad hely.", +"Upload failed. Could not get file info." => "A feltöltés nem sikerült. Az állományt leíró információk nem érhetők el.", +"Upload failed. Could not find uploaded file" => "A feltöltés nem sikerült. Nem található a feltöltendő állomány.", "Invalid directory." => "Érvénytelen mappa.", "Files" => "Fájlok", -"Unable to upload your file as it is a directory or has 0 bytes" => "Nem tölthető fel, mert mappa volt, vagy 0 byte méretű", +"Unable to upload {filename} as it is a directory or has 0 bytes" => "A(z) {filename} állomány nem tölthető fel, mert ez vagy egy mappa, vagy pedig 0 bájtból áll.", "Not enough space available" => "Nincs elég szabad hely", "Upload cancelled." => "A feltöltést megszakítottuk.", +"Could not get result from server." => "A kiszolgálótól nem kapható meg az eredmény.", "File upload is in progress. Leaving the page now will cancel the upload." => "Fájlfeltöltés van folyamatban. Az oldal elhagyása megszakítja a feltöltést.", "URL cannot be empty." => "Az URL nem lehet semmi.", "Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Érvénytelen mappanév. A 'Shared' az ownCloud számára fenntartott elnevezés", @@ -32,19 +35,21 @@ $TRANSLATIONS = array( "cancel" => "mégse", "replaced {new_name} with {old_name}" => "{new_name} fájlt kicseréltük ezzel: {old_name}", "undo" => "visszavonás", -"_Uploading %n file_::_Uploading %n files_" => array("",""), -"files uploading" => "fájl töltődik föl", +"_%n folder_::_%n folders_" => array("%n mappa","%n mappa"), +"_%n file_::_%n files_" => array("%n állomány","%n állomány"), +"{dirs} and {files}" => "{dirs} és {files}", +"_Uploading %n file_::_Uploading %n files_" => array("%n állomány feltöltése","%n állomány feltöltése"), "'.' is an invalid file name." => "'.' fájlnév érvénytelen.", "File name cannot be empty." => "A fájlnév nem lehet semmi.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Érvénytelen elnevezés. Ezek a karakterek nem használhatók: '\\', '/', '<', '>', ':', '\"', '|', '?' és '*'", "Your storage is full, files can not be updated or synced anymore!" => "A tároló tele van, a fájlok nem frissíthetőek vagy szinkronizálhatóak a jövőben.", "Your storage is almost full ({usedSpacePercent}%)" => "A tároló majdnem tele van ({usedSpacePercent}%)", +"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "A titkosítási funkciót kikapcsolták, de az Ön állományai még mindig titkosított állapotban vannak. A személyes beállításoknál tudja a titkosítást feloldani.", "Your download is being prepared. This might take some time if the files are big." => "Készül a letöltendő állomány. Ez eltarthat egy ideig, ha nagyok a fájlok.", +"Error moving file" => "Az állomány áthelyezése nem sikerült.", "Name" => "Név", "Size" => "Méret", "Modified" => "Módosítva", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), "%s could not be renamed" => "%s átnevezése nem sikerült", "Upload" => "Feltöltés", "File handling" => "Fájlkezelés", @@ -70,10 +75,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "A feltöltendő állományok mérete meghaladja a kiszolgálón megengedett maximális méretet.", "Files are being scanned, please wait." => "A fájllista ellenőrzése zajlik, kis türelmet!", "Current scanning" => "Ellenőrzés alatt", -"directory" => "mappa", -"directories" => "mappa", -"file" => "fájl", -"files" => "fájlok", "Upgrading filesystem cache..." => "A fájlrendszer gyorsítótárának frissítése zajlik..." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/hy.php b/apps/files/l10n/hy.php index a419a74cc972b362f7b5cc20be7c7796e8656a2c..9a5ebb862a9f150acb2fbb4c1a9c4ba170136fdc 100644 --- a/apps/files/l10n/hy.php +++ b/apps/files/l10n/hy.php @@ -1,8 +1,8 @@ array("",""), "_%n folder_::_%n folders_" => array("",""), "_%n file_::_%n files_" => array("",""), +"_Uploading %n file_::_Uploading %n files_" => array("",""), "Save" => "Պահպանել", "Download" => "Բեռնել", "Delete" => "Ջնջել" diff --git a/apps/files/l10n/ia.php b/apps/files/l10n/ia.php index 202375636a1ea638be137b8be71c06e94b956178..1560687f6c4e646a9ba845b923ae213a56971d3c 100644 --- a/apps/files/l10n/ia.php +++ b/apps/files/l10n/ia.php @@ -6,12 +6,12 @@ $TRANSLATIONS = array( "Files" => "Files", "Error" => "Error", "Share" => "Compartir", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "_Uploading %n file_::_Uploading %n files_" => array("",""), "Name" => "Nomine", "Size" => "Dimension", "Modified" => "Modificate", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), "Upload" => "Incargar", "Maximum upload size" => "Dimension maxime de incargamento", "Save" => "Salveguardar", diff --git a/apps/files/l10n/id.php b/apps/files/l10n/id.php index 84d9ba2020f1ba163b6068febcf7c482770134b2..c8b3194eb6b0d182ad71761b2bd88ef116554c65 100644 --- a/apps/files/l10n/id.php +++ b/apps/files/l10n/id.php @@ -13,7 +13,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "Ruang penyimpanan tidak mencukupi", "Invalid directory." => "Direktori tidak valid.", "Files" => "Berkas", -"Unable to upload your file as it is a directory or has 0 bytes" => "Gagal mengunggah berkas Anda karena berupa direktori atau mempunyai ukuran 0 byte", "Not enough space available" => "Ruang penyimpanan tidak mencukupi", "Upload cancelled." => "Pengunggahan dibatalkan.", "File upload is in progress. Leaving the page now will cancel the upload." => "Berkas sedang diunggah. Meninggalkan halaman ini akan membatalkan proses.", @@ -29,8 +28,9 @@ $TRANSLATIONS = array( "cancel" => "batalkan", "replaced {new_name} with {old_name}" => "mengganti {new_name} dengan {old_name}", "undo" => "urungkan", +"_%n folder_::_%n folders_" => array(""), +"_%n file_::_%n files_" => array(""), "_Uploading %n file_::_Uploading %n files_" => array(""), -"files uploading" => "berkas diunggah", "'.' is an invalid file name." => "'.' bukan nama berkas yang valid.", "File name cannot be empty." => "Nama berkas tidak boleh kosong.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nama tidak valid, karakter '\\', '/', '<', '>', ':', '\"', '|', '?' dan '*' tidak diizinkan.", @@ -40,8 +40,6 @@ $TRANSLATIONS = array( "Name" => "Nama", "Size" => "Ukuran", "Modified" => "Dimodifikasi", -"_%n folder_::_%n folders_" => array(""), -"_%n file_::_%n files_" => array(""), "Upload" => "Unggah", "File handling" => "Penanganan berkas", "Maximum upload size" => "Ukuran pengunggahan maksimum", @@ -66,8 +64,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Berkas yang dicoba untuk diunggah melebihi ukuran maksimum pengunggahan berkas di server ini.", "Files are being scanned, please wait." => "Berkas sedang dipindai, silakan tunggu.", "Current scanning" => "Yang sedang dipindai", -"file" => "berkas", -"files" => "berkas-berkas", "Upgrading filesystem cache..." => "Meningkatkan tembolok sistem berkas..." ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/l10n/is.php b/apps/files/l10n/is.php index 36116001bce9b163f6912cad313f48ff6982cedb..ef49341820691d92f570434e5e0313bdea535750 100644 --- a/apps/files/l10n/is.php +++ b/apps/files/l10n/is.php @@ -12,7 +12,6 @@ $TRANSLATIONS = array( "Failed to write to disk" => "Tókst ekki að skrifa á disk", "Invalid directory." => "Ógild mappa.", "Files" => "Skrár", -"Unable to upload your file as it is a directory or has 0 bytes" => "Innsending á skrá mistókst, hugsanlega sendir þú möppu eða skráin er 0 bæti.", "Not enough space available" => "Ekki nægt pláss tiltækt", "Upload cancelled." => "Hætt við innsendingu.", "File upload is in progress. Leaving the page now will cancel the upload." => "Innsending í gangi. Ef þú ferð af þessari síðu mun innsending misheppnast.", @@ -27,6 +26,8 @@ $TRANSLATIONS = array( "cancel" => "hætta við", "replaced {new_name} with {old_name}" => "yfirskrifaði {new_name} með {old_name}", "undo" => "afturkalla", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "_Uploading %n file_::_Uploading %n files_" => array("",""), "'.' is an invalid file name." => "'.' er ekki leyfilegt nafn.", "File name cannot be empty." => "Nafn skráar má ekki vera tómt", @@ -34,8 +35,6 @@ $TRANSLATIONS = array( "Name" => "Nafn", "Size" => "Stærð", "Modified" => "Breytt", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), "Upload" => "Senda inn", "File handling" => "Meðhöndlun skrár", "Maximum upload size" => "Hámarks stærð innsendingar", diff --git a/apps/files/l10n/it.php b/apps/files/l10n/it.php index 9be317fba992234d2a952f9f9eccf3d5a7b0a058..44b4e341956df3b771bfdee982230d317ff87296 100644 --- a/apps/files/l10n/it.php +++ b/apps/files/l10n/it.php @@ -13,11 +13,14 @@ $TRANSLATIONS = array( "Missing a temporary folder" => "Manca una cartella temporanea", "Failed to write to disk" => "Scrittura su disco non riuscita", "Not enough storage available" => "Spazio di archiviazione insufficiente", +"Upload failed. Could not get file info." => "Caricamento non riuscito. Impossibile ottenere informazioni sul file.", +"Upload failed. Could not find uploaded file" => "Caricamento non riuscito. Impossibile trovare il file caricato.", "Invalid directory." => "Cartella non valida.", "Files" => "File", -"Unable to upload your file as it is a directory or has 0 bytes" => "Impossibile caricare il file poiché è una cartella o ha una dimensione di 0 byte", +"Unable to upload {filename} as it is a directory or has 0 bytes" => "Impossibile caricare {filename} poiché è una cartella oppure ha una dimensione di 0 byte.", "Not enough space available" => "Spazio disponibile insufficiente", "Upload cancelled." => "Invio annullato", +"Could not get result from server." => "Impossibile ottenere il risultato dal server.", "File upload is in progress. Leaving the page now will cancel the upload." => "Caricamento del file in corso. La chiusura della pagina annullerà il caricamento.", "URL cannot be empty." => "L'URL non può essere vuoto.", "Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Nome della cartella non valido. L'uso di 'Shared' è riservato a ownCloud", @@ -32,8 +35,10 @@ $TRANSLATIONS = array( "cancel" => "annulla", "replaced {new_name} with {old_name}" => "sostituito {new_name} con {old_name}", "undo" => "annulla", +"_%n folder_::_%n folders_" => array("%n cartella","%n cartelle"), +"_%n file_::_%n files_" => array("%n file","%n file"), +"{dirs} and {files}" => "{dirs} e {files}", "_Uploading %n file_::_Uploading %n files_" => array("Caricamento di %n file in corso","Caricamento di %n file in corso"), -"files uploading" => "caricamento file", "'.' is an invalid file name." => "'.' non è un nome file valido.", "File name cannot be empty." => "Il nome del file non può essere vuoto.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nome non valido, '\\', '/', '<', '>', ':', '\"', '|', '?' e '*' non sono consentiti.", @@ -41,11 +46,10 @@ $TRANSLATIONS = array( "Your storage is almost full ({usedSpacePercent}%)" => "Lo spazio di archiviazione è quasi pieno ({usedSpacePercent}%)", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "La cifratura è stata disabilitata ma i tuoi file sono ancora cifrati. Vai nelle impostazioni personali per decifrare i file.", "Your download is being prepared. This might take some time if the files are big." => "Il tuo scaricamento è in fase di preparazione. Ciò potrebbe richiedere del tempo se i file sono grandi.", +"Error moving file" => "Errore durante lo spostamento del file", "Name" => "Nome", "Size" => "Dimensione", "Modified" => "Modificato", -"_%n folder_::_%n folders_" => array("%n cartella","%n cartelle"), -"_%n file_::_%n files_" => array("%n file","%n file"), "%s could not be renamed" => "%s non può essere rinominato", "Upload" => "Carica", "File handling" => "Gestione file", @@ -71,10 +75,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "I file che stai provando a caricare superano la dimensione massima consentita su questo server.", "Files are being scanned, please wait." => "Scansione dei file in corso, attendi", "Current scanning" => "Scansione corrente", -"directory" => "cartella", -"directories" => "cartelle", -"file" => "file", -"files" => "file", "Upgrading filesystem cache..." => "Aggiornamento della cache del filesystem in corso..." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/ja_JP.php b/apps/files/l10n/ja_JP.php index 902cc82e0363e233343afce94e42eebe6d76596f..07ee96f1eb6c1d36aff8205ee7773bee55a76064 100644 --- a/apps/files/l10n/ja_JP.php +++ b/apps/files/l10n/ja_JP.php @@ -13,11 +13,14 @@ $TRANSLATIONS = array( "Missing a temporary folder" => "一時保存フォルダが見つかりません", "Failed to write to disk" => "ディスクへの書き込みに失敗しました", "Not enough storage available" => "ストレージに十分な空き容量がありません", +"Upload failed. Could not get file info." => "アップロードに失敗。ファイル情報を取得できませんでした。", +"Upload failed. Could not find uploaded file" => "アップロードに失敗。アップロード済みのファイルを見つけることができませんでした。", "Invalid directory." => "無効なディレクトリです。", "Files" => "ファイル", -"Unable to upload your file as it is a directory or has 0 bytes" => "ディレクトリもしくは0バイトのファイルはアップロードできません", +"Unable to upload {filename} as it is a directory or has 0 bytes" => "ディレクトリもしくは0バイトのため {filename} をアップロードできません", "Not enough space available" => "利用可能なスペースが十分にありません", "Upload cancelled." => "アップロードはキャンセルされました。", +"Could not get result from server." => "サーバから結果を取得できませんでした。", "File upload is in progress. Leaving the page now will cancel the upload." => "ファイル転送を実行中です。今このページから移動するとアップロードが中止されます。", "URL cannot be empty." => "URLは空にできません。", "Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "無効なフォルダ名です。'Shared' の利用はownCloudで予約済みです", @@ -32,8 +35,10 @@ $TRANSLATIONS = array( "cancel" => "キャンセル", "replaced {new_name} with {old_name}" => "{old_name} を {new_name} に置換", "undo" => "元に戻す", +"_%n folder_::_%n folders_" => array("%n個のフォルダ"), +"_%n file_::_%n files_" => array("%n個のファイル"), +"{dirs} and {files}" => "{dirs} と {files}", "_Uploading %n file_::_Uploading %n files_" => array("%n 個のファイルをアップロード中"), -"files uploading" => "ファイルをアップロード中", "'.' is an invalid file name." => "'.' は無効なファイル名です。", "File name cannot be empty." => "ファイル名を空にすることはできません。", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "無効な名前、'\\', '/', '<', '>', ':', '\"', '|', '?', '*' は使用できません。", @@ -41,11 +46,10 @@ $TRANSLATIONS = array( "Your storage is almost full ({usedSpacePercent}%)" => "あなたのストレージはほぼ一杯です({usedSpacePercent}%)", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "暗号化の機能は無効化されましたが、ファイルはすでに暗号化されています。個人設定からファイルを複合を行ってください。", "Your download is being prepared. This might take some time if the files are big." => "ダウンロードの準備中です。ファイルサイズが大きい場合は少し時間がかかるかもしれません。", +"Error moving file" => "ファイルの移動エラー", "Name" => "名前", "Size" => "サイズ", "Modified" => "変更", -"_%n folder_::_%n folders_" => array("%n個のフォルダ"), -"_%n file_::_%n files_" => array("%n個のファイル"), "%s could not be renamed" => "%sの名前を変更できませんでした", "Upload" => "アップロード", "File handling" => "ファイル操作", @@ -71,10 +75,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "アップロードしようとしているファイルは、サーバで規定された最大サイズを超えています。", "Files are being scanned, please wait." => "ファイルをスキャンしています、しばらくお待ちください。", "Current scanning" => "スキャン中", -"directory" => "ディレクトリ", -"directories" => "ディレクトリ", -"file" => "ファイル", -"files" => "ファイル", "Upgrading filesystem cache..." => "ファイルシステムキャッシュを更新中..." ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/l10n/ka.php b/apps/files/l10n/ka.php index 527a2c49b1cc3446cfc2816d1e69303dea949c36..544e8168c548e6d5351f06ccd90428a0748f4e06 100644 --- a/apps/files/l10n/ka.php +++ b/apps/files/l10n/ka.php @@ -1,9 +1,9 @@ "ფაილები", -"_Uploading %n file_::_Uploading %n files_" => array(""), "_%n folder_::_%n folders_" => array(""), "_%n file_::_%n files_" => array(""), +"_Uploading %n file_::_Uploading %n files_" => array(""), "Download" => "გადმოწერა" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/l10n/ka_GE.php b/apps/files/l10n/ka_GE.php index 3e70d3294c1b3353c6061354c026715572e9d570..b9313957714b6db6c99d5869ffb5ecc1dbd98e42 100644 --- a/apps/files/l10n/ka_GE.php +++ b/apps/files/l10n/ka_GE.php @@ -13,7 +13,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "საცავში საკმარისი ადგილი არ არის", "Invalid directory." => "დაუშვებელი დირექტორია.", "Files" => "ფაილები", -"Unable to upload your file as it is a directory or has 0 bytes" => "თქვენი ფაილის ატვირთვა ვერ მოხერხდა. ის არის საქაღალდე და შეიცავს 0 ბაიტს", "Not enough space available" => "საკმარისი ადგილი არ არის", "Upload cancelled." => "ატვირთვა შეჩერებულ იქნა.", "File upload is in progress. Leaving the page now will cancel the upload." => "მიმდინარეობს ფაილის ატვირთვა. სხვა გვერდზე გადასვლა გამოიწვევს ატვირთვის შეჩერებას", @@ -29,8 +28,9 @@ $TRANSLATIONS = array( "cancel" => "უარყოფა", "replaced {new_name} with {old_name}" => "{new_name} შეცვლილია {old_name}–ით", "undo" => "დაბრუნება", +"_%n folder_::_%n folders_" => array(""), +"_%n file_::_%n files_" => array(""), "_Uploading %n file_::_Uploading %n files_" => array(""), -"files uploading" => "ფაილები იტვირთება", "'.' is an invalid file name." => "'.' არის დაუშვებელი ფაილის სახელი.", "File name cannot be empty." => "ფაილის სახელი არ შეიძლება იყოს ცარიელი.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "არადაშვებადი სახელი, '\\', '/', '<', '>', ':', '\"', '|', '?' და '*' არ არის დაიშვებული.", @@ -40,8 +40,6 @@ $TRANSLATIONS = array( "Name" => "სახელი", "Size" => "ზომა", "Modified" => "შეცვლილია", -"_%n folder_::_%n folders_" => array(""), -"_%n file_::_%n files_" => array(""), "Upload" => "ატვირთვა", "File handling" => "ფაილის დამუშავება", "Maximum upload size" => "მაქსიმუმ ატვირთის ზომა", diff --git a/apps/files/l10n/km.php b/apps/files/l10n/km.php new file mode 100644 index 0000000000000000000000000000000000000000..70ab6572ba466c23b8066e18b9ee2f9cb2a7a827 --- /dev/null +++ b/apps/files/l10n/km.php @@ -0,0 +1,7 @@ + array(""), +"_%n file_::_%n files_" => array(""), +"_Uploading %n file_::_Uploading %n files_" => array("") +); +$PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/l10n/kn.php b/apps/files/l10n/kn.php new file mode 100644 index 0000000000000000000000000000000000000000..70ab6572ba466c23b8066e18b9ee2f9cb2a7a827 --- /dev/null +++ b/apps/files/l10n/kn.php @@ -0,0 +1,7 @@ + array(""), +"_%n file_::_%n files_" => array(""), +"_Uploading %n file_::_Uploading %n files_" => array("") +); +$PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/l10n/ko.php b/apps/files/l10n/ko.php index f53c9e8e38e49bfbb679592624addec26cc74f9d..0174f8d0d21a4b480587d5190bea6f202d713057 100644 --- a/apps/files/l10n/ko.php +++ b/apps/files/l10n/ko.php @@ -2,6 +2,8 @@ $TRANSLATIONS = array( "Could not move %s - File with this name already exists" => "%s 항목을 이동시키지 못하였음 - 파일 이름이 이미 존재함", "Could not move %s" => "%s 항목을 이딩시키지 못하였음", +"Unable to set upload directory." => "업로드 디렉터리를 정할수 없습니다", +"Invalid Token" => "잘못된 토큰", "No file was uploaded. Unknown error" => "파일이 업로드되지 않았습니다. 알 수 없는 오류입니다", "There is no error, the file uploaded with success" => "파일 업로드에 성공하였습니다.", "The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "업로드한 파일이 php.ini의 upload_max_filesize보다 큽니다:", @@ -11,13 +13,17 @@ $TRANSLATIONS = array( "Missing a temporary folder" => "임시 폴더가 없음", "Failed to write to disk" => "디스크에 쓰지 못했습니다", "Not enough storage available" => "저장소가 용량이 충분하지 않습니다.", +"Upload failed. Could not get file info." => "업로드에 실패했습니다. 파일 정보를 가져올수 없습니다.", +"Upload failed. Could not find uploaded file" => "업로드에 실패했습니다. 업로드할 파일을 찾을수 없습니다", "Invalid directory." => "올바르지 않은 디렉터리입니다.", "Files" => "파일", -"Unable to upload your file as it is a directory or has 0 bytes" => "디렉터리 및 빈 파일은 업로드할 수 없습니다", +"Unable to upload {filename} as it is a directory or has 0 bytes" => "{filename}을 업로드 할수 없습니다. 폴더이거나 0 바이트 파일입니다.", "Not enough space available" => "여유 공간이 부족합니다", "Upload cancelled." => "업로드가 취소되었습니다.", +"Could not get result from server." => "서버에서 결과를 가져올수 없습니다.", "File upload is in progress. Leaving the page now will cancel the upload." => "파일 업로드가 진행 중입니다. 이 페이지를 벗어나면 업로드가 취소됩니다.", "URL cannot be empty." => "URL을 입력해야 합니다.", +"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "유효하지 않은 폴더명입니다. \"Shared\" 이름의 사용은 OwnCloud 가 이미 예약하고 있습니다.", "Error" => "오류", "Share" => "공유", "Delete permanently" => "영원히 삭제", @@ -29,19 +35,22 @@ $TRANSLATIONS = array( "cancel" => "취소", "replaced {new_name} with {old_name}" => "{old_name}이(가) {new_name}(으)로 대체됨", "undo" => "되돌리기", -"_Uploading %n file_::_Uploading %n files_" => array(""), -"files uploading" => "파일 업로드중", +"_%n folder_::_%n folders_" => array("폴더 %n"), +"_%n file_::_%n files_" => array("파일 %n 개"), +"{dirs} and {files}" => "{dirs} 그리고 {files}", +"_Uploading %n file_::_Uploading %n files_" => array("%n 개의 파일을 업로드중"), "'.' is an invalid file name." => "'.' 는 올바르지 않은 파일 이름 입니다.", "File name cannot be empty." => "파일 이름이 비어 있을 수 없습니다.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "폴더 이름이 올바르지 않습니다. 이름에 문자 '\\', '/', '<', '>', ':', '\"', '|', '? ', '*'는 사용할 수 없습니다.", "Your storage is full, files can not be updated or synced anymore!" => "저장 공간이 가득 찼습니다. 파일을 업데이트하거나 동기화할 수 없습니다!", "Your storage is almost full ({usedSpacePercent}%)" => "저장 공간이 거의 가득 찼습니다 ({usedSpacePercent}%)", +"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "암호화는 해제되어 있지만, 파일은 아직 암호화 되어 있습니다. 개인 설저에 가셔서 암호를 해제하십시오", "Your download is being prepared. This might take some time if the files are big." => "다운로드가 준비 중입니다. 파일 크기가 크다면 시간이 오래 걸릴 수도 있습니다.", +"Error moving file" => "파일 이동 오류", "Name" => "이름", "Size" => "크기", "Modified" => "수정됨", -"_%n folder_::_%n folders_" => array(""), -"_%n file_::_%n files_" => array(""), +"%s could not be renamed" => "%s 의 이름을 변경할수 없습니다", "Upload" => "업로드", "File handling" => "파일 처리", "Maximum upload size" => "최대 업로드 크기", @@ -66,8 +75,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "이 파일이 서버에서 허용하는 최대 업로드 가능 용량보다 큽니다.", "Files are being scanned, please wait." => "파일을 검색하고 있습니다. 기다려 주십시오.", "Current scanning" => "현재 검색", -"file" => "파일", -"files" => "파일", "Upgrading filesystem cache..." => "파일 시스템 캐시 업그레이드 중..." ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/l10n/ku_IQ.php b/apps/files/l10n/ku_IQ.php index 81177f9bea07221749f112997e332ad5e91a1dce..d98848a71f099a262830da1784c277ddde68b566 100644 --- a/apps/files/l10n/ku_IQ.php +++ b/apps/files/l10n/ku_IQ.php @@ -2,10 +2,11 @@ $TRANSLATIONS = array( "URL cannot be empty." => "ناونیشانی به‌سته‌ر نابێت به‌تاڵ بێت.", "Error" => "هه‌ڵه", -"_Uploading %n file_::_Uploading %n files_" => array("",""), -"Name" => "ناو", +"Share" => "هاوبەشی کردن", "_%n folder_::_%n folders_" => array("",""), "_%n file_::_%n files_" => array("",""), +"_Uploading %n file_::_Uploading %n files_" => array("",""), +"Name" => "ناو", "Upload" => "بارکردن", "Save" => "پاشکه‌وتکردن", "Folder" => "بوخچه", diff --git a/apps/files/l10n/lb.php b/apps/files/l10n/lb.php index c57eebd9e765fed8e90f8e91f4778dcf1359bf32..cd68b2b9ad2ec25562d4369f0eb3c992291867bc 100644 --- a/apps/files/l10n/lb.php +++ b/apps/files/l10n/lb.php @@ -7,7 +7,6 @@ $TRANSLATIONS = array( "Missing a temporary folder" => "Et feelt en temporären Dossier", "Failed to write to disk" => "Konnt net op den Disk schreiwen", "Files" => "Dateien", -"Unable to upload your file as it is a directory or has 0 bytes" => "Kann deng Datei net eroplueden well et en Dossier ass oder 0 byte grouss ass.", "Upload cancelled." => "Upload ofgebrach.", "File upload is in progress. Leaving the page now will cancel the upload." => "File Upload am gaang. Wann's de des Säit verléiss gëtt den Upload ofgebrach.", "Error" => "Fehler", @@ -15,12 +14,12 @@ $TRANSLATIONS = array( "replace" => "ersetzen", "cancel" => "ofbriechen", "undo" => "réckgängeg man", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "_Uploading %n file_::_Uploading %n files_" => array("",""), "Name" => "Numm", "Size" => "Gréisst", "Modified" => "Geännert", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), "Upload" => "Eroplueden", "File handling" => "Fichier handling", "Maximum upload size" => "Maximum Upload Gréisst ", @@ -41,8 +40,6 @@ $TRANSLATIONS = array( "Upload too large" => "Upload ze grouss", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Déi Dateien déi Dir probéiert erop ze lueden sinn méi grouss wei déi Maximal Gréisst déi op dësem Server erlaabt ass.", "Files are being scanned, please wait." => "Fichieren gi gescannt, war weg.", -"Current scanning" => "Momentane Scan", -"file" => "Datei", -"files" => "Dateien" +"Current scanning" => "Momentane Scan" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/lt_LT.php b/apps/files/l10n/lt_LT.php index a4dd5008afb96969828900b9fe85bdd0bc47331b..d064b0c6523c23e9a8fcd96d3c902ad0e3369629 100644 --- a/apps/files/l10n/lt_LT.php +++ b/apps/files/l10n/lt_LT.php @@ -2,6 +2,8 @@ $TRANSLATIONS = array( "Could not move %s - File with this name already exists" => "Nepavyko perkelti %s - failas su tokiu pavadinimu jau egzistuoja", "Could not move %s" => "Nepavyko perkelti %s", +"Unable to set upload directory." => "Nepavyksta nustatyti įkėlimų katalogo.", +"Invalid Token" => "Netinkamas ženklas", "No file was uploaded. Unknown error" => "Failai nebuvo įkelti dėl nežinomos priežasties", "There is no error, the file uploaded with success" => "Failas įkeltas sėkmingai, be klaidų", "The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "Įkeliamas failas yra didesnis nei leidžia upload_max_filesize php.ini faile:", @@ -11,11 +13,14 @@ $TRANSLATIONS = array( "Missing a temporary folder" => "Nėra laikinojo katalogo", "Failed to write to disk" => "Nepavyko įrašyti į diską", "Not enough storage available" => "Nepakanka vietos serveryje", +"Upload failed. Could not get file info." => "Įkėlimas nepavyko. Nepavyko gauti failo informacijos.", +"Upload failed. Could not find uploaded file" => "Įkėlimas nepavyko. Nepavyko rasti įkelto failo", "Invalid directory." => "Neteisingas aplankas", "Files" => "Failai", -"Unable to upload your file as it is a directory or has 0 bytes" => "Neįmanoma įkelti failo - jo dydis gali būti 0 bitų arba tai katalogas", +"Unable to upload {filename} as it is a directory or has 0 bytes" => "Nepavyksta įkelti {filename}, nes tai katalogas arba yra 0 baitų dydžio", "Not enough space available" => "Nepakanka vietos", "Upload cancelled." => "Įkėlimas atšauktas.", +"Could not get result from server." => "Nepavyko gauti rezultato iš serverio.", "File upload is in progress. Leaving the page now will cancel the upload." => "Failo įkėlimas pradėtas. Jei paliksite šį puslapį, įkėlimas nutrūks.", "URL cannot be empty." => "URL negali būti tuščias.", "Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Negalimas aplanko pavadinimas. 'Shared' pavadinimas yra rezervuotas ownCloud", @@ -30,19 +35,22 @@ $TRANSLATIONS = array( "cancel" => "atšaukti", "replaced {new_name} with {old_name}" => "pakeiskite {new_name} į {old_name}", "undo" => "anuliuoti", -"_Uploading %n file_::_Uploading %n files_" => array("","",""), -"files uploading" => "įkeliami failai", +"_%n folder_::_%n folders_" => array("%n aplankas","%n aplankai","%n aplankų"), +"_%n file_::_%n files_" => array("%n failas","%n failai","%n failų"), +"{dirs} and {files}" => "{dirs} ir {files}", +"_Uploading %n file_::_Uploading %n files_" => array("Įkeliamas %n failas","Įkeliami %n failai","Įkeliama %n failų"), "'.' is an invalid file name." => "'.' yra neleidžiamas failo pavadinime.", "File name cannot be empty." => "Failo pavadinimas negali būti tuščias.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Neleistinas pavadinimas, '\\', '/', '<', '>', ':', '\"', '|', '?' ir '*' yra neleidžiami.", "Your storage is full, files can not be updated or synced anymore!" => "Jūsų visa vieta serveryje užimta", "Your storage is almost full ({usedSpacePercent}%)" => "Jūsų vieta serveryje beveik visa užimta ({usedSpacePercent}%)", +"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Šifravimas buvo išjungtas, bet Jūsų failai vis dar užšifruoti. Prašome eiti į asmeninius nustatymus ir iššifruoti savo failus.", "Your download is being prepared. This might take some time if the files are big." => "Jūsų atsisiuntimas yra paruošiamas. tai gali užtrukti jei atsisiunčiamas didelis failas.", +"Error moving file" => "Klaida perkeliant failą", "Name" => "Pavadinimas", "Size" => "Dydis", "Modified" => "Pakeista", -"_%n folder_::_%n folders_" => array("","",""), -"_%n file_::_%n files_" => array("","",""), +"%s could not be renamed" => "%s negali būti pervadintas", "Upload" => "Įkelti", "File handling" => "Failų tvarkymas", "Maximum upload size" => "Maksimalus įkeliamo failo dydis", @@ -67,8 +75,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Bandomų įkelti failų dydis viršija maksimalų, kuris leidžiamas šiame serveryje", "Files are being scanned, please wait." => "Skenuojami failai, prašome palaukti.", "Current scanning" => "Šiuo metu skenuojama", -"file" => "failas", -"files" => "failai", "Upgrading filesystem cache..." => "Atnaujinamas sistemos kešavimas..." ); $PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/apps/files/l10n/lv.php b/apps/files/l10n/lv.php index b1435b46096224fcd38eb514126eddccbc7aaddf..cefaea62818ead578eb1d12b363ecc4a69f1cfae 100644 --- a/apps/files/l10n/lv.php +++ b/apps/files/l10n/lv.php @@ -15,7 +15,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "Nav pietiekami daudz vietas", "Invalid directory." => "Nederīga direktorija.", "Files" => "Datnes", -"Unable to upload your file as it is a directory or has 0 bytes" => "Nevar augšupielādēt jūsu datni, jo tā ir direktorija vai arī tā ir 0 baitu liela", "Not enough space available" => "Nepietiek brīvas vietas", "Upload cancelled." => "Augšupielāde ir atcelta.", "File upload is in progress. Leaving the page now will cancel the upload." => "Notiek augšupielāde. Pametot lapu tagad, tiks atcelta augšupielāde.", @@ -32,8 +31,9 @@ $TRANSLATIONS = array( "cancel" => "atcelt", "replaced {new_name} with {old_name}" => "aizvietoja {new_name} ar {old_name}", "undo" => "atsaukt", +"_%n folder_::_%n folders_" => array("%n mapes","%n mape","%n mapes"), +"_%n file_::_%n files_" => array("%n faili","%n fails","%n faili"), "_Uploading %n file_::_Uploading %n files_" => array("%n","Augšupielāde %n failu","Augšupielāde %n failus"), -"files uploading" => "fails augšupielādējas", "'.' is an invalid file name." => "'.' ir nederīgs datnes nosaukums.", "File name cannot be empty." => "Datnes nosaukums nevar būt tukšs.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nederīgs nosaukums, nav atļauti '\\', '/', '<', '>', ':', '\"', '|', '?' un '*'.", @@ -44,8 +44,6 @@ $TRANSLATIONS = array( "Name" => "Nosaukums", "Size" => "Izmērs", "Modified" => "Mainīts", -"_%n folder_::_%n folders_" => array("%n mapes","%n mape","%n mapes"), -"_%n file_::_%n files_" => array("%n faili","%n fails","%n faili"), "%s could not be renamed" => "%s nevar tikt pārsaukts", "Upload" => "Augšupielādēt", "File handling" => "Datņu pārvaldība", @@ -71,10 +69,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Augšupielādējamās datnes pārsniedz servera pieļaujamo datņu augšupielādes apjomu", "Files are being scanned, please wait." => "Datnes šobrīd tiek caurskatītas, lūdzu, uzgaidiet.", "Current scanning" => "Šobrīd tiek caurskatīts", -"directory" => "direktorija", -"directories" => "direktorijas", -"file" => "fails", -"files" => "faili", "Upgrading filesystem cache..." => "Uzlabo datņu sistēmas kešatmiņu..." ); $PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);"; diff --git a/apps/files/l10n/mk.php b/apps/files/l10n/mk.php index 20fed43ab20eda052ce74f16776f44bbfe278266..2306db6921a93b3676ca693ac7fd60b9cca30cad 100644 --- a/apps/files/l10n/mk.php +++ b/apps/files/l10n/mk.php @@ -9,7 +9,6 @@ $TRANSLATIONS = array( "Missing a temporary folder" => "Недостасува привремена папка", "Failed to write to disk" => "Неуспеав да запишам на диск", "Files" => "Датотеки", -"Unable to upload your file as it is a directory or has 0 bytes" => "Не може да се преземе вашата датотека бидејќи фолдерот во кој се наоѓа фајлот има големина од 0 бајти", "Upload cancelled." => "Преземањето е прекинато.", "File upload is in progress. Leaving the page now will cancel the upload." => "Подигање на датотека е во тек. Напуштење на страницата ќе го прекине.", "URL cannot be empty." => "Адресата неможе да биде празна.", @@ -23,13 +22,13 @@ $TRANSLATIONS = array( "cancel" => "откажи", "replaced {new_name} with {old_name}" => "заменета {new_name} со {old_name}", "undo" => "врати", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "_Uploading %n file_::_Uploading %n files_" => array("",""), "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Неправилно име. , '\\', '/', '<', '>', ':', '\"', '|', '?' и '*' не се дозволени.", "Name" => "Име", "Size" => "Големина", "Modified" => "Променето", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), "Upload" => "Подигни", "File handling" => "Ракување со датотеки", "Maximum upload size" => "Максимална големина за подигање", @@ -51,8 +50,6 @@ $TRANSLATIONS = array( "Upload too large" => "Фајлот кој се вчитува е преголем", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Датотеките кои се обидувате да ги подигнете ја надминуваат максималната големина за подигнување датотеки на овој сервер.", "Files are being scanned, please wait." => "Се скенираат датотеки, ве молам почекајте.", -"Current scanning" => "Моментално скенирам", -"file" => "датотека", -"files" => "датотеки" +"Current scanning" => "Моментално скенирам" ); $PLURAL_FORMS = "nplurals=2; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : 1;"; diff --git a/apps/files/l10n/ml_IN.php b/apps/files/l10n/ml_IN.php new file mode 100644 index 0000000000000000000000000000000000000000..0157af093e92200cc7790497227e92e62d80165f --- /dev/null +++ b/apps/files/l10n/ml_IN.php @@ -0,0 +1,7 @@ + array("",""), +"_%n file_::_%n files_" => array("",""), +"_Uploading %n file_::_Uploading %n files_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/ms_MY.php b/apps/files/l10n/ms_MY.php index 86b70faefda3b07a977c4f8b768e655dc43fb72c..61bbf81cd8a4d3bd4b0c64cefa6050a57ada4193 100644 --- a/apps/files/l10n/ms_MY.php +++ b/apps/files/l10n/ms_MY.php @@ -8,19 +8,18 @@ $TRANSLATIONS = array( "Missing a temporary folder" => "Direktori sementara hilang", "Failed to write to disk" => "Gagal untuk disimpan", "Files" => "Fail-fail", -"Unable to upload your file as it is a directory or has 0 bytes" => "Tidak boleh memuatnaik fail anda kerana mungkin ianya direktori atau saiz fail 0 bytes", "Upload cancelled." => "Muatnaik dibatalkan.", "Error" => "Ralat", "Share" => "Kongsi", "Pending" => "Dalam proses", "replace" => "ganti", "cancel" => "Batal", +"_%n folder_::_%n folders_" => array(""), +"_%n file_::_%n files_" => array(""), "_Uploading %n file_::_Uploading %n files_" => array(""), "Name" => "Nama", "Size" => "Saiz", "Modified" => "Dimodifikasi", -"_%n folder_::_%n folders_" => array(""), -"_%n file_::_%n files_" => array(""), "Upload" => "Muat naik", "File handling" => "Pengendalian fail", "Maximum upload size" => "Saiz maksimum muat naik", @@ -40,8 +39,6 @@ $TRANSLATIONS = array( "Upload too large" => "Muatnaik terlalu besar", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Fail yang cuba dimuat naik melebihi saiz maksimum fail upload server", "Files are being scanned, please wait." => "Fail sedang diimbas, harap bersabar.", -"Current scanning" => "Imbasan semasa", -"file" => "fail", -"files" => "fail" +"Current scanning" => "Imbasan semasa" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/l10n/my_MM.php b/apps/files/l10n/my_MM.php index 4dc63ffee2d7b03637e751ca3e61c686c9810786..497ecc0949250ba65a5512e9fed53b5484a4f244 100644 --- a/apps/files/l10n/my_MM.php +++ b/apps/files/l10n/my_MM.php @@ -1,9 +1,9 @@ "ဖိုင်များ", -"_Uploading %n file_::_Uploading %n files_" => array(""), "_%n folder_::_%n folders_" => array(""), "_%n file_::_%n files_" => array(""), +"_Uploading %n file_::_Uploading %n files_" => array(""), "Download" => "ဒေါင်းလုတ်" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/l10n/nb_NO.php b/apps/files/l10n/nb_NO.php index 72c4153c6efd9550b5f8e6ef9def9dbcf0fe91ad..8fda251a2bc072c7e2ee45a8421f128a8bb301e8 100644 --- a/apps/files/l10n/nb_NO.php +++ b/apps/files/l10n/nb_NO.php @@ -15,7 +15,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "Ikke nok lagringsplass", "Invalid directory." => "Ugyldig katalog.", "Files" => "Filer", -"Unable to upload your file as it is a directory or has 0 bytes" => "Kan ikke laste opp filen din siden det er en mappe eller den har 0 bytes", "Not enough space available" => "Ikke nok lagringsplass", "Upload cancelled." => "Opplasting avbrutt.", "File upload is in progress. Leaving the page now will cancel the upload." => "Filopplasting pågår. Forlater du siden nå avbrytes opplastingen.", @@ -32,8 +31,9 @@ $TRANSLATIONS = array( "cancel" => "avbryt", "replaced {new_name} with {old_name}" => "erstattet {new_name} med {old_name}", "undo" => "angre", +"_%n folder_::_%n folders_" => array("%n mappe","%n mapper"), +"_%n file_::_%n files_" => array("%n fil","%n filer"), "_Uploading %n file_::_Uploading %n files_" => array("Laster opp %n fil","Laster opp %n filer"), -"files uploading" => "filer lastes opp", "'.' is an invalid file name." => "'.' er et ugyldig filnavn.", "File name cannot be empty." => "Filnavn kan ikke være tomt.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ugyldig navn, '\\', '/', '<', '>', ':', '\"', '|', '?' og '*' er ikke tillatt.", @@ -43,8 +43,6 @@ $TRANSLATIONS = array( "Name" => "Navn", "Size" => "Størrelse", "Modified" => "Endret", -"_%n folder_::_%n folders_" => array("%n mappe","%n mapper"), -"_%n file_::_%n files_" => array("%n fil","%n filer"), "%s could not be renamed" => "Kunne ikke gi nytt navn til %s", "Upload" => "Last opp", "File handling" => "Filhåndtering", @@ -70,10 +68,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Filene du prøver å laste opp er for store for å laste opp til denne serveren.", "Files are being scanned, please wait." => "Skanner filer, vennligst vent.", "Current scanning" => "Pågående skanning", -"directory" => "katalog", -"directories" => "kataloger", -"file" => "fil", -"files" => "filer", "Upgrading filesystem cache..." => "Oppgraderer filsystemets mellomlager..." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/ne.php b/apps/files/l10n/ne.php new file mode 100644 index 0000000000000000000000000000000000000000..0157af093e92200cc7790497227e92e62d80165f --- /dev/null +++ b/apps/files/l10n/ne.php @@ -0,0 +1,7 @@ + array("",""), +"_%n file_::_%n files_" => array("",""), +"_Uploading %n file_::_Uploading %n files_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/nl.php b/apps/files/l10n/nl.php index 422fa8ba130414b7396bdae295a3b108e75309c6..65ad526523795934267b5ee1861ee36c2246cb51 100644 --- a/apps/files/l10n/nl.php +++ b/apps/files/l10n/nl.php @@ -15,7 +15,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "Niet genoeg opslagruimte beschikbaar", "Invalid directory." => "Ongeldige directory.", "Files" => "Bestanden", -"Unable to upload your file as it is a directory or has 0 bytes" => "Het lukt niet om uw bestand te uploaded, omdat het een folder of 0 bytes is", "Not enough space available" => "Niet genoeg ruimte beschikbaar", "Upload cancelled." => "Uploaden geannuleerd.", "File upload is in progress. Leaving the page now will cancel the upload." => "Bestandsupload is bezig. Wanneer de pagina nu verlaten wordt, stopt de upload.", @@ -32,8 +31,10 @@ $TRANSLATIONS = array( "cancel" => "annuleren", "replaced {new_name} with {old_name}" => "verving {new_name} met {old_name}", "undo" => "ongedaan maken", +"_%n folder_::_%n folders_" => array("","%n mappen"), +"_%n file_::_%n files_" => array("","%n bestanden"), +"{dirs} and {files}" => "{dirs} en {files}", "_Uploading %n file_::_Uploading %n files_" => array("%n bestand aan het uploaden","%n bestanden aan het uploaden"), -"files uploading" => "bestanden aan het uploaden", "'.' is an invalid file name." => "'.' is een ongeldige bestandsnaam.", "File name cannot be empty." => "Bestandsnaam kan niet leeg zijn.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Onjuiste naam; '\\', '/', '<', '>', ':', '\"', '|', '?' en '*' zijn niet toegestaan.", @@ -44,8 +45,6 @@ $TRANSLATIONS = array( "Name" => "Naam", "Size" => "Grootte", "Modified" => "Aangepast", -"_%n folder_::_%n folders_" => array("","%n mappen"), -"_%n file_::_%n files_" => array("","%n bestanden"), "%s could not be renamed" => "%s kon niet worden hernoemd", "Upload" => "Uploaden", "File handling" => "Bestand", @@ -71,10 +70,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "De bestanden die u probeert te uploaden zijn groter dan de maximaal toegestane bestandsgrootte voor deze server.", "Files are being scanned, please wait." => "Bestanden worden gescand, even wachten.", "Current scanning" => "Er wordt gescand", -"directory" => "directory", -"directories" => "directories", -"file" => "bestand", -"files" => "bestanden", "Upgrading filesystem cache..." => "Upgraden bestandssysteem cache..." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/nn_NO.php b/apps/files/l10n/nn_NO.php index abaaa5ffe8edb47c30c6b0ddc70ee45404bb9cb9..e29b1d3ad36b13ba2cea74bfed1dc71039db89b3 100644 --- a/apps/files/l10n/nn_NO.php +++ b/apps/files/l10n/nn_NO.php @@ -2,6 +2,8 @@ $TRANSLATIONS = array( "Could not move %s - File with this name already exists" => "Klarte ikkje flytta %s – det finst allereie ei fil med dette namnet", "Could not move %s" => "Klarte ikkje flytta %s", +"Unable to set upload directory." => "Klarte ikkje å endra opplastingsmappa.", +"Invalid Token" => "Ugyldig token", "No file was uploaded. Unknown error" => "Ingen filer lasta opp. Ukjend feil", "There is no error, the file uploaded with success" => "Ingen feil, fila vart lasta opp", "The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "Fila du lasta opp er større enn det «upload_max_filesize» i php.ini tillater: ", @@ -11,11 +13,14 @@ $TRANSLATIONS = array( "Missing a temporary folder" => "Manglar ei mellombels mappe", "Failed to write to disk" => "Klarte ikkje skriva til disk", "Not enough storage available" => "Ikkje nok lagringsplass tilgjengeleg", +"Upload failed. Could not get file info." => "Feil ved opplasting. Klarte ikkje å henta filinfo.", +"Upload failed. Could not find uploaded file" => "Feil ved opplasting. Klarte ikkje å finna opplasta fil.", "Invalid directory." => "Ugyldig mappe.", "Files" => "Filer", -"Unable to upload your file as it is a directory or has 0 bytes" => "Klarte ikkje lasta opp fila sidan ho er ei mappe eller er på 0 byte", +"Unable to upload {filename} as it is a directory or has 0 bytes" => "Klarte ikkje å lasta opp {filename} sidan det er ei mappe eller er 0 byte.", "Not enough space available" => "Ikkje nok lagringsplass tilgjengeleg", "Upload cancelled." => "Opplasting avbroten.", +"Could not get result from server." => "Klarte ikkje å henta resultat frå tenaren.", "File upload is in progress. Leaving the page now will cancel the upload." => "Fila lastar no opp. Viss du forlèt sida no vil opplastinga verta avbroten.", "URL cannot be empty." => "Nettadressa kan ikkje vera tom.", "Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Ugyldig mappenamn. Mappa «Shared» er reservert av ownCloud", @@ -30,19 +35,22 @@ $TRANSLATIONS = array( "cancel" => "avbryt", "replaced {new_name} with {old_name}" => "bytte ut {new_name} med {old_name}", "undo" => "angre", -"_Uploading %n file_::_Uploading %n files_" => array("",""), -"files uploading" => "filer lastar opp", +"_%n folder_::_%n folders_" => array("%n mappe","%n mapper"), +"_%n file_::_%n files_" => array("%n fil","%n filer"), +"{dirs} and {files}" => "{dirs} og {files}", +"_Uploading %n file_::_Uploading %n files_" => array("Lastar opp %n fil","Lastar opp %n filer"), "'.' is an invalid file name." => "«.» er eit ugyldig filnamn.", "File name cannot be empty." => "Filnamnet kan ikkje vera tomt.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ugyldig namn, «\\», «/», «<», «>», «:», «\"», «|», «?» og «*» er ikkje tillate.", "Your storage is full, files can not be updated or synced anymore!" => "Lagringa di er full, kan ikkje lenger oppdatera eller synkronisera!", "Your storage is almost full ({usedSpacePercent}%)" => "Lagringa di er nesten full ({usedSpacePercent} %)", +"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Kryptering er skrudd av, men filene dine er enno krypterte. Du kan dekryptera filene i personlege innstillingar.", "Your download is being prepared. This might take some time if the files are big." => "Gjer klar nedlastinga di. Dette kan ta ei stund viss filene er store.", +"Error moving file" => "Feil ved flytting av fil", "Name" => "Namn", "Size" => "Storleik", "Modified" => "Endra", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), +"%s could not be renamed" => "Klarte ikkje å omdøypa på %s", "Upload" => "Last opp", "File handling" => "Filhandtering", "Maximum upload size" => "Maksimal opplastingsstorleik", diff --git a/apps/files/l10n/nqo.php b/apps/files/l10n/nqo.php new file mode 100644 index 0000000000000000000000000000000000000000..70ab6572ba466c23b8066e18b9ee2f9cb2a7a827 --- /dev/null +++ b/apps/files/l10n/nqo.php @@ -0,0 +1,7 @@ + array(""), +"_%n file_::_%n files_" => array(""), +"_Uploading %n file_::_Uploading %n files_" => array("") +); +$PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/l10n/oc.php b/apps/files/l10n/oc.php index 552d72bef59cfa1ff15a2a6b7db4f711fae4827a..a6d8f91458edafc5a7bff0a9d9884f0da2ba03db 100644 --- a/apps/files/l10n/oc.php +++ b/apps/files/l10n/oc.php @@ -7,7 +7,6 @@ $TRANSLATIONS = array( "Missing a temporary folder" => "Un dorsièr temporari manca", "Failed to write to disk" => "L'escriptura sul disc a fracassat", "Files" => "Fichièrs", -"Unable to upload your file as it is a directory or has 0 bytes" => "Impossible d'amontcargar lo teu fichièr qu'es un repertòri o que ten pas que 0 octet.", "Upload cancelled." => "Amontcargar anullat.", "File upload is in progress. Leaving the page now will cancel the upload." => "Un amontcargar es a se far. Daissar aquesta pagina ara tamparà lo cargament. ", "Error" => "Error", @@ -18,13 +17,12 @@ $TRANSLATIONS = array( "suggest name" => "nom prepausat", "cancel" => "anulla", "undo" => "defar", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "_Uploading %n file_::_Uploading %n files_" => array("",""), -"files uploading" => "fichièrs al amontcargar", "Name" => "Nom", "Size" => "Talha", "Modified" => "Modificat", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), "Upload" => "Amontcarga", "File handling" => "Manejament de fichièr", "Maximum upload size" => "Talha maximum d'amontcargament", @@ -45,8 +43,6 @@ $TRANSLATIONS = array( "Upload too large" => "Amontcargament tròp gròs", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Los fichièrs que sias a amontcargar son tròp pesucs per la talha maxi pel servidor.", "Files are being scanned, please wait." => "Los fiichièrs son a èsser explorats, ", -"Current scanning" => "Exploracion en cors", -"file" => "fichièr", -"files" => "fichièrs" +"Current scanning" => "Exploracion en cors" ); $PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/apps/files/l10n/pa.php b/apps/files/l10n/pa.php new file mode 100644 index 0000000000000000000000000000000000000000..d8c50f2d1bc4765a7a49e11cd3260647d20845e6 --- /dev/null +++ b/apps/files/l10n/pa.php @@ -0,0 +1,16 @@ + "ਫਾਇਲਾਂ", +"Error" => "ਗਲਤੀ", +"Share" => "ਸਾਂਝਾ ਕਰੋ", +"Rename" => "ਨਾਂ ਬਦਲੋ", +"undo" => "ਵਾਪਸ", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), +"_Uploading %n file_::_Uploading %n files_" => array("",""), +"Upload" => "ਅੱਪਲੋਡ", +"Cancel upload" => "ਅੱਪਲੋਡ ਰੱਦ ਕਰੋ", +"Download" => "ਡਾਊਨਲੋਡ", +"Delete" => "ਹਟਾਓ" +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/pl.php b/apps/files/l10n/pl.php index d858248f29fe7f059f2e818fb1ea84b7c52be7e9..50a247d2e0f4acd85b1b58d7e8f7080cbe489b0e 100644 --- a/apps/files/l10n/pl.php +++ b/apps/files/l10n/pl.php @@ -13,11 +13,14 @@ $TRANSLATIONS = array( "Missing a temporary folder" => "Brak folderu tymczasowego", "Failed to write to disk" => "Błąd zapisu na dysk", "Not enough storage available" => "Za mało dostępnego miejsca", +"Upload failed. Could not get file info." => "Nieudane przesłanie. Nie można pobrać informacji o pliku.", +"Upload failed. Could not find uploaded file" => "Nieudane przesłanie. Nie można znaleźć przesyłanego pliku", "Invalid directory." => "Zła ścieżka.", "Files" => "Pliki", -"Unable to upload your file as it is a directory or has 0 bytes" => "Nie można wczytać pliku, ponieważ jest on katalogiem lub ma 0 bajtów", +"Unable to upload {filename} as it is a directory or has 0 bytes" => "Nie można przesłać {filename} być może jest katalogiem lub posiada 0 bajtów", "Not enough space available" => "Za mało miejsca", "Upload cancelled." => "Wczytywanie anulowane.", +"Could not get result from server." => "Nie można uzyskać wyniku z serwera.", "File upload is in progress. Leaving the page now will cancel the upload." => "Wysyłanie pliku jest w toku. Jeśli opuścisz tę stronę, wysyłanie zostanie przerwane.", "URL cannot be empty." => "URL nie może być pusty.", "Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Nieprawidłowa nazwa folderu. Wykorzystanie 'Shared' jest zarezerwowane przez ownCloud", @@ -32,19 +35,21 @@ $TRANSLATIONS = array( "cancel" => "anuluj", "replaced {new_name} with {old_name}" => "zastąpiono {new_name} przez {old_name}", "undo" => "cofnij", -"_Uploading %n file_::_Uploading %n files_" => array("","",""), -"files uploading" => "pliki wczytane", +"_%n folder_::_%n folders_" => array("%n katalog","%n katalogi","%n katalogów"), +"_%n file_::_%n files_" => array("%n plik","%n pliki","%n plików"), +"{dirs} and {files}" => "{katalogi} and {pliki}", +"_Uploading %n file_::_Uploading %n files_" => array("Wysyłanie %n pliku","Wysyłanie %n plików","Wysyłanie %n plików"), "'.' is an invalid file name." => "„.” jest nieprawidłową nazwą pliku.", "File name cannot be empty." => "Nazwa pliku nie może być pusta.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nieprawidłowa nazwa. Znaki '\\', '/', '<', '>', ':', '\"', '|', '?' oraz '*' są niedozwolone.", "Your storage is full, files can not be updated or synced anymore!" => "Magazyn jest pełny. Pliki nie mogą zostać zaktualizowane lub zsynchronizowane!", "Your storage is almost full ({usedSpacePercent}%)" => "Twój magazyn jest prawie pełny ({usedSpacePercent}%)", +"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Szyfrowanie zostało wyłączone, ale nadal pliki są zaszyfrowane. Przejdź do ustawień osobistych i tam odszyfruj pliki.", "Your download is being prepared. This might take some time if the files are big." => "Pobieranie jest przygotowywane. Może to zająć trochę czasu jeśli pliki są duże.", +"Error moving file" => "Błąd prz przenoszeniu pliku", "Name" => "Nazwa", "Size" => "Rozmiar", "Modified" => "Modyfikacja", -"_%n folder_::_%n folders_" => array("","",""), -"_%n file_::_%n files_" => array("","",""), "%s could not be renamed" => "%s nie można zmienić nazwy", "Upload" => "Wyślij", "File handling" => "Zarządzanie plikami", @@ -70,10 +75,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Pliki, które próbujesz przesłać, przekraczają maksymalną dopuszczalną wielkość.", "Files are being scanned, please wait." => "Skanowanie plików, proszę czekać.", "Current scanning" => "Aktualnie skanowane", -"directory" => "Katalog", -"directories" => "Katalogi", -"file" => "plik", -"files" => "pliki", "Upgrading filesystem cache..." => "Uaktualnianie plików pamięci podręcznej..." ); $PLURAL_FORMS = "nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/apps/files/l10n/pt_BR.php b/apps/files/l10n/pt_BR.php index b42b81d040ba10d4643a8840a02cd6bde2cc89f9..cd96020856511a053c2a387c616dd785c1f8c6f0 100644 --- a/apps/files/l10n/pt_BR.php +++ b/apps/files/l10n/pt_BR.php @@ -13,11 +13,14 @@ $TRANSLATIONS = array( "Missing a temporary folder" => "Pasta temporária não encontrada", "Failed to write to disk" => "Falha ao escrever no disco", "Not enough storage available" => "Espaço de armazenamento insuficiente", +"Upload failed. Could not get file info." => "Falha no envio. Não foi possível obter informações do arquivo.", +"Upload failed. Could not find uploaded file" => "Falha no envio. Não foi possível encontrar o arquivo enviado", "Invalid directory." => "Diretório inválido.", "Files" => "Arquivos", -"Unable to upload your file as it is a directory or has 0 bytes" => "Impossível enviar seus arquivo por ele ser um diretório ou ter 0 bytes.", +"Unable to upload {filename} as it is a directory or has 0 bytes" => "Incapaz de fazer o envio de {filename}, pois é um diretório ou tem 0 bytes", "Not enough space available" => "Espaço de armazenamento insuficiente", "Upload cancelled." => "Envio cancelado.", +"Could not get result from server." => "Não foi possível obter o resultado do servidor.", "File upload is in progress. Leaving the page now will cancel the upload." => "Upload em andamento. Sair da página agora resultará no cancelamento do envio.", "URL cannot be empty." => "URL não pode ficar em branco", "Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Nome de pasta inválido. O uso do nome 'Compartilhado' é reservado ao ownCloud", @@ -32,19 +35,21 @@ $TRANSLATIONS = array( "cancel" => "cancelar", "replaced {new_name} with {old_name}" => "Substituído {old_name} por {new_name} ", "undo" => "desfazer", -"_Uploading %n file_::_Uploading %n files_" => array("",""), -"files uploading" => "enviando arquivos", +"_%n folder_::_%n folders_" => array("%n pasta","%n pastas"), +"_%n file_::_%n files_" => array("%n arquivo","%n arquivos"), +"{dirs} and {files}" => "{dirs} e {files}", +"_Uploading %n file_::_Uploading %n files_" => array("Enviando %n arquivo","Enviando %n arquivos"), "'.' is an invalid file name." => "'.' é um nome de arquivo inválido.", "File name cannot be empty." => "O nome do arquivo não pode estar vazio.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nome inválido, '\\', '/', '<', '>', ':', '\"', '|', '?' e '*' não são permitidos.", "Your storage is full, files can not be updated or synced anymore!" => "Seu armazenamento está cheio, arquivos não podem mais ser atualizados ou sincronizados!", "Your storage is almost full ({usedSpacePercent}%)" => "Seu armazenamento está quase cheio ({usedSpacePercent}%)", +"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Encriptação foi desabilitada mas seus arquivos continuam encriptados. Por favor vá a suas configurações pessoais para descriptar seus arquivos.", "Your download is being prepared. This might take some time if the files are big." => "Seu download está sendo preparado. Isto pode levar algum tempo se os arquivos forem grandes.", +"Error moving file" => "Erro movendo o arquivo", "Name" => "Nome", "Size" => "Tamanho", "Modified" => "Modificado", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), "%s could not be renamed" => "%s não pode ser renomeado", "Upload" => "Upload", "File handling" => "Tratamento de Arquivo", @@ -70,10 +75,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Os arquivos que você está tentando carregar excedeu o tamanho máximo para arquivos no servidor.", "Files are being scanned, please wait." => "Arquivos sendo escaneados, por favor aguarde.", "Current scanning" => "Scanning atual", -"directory" => "diretório", -"directories" => "diretórios", -"file" => "arquivo", -"files" => "arquivos", "Upgrading filesystem cache..." => "Atualizando cache do sistema de arquivos..." ); $PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/apps/files/l10n/pt_PT.php b/apps/files/l10n/pt_PT.php index 50a33de6db3d7930d4770c1ce0355ef2bbda7a6c..f6d61fc9873e6d1d497587147f1f21643c11bd0e 100644 --- a/apps/files/l10n/pt_PT.php +++ b/apps/files/l10n/pt_PT.php @@ -15,7 +15,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "Não há espaço suficiente em disco", "Invalid directory." => "Directório Inválido", "Files" => "Ficheiros", -"Unable to upload your file as it is a directory or has 0 bytes" => "Não é possível fazer o envio do ficheiro devido a ser uma pasta ou ter 0 bytes", "Not enough space available" => "Espaço em disco insuficiente!", "Upload cancelled." => "Envio cancelado.", "File upload is in progress. Leaving the page now will cancel the upload." => "Envio de ficheiro em progresso. Irá cancelar o envio se sair da página agora.", @@ -32,19 +31,20 @@ $TRANSLATIONS = array( "cancel" => "cancelar", "replaced {new_name} with {old_name}" => "substituido {new_name} por {old_name}", "undo" => "desfazer", -"_Uploading %n file_::_Uploading %n files_" => array("",""), -"files uploading" => "A enviar os ficheiros", +"_%n folder_::_%n folders_" => array("%n pasta","%n pastas"), +"_%n file_::_%n files_" => array("%n ficheiro","%n ficheiros"), +"{dirs} and {files}" => "{dirs} e {files}", +"_Uploading %n file_::_Uploading %n files_" => array("A carregar %n ficheiro","A carregar %n ficheiros"), "'.' is an invalid file name." => "'.' não é um nome de ficheiro válido!", "File name cannot be empty." => "O nome do ficheiro não pode estar vazio.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nome Inválido, os caracteres '\\', '/', '<', '>', ':', '\"', '|', '?' e '*' não são permitidos.", "Your storage is full, files can not be updated or synced anymore!" => "O seu armazenamento está cheio, os ficheiros não podem ser sincronizados.", "Your storage is almost full ({usedSpacePercent}%)" => "O seu espaço de armazenamento está quase cheiro ({usedSpacePercent}%)", +"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "A encriptação foi desactivada mas os seus ficheiros continuam encriptados. Por favor consulte as suas definições pessoais para desencriptar os ficheiros.", "Your download is being prepared. This might take some time if the files are big." => "O seu download está a ser preparado. Este processo pode demorar algum tempo se os ficheiros forem grandes.", "Name" => "Nome", "Size" => "Tamanho", "Modified" => "Modificado", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), "%s could not be renamed" => "%s não pode ser renomeada", "Upload" => "Carregar", "File handling" => "Manuseamento de ficheiros", @@ -70,10 +70,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Os ficheiro que está a tentar enviar excedem o tamanho máximo de envio neste servidor.", "Files are being scanned, please wait." => "Os ficheiros estão a ser analisados, por favor aguarde.", "Current scanning" => "Análise actual", -"directory" => "diretório", -"directories" => "diretórios", -"file" => "ficheiro", -"files" => "ficheiros", "Upgrading filesystem cache..." => "Atualizar cache do sistema de ficheiros..." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/ro.php b/apps/files/l10n/ro.php index 7c78c6f0767ad7742dfe85c101543d3d6cceaf65..b1b9af45d38e2ae62f849c23009c4c6cc94e02f6 100644 --- a/apps/files/l10n/ro.php +++ b/apps/files/l10n/ro.php @@ -6,74 +6,75 @@ $TRANSLATIONS = array( "Invalid Token" => "Jeton Invalid", "No file was uploaded. Unknown error" => "Nici un fișier nu a fost încărcat. Eroare necunoscută", "There is no error, the file uploaded with success" => "Nu a apărut nici o eroare, fișierul a fost încărcat cu succes", -"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "Fisierul incarcat depaseste upload_max_filesize permisi in php.ini: ", +"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "Fisierul incarcat depaseste marimea maxima permisa in php.ini: ", "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Fișierul are o dimensiune mai mare decât variabile MAX_FILE_SIZE specificată în formularul HTML", "The uploaded file was only partially uploaded" => "Fișierul a fost încărcat doar parțial", "No file was uploaded" => "Nu a fost încărcat nici un fișier", -"Missing a temporary folder" => "Lipsește un director temporar", -"Failed to write to disk" => "Eroare la scriere pe disc", +"Missing a temporary folder" => "Lipsește un dosar temporar", +"Failed to write to disk" => "Eroare la scrierea discului", "Not enough storage available" => "Nu este suficient spațiu disponibil", -"Invalid directory." => "Director invalid.", +"Upload failed. Could not get file info." => "Încărcare eșuată. Nu se pot obține informații despre fișier.", +"Upload failed. Could not find uploaded file" => "Încărcare eșuată. Nu se poate găsi fișierul încărcat", +"Invalid directory." => "registru invalid.", "Files" => "Fișiere", -"Unable to upload your file as it is a directory or has 0 bytes" => "Nu s-a putut încărca fișierul tău deoarece pare să fie un director sau are 0 bytes.", +"Unable to upload {filename} as it is a directory or has 0 bytes" => "Nu se poate încărca {filename} deoarece este un director sau are mărimea de 0 octeți", "Not enough space available" => "Nu este suficient spațiu disponibil", "Upload cancelled." => "Încărcare anulată.", +"Could not get result from server." => "Nu se poate obține rezultatul de la server.", "File upload is in progress. Leaving the page now will cancel the upload." => "Fișierul este în curs de încărcare. Părăsirea paginii va întrerupe încărcarea.", -"URL cannot be empty." => "Adresa URL nu poate fi goală.", +"URL cannot be empty." => "Adresa URL nu poate fi golita", "Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Nume de dosar invalid. Utilizarea 'Shared' e rezervată de ownCloud", "Error" => "Eroare", -"Share" => "Partajează", +"Share" => "a imparti", "Delete permanently" => "Stergere permanenta", "Rename" => "Redenumire", -"Pending" => "În așteptare", +"Pending" => "in timpul", "{new_name} already exists" => "{new_name} deja exista", "replace" => "înlocuire", "suggest name" => "sugerează nume", "cancel" => "anulare", "replaced {new_name} with {old_name}" => "{new_name} inlocuit cu {old_name}", "undo" => "Anulează ultima acțiune", -"_Uploading %n file_::_Uploading %n files_" => array("","",""), -"files uploading" => "fișiere se încarcă", +"_%n folder_::_%n folders_" => array("%n director","%n directoare","%n directoare"), +"_%n file_::_%n files_" => array("%n fișier","%n fișiere","%n fișiere"), +"{dirs} and {files}" => "{dirs} și {files}", +"_Uploading %n file_::_Uploading %n files_" => array("Se încarcă %n fișier.","Se încarcă %n fișiere.","Se încarcă %n fișiere."), "'.' is an invalid file name." => "'.' este un nume invalid de fișier.", "File name cannot be empty." => "Numele fișierului nu poate rămâne gol.", -"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nume invalid, '\\', '/', '<', '>', ':', '\"', '|', '?' si '*' nu sunt permise.", -"Your storage is full, files can not be updated or synced anymore!" => "Spatiul de stocare este plin, nu mai puteti incarca s-au sincroniza alte fisiere.", -"Your storage is almost full ({usedSpacePercent}%)" => "Spatiul de stocare este aproape plin ({usedSpacePercent}%)", -"Your download is being prepared. This might take some time if the files are big." => "Se pregătește descărcarea. Aceasta poate să dureze ceva timp dacă fișierele sunt mari.", +"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nume invalide, '\\', '/', '<', '>', ':', '\"', '|', '?' si '*' nu sunt permise.", +"Your storage is full, files can not be updated or synced anymore!" => "Spatiul de stocare este plin, fisierele nu mai pot fi actualizate sau sincronizate", +"Your storage is almost full ({usedSpacePercent}%)" => "Spatiul de stocare este aproape plin {spatiu folosit}%", +"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "criptarea a fost disactivata dar fisierele sant inca criptate.va rog intrati in setarile personale pentru a decripta fisierele", +"Your download is being prepared. This might take some time if the files are big." => "in curs de descarcare. Aceasta poate să dureze ceva timp dacă fișierele sunt mari.", +"Error moving file" => "Eroare la mutarea fișierului", "Name" => "Nume", "Size" => "Dimensiune", "Modified" => "Modificat", -"_%n folder_::_%n folders_" => array("","",""), -"_%n file_::_%n files_" => array("","",""), "%s could not be renamed" => "%s nu a putut fi redenumit", "Upload" => "Încărcare", "File handling" => "Manipulare fișiere", "Maximum upload size" => "Dimensiune maximă admisă la încărcare", "max. possible: " => "max. posibil:", -"Needed for multi-file and folder downloads." => "Necesar pentru descărcarea mai multor fișiere și a dosarelor", -"Enable ZIP-download" => "Activează descărcare fișiere compresate", +"Needed for multi-file and folder downloads." => "necesar la descarcarea mai multor liste si fisiere", +"Enable ZIP-download" => "permite descarcarea codurilor ZIP", "0 is unlimited" => "0 e nelimitat", "Maximum input size for ZIP files" => "Dimensiunea maximă de intrare pentru fișiere compresate", "Save" => "Salvează", "New" => "Nou", -"Text file" => "Fișier text", +"Text file" => "lista", "Folder" => "Dosar", "From link" => "de la adresa", "Deleted files" => "Sterge fisierele", "Cancel upload" => "Anulează încărcarea", -"You don’t have write permissions here." => "Nu ai permisiunea de a sterge fisiere aici.", +"You don’t have write permissions here." => "Nu ai permisiunea de a scrie aici.", "Nothing in here. Upload something!" => "Nimic aici. Încarcă ceva!", "Download" => "Descarcă", -"Unshare" => "Anulare partajare", +"Unshare" => "Anulare", "Delete" => "Șterge", "Upload too large" => "Fișierul încărcat este prea mare", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Fișierul care l-ai încărcat a depășită limita maximă admisă la încărcare pe acest server.", -"Files are being scanned, please wait." => "Fișierele sunt scanate, te rog așteptă.", +"Files are being scanned, please wait." => "Fișierele sunt scanate, asteptati va rog", "Current scanning" => "În curs de scanare", -"directory" => "catalog", -"directories" => "cataloage", -"file" => "fișier", -"files" => "fișiere", "Upgrading filesystem cache..." => "Modernizare fisiere de sistem cache.." ); $PLURAL_FORMS = "nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));"; diff --git a/apps/files/l10n/ru.php b/apps/files/l10n/ru.php index 782817be0ae73ec5fabaef226eb12a983bdd340d..143a3379ad4e4e2c3fc4b07d8dd7c1b19f58c9c3 100644 --- a/apps/files/l10n/ru.php +++ b/apps/files/l10n/ru.php @@ -13,11 +13,14 @@ $TRANSLATIONS = array( "Missing a temporary folder" => "Отсутствует временная папка", "Failed to write to disk" => "Ошибка записи на диск", "Not enough storage available" => "Недостаточно доступного места в хранилище", +"Upload failed. Could not get file info." => "Загрузка не удалась. Невозможно получить информацию о файле", +"Upload failed. Could not find uploaded file" => "Загрузка не удалась. Невозможно найти загруженный файл", "Invalid directory." => "Неправильный каталог.", "Files" => "Файлы", -"Unable to upload your file as it is a directory or has 0 bytes" => "Файл не был загружен: его размер 0 байт либо это не файл, а директория.", +"Unable to upload {filename} as it is a directory or has 0 bytes" => "Невозможно загрузить файл {filename} так как он является директорией либо имеет размер 0 байт", "Not enough space available" => "Недостаточно свободного места", "Upload cancelled." => "Загрузка отменена.", +"Could not get result from server." => "Не получен ответ от сервера", "File upload is in progress. Leaving the page now will cancel the upload." => "Файл в процессе загрузки. Покинув страницу вы прервёте загрузку.", "URL cannot be empty." => "Ссылка не может быть пустой.", "Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Неправильное имя каталога. Имя 'Shared' зарезервировано.", @@ -32,19 +35,21 @@ $TRANSLATIONS = array( "cancel" => "отмена", "replaced {new_name} with {old_name}" => "заменено {new_name} на {old_name}", "undo" => "отмена", +"_%n folder_::_%n folders_" => array("%n папка","%n папки","%n папок"), +"_%n file_::_%n files_" => array("%n файл","%n файла","%n файлов"), +"{dirs} and {files}" => "{dirs} и {files}", "_Uploading %n file_::_Uploading %n files_" => array("Закачка %n файла","Закачка %n файлов","Закачка %n файлов"), -"files uploading" => "файлы загружаются", "'.' is an invalid file name." => "'.' - неправильное имя файла.", "File name cannot be empty." => "Имя файла не может быть пустым.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Неправильное имя, '\\', '/', '<', '>', ':', '\"', '|', '?' и '*' недопустимы.", "Your storage is full, files can not be updated or synced anymore!" => "Ваше дисковое пространство полностью заполнено, произведите очистку перед загрузкой новых файлов.", "Your storage is almost full ({usedSpacePercent}%)" => "Ваше хранилище почти заполнено ({usedSpacePercent}%)", +"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Шифрование было отключено, но ваши файлы все еще зашифрованы. Пожалуйста, зайдите на страницу персональных настроек для того, чтобы расшифровать ваши файлы.", "Your download is being prepared. This might take some time if the files are big." => "Загрузка началась. Это может потребовать много времени, если файл большого размера.", +"Error moving file" => "Ошибка при перемещении файла", "Name" => "Имя", "Size" => "Размер", "Modified" => "Изменён", -"_%n folder_::_%n folders_" => array("%n папка","%n папки","%n папок"), -"_%n file_::_%n files_" => array("%n файл","%n файла","%n файлов"), "%s could not be renamed" => "%s не может быть переименован", "Upload" => "Загрузка", "File handling" => "Управление файлами", @@ -70,10 +75,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Файлы, которые вы пытаетесь загрузить, превышают лимит для файлов на этом сервере.", "Files are being scanned, please wait." => "Подождите, файлы сканируются.", "Current scanning" => "Текущее сканирование", -"directory" => "директория", -"directories" => "директории", -"file" => "файл", -"files" => "файлы", "Upgrading filesystem cache..." => "Обновление кэша файловой системы..." ); $PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/apps/files/l10n/si_LK.php b/apps/files/l10n/si_LK.php index ffb28e09584aa2b0e5d1094c1ff8e07aec9c9d0b..7d24370a092f06e8f1c22f18e007028c4a5de089 100644 --- a/apps/files/l10n/si_LK.php +++ b/apps/files/l10n/si_LK.php @@ -18,12 +18,12 @@ $TRANSLATIONS = array( "suggest name" => "නමක් යෝජනා කරන්න", "cancel" => "අත් හරින්න", "undo" => "නිෂ්ප්‍රභ කරන්න", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "_Uploading %n file_::_Uploading %n files_" => array("",""), "Name" => "නම", "Size" => "ප්‍රමාණය", "Modified" => "වෙනස් කළ", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), "Upload" => "උඩුගත කරන්න", "File handling" => "ගොනු පරිහරණය", "Maximum upload size" => "උඩුගත කිරීමක උපරිම ප්‍රමාණය", @@ -45,8 +45,6 @@ $TRANSLATIONS = array( "Upload too large" => "උඩුගත කිරීම විශාල වැඩිය", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "ඔබ උඩුගත කිරීමට තැත් කරන ගොනු මෙම සේවාදායකයා උඩුගත කිරීමට ඉඩදී ඇති උපරිම ගොනු විශාලත්වයට වඩා වැඩිය", "Files are being scanned, please wait." => "ගොනු පරික්ෂා කෙරේ. මඳක් රැඳී සිටින්න", -"Current scanning" => "වර්තමාන පරික්ෂාව", -"file" => "ගොනුව", -"files" => "ගොනු" +"Current scanning" => "වර්තමාන පරික්ෂාව" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/sk.php b/apps/files/l10n/sk.php new file mode 100644 index 0000000000000000000000000000000000000000..a3178a95c47c1b1f0afb722e2cda03d5ee75bd17 --- /dev/null +++ b/apps/files/l10n/sk.php @@ -0,0 +1,7 @@ + array("","",""), +"_%n file_::_%n files_" => array("","",""), +"_Uploading %n file_::_Uploading %n files_" => array("","","") +); +$PLURAL_FORMS = "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"; diff --git a/apps/files/l10n/sk_SK.php b/apps/files/l10n/sk_SK.php index 9c84579448560a9f9cf17d24a2d13d9d53341a0a..962ce7d7e9b08e872254153ecdd890def27ffa9c 100644 --- a/apps/files/l10n/sk_SK.php +++ b/apps/files/l10n/sk_SK.php @@ -15,7 +15,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "Nedostatok dostupného úložného priestoru", "Invalid directory." => "Neplatný priečinok.", "Files" => "Súbory", -"Unable to upload your file as it is a directory or has 0 bytes" => "Nedá sa odoslať Váš súbor, pretože je to priečinok, alebo je jeho veľkosť 0 bajtov", "Not enough space available" => "Nie je k dispozícii dostatok miesta", "Upload cancelled." => "Odosielanie zrušené.", "File upload is in progress. Leaving the page now will cancel the upload." => "Opustenie stránky zruší práve prebiehajúce odosielanie súboru.", @@ -32,8 +31,9 @@ $TRANSLATIONS = array( "cancel" => "zrušiť", "replaced {new_name} with {old_name}" => "prepísaný {new_name} súborom {old_name}", "undo" => "vrátiť", +"_%n folder_::_%n folders_" => array("%n priečinok","%n priečinky","%n priečinkov"), +"_%n file_::_%n files_" => array("%n súbor","%n súbory","%n súborov"), "_Uploading %n file_::_Uploading %n files_" => array("Nahrávam %n súbor","Nahrávam %n súbory","Nahrávam %n súborov"), -"files uploading" => "nahrávanie súborov", "'.' is an invalid file name." => "'.' je neplatné meno súboru.", "File name cannot be empty." => "Meno súboru nemôže byť prázdne", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nesprávne meno, '\\', '/', '<', '>', ':', '\"', '|', '?' a '*' nie sú povolené hodnoty.", @@ -44,8 +44,6 @@ $TRANSLATIONS = array( "Name" => "Názov", "Size" => "Veľkosť", "Modified" => "Upravené", -"_%n folder_::_%n folders_" => array("%n priečinok","%n priečinky","%n priečinkov"), -"_%n file_::_%n files_" => array("%n súbor","%n súbory","%n súborov"), "%s could not be renamed" => "%s nemohol byť premenovaný", "Upload" => "Odoslať", "File handling" => "Nastavenie správania sa k súborom", @@ -71,10 +69,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Súbory, ktoré sa snažíte nahrať, presahujú maximálnu veľkosť pre nahratie súborov na tento server.", "Files are being scanned, please wait." => "Čakajte, súbory sú prehľadávané.", "Current scanning" => "Práve prezerané", -"directory" => "priečinok", -"directories" => "priečinky", -"file" => "súbor", -"files" => "súbory", "Upgrading filesystem cache..." => "Aktualizujem medzipamäť súborového systému..." ); $PLURAL_FORMS = "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"; diff --git a/apps/files/l10n/sl.php b/apps/files/l10n/sl.php index 79296c804923cc302d8c480f3639b936a263a7f4..7190753eac9610b62dd78660de326eff75053e98 100644 --- a/apps/files/l10n/sl.php +++ b/apps/files/l10n/sl.php @@ -15,7 +15,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "Na voljo ni dovolj prostora", "Invalid directory." => "Neveljavna mapa.", "Files" => "Datoteke", -"Unable to upload your file as it is a directory or has 0 bytes" => "Pošiljanja ni mogoče izvesti, saj gre za mapo oziroma datoteko velikosti 0 bajtov.", "Not enough space available" => "Na voljo ni dovolj prostora.", "Upload cancelled." => "Pošiljanje je preklicano.", "File upload is in progress. Leaving the page now will cancel the upload." => "V teku je pošiljanje datoteke. Če zapustite to stran zdaj, bo pošiljanje preklicano.", @@ -32,8 +31,9 @@ $TRANSLATIONS = array( "cancel" => "prekliči", "replaced {new_name} with {old_name}" => "preimenovano ime {new_name} z imenom {old_name}", "undo" => "razveljavi", +"_%n folder_::_%n folders_" => array("","","",""), +"_%n file_::_%n files_" => array("","","",""), "_Uploading %n file_::_Uploading %n files_" => array("","","",""), -"files uploading" => "poteka pošiljanje datotek", "'.' is an invalid file name." => "'.' je neveljavno ime datoteke.", "File name cannot be empty." => "Ime datoteke ne sme biti prazno polje.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Neveljavno ime, znaki '\\', '/', '<', '>', ':', '\"', '|', '?' in '*' niso dovoljeni.", @@ -43,8 +43,6 @@ $TRANSLATIONS = array( "Name" => "Ime", "Size" => "Velikost", "Modified" => "Spremenjeno", -"_%n folder_::_%n folders_" => array("","","",""), -"_%n file_::_%n files_" => array("","","",""), "%s could not be renamed" => "%s ni bilo mogoče preimenovati", "Upload" => "Pošlji", "File handling" => "Upravljanje z datotekami", @@ -70,10 +68,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Datoteke, ki jih želite poslati, presegajo največjo dovoljeno velikost na strežniku.", "Files are being scanned, please wait." => "Poteka preučevanje datotek, počakajte ...", "Current scanning" => "Trenutno poteka preučevanje", -"directory" => "direktorij", -"directories" => "direktoriji", -"file" => "datoteka", -"files" => "datoteke", "Upgrading filesystem cache..." => "Nadgrajevanje predpomnilnika datotečnega sistema ..." ); $PLURAL_FORMS = "nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);"; diff --git a/apps/files/l10n/sq.php b/apps/files/l10n/sq.php index 838bcc5ef23dfebd63a183271b710e95e3401aef..ecc066a284c9a5f526151a2b00ff2d1ea8349d4b 100644 --- a/apps/files/l10n/sq.php +++ b/apps/files/l10n/sq.php @@ -2,6 +2,8 @@ $TRANSLATIONS = array( "Could not move %s - File with this name already exists" => "%s nuk u spostua - Aty ekziston një skedar me të njëjtin emër", "Could not move %s" => "%s nuk u spostua", +"Unable to set upload directory." => "Nuk është i mundur caktimi i dosjes së ngarkimit.", +"Invalid Token" => "Përmbajtje e pavlefshme", "No file was uploaded. Unknown error" => "Nuk u ngarkua asnjë skedar. Veprim i gabuar i panjohur", "There is no error, the file uploaded with success" => "Nuk pati veprime të gabuara, skedari u ngarkua me sukses", "The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "Skedari i ngarkuar tejkalon udhëzimin upload_max_filesize tek php.ini:", @@ -13,11 +15,11 @@ $TRANSLATIONS = array( "Not enough storage available" => "Nuk ka mbetur hapësirë memorizimi e mjaftueshme", "Invalid directory." => "Dosje e pavlefshme.", "Files" => "Skedarët", -"Unable to upload your file as it is a directory or has 0 bytes" => "Nuk është i mundur ngarkimi i skedarit tuaj sepse është dosje ose ka dimension 0 byte", "Not enough space available" => "Nuk ka hapësirë memorizimi e mjaftueshme", "Upload cancelled." => "Ngarkimi u anulua.", "File upload is in progress. Leaving the page now will cancel the upload." => "Ngarkimi i skedarit është në vazhdim. Nqse ndërroni faqen tani ngarkimi do të anulohet.", "URL cannot be empty." => "URL-i nuk mund të jetë bosh.", +"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Emri i dosjes është i pavlefshëm. Përdorimi i \"Shared\" është i rezervuar nga Owncloud-i", "Error" => "Veprim i gabuar", "Share" => "Nda", "Delete permanently" => "Elimino përfundimisht", @@ -29,19 +31,21 @@ $TRANSLATIONS = array( "cancel" => "anulo", "replaced {new_name} with {old_name}" => "U zëvëndësua {new_name} me {old_name}", "undo" => "anulo", -"_Uploading %n file_::_Uploading %n files_" => array("",""), -"files uploading" => "po ngarkoj skedarët", +"_%n folder_::_%n folders_" => array("%n dosje","%n dosje"), +"_%n file_::_%n files_" => array("%n skedar","%n skedarë"), +"{dirs} and {files}" => "{dirs} dhe {files}", +"_Uploading %n file_::_Uploading %n files_" => array("Po ngarkoj %n skedar","Po ngarkoj %n skedarë"), "'.' is an invalid file name." => "'.' është emër i pavlefshëm.", "File name cannot be empty." => "Emri i skedarit nuk mund të jetë bosh.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Emër i pavlefshëm, '\\', '/', '<', '>', ':', '\"', '|', '?' dhe '*' nuk lejohen.", "Your storage is full, files can not be updated or synced anymore!" => "Hapësira juaj e memorizimit është plot, nuk mund të ngarkoni apo sinkronizoni më skedarët.", "Your storage is almost full ({usedSpacePercent}%)" => "Hapësira juaj e memorizimit është gati plot ({usedSpacePercent}%)", +"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Kodifikimi u çaktivizua por skedarët tuaj vazhdojnë të jenë të kodifikuar. Ju lutem shkoni tek parametrat personale për të dekodifikuar skedarët tuaj.", "Your download is being prepared. This might take some time if the files are big." => "Shkarkimi juaj po përgatitet. Mund të duhet pak kohë nqse skedarët janë të mëdhenj.", "Name" => "Emri", "Size" => "Dimensioni", "Modified" => "Modifikuar", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), +"%s could not be renamed" => "Nuk është i mundur riemërtimi i %s", "Upload" => "Ngarko", "File handling" => "Trajtimi i skedarit", "Maximum upload size" => "Dimensioni maksimal i ngarkimit", diff --git a/apps/files/l10n/sr.php b/apps/files/l10n/sr.php index d4dcbd14ee5fbcb8d950bb795e30077168df431a..fd3b2a2912f8fa474b4a8cfbd32de7d6c7d8a4d0 100644 --- a/apps/files/l10n/sr.php +++ b/apps/files/l10n/sr.php @@ -13,7 +13,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "Нема довољно простора", "Invalid directory." => "неисправна фасцикла.", "Files" => "Датотеке", -"Unable to upload your file as it is a directory or has 0 bytes" => "Не могу да отпремим датотеку као фасциклу или она има 0 бајтова", "Not enough space available" => "Нема довољно простора", "Upload cancelled." => "Отпремање је прекинуто.", "File upload is in progress. Leaving the page now will cancel the upload." => "Отпремање датотеке је у току. Ако сада напустите страницу, прекинућете отпремање.", @@ -29,8 +28,9 @@ $TRANSLATIONS = array( "cancel" => "откажи", "replaced {new_name} with {old_name}" => "замењено {new_name} са {old_name}", "undo" => "опозови", +"_%n folder_::_%n folders_" => array("","",""), +"_%n file_::_%n files_" => array("","",""), "_Uploading %n file_::_Uploading %n files_" => array("","",""), -"files uploading" => "датотеке се отпремају", "'.' is an invalid file name." => "Датотека „.“ је неисправног имена.", "File name cannot be empty." => "Име датотеке не може бити празно.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Неисправан назив. Следећи знакови нису дозвољени: \\, /, <, >, :, \", |, ? и *.", @@ -40,8 +40,6 @@ $TRANSLATIONS = array( "Name" => "Име", "Size" => "Величина", "Modified" => "Измењено", -"_%n folder_::_%n folders_" => array("","",""), -"_%n file_::_%n files_" => array("","",""), "Upload" => "Отпреми", "File handling" => "Управљање датотекама", "Maximum upload size" => "Највећа величина датотеке", diff --git a/apps/files/l10n/sr@latin.php b/apps/files/l10n/sr@latin.php index bc7b11b8c53f44f3144ea22de969e5ecc60060f1..8831d1a1bef0ee736f95b15be17888f0f28ed215 100644 --- a/apps/files/l10n/sr@latin.php +++ b/apps/files/l10n/sr@latin.php @@ -6,17 +6,20 @@ $TRANSLATIONS = array( "No file was uploaded" => "Nijedan fajl nije poslat", "Missing a temporary folder" => "Nedostaje privremena fascikla", "Files" => "Fajlovi", +"Error" => "Greška", +"Share" => "Podeli", +"_%n folder_::_%n folders_" => array("","",""), +"_%n file_::_%n files_" => array("","",""), "_Uploading %n file_::_Uploading %n files_" => array("","",""), "Name" => "Ime", "Size" => "Veličina", "Modified" => "Zadnja izmena", -"_%n folder_::_%n folders_" => array("","",""), -"_%n file_::_%n files_" => array("","",""), "Upload" => "Pošalji", "Maximum upload size" => "Maksimalna veličina pošiljke", "Save" => "Snimi", "Nothing in here. Upload something!" => "Ovde nema ničeg. Pošaljite nešto!", "Download" => "Preuzmi", +"Unshare" => "Ukljoni deljenje", "Delete" => "Obriši", "Upload too large" => "Pošiljka je prevelika", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Fajlovi koje želite da pošaljete prevazilaze ograničenje maksimalne veličine pošiljke na ovom serveru." diff --git a/apps/files/l10n/sv.php b/apps/files/l10n/sv.php index 0f72443a5f95be11a70a5261f62decf47ed133b7..208dcd4ea12d83ddd617cf390e88874e77396c76 100644 --- a/apps/files/l10n/sv.php +++ b/apps/files/l10n/sv.php @@ -15,7 +15,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "Inte tillräckligt med lagringsutrymme tillgängligt", "Invalid directory." => "Felaktig mapp.", "Files" => "Filer", -"Unable to upload your file as it is a directory or has 0 bytes" => "Kan inte ladda upp din fil eftersom det är en katalog eller har 0 bytes", "Not enough space available" => "Inte tillräckligt med utrymme tillgängligt", "Upload cancelled." => "Uppladdning avbruten.", "File upload is in progress. Leaving the page now will cancel the upload." => "Filuppladdning pågår. Lämnar du sidan så avbryts uppladdningen.", @@ -32,8 +31,10 @@ $TRANSLATIONS = array( "cancel" => "avbryt", "replaced {new_name} with {old_name}" => "ersatt {new_name} med {old_name}", "undo" => "ångra", +"_%n folder_::_%n folders_" => array("%n mapp","%n mappar"), +"_%n file_::_%n files_" => array("%n fil","%n filer"), +"{dirs} and {files}" => "{dirs} och {files}", "_Uploading %n file_::_Uploading %n files_" => array("Laddar upp %n fil","Laddar upp %n filer"), -"files uploading" => "filer laddas upp", "'.' is an invalid file name." => "'.' är ett ogiltigt filnamn.", "File name cannot be empty." => "Filnamn kan inte vara tomt.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ogiltigt namn, '\\', '/', '<', '>', ':', '\"', '|', '?' och '*' är inte tillåtet.", @@ -44,8 +45,6 @@ $TRANSLATIONS = array( "Name" => "Namn", "Size" => "Storlek", "Modified" => "Ändrad", -"_%n folder_::_%n folders_" => array("%n mapp","%n mappar"), -"_%n file_::_%n files_" => array("%n fil","%n filer"), "%s could not be renamed" => "%s kunde inte namnändras", "Upload" => "Ladda upp", "File handling" => "Filhantering", @@ -71,10 +70,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Filerna du försöker ladda upp överstiger den maximala storleken för filöverföringar på servern.", "Files are being scanned, please wait." => "Filer skannas, var god vänta", "Current scanning" => "Aktuell skanning", -"directory" => "mapp", -"directories" => "mappar", -"file" => "fil", -"files" => "filer", "Upgrading filesystem cache..." => "Uppgraderar filsystemets cache..." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/sw_KE.php b/apps/files/l10n/sw_KE.php new file mode 100644 index 0000000000000000000000000000000000000000..0157af093e92200cc7790497227e92e62d80165f --- /dev/null +++ b/apps/files/l10n/sw_KE.php @@ -0,0 +1,7 @@ + array("",""), +"_%n file_::_%n files_" => array("",""), +"_Uploading %n file_::_Uploading %n files_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/ta_LK.php b/apps/files/l10n/ta_LK.php index eb39218e48d85e34a15e14e4dfef9716a637607b..f05990b94f00f39152dcbbafd57e0f1d9c9bb59d 100644 --- a/apps/files/l10n/ta_LK.php +++ b/apps/files/l10n/ta_LK.php @@ -8,7 +8,6 @@ $TRANSLATIONS = array( "Missing a temporary folder" => "ஒரு தற்காலிகமான கோப்புறையை காணவில்லை", "Failed to write to disk" => "வட்டில் எழுத முடியவில்லை", "Files" => "கோப்புகள்", -"Unable to upload your file as it is a directory or has 0 bytes" => "அடைவு அல்லது 0 bytes ஐ கொண்டுள்ளதால் உங்களுடைய கோப்பை பதிவேற்ற முடியவில்லை", "Upload cancelled." => "பதிவேற்றல் இரத்து செய்யப்பட்டுள்ளது", "File upload is in progress. Leaving the page now will cancel the upload." => "கோப்பு பதிவேற்றம் செயல்பாட்டில் உள்ளது. இந்தப் பக்கத்திலிருந்து வெறியேறுவதானது பதிவேற்றலை இரத்து செய்யும்.", "URL cannot be empty." => "URL வெறுமையாக இருக்கமுடியாது.", @@ -22,13 +21,13 @@ $TRANSLATIONS = array( "cancel" => "இரத்து செய்க", "replaced {new_name} with {old_name}" => "{new_name} ஆனது {old_name} இனால் மாற்றப்பட்டது", "undo" => "முன் செயல் நீக்கம் ", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "_Uploading %n file_::_Uploading %n files_" => array("",""), "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "செல்லுபடியற்ற பெயர்,'\\', '/', '<', '>', ':', '\"', '|', '?' மற்றும் '*' ஆகியன அனுமதிக்கப்படமாட்டாது.", "Name" => "பெயர்", "Size" => "அளவு", "Modified" => "மாற்றப்பட்டது", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), "Upload" => "பதிவேற்றுக", "File handling" => "கோப்பு கையாளுதல்", "Maximum upload size" => "பதிவேற்றக்கூடிய ஆகக்கூடிய அளவு ", diff --git a/apps/files/l10n/te.php b/apps/files/l10n/te.php index 5a108274dd9c2654ea06c7f2fa4fd64562ff9d66..60aabc8a3655753f2cc3c393371c8e8372f76a79 100644 --- a/apps/files/l10n/te.php +++ b/apps/files/l10n/te.php @@ -3,11 +3,11 @@ $TRANSLATIONS = array( "Error" => "పొరపాటు", "Delete permanently" => "శాశ్వతంగా తొలగించు", "cancel" => "రద్దుచేయి", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "_Uploading %n file_::_Uploading %n files_" => array("",""), "Name" => "పేరు", "Size" => "పరిమాణం", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), "Save" => "భద్రపరచు", "Folder" => "సంచయం", "Delete" => "తొలగించు" diff --git a/apps/files/l10n/th_TH.php b/apps/files/l10n/th_TH.php index ac2da6aed9154836c9db7298ec40d6e95a6fed73..37144ebc8836d6079f55fab879f1939522e6b577 100644 --- a/apps/files/l10n/th_TH.php +++ b/apps/files/l10n/th_TH.php @@ -13,7 +13,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "เหลือพื้นที่ไม่เพียงสำหรับใช้งาน", "Invalid directory." => "ไดเร็กทอรี่ไม่ถูกต้อง", "Files" => "ไฟล์", -"Unable to upload your file as it is a directory or has 0 bytes" => "ไม่สามารถอัพโหลดไฟล์ของคุณได้ เนื่องจากไฟล์ดังกล่าวเป็นไดเร็กทอรี่ หรือ มีขนาดไฟล์ 0 ไบต์", "Not enough space available" => "มีพื้นที่เหลือไม่เพียงพอ", "Upload cancelled." => "การอัพโหลดถูกยกเลิก", "File upload is in progress. Leaving the page now will cancel the upload." => "การอัพโหลดไฟล์กำลังอยู่ในระหว่างดำเนินการ การออกจากหน้าเว็บนี้จะทำให้การอัพโหลดถูกยกเลิก", @@ -28,8 +27,9 @@ $TRANSLATIONS = array( "cancel" => "ยกเลิก", "replaced {new_name} with {old_name}" => "แทนที่ {new_name} ด้วย {old_name} แล้ว", "undo" => "เลิกทำ", +"_%n folder_::_%n folders_" => array(""), +"_%n file_::_%n files_" => array(""), "_Uploading %n file_::_Uploading %n files_" => array(""), -"files uploading" => "การอัพโหลดไฟล์", "'.' is an invalid file name." => "'.' เป็นชื่อไฟล์ที่ไม่ถูกต้อง", "File name cannot be empty." => "ชื่อไฟล์ไม่สามารถเว้นว่างได้", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "ชื่อที่ใช้ไม่ถูกต้อง, '\\', '/', '<', '>', ':', '\"', '|', '?' และ '*' ไม่ได้รับอนุญาตให้ใช้งานได้", @@ -39,8 +39,6 @@ $TRANSLATIONS = array( "Name" => "ชื่อ", "Size" => "ขนาด", "Modified" => "แก้ไขแล้ว", -"_%n folder_::_%n folders_" => array(""), -"_%n file_::_%n files_" => array(""), "Upload" => "อัพโหลด", "File handling" => "การจัดกาไฟล์", "Maximum upload size" => "ขนาดไฟล์สูงสุดที่อัพโหลดได้", @@ -63,8 +61,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "ไฟล์ที่คุณพยายามที่จะอัพโหลดมีขนาดเกินกว่าขนาดสูงสุดที่กำหนดไว้ให้อัพโหลดได้สำหรับเซิร์ฟเวอร์นี้", "Files are being scanned, please wait." => "ไฟล์กำลังอยู่ระหว่างการสแกน, กรุณารอสักครู่.", "Current scanning" => "ไฟล์ที่กำลังสแกนอยู่ขณะนี้", -"file" => "ไฟล์", -"files" => "ไฟล์", "Upgrading filesystem cache..." => "กำลังอัพเกรดหน่วยความจำแคชของระบบไฟล์..." ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/l10n/tr.php b/apps/files/l10n/tr.php index 650e4ead88c7a7e8b351388006befbe4e0ff35ab..8cb05e16ace42b30fb161c1e449769a978206c32 100644 --- a/apps/files/l10n/tr.php +++ b/apps/files/l10n/tr.php @@ -15,7 +15,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "Yeterli disk alanı yok", "Invalid directory." => "Geçersiz dizin.", "Files" => "Dosyalar", -"Unable to upload your file as it is a directory or has 0 bytes" => "Dosyanızın boyutu 0 byte olduğundan veya bir dizin olduğundan yüklenemedi", "Not enough space available" => "Yeterli disk alanı yok", "Upload cancelled." => "Yükleme iptal edildi.", "File upload is in progress. Leaving the page now will cancel the upload." => "Dosya yükleme işlemi sürüyor. Şimdi sayfadan ayrılırsanız işleminiz iptal olur.", @@ -32,8 +31,9 @@ $TRANSLATIONS = array( "cancel" => "iptal", "replaced {new_name} with {old_name}" => "{new_name} ismi {old_name} ile değiştirildi", "undo" => "geri al", +"_%n folder_::_%n folders_" => array("%n dizin","%n dizin"), +"_%n file_::_%n files_" => array("%n dosya","%n dosya"), "_Uploading %n file_::_Uploading %n files_" => array("%n dosya yükleniyor","%n dosya yükleniyor"), -"files uploading" => "Dosyalar yükleniyor", "'.' is an invalid file name." => "'.' geçersiz dosya adı.", "File name cannot be empty." => "Dosya adı boş olamaz.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Geçersiz isim, '\\', '/', '<', '>', ':', '\"', '|', '?' ve '*' karakterlerine izin verilmemektedir.", @@ -44,8 +44,6 @@ $TRANSLATIONS = array( "Name" => "İsim", "Size" => "Boyut", "Modified" => "Değiştirilme", -"_%n folder_::_%n folders_" => array("%n dizin","%n dizin"), -"_%n file_::_%n files_" => array("%n dosya","%n dosya"), "%s could not be renamed" => "%s yeniden adlandırılamadı", "Upload" => "Yükle", "File handling" => "Dosya taşıma", @@ -71,10 +69,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Yüklemeye çalıştığınız dosyalar bu sunucudaki maksimum yükleme boyutunu aşıyor.", "Files are being scanned, please wait." => "Dosyalar taranıyor, lütfen bekleyin.", "Current scanning" => "Güncel tarama", -"directory" => "dizin", -"directories" => "dizinler", -"file" => "dosya", -"files" => "dosyalar", "Upgrading filesystem cache..." => "Sistem dosyası önbelleği güncelleniyor" ); $PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/apps/files/l10n/ug.php b/apps/files/l10n/ug.php index 2eceeea44a87880a6dee33508a591b9b19784710..a38ce706ef9ea1b988de3cc896033c513d6e1ce8 100644 --- a/apps/files/l10n/ug.php +++ b/apps/files/l10n/ug.php @@ -20,13 +20,12 @@ $TRANSLATIONS = array( "suggest name" => "تەۋسىيە ئات", "cancel" => "ۋاز كەچ", "undo" => "يېنىۋال", +"_%n folder_::_%n folders_" => array(""), +"_%n file_::_%n files_" => array(""), "_Uploading %n file_::_Uploading %n files_" => array(""), -"files uploading" => "ھۆججەت يۈكلىنىۋاتىدۇ", "Name" => "ئاتى", "Size" => "چوڭلۇقى", "Modified" => "ئۆزگەرتكەن", -"_%n folder_::_%n folders_" => array(""), -"_%n file_::_%n files_" => array(""), "Upload" => "يۈكلە", "Save" => "ساقلا", "New" => "يېڭى", diff --git a/apps/files/l10n/uk.php b/apps/files/l10n/uk.php index 49747caef1967c7cb33cfdb224c1258bc580ad06..4aaeca255422ce889863a60613ac83d58261bceb 100644 --- a/apps/files/l10n/uk.php +++ b/apps/files/l10n/uk.php @@ -2,6 +2,7 @@ $TRANSLATIONS = array( "Could not move %s - File with this name already exists" => "Не вдалося перемістити %s - Файл з таким ім'ям вже існує", "Could not move %s" => "Не вдалося перемістити %s", +"Unable to set upload directory." => "Не вдалося встановити каталог завантаження.", "No file was uploaded. Unknown error" => "Не завантажено жодного файлу. Невідома помилка", "There is no error, the file uploaded with success" => "Файл успішно вивантажено без помилок.", "The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "Розмір звантаження перевищує upload_max_filesize параметра в php.ini: ", @@ -13,11 +14,11 @@ $TRANSLATIONS = array( "Not enough storage available" => "Місця більше немає", "Invalid directory." => "Невірний каталог.", "Files" => "Файли", -"Unable to upload your file as it is a directory or has 0 bytes" => "Неможливо завантажити ваш файл тому, що він тека або файл розміром 0 байт", "Not enough space available" => "Місця більше немає", "Upload cancelled." => "Завантаження перервано.", "File upload is in progress. Leaving the page now will cancel the upload." => "Виконується завантаження файлу. Закриття цієї сторінки приведе до відміни завантаження.", "URL cannot be empty." => "URL не може бути пустим.", +"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Неправильне ім'я теки. Використання 'Shared' зарезервовано ownCloud", "Error" => "Помилка", "Share" => "Поділитися", "Delete permanently" => "Видалити назавжди", @@ -29,8 +30,9 @@ $TRANSLATIONS = array( "cancel" => "відміна", "replaced {new_name} with {old_name}" => "замінено {new_name} на {old_name}", "undo" => "відмінити", +"_%n folder_::_%n folders_" => array("%n тека","%n тека","%n теки"), +"_%n file_::_%n files_" => array("","",""), "_Uploading %n file_::_Uploading %n files_" => array("","",""), -"files uploading" => "файли завантажуються", "'.' is an invalid file name." => "'.' це невірне ім'я файлу.", "File name cannot be empty." => " Ім'я файлу не може бути порожнім.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Невірне ім'я, '\\', '/', '<', '>', ':', '\"', '|', '?' та '*' не дозволені.", @@ -40,8 +42,6 @@ $TRANSLATIONS = array( "Name" => "Ім'я", "Size" => "Розмір", "Modified" => "Змінено", -"_%n folder_::_%n folders_" => array("","",""), -"_%n file_::_%n files_" => array("","",""), "%s could not be renamed" => "%s не може бути перейменований", "Upload" => "Вивантажити", "File handling" => "Робота з файлами", @@ -54,7 +54,7 @@ $TRANSLATIONS = array( "Save" => "Зберегти", "New" => "Створити", "Text file" => "Текстовий файл", -"Folder" => "Папка", +"Folder" => "Тека", "From link" => "З посилання", "Deleted files" => "Видалено файлів", "Cancel upload" => "Перервати завантаження", @@ -67,10 +67,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Файли,що ви намагаєтесь відвантажити перевищують максимальний дозволений розмір файлів на цьому сервері.", "Files are being scanned, please wait." => "Файли скануються, зачекайте, будь-ласка.", "Current scanning" => "Поточне сканування", -"directory" => "каталог", -"directories" => "каталоги", -"file" => "файл", -"files" => "файли", "Upgrading filesystem cache..." => "Оновлення кеша файлової системи..." ); $PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/apps/files/l10n/ur_PK.php b/apps/files/l10n/ur_PK.php index 15c24700df0bb02f3dba942e2b67ae19615e9983..6854c421587594c1eb30dd97924044e0cfebd3f5 100644 --- a/apps/files/l10n/ur_PK.php +++ b/apps/files/l10n/ur_PK.php @@ -1,9 +1,9 @@ "ایرر", -"_Uploading %n file_::_Uploading %n files_" => array("",""), "_%n folder_::_%n folders_" => array("",""), "_%n file_::_%n files_" => array("",""), +"_Uploading %n file_::_Uploading %n files_" => array("",""), "Unshare" => "شئیرنگ ختم کریں" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/vi.php b/apps/files/l10n/vi.php index 9c6e1c2a57babf8fd9b12f34edc6c48439402763..2d63128aa264abdb48d3e0c85f6d88e03e29f85f 100644 --- a/apps/files/l10n/vi.php +++ b/apps/files/l10n/vi.php @@ -13,7 +13,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "Không đủ không gian lưu trữ", "Invalid directory." => "Thư mục không hợp lệ", "Files" => "Tập tin", -"Unable to upload your file as it is a directory or has 0 bytes" => "Không thể tải lên tập tin của bạn ,nó như là một thư mục hoặc có 0 byte", "Not enough space available" => "Không đủ chỗ trống cần thiết", "Upload cancelled." => "Hủy tải lên", "File upload is in progress. Leaving the page now will cancel the upload." => "Tập tin tải lên đang được xử lý. Nếu bạn rời khỏi trang bây giờ sẽ hủy quá trình này.", @@ -29,8 +28,9 @@ $TRANSLATIONS = array( "cancel" => "hủy", "replaced {new_name} with {old_name}" => "đã thay thế {new_name} bằng {old_name}", "undo" => "lùi lại", +"_%n folder_::_%n folders_" => array(""), +"_%n file_::_%n files_" => array(""), "_Uploading %n file_::_Uploading %n files_" => array(""), -"files uploading" => "tệp tin đang được tải lên", "'.' is an invalid file name." => "'.' là một tên file không hợp lệ", "File name cannot be empty." => "Tên file không được rỗng", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Tên không hợp lệ, '\\', '/', '<', '>', ':', '\"', '|', '?' và '*' thì không được phép dùng.", @@ -40,8 +40,6 @@ $TRANSLATIONS = array( "Name" => "Tên", "Size" => "Kích cỡ", "Modified" => "Thay đổi", -"_%n folder_::_%n folders_" => array(""), -"_%n file_::_%n files_" => array(""), "Upload" => "Tải lên", "File handling" => "Xử lý tập tin", "Maximum upload size" => "Kích thước tối đa ", @@ -66,8 +64,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Các tập tin bạn đang tải lên vượt quá kích thước tối đa cho phép trên máy chủ .", "Files are being scanned, please wait." => "Tập tin đang được quét ,vui lòng chờ.", "Current scanning" => "Hiện tại đang quét", -"file" => "file", -"files" => "files", "Upgrading filesystem cache..." => "Đang nâng cấp bộ nhớ đệm cho tập tin hệ thống..." ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/l10n/zh_CN.php b/apps/files/l10n/zh_CN.php index ad9733f059a728050430b8fa19836657d0840b62..b739b72ce7e264773a2cd974e4c06025f009f637 100644 --- a/apps/files/l10n/zh_CN.php +++ b/apps/files/l10n/zh_CN.php @@ -15,7 +15,6 @@ $TRANSLATIONS = array( "Not enough storage available" => "没有足够的存储空间", "Invalid directory." => "无效文件夹。", "Files" => "文件", -"Unable to upload your file as it is a directory or has 0 bytes" => "无法上传您的文件,文件夹或者空文件", "Not enough space available" => "没有足够可用空间", "Upload cancelled." => "上传已取消", "File upload is in progress. Leaving the page now will cancel the upload." => "文件正在上传中。现在离开此页会导致上传动作被取消。", @@ -32,8 +31,9 @@ $TRANSLATIONS = array( "cancel" => "取消", "replaced {new_name} with {old_name}" => "已将 {old_name}替换成 {new_name}", "undo" => "撤销", +"_%n folder_::_%n folders_" => array("%n 文件夹"), +"_%n file_::_%n files_" => array("%n个文件"), "_Uploading %n file_::_Uploading %n files_" => array(""), -"files uploading" => "文件上传中", "'.' is an invalid file name." => "'.' 是一个无效的文件名。", "File name cannot be empty." => "文件名不能为空。", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "无效名称,'\\', '/', '<', '>', ':', '\"', '|', '?' 和 '*' 不被允许使用。", @@ -43,8 +43,6 @@ $TRANSLATIONS = array( "Name" => "名称", "Size" => "大小", "Modified" => "修改日期", -"_%n folder_::_%n folders_" => array("%n 文件夹"), -"_%n file_::_%n files_" => array("%n个文件"), "%s could not be renamed" => "%s 不能被重命名", "Upload" => "上传", "File handling" => "文件处理", @@ -70,8 +68,6 @@ $TRANSLATIONS = array( "The files you are trying to upload exceed the maximum size for file uploads on this server." => "您正尝试上传的文件超过了此服务器可以上传的最大容量限制", "Files are being scanned, please wait." => "文件正在被扫描,请稍候。", "Current scanning" => "当前扫描", -"file" => "文件", -"files" => "文件", "Upgrading filesystem cache..." => "正在更新文件系统缓存..." ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/l10n/zh_HK.php b/apps/files/l10n/zh_HK.php index a9064fa7f780944989cfb4b7629a8655a4306b52..febed4fe8fb68048048ac876a81ba9ed6b5b53c3 100644 --- a/apps/files/l10n/zh_HK.php +++ b/apps/files/l10n/zh_HK.php @@ -3,10 +3,10 @@ $TRANSLATIONS = array( "Files" => "文件", "Error" => "錯誤", "Share" => "分享", -"_Uploading %n file_::_Uploading %n files_" => array(""), -"Name" => "名稱", "_%n folder_::_%n folders_" => array(""), "_%n file_::_%n files_" => array(""), +"_Uploading %n file_::_Uploading %n files_" => array(""), +"Name" => "名稱", "Upload" => "上傳", "Save" => "儲存", "Download" => "下載", diff --git a/apps/files/l10n/zh_TW.php b/apps/files/l10n/zh_TW.php index 5cca3e0fd857477471012ead5589078df6547230..214812d7adaf6270faca6af413113b929aa7c07a 100644 --- a/apps/files/l10n/zh_TW.php +++ b/apps/files/l10n/zh_TW.php @@ -1,11 +1,11 @@ "無法移動 %s - 同名的檔案已經存在", +"Could not move %s - File with this name already exists" => "無法移動 %s ,同名的檔案已經存在", "Could not move %s" => "無法移動 %s", -"Unable to set upload directory." => "無法設定上傳目錄。", +"Unable to set upload directory." => "無法設定上傳目錄", "Invalid Token" => "無效的 token", -"No file was uploaded. Unknown error" => "沒有檔案被上傳。未知的錯誤。", -"There is no error, the file uploaded with success" => "無錯誤,檔案上傳成功", +"No file was uploaded. Unknown error" => "沒有檔案被上傳,原因未知", +"There is no error, the file uploaded with success" => "一切都順利,檔案上傳成功", "The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "上傳的檔案大小超過 php.ini 當中 upload_max_filesize 參數的設定:", "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "上傳的檔案大小超過 HTML 表單中 MAX_FILE_SIZE 的限制", "The uploaded file was only partially uploaded" => "只有檔案的一部分被上傳", @@ -13,13 +13,12 @@ $TRANSLATIONS = array( "Missing a temporary folder" => "找不到暫存資料夾", "Failed to write to disk" => "寫入硬碟失敗", "Not enough storage available" => "儲存空間不足", -"Invalid directory." => "無效的資料夾。", +"Invalid directory." => "無效的資料夾", "Files" => "檔案", -"Unable to upload your file as it is a directory or has 0 bytes" => "無法上傳您的檔案因為它可能是一個目錄或檔案大小為0", "Not enough space available" => "沒有足夠的可用空間", "Upload cancelled." => "上傳已取消", -"File upload is in progress. Leaving the page now will cancel the upload." => "檔案上傳中。離開此頁面將會取消上傳。", -"URL cannot be empty." => "URL 不能為空白。", +"File upload is in progress. Leaving the page now will cancel the upload." => "檔案上傳中,離開此頁面將會取消上傳。", +"URL cannot be empty." => "URL 不能為空", "Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "無效的資料夾名稱,'Shared' 的使用被 ownCloud 保留", "Error" => "錯誤", "Share" => "分享", @@ -32,49 +31,45 @@ $TRANSLATIONS = array( "cancel" => "取消", "replaced {new_name} with {old_name}" => "使用 {new_name} 取代 {old_name}", "undo" => "復原", +"_%n folder_::_%n folders_" => array("%n 個資料夾"), +"_%n file_::_%n files_" => array("%n 個檔案"), +"{dirs} and {files}" => "{dirs} 和 {files}", "_Uploading %n file_::_Uploading %n files_" => array("%n 個檔案正在上傳"), -"files uploading" => "檔案正在上傳中", -"'.' is an invalid file name." => "'.' 是不合法的檔名。", -"File name cannot be empty." => "檔名不能為空。", -"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "檔名不合法,不允許 '\\', '/', '<', '>', ':', '\"', '|', '?' 和 '*' 。", +"'.' is an invalid file name." => "'.' 是不合法的檔名", +"File name cannot be empty." => "檔名不能為空", +"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "檔名不合法,不允許 \\ / < > : \" | ? * 字元", "Your storage is full, files can not be updated or synced anymore!" => "您的儲存空間已滿,沒有辦法再更新或是同步檔案!", "Your storage is almost full ({usedSpacePercent}%)" => "您的儲存空間快要滿了 ({usedSpacePercent}%)", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "加密已經被停用,但是您的舊檔案還是處於已加密的狀態,請前往個人設定以解密這些檔案。", "Your download is being prepared. This might take some time if the files are big." => "正在準備您的下載,若您的檔案較大,將會需要更多時間。", "Name" => "名稱", "Size" => "大小", -"Modified" => "修改", -"_%n folder_::_%n folders_" => array("%n 個資料夾"), -"_%n file_::_%n files_" => array("%n 個檔案"), +"Modified" => "修改時間", "%s could not be renamed" => "無法重新命名 %s", "Upload" => "上傳", "File handling" => "檔案處理", -"Maximum upload size" => "最大上傳檔案大小", +"Maximum upload size" => "上傳限制", "max. possible: " => "最大允許:", -"Needed for multi-file and folder downloads." => "針對多檔案和目錄下載是必填的。", -"Enable ZIP-download" => "啟用 Zip 下載", +"Needed for multi-file and folder downloads." => "下載多檔案和目錄時,此項是必填的。", +"Enable ZIP-download" => "啟用 ZIP 下載", "0 is unlimited" => "0代表沒有限制", -"Maximum input size for ZIP files" => "針對 ZIP 檔案最大輸入大小", +"Maximum input size for ZIP files" => "ZIP 壓縮前的原始大小限制", "Save" => "儲存", "New" => "新增", "Text file" => "文字檔", "Folder" => "資料夾", "From link" => "從連結", -"Deleted files" => "已刪除的檔案", +"Deleted files" => "回收桶", "Cancel upload" => "取消上傳", -"You don’t have write permissions here." => "您在這裡沒有編輯權。", -"Nothing in here. Upload something!" => "這裡什麼也沒有,上傳一些東西吧!", +"You don’t have write permissions here." => "您在這裡沒有編輯權", +"Nothing in here. Upload something!" => "這裡還沒有東西,上傳一些吧!", "Download" => "下載", -"Unshare" => "取消共享", +"Unshare" => "取消分享", "Delete" => "刪除", "Upload too large" => "上傳過大", -"The files you are trying to upload exceed the maximum size for file uploads on this server." => "您試圖上傳的檔案已超過伺服器的最大檔案大小限制。", +"The files you are trying to upload exceed the maximum size for file uploads on this server." => "您試圖上傳的檔案大小超過伺服器的限制。", "Files are being scanned, please wait." => "正在掃描檔案,請稍等。", -"Current scanning" => "目前掃描", -"directory" => "目錄", -"directories" => "目錄", -"file" => "檔案", -"files" => "檔案", -"Upgrading filesystem cache..." => "正在升級檔案系統快取..." +"Current scanning" => "正在掃描", +"Upgrading filesystem cache..." => "正在升級檔案系統快取…" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/lib/helper.php b/apps/files/lib/helper.php index 7135ef9f656525fbc18b3fd7c87b95873ce481a2..709d78a4d45cb65aab21c3f8f00613e141337055 100644 --- a/apps/files/lib/helper.php +++ b/apps/files/lib/helper.php @@ -1,6 +1,6 @@ $maxHumanFilesize, 'usedSpacePercent' => (int)$storageInfo['relative']); } + + public static function determineIcon($file) { + if($file['type'] === 'dir') { + $dir = $file['directory']; + $absPath = \OC\Files\Filesystem::getView()->getAbsolutePath($dir.'/'.$file['name']); + $mount = \OC\Files\Filesystem::getMountManager()->find($absPath); + if (!is_null($mount)) { + $sid = $mount->getStorageId(); + if (!is_null($sid)) { + $sid = explode(':', $sid); + if ($sid[0] === 'shared') { + return \OC_Helper::mimetypeIcon('dir-shared'); + } + if ($sid[0] !== 'local') { + return \OC_Helper::mimetypeIcon('dir-external'); + } + } + } + return \OC_Helper::mimetypeIcon('dir'); + } + + if($file['isPreviewAvailable']) { + $pathForPreview = $file['directory'] . '/' . $file['name']; + return \OC_Helper::previewIcon($pathForPreview); + } + return \OC_Helper::mimetypeIcon($file['mimetype']); + } + + /** + * Comparator function to sort files alphabetically and have + * the directories appear first + * @param array $a file + * @param array $b file + * @return -1 if $a must come before $b, 1 otherwise + */ + public static function fileCmp($a, $b) { + if ($a['type'] === 'dir' and $b['type'] !== 'dir') { + return -1; + } elseif ($a['type'] !== 'dir' and $b['type'] === 'dir') { + return 1; + } else { + return strnatcasecmp($a['name'], $b['name']); + } + } + + /** + * Retrieves the contents of the given directory and + * returns it as a sorted array. + * @param string $dir path to the directory + * @return array of files + */ + public static function getFiles($dir) { + $content = \OC\Files\Filesystem::getDirectoryContent($dir); + $files = array(); + + foreach ($content as $i) { + $i['date'] = \OCP\Util::formatDate($i['mtime']); + if ($i['type'] === 'file') { + $fileinfo = pathinfo($i['name']); + $i['basename'] = $fileinfo['filename']; + if (!empty($fileinfo['extension'])) { + $i['extension'] = '.' . $fileinfo['extension']; + } else { + $i['extension'] = ''; + } + } + $i['directory'] = $dir; + $i['isPreviewAvailable'] = \OC::$server->getPreviewManager()->isMimeSupported($i['mimetype']); + $i['icon'] = \OCA\Files\Helper::determineIcon($i); + $files[] = $i; + } + + usort($files, array('\OCA\Files\Helper', 'fileCmp')); + + return $files; + } + + /** + * Splits the given path into a breadcrumb structure. + * @param string $dir path to process + * @return array where each entry is a hash of the absolute + * directory path and its name + */ + public static function makeBreadcrumb($dir){ + $breadcrumb = array(); + $pathtohere = ''; + foreach (explode('/', $dir) as $i) { + if ($i !== '') { + $pathtohere .= '/' . $i; + $breadcrumb[] = array('dir' => $pathtohere, 'name' => $i); + } + } + return $breadcrumb; + } + + /** + * Returns the numeric permissions for the given directory. + * @param string $dir directory without trailing slash + * @return numeric permissions + */ + public static function getDirPermissions($dir){ + $permissions = \OCP\PERMISSION_READ; + if (\OC\Files\Filesystem::isCreatable($dir . '/')) { + $permissions |= \OCP\PERMISSION_CREATE; + } + if (\OC\Files\Filesystem::isUpdatable($dir . '/')) { + $permissions |= \OCP\PERMISSION_UPDATE; + } + if (\OC\Files\Filesystem::isDeletable($dir . '/')) { + $permissions |= \OCP\PERMISSION_DELETE; + } + if (\OC\Files\Filesystem::isSharable($dir . '/')) { + $permissions |= \OCP\PERMISSION_SHARE; + } + return $permissions; + } } diff --git a/apps/files/templates/fileexists.html b/apps/files/templates/fileexists.html new file mode 100644 index 0000000000000000000000000000000000000000..662177ac7ed79b56ed12360f998b807131e27e2b --- /dev/null +++ b/apps/files/templates/fileexists.html @@ -0,0 +1,26 @@ +
+ {why}
+ {what}
+
+ + + +
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 360874103f830a5805d89f28d8c539e93dce112e..96a80738989667198f4605f7705a0b55b6e9e858 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -1,8 +1,7 @@
- -
+
t('New'));?>
    @@ -10,35 +9,29 @@ data-type='file'>

    t('Text file'));?>

  • t('Folder'));?>

  • -
  • t('From link'));?>

-
= 0):?> - - + -
- > +
@@ -48,38 +41,40 @@
- -
- - +
+
+
- -
t('Nothing in here. Upload something!'))?>
- +
0 or $_['ajaxLoad']):?>class="hidden">t('Nothing in here. Upload something!'))?>
+ + - +
- - t( 'Name' )); ?> - - - - Download" /> - t('Download'))?> - - - +
+ + + t( 'Name' )); ?> + + + + Download" /> + t('Download'))?> + + + +
t('Size')); ?> t( 'Modified' )); ?> - + t('Unshare'))?> @@ -101,7 +96,7 @@
-
+

t('The files you are trying to upload exceed the maximum size for file uploads on this server.'));?> @@ -117,6 +112,7 @@

+ diff --git a/apps/files/templates/part.list.php b/apps/files/templates/part.list.php index 0c7d6936697fb5ce09222a47896710307ce15308..1e4d4d11c98dbfa6344abe6ec9a1f48e993d7588 100644 --- a/apps/files/templates/part.list.php +++ b/apps/files/templates/part.list.php @@ -1,14 +1,7 @@ - data-file="" data-type="" data-mime="" - data-size='' - data-permissions=''> - - style="background-image:url()" + data-size="" + data-permissions=""> + + - style="background-image:url()" + + style="background-image:url()" > - + + + + @@ -64,33 +60,4 @@ $totalsize = 0; ?> - - - - - t('directory')); - } else { - p($l->t('directories')); - } - } - if ($totaldirs !== 0 && $totalfiles !== 0) { - p(' & '); - } - if ($totalfiles !== 0) { - p($totalfiles.' '); - if ($totalfiles === 1) { - p($l->t('file')); - } else { - p($l->t('files')); - } - } ?> - - - - - - - Sam Tuke, Bjoern Schiessle, Florin Peter 4 true + false diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php index de306462d79062a7fcd7ba876a9e8e624936dc06..d9221c6e828a2539ed61ffe184f7e589ca978444 100644 --- a/apps/files_encryption/hooks/hooks.php +++ b/apps/files_encryption/hooks/hooks.php @@ -36,14 +36,6 @@ class Hooks { */ public static function login($params) { $l = new \OC_L10N('files_encryption'); - //check if all requirements are met - if(!Helper::checkRequirements() || !Helper::checkConfiguration() ) { - $error_msg = $l->t("Missing requirements."); - $hint = $l->t('Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled.'); - \OC_App::disable('files_encryption'); - \OCP\Util::writeLog('Encryption library', $error_msg . ' ' . $hint, \OCP\Util::ERROR); - \OCP\Template::printErrorPage($error_msg, $hint); - } $view = new \OC_FilesystemView('/'); @@ -52,6 +44,20 @@ class Hooks { \OC_Util::setupFS($params['uid']); } + $privateKey = \OCA\Encryption\Keymanager::getPrivateKey($view, $params['uid']); + + // if no private key exists, check server configuration + if(!$privateKey) { + //check if all requirements are met + if(!Helper::checkRequirements() || !Helper::checkConfiguration()) { + $error_msg = $l->t("Missing requirements."); + $hint = $l->t('Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled.'); + \OC_App::disable('files_encryption'); + \OCP\Util::writeLog('Encryption library', $error_msg . ' ' . $hint, \OCP\Util::ERROR); + \OCP\Template::printErrorPage($error_msg, $hint); + } + } + $util = new Util($view, $params['uid']); // setup user, if user not ready force relogin @@ -72,7 +78,7 @@ class Hooks { $userView = new \OC_FilesystemView('/' . $params['uid']); - // Set legacy encryption key if it exists, to support + // Set legacy encryption key if it exists, to support // depreciated encryption system if ( $userView->file_exists('encryption.key') @@ -248,7 +254,7 @@ class Hooks { $params['run'] = false; $params['error'] = $l->t('Following users are not set up for encryption:') . ' ' . join(', ' , $notConfigured); } - + } /** @@ -259,7 +265,7 @@ class Hooks { // NOTE: $params has keys: // [itemType] => file // itemSource -> int, filecache file ID - // [parent] => + // [parent] => // [itemTarget] => /13 // shareWith -> string, uid of user being shared to // fileTarget -> path of file being shared @@ -300,13 +306,13 @@ class Hooks { // NOTE: parent is folder but shared was a file! // we try to rebuild the missing path // some examples we face here - // user1 share folder1 with user2 folder1 has - // the following structure + // user1 share folder1 with user2 folder1 has + // the following structure // /folder1/subfolder1/subsubfolder1/somefile.txt // user2 re-share subfolder2 with user3 // user3 re-share somefile.txt user4 - // so our path should be - // /Shared/subfolder1/subsubfolder1/somefile.txt + // so our path should be + // /Shared/subfolder1/subsubfolder1/somefile.txt // while user3 is sharing if ($params['itemType'] === 'file') { diff --git a/apps/files_encryption/l10n/bs.php b/apps/files_encryption/l10n/bs.php new file mode 100644 index 0000000000000000000000000000000000000000..708e045adebb6fa3a36e65fea2416ead10d58b93 --- /dev/null +++ b/apps/files_encryption/l10n/bs.php @@ -0,0 +1,5 @@ + "Spašavam..." +); +$PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/apps/files_encryption/l10n/de_CH.php b/apps/files_encryption/l10n/de_CH.php new file mode 100644 index 0000000000000000000000000000000000000000..aa867645c8d6c8064a64cc92175bb7d9b300d515 --- /dev/null +++ b/apps/files_encryption/l10n/de_CH.php @@ -0,0 +1,39 @@ + "Der Wiederherstellungsschlüssel wurde erfolgreich aktiviert.", +"Could not enable recovery key. Please check your recovery key password!" => "Der Wiederherstellungsschlüssel konnte nicht aktiviert werden. Bitte überprüfen Sie das Passwort für den Wiederherstellungsschlüssel!", +"Recovery key successfully disabled" => "Der Wiederherstellungsschlüssel wurde erfolgreich deaktiviert.", +"Could not disable recovery key. Please check your recovery key password!" => "Der Wiederherstellungsschlüssel konnte nicht deaktiviert werden. Bitte überprüfen Sie das Passwort für den Wiederherstellungsschlüssel!", +"Password successfully changed." => "Das Passwort wurde erfolgreich geändert.", +"Could not change the password. Maybe the old password was not correct." => "Das Passwort konnte nicht geändert werden. Vielleicht war das alte Passwort nicht richtig.", +"Private key password successfully updated." => "Das Passwort des privaten Schlüssels wurde erfolgreich aktualisiert.", +"Could not update the private key password. Maybe the old password was not correct." => "Das Passwort des privaten Schlüssels konnte nicht aktualisiert werden. Vielleicht war das alte Passwort nicht richtig.", +"Your private key is not valid! Likely your password was changed outside the ownCloud system (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Ihr privater Schlüssel ist ungültig. Möglicher Weise wurde von ausserhalb Ihr Passwort geändert (z.B. in Ihrem gemeinsamen Verzeichnis). Sie können das Passwort Ihres privaten Schlüssels in den persönlichen Einstellungen aktualisieren, um wieder an Ihre Dateien zu gelangen.", +"Missing requirements." => "Fehlende Voraussetzungen", +"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Bitte stellen Sie sicher, dass PHP 5.3.3 oder neuer installiert und das OpenSSL zusammen mit der PHP-Erweiterung aktiviert und richtig konfiguriert ist. Zur Zeit ist die Verschlüsselungs-App deaktiviert.", +"Following users are not set up for encryption:" => "Für folgende Nutzer ist keine Verschlüsselung eingerichtet:", +"Saving..." => "Speichern...", +"Your private key is not valid! Maybe the your password was changed from outside." => "Ihr privater Schlüssel ist ungültig! Vielleicht wurde Ihr Passwort von ausserhalb geändert.", +"You can unlock your private key in your " => "Sie können den privaten Schlüssel ändern und zwar in Ihrem", +"personal settings" => "Persönliche Einstellungen", +"Encryption" => "Verschlüsselung", +"Enable recovery key (allow to recover users files in case of password loss):" => "Aktivieren Sie den Wiederherstellungsschlüssel (erlaubt die Wiederherstellung des Zugangs zu den Benutzerdateien, wenn das Passwort verloren geht).", +"Recovery key password" => "Wiederherstellungschlüsselpasswort", +"Enabled" => "Aktiviert", +"Disabled" => "Deaktiviert", +"Change recovery key password:" => "Wiederherstellungsschlüsselpasswort ändern", +"Old Recovery key password" => "Altes Wiederherstellungsschlüsselpasswort", +"New Recovery key password" => "Neues Wiederherstellungsschlüsselpasswort ", +"Change Password" => "Passwort ändern", +"Your private key password no longer match your log-in password:" => "Das Privatschlüsselpasswort darf nicht länger mit den Login-Passwort übereinstimmen.", +"Set your old private key password to your current log-in password." => "Setzen Sie Ihr altes Privatschlüsselpasswort auf Ihr aktuelles LogIn-Passwort.", +" If you don't remember your old password you can ask your administrator to recover your files." => "Falls Sie sich nicht an Ihr altes Passwort erinnern können, fragen Sie bitte Ihren Administrator, um Ihre Dateien wiederherzustellen.", +"Old log-in password" => "Altes Login-Passwort", +"Current log-in password" => "Momentanes Login-Passwort", +"Update Private Key Password" => "Das Passwort des privaten Schlüssels aktualisieren", +"Enable password recovery:" => "Die Passwort-Wiederherstellung aktivieren:", +"Enabling this option will allow you to reobtain access to your encrypted files in case of password loss" => "Durch die Aktivierung dieser Option haben Sie die Möglichkeit, wieder auf Ihre verschlüsselten Dateien zugreifen zu können, wenn Sie Ihr Passwort verloren haben.", +"File recovery settings updated" => "Die Einstellungen für die Dateiwiederherstellung wurden aktualisiert.", +"Could not update file recovery" => "Die Dateiwiederherstellung konnte nicht aktualisiert werden." +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_encryption/l10n/en_GB.php b/apps/files_encryption/l10n/en_GB.php new file mode 100644 index 0000000000000000000000000000000000000000..c220a4bdf045c81a57707c04a1a746cf076befe5 --- /dev/null +++ b/apps/files_encryption/l10n/en_GB.php @@ -0,0 +1,39 @@ + "Recovery key enabled successfully", +"Could not enable recovery key. Please check your recovery key password!" => "Could not enable recovery key. Please check your recovery key password!", +"Recovery key successfully disabled" => "Recovery key disabled successfully", +"Could not disable recovery key. Please check your recovery key password!" => "Could not disable recovery key. Please check your recovery key password!", +"Password successfully changed." => "Password changed successfully.", +"Could not change the password. Maybe the old password was not correct." => "Could not change the password. Maybe the old password was incorrect.", +"Private key password successfully updated." => "Private key password updated successfully.", +"Could not update the private key password. Maybe the old password was not correct." => "Could not update the private key password. Maybe the old password was not correct.", +"Your private key is not valid! Likely your password was changed outside the ownCloud system (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Your private key is not valid! Likely your password was changed outside the ownCloud system (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files.", +"Missing requirements." => "Missing requirements.", +"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled.", +"Following users are not set up for encryption:" => "Following users are not set up for encryption:", +"Saving..." => "Saving...", +"Your private key is not valid! Maybe the your password was changed from outside." => "Your private key is not valid! Maybe the your password was changed externally.", +"You can unlock your private key in your " => "You can unlock your private key in your ", +"personal settings" => "personal settings", +"Encryption" => "Encryption", +"Enable recovery key (allow to recover users files in case of password loss):" => "Enable recovery key (allow to recover users files in case of password loss):", +"Recovery key password" => "Recovery key password", +"Enabled" => "Enabled", +"Disabled" => "Disabled", +"Change recovery key password:" => "Change recovery key password:", +"Old Recovery key password" => "Old Recovery key password", +"New Recovery key password" => "New Recovery key password", +"Change Password" => "Change Password", +"Your private key password no longer match your log-in password:" => "Your private key password no longer match your login password:", +"Set your old private key password to your current log-in password." => "Set your old private key password to your current login password.", +" If you don't remember your old password you can ask your administrator to recover your files." => " If you don't remember your old password you can ask your administrator to recover your files.", +"Old log-in password" => "Old login password", +"Current log-in password" => "Current login password", +"Update Private Key Password" => "Update Private Key Password", +"Enable password recovery:" => "Enable password recovery:", +"Enabling this option will allow you to reobtain access to your encrypted files in case of password loss" => "Enabling this option will allow you to reobtain access to your encrypted files in case of password loss", +"File recovery settings updated" => "File recovery settings updated", +"Could not update file recovery" => "Could not update file recovery" +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_encryption/l10n/es.php b/apps/files_encryption/l10n/es.php index 8341bafc9fdab992bdc942f13d6cf41f1b29e8bb..2d644708c59ed3ece59af8046b5fab59205c280b 100644 --- a/apps/files_encryption/l10n/es.php +++ b/apps/files_encryption/l10n/es.php @@ -10,6 +10,8 @@ $TRANSLATIONS = array( "Could not update the private key password. Maybe the old password was not correct." => "No se pudo cambiar la contraseña. Puede que la contraseña antigua no sea correcta.", "Your private key is not valid! Likely your password was changed outside the ownCloud system (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "¡Su clave privada no es válida! Tal vez su contraseña ha sido cambiada desde fuera. Puede actualizar su clave privada en sus opciones personales para recuperar el acceso a sus ficheros.", "Missing requirements." => "Requisitos incompletos.", +"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Por favor, asegúrese de que PHP 5.3.3 o posterior está instalado y que la extensión OpenSSL de PHP está habilitada y configurada correctamente. Por el momento, la aplicación de cifrado ha sido deshabilitada.", +"Following users are not set up for encryption:" => "Los siguientes usuarios no han sido configurados para el cifrado:", "Saving..." => "Guardando...", "Your private key is not valid! Maybe the your password was changed from outside." => "¡Su clave privada no es válida! Tal vez su contraseña ha sido cambiada desde fuera.", "You can unlock your private key in your " => "Puede desbloquear su clave privada en su", diff --git a/apps/files_encryption/l10n/es_AR.php b/apps/files_encryption/l10n/es_AR.php index cac8c465362b83b47dc5b0b1064ede90814c3aa8..666ea59687c404bb19e088ce0e2a43a7288dd3de 100644 --- a/apps/files_encryption/l10n/es_AR.php +++ b/apps/files_encryption/l10n/es_AR.php @@ -10,6 +10,8 @@ $TRANSLATIONS = array( "Could not update the private key password. Maybe the old password was not correct." => "No fue posible actualizar la contraseña de clave privada. Tal vez la contraseña anterior no es correcta.", "Your private key is not valid! Likely your password was changed outside the ownCloud system (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "¡Tu clave privada no es válida! Tal vez tu contraseña fue cambiada desde fuera del sistema de ownCloud (por ej. desde tu cuenta de sistema). Podés actualizar tu clave privada en la sección de \"configuración personal\", para recuperar el acceso a tus archivos.", "Missing requirements." => "Requisitos incompletos.", +"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Por favor, asegúrese de que PHP 5.3.3 o una versión más reciente esté instalado y que OpenSSL junto con la extensión PHP esté habilitado y configurado apropiadamente. Por ahora, la aplicación de encriptación ha sido deshabilitada.", +"Following users are not set up for encryption:" => "Los siguientes usuarios no fueron configurados para encriptar:", "Saving..." => "Guardando...", "Your private key is not valid! Maybe the your password was changed from outside." => "¡Tu clave privada no es válida! Tal vez tu contraseña fue cambiada desde afuera.", "You can unlock your private key in your " => "Podés desbloquear tu clave privada en tu", diff --git a/apps/files_encryption/l10n/fi_FI.php b/apps/files_encryption/l10n/fi_FI.php index 53b0a6b25cd9e8cbb785ee47cd69ee0488fa49de..b3df41b1f423440e467b8942011d2fd0f85d836c 100644 --- a/apps/files_encryption/l10n/fi_FI.php +++ b/apps/files_encryption/l10n/fi_FI.php @@ -1,11 +1,21 @@ "Palautusavain kytketty päälle onnistuneesti", "Password successfully changed." => "Salasana vaihdettiin onnistuneesti.", "Could not change the password. Maybe the old password was not correct." => "Salasanan vaihto epäonnistui. Kenties vanha salasana oli väärin.", +"Following users are not set up for encryption:" => "Seuraavat käyttäjät eivät ole määrittäneet salausta:", "Saving..." => "Tallennetaan...", +"personal settings" => "henkilökohtaiset asetukset", "Encryption" => "Salaus", +"Recovery key password" => "Palautusavaimen salasana", "Enabled" => "Käytössä", "Disabled" => "Ei käytössä", -"Change Password" => "Vaihda salasana" +"Change recovery key password:" => "Vaihda palautusavaimen salasana:", +"Old Recovery key password" => "Vanha palautusavaimen salasana", +"New Recovery key password" => "Uusi palautusavaimen salasana", +"Change Password" => "Vaihda salasana", +"Old log-in password" => "Vanha kirjautumis-salasana", +"Current log-in password" => "Nykyinen kirjautumis-salasana", +"Enable password recovery:" => "Ota salasanan palautus käyttöön:" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_encryption/l10n/fr.php b/apps/files_encryption/l10n/fr.php index 12af810139434711b7fa653b28921c3589d127c4..358937441e2c1cf4caef09b746b6b502e179e1f4 100644 --- a/apps/files_encryption/l10n/fr.php +++ b/apps/files_encryption/l10n/fr.php @@ -10,6 +10,8 @@ $TRANSLATIONS = array( "Could not update the private key password. Maybe the old password was not correct." => "Impossible de mettre à jour le mot de passe de la clé privé. Peut-être que l'ancien mot de passe n'était pas correcte.", "Your private key is not valid! Likely your password was changed outside the ownCloud system (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Votre clé de sécurité privée n'est pas valide! Il est probable que votre mot de passe ait été changé sans passer par le système ownCloud (par éxemple: le serveur de votre entreprise). Ain d'avoir à nouveau accès à vos fichiers cryptés, vous pouvez mettre à jour votre clé de sécurité privée dans les paramètres personnels de votre compte.", "Missing requirements." => "Système minimum requis non respecté.", +"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Veuillez vous assurer qu'une version de PHP 5.3.3 ou supérieure est installée et qu'OpenSSL et son extension PHP sont activés et configurés correctement. En attendant, l'application de chiffrement été désactivée.", +"Following users are not set up for encryption:" => "Les utilisateurs suivants ne sont pas configurés pour le chiffrement :", "Saving..." => "Enregistrement...", "Your private key is not valid! Maybe the your password was changed from outside." => "Votre clef privée est invalide ! Votre mot de passe a peut-être été modifié depuis l'extérieur.", "You can unlock your private key in your " => "Vous pouvez déverrouiller votre clé privée dans votre", diff --git a/apps/files_encryption/l10n/hu_HU.php b/apps/files_encryption/l10n/hu_HU.php index 49dcf817fb7680c486b8021179f00eb3758ab27c..323291bbfbe9fb7172c381012d315b5d3b51038a 100644 --- a/apps/files_encryption/l10n/hu_HU.php +++ b/apps/files_encryption/l10n/hu_HU.php @@ -1,6 +1,18 @@ "Visszaállítási kulcs sikeresen kikapcsolva", +"Password successfully changed." => "Jelszó sikeresen megváltoztatva.", +"Could not change the password. Maybe the old password was not correct." => "A jelszót nem lehet megváltoztatni! Lehet, hogy hibás volt a régi jelszó.", +"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Kérlek győződj meg arról, hogy PHP 5.3.3 vagy annál frissebb van telepítve, valamint a PHP-hez tartozó OpenSSL bővítmény be van-e kapcsolva és az helyesen van-e konfigurálva! Ki lett kapcsolva ideiglenesen a titkosító alkalmazás.", "Saving..." => "Mentés...", -"Encryption" => "Titkosítás" +"personal settings" => "személyes beállítások", +"Encryption" => "Titkosítás", +"Enabled" => "Bekapcsolva", +"Disabled" => "Kikapcsolva", +"Change Password" => "Jelszó megváltoztatása", +"Old log-in password" => "Régi bejelentkezési jelszó", +"Current log-in password" => "Jelenlegi bejelentkezési jelszó", +"Update Private Key Password" => "Privát kulcs jelszó frissítése", +"Enable password recovery:" => "Jelszó-visszaállítás bekapcsolása" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_encryption/l10n/lt_LT.php b/apps/files_encryption/l10n/lt_LT.php index 9fbf7b296046029bc85f376afdd9b90df55cfdc3..4ededb716f4e16badeef5a02d1ff36ba341bcc79 100644 --- a/apps/files_encryption/l10n/lt_LT.php +++ b/apps/files_encryption/l10n/lt_LT.php @@ -6,12 +6,34 @@ $TRANSLATIONS = array( "Could not disable recovery key. Please check your recovery key password!" => "Neišėjo išjungti jūsų atkūrimo rakto. Prašome jį patikrinti!", "Password successfully changed." => "Slaptažodis sėkmingai pakeistas", "Could not change the password. Maybe the old password was not correct." => "Slaptažodis nebuvo pakeistas. Gali būti, kad buvo neteisingai suvestas senasis.", +"Private key password successfully updated." => "Privataus rakto slaptažodis buvo sėkmingai atnaujintas.", +"Could not update the private key password. Maybe the old password was not correct." => "Nepavyko atnaujinti privataus rakto slaptažodžio. Gali būti, kad buvo neteisingai suvestas senasis.", +"Your private key is not valid! Likely your password was changed outside the ownCloud system (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Jūsų privatus raktas yra netinkamas! Panašu, kad Jūsų slaptažodis buvo pakeistas išorėje ownCloud sistemos (pvz. Jūsų organizacijos kataloge). Galite atnaujinti savo privataus rakto slaptažodį savo asmeniniuose nustatymuose, kad atkurti prieigą prie savo šifruotų failų.", +"Missing requirements." => "Trūkstami laukai.", +"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Prašome įsitikinti, kad PHP 5.3.3 ar naujesnė yra įdiegta ir kad OpenSSL kartu su PHP plėtiniu yra šjungti ir teisingai sukonfigūruoti. Kol kas šifravimo programa bus išjungta.", +"Following users are not set up for encryption:" => "Sekantys naudotojai nenustatyti šifravimui:", "Saving..." => "Saugoma...", +"Your private key is not valid! Maybe the your password was changed from outside." => "Jūsų privatus raktas yra netinkamas! Galbūt Jūsų slaptažodis buvo pakeistas iš išorės?", +"You can unlock your private key in your " => "Galite atrakinti savo privatų raktą savo", +"personal settings" => "asmeniniai nustatymai", "Encryption" => "Šifravimas", +"Enable recovery key (allow to recover users files in case of password loss):" => "Įjunkite atkūrimo raktą, (leisti atkurti naudotojų failus praradus slaptažodį):", +"Recovery key password" => "Atkūrimo rakto slaptažodis", "Enabled" => "Įjungta", "Disabled" => "Išjungta", +"Change recovery key password:" => "Pakeisti atkūrimo rakto slaptažodį:", +"Old Recovery key password" => "Senas atkūrimo rakto slaptažodis", +"New Recovery key password" => "Naujas atkūrimo rakto slaptažodis", "Change Password" => "Pakeisti slaptažodį", -"File recovery settings updated" => "Failų atstatymo nustatymai pakeisti", +"Your private key password no longer match your log-in password:" => "Privatus rakto slaptažodis daugiau neatitinka Jūsų prisijungimo slaptažodžio:", +"Set your old private key password to your current log-in password." => "Nustatyti Jūsų privataus rakto slaptažodį į Jūsų dabartinį prisijungimo.", +" If you don't remember your old password you can ask your administrator to recover your files." => "Jei nepamenate savo seno slaptažodžio, galite paprašyti administratoriaus atkurti Jūsų failus.", +"Old log-in password" => "Senas prisijungimo slaptažodis", +"Current log-in password" => "Dabartinis prisijungimo slaptažodis", +"Update Private Key Password" => "Atnaujinti privataus rakto slaptažodį", +"Enable password recovery:" => "Įjungti slaptažodžio atkūrimą:", +"Enabling this option will allow you to reobtain access to your encrypted files in case of password loss" => "Įjungus šią funkciją jums bus suteiktas pakartotinis priėjimas prie Jūsų šifruotų failų pamiršus slaptažodį.", +"File recovery settings updated" => "Failų atkūrimo nustatymai pakeisti", "Could not update file recovery" => "Neišėjo atnaujinti failų atkūrimo" ); $PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/apps/files_encryption/l10n/nn_NO.php b/apps/files_encryption/l10n/nn_NO.php index b99d0751540d4008389f1b53ebb8b775d0a24f1f..bb30d69c592a803fe5846cfd5ab0d9099ef95ca3 100644 --- a/apps/files_encryption/l10n/nn_NO.php +++ b/apps/files_encryption/l10n/nn_NO.php @@ -1,5 +1,6 @@ "Lagrar …" +"Saving..." => "Lagrar …", +"Encryption" => "Kryptering" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_encryption/l10n/pa.php b/apps/files_encryption/l10n/pa.php new file mode 100644 index 0000000000000000000000000000000000000000..586709904094e5ac740fa2f317b1feb80b9d9612 --- /dev/null +++ b/apps/files_encryption/l10n/pa.php @@ -0,0 +1,5 @@ + "...ਸੰਭਾਲਿਆ ਜਾ ਰਿਹਾ ਹੈ" +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_encryption/l10n/sk_SK.php b/apps/files_encryption/l10n/sk_SK.php index a723d80773b6751b7fb9f465995f2a2c56a55aec..a80eb3e65214a8bbbc4d70dff8a801be95cababc 100644 --- a/apps/files_encryption/l10n/sk_SK.php +++ b/apps/files_encryption/l10n/sk_SK.php @@ -8,12 +8,22 @@ $TRANSLATIONS = array( "Could not change the password. Maybe the old password was not correct." => "Nemožno zmeniť heslo. Pravdepodobne nebolo staré heslo zadané správne.", "Private key password successfully updated." => "Heslo súkromného kľúča je úspešne aktualizované.", "Could not update the private key password. Maybe the old password was not correct." => "Nemožno aktualizovať heslo súkromného kľúča. Možno nebolo staré heslo správne.", +"Your private key is not valid! Likely your password was changed outside the ownCloud system (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Váš privátny kľúč je nesprávny! Pravdepodobne bolo zmenené vaše heslo mimo systému ownCloud (napr. váš korporátny adresár). Môžte aktualizovať vaše heslo privátneho kľúča v osobných nastaveniach za účelom obnovenia prístupu k zašifrovaným súborom.", +"Missing requirements." => "Chýbajúce požiadavky.", +"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Prosím uistite sa, že PHP verzie 5.3.3 alebo novšej je nainštalované a tiež, že OpenSSL knižnica spolu z PHP rozšírením je povolená a konfigurovaná správne. Nateraz bola aplikácia šifrovania zablokovaná.", +"Following users are not set up for encryption:" => "Nasledujúci používatelia nie sú nastavení pre šifrovanie:", "Saving..." => "Ukladám...", "Your private key is not valid! Maybe the your password was changed from outside." => "Váš súkromný kľúč je neplatný. Možno bolo Vaše heslo zmenené z vonku.", +"You can unlock your private key in your " => "Môžte odomknúť váš privátny kľúč v", "personal settings" => "osobné nastavenia", "Encryption" => "Šifrovanie", +"Enable recovery key (allow to recover users files in case of password loss):" => "Povoliť obnovovací kľúč (umožňuje obnoviť používateľské súbory v prípade straty hesla):", +"Recovery key password" => "Heslo obnovovacieho kľúča", "Enabled" => "Povolené", "Disabled" => "Zakázané", +"Change recovery key password:" => "Zmeniť heslo obnovovacieho kľúča:", +"Old Recovery key password" => "Staré heslo obnovovacieho kľúča", +"New Recovery key password" => "Nové heslo obnovovacieho kľúča", "Change Password" => "Zmeniť heslo", "Your private key password no longer match your log-in password:" => "Vaše heslo súkromného kľúča je rovnaké ako Vaše prihlasovacie heslo:", "Set your old private key password to your current log-in password." => "Nastavte si staré heslo súkromného kľúča k Vášmu súčasnému prihlasovaciemu heslu.", diff --git a/apps/files_encryption/l10n/te.php b/apps/files_encryption/l10n/te.php new file mode 100644 index 0000000000000000000000000000000000000000..10c7a08a554c9b78c8e208b376c7ba82e228b1b5 --- /dev/null +++ b/apps/files_encryption/l10n/te.php @@ -0,0 +1,5 @@ + "వ్యక్తిగత అమరికలు" +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_encryption/l10n/uk.php b/apps/files_encryption/l10n/uk.php index 680beddfe680f72a72753efa561323cf9c0f19ff..5260dd3f2f7eb2b321e3ec0a4ba197a5708e5193 100644 --- a/apps/files_encryption/l10n/uk.php +++ b/apps/files_encryption/l10n/uk.php @@ -1,6 +1,8 @@ "Зберігаю...", -"Encryption" => "Шифрування" +"personal settings" => "особисті налаштування", +"Encryption" => "Шифрування", +"Change Password" => "Змінити Пароль" ); $PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php index e129bc9313ef3836b0ff3709e26d8428efaf35ca..c009718160ae360d47b4abce3822d9c9fea6fcde 100755 --- a/apps/files_encryption/lib/crypt.php +++ b/apps/files_encryption/lib/crypt.php @@ -52,14 +52,14 @@ class Crypt { $return = false; - $res = openssl_pkey_new(array('private_key_bits' => 4096)); + $res = Helper::getOpenSSLPkey(); if ($res === false) { \OCP\Util::writeLog('Encryption library', 'couldn\'t generate users key-pair for ' . \OCP\User::getUser(), \OCP\Util::ERROR); while ($msg = openssl_error_string()) { \OCP\Util::writeLog('Encryption library', 'openssl_pkey_new() fails: ' . $msg, \OCP\Util::ERROR); } - } elseif (openssl_pkey_export($res, $privateKey)) { + } elseif (openssl_pkey_export($res, $privateKey, null, Helper::getOpenSSLConfig())) { // Get public key $keyDetails = openssl_pkey_get_details($res); $publicKey = $keyDetails['key']; @@ -70,7 +70,9 @@ class Crypt { ); } else { \OCP\Util::writeLog('Encryption library', 'couldn\'t export users private key, please check your servers openSSL configuration.' . \OCP\User::getUser(), \OCP\Util::ERROR); - \OCP\Util::writeLog('Encryption library', openssl_error_string(), \OCP\Util::ERROR); + while($errMsg = openssl_error_string()) { + \OCP\Util::writeLog('Encryption library', $errMsg, \OCP\Util::ERROR); + } } return $return; diff --git a/apps/files_encryption/lib/helper.php b/apps/files_encryption/lib/helper.php index 0209a5d18b78a555bfd17397428aed58cded46e1..445d7ff8ca796ed911833df22685935578d2b316 100755 --- a/apps/files_encryption/lib/helper.php +++ b/apps/files_encryption/lib/helper.php @@ -265,7 +265,7 @@ class Helper { * @return bool true if configuration seems to be OK */ public static function checkConfiguration() { - if(openssl_pkey_new(array('private_key_bits' => 4096))) { + if(self::getOpenSSLPkey()) { return true; } else { while ($msg = openssl_error_string()) { @@ -275,6 +275,26 @@ class Helper { } } + /** + * Create an openssl pkey with config-supplied settings + * WARNING: This initializes a new private keypair, which is computationally expensive + * @return resource The pkey resource created + */ + public static function getOpenSSLPkey() { + return openssl_pkey_new(self::getOpenSSLConfig()); + } + + /** + * Return an array of OpenSSL config options, default + config + * Used for multiple OpenSSL functions + * @return array The combined defaults and config settings + */ + public static function getOpenSSLConfig() { + $config = array('private_key_bits' => 4096); + $config = array_merge(\OCP\Config::getSystemValue('openssl', array()), $config); + return $config; + } + /** * @brief glob uses different pattern than regular expressions, escape glob pattern only * @param unescaped path diff --git a/apps/files_encryption/lib/keymanager.php b/apps/files_encryption/lib/keymanager.php index 5386de486e190d93aa5671e577d53aa2ba651033..7143fcff0f63b7719849abc40f2450ed90179494 100755 --- a/apps/files_encryption/lib/keymanager.php +++ b/apps/files_encryption/lib/keymanager.php @@ -40,11 +40,14 @@ class Keymanager { public static function getPrivateKey(\OC_FilesystemView $view, $user) { $path = '/' . $user . '/' . 'files_encryption' . '/' . $user . '.private.key'; + $key = false; $proxyStatus = \OC_FileProxy::$enabled; \OC_FileProxy::$enabled = false; - $key = $view->file_get_contents($path); + if ($view->file_exists($path)) { + $key = $view->file_get_contents($path); + } \OC_FileProxy::$enabled = $proxyStatus; @@ -220,22 +223,10 @@ class Keymanager { */ public static function getFileKey(\OC_FilesystemView $view, $userId, $filePath) { - // try reusing key file if part file - if (self::isPartialFilePath($filePath)) { - - $result = self::getFileKey($view, $userId, self::fixPartialFilePath($filePath)); - - if ($result) { - - return $result; - - } - - } - $util = new Util($view, \OCP\User::getUser()); list($owner, $filename) = $util->getUidAndFilename($filePath); + $filename = self::fixPartialFilePath($filename); $filePath_f = ltrim($filename, '/'); // in case of system wide mount points the keys are stored directly in the data directory @@ -424,18 +415,6 @@ class Keymanager { public static function getShareKey(\OC_FilesystemView $view, $userId, $filePath) { // try reusing key file if part file - if (self::isPartialFilePath($filePath)) { - - $result = self::getShareKey($view, $userId, self::fixPartialFilePath($filePath)); - - if ($result) { - - return $result; - - } - - } - $proxyStatus = \OC_FileProxy::$enabled; \OC_FileProxy::$enabled = false; @@ -443,7 +422,7 @@ class Keymanager { $util = new Util($view, \OCP\User::getUser()); list($owner, $filename) = $util->getUidAndFilename($filePath); - + $filename = self::fixPartialFilePath($filename); // in case of system wide mount points the keys are stored directly in the data directory if ($util->isSystemWideMountPoint($filename)) { $shareKeyPath = '/files_encryption/share-keys/' . $filename . '.' . $userId . '.shareKey'; diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php index eb7ba60cb9d17821b62cd74a3f1f68b0f387b8cb..4ec810a51996e817cca39324e8a9bbf0ec4fe6c5 100644 --- a/apps/files_encryption/lib/proxy.php +++ b/apps/files_encryption/lib/proxy.php @@ -50,9 +50,8 @@ class Proxy extends \OC_FileProxy { private static function shouldEncrypt($path) { if (is_null(self::$enableEncryption)) { - if ( - \OCP\Config::getAppValue('files_encryption', 'enable_encryption', 'true') === 'true' + \OCP\App::isEnabled('files_encryption') === true && Crypt::mode() === 'server' ) { @@ -200,7 +199,7 @@ class Proxy extends \OC_FileProxy { */ public function preUnlink($path) { - // let the trashbin handle this + // let the trashbin handle this if (\OCP\App::isEnabled('files_trashbin')) { return true; } @@ -291,7 +290,7 @@ class Proxy extends \OC_FileProxy { // Close the original encrypted file fclose($result); - // Open the file using the crypto stream wrapper + // Open the file using the crypto stream wrapper // protocol and let it do the decryption work instead $result = fopen('crypt://' . $path, $meta['mode']); diff --git a/apps/files_encryption/lib/stream.php b/apps/files_encryption/lib/stream.php index 335ea3733eb2f90565bfe2e2098dbe82876732e3..083b33c03cbf2be40e674a8e509c3d5743975fb7 100644 --- a/apps/files_encryption/lib/stream.php +++ b/apps/files_encryption/lib/stream.php @@ -81,7 +81,7 @@ class Stream { * @return bool */ public function stream_open($path, $mode, $options, &$opened_path) { - + // assume that the file already exist before we decide it finally in getKey() $this->newFile = false; @@ -106,12 +106,12 @@ class Stream { if ($this->relPath === false) { $this->relPath = Helper::getPathToRealFile($this->rawPath); } - + if($this->relPath === false) { \OCP\Util::writeLog('Encryption library', 'failed to open file "' . $this->rawPath . '" expecting a path to user/files or to user/files_versions', \OCP\Util::ERROR); return false; } - + // Disable fileproxies so we can get the file size and open the source file without recursive encryption $proxyStatus = \OC_FileProxy::$enabled; \OC_FileProxy::$enabled = false; @@ -188,7 +188,7 @@ class Stream { } // Get the data from the file handle - $data = fread($this->handle, 8192); + $data = fread($this->handle, $count); $result = null; @@ -272,7 +272,7 @@ class Stream { } else { $this->newFile = true; - + return false; } @@ -296,9 +296,9 @@ class Stream { return strlen($data); } - // Disable the file proxies so that encryption is not - // automatically attempted when the file is written to disk - - // we are handling that separately here and we don't want to + // Disable the file proxies so that encryption is not + // automatically attempted when the file is written to disk - + // we are handling that separately here and we don't want to // get into an infinite loop $proxyStatus = \OC_FileProxy::$enabled; \OC_FileProxy::$enabled = false; @@ -311,7 +311,7 @@ class Stream { $pointer = ftell($this->handle); // Get / generate the keyfile for the file we're handling - // If we're writing a new file (not overwriting an existing + // If we're writing a new file (not overwriting an existing // one), save the newly generated keyfile if (!$this->getKey()) { @@ -319,7 +319,7 @@ class Stream { } - // If extra data is left over from the last round, make sure it + // If extra data is left over from the last round, make sure it // is integrated into the next 6126 / 8192 block if ($this->writeCache) { @@ -344,12 +344,12 @@ class Stream { if ($remainingLength < 6126) { // Set writeCache to contents of $data - // The writeCache will be carried over to the - // next write round, and added to the start of - // $data to ensure that written blocks are - // always the correct length. If there is still - // data in writeCache after the writing round - // has finished, then the data will be written + // The writeCache will be carried over to the + // next write round, and added to the start of + // $data to ensure that written blocks are + // always the correct length. If there is still + // data in writeCache after the writing round + // has finished, then the data will be written // to disk by $this->flush(). $this->writeCache = $data; @@ -363,7 +363,7 @@ class Stream { $encrypted = $this->preWriteEncrypt($chunk, $this->plainKey); - // Write the data chunk to disk. This will be + // Write the data chunk to disk. This will be // attended to the last data chunk if the file // being handled totals more than 6126 bytes fwrite($this->handle, $encrypted); @@ -488,6 +488,7 @@ class Stream { $this->meta['mode'] !== 'rb' && $this->size > 0 ) { + // only write keyfiles if it was a new file if ($this->newFile === true) { @@ -535,6 +536,7 @@ class Stream { // set fileinfo $this->rootView->putFileInfo($this->rawPath, $fileInfo); + } return fclose($this->handle); diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php index b8d6862349395efa1a02b7039b267cee87faa700..df4d35cab0b42076108403b380e0249425f13e33 100644 --- a/apps/files_encryption/lib/util.php +++ b/apps/files_encryption/lib/util.php @@ -201,10 +201,11 @@ class Util { if (false === $this->recoveryEnabledForUser()) { // create database configuration - $sql = 'INSERT INTO `*PREFIX*encryption` (`uid`,`mode`,`recovery_enabled`) VALUES (?,?,?)'; + $sql = 'INSERT INTO `*PREFIX*encryption` (`uid`,`mode`,`recovery_enabled`,`migration_status`) VALUES (?,?,?,?)'; $args = array( $this->userId, 'server-side', + 0, 0 ); $query = \OCP\DB::prepare($sql); @@ -329,72 +330,73 @@ class Util { $this->view->is_dir($directory) && $handle = $this->view->opendir($directory) ) { - - while (false !== ($file = readdir($handle))) { - - if ( - $file !== "." - && $file !== ".." - ) { - - $filePath = $directory . '/' . $this->view->getRelativePath('/' . $file); - $relPath = \OCA\Encryption\Helper::stripUserFilesPath($filePath); - - // If the path is a directory, search - // its contents - if ($this->view->is_dir($filePath)) { - - $this->findEncFiles($filePath, $found); - - // If the path is a file, determine - // its encryption status - } elseif ($this->view->is_file($filePath)) { - - // Disable proxies again, some- - // where they got re-enabled :/ - \OC_FileProxy::$enabled = false; - - $isEncryptedPath = $this->isEncryptedPath($filePath); - // If the file is encrypted - // NOTE: If the userId is - // empty or not set, file will - // detected as plain - // NOTE: This is inefficient; - // scanning every file like this - // will eat server resources :( - if ( - Keymanager::getFileKey($this->view, $this->userId, $relPath) - && $isEncryptedPath - ) { - - $found['encrypted'][] = array( - 'name' => $file, - 'path' => $filePath - ); - - // If the file uses old - // encryption system - } elseif (Crypt::isLegacyEncryptedContent($isEncryptedPath, $relPath)) { - - $found['legacy'][] = array( - 'name' => $file, - 'path' => $filePath - ); - - // If the file is not encrypted - } else { - - $found['plain'][] = array( - 'name' => $file, - 'path' => $relPath - ); + if(is_resource($handle)) { + while (false !== ($file = readdir($handle))) { + + if ( + $file !== "." + && $file !== ".." + ) { + + $filePath = $directory . '/' . $this->view->getRelativePath('/' . $file); + $relPath = \OCA\Encryption\Helper::stripUserFilesPath($filePath); + + // If the path is a directory, search + // its contents + if ($this->view->is_dir($filePath)) { + + $this->findEncFiles($filePath, $found); + + // If the path is a file, determine + // its encryption status + } elseif ($this->view->is_file($filePath)) { + + // Disable proxies again, some- + // where they got re-enabled :/ + \OC_FileProxy::$enabled = false; + + $isEncryptedPath = $this->isEncryptedPath($filePath); + // If the file is encrypted + // NOTE: If the userId is + // empty or not set, file will + // detected as plain + // NOTE: This is inefficient; + // scanning every file like this + // will eat server resources :( + if ( + Keymanager::getFileKey($this->view, $this->userId, $relPath) + && $isEncryptedPath + ) { + + $found['encrypted'][] = array( + 'name' => $file, + 'path' => $filePath + ); + + // If the file uses old + // encryption system + } elseif (Crypt::isLegacyEncryptedContent($isEncryptedPath, $relPath)) { + + $found['legacy'][] = array( + 'name' => $file, + 'path' => $filePath + ); + + // If the file is not encrypted + } else { + + $found['plain'][] = array( + 'name' => $file, + 'path' => $relPath + ); + + } } } } - } \OC_FileProxy::$enabled = true; @@ -508,10 +510,11 @@ class Util { // get the size from filesystem $fullPath = $this->view->getLocalFile($path); - $size = filesize($fullPath); + $size = $this->view->filesize($path); // calculate last chunk nr $lastChunkNr = floor($size / 8192); + $lastChunkSize = $size - ($lastChunkNr * 8192); // open stream $stream = fopen('crypt://' . $path, "r"); @@ -524,7 +527,7 @@ class Util { fseek($stream, $lastChunckPos); // get the content of the last chunk - $lastChunkContent = fread($stream, 8192); + $lastChunkContent = fread($stream, $lastChunkSize); // calc the real file size with the size of the last chunk $realSize = (($lastChunkNr * 6126) + strlen($lastChunkContent)); @@ -1136,6 +1139,11 @@ class Util { // Make sure that a share key is generated for the owner too list($owner, $ownerPath) = $this->getUidAndFilename($filePath); + $pathinfo = pathinfo($ownerPath); + if(array_key_exists('extension', $pathinfo) && $pathinfo['extension'] === 'part') { + $ownerPath = $pathinfo['dirname'] . '/' . $pathinfo['filename']; + } + $userIds = array(); if ($sharingEnabled) { @@ -1289,8 +1297,25 @@ class Util { */ public function getUidAndFilename($path) { + $pathinfo = pathinfo($path); + $partfile = false; + $parentFolder = false; + if (array_key_exists('extension', $pathinfo) && $pathinfo['extension'] === 'part') { + // if the real file exists we check this file + $filePath = $this->userFilesDir . '/' .$pathinfo['dirname'] . '/' . $pathinfo['filename']; + if ($this->view->file_exists($filePath)) { + $pathToCheck = $pathinfo['dirname'] . '/' . $pathinfo['filename']; + } else { // otherwise we look for the parent + $pathToCheck = $pathinfo['dirname']; + $parentFolder = true; + } + $partfile = true; + } else { + $pathToCheck = $path; + } + $view = new \OC\Files\View($this->userFilesDir); - $fileOwnerUid = $view->getOwner($path); + $fileOwnerUid = $view->getOwner($pathToCheck); // handle public access if ($this->isPublic) { @@ -1319,12 +1344,18 @@ class Util { $filename = $path; } else { - - $info = $view->getFileInfo($path); + $info = $view->getFileInfo($pathToCheck); $ownerView = new \OC\Files\View('/' . $fileOwnerUid . '/files'); // Fetch real file path from DB - $filename = $ownerView->getPath($info['fileid']); // TODO: Check that this returns a path without including the user data dir + $filename = $ownerView->getPath($info['fileid']); + if ($parentFolder) { + $filename = $filename . '/'. $pathinfo['filename']; + } + + if ($partfile) { + $filename = $filename . '.' . $pathinfo['extension']; + } } @@ -1333,10 +1364,9 @@ class Util { \OC_Filesystem::normalizePath($filename) ); } - - } + /** * @brief go recursively through a dir and collect all files and sub files. * @param string $dir relative to the users files folder diff --git a/apps/files_external/3rdparty/Dropbox/API.php b/apps/files_external/3rdparty/Dropbox/API.php new file mode 100644 index 0000000000000000000000000000000000000000..8cdce678e1c8101d756cd72d36f4d9fbb49c18df --- /dev/null +++ b/apps/files_external/3rdparty/Dropbox/API.php @@ -0,0 +1,380 @@ +oauth = $oauth; + $this->root = $root; + $this->useSSL = $useSSL; + if (!$this->useSSL) + { + throw new Dropbox_Exception('Dropbox REST API now requires that all requests use SSL'); + } + + } + + /** + * Returns information about the current dropbox account + * + * @return stdclass + */ + public function getAccountInfo() { + + $data = $this->oauth->fetch($this->api_url . 'account/info'); + return json_decode($data['body'],true); + + } + + /** + * Returns a file's contents + * + * @param string $path path + * @param string $root Use this to override the default root path (sandbox/dropbox) + * @return string + */ + public function getFile($path = '', $root = null) { + + if (is_null($root)) $root = $this->root; + $path = str_replace(array('%2F','~'), array('/','%7E'), rawurlencode($path)); + $result = $this->oauth->fetch($this->api_content_url . 'files/' . $root . '/' . ltrim($path,'/')); + return $result['body']; + + } + + /** + * Uploads a new file + * + * @param string $path Target path (including filename) + * @param string $file Either a path to a file or a stream resource + * @param string $root Use this to override the default root path (sandbox/dropbox) + * @return bool + */ + public function putFile($path, $file, $root = null) { + + $directory = dirname($path); + $filename = basename($path); + + if($directory==='.') $directory = ''; + $directory = str_replace(array('%2F','~'), array('/','%7E'), rawurlencode($directory)); +// $filename = str_replace('~', '%7E', rawurlencode($filename)); + if (is_null($root)) $root = $this->root; + + if (is_string($file)) { + + $file = fopen($file,'rb'); + + } elseif (!is_resource($file)) { + throw new Dropbox_Exception('File must be a file-resource or a string'); + } + $result=$this->multipartFetch($this->api_content_url . 'files/' . + $root . '/' . trim($directory,'/'), $file, $filename); + + if(!isset($result["httpStatus"]) || $result["httpStatus"] != 200) + throw new Dropbox_Exception("Uploading file to Dropbox failed"); + + return true; + } + + + /** + * Copies a file or directory from one location to another + * + * This method returns the file information of the newly created file. + * + * @param string $from source path + * @param string $to destination path + * @param string $root Use this to override the default root path (sandbox/dropbox) + * @return stdclass + */ + public function copy($from, $to, $root = null) { + + if (is_null($root)) $root = $this->root; + $response = $this->oauth->fetch($this->api_url . 'fileops/copy', array('from_path' => $from, 'to_path' => $to, 'root' => $root), 'POST'); + + return json_decode($response['body'],true); + + } + + /** + * Creates a new folder + * + * This method returns the information from the newly created directory + * + * @param string $path + * @param string $root Use this to override the default root path (sandbox/dropbox) + * @return stdclass + */ + public function createFolder($path, $root = null) { + + if (is_null($root)) $root = $this->root; + + // Making sure the path starts with a / +// $path = '/' . ltrim($path,'/'); + + $response = $this->oauth->fetch($this->api_url . 'fileops/create_folder', array('path' => $path, 'root' => $root),'POST'); + return json_decode($response['body'],true); + + } + + /** + * Deletes a file or folder. + * + * This method will return the metadata information from the deleted file or folder, if successful. + * + * @param string $path Path to new folder + * @param string $root Use this to override the default root path (sandbox/dropbox) + * @return array + */ + public function delete($path, $root = null) { + + if (is_null($root)) $root = $this->root; + $response = $this->oauth->fetch($this->api_url . 'fileops/delete', array('path' => $path, 'root' => $root), 'POST'); + return json_decode($response['body']); + + } + + /** + * Moves a file or directory to a new location + * + * This method returns the information from the newly created directory + * + * @param mixed $from Source path + * @param mixed $to destination path + * @param string $root Use this to override the default root path (sandbox/dropbox) + * @return stdclass + */ + public function move($from, $to, $root = null) { + + if (is_null($root)) $root = $this->root; + $response = $this->oauth->fetch($this->api_url . 'fileops/move', array('from_path' => rawurldecode($from), 'to_path' => rawurldecode($to), 'root' => $root), 'POST'); + + return json_decode($response['body'],true); + + } + + /** + * Returns file and directory information + * + * @param string $path Path to receive information from + * @param bool $list When set to true, this method returns information from all files in a directory. When set to false it will only return infromation from the specified directory. + * @param string $hash If a hash is supplied, this method simply returns true if nothing has changed since the last request. Good for caching. + * @param int $fileLimit Maximum number of file-information to receive + * @param string $root Use this to override the default root path (sandbox/dropbox) + * @return array|true + */ + public function getMetaData($path, $list = true, $hash = null, $fileLimit = null, $root = null) { + + if (is_null($root)) $root = $this->root; + + $args = array( + 'list' => $list, + ); + + if (!is_null($hash)) $args['hash'] = $hash; + if (!is_null($fileLimit)) $args['file_limit'] = $fileLimit; + + $path = str_replace(array('%2F','~'), array('/','%7E'), rawurlencode($path)); + $response = $this->oauth->fetch($this->api_url . 'metadata/' . $root . '/' . ltrim($path,'/'), $args); + + /* 304 is not modified */ + if ($response['httpStatus']==304) { + return true; + } else { + return json_decode($response['body'],true); + } + + } + + /** + * A way of letting you keep up with changes to files and folders in a user's Dropbox. You can periodically call /delta to get a list of "delta entries", which are instructions on how to update your local state to match the server's state. + * + * This method returns the information from the newly created directory + * + * @param string $cursor A string that is used to keep track of your current state. On the next call pass in this value to return delta entries that have been recorded since the cursor was returned. + * @return stdclass + */ + public function delta($cursor) { + + $arg['cursor'] = $cursor; + + $response = $this->oauth->fetch($this->api_url . 'delta', $arg, 'POST'); + return json_decode($response['body'],true); + + } + + /** + * Returns a thumbnail (as a string) for a file path. + * + * @param string $path Path to file + * @param string $size small, medium or large + * @param string $root Use this to override the default root path (sandbox/dropbox) + * @return string + */ + public function getThumbnail($path, $size = 'small', $root = null) { + + if (is_null($root)) $root = $this->root; + $path = str_replace(array('%2F','~'), array('/','%7E'), rawurlencode($path)); + $response = $this->oauth->fetch($this->api_content_url . 'thumbnails/' . $root . '/' . ltrim($path,'/'),array('size' => $size)); + + return $response['body']; + + } + + /** + * This method is used to generate multipart POST requests for file upload + * + * @param string $uri + * @param array $arguments + * @return bool + */ + protected function multipartFetch($uri, $file, $filename) { + + /* random string */ + $boundary = 'R50hrfBj5JYyfR3vF3wR96GPCC9Fd2q2pVMERvEaOE3D8LZTgLLbRpNwXek3'; + + $headers = array( + 'Content-Type' => 'multipart/form-data; boundary=' . $boundary, + ); + + $body="--" . $boundary . "\r\n"; + $body.="Content-Disposition: form-data; name=file; filename=".rawurldecode($filename)."\r\n"; + $body.="Content-type: application/octet-stream\r\n"; + $body.="\r\n"; + $body.=stream_get_contents($file); + $body.="\r\n"; + $body.="--" . $boundary . "--"; + + // Dropbox requires the filename to also be part of the regular arguments, so it becomes + // part of the signature. + $uri.='?file=' . $filename; + + return $this->oauth->fetch($uri, $body, 'POST', $headers); + + } + + + /** + * Search + * + * Returns metadata for all files and folders that match the search query. + * + * @added by: diszo.sasil + * + * @param string $query + * @param string $root Use this to override the default root path (sandbox/dropbox) + * @param string $path + * @return array + */ + public function search($query = '', $root = null, $path = ''){ + if (is_null($root)) $root = $this->root; + if(!empty($path)){ + $path = str_replace(array('%2F','~'), array('/','%7E'), rawurlencode($path)); + } + $response = $this->oauth->fetch($this->api_url . 'search/' . $root . '/' . ltrim($path,'/'),array('query' => $query)); + return json_decode($response['body'],true); + } + + /** + * Creates and returns a shareable link to files or folders. + * + * Note: Links created by the /shares API call expire after thirty days. + * + * @param type $path + * @param type $root + * @return type + */ + public function share($path, $root = null) { + if (is_null($root)) $root = $this->root; + $path = str_replace(array('%2F','~'), array('/','%7E'), rawurlencode($path)); + $response = $this->oauth->fetch($this->api_url. 'shares/'. $root . '/' . ltrim($path, '/'), array(), 'POST'); + return json_decode($response['body'],true); + + } + + /** + * Returns a link directly to a file. + * Similar to /shares. The difference is that this bypasses the Dropbox webserver, used to provide a preview of the file, so that you can effectively stream the contents of your media. + * + * Note: The /media link expires after four hours, allotting enough time to stream files, but not enough to leave a connection open indefinitely. + * + * @param type $path + * @param type $root + * @return type + */ + public function media($path, $root = null) { + + if (is_null($root)) $root = $this->root; + $path = str_replace(array('%2F','~'), array('/','%7E'), rawurlencode($path)); + $response = $this->oauth->fetch($this->api_url. 'media/'. $root . '/' . ltrim($path, '/'), array(), 'POST'); + return json_decode($response['body'],true); + + } + + /** + * Creates and returns a copy_ref to a file. This reference string can be used to copy that file to another user's Dropbox by passing it in as the from_copy_ref parameter on /fileops/copy. + * + * @param type $path + * @param type $root + * @return type + */ + public function copy_ref($path, $root = null) { + + if (is_null($root)) $root = $this->root; + $path = str_replace(array('%2F','~'), array('/','%7E'), rawurlencode($path)); + $response = $this->oauth->fetch($this->api_url. 'copy_ref/'. $root . '/' . ltrim($path, '/')); + return json_decode($response['body'],true); + + } + + +} diff --git a/apps/files_external/3rdparty/Dropbox/Exception.php b/apps/files_external/3rdparty/Dropbox/Exception.php new file mode 100644 index 0000000000000000000000000000000000000000..50cbc4c79150e821841cae2cb7383a63d88b2e3b --- /dev/null +++ b/apps/files_external/3rdparty/Dropbox/Exception.php @@ -0,0 +1,15 @@ +oauth_token = $token['token']; + $this->oauth_token_secret = $token['token_secret']; + } else { + $this->oauth_token = $token; + $this->oauth_token_secret = $token_secret; + } + + } + + /** + * Returns the oauth request tokens as an associative array. + * + * The array will contain the elements 'token' and 'token_secret'. + * + * @return array + */ + public function getToken() { + + return array( + 'token' => $this->oauth_token, + 'token_secret' => $this->oauth_token_secret, + ); + + } + + /** + * Returns the authorization url + * + * @param string $callBack Specify a callback url to automatically redirect the user back + * @return string + */ + public function getAuthorizeUrl($callBack = null) { + + // Building the redirect uri + $token = $this->getToken(); + $uri = self::URI_AUTHORIZE . '?oauth_token=' . $token['token']; + if ($callBack) $uri.='&oauth_callback=' . $callBack; + return $uri; + } + + /** + * Fetches a secured oauth url and returns the response body. + * + * @param string $uri + * @param mixed $arguments + * @param string $method + * @param array $httpHeaders + * @return string + */ + public abstract function fetch($uri, $arguments = array(), $method = 'GET', $httpHeaders = array()); + + /** + * Requests the OAuth request token. + * + * @return array + */ + abstract public function getRequestToken(); + + /** + * Requests the OAuth access tokens. + * + * @return array + */ + abstract public function getAccessToken(); + +} diff --git a/apps/files_external/3rdparty/Dropbox/OAuth/Consumer/Dropbox.php b/apps/files_external/3rdparty/Dropbox/OAuth/Consumer/Dropbox.php new file mode 100644 index 0000000000000000000000000000000000000000..204a659de00653ec702cb27fedd7ade19653ddcd --- /dev/null +++ b/apps/files_external/3rdparty/Dropbox/OAuth/Consumer/Dropbox.php @@ -0,0 +1,37 @@ +consumerRequest instanceof HTTP_OAuth_Consumer_Request) { + $this->consumerRequest = new HTTP_OAuth_Consumer_Request; + } + + // TODO: Change this and add in code to validate the SSL cert. + // see https://github.com/bagder/curl/blob/master/lib/mk-ca-bundle.pl + $this->consumerRequest->setConfig(array( + 'ssl_verify_peer' => false, + 'ssl_verify_host' => false + )); + + return $this->consumerRequest; + } +} diff --git a/apps/files_external/3rdparty/Dropbox/OAuth/Curl.php b/apps/files_external/3rdparty/Dropbox/OAuth/Curl.php new file mode 100644 index 0000000000000000000000000000000000000000..b75b27bb3637363910676c04fc1fcd8886b3d7cf --- /dev/null +++ b/apps/files_external/3rdparty/Dropbox/OAuth/Curl.php @@ -0,0 +1,282 @@ +consumerKey = $consumerKey; + $this->consumerSecret = $consumerSecret; + } + + /** + * Fetches a secured oauth url and returns the response body. + * + * @param string $uri + * @param mixed $arguments + * @param string $method + * @param array $httpHeaders + * @return string + */ + public function fetch($uri, $arguments = array(), $method = 'GET', $httpHeaders = array()) { + + $uri=str_replace('http://', 'https://', $uri); // all https, upload makes problems if not + if (is_string($arguments) and strtoupper($method) == 'POST') { + preg_match("/\?file=(.*)$/i", $uri, $matches); + if (isset($matches[1])) { + $uri = str_replace($matches[0], "", $uri); + $filename = $matches[1]; + $httpHeaders=array_merge($httpHeaders,$this->getOAuthHeader($uri, array("file" => $filename), $method)); + } + } else { + $httpHeaders=array_merge($httpHeaders,$this->getOAuthHeader($uri, $arguments, $method)); + } + $ch = curl_init(); + if (strtoupper($method) == 'POST') { + curl_setopt($ch, CURLOPT_URL, $uri); + curl_setopt($ch, CURLOPT_POST, true); +// if (is_array($arguments)) +// $arguments=http_build_query($arguments); + curl_setopt($ch, CURLOPT_POSTFIELDS, $arguments); +// $httpHeaders['Content-Length']=strlen($arguments); + } else { + curl_setopt($ch, CURLOPT_URL, $uri.'?'.http_build_query($arguments)); + curl_setopt($ch, CURLOPT_POST, false); + } + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_TIMEOUT, 300); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); +// curl_setopt($ch, CURLOPT_CAINFO, "rootca"); + curl_setopt($ch, CURLOPT_FRESH_CONNECT, true); + //Build header + $headers = array(); + foreach ($httpHeaders as $name => $value) { + $headers[] = "{$name}: $value"; + } + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + if (!ini_get('safe_mode') && !ini_get('open_basedir')) + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true ); + if (function_exists($this->ProgressFunction) and defined('CURLOPT_PROGRESSFUNCTION')) { + curl_setopt($ch, CURLOPT_NOPROGRESS, false); + curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, $this->ProgressFunction); + curl_setopt($ch, CURLOPT_BUFFERSIZE, 512); + } + $response=curl_exec($ch); + $errorno=curl_errno($ch); + $error=curl_error($ch); + $status=curl_getinfo($ch,CURLINFO_HTTP_CODE); + curl_close($ch); + + + if (!empty($errorno)) + throw new Dropbox_Exception_NotFound('Curl error: ('.$errorno.') '.$error."\n"); + + if ($status>=300) { + $body = json_decode($response,true); + switch ($status) { + // Not modified + case 304 : + return array( + 'httpStatus' => 304, + 'body' => null, + ); + break; + case 403 : + throw new Dropbox_Exception_Forbidden('Forbidden. + This could mean a bad OAuth request, or a file or folder already existing at the target location. + ' . $body["error"] . "\n"); + case 404 : + throw new Dropbox_Exception_NotFound('Resource at uri: ' . $uri . ' could not be found. ' . + $body["error"] . "\n"); + case 507 : + throw new Dropbox_Exception_OverQuota('This dropbox is full. ' . + $body["error"] . "\n"); + } + if (!empty($body["error"])) + throw new Dropbox_Exception_RequestToken('Error: ('.$status.') '.$body["error"]."\n"); + } + + return array( + 'body' => $response, + 'httpStatus' => $status + ); + } + + /** + * Returns named array with oauth parameters for further use + * @return array Array with oauth_ parameters + */ + private function getOAuthBaseParams() { + $params['oauth_version'] = '1.0'; + $params['oauth_signature_method'] = 'HMAC-SHA1'; + + $params['oauth_consumer_key'] = $this->consumerKey; + $tokens = $this->getToken(); + if (isset($tokens['token']) && $tokens['token']) { + $params['oauth_token'] = $tokens['token']; + } + $params['oauth_timestamp'] = time(); + $params['oauth_nonce'] = md5(microtime() . mt_rand()); + return $params; + } + + /** + * Creates valid Authorization header for OAuth, based on URI and Params + * + * @param string $uri + * @param array $params + * @param string $method GET or POST, standard is GET + * @param array $oAuthParams optional, pass your own oauth_params here + * @return array Array for request's headers section like + * array('Authorization' => 'OAuth ...'); + */ + private function getOAuthHeader($uri, $params, $method = 'GET', $oAuthParams = null) { + $oAuthParams = $oAuthParams ? $oAuthParams : $this->getOAuthBaseParams(); + + // create baseString to encode for the sent parameters + $baseString = $method . '&'; + $baseString .= $this->oauth_urlencode($uri) . "&"; + + // OAuth header does not include GET-Parameters + $signatureParams = array_merge($params, $oAuthParams); + + // sorting the parameters + ksort($signatureParams); + + $encodedParams = array(); + foreach ($signatureParams as $key => $value) { + $encodedParams[] = $this->oauth_urlencode($key) . '=' . $this->oauth_urlencode($value); + } + + $baseString .= $this->oauth_urlencode(implode('&', $encodedParams)); + + // encode the signature + $tokens = $this->getToken(); + $hash = $this->hash_hmac_sha1($this->consumerSecret.'&'.$tokens['token_secret'], $baseString); + $signature = base64_encode($hash); + + // add signature to oAuthParams + $oAuthParams['oauth_signature'] = $signature; + + $oAuthEncoded = array(); + foreach ($oAuthParams as $key => $value) { + $oAuthEncoded[] = $key . '="' . $this->oauth_urlencode($value) . '"'; + } + + return array('Authorization' => 'OAuth ' . implode(', ', $oAuthEncoded)); + } + + /** + * Requests the OAuth request token. + * + * @return void + */ + public function getRequestToken() { + $result = $this->fetch(self::URI_REQUEST_TOKEN, array(), 'POST'); + if ($result['httpStatus'] == "200") { + $tokens = array(); + parse_str($result['body'], $tokens); + $this->setToken($tokens['oauth_token'], $tokens['oauth_token_secret']); + return $this->getToken(); + } else { + throw new Dropbox_Exception_RequestToken('We were unable to fetch request tokens. This likely means that your consumer key and/or secret are incorrect.'); + } + } + + /** + * Requests the OAuth access tokens. + * + * This method requires the 'unauthorized' request tokens + * and, if successful will set the authorized request tokens. + * + * @return void + */ + public function getAccessToken() { + $result = $this->fetch(self::URI_ACCESS_TOKEN, array(), 'POST'); + if ($result['httpStatus'] == "200") { + $tokens = array(); + parse_str($result['body'], $tokens); + $this->setToken($tokens['oauth_token'], $tokens['oauth_token_secret']); + return $this->getToken(); + } else { + throw new Dropbox_Exception_RequestToken('We were unable to fetch request tokens. This likely means that your consumer key and/or secret are incorrect.'); + } + } + + /** + * Helper function to properly urlencode parameters. + * See http://php.net/manual/en/function.oauth-urlencode.php + * + * @param string $string + * @return string + */ + private function oauth_urlencode($string) { + return str_replace('%E7', '~', rawurlencode($string)); + } + + /** + * Hash function for hmac_sha1; uses native function if available. + * + * @param string $key + * @param string $data + * @return string + */ + private function hash_hmac_sha1($key, $data) { + if (function_exists('hash_hmac') && in_array('sha1', hash_algos())) { + return hash_hmac('sha1', $data, $key, true); + } else { + $blocksize = 64; + $hashfunc = 'sha1'; + if (strlen($key) > $blocksize) { + $key = pack('H*', $hashfunc($key)); + } + + $key = str_pad($key, $blocksize, chr(0x00)); + $ipad = str_repeat(chr(0x36), $blocksize); + $opad = str_repeat(chr(0x5c), $blocksize); + $hash = pack('H*', $hashfunc(( $key ^ $opad ) . pack('H*', $hashfunc(($key ^ $ipad) . $data)))); + + return $hash; + } + } + + +} \ No newline at end of file diff --git a/apps/files_external/3rdparty/Dropbox/README.md b/apps/files_external/3rdparty/Dropbox/README.md new file mode 100644 index 0000000000000000000000000000000000000000..54e05db762b723c0722edaa57c13080250cb290c --- /dev/null +++ b/apps/files_external/3rdparty/Dropbox/README.md @@ -0,0 +1,31 @@ +Dropbox-php +=========== + +This PHP library allows you to easily integrate dropbox with PHP. + +The following PHP extension is required: + +* json + +The library makes use of OAuth. At the moment you can use either of these libraries: + +[PHP OAuth extension](http://pecl.php.net/package/oauth) +[PEAR's HTTP_OAUTH package](http://pear.php.net/package/http_oauth) + +The extension is recommended, but if you can't install php extensions you should go for the pear package. +Installing +---------- + + pear channel-discover pear.dropbox-php.com + pear install dropbox-php/Dropbox-alpha + +Documentation +------------- +Check out the [documentation](http://www.dropbox-php.com/docs). + +Questions? +---------- + +[Dropbox-php Mailing list](http://groups.google.com/group/dropbox-php) +[Official Dropbox developer forum](http://forums.dropbox.com/forum.php?id=5) + diff --git a/apps/files_external/3rdparty/Dropbox/autoload.php b/apps/files_external/3rdparty/Dropbox/autoload.php new file mode 100644 index 0000000000000000000000000000000000000000..5388ea6334a23a3e318a0e967404cafdd8827f47 --- /dev/null +++ b/apps/files_external/3rdparty/Dropbox/autoload.php @@ -0,0 +1,29 @@ + \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/ProdsConfig.inc.php b/apps/files_external/3rdparty/irodsphp/prods/src/ProdsConfig.inc.php index 478c90d631f20c5281eaf342630ef86168f15308..1089932a3e208200e1cd3f017cd1c651ff87e1ac 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/ProdsConfig.inc.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/ProdsConfig.inc.php @@ -15,5 +15,3 @@ if (file_exists(__DIR__ . "/prods.ini")) { else { $GLOBALS['PRODS_CONFIG'] = array(); } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/ProdsPath.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/ProdsPath.class.php index be7c6c567882b0e45b71391e3305120331e6ff92..fdf100b77a4ba85fa7c1ad2b18605ba6ee27d2f5 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/ProdsPath.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/ProdsPath.class.php @@ -279,5 +279,3 @@ abstract class ProdsPath } } - -?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/ProdsQuery.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/ProdsQuery.class.php index 62469725970100076c712fd0556cb60c23a192b0..5e8dc92d594d8b3ce43767a05dea46c4435f9766 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/ProdsQuery.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/ProdsQuery.class.php @@ -103,5 +103,3 @@ class ProdsQuery } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/ProdsRule.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/ProdsRule.class.php index 42308d9cc35190095f9b637eff2b17f46921a5ee..d14d87ad1aa9aed61948facbf21ae0235c907641 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/ProdsRule.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/ProdsRule.class.php @@ -58,5 +58,3 @@ class ProdsRule return $result; } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/ProdsStreamer.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/ProdsStreamer.class.php index 27b927bb0331ff4b32306a645b6da74ef366c2de..67ef096c5c5be494099d1d5c368eba49fa918762 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/ProdsStreamer.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/ProdsStreamer.class.php @@ -432,5 +432,3 @@ stream_wrapper_register('rods', 'ProdsStreamer') or die ('Failed to register protocol:rods'); stream_wrapper_register('rods+ticket', 'ProdsStreamer') or die ('Failed to register protocol:rods'); -?> - diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSAccount.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSAccount.class.php index f47f85bc238393fbddf2f4dd1cb5b3975c914eb7..ba4c5ad96b053da6bf38001d8398e5f91caaee56 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RODSAccount.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RODSAccount.class.php @@ -199,5 +199,3 @@ class RODSAccount return $dir->toURI(); } } - -?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSConn.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSConn.class.php index 0498f42cfaa7a43821222ee3b0513d58b043d328..c10f880a5cc435da896b161edc6e531751680788 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RODSConn.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RODSConn.class.php @@ -1611,5 +1611,3 @@ class RODSConn return $results; } } - -?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSConnManager.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSConnManager.class.php index 830e01bde8447f97d10a806e589209f939411321..b3e8155da4d60a0927d1fca87da02e8168815826 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RODSConnManager.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RODSConnManager.class.php @@ -77,5 +77,3 @@ class RODSConnManager } } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSException.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSException.class.php index 52eb95bbfb5c3c8f55fa51103b2438f86c9cbd54..97116a102c1ce5e2ae37235b6ce4d4c09de921be 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RODSException.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RODSException.class.php @@ -180,5 +180,3 @@ class RODSException extends Exception } } - -?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueConds.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueConds.class.php index 848f29e85e95c83ad4fc77781f56124f8a066921..4bc10cc549fc4b35e14ef0c385c17ad626e0193c 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueConds.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueConds.class.php @@ -110,5 +110,3 @@ class RODSGenQueConds return $this->cond; } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueResults.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueResults.class.php index 41be1069afd8dc3ecea38280b67565b0e05ff72f..899b4f0e3b40a8d987572e90b378c629d3169a9f 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueResults.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueResults.class.php @@ -95,5 +95,3 @@ class RODSGenQueResults return $this->numrow; } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueSelFlds.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueSelFlds.class.php index 10a32f6614faecbc424127f592ddad10f9b0ca95..aa391613d07c1e4018b86051b3f85cdf63ae741d 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueSelFlds.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueSelFlds.class.php @@ -156,5 +156,3 @@ class RODSGenQueSelFlds } } - -?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSKeyValPair.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSKeyValPair.class.php index 31b720cf19cb419f5bcdd810f0292db7c32ca33c..f347f7c988af2fc7235184fe8548ef05f97a0102 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RODSKeyValPair.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RODSKeyValPair.class.php @@ -46,5 +46,3 @@ class RODSKeyValPair return $new_keyval; } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSMessage.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSMessage.class.php index ca3e8bc23a6055ab34e42c5e5d35a781591088c9..243903a42dfe7d3ca02f97e52cd4cf1a8d180cfb 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RODSMessage.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RODSMessage.class.php @@ -181,5 +181,3 @@ class RODSMessage return $rods_msg->pack(); } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSObjIOOpr.inc.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSObjIOOpr.inc.php index 95807d12ea8d3ba89f4b440ef2265be4d3bfcbef..1d367e900bc955ded06eee80e2219c5f9e5bb151 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RODSObjIOOpr.inc.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RODSObjIOOpr.inc.php @@ -17,4 +17,3 @@ define ("RSYNC_OPR", 14); define ("PHYMV_OPR", 15); define ("PHYMV_SRC", 16); define ("PHYMV_DEST", 17); -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RodsAPINum.inc.php b/apps/files_external/3rdparty/irodsphp/prods/src/RodsAPINum.inc.php index c4e2c031174ecb1589089138cfb6339ca96236d1..258dfcab39d3a3cdc04c8d3197e47055584a3084 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RodsAPINum.inc.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RodsAPINum.inc.php @@ -214,4 +214,3 @@ $GLOBALS['PRODS_API_NUMS_REV'] = array( '1100' => 'SSL_START_AN', '1101' => 'SSL_END_AN', ); -?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RodsConst.inc.php b/apps/files_external/3rdparty/irodsphp/prods/src/RodsConst.inc.php index 1d51f619197a287eacb0de25bc491ffa57254aad..ecc2f5c2593ddf3f2fbd89163e8bb5d296903284 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RodsConst.inc.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RodsConst.inc.php @@ -4,5 +4,3 @@ // are doing! define ("ORDER_BY", 0x400); define ("ORDER_BY_DESC", 0x800); - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RodsErrorTable.inc.php b/apps/files_external/3rdparty/irodsphp/prods/src/RodsErrorTable.inc.php index 7c4bb170d4a631a985f6e5f580055fa863799e26..177ca5b12600fb26b51442f33e40529f3f046330 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RodsErrorTable.inc.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RodsErrorTable.inc.php @@ -584,4 +584,3 @@ $GLOBALS['PRODS_ERR_CODES_REV'] = array( '-993000' => 'PAM_AUTH_PASSWORD_FAILED', '-994000' => 'PAM_AUTH_PASSWORD_INVALID_TTL', ); -?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RodsGenQueryKeyWd.inc.php b/apps/files_external/3rdparty/irodsphp/prods/src/RodsGenQueryKeyWd.inc.php index ff830c6d6aabe1a8da5b35134aaa566f74fb53c6..55ad02e3b82a8e2a915990ab9836a5713ccd0cf3 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RodsGenQueryKeyWd.inc.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RodsGenQueryKeyWd.inc.php @@ -222,4 +222,3 @@ $GLOBALS['PRODS_GENQUE_KEYWD_REV'] = array( "lastExeTime" => 'RULE_LAST_EXE_TIME_KW', "exeStatus" => 'RULE_EXE_STATUS_KW', ); -?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RodsGenQueryNum.inc.php b/apps/files_external/3rdparty/irodsphp/prods/src/RodsGenQueryNum.inc.php index 82de94095b21787a653129cbc5d22b87b92d692d..a65823ec8778569b0e6b3924e44a769fd8425a54 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RodsGenQueryNum.inc.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RodsGenQueryNum.inc.php @@ -232,4 +232,3 @@ $GLOBALS['PRODS_GENQUE_NUMS_REV'] = array( '1105' => 'COL_TOKEN_VALUE3', '1106' => 'COL_TOKEN_COMMENT', ); -?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RODSPacket.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RODSPacket.class.php index 89040882d20f053bb16e827e45d23a4d84cca0b6..e5cff1f60e3adfbf38eaad58db61126b8890207a 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RODSPacket.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RODSPacket.class.php @@ -246,5 +246,3 @@ class RODSPacket } */ } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_BinBytesBuf.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_BinBytesBuf.class.php index 8cabcd0ae423ccc1dd1d431c99d0618d942d314a..a7598bb7e62938e27ba12f877710c00c39ed3cee 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_BinBytesBuf.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_BinBytesBuf.class.php @@ -10,5 +10,3 @@ class RP_BinBytesBuf extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_CollInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_CollInp.class.php index b7ad6fd0cad02dc2f4892da951b38146756f091b..05c51cf56c0caaf9e2b3b0ee99e96cc55c6cc1e9 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_CollInp.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_CollInp.class.php @@ -15,5 +15,3 @@ class RP_CollInp extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_CollOprStat.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_CollOprStat.class.php index 939d2e3759641a1ba07ec22e0a7bb62dcb60890c..a9140050bc7be3c8c1839a19b218878f1cdc4c7f 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_CollOprStat.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_CollOprStat.class.php @@ -13,5 +13,3 @@ class RP_CollOprStat extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_DataObjCopyInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_DataObjCopyInp.class.php index c16b3628f5ebd901905de52e9dbc8816462b391f..481ff34a22ab172f55bcfcb49fc6522bb3159c5c 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_DataObjCopyInp.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_DataObjCopyInp.class.php @@ -15,5 +15,3 @@ class RP_DataObjCopyInp extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_DataObjInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_DataObjInp.class.php index f7a8f939b82d6bfdf5158f7138380e06ae58f777..f6200d1761c6948aa91832e0bc41548d17246a5f 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_DataObjInp.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_DataObjInp.class.php @@ -18,5 +18,3 @@ class RP_DataObjInp extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ExecCmdOut.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ExecCmdOut.class.php index 55dcb02383d12179e423dc53d5733e573ca5d2fd..a7559e3c2566045233826f56e00e657f7c1b44e9 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ExecCmdOut.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ExecCmdOut.class.php @@ -52,5 +52,3 @@ class RP_ExecCmdOut extends RODSPacket } } } - -?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ExecMyRuleInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ExecMyRuleInp.class.php index 88a62fc2b0c6515de6614f285df0f482f1db2384..2eb5dbd6ff95c461a29f3f12a007030b7818599b 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ExecMyRuleInp.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ExecMyRuleInp.class.php @@ -18,5 +18,3 @@ class RP_ExecMyRuleInp extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_GenQueryInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_GenQueryInp.class.php index 2e1e29a2bfeb440c6572c0f7138c5294c518b9b8..cf4bf3406067408a6ef6738589ea6e17e781b76c 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_GenQueryInp.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_GenQueryInp.class.php @@ -21,5 +21,3 @@ class RP_GenQueryInp extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_GenQueryOut.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_GenQueryOut.class.php index e9f31dd5368be60e68382a17add633fb3d1ca11f..afec88c45b16ab4440782601a2f292508164cb73 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_GenQueryOut.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_GenQueryOut.class.php @@ -18,5 +18,3 @@ class RP_GenQueryOut extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_InxIvalPair.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_InxIvalPair.class.php index ac56bc93df8cf67a8cd77638c49efd32a732df33..e8af5c9fc5c8f2e4350e390621e1f5087730acfd 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_InxIvalPair.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_InxIvalPair.class.php @@ -23,5 +23,3 @@ class RP_InxIvalPair extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_InxValPair.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_InxValPair.class.php index 787d27fd1031f5b6e0dab90573c35324b2205fa6..4a08780f4a3415afca1b3909194f6be10ea86b26 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_InxValPair.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_InxValPair.class.php @@ -40,5 +40,3 @@ class RP_InxValPair extends RODSPacket } } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_KeyValPair.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_KeyValPair.class.php index 6d8dd12ff1263577a6796e68bcb9371f9b506ea6..905d88bc8a2191000c4b7adebe782c49c19ab1ac 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_KeyValPair.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_KeyValPair.class.php @@ -43,5 +43,3 @@ class RP_KeyValPair extends RODSPacket } } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MiscSvrInfo.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MiscSvrInfo.class.php index 65ee3580e97043dcb0790448327a14b734e79ab6..4f54c9c4e76ded758adbc8ce73284dd81234eb27 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MiscSvrInfo.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MiscSvrInfo.class.php @@ -13,5 +13,3 @@ class RP_MiscSvrInfo extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ModAVUMetadataInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ModAVUMetadataInp.class.php index b67b7083d44667f65f751e33228fed76099abdb9..467541734dfd2ff1deaf41421223f3df2d80895e 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ModAVUMetadataInp.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ModAVUMetadataInp.class.php @@ -14,5 +14,3 @@ class RP_ModAVUMetadataInp extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MsParam.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MsParam.class.php index abf9bc471bbf0ecee958e4e5dce2d246f916ca7b..fa5d4fcc3dc690d36cf405f7ebd58445b1cb00c0 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MsParam.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MsParam.class.php @@ -41,5 +41,3 @@ class RP_MsParam extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MsParamArray.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MsParamArray.class.php index b747c098dd21d79fd955ce67690c28f18f8311bb..b664abe62bc69da99855c2fbd1b946f8e4ed2a86 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MsParamArray.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MsParamArray.class.php @@ -17,5 +17,3 @@ class RP_MsParamArray extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MsgHeader.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MsgHeader.class.php index 0249da9a05d2f1406620a5d9a4e33ad639c5e3e2..f1b03f779d13b0703f8a60e73011ece66747d161 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MsgHeader.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MsgHeader.class.php @@ -12,6 +12,3 @@ class RP_MsgHeader extends RODSPacket } } - -?> - \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_RHostAddr.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_RHostAddr.class.php index 28602f3150f4d3e62fe282e5fa4a7d26bbbc8018..2ac70dc22cceb6ec611f31047791d7decf2bc31b 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_RHostAddr.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_RHostAddr.class.php @@ -11,5 +11,3 @@ class RP_RHostAddr extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_RodsObjStat.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_RodsObjStat.class.php index 290a4c9a5b0ff5cf0f9409e7362efd615d697e3a..96f427a2de5a2dc2d59be26cfc4eb256ee0fe4bc 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_RodsObjStat.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_RodsObjStat.class.php @@ -16,5 +16,3 @@ class RP_RodsObjStat extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_STR.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_STR.class.php index 3f5a91a35d053e023295a8e89882e4ee7bd550e8..af7739988d4f22164452bd2b7bae6fff9cf510b5 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_STR.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_STR.class.php @@ -10,5 +10,3 @@ class RP_STR extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_SqlResult.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_SqlResult.class.php index 1950f096f1307a7f553ec2f8abd8b75912985336..e6ee1c3adbb6eb0fc81f3ad506e96dac41e6aab1 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_SqlResult.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_SqlResult.class.php @@ -11,5 +11,3 @@ class RP_SqlResult extends RODSPacket } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_StartupPack.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_StartupPack.class.php index a411bd7425b01bf759ed0b9474314a08d2db08a7..700fbd34428c03f26c9066a4d065907c121ee16d 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_StartupPack.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_StartupPack.class.php @@ -14,5 +14,3 @@ class RP_StartupPack extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_TransStat.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_TransStat.class.php index bb591f01343a0eb2031ddf14a867c2dfa0f72b37..5c962649df0f627efc1949b15fa9be7f709e70bd 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_TransStat.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_TransStat.class.php @@ -12,5 +12,3 @@ class RP_TransStat extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_Version.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_Version.class.php index a08cb6cc24c6340206aee7149cf394ae0e81a6bf..9fa9b7d1c3517b7b5d75f99e7c21867a0b2321d0 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_Version.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_Version.class.php @@ -12,5 +12,3 @@ class RP_Version extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_authRequestOut.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_authRequestOut.class.php index 9dc87140635980e9f515f8b5fce6569a3d305feb..a702650c0eb4259a7d6a221c63e1483db7c05274 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_authRequestOut.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_authRequestOut.class.php @@ -10,5 +10,3 @@ class RP_authRequestOut extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_authResponseInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_authResponseInp.class.php index 23d754df0acff8989bacd99fabf0115191d14393..3f9cbc618f7e5087ffdfa2a9fa7a1df97923a2bc 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_authResponseInp.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_authResponseInp.class.php @@ -10,5 +10,3 @@ class RP_authResponseInp extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_dataObjCloseInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_dataObjCloseInp.class.php index d16e1b3f3a44b4472b76b2d530a8c71c94fdc3c7..d37afe23c9539065240b09b0fb9c466eb1d4e9ad 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_dataObjCloseInp.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_dataObjCloseInp.class.php @@ -12,5 +12,3 @@ class RP_dataObjCloseInp extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_dataObjReadInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_dataObjReadInp.class.php index 29bd1b68e35577025c0b14cb3ee754b3a1a06175..31b12354714e90907ae2f61a424584c635f7afb8 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_dataObjReadInp.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_dataObjReadInp.class.php @@ -12,5 +12,3 @@ class RP_dataObjReadInp extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_dataObjWriteInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_dataObjWriteInp.class.php index 5327d7a8932a9daec965efcf4e4f5cb63f51b311..175b7e834029c6d9260fe14e946d80f8479eb528 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_dataObjWriteInp.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_dataObjWriteInp.class.php @@ -12,5 +12,3 @@ class RP_dataObjWriteInp extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_fileLseekInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_fileLseekInp.class.php index e28a7b3b49870fd96c45375d5343a73218200855..83b77f4704fce5d802c57e0ab7e8ad8abc987436 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_fileLseekInp.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_fileLseekInp.class.php @@ -12,5 +12,3 @@ class RP_fileLseekInp extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_fileLseekOut.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_fileLseekOut.class.php index cf01741bea605e0de73404a94dafe21850320127..45811e7ca68e8c2ef1e39ddfd25682ef5ed419b2 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_fileLseekOut.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_fileLseekOut.class.php @@ -11,5 +11,3 @@ class RP_fileLseekOut extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_getTempPasswordOut.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_getTempPasswordOut.class.php index ba073e979398e85e6359dff6d39b72a34348bc29..29c1001df68c27dbd47ec7117602f63a8be1cc69 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_getTempPasswordOut.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_getTempPasswordOut.class.php @@ -10,5 +10,3 @@ class RP_getTempPasswordOut extends RODSPacket } } - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_pamAuthRequestInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_pamAuthRequestInp.class.php index 0bbc2334a827738875ed43033d0247bd01714bce..e42ac918d459d44b1b529cc33cb019c2c8696125 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_pamAuthRequestInp.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_pamAuthRequestInp.class.php @@ -10,4 +10,3 @@ class RP_pamAuthRequestInp extends RODSPacket } } -?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_pamAuthRequestOut.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_pamAuthRequestOut.class.php index 01959954c97f6c5c0e186f25614a37289b9b52cf..b3ec13065569a48d9cfaacf29a08952257fb70ee 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_pamAuthRequestOut.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_pamAuthRequestOut.class.php @@ -10,4 +10,3 @@ class RP_pamAuthRequestOut extends RODSPacket } } -?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_sslEndInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_sslEndInp.class.php index 530f304860442b04aaf180ca23275d24d496232f..26470378a7df6052921bcde2e5e7c279c2594ad7 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_sslEndInp.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_sslEndInp.class.php @@ -10,4 +10,3 @@ class RP_sslEndInp extends RODSPacket } } -?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_sslStartInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_sslStartInp.class.php index 03c8365898e698671b4237f10eb147b434447eb5..a23756e78601cdee8eba1b51aaede158b5443f1b 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_sslStartInp.class.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_sslStartInp.class.php @@ -10,4 +10,3 @@ class RP_sslStartInp extends RODSPacket } } -?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/setRodsAPINum.php b/apps/files_external/3rdparty/irodsphp/prods/src/setRodsAPINum.php index 382a85c051e0866bfb53bcf42a51d4ea97bb62e1..98c1f6cabdfcb18f41a10684dad686d9b11dca7a 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/setRodsAPINum.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/setRodsAPINum.php @@ -66,5 +66,3 @@ $outputstr = $outputstr . ");\n"; $outputstr = $outputstr . "?>\n"; file_put_contents($prods_api_num_file, $outputstr); - -?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/setRodsErrorCodes.php b/apps/files_external/3rdparty/irodsphp/prods/src/setRodsErrorCodes.php index d5c4377384525434aa7e0e42db41bbfe0f1bb841..142b4af57020e47f50661ef4890523ed880a4f2f 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/setRodsErrorCodes.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/setRodsErrorCodes.php @@ -71,5 +71,3 @@ $outputstr = $outputstr . ");\n"; $outputstr = $outputstr . "?>\n"; file_put_contents($prods_error_table_file, $outputstr); - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/setRodsGenQueryKeyWd.php b/apps/files_external/3rdparty/irodsphp/prods/src/setRodsGenQueryKeyWd.php index 4372a849aac0703523a714795572d995dad19d08..5a5968d25af99bd62a510b71876c575badd46dfa 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/setRodsGenQueryKeyWd.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/setRodsGenQueryKeyWd.php @@ -69,5 +69,3 @@ $outputstr = $outputstr . ");\n"; $outputstr = $outputstr . "?>\n"; file_put_contents($prods_genque_keywd_file, $outputstr); - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/setRodsGenQueryNum.php b/apps/files_external/3rdparty/irodsphp/prods/src/setRodsGenQueryNum.php index 03fa051f092a4ef70c18484b8e0092eec151e0ca..0be297826e642dfa234e0c654e20fd57696963f5 100644 --- a/apps/files_external/3rdparty/irodsphp/prods/src/setRodsGenQueryNum.php +++ b/apps/files_external/3rdparty/irodsphp/prods/src/setRodsGenQueryNum.php @@ -59,5 +59,3 @@ $outputstr = $outputstr . ");\n"; $outputstr = $outputstr . "?>\n"; file_put_contents($prods_genque_num_file, $outputstr); - -?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/smb4php/smb.php b/apps/files_external/3rdparty/smb4php/smb.php new file mode 100644 index 0000000000000000000000000000000000000000..e7d1dfa09fec9ba8f42c3ba1f0290191231fd472 --- /dev/null +++ b/apps/files_external/3rdparty/smb4php/smb.php @@ -0,0 +1,484 @@ + +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +################################################################### + +define ('SMB4PHP_VERSION', '0.8'); + +################################################################### +# CONFIGURATION SECTION - Change for your needs +################################################################### + +define ('SMB4PHP_SMBCLIENT', 'smbclient'); +define ('SMB4PHP_SMBOPTIONS', 'TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192'); +define ('SMB4PHP_AUTHMODE', 'arg'); # set to 'env' to use USER enviroment variable + +################################################################### +# SMB - commands that does not need an instance +################################################################### + +$GLOBALS['__smb_cache'] = array ('stat' => array (), 'dir' => array ()); + +class smb { + + function parse_url ($url) { + $pu = parse_url (trim($url)); + foreach (array ('domain', 'user', 'pass', 'host', 'port', 'path') as $i) { + if (! isset($pu[$i])) { + $pu[$i] = ''; + } + } + if (count ($userdomain = explode (';', urldecode ($pu['user']))) > 1) { + @list ($pu['domain'], $pu['user']) = $userdomain; + } + $path = preg_replace (array ('/^\//', '/\/$/'), '', urldecode ($pu['path'])); + list ($pu['share'], $pu['path']) = (preg_match ('/^([^\/]+)\/(.*)/', $path, $regs)) + ? array ($regs[1], preg_replace ('/\//', '\\', $regs[2])) + : array ($path, ''); + $pu['type'] = $pu['path'] ? 'path' : ($pu['share'] ? 'share' : ($pu['host'] ? 'host' : '**error**')); + if (! ($pu['port'] = intval(@$pu['port']))) { + $pu['port'] = 139; + } + + // decode user and password + $pu['user'] = urldecode($pu['user']); + $pu['pass'] = urldecode($pu['pass']); + return $pu; + } + + + function look ($purl) { + return smb::client ('-L ' . escapeshellarg ($purl['host']), $purl); + } + + + function execute ($command, $purl) { + return smb::client ('-d 0 ' + . escapeshellarg ('//' . $purl['host'] . '/' . $purl['share']) + . ' -c ' . escapeshellarg ($command), $purl + ); + } + + function client ($params, $purl) { + + static $regexp = array ( + '^added interface ip=(.*) bcast=(.*) nmask=(.*)$' => 'skip', + 'Anonymous login successful' => 'skip', + '^Domain=\[(.*)\] OS=\[(.*)\] Server=\[(.*)\]$' => 'skip', + '^\tSharename[ ]+Type[ ]+Comment$' => 'shares', + '^\t---------[ ]+----[ ]+-------$' => 'skip', + '^\tServer [ ]+Comment$' => 'servers', + '^\t---------[ ]+-------$' => 'skip', + '^\tWorkgroup[ ]+Master$' => 'workg', + '^\t(.*)[ ]+(Disk|IPC)[ ]+IPC.*$' => 'skip', + '^\tIPC\\\$(.*)[ ]+IPC' => 'skip', + '^\t(.*)[ ]+(Disk)[ ]+(.*)$' => 'share', + '^\t(.*)[ ]+(Printer)[ ]+(.*)$' => 'skip', + '([0-9]+) blocks of size ([0-9]+)\. ([0-9]+) blocks available' => 'skip', + 'Got a positive name query response from ' => 'skip', + '^(session setup failed): (.*)$' => 'error', + '^(.*): ERRSRV - ERRbadpw' => 'error', + '^Error returning browse list: (.*)$' => 'error', + '^tree connect failed: (.*)$' => 'error', + '^(Connection to .* failed)(.*)$' => 'error-connect', + '^NT_STATUS_(.*) ' => 'error', + '^NT_STATUS_(.*)\$' => 'error', + 'ERRDOS - ERRbadpath \((.*).\)' => 'error', + 'cd (.*): (.*)$' => 'error', + '^cd (.*): NT_STATUS_(.*)' => 'error', + '^\t(.*)$' => 'srvorwg', + '^([0-9]+)[ ]+([0-9]+)[ ]+(.*)$' => 'skip', + '^Job ([0-9]+) cancelled' => 'skip', + '^[ ]+(.*)[ ]+([0-9]+)[ ]+(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[ ](Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[ ]+([0-9]+)[ ]+([0-9]{2}:[0-9]{2}:[0-9]{2})[ ]([0-9]{4})$' => 'files', + '^message start: ERRSRV - (ERRmsgoff)' => 'error' + ); + + if (SMB4PHP_AUTHMODE == 'env') { + putenv("USER={$purl['user']}%{$purl['pass']}"); + $auth = ''; + } else { + $auth = ($purl['user'] <> '' ? (' -U ' . escapeshellarg ($purl['user'] . '%' . $purl['pass'])) : ''); + } + if ($purl['domain'] <> '') { + $auth .= ' -W ' . escapeshellarg ($purl['domain']); + } + $port = ($purl['port'] <> 139 ? ' -p ' . escapeshellarg ($purl['port']) : ''); + $options = '-O ' . escapeshellarg(SMB4PHP_SMBOPTIONS); + + // this put env is necessary to read the output of smbclient correctly + $old_locale = getenv('LC_ALL'); + putenv('LC_ALL=en_US.UTF-8'); + $output = popen (SMB4PHP_SMBCLIENT." -N {$auth} {$options} {$port} {$options} {$params} 2>/dev/null", 'r'); + $info = array (); + $info['info']= array (); + $mode = ''; + while ($line = fgets ($output, 4096)) { + list ($tag, $regs, $i) = array ('skip', array (), array ()); + reset ($regexp); + foreach ($regexp as $r => $t) if (preg_match ('/'.$r.'/', $line, $regs)) { + $tag = $t; + break; + } + switch ($tag) { + case 'skip': continue; + case 'shares': $mode = 'shares'; break; + case 'servers': $mode = 'servers'; break; + case 'workg': $mode = 'workgroups'; break; + case 'share': + list($name, $type) = array ( + trim(substr($line, 1, 15)), + trim(strtolower(substr($line, 17, 10))) + ); + $i = ($type <> 'disk' && preg_match('/^(.*) Disk/', $line, $regs)) + ? array(trim($regs[1]), 'disk') + : array($name, 'disk'); + break; + case 'srvorwg': + list ($name, $master) = array ( + strtolower(trim(substr($line,1,21))), + strtolower(trim(substr($line, 22))) + ); + $i = ($mode == 'servers') ? array ($name, "server") : array ($name, "workgroup", $master); + break; + case 'files': + list ($attr, $name) = preg_match ("/^(.*)[ ]+([D|A|H|S|R]+)$/", trim ($regs[1]), $regs2) + ? array (trim ($regs2[2]), trim ($regs2[1])) + : array ('', trim ($regs[1])); + list ($his, $im) = array ( + explode(':', $regs[6]), 1 + strpos("JanFebMarAprMayJunJulAugSepOctNovDec", $regs[4]) / 3); + $i = ($name <> '.' && $name <> '..') + ? array ( + $name, + (strpos($attr,'D') === FALSE) ? 'file' : 'folder', + 'attr' => $attr, + 'size' => intval($regs[2]), + 'time' => mktime ($his[0], $his[1], $his[2], $im, $regs[5], $regs[7]) + ) + : array(); + break; + case 'error': + if(substr($regs[0],0,22)=='NT_STATUS_NO_SUCH_FILE'){ + return false; + }elseif(substr($regs[0],0,31)=='NT_STATUS_OBJECT_NAME_COLLISION'){ + return false; + }elseif(substr($regs[0],0,31)=='NT_STATUS_OBJECT_PATH_NOT_FOUND'){ + return false; + }elseif(substr($regs[0],0,29)=='NT_STATUS_FILE_IS_A_DIRECTORY'){ + return false; + } + trigger_error($regs[0].' params('.$params.')', E_USER_ERROR); + case 'error-connect': + return false; + } + if ($i) switch ($i[1]) { + case 'file': + case 'folder': $info['info'][$i[0]] = $i; + case 'disk': + case 'server': + case 'workgroup': $info[$i[1]][] = $i[0]; + } + } + pclose($output); + + + // restore previous locale + if ($old_locale===false) { + putenv('LC_ALL'); + } else { + putenv('LC_ALL='.$old_locale); + } + + return $info; + } + + + # stats + + function url_stat ($url, $flags = STREAM_URL_STAT_LINK) { + if ($s = smb::getstatcache($url)) { + return $s; + } + list ($stat, $pu) = array (false, smb::parse_url ($url)); + switch ($pu['type']) { + case 'host': + if ($o = smb::look ($pu)) + $stat = stat ("/tmp"); + else + trigger_error ("url_stat(): list failed for host '{$pu['host']}'", E_USER_WARNING); + break; + case 'share': + if ($o = smb::look ($pu)) { + $found = FALSE; + $lshare = strtolower ($pu['share']); # fix by Eric Leung + foreach ($o['disk'] as $s) if ($lshare == strtolower($s)) { + $found = TRUE; + $stat = stat ("/tmp"); + break; + } + if (! $found) + trigger_error ("url_stat(): disk resource '{$lshare}' not found in '{$pu['host']}'", E_USER_WARNING); + } + break; + case 'path': + if ($o = smb::execute ('dir "'.$pu['path'].'"', $pu)) { + $p = explode('\\', $pu['path']); + $name = $p[count($p)-1]; + if (isset ($o['info'][$name])) { + $stat = smb::addstatcache ($url, $o['info'][$name]); + } else { + trigger_error ("url_stat(): path '{$pu['path']}' not found", E_USER_WARNING); + } + } else { + return false; +// trigger_error ("url_stat(): dir failed for path '{$pu['path']}'", E_USER_WARNING); + } + break; + default: trigger_error ('error in URL', E_USER_ERROR); + } + return $stat; + } + + function addstatcache ($url, $info) { + $url = str_replace('//', '/', $url); + $url = rtrim($url, '/'); + global $__smb_cache; + $is_file = (strpos ($info['attr'],'D') === FALSE); + $s = ($is_file) ? stat ('/etc/passwd') : stat ('/tmp'); + $s[7] = $s['size'] = $info['size']; + $s[8] = $s[9] = $s[10] = $s['atime'] = $s['mtime'] = $s['ctime'] = $info['time']; + return $__smb_cache['stat'][$url] = $s; + } + + function getstatcache ($url) { + $url = str_replace('//', '/', $url); + $url = rtrim($url, '/'); + global $__smb_cache; + return isset ($__smb_cache['stat'][$url]) ? $__smb_cache['stat'][$url] : FALSE; + } + + function clearstatcache ($url='') { + $url = str_replace('//', '/', $url); + $url = rtrim($url, '/'); + global $__smb_cache; + if ($url == '') $__smb_cache['stat'] = array (); else unset ($__smb_cache['stat'][$url]); + } + + + # commands + + function unlink ($url) { + $pu = smb::parse_url($url); + if ($pu['type'] <> 'path') trigger_error('unlink(): error in URL', E_USER_ERROR); + smb::clearstatcache ($url); + smb_stream_wrapper::cleardircache (dirname($url)); + return smb::execute ('del "'.$pu['path'].'"', $pu); + } + + function rename ($url_from, $url_to) { + list ($from, $to) = array (smb::parse_url($url_from), smb::parse_url($url_to)); + if ($from['host'] <> $to['host'] || + $from['share'] <> $to['share'] || + $from['user'] <> $to['user'] || + $from['pass'] <> $to['pass'] || + $from['domain'] <> $to['domain']) { + trigger_error('rename(): FROM & TO must be in same server-share-user-pass-domain', E_USER_ERROR); + } + if ($from['type'] <> 'path' || $to['type'] <> 'path') { + trigger_error('rename(): error in URL', E_USER_ERROR); + } + smb::clearstatcache ($url_from); + return smb::execute ('rename "'.$from['path'].'" "'.$to['path'].'"', $to); + } + + function mkdir ($url, $mode, $options) { + $pu = smb::parse_url($url); + if ($pu['type'] <> 'path') trigger_error('mkdir(): error in URL', E_USER_ERROR); + return smb::execute ('mkdir "'.$pu['path'].'"', $pu)!==false; + } + + function rmdir ($url) { + $pu = smb::parse_url($url); + if ($pu['type'] <> 'path') trigger_error('rmdir(): error in URL', E_USER_ERROR); + smb::clearstatcache ($url); + smb_stream_wrapper::cleardircache (dirname($url)); + return smb::execute ('rmdir "'.$pu['path'].'"', $pu)!==false; + } + +} + +################################################################### +# SMB_STREAM_WRAPPER - class to be registered for smb:// URLs +################################################################### + +class smb_stream_wrapper extends smb { + + # variables + + private $stream, $url, $parsed_url = array (), $mode, $tmpfile; + private $need_flush = FALSE; + private $dir = array (), $dir_index = -1; + + + # directories + + function dir_opendir ($url, $options) { + if ($d = $this->getdircache ($url)) { + $this->dir = $d; + $this->dir_index = 0; + return TRUE; + } + $pu = smb::parse_url ($url); + switch ($pu['type']) { + case 'host': + if ($o = smb::look ($pu)) { + $this->dir = $o['disk']; + $this->dir_index = 0; + } else { + trigger_error ("dir_opendir(): list failed for host '{$pu['host']}'", E_USER_WARNING); + return false; + } + break; + case 'share': + case 'path': + if (is_array($o = smb::execute ('dir "'.$pu['path'].'\*"', $pu))) { + $this->dir = array_keys($o['info']); + $this->dir_index = 0; + $this->adddircache ($url, $this->dir); + if(substr($url,-1,1)=='/'){ + $url=substr($url,0,-1); + } + foreach ($o['info'] as $name => $info) { + smb::addstatcache($url . '/' . $name, $info); + } + } else { + trigger_error ("dir_opendir(): dir failed for path '".$pu['path']."'", E_USER_WARNING); + return false; + } + break; + default: + trigger_error ('dir_opendir(): error in URL', E_USER_ERROR); + return false; + } + return TRUE; + } + + function dir_readdir () { + return ($this->dir_index < count($this->dir)) ? $this->dir[$this->dir_index++] : FALSE; + } + + function dir_rewinddir () { $this->dir_index = 0; } + + function dir_closedir () { $this->dir = array(); $this->dir_index = -1; return TRUE; } + + + # cache + + function adddircache ($url, $content) { + $url = str_replace('//', '/', $url); + $url = rtrim($url, '/'); + global $__smb_cache; + return $__smb_cache['dir'][$url] = $content; + } + + function getdircache ($url) { + $url = str_replace('//', '/', $url); + $url = rtrim($url, '/'); + global $__smb_cache; + return isset ($__smb_cache['dir'][$url]) ? $__smb_cache['dir'][$url] : FALSE; + } + + function cleardircache ($url='') { + $url = str_replace('//', '/', $url); + $url = rtrim($url, '/'); + global $__smb_cache; + if ($url == ''){ + $__smb_cache['dir'] = array (); + }else{ + unset ($__smb_cache['dir'][$url]); + } + } + + + # streams + + function stream_open ($url, $mode, $options, $opened_path) { + $this->url = $url; + $this->mode = $mode; + $this->parsed_url = $pu = smb::parse_url($url); + if ($pu['type'] <> 'path') trigger_error('stream_open(): error in URL', E_USER_ERROR); + switch ($mode) { + case 'r': + case 'r+': + case 'rb': + case 'a': + case 'a+': $this->tmpfile = tempnam('/tmp', 'smb.down.'); + smb::execute ('get "'.$pu['path'].'" "'.$this->tmpfile.'"', $pu); + break; + case 'w': + case 'w+': + case 'wb': + case 'x': + case 'x+': $this->cleardircache(); + $this->tmpfile = tempnam('/tmp', 'smb.up.'); + $this->need_flush=true; + } + $this->stream = fopen ($this->tmpfile, $mode); + return TRUE; + } + + function stream_close () { return fclose($this->stream); } + + function stream_read ($count) { return fread($this->stream, $count); } + + function stream_write ($data) { $this->need_flush = TRUE; return fwrite($this->stream, $data); } + + function stream_eof () { return feof($this->stream); } + + function stream_tell () { return ftell($this->stream); } + + function stream_seek ($offset, $whence=null) { return fseek($this->stream, $offset, $whence); } + + function stream_flush () { + if ($this->mode <> 'r' && $this->need_flush) { + smb::clearstatcache ($this->url); + smb::execute ('put "'.$this->tmpfile.'" "'.$this->parsed_url['path'].'"', $this->parsed_url); + $this->need_flush = FALSE; + } + } + + function stream_stat () { return smb::url_stat ($this->url); } + + function __destruct () { + if ($this->tmpfile <> '') { + if ($this->need_flush) $this->stream_flush (); + unlink ($this->tmpfile); + + } + } + +} + +################################################################### +# Register 'smb' protocol ! +################################################################### + +stream_wrapper_register('smb', 'smb_stream_wrapper') + or die ('Failed to register protocol'); diff --git a/apps/files_external/l10n/de_CH.php b/apps/files_external/l10n/de_CH.php new file mode 100644 index 0000000000000000000000000000000000000000..85e2f2d91fdee12e3da8a9d81f259e79acb1c7a5 --- /dev/null +++ b/apps/files_external/l10n/de_CH.php @@ -0,0 +1,28 @@ + "Zugriff gestattet", +"Error configuring Dropbox storage" => "Fehler beim Einrichten von Dropbox", +"Grant access" => "Zugriff gestatten", +"Please provide a valid Dropbox app key and secret." => "Bitte tragen Sie einen gültigen Dropbox-App-Key mit Secret ein.", +"Error configuring Google Drive storage" => "Fehler beim Einrichten von Google Drive", +"Warning: \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "Warnung: «smbclient» ist nicht installiert. Das Einhängen von CIFS/SMB-Freigaben ist nicht möglich. Bitten Sie Ihren Systemadministrator, dies zu installieren.", +"Warning: The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "Warnung:: Die FTP Unterstützung von PHP ist nicht aktiviert oder installiert. Bitte wenden Sie sich an Ihren Systemadministrator.", +"Warning: The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "Achtung: Die Curl-Unterstützung von PHP ist nicht aktiviert oder installiert. Das Laden von ownCloud / WebDAV oder GoogleDrive Freigaben ist nicht möglich. Bitte Sie Ihren Systemadministrator, das Modul zu installieren.", +"External Storage" => "Externer Speicher", +"Folder name" => "Ordnername", +"External storage" => "Externer Speicher", +"Configuration" => "Konfiguration", +"Options" => "Optionen", +"Applicable" => "Zutreffend", +"Add storage" => "Speicher hinzufügen", +"None set" => "Nicht definiert", +"All Users" => "Alle Benutzer", +"Groups" => "Gruppen", +"Users" => "Benutzer", +"Delete" => "Löschen", +"Enable User External Storage" => "Externen Speicher für Benutzer aktivieren", +"Allow users to mount their own external storage" => "Erlaubt Benutzern, ihre eigenen externen Speicher einzubinden", +"SSL root certificates" => "SSL-Root-Zertifikate", +"Import Root Certificate" => "Root-Zertifikate importieren" +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_external/l10n/en_GB.php b/apps/files_external/l10n/en_GB.php new file mode 100644 index 0000000000000000000000000000000000000000..8adca794dda125ab1b6db8f238421070719b3c8e --- /dev/null +++ b/apps/files_external/l10n/en_GB.php @@ -0,0 +1,28 @@ + "Access granted", +"Error configuring Dropbox storage" => "Error configuring Dropbox storage", +"Grant access" => "Grant access", +"Please provide a valid Dropbox app key and secret." => "Please provide a valid Dropbox app key and secret.", +"Error configuring Google Drive storage" => "Error configuring Google Drive storage", +"Warning: \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "Warning: \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it.", +"Warning: The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "Warning: The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it.", +"Warning: The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "Warning: The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it.", +"External Storage" => "External Storage", +"Folder name" => "Folder name", +"External storage" => "External storage", +"Configuration" => "Configuration", +"Options" => "Options", +"Applicable" => "Applicable", +"Add storage" => "Add storage", +"None set" => "None set", +"All Users" => "All Users", +"Groups" => "Groups", +"Users" => "Users", +"Delete" => "Delete", +"Enable User External Storage" => "Enable User External Storage", +"Allow users to mount their own external storage" => "Allow users to mount their own external storage", +"SSL root certificates" => "SSL root certificates", +"Import Root Certificate" => "Import Root Certificate" +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_external/l10n/pa.php b/apps/files_external/l10n/pa.php new file mode 100644 index 0000000000000000000000000000000000000000..d633784f5ce17303420e1d208da83d4746395e0c --- /dev/null +++ b/apps/files_external/l10n/pa.php @@ -0,0 +1,6 @@ + "ਗਰੁੱਪ", +"Delete" => "ਹਟਾਓ" +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php index 2d7bcd4ac376b5d69f15f0899824e7d38fe6fee3..c08a266b48c23d36e897cae68b319af36d4963df 100644 --- a/apps/files_external/lib/amazons3.php +++ b/apps/files_external/lib/amazons3.php @@ -183,17 +183,20 @@ class AmazonS3 extends \OC\Files\Storage\Common { } $dh = $this->opendir($path); - while (($file = readdir($dh)) !== false) { - if ($file === '.' || $file === '..') { - continue; - } - if ($this->is_dir($path . '/' . $file)) { - $this->rmdir($path . '/' . $file); - } else { - $this->unlink($path . '/' . $file); + if(is_resource($dh)) { + while (($file = readdir($dh)) !== false) { + if ($file === '.' || $file === '..') { + continue; + } + + if ($this->is_dir($path . '/' . $file)) { + $this->rmdir($path . '/' . $file); + } else { + $this->unlink($path . '/' . $file); + } } - } + } try { $result = $this->connection->deleteObject(array( @@ -464,15 +467,17 @@ class AmazonS3 extends \OC\Files\Storage\Common { } $dh = $this->opendir($path1); - while (($file = readdir($dh)) !== false) { - if ($file === '.' || $file === '..') { - continue; + if(is_resource($dh)) { + while (($file = readdir($dh)) !== false) { + if ($file === '.' || $file === '..') { + continue; + } + + $source = $path1 . '/' . $file; + $target = $path2 . '/' . $file; + $this->copy($source, $target); } - - $source = $path1 . '/' . $file; - $target = $path2 . '/' . $file; - $this->copy($source, $target); - } + } } return true; diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index 1935740cd2e4a5748c4e1763cf73093885d26c58..659959e662e439fcbd5ca80878fd482b277b4c5f 100755 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -378,7 +378,7 @@ class OC_Mount_Config { } $result = array(); $handle = opendir($path); - if ( ! $handle) { + if(!is_resource($handle)) { return array(); } while (false !== ($file = readdir($handle))) { diff --git a/apps/files_external/lib/dropbox.php b/apps/files_external/lib/dropbox.php index 081c54788814788ba2d7cd63142dbb08ba103543..b6deab6e5a712e93805cc6ad2f97092e82268b05 100755 --- a/apps/files_external/lib/dropbox.php +++ b/apps/files_external/lib/dropbox.php @@ -22,7 +22,7 @@ namespace OC\Files\Storage; -require_once 'Dropbox/autoload.php'; +require_once __DIR__ . '/../3rdparty/Dropbox/autoload.php'; class Dropbox extends \OC\Files\Storage\Common { diff --git a/apps/files_external/lib/google.php b/apps/files_external/lib/google.php index 215bdcda6c2356a645f631eeef2ab10fed746e16..b63b5885de1ac80287c334e3e821b8c8523e7390 100644 --- a/apps/files_external/lib/google.php +++ b/apps/files_external/lib/google.php @@ -206,14 +206,16 @@ class Google extends \OC\Files\Storage\Common { public function rmdir($path) { if (trim($path, '/') === '') { $dir = $this->opendir($path); - while (($file = readdir($dh)) !== false) { - if (!\OC\Files\Filesystem::isIgnoredDir($file)) { - if (!$this->unlink($path.'/'.$file)) { - return false; + if(is_resource($dir)) { + while (($file = readdir($dir)) !== false) { + if (!\OC\Files\Filesystem::isIgnoredDir($file)) { + if (!$this->unlink($path.'/'.$file)) { + return false; + } } } + closedir($dir); } - closedir($dir); $this->driveFiles = array(); return true; } else { diff --git a/apps/files_external/lib/irods.php b/apps/files_external/lib/irods.php index 7ec3b3a0cfc09f32cfcb02aa289a5f73b7386386..6d4f66e856e1a72f0300fca229c7bbf9658cdf60 100644 --- a/apps/files_external/lib/irods.php +++ b/apps/files_external/lib/irods.php @@ -27,12 +27,12 @@ class iRODS extends \OC\Files\Storage\StreamWrapper{ private $auth_mode; public function __construct($params) { - if (isset($params['host']) && isset($params['user']) && isset($params['password'])) { + if (isset($params['host'])) { $this->host = $params['host']; - $this->port = $params['port']; - $this->user = $params['user']; - $this->password = $params['password']; - $this->use_logon_credentials = $params['use_logon_credentials']; + $this->port = isset($params['port']) ? $params['port'] : 1247; + $this->user = isset($params['user']) ? $params['user'] : ''; + $this->password = isset($params['password']) ? $params['password'] : ''; + $this->use_logon_credentials = ($params['use_logon_credentials'] === 'true'); $this->zone = $params['zone']; $this->auth_mode = isset($params['auth_mode']) ? $params['auth_mode'] : ''; @@ -42,10 +42,11 @@ class iRODS extends \OC\Files\Storage\StreamWrapper{ } // take user and password from the session - if ($this->use_logon_credentials && isset($_SESSION['irods-credentials']) ) + if ($this->use_logon_credentials && \OC::$session->exists('irods-credentials')) { - $this->user = $_SESSION['irods-credentials']['uid']; - $this->password = $_SESSION['irods-credentials']['password']; + $params = \OC::$session->get('irods-credentials'); + $this->user = $params['uid']; + $this->password = $params['password']; } //create the root folder if necessary @@ -55,11 +56,11 @@ class iRODS extends \OC\Files\Storage\StreamWrapper{ } else { throw new \Exception(); } - + } public static function login( $params ) { - $_SESSION['irods-credentials'] = $params; + \OC::$session->set('irods-credentials', $params); } public function getId(){ @@ -137,11 +138,13 @@ class iRODS extends \OC\Files\Storage\StreamWrapper{ private function collectionMTime($path) { $dh = $this->opendir($path); $lastCTime = $this->filemtime($path); - while (($file = readdir($dh)) !== false) { - if ($file != '.' and $file != '..') { - $time = $this->filemtime($file); - if ($time > $lastCTime) { - $lastCTime = $time; + if(is_resource($dh)) { + while (($file = readdir($dh)) !== false) { + if ($file != '.' and $file != '..') { + $time = $this->filemtime($file); + if ($time > $lastCTime) { + $lastCTime = $time; + } } } } diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php index dc4e02731f1431ee8a66f6e94457bd7370f0bcf8..ecd4dae04849a19dccd316bb0f11d0e1f9411b78 100644 --- a/apps/files_external/lib/smb.php +++ b/apps/files_external/lib/smb.php @@ -8,7 +8,7 @@ namespace OC\Files\Storage; -require_once 'smb4php/smb.php'; +require_once __DIR__ . '/../3rdparty/smb4php/smb.php'; class SMB extends \OC\Files\Storage\StreamWrapper{ private $password; @@ -99,11 +99,13 @@ class SMB extends \OC\Files\Storage\StreamWrapper{ private function shareMTime() { $dh=$this->opendir(''); $lastCtime=0; - while (($file = readdir($dh)) !== false) { - if ($file!='.' and $file!='..') { - $ctime=$this->filemtime($file); - if ($ctime>$lastCtime) { - $lastCtime=$ctime; + if(is_resource($dh)) { + while (($file = readdir($dh)) !== false) { + if ($file!='.' and $file!='..') { + $ctime=$this->filemtime($file); + if ($ctime>$lastCtime) { + $lastCtime=$ctime; + } } } } diff --git a/apps/files_sharing/ajax/publicpreview.php b/apps/files_sharing/ajax/publicpreview.php new file mode 100644 index 0000000000000000000000000000000000000000..41a1c178a48f64243343c41842cdcadfa64c82e7 --- /dev/null +++ b/apps/files_sharing/ajax/publicpreview.php @@ -0,0 +1,85 @@ +setFile($sharedFile); + $preview->setMaxX($maxX); + $preview->setMaxY($maxY); + $preview->setScalingUp($scalingUp); + + $preview->show(); +} catch (\Exception $e) { + \OC_Response::setStatus(500); + \OC_Log::write('core', $e->getmessage(), \OC_Log::DEBUG); +} \ No newline at end of file diff --git a/apps/files_sharing/appinfo/routes.php b/apps/files_sharing/appinfo/routes.php new file mode 100644 index 0000000000000000000000000000000000000000..02815b5eb42919936c19278333517faf562c1cb1 --- /dev/null +++ b/apps/files_sharing/appinfo/routes.php @@ -0,0 +1,5 @@ +create('core_ajax_public_preview', '/publicpreview.png')->action( +function() { + require_once __DIR__ . '/../ajax/publicpreview.php'; +}); \ No newline at end of file diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 7ffd5e068730ce53eeb76236a3ff38e647dcbfae..67320b1cdb690878d77eb9c408edbade129b70f9 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -7,8 +7,6 @@ function fileDownloadPath(dir, file) { return url; } -var form_data; - $(document).ready(function() { $('#data-upload-form').tipsy({gravity:'ne', fade:true}); @@ -16,7 +14,7 @@ $(document).ready(function() { if (typeof FileActions !== 'undefined') { var mimetype = $('#mimetype').val(); // Show file preview if previewer is available, images are already handled by the template - if (mimetype.substr(0, mimetype.indexOf('/')) != 'image') { + if (mimetype.substr(0, mimetype.indexOf('/')) != 'image' && $('.publicpreview').length === 0) { // Trigger default action if not download TODO var action = FileActions.getDefault(mimetype, 'file', OC.PERMISSION_READ); if (typeof action === 'undefined') { @@ -50,19 +48,23 @@ $(document).ready(function() { }); } - // Add some form data to the upload handler - file_upload_param.formData = { - MAX_FILE_SIZE: $('#uploadMaxFilesize').val(), - requesttoken: $('#publicUploadRequestToken').val(), - dirToken: $('#dirToken').val(), - appname: 'files_sharing', - subdir: $('input#dir').val() - }; + var file_upload_start = $('#file_upload_start'); + file_upload_start.on('fileuploadadd', function(e, data) { + // Add custom data to the upload handler + data.formData = { + requesttoken: $('#publicUploadRequestToken').val(), + dirToken: $('#dirToken').val(), + subdir: $('input#dir').val() + }; + }); - // Add Uploadprogress Wrapper to controls bar - $('#controls').append($('#additional_controls div#uploadprogresswrapper')); + // Add Uploadprogress Wrapper to controls bar + $('#controls').append($('#additional_controls div#uploadprogresswrapper')); - // Cancel upload trigger - $('#cancel_upload_button').click(Files.cancelUploads); + // Cancel upload trigger + $('#cancel_upload_button').click(function() { + OC.Upload.cancelUploads(); + procesSelection(); + }); }); diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index 3be89a39fa0c135fac4d3aeeafeb2efc9382dd0f..03ed02f41ef0cf2557ad13013d24beba03d27e9d 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -4,7 +4,7 @@ $(document).ready(function() { if (typeof OC.Share !== 'undefined' && typeof FileActions !== 'undefined' && !disableSharing) { - $('#fileList').one('fileActionsReady',function(){ + $('#fileList').on('fileActionsReady',function(){ OC.Share.loadIcons('file'); }); diff --git a/apps/files_sharing/l10n/de_CH.php b/apps/files_sharing/l10n/de_CH.php new file mode 100644 index 0000000000000000000000000000000000000000..1bd24f9d9c4bf47ebb1020c2f4a14e3b256a617a --- /dev/null +++ b/apps/files_sharing/l10n/de_CH.php @@ -0,0 +1,19 @@ + "Das Passwort ist falsch. Bitte versuchen Sie es erneut.", +"Password" => "Passwort", +"Submit" => "Bestätigen", +"Sorry, this link doesn’t seem to work anymore." => "Entschuldigung, dieser Link scheint nicht mehr zu funktionieren.", +"Reasons might be:" => "Gründe könnten sein:", +"the item was removed" => "Das Element wurde entfernt", +"the link expired" => "Der Link ist abgelaufen", +"sharing is disabled" => "Teilen ist deaktiviert", +"For more info, please ask the person who sent this link." => "Für mehr Informationen, fragen Sie bitte die Person, die Ihnen diesen Link geschickt hat.", +"%s shared the folder %s with you" => "%s hat den Ordner %s mit Ihnen geteilt", +"%s shared the file %s with you" => "%s hat die Datei %s mit Ihnen geteilt", +"Download" => "Herunterladen", +"Upload" => "Hochladen", +"Cancel upload" => "Upload abbrechen", +"No preview available for" => "Es ist keine Vorschau verfügbar für" +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/en_GB.php b/apps/files_sharing/l10n/en_GB.php new file mode 100644 index 0000000000000000000000000000000000000000..337c108651eb0c793382e950ffb44a557d343857 --- /dev/null +++ b/apps/files_sharing/l10n/en_GB.php @@ -0,0 +1,19 @@ + "The password is wrong. Try again.", +"Password" => "Password", +"Submit" => "Submit", +"Sorry, this link doesn’t seem to work anymore." => "Sorry, this link doesn’t seem to work anymore.", +"Reasons might be:" => "Reasons might be:", +"the item was removed" => "the item was removed", +"the link expired" => "the link expired", +"sharing is disabled" => "sharing is disabled", +"For more info, please ask the person who sent this link." => "For more info, please ask the person who sent this link.", +"%s shared the folder %s with you" => "%s shared the folder %s with you", +"%s shared the file %s with you" => "%s shared the file %s with you", +"Download" => "Download", +"Upload" => "Upload", +"Cancel upload" => "Cancel upload", +"No preview available for" => "No preview available for" +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/es.php b/apps/files_sharing/l10n/es.php index 1f238d083fbdb07945ba2980ee1266b34f71c460..e163da766f34bd0edcb518bea57cacc48e386ba2 100644 --- a/apps/files_sharing/l10n/es.php +++ b/apps/files_sharing/l10n/es.php @@ -3,7 +3,7 @@ $TRANSLATIONS = array( "The password is wrong. Try again." => "La contraseña introducida es errónea. Inténtelo de nuevo.", "Password" => "Contraseña", "Submit" => "Enviar", -"Sorry, this link doesn’t seem to work anymore." => "Este enlace parece no funcionar más.", +"Sorry, this link doesn’t seem to work anymore." => "Vaya, este enlace parece que no volverá a funcionar.", "Reasons might be:" => "Las causas podrían ser:", "the item was removed" => "el elemento fue eliminado", "the link expired" => "el enlace expiró", diff --git a/apps/files_sharing/l10n/es_AR.php b/apps/files_sharing/l10n/es_AR.php index fed0b1e7b30f9b4ed4520296b79b3ca1f23b14bb..7c9dcb94ac19b4f258195d0a8148b595cae5a1a3 100644 --- a/apps/files_sharing/l10n/es_AR.php +++ b/apps/files_sharing/l10n/es_AR.php @@ -3,6 +3,12 @@ $TRANSLATIONS = array( "The password is wrong. Try again." => "La contraseña no es correcta. Probá de nuevo.", "Password" => "Contraseña", "Submit" => "Enviar", +"Sorry, this link doesn’t seem to work anymore." => "Perdón, este enlace parece no funcionar más.", +"Reasons might be:" => "Las causas podrían ser:", +"the item was removed" => "el elemento fue borrado", +"the link expired" => "el enlace expiró", +"sharing is disabled" => "compartir está desactivado", +"For more info, please ask the person who sent this link." => "Para mayor información, contactá a la persona que te mandó el enlace.", "%s shared the folder %s with you" => "%s compartió la carpeta %s con vos", "%s shared the file %s with you" => "%s compartió el archivo %s con vos", "Download" => "Descargar", diff --git a/apps/files_sharing/l10n/fr.php b/apps/files_sharing/l10n/fr.php index b263cd87959d17c21270c8e6b03ff3fea41826a1..c97a1db97e4a2170e7e398841928d84a7b6c8e14 100644 --- a/apps/files_sharing/l10n/fr.php +++ b/apps/files_sharing/l10n/fr.php @@ -3,6 +3,12 @@ $TRANSLATIONS = array( "The password is wrong. Try again." => "Le mot de passe est incorrect. Veuillez réessayer.", "Password" => "Mot de passe", "Submit" => "Envoyer", +"Sorry, this link doesn’t seem to work anymore." => "Désolé, mais le lien semble ne plus fonctionner.", +"Reasons might be:" => "Les raisons peuvent être :", +"the item was removed" => "l'item a été supprimé", +"the link expired" => "le lien a expiré", +"sharing is disabled" => "le partage est désactivé", +"For more info, please ask the person who sent this link." => "Pour plus d'informations, veuillez contacter la personne qui a envoyé ce lien.", "%s shared the folder %s with you" => "%s a partagé le répertoire %s avec vous", "%s shared the file %s with you" => "%s a partagé le fichier %s avec vous", "Download" => "Télécharger", diff --git a/apps/files_sharing/l10n/hi.php b/apps/files_sharing/l10n/hi.php index 74a2c320438158d5d3dfb359556d07927acc09bc..63a5d528f3bcc7b52d844692a503c3cf647e41a0 100644 --- a/apps/files_sharing/l10n/hi.php +++ b/apps/files_sharing/l10n/hi.php @@ -1,5 +1,6 @@ "पासवर्ड" +"Password" => "पासवर्ड", +"Upload" => "अपलोड " ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/ko.php b/apps/files_sharing/l10n/ko.php index f3a94a70979a25676f57553b41abb90b41c48446..f7eab1ac5500c2e6169c33ddeba0f9a0be7a85aa 100644 --- a/apps/files_sharing/l10n/ko.php +++ b/apps/files_sharing/l10n/ko.php @@ -1,7 +1,14 @@ "비밀번호가 틀립니다. 다시 입력해주세요.", "Password" => "암호", "Submit" => "제출", +"Sorry, this link doesn’t seem to work anymore." => "죄송합니다만 이 링크는 더이상 작동되지 않습니다.", +"Reasons might be:" => "이유는 다음과 같을 수 있습니다:", +"the item was removed" => "이 항목은 삭제되었습니다", +"the link expired" => "링크가 만료되었습니다", +"sharing is disabled" => "공유가 비활성되었습니다", +"For more info, please ask the person who sent this link." => "더 자세한 설명은 링크를 보내신 분에게 여쭤보십시오", "%s shared the folder %s with you" => "%s 님이 폴더 %s을(를) 공유하였습니다", "%s shared the file %s with you" => "%s 님이 파일 %s을(를) 공유하였습니다", "Download" => "다운로드", diff --git a/apps/files_sharing/l10n/lt_LT.php b/apps/files_sharing/l10n/lt_LT.php index 5d0e58e2fb295dc0023bd474c08b839542cb5aca..90ae6a39a074378f25e6ae33d84cc8079bd58d21 100644 --- a/apps/files_sharing/l10n/lt_LT.php +++ b/apps/files_sharing/l10n/lt_LT.php @@ -1,7 +1,14 @@ "Netinka slaptažodis: Bandykite dar kartą.", "Password" => "Slaptažodis", "Submit" => "Išsaugoti", +"Sorry, this link doesn’t seem to work anymore." => "Atleiskite, panašu, kad nuoroda yra neveiksni.", +"Reasons might be:" => "Galimos priežastys:", +"the item was removed" => "elementas buvo pašalintas", +"the link expired" => "baigėsi nuorodos galiojimo laikas", +"sharing is disabled" => "dalinimasis yra išjungtas", +"For more info, please ask the person who sent this link." => "Dėl tikslesnės informacijos susisiekite su asmeniu atsiuntusiu nuorodą.", "%s shared the folder %s with you" => "%s pasidalino su jumis %s aplanku", "%s shared the file %s with you" => "%s pasidalino su jumis %s failu", "Download" => "Atsisiųsti", diff --git a/apps/files_sharing/l10n/nn_NO.php b/apps/files_sharing/l10n/nn_NO.php index bcb6538b09f22b1a6b880ff63f8eec2b56239185..94272943e40b9606c30a56bd7226363d307379cc 100644 --- a/apps/files_sharing/l10n/nn_NO.php +++ b/apps/files_sharing/l10n/nn_NO.php @@ -1,7 +1,14 @@ "Passordet er gale. Prøv igjen.", "Password" => "Passord", "Submit" => "Send", +"Sorry, this link doesn’t seem to work anymore." => "Orsak, denne lenkja fungerer visst ikkje lenger.", +"Reasons might be:" => "Moglege grunnar:", +"the item was removed" => "fila/mappa er fjerna", +"the link expired" => "lenkja har gått ut på dato", +"sharing is disabled" => "deling er slått av", +"For more info, please ask the person who sent this link." => "Spør den som sende deg lenkje om du vil ha meir informasjon.", "%s shared the folder %s with you" => "%s delte mappa %s med deg", "%s shared the file %s with you" => "%s delte fila %s med deg", "Download" => "Last ned", diff --git a/apps/files_sharing/l10n/pa.php b/apps/files_sharing/l10n/pa.php new file mode 100644 index 0000000000000000000000000000000000000000..6c14eda59df9ebcf295c54e2b5dcaf5634f59884 --- /dev/null +++ b/apps/files_sharing/l10n/pa.php @@ -0,0 +1,8 @@ + "ਪਾਸਵਰ", +"Download" => "ਡਾਊਨਲੋਡ", +"Upload" => "ਅੱਪਲੋਡ", +"Cancel upload" => "ਅੱਪਲੋਡ ਰੱਦ ਕਰੋ" +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/sq.php b/apps/files_sharing/l10n/sq.php index ae29e5738ffdd8f67c3ad72b96a497e55cf09907..d2077663e8d7bef61be1aa4a445f6623226492d1 100644 --- a/apps/files_sharing/l10n/sq.php +++ b/apps/files_sharing/l10n/sq.php @@ -1,7 +1,14 @@ "Kodi është i gabuar. Provojeni përsëri.", "Password" => "Kodi", "Submit" => "Parashtro", +"Sorry, this link doesn’t seem to work anymore." => "Ju kërkojmë ndjesë, kjo lidhje duket sikur nuk punon më.", +"Reasons might be:" => "Arsyet mund të jenë:", +"the item was removed" => "elementi është eliminuar", +"the link expired" => "lidhja ka skaduar", +"sharing is disabled" => "ndarja është çaktivizuar", +"For more info, please ask the person who sent this link." => "Për më shumë informacione, ju lutem pyesni personin që iu dërgoi këtë lidhje.", "%s shared the folder %s with you" => "%s ndau me ju dosjen %s", "%s shared the file %s with you" => "%s ndau me ju skedarin %s", "Download" => "Shkarko", diff --git a/apps/files_sharing/l10n/zh_TW.php b/apps/files_sharing/l10n/zh_TW.php index 56d67ea7ce71f7c22f1f092e40549d7da4ace4f8..5cc33fd3830c5c7eadeea8b63947e246e2500d54 100644 --- a/apps/files_sharing/l10n/zh_TW.php +++ b/apps/files_sharing/l10n/zh_TW.php @@ -1,9 +1,9 @@ "請檢查您的密碼並再試一次。", +"The password is wrong. Try again." => "請檢查您的密碼並再試一次", "Password" => "密碼", "Submit" => "送出", -"Sorry, this link doesn’t seem to work anymore." => "抱歉,這連結看來已經不能用了。", +"Sorry, this link doesn’t seem to work anymore." => "抱歉,此連結已經失效", "Reasons might be:" => "可能的原因:", "the item was removed" => "項目已經移除", "the link expired" => "連結過期", diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php index 33cd14288998bed926760e3b7baba6953db6f9b0..123268e240afee61b59c179df4166e631a9d6eaa 100644 --- a/apps/files_sharing/lib/cache.php +++ b/apps/files_sharing/lib/cache.php @@ -20,6 +20,7 @@ */ namespace OC\Files\Cache; +use OCP\Share_Backend_Collection; /** * Metadata cache for shared files @@ -226,7 +227,36 @@ class Shared_Cache extends Cache { * @return array of file data */ public function search($pattern) { - // TODO + + // normalize pattern + $pattern = $this->normalize($pattern); + + $ids = $this->getAll(); + + $files = array(); + + // divide into 1k chunks + $chunks = array_chunk($ids, 1000); + + foreach ($chunks as $chunk) { + $placeholders = join(',', array_fill(0, count($chunk), '?')); + + $sql = 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, + `encrypted`, `unencrypted_size`, `etag` + FROM `*PREFIX*filecache` WHERE `name` LIKE ? AND `fileid` IN (' . $placeholders . ')'; + + $result = \OC_DB::executeAudited($sql, array_merge(array($pattern), $chunk)); + + while ($row = $result->fetchRow()) { + if (substr($row['path'], 0, 6)==='files/') { + $row['path'] = substr($row['path'],6); // remove 'files/' from path as it's relative to '/Shared' + } + $row['mimetype'] = $this->getMimetype($row['mimetype']); + $row['mimepart'] = $this->getMimetype($row['mimepart']); + $files[] = $row; + } + } + return $files; } /** @@ -244,13 +274,30 @@ class Shared_Cache extends Cache { } $mimetype = $this->getMimetypeId($mimetype); $ids = $this->getAll(); - $placeholders = join(',', array_fill(0, count($ids), '?')); - $query = \OC_DB::prepare(' - SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `encrypted` - FROM `*PREFIX*filecache` WHERE ' . $where . ' AND `fileid` IN (' . $placeholders . ')' - ); - $result = $query->execute(array_merge(array($mimetype), $ids)); - return $result->fetchAll(); + + $files = array(); + + // divide into 1k chunks + $chunks = array_chunk($ids, 1000); + + foreach ($chunks as $chunk) { + $placeholders = join(',', array_fill(0, count($ids), '?')); + $sql = 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, + `encrypted`, `unencrypted_size`, `etag` + FROM `*PREFIX*filecache` WHERE ' . $where . ' AND `fileid` IN (' . $placeholders . ')'; + + $result = \OC_DB::executeAudited($sql, array_merge(array($mimetype), $chunk)); + + while ($row = $result->fetchRow()) { + if (substr($row['path'], 0, 6)==='files/') { + $row['path'] = substr($row['path'],6); // remove 'files/' from path as it's relative to '/Shared' + } + $row['mimetype'] = $this->getMimetype($row['mimetype']); + $row['mimepart'] = $this->getMimetype($row['mimepart']); + $files[] = $row; + } + } + return $files; } /** @@ -272,7 +319,20 @@ class Shared_Cache extends Cache { * @return int[] */ public function getAll() { - return \OCP\Share::getItemsSharedWith('file', \OC_Share_Backend_File::FORMAT_GET_ALL); + $ids = \OCP\Share::getItemsSharedWith('file', \OC_Share_Backend_File::FORMAT_GET_ALL); + $folderBackend = \OCP\Share::getBackend('folder'); + if ($folderBackend instanceof Share_Backend_Collection) { + foreach ($ids as $file) { + /** @var $folderBackend Share_Backend_Collection */ + $children = $folderBackend->getChildren($file); + foreach ($children as $child) { + $ids[] = (int)$child['source']; + } + + } + } + + return $ids; } /** diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php index 7384b094cb04dd74049f4394ce5429622a85c1e2..257da89c84e52e3a68ae27d4282109301b461563 100644 --- a/apps/files_sharing/lib/sharedstorage.php +++ b/apps/files_sharing/lib/sharedstorage.php @@ -221,7 +221,8 @@ class Shared extends \OC\Files\Storage\Common { public function filemtime($path) { if ($path == '' || $path == '/') { $mtime = 0; - if ($dh = $this->opendir($path)) { + $dh = $this->opendir($path); + if(is_resource($dh)) { while (($filename = readdir($dh)) !== false) { $tempmtime = $this->filemtime($filename); if ($tempmtime > $mtime) { @@ -362,9 +363,13 @@ class Shared extends \OC\Files\Storage\Common { case 'xb': case 'a': case 'ab': - if (!$this->isUpdatable($path)) { - return false; - } + $exists = $this->file_exists($path); + if ($exists && !$this->isUpdatable($path)) { + return false; + } + if (!$exists && !$this->isCreatable(dirname($path))) { + return false; + } } $info = array( 'target' => $this->sharedFolder.$path, diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php index e9fdf6e4c9514aae2a7f3c27a856b75e86ff4e61..eff38dcc0fd5fce37baf3d39ae3206381d1cfdfa 100644 --- a/apps/files_sharing/public.php +++ b/apps/files_sharing/public.php @@ -19,6 +19,20 @@ function fileCmp($a, $b) { } } +function determineIcon($file, $sharingRoot, $sharingToken) { + // for folders we simply reuse the files logic + if($file['type'] == 'dir') { + return \OCA\Files\Helper::determineIcon($file); + } + + $relativePath = substr($file['path'], 6); + $relativePath = substr($relativePath, strlen($sharingRoot)); + if($file['isPreviewAvailable']) { + return OCP\publicPreview_icon($relativePath, $sharingToken); + } + return OCP\mimetype_icon($file['mimetype']); +} + if (isset($_GET['t'])) { $token = $_GET['t']; $linkItem = OCP\Share::getShareByToken($token); @@ -133,6 +147,7 @@ if (isset($path)) { $tmpl->assign('mimetype', \OC\Files\Filesystem::getMimeType($path)); $tmpl->assign('fileTarget', basename($linkItem['file_target'])); $tmpl->assign('dirToken', $linkItem['token']); + $tmpl->assign('disableSharing', true); $allowPublicUploadEnabled = (bool) ($linkItem['permissions'] & OCP\PERMISSION_CREATE); if (\OCP\App::isEnabled('files_encryption')) { $allowPublicUploadEnabled = false; @@ -155,6 +170,7 @@ if (isset($path)) { $tmpl->assign('dir', $getPath); OCP\Util::addStyle('files', 'files'); + OCP\Util::addStyle('files', 'upload'); OCP\Util::addScript('files', 'files'); OCP\Util::addScript('files', 'filelist'); OCP\Util::addscript('files', 'keyboardshortcuts'); @@ -172,9 +188,11 @@ if (isset($path)) { } else { $i['extension'] = ''; } + $i['isPreviewAvailable'] = \OC::$server->getPreviewManager()->isMimeSupported($i['mimetype']); } $i['directory'] = $getPath; $i['permissions'] = OCP\PERMISSION_READ; + $i['icon'] = determineIcon($i, $basePath, $token); $files[] = $i; } usort($files, "fileCmp"); @@ -190,10 +208,12 @@ if (isset($path)) { } $list = new OCP\Template('files', 'part.list', ''); $list->assign('files', $files); - $list->assign('disableSharing', true); $list->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path='); $list->assign('downloadURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path='); + $list->assign('isPublic', true); + $list->assign('sharingtoken', $token); + $list->assign('sharingroot', $basePath); $breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', ''); $breadcrumbNav->assign('breadcrumb', $breadcrumb); $breadcrumbNav->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path='); diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index 746a715f3cc3d95d6e523c348399e49ae9ab3684..c164b3ea2b791f214ffd4ce5326dcd08b18a54f1 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -79,6 +79,10 @@
+ +
+ +
  • diff --git a/apps/files_trashbin/ajax/list.php b/apps/files_trashbin/ajax/list.php new file mode 100644 index 0000000000000000000000000000000000000000..c9dc13b7840ba650d32cddf8f6afa330e6dabcf9 --- /dev/null +++ b/apps/files_trashbin/ajax/list.php @@ -0,0 +1,51 @@ +assign('breadcrumb', $breadcrumb, false); + $breadcrumbNav->assign('baseURL', OCP\Util::linkTo('files_trashbin', 'index.php') . '?dir='); + $breadcrumbNav->assign('home', OCP\Util::linkTo('files', 'index.php')); + + $data['breadcrumb'] = $breadcrumbNav->fetchPage(); +} + +// make filelist +$files = \OCA\Files_Trashbin\Helper::getTrashFiles($dir); + +if ($files === null){ + header("HTTP/1.0 404 Not Found"); + exit(); +} + +$dirlisting = false; +if ($dir && $dir !== '/') { + $dirlisting = true; +} + +$encodedDir = \OCP\Util::encodePath($dir); +$list = new OCP\Template('files_trashbin', 'part.list', ''); +$list->assign('files', $files, false); +$list->assign('baseURL', OCP\Util::linkTo('files_trashbin', 'index.php'). '?dir='.$encodedDir); +$list->assign('downloadURL', OCP\Util::linkToRoute('download', array('file' => '/'))); +$list->assign('dirlisting', $dirlisting); +$list->assign('disableDownloadActions', true); +$data['files'] = $list->fetchPage(); + +OCP\JSON::success(array('data' => $data)); + diff --git a/apps/files_trashbin/ajax/preview.php b/apps/files_trashbin/ajax/preview.php new file mode 100644 index 0000000000000000000000000000000000000000..a0846b051c7217ff270ae88ad9a9258330a1be88 --- /dev/null +++ b/apps/files_trashbin/ajax/preview.php @@ -0,0 +1,42 @@ +setFile($file); + $preview->setMaxX($maxX); + $preview->setMaxY($maxY); + $preview->setScalingUp($scalingUp); + + $preview->showPreview(); +}catch(\Exception $e) { + \OC_Response::setStatus(500); + \OC_Log::write('core', $e->getmessage(), \OC_Log::DEBUG); +} \ No newline at end of file diff --git a/apps/files_trashbin/appinfo/app.php b/apps/files_trashbin/appinfo/app.php index 2c101f0a723b18cbb0890d9271c51b712719a62a..d30a601ef564c0282fdbed5715cf62f394cd114d 100644 --- a/apps/files_trashbin/appinfo/app.php +++ b/apps/files_trashbin/appinfo/app.php @@ -1,7 +1,7 @@ create('core_ajax_trashbin_preview', '/preview.png')->action( +function() { + require_once __DIR__ . '/../ajax/preview.php'; +}); \ No newline at end of file diff --git a/apps/files_trashbin/index.php b/apps/files_trashbin/index.php index 27f8407db0641c13d5e803db502b62071f54b6df..d8661e170a58cd69ebde886cb0fa92192969916f 100644 --- a/apps/files_trashbin/index.php +++ b/apps/files_trashbin/index.php @@ -10,90 +10,52 @@ OCP\Util::addScript('files_trashbin', 'disableDefaultActions'); OCP\Util::addScript('files', 'fileactions'); $tmpl = new OCP\Template('files_trashbin', 'index', 'user'); -$user = \OCP\User::getUser(); -$view = new OC_Filesystemview('/'.$user.'/files_trashbin/files'); - OCP\Util::addStyle('files', 'files'); OCP\Util::addScript('files', 'filelist'); +// filelist overrides +OCP\Util::addScript('files_trashbin', 'filelist'); +OCP\Util::addscript('files', 'files'); $dir = isset($_GET['dir']) ? stripslashes($_GET['dir']) : ''; -$result = array(); -if ($dir) { - $dirlisting = true; - $dirContent = $view->opendir($dir); - $i = 0; - while(($entryName = readdir($dirContent)) !== false) { - if (!\OC\Files\Filesystem::isIgnoredDir($entryName)) { - $pos = strpos($dir.'/', '/', 1); - $tmp = substr($dir, 0, $pos); - $pos = strrpos($tmp, '.d'); - $timestamp = substr($tmp, $pos+2); - $result[] = array( - 'id' => $entryName, - 'timestamp' => $timestamp, - 'mime' => $view->getMimeType($dir.'/'.$entryName), - 'type' => $view->is_dir($dir.'/'.$entryName) ? 'dir' : 'file', - 'location' => $dir, - ); - } - } - closedir($dirContent); - -} else { - $dirlisting = false; - $query = \OC_DB::prepare('SELECT `id`,`location`,`timestamp`,`type`,`mime` FROM `*PREFIX*files_trash` WHERE `user` = ?'); - $result = $query->execute(array($user))->fetchAll(); +$isIE8 = false; +preg_match('/MSIE (.*?);/', $_SERVER['HTTP_USER_AGENT'], $matches); +if (count($matches) > 0 && $matches[1] <= 8){ + $isIE8 = true; } -$files = array(); -foreach ($result as $r) { - $i = array(); - $i['name'] = $r['id']; - $i['date'] = OCP\Util::formatDate($r['timestamp']); - $i['timestamp'] = $r['timestamp']; - $i['mimetype'] = $r['mime']; - $i['type'] = $r['type']; - if ($i['type'] === 'file') { - $fileinfo = pathinfo($r['id']); - $i['basename'] = $fileinfo['filename']; - $i['extension'] = isset($fileinfo['extension']) ? ('.'.$fileinfo['extension']) : ''; +// if IE8 and "?dir=path" was specified, reformat the URL to use a hash like "#?dir=path" +if ($isIE8 && isset($_GET['dir'])){ + if ($dir === ''){ + $dir = '/'; } - $i['directory'] = $r['location']; - if ($i['directory'] === '/') { - $i['directory'] = ''; - } - $i['permissions'] = OCP\PERMISSION_READ; - $files[] = $i; + header('Location: ' . OCP\Util::linkTo('files_trashbin', 'index.php') . '#?dir=' . \OCP\Util::encodePath($dir)); + exit(); } -function fileCmp($a, $b) { - if ($a['type'] === 'dir' and $b['type'] !== 'dir') { - return -1; - } elseif ($a['type'] !== 'dir' and $b['type'] === 'dir') { - return 1; - } else { - return strnatcasecmp($a['name'], $b['name']); - } +$ajaxLoad = false; + +if (!$isIE8){ + $files = \OCA\Files_Trashbin\Helper::getTrashFiles($dir); +} +else{ + $files = array(); + $ajaxLoad = true; } -usort($files, "fileCmp"); - -// Make breadcrumb -$pathtohere = ''; -$breadcrumb = array(); -foreach (explode('/', $dir) as $i) { - if ($i !== '') { - if ( preg_match('/^(.+)\.d[0-9]+$/', $i, $match) ) { - $name = $match[1]; - } else { - $name = $i; - } - $pathtohere .= '/' . $i; - $breadcrumb[] = array('dir' => $pathtohere, 'name' => $name); - } +// Redirect if directory does not exist +if ($files === null){ + header('Location: ' . OCP\Util::linkTo('files_trashbin', 'index.php')); + exit(); } +$dirlisting = false; +if ($dir && $dir !== '/') { + $dirlisting = true; +} + +$breadcrumb = \OCA\Files_Trashbin\Helper::makeBreadcrumb($dir); + $breadcrumbNav = new OCP\Template('files_trashbin', 'part.breadcrumb', ''); $breadcrumbNav->assign('breadcrumb', $breadcrumb); $breadcrumbNav->assign('baseURL', OCP\Util::linkTo('files_trashbin', 'index.php') . '?dir='); @@ -105,7 +67,6 @@ $list->assign('files', $files); $encodedDir = \OCP\Util::encodePath($dir); $list->assign('baseURL', OCP\Util::linkTo('files_trashbin', 'index.php'). '?dir='.$encodedDir); $list->assign('downloadURL', OCP\Util::linkTo('files_trashbin', 'download.php') . '?file='.$encodedDir); -$list->assign('disableSharing', true); $list->assign('dirlisting', $dirlisting); $list->assign('disableDownloadActions', true); @@ -113,6 +74,8 @@ $tmpl->assign('dirlisting', $dirlisting); $tmpl->assign('breadcrumb', $breadcrumbNav->fetchPage()); $tmpl->assign('fileList', $list->fetchPage()); $tmpl->assign('files', $files); -$tmpl->assign('dir', \OC\Files\Filesystem::normalizePath($view->getAbsolutePath())); +$tmpl->assign('dir', $dir); +$tmpl->assign('disableSharing', true); +$tmpl->assign('ajaxLoad', true); $tmpl->printPage(); diff --git a/apps/files_trashbin/js/filelist.js b/apps/files_trashbin/js/filelist.js new file mode 100644 index 0000000000000000000000000000000000000000..cd5a67ddfe002d502d013074b1baf496a948cbbf --- /dev/null +++ b/apps/files_trashbin/js/filelist.js @@ -0,0 +1,24 @@ +// override reload with own ajax call +FileList.reload = function(){ + FileList.showMask(); + if (FileList._reloadCall){ + FileList._reloadCall.abort(); + } + $.ajax({ + url: OC.filePath('files_trashbin','ajax','list.php'), + data: { + dir : $('#dir').val(), + breadcrumb: true + }, + error: function(result) { + FileList.reloadCallback(result); + }, + success: function(result) { + FileList.reloadCallback(result); + } + }); +} + +FileList.linkTo = function(dir){ + return OC.linkTo('files_trashbin', 'index.php')+"?dir="+ encodeURIComponent(dir).replace(/%2F/g, '/'); +} diff --git a/apps/files_trashbin/js/trash.js b/apps/files_trashbin/js/trash.js index b14a7240cbe5d0c211b9665492d302136b8e6428..d73eadb6011d40ac73797b617e4e26bb493e5c45 100644 --- a/apps/files_trashbin/js/trash.js +++ b/apps/files_trashbin/js/trash.js @@ -20,6 +20,7 @@ $(document).ready(function() { OC.dialogs.alert(result.data.message, t('core', 'Error')); } enableActions(); + FileList.updateFileSummary(); }); }); @@ -48,6 +49,7 @@ $(document).ready(function() { OC.dialogs.alert(result.data.message, t('core', 'Error')); } enableActions(); + FileList.updateFileSummary(); }); }); @@ -169,9 +171,15 @@ $(document).ready(function() { action(filename); } } + + // event handlers for breadcrumb items + $('#controls').delegate('.crumb:not(.home) a', 'click', onClickBreadcrumb); }); - FileActions.actions.dir = {}; + FileActions.actions.dir = { + // only keep 'Open' action for navigation + 'Open': FileActions.actions.dir.Open + }; }); function processSelection(){ @@ -244,3 +252,9 @@ function disableActions() { $(".action").css("display", "none"); $(":input:checkbox").css("display", "none"); } +function onClickBreadcrumb(e){ + var $el = $(e.target).closest('.crumb'); + e.preventDefault(); + FileList.changeDirectory(decodeURIComponent($el.data('dir'))); +} + diff --git a/apps/files_trashbin/l10n/ach.php b/apps/files_trashbin/l10n/ach.php new file mode 100644 index 0000000000000000000000000000000000000000..5569f410cc96d23883a8b3d3d0a58dc4e0f51f6a --- /dev/null +++ b/apps/files_trashbin/l10n/ach.php @@ -0,0 +1,6 @@ + array("",""), +"_%n file_::_%n files_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/apps/files_trashbin/l10n/af_ZA.php b/apps/files_trashbin/l10n/af_ZA.php new file mode 100644 index 0000000000000000000000000000000000000000..0acad00e8b58f9aeba594f70d8957213bf899c9a --- /dev/null +++ b/apps/files_trashbin/l10n/af_ZA.php @@ -0,0 +1,6 @@ + array("",""), +"_%n file_::_%n files_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_trashbin/l10n/be.php b/apps/files_trashbin/l10n/be.php new file mode 100644 index 0000000000000000000000000000000000000000..50df7ff5a972ed321c03533ed72e520d7d3a496c --- /dev/null +++ b/apps/files_trashbin/l10n/be.php @@ -0,0 +1,6 @@ + array("","","",""), +"_%n file_::_%n files_" => array("","","","") +); +$PLURAL_FORMS = "nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/apps/files_trashbin/l10n/bs.php b/apps/files_trashbin/l10n/bs.php new file mode 100644 index 0000000000000000000000000000000000000000..af7033bd1832e7243ab3e19486a21727eeedb32d --- /dev/null +++ b/apps/files_trashbin/l10n/bs.php @@ -0,0 +1,7 @@ + "Ime", +"_%n folder_::_%n folders_" => array("","",""), +"_%n file_::_%n files_" => array("","","") +); +$PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/apps/files_trashbin/l10n/de_AT.php b/apps/files_trashbin/l10n/de_AT.php new file mode 100644 index 0000000000000000000000000000000000000000..0acad00e8b58f9aeba594f70d8957213bf899c9a --- /dev/null +++ b/apps/files_trashbin/l10n/de_AT.php @@ -0,0 +1,6 @@ + array("",""), +"_%n file_::_%n files_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_trashbin/l10n/de_CH.php b/apps/files_trashbin/l10n/de_CH.php new file mode 100644 index 0000000000000000000000000000000000000000..92290a0de50f438389d010a038c8e65392bb1ede --- /dev/null +++ b/apps/files_trashbin/l10n/de_CH.php @@ -0,0 +1,19 @@ + "Konnte %s nicht dauerhaft löschen", +"Couldn't restore %s" => "Konnte %s nicht wiederherstellen", +"perform restore operation" => "Wiederherstellung ausführen", +"Error" => "Fehler", +"delete file permanently" => "Datei dauerhaft löschen", +"Delete permanently" => "Endgültig löschen", +"Name" => "Name", +"Deleted" => "Gelöscht", +"_%n folder_::_%n folders_" => array("%n Ordner","%n Ordner"), +"_%n file_::_%n files_" => array("%n Datei","%n Dateien"), +"restored" => "Wiederhergestellt", +"Nothing in here. Your trash bin is empty!" => "Nichts zu löschen, Ihr Papierkorb ist leer!", +"Restore" => "Wiederherstellen", +"Delete" => "Löschen", +"Deleted Files" => "Gelöschte Dateien" +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_trashbin/l10n/el.php b/apps/files_trashbin/l10n/el.php index 759e5299e4200c58acca5df8a0801e1d5f2f5ba8..939c7fed6143e7879254bf7f1ec9eece441fd298 100644 --- a/apps/files_trashbin/l10n/el.php +++ b/apps/files_trashbin/l10n/el.php @@ -8,8 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Μόνιμη διαγραφή", "Name" => "Όνομα", "Deleted" => "Διαγράφηκε", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), +"_%n folder_::_%n folders_" => array("","%n φάκελοι"), +"_%n file_::_%n files_" => array("","%n αρχεία"), "restored" => "έγινε επαναφορά", "Nothing in here. Your trash bin is empty!" => "Δεν υπάρχει τίποτα εδώ. Ο κάδος σας είναι άδειος!", "Restore" => "Επαναφορά", diff --git a/apps/files_trashbin/l10n/en@pirate.php b/apps/files_trashbin/l10n/en@pirate.php new file mode 100644 index 0000000000000000000000000000000000000000..0acad00e8b58f9aeba594f70d8957213bf899c9a --- /dev/null +++ b/apps/files_trashbin/l10n/en@pirate.php @@ -0,0 +1,6 @@ + array("",""), +"_%n file_::_%n files_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_trashbin/l10n/en_GB.php b/apps/files_trashbin/l10n/en_GB.php new file mode 100644 index 0000000000000000000000000000000000000000..be9d8b9f520dca6890f1bcf6f4d2cb94282e8113 --- /dev/null +++ b/apps/files_trashbin/l10n/en_GB.php @@ -0,0 +1,19 @@ + "Couldn't delete %s permanently", +"Couldn't restore %s" => "Couldn't restore %s", +"perform restore operation" => "perform restore operation", +"Error" => "Error", +"delete file permanently" => "delete file permanently", +"Delete permanently" => "Delete permanently", +"Name" => "Name", +"Deleted" => "Deleted", +"_%n folder_::_%n folders_" => array("%n folder","%n folders"), +"_%n file_::_%n files_" => array("%n file","%n files"), +"restored" => "restored", +"Nothing in here. Your trash bin is empty!" => "Nothing in here. Your recycle bin is empty!", +"Restore" => "Restore", +"Delete" => "Delete", +"Deleted Files" => "Deleted Files" +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_trashbin/l10n/es.php b/apps/files_trashbin/l10n/es.php index 956d89ae6880d44befddef8290d8ea46c3947562..a5639c2c71454d6d1e5aa4210b4b94acec21b7c6 100644 --- a/apps/files_trashbin/l10n/es.php +++ b/apps/files_trashbin/l10n/es.php @@ -8,8 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Eliminar permanentemente", "Name" => "Nombre", "Deleted" => "Eliminado", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), +"_%n folder_::_%n folders_" => array("%n carpeta","%n carpetas"), +"_%n file_::_%n files_" => array("%n archivo","%n archivos"), "restored" => "recuperado", "Nothing in here. Your trash bin is empty!" => "No hay nada aquí. ¡Tu papelera esta vacía!", "Restore" => "Recuperar", diff --git a/apps/files_trashbin/l10n/es_AR.php b/apps/files_trashbin/l10n/es_AR.php index 6f47255b50652bf06c450dc91f35bfc8df1d7385..0cb969a3483b4f1ce7c83aabfe6f6867510bacdd 100644 --- a/apps/files_trashbin/l10n/es_AR.php +++ b/apps/files_trashbin/l10n/es_AR.php @@ -8,8 +8,9 @@ $TRANSLATIONS = array( "Delete permanently" => "Borrar de manera permanente", "Name" => "Nombre", "Deleted" => "Borrado", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), +"_%n folder_::_%n folders_" => array("%n directorio","%n directorios"), +"_%n file_::_%n files_" => array("%n archivo","%n archivos"), +"restored" => "recuperado", "Nothing in here. Your trash bin is empty!" => "No hay nada acá. ¡La papelera está vacía!", "Restore" => "Recuperar", "Delete" => "Borrar", diff --git a/apps/files_trashbin/l10n/es_MX.php b/apps/files_trashbin/l10n/es_MX.php new file mode 100644 index 0000000000000000000000000000000000000000..0acad00e8b58f9aeba594f70d8957213bf899c9a --- /dev/null +++ b/apps/files_trashbin/l10n/es_MX.php @@ -0,0 +1,6 @@ + array("",""), +"_%n file_::_%n files_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_trashbin/l10n/fr.php b/apps/files_trashbin/l10n/fr.php index 8854190e2ceb7827bc8d7e26ea85b96bbecad34f..45527805ce1af23c00193da2c838a7cfb3d50f3a 100644 --- a/apps/files_trashbin/l10n/fr.php +++ b/apps/files_trashbin/l10n/fr.php @@ -8,8 +8,9 @@ $TRANSLATIONS = array( "Delete permanently" => "Supprimer de façon définitive", "Name" => "Nom", "Deleted" => "Effacé", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), +"_%n folder_::_%n folders_" => array("","%n dossiers"), +"_%n file_::_%n files_" => array("","%n fichiers"), +"restored" => "restauré", "Nothing in here. Your trash bin is empty!" => "Il n'y a rien ici. Votre corbeille est vide !", "Restore" => "Restaurer", "Delete" => "Supprimer", diff --git a/apps/files_trashbin/l10n/hi.php b/apps/files_trashbin/l10n/hi.php new file mode 100644 index 0000000000000000000000000000000000000000..71711218b14dad40bfa6fafa6987278cdd1b45e0 --- /dev/null +++ b/apps/files_trashbin/l10n/hi.php @@ -0,0 +1,7 @@ + "त्रुटि", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_trashbin/l10n/hu_HU.php b/apps/files_trashbin/l10n/hu_HU.php index aac6cf780001a1b143f0943ce40b8615616ecb2c..766ddcbce4de9dd91d471315cd81f663239091b1 100644 --- a/apps/files_trashbin/l10n/hu_HU.php +++ b/apps/files_trashbin/l10n/hu_HU.php @@ -8,8 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Végleges törlés", "Name" => "Név", "Deleted" => "Törölve", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), +"_%n folder_::_%n folders_" => array("","%n mappa"), +"_%n file_::_%n files_" => array("","%n állomány"), "restored" => "visszaállítva", "Nothing in here. Your trash bin is empty!" => "Itt nincs semmi. Az Ön szemetes mappája üres!", "Restore" => "Visszaállítás", diff --git a/apps/files_trashbin/l10n/ka.php b/apps/files_trashbin/l10n/ka.php new file mode 100644 index 0000000000000000000000000000000000000000..70f10d7c0bf5f12667a902c57aeb1cb8215703ef --- /dev/null +++ b/apps/files_trashbin/l10n/ka.php @@ -0,0 +1,6 @@ + array(""), +"_%n file_::_%n files_" => array("") +); +$PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_trashbin/l10n/km.php b/apps/files_trashbin/l10n/km.php new file mode 100644 index 0000000000000000000000000000000000000000..70f10d7c0bf5f12667a902c57aeb1cb8215703ef --- /dev/null +++ b/apps/files_trashbin/l10n/km.php @@ -0,0 +1,6 @@ + array(""), +"_%n file_::_%n files_" => array("") +); +$PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_trashbin/l10n/kn.php b/apps/files_trashbin/l10n/kn.php new file mode 100644 index 0000000000000000000000000000000000000000..70f10d7c0bf5f12667a902c57aeb1cb8215703ef --- /dev/null +++ b/apps/files_trashbin/l10n/kn.php @@ -0,0 +1,6 @@ + array(""), +"_%n file_::_%n files_" => array("") +); +$PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_trashbin/l10n/ko.php b/apps/files_trashbin/l10n/ko.php index f2e604d75915416e9825bae5b97db30f9f1883a7..9ac5f9802c683671fe3d156e9fb39655fddbcda9 100644 --- a/apps/files_trashbin/l10n/ko.php +++ b/apps/files_trashbin/l10n/ko.php @@ -1,11 +1,19 @@ "%s를 영구적으로 삭제할수 없습니다", +"Couldn't restore %s" => "%s를 복원할수 없습니다", +"perform restore operation" => "복원 작업중", "Error" => "오류", +"delete file permanently" => "영구적으로 파일 삭제하기", "Delete permanently" => "영원히 삭제", "Name" => "이름", -"_%n folder_::_%n folders_" => array(""), -"_%n file_::_%n files_" => array(""), +"Deleted" => "삭제됨", +"_%n folder_::_%n folders_" => array("폴더 %n개"), +"_%n file_::_%n files_" => array("파일 %n개 "), +"restored" => "복원됨", +"Nothing in here. Your trash bin is empty!" => "현재 휴지통은 비어있습니다!", "Restore" => "복원", -"Delete" => "삭제" +"Delete" => "삭제", +"Deleted Files" => "삭제된 파일들" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_trashbin/l10n/lt_LT.php b/apps/files_trashbin/l10n/lt_LT.php index c4a12ff21755aff9c89634d80665430c68699333..0a51290f4d99bf12f2ffea6417eb951179df7efc 100644 --- a/apps/files_trashbin/l10n/lt_LT.php +++ b/apps/files_trashbin/l10n/lt_LT.php @@ -8,8 +8,9 @@ $TRANSLATIONS = array( "Delete permanently" => "Ištrinti negrįžtamai", "Name" => "Pavadinimas", "Deleted" => "Ištrinti", -"_%n folder_::_%n folders_" => array("","",""), -"_%n file_::_%n files_" => array("","",""), +"_%n folder_::_%n folders_" => array("","","%n aplankų"), +"_%n file_::_%n files_" => array("","","%n failų"), +"restored" => "atstatyta", "Nothing in here. Your trash bin is empty!" => "Nieko nėra. Jūsų šiukšliadėžė tuščia!", "Restore" => "Atstatyti", "Delete" => "Ištrinti", diff --git a/apps/files_trashbin/l10n/ml_IN.php b/apps/files_trashbin/l10n/ml_IN.php new file mode 100644 index 0000000000000000000000000000000000000000..0acad00e8b58f9aeba594f70d8957213bf899c9a --- /dev/null +++ b/apps/files_trashbin/l10n/ml_IN.php @@ -0,0 +1,6 @@ + array("",""), +"_%n file_::_%n files_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_trashbin/l10n/my_MM.php b/apps/files_trashbin/l10n/my_MM.php new file mode 100644 index 0000000000000000000000000000000000000000..70f10d7c0bf5f12667a902c57aeb1cb8215703ef --- /dev/null +++ b/apps/files_trashbin/l10n/my_MM.php @@ -0,0 +1,6 @@ + array(""), +"_%n file_::_%n files_" => array("") +); +$PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_trashbin/l10n/ne.php b/apps/files_trashbin/l10n/ne.php new file mode 100644 index 0000000000000000000000000000000000000000..0acad00e8b58f9aeba594f70d8957213bf899c9a --- /dev/null +++ b/apps/files_trashbin/l10n/ne.php @@ -0,0 +1,6 @@ + array("",""), +"_%n file_::_%n files_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_trashbin/l10n/nn_NO.php b/apps/files_trashbin/l10n/nn_NO.php index 9e351668e33626bd279e9638c59a2939bc8a27bf..73fe48211c293719e167c1c4c0f7722cfd0cc735 100644 --- a/apps/files_trashbin/l10n/nn_NO.php +++ b/apps/files_trashbin/l10n/nn_NO.php @@ -8,8 +8,9 @@ $TRANSLATIONS = array( "Delete permanently" => "Slett for godt", "Name" => "Namn", "Deleted" => "Sletta", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), +"_%n folder_::_%n folders_" => array("%n mappe","%n mapper"), +"_%n file_::_%n files_" => array("%n fil","%n filer"), +"restored" => "gjenoppretta", "Nothing in here. Your trash bin is empty!" => "Ingenting her. Papirkorga di er tom!", "Restore" => "Gjenopprett", "Delete" => "Slett", diff --git a/apps/files_trashbin/l10n/nqo.php b/apps/files_trashbin/l10n/nqo.php new file mode 100644 index 0000000000000000000000000000000000000000..70f10d7c0bf5f12667a902c57aeb1cb8215703ef --- /dev/null +++ b/apps/files_trashbin/l10n/nqo.php @@ -0,0 +1,6 @@ + array(""), +"_%n file_::_%n files_" => array("") +); +$PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_trashbin/l10n/pa.php b/apps/files_trashbin/l10n/pa.php new file mode 100644 index 0000000000000000000000000000000000000000..e53707fd7077c2fdcada3484af32c770f87b841f --- /dev/null +++ b/apps/files_trashbin/l10n/pa.php @@ -0,0 +1,8 @@ + "ਗਲਤੀ", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), +"Delete" => "ਹਟਾਓ" +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_trashbin/l10n/pl.php b/apps/files_trashbin/l10n/pl.php index e8295e2ff038bd599cc2962ef918d8a3fac93018..c838a6b956c2e583964dcc186fc9d7ebaac6509b 100644 --- a/apps/files_trashbin/l10n/pl.php +++ b/apps/files_trashbin/l10n/pl.php @@ -8,8 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Trwale usuń", "Name" => "Nazwa", "Deleted" => "Usunięte", -"_%n folder_::_%n folders_" => array("","",""), -"_%n file_::_%n files_" => array("","",""), +"_%n folder_::_%n folders_" => array("","","%n katalogów"), +"_%n file_::_%n files_" => array("","","%n plików"), "restored" => "przywrócony", "Nothing in here. Your trash bin is empty!" => "Nic tu nie ma. Twój kosz jest pusty!", "Restore" => "Przywróć", diff --git a/apps/files_trashbin/l10n/pt_BR.php b/apps/files_trashbin/l10n/pt_BR.php index 1e3c67ba027a48389c527fa45287e80e0b9675eb..e0e8c8faec6b7f87f0e62a6e3557474514fac548 100644 --- a/apps/files_trashbin/l10n/pt_BR.php +++ b/apps/files_trashbin/l10n/pt_BR.php @@ -8,8 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Excluir permanentemente", "Name" => "Nome", "Deleted" => "Excluído", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), +"_%n folder_::_%n folders_" => array("","%n pastas"), +"_%n file_::_%n files_" => array("%n arquivo","%n arquivos"), "restored" => "restaurado", "Nothing in here. Your trash bin is empty!" => "Nada aqui. Sua lixeira está vazia!", "Restore" => "Restaurar", diff --git a/apps/files_trashbin/l10n/pt_PT.php b/apps/files_trashbin/l10n/pt_PT.php index 0c88d132b5cc00eb299bbf25a4c7f1d975071b87..9dccc773cb1adfcb222cb46cab541f9dc7d3e9b4 100644 --- a/apps/files_trashbin/l10n/pt_PT.php +++ b/apps/files_trashbin/l10n/pt_PT.php @@ -8,8 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Eliminar permanentemente", "Name" => "Nome", "Deleted" => "Apagado", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), +"_%n folder_::_%n folders_" => array("%n pasta","%n pastas"), +"_%n file_::_%n files_" => array("%n ficheiro","%n ficheiros"), "restored" => "Restaurado", "Nothing in here. Your trash bin is empty!" => "Não hà ficheiros. O lixo está vazio!", "Restore" => "Restaurar", diff --git a/apps/files_trashbin/l10n/ro.php b/apps/files_trashbin/l10n/ro.php index 0b1d2cd9e179cb5020e2538fd02912daddaced54..12377bb065249cf371c38a6e7730baf988541877 100644 --- a/apps/files_trashbin/l10n/ro.php +++ b/apps/files_trashbin/l10n/ro.php @@ -3,8 +3,8 @@ $TRANSLATIONS = array( "Error" => "Eroare", "Delete permanently" => "Stergere permanenta", "Name" => "Nume", -"_%n folder_::_%n folders_" => array("","",""), -"_%n file_::_%n files_" => array("","",""), +"_%n folder_::_%n folders_" => array("","","%n directoare"), +"_%n file_::_%n files_" => array("","","%n fișiere"), "Delete" => "Șterge" ); $PLURAL_FORMS = "nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));"; diff --git a/apps/files_trashbin/l10n/sk.php b/apps/files_trashbin/l10n/sk.php new file mode 100644 index 0000000000000000000000000000000000000000..94aaf9b3a94937649bf432d87449003038f80c7d --- /dev/null +++ b/apps/files_trashbin/l10n/sk.php @@ -0,0 +1,6 @@ + array("","",""), +"_%n file_::_%n files_" => array("","","") +); +$PLURAL_FORMS = "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"; diff --git a/apps/files_trashbin/l10n/sq.php b/apps/files_trashbin/l10n/sq.php index 1b7b5b828c81e08db327277b77d964d062fd0cfa..50ca7d901b598f10dd6502c22e4e24f955d01f97 100644 --- a/apps/files_trashbin/l10n/sq.php +++ b/apps/files_trashbin/l10n/sq.php @@ -8,8 +8,9 @@ $TRANSLATIONS = array( "Delete permanently" => "Elimino përfundimisht", "Name" => "Emri", "Deleted" => "Eliminuar", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), +"_%n folder_::_%n folders_" => array("%n dosje","%n dosje"), +"_%n file_::_%n files_" => array("%n skedar","%n skedarë"), +"restored" => "rivendosur", "Nothing in here. Your trash bin is empty!" => "Këtu nuk ka asgjë. Koshi juaj është bosh!", "Restore" => "Rivendos", "Delete" => "Elimino", diff --git a/apps/files_trashbin/l10n/sr@latin.php b/apps/files_trashbin/l10n/sr@latin.php index 483d1e3ca2b89bb2451fc108921db95f82bbbdf7..fa30afcf4bf53d8ca8e5c79382df29212513d315 100644 --- a/apps/files_trashbin/l10n/sr@latin.php +++ b/apps/files_trashbin/l10n/sr@latin.php @@ -1,5 +1,6 @@ "Greška", "Name" => "Ime", "_%n folder_::_%n folders_" => array("","",""), "_%n file_::_%n files_" => array("","",""), diff --git a/apps/files_trashbin/l10n/sw_KE.php b/apps/files_trashbin/l10n/sw_KE.php new file mode 100644 index 0000000000000000000000000000000000000000..0acad00e8b58f9aeba594f70d8957213bf899c9a --- /dev/null +++ b/apps/files_trashbin/l10n/sw_KE.php @@ -0,0 +1,6 @@ + array("",""), +"_%n file_::_%n files_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_trashbin/l10n/zh_TW.php b/apps/files_trashbin/l10n/zh_TW.php index 2dfc484fc7faa60b4e95adedb2aa91ec4c8303ce..bfc2fc659de35b74a49a5db6452b28f6004a24ba 100644 --- a/apps/files_trashbin/l10n/zh_TW.php +++ b/apps/files_trashbin/l10n/zh_TW.php @@ -11,7 +11,7 @@ $TRANSLATIONS = array( "_%n folder_::_%n folders_" => array("%n 個資料夾"), "_%n file_::_%n files_" => array("%n 個檔案"), "restored" => "已還原", -"Nothing in here. Your trash bin is empty!" => "您的垃圾桶是空的!", +"Nothing in here. Your trash bin is empty!" => "您的回收桶是空的!", "Restore" => "還原", "Delete" => "刪除", "Deleted Files" => "已刪除的檔案" diff --git a/apps/files_trashbin/lib/helper.php b/apps/files_trashbin/lib/helper.php new file mode 100644 index 0000000000000000000000000000000000000000..4f442ee930471cf39023059c071a79cd53376bf8 --- /dev/null +++ b/apps/files_trashbin/lib/helper.php @@ -0,0 +1,97 @@ +opendir($dir); + if ($dirContent === false){ + return null; + } + if(is_resource($dirContent)){ + while(($entryName = readdir($dirContent)) !== false) { + if (!\OC\Files\Filesystem::isIgnoredDir($entryName)) { + $pos = strpos($dir.'/', '/', 1); + $tmp = substr($dir, 0, $pos); + $pos = strrpos($tmp, '.d'); + $timestamp = substr($tmp, $pos+2); + $result[] = array( + 'id' => $entryName, + 'timestamp' => $timestamp, + 'mime' => $view->getMimeType($dir.'/'.$entryName), + 'type' => $view->is_dir($dir.'/'.$entryName) ? 'dir' : 'file', + 'location' => $dir, + ); + } + } + closedir($dirContent); + } + } else { + $query = \OC_DB::prepare('SELECT `id`,`location`,`timestamp`,`type`,`mime` FROM `*PREFIX*files_trash` WHERE `user` = ?'); + $result = $query->execute(array($user))->fetchAll(); + } + + $files = array(); + foreach ($result as $r) { + $i = array(); + $i['name'] = $r['id']; + $i['date'] = \OCP\Util::formatDate($r['timestamp']); + $i['timestamp'] = $r['timestamp']; + $i['mimetype'] = $r['mime']; + $i['type'] = $r['type']; + if ($i['type'] === 'file') { + $fileinfo = pathinfo($r['id']); + $i['basename'] = $fileinfo['filename']; + $i['extension'] = isset($fileinfo['extension']) ? ('.'.$fileinfo['extension']) : ''; + } + $i['directory'] = $r['location']; + if ($i['directory'] === '/') { + $i['directory'] = ''; + } + $i['permissions'] = \OCP\PERMISSION_READ; + $i['isPreviewAvailable'] = \OC::$server->getPreviewManager()->isMimeSupported($r['mime']); + $i['icon'] = \OCA\Files\Helper::determineIcon($i); + $files[] = $i; + } + + usort($files, array('\OCA\Files\Helper', 'fileCmp')); + + return $files; + } + + /** + * Splits the given path into a breadcrumb structure. + * @param string $dir path to process + * @return array where each entry is a hash of the absolute + * directory path and its name + */ + public static function makeBreadcrumb($dir){ + // Make breadcrumb + $pathtohere = ''; + $breadcrumb = array(); + foreach (explode('/', $dir) as $i) { + if ($i !== '') { + if ( preg_match('/^(.+)\.d[0-9]+$/', $i, $match) ) { + $name = $match[1]; + } else { + $name = $i; + } + $pathtohere .= '/' . $i; + $breadcrumb[] = array('dir' => $pathtohere, 'name' => $name); + } + } + return $breadcrumb; + } +} diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trashbin.php similarity index 99% rename from apps/files_trashbin/lib/trash.php rename to apps/files_trashbin/lib/trashbin.php index 0dcb2fc82e188ef6822ec6c838b72261e79a3199..c79afdc0c2ec91c11a3bd1f968335d0607d77103 100644 --- a/apps/files_trashbin/lib/trash.php +++ b/apps/files_trashbin/lib/trashbin.php @@ -72,11 +72,6 @@ class Trashbin { $mime = $view->getMimeType('files' . $file_path); if ($view->is_dir('files' . $file_path)) { - $dirContent = $view->getDirectoryContent('files' . $file_path); - // no need to move empty folders to the trash bin - if (empty($dirContent)) { - return true; - } $type = 'dir'; } else { $type = 'file'; @@ -909,4 +904,7 @@ class Trashbin { return true; } + public static function preview_icon($path) { + return \OC_Helper::linkToRoute( 'core_ajax_trashbin_preview', array('x' => 36, 'y' => 36, 'file' => urlencode($path) )); + } } diff --git a/apps/files_trashbin/templates/index.php b/apps/files_trashbin/templates/index.php index 371765fa69a658783cef13020e8d8d5d167fe531..82ba0608834c95e6fcdc2632dd694235c90613b7 100644 --- a/apps/files_trashbin/templates/index.php +++ b/apps/files_trashbin/templates/index.php @@ -5,10 +5,14 @@
    - -
    t('Nothing in here. Your trash bin is empty!'))?>
    + +
    t('Nothing in here. Your trash bin is empty!'))?>
    + + + + diff --git a/apps/files_trashbin/templates/part.breadcrumb.php b/apps/files_trashbin/templates/part.breadcrumb.php index 8ecab58e5c809c462580d8e31f28fe3ad393b994..4acc298adbe3c2cdb65e59eb56148f5335e06608 100644 --- a/apps/files_trashbin/templates/part.breadcrumb.php +++ b/apps/files_trashbin/templates/part.breadcrumb.php @@ -1,11 +1,11 @@ -
    +
    '> + data-dir='/'> t("Deleted Files")); ?>
    diff --git a/apps/files_trashbin/templates/part.list.php b/apps/files_trashbin/templates/part.list.php index 254b08dd36a31e39d0a289ef35e7ded6547fa255..78709d986ae32a3e90425d6467e0673a34ecb53d 100644 --- a/apps/files_trashbin/templates/part.list.php +++ b/apps/files_trashbin/templates/part.list.php @@ -1,4 +1,3 @@ - ' id="" - data-file="" + data-file="" data-timestamp='' data-dirlisting=1 @@ -21,11 +20,19 @@ data-timestamp='' data-dirlisting=0 > + +
    style="background-image:url()" - style="background-image:url()" + + style="background-image:url()" + + style="background-image:url()" + > diff --git a/apps/files_versions/l10n/cy_GB.php b/apps/files_versions/l10n/cy_GB.php new file mode 100644 index 0000000000000000000000000000000000000000..fa35dfd5218edd267f6aa125323a6b9d6bc8b6e3 --- /dev/null +++ b/apps/files_versions/l10n/cy_GB.php @@ -0,0 +1,5 @@ + "Adfer" +); +$PLURAL_FORMS = "nplurals=4; plural=(n==1) ? 0 : (n==2) ? 1 : (n != 8 && n != 11) ? 2 : 3;"; diff --git a/apps/files_versions/l10n/de_CH.php b/apps/files_versions/l10n/de_CH.php new file mode 100644 index 0000000000000000000000000000000000000000..c8b45eee5005516a2e916d685cf3f05645efa049 --- /dev/null +++ b/apps/files_versions/l10n/de_CH.php @@ -0,0 +1,10 @@ + "Konnte %s nicht zurücksetzen", +"Versions" => "Versionen", +"Failed to revert {file} to revision {timestamp}." => "Konnte {file} der Revision {timestamp} nicht rückgänging machen.", +"More versions..." => "Mehrere Versionen...", +"No other versions available" => "Keine anderen Versionen verfügbar", +"Restore" => "Wiederherstellen" +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/en_GB.php b/apps/files_versions/l10n/en_GB.php new file mode 100644 index 0000000000000000000000000000000000000000..af22b8fb0b2a54570b2c1be6ed69435cf28356d0 --- /dev/null +++ b/apps/files_versions/l10n/en_GB.php @@ -0,0 +1,10 @@ + "Could not revert: %s", +"Versions" => "Versions", +"Failed to revert {file} to revision {timestamp}." => "Failed to revert {file} to revision {timestamp}.", +"More versions..." => "More versions...", +"No other versions available" => "No other versions available", +"Restore" => "Restore" +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/es.php b/apps/files_versions/l10n/es.php index a6031698e06ba7b0944e638551ddf6f4d12033e8..b7acc3769786c5579c97ca8b81a93170a2b04d78 100644 --- a/apps/files_versions/l10n/es.php +++ b/apps/files_versions/l10n/es.php @@ -3,7 +3,7 @@ $TRANSLATIONS = array( "Could not revert: %s" => "No se puede revertir: %s", "Versions" => "Revisiones", "Failed to revert {file} to revision {timestamp}." => "No se ha podido revertir {archivo} a revisión {timestamp}.", -"More versions..." => "Más...", +"More versions..." => "Más versiones...", "No other versions available" => "No hay otras versiones disponibles", "Restore" => "Recuperar" ); diff --git a/apps/files_versions/l10n/es_AR.php b/apps/files_versions/l10n/es_AR.php index 068f835d0afe84dd2ae43a304ec118eeac5bc18f..3008220122f5365f37c3ae45298de7977c14a8c0 100644 --- a/apps/files_versions/l10n/es_AR.php +++ b/apps/files_versions/l10n/es_AR.php @@ -2,6 +2,9 @@ $TRANSLATIONS = array( "Could not revert: %s" => "No se pudo revertir: %s ", "Versions" => "Versiones", +"Failed to revert {file} to revision {timestamp}." => "Falló al revertir {file} a la revisión {timestamp}.", +"More versions..." => "Más versiones...", +"No other versions available" => "No hay más versiones disponibles", "Restore" => "Recuperar" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/fr.php b/apps/files_versions/l10n/fr.php index 537783e6c9f867a3237f6c764344ac2a74192220..7f3df1bce41c27d13f78c94eda1a1821bb3e128a 100644 --- a/apps/files_versions/l10n/fr.php +++ b/apps/files_versions/l10n/fr.php @@ -2,6 +2,9 @@ $TRANSLATIONS = array( "Could not revert: %s" => "Impossible de restaurer %s", "Versions" => "Versions", +"Failed to revert {file} to revision {timestamp}." => "Échec du retour du fichier {file} à la révision {timestamp}.", +"More versions..." => "Plus de versions...", +"No other versions available" => "Aucune autre version disponible", "Restore" => "Restaurer" ); $PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/apps/files_versions/l10n/ko.php b/apps/files_versions/l10n/ko.php index 365adc25115977ce91d91d504df6e14c398cbf87..ba951c4107a1d68cb5f3988d1f66f45ce90ebd0b 100644 --- a/apps/files_versions/l10n/ko.php +++ b/apps/files_versions/l10n/ko.php @@ -2,6 +2,9 @@ $TRANSLATIONS = array( "Could not revert: %s" => "되돌릴 수 없습니다: %s", "Versions" => "버전", +"Failed to revert {file} to revision {timestamp}." => "{timestamp} 판의 {file}로 돌리는데 실패했습니다.", +"More versions..." => "더 많은 버전들...", +"No other versions available" => "다른 버전을 사용할수 없습니다", "Restore" => "복원" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_versions/l10n/lt_LT.php b/apps/files_versions/l10n/lt_LT.php index 4e1af5fcc29ce58b7c82cb7e2cbba0fc42542b74..3afcfbe3b5f63aa263dce40a7dc9bf0e8a6b8dec 100644 --- a/apps/files_versions/l10n/lt_LT.php +++ b/apps/files_versions/l10n/lt_LT.php @@ -2,6 +2,9 @@ $TRANSLATIONS = array( "Could not revert: %s" => "Nepavyko atstatyti: %s", "Versions" => "Versijos", +"Failed to revert {file} to revision {timestamp}." => "Nepavyko atstatyti {file} į būseną {timestamp}.", +"More versions..." => "Daugiau versijų...", +"No other versions available" => "Nėra daugiau versijų", "Restore" => "Atstatyti" ); $PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/apps/files_versions/l10n/nn_NO.php b/apps/files_versions/l10n/nn_NO.php index 79b518bc18d0ec398ad66195c63640318bccbe32..608d72aaaed6bc5151addb0f0b214c117a98592a 100644 --- a/apps/files_versions/l10n/nn_NO.php +++ b/apps/files_versions/l10n/nn_NO.php @@ -2,6 +2,9 @@ $TRANSLATIONS = array( "Could not revert: %s" => "Klarte ikkje å tilbakestilla: %s", "Versions" => "Utgåver", +"Failed to revert {file} to revision {timestamp}." => "Klarte ikkje å tilbakestilla {file} til utgåva {timestamp}.", +"More versions..." => "Fleire utgåver …", +"No other versions available" => "Ingen andre utgåver tilgjengeleg", "Restore" => "Gjenopprett" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/sq.php b/apps/files_versions/l10n/sq.php new file mode 100644 index 0000000000000000000000000000000000000000..5a7a23a217f91eea40971049f133ff998a635bd4 --- /dev/null +++ b/apps/files_versions/l10n/sq.php @@ -0,0 +1,5 @@ + "Rivendos" +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/user_ldap/l10n/cs_CZ.php b/apps/user_ldap/l10n/cs_CZ.php index 9f4c31c068ba118864cc4b118cd79fce8028ea55..9109a8c710a82e09152ca0ec3a72ebb0940c6b04 100644 --- a/apps/user_ldap/l10n/cs_CZ.php +++ b/apps/user_ldap/l10n/cs_CZ.php @@ -30,11 +30,11 @@ $TRANSLATIONS = array( "Password" => "Heslo", "For anonymous access, leave DN and Password empty." => "Pro anonymní přístup ponechte údaje DN and heslo prázdné.", "User Login Filter" => "Filtr přihlášení uživatelů", -"Defines the filter to apply, when login is attempted. %%uid replaces the username in the login action. Example: \"uid=%%uid\"" => "Určuje použitý filtr, při pokusu o přihlášení. %%uid nahrazuje uživatelské jméno v činnosti přihlášení. Příklad \"uid=%%uid\"", +"Defines the filter to apply, when login is attempted. %%uid replaces the username in the login action. Example: \"uid=%%uid\"" => "Určuje použitý filtr při pokusu o přihlášení. %%uid nahrazuje uživatelské jméno v činnosti přihlášení. Příklad: \"uid=%%uid\"", "User List Filter" => "Filtr seznamu uživatelů", -"Defines the filter to apply, when retrieving users (no placeholders). Example: \"objectClass=person\"" => "Určuje použitý filtr pro získávaní uživatelů (bez zástupných znaků). Příklad: \"objectClass=person\"", +"Defines the filter to apply, when retrieving users (no placeholders). Example: \"objectClass=person\"" => "Určuje použitý filtr při získávání uživatelů (bez zástupných znaků). Příklad: \"objectClass=person\"", "Group Filter" => "Filtr skupin", -"Defines the filter to apply, when retrieving groups (no placeholders). Example: \"objectClass=posixGroup\"" => "Určuje použitý filtr, pro získávaní skupin (bez zástupných znaků). Příklad: \"objectClass=posixGroup\"", +"Defines the filter to apply, when retrieving groups (no placeholders). Example: \"objectClass=posixGroup\"" => "Určuje použitý filtr při získávání skupin (bez zástupných znaků). Příklad: \"objectClass=posixGroup\"", "Connection Settings" => "Nastavení spojení", "Configuration Active" => "Nastavení aktivní", "When unchecked, this configuration will be skipped." => "Pokud není zaškrtnuto, bude toto nastavení přeskočeno.", diff --git a/apps/user_ldap/l10n/de_CH.php b/apps/user_ldap/l10n/de_CH.php new file mode 100644 index 0000000000000000000000000000000000000000..df9175e73b1d399c6c7561e3f5fc57ba5b7d7b21 --- /dev/null +++ b/apps/user_ldap/l10n/de_CH.php @@ -0,0 +1,87 @@ + "Löschen der Zuordnung fehlgeschlagen.", +"Failed to delete the server configuration" => "Löschen der Serverkonfiguration fehlgeschlagen", +"The configuration is valid and the connection could be established!" => "Die Konfiguration ist gültig und die Verbindung konnte hergestellt werden!", +"The configuration is valid, but the Bind failed. Please check the server settings and credentials." => "Die Konfiguration ist gültig aber die Verbindung ist fehlgeschlagen. Bitte überprüfen Sie die Servereinstellungen und die Anmeldeinformationen.", +"The configuration is invalid. Please look in the ownCloud log for further details." => "Die Konfiguration ist ungültig, sehen Sie für weitere Details bitte im ownCloud Log nach", +"Deletion failed" => "Löschen fehlgeschlagen", +"Take over settings from recent server configuration?" => "Einstellungen von letzter Konfiguration übernehmen?", +"Keep settings?" => "Einstellungen beibehalten?", +"Cannot add server configuration" => "Das Hinzufügen der Serverkonfiguration schlug fehl", +"mappings cleared" => "Zuordnungen gelöscht", +"Success" => "Erfolg", +"Error" => "Fehler", +"Connection test succeeded" => "Verbindungstest erfolgreich", +"Connection test failed" => "Verbindungstest fehlgeschlagen", +"Do you really want to delete the current Server Configuration?" => "Möchten Sie die aktuelle Serverkonfiguration wirklich löschen?", +"Confirm Deletion" => "Löschung bestätigen", +"Warning: Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behavior. Please ask your system administrator to disable one of them." => "Warnung: Die Anwendungen user_ldap und user_webdavauth sind inkompatibel. Es kann demzufolge zu unerwarteten Verhalten kommen. Bitten Sie Ihren Systemadministator eine der beiden Anwendungen zu deaktivieren.", +"Warning: The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." => "Warnung: Da das PHP-Modul für LDAP nicht installiert ist, wird das Backend nicht funktionieren. Bitten Sie Ihren Systemadministrator das Modul zu installieren.", +"Server configuration" => "Serverkonfiguration", +"Add Server Configuration" => "Serverkonfiguration hinzufügen", +"Host" => "Host", +"You can omit the protocol, except you require SSL. Then start with ldaps://" => "Sie können das Protokoll auslassen, ausser wenn Sie SSL benötigen. Beginnen Sie dann mit ldaps://", +"Base DN" => "Basis-DN", +"One Base DN per line" => "Ein Basis-DN pro Zeile", +"You can specify Base DN for users and groups in the Advanced tab" => "Sie können Basis-DN für Benutzer und Gruppen in dem «Erweitert»-Reiter konfigurieren", +"User DN" => "Benutzer-DN", +"The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty." => "Der DN des Benutzers für LDAP-Bind, z.B.: uid=agent,dc=example,dc=com. Für einen anonymen Zugriff lassen Sie DN und Passwort leer.", +"Password" => "Passwort", +"For anonymous access, leave DN and Password empty." => "Lassen Sie die Felder DN und Passwort für einen anonymen Zugang leer.", +"User Login Filter" => "Benutzer-Login-Filter", +"Defines the filter to apply, when login is attempted. %%uid replaces the username in the login action. Example: \"uid=%%uid\"" => "Bestimmt den Filter, welcher bei einer Anmeldung angewandt wird. %%uid ersetzt den Benutzernamen bei der Anmeldung. Beispiel: \"uid=%%uid\"", +"User List Filter" => "Benutzer-Filter-Liste", +"Defines the filter to apply, when retrieving users (no placeholders). Example: \"objectClass=person\"" => "Definiert den Filter für die Wiederherstellung eines Benutzers (kein Platzhalter). Beispiel: \"objectClass=person\"", +"Group Filter" => "Gruppen-Filter", +"Defines the filter to apply, when retrieving groups (no placeholders). Example: \"objectClass=posixGroup\"" => "Definiert den Filter für die Wiederherstellung einer Gruppe (kein Platzhalter). Beispiel: \"objectClass=posixGroup\"", +"Connection Settings" => "Verbindungseinstellungen", +"Configuration Active" => "Konfiguration aktiv", +"When unchecked, this configuration will be skipped." => "Wenn nicht angehakt, wird diese Konfiguration übersprungen.", +"Port" => "Port", +"Backup (Replica) Host" => "Backup Host (Kopie)", +"Give an optional backup host. It must be a replica of the main LDAP/AD server." => "Geben Sie einen optionalen Backup Host an. Es muss sich um eine Kopie des Haupt LDAP/AD Servers handeln.", +"Backup (Replica) Port" => "Backup Port", +"Disable Main Server" => "Hauptserver deaktivieren", +"Only connect to the replica server." => "Nur zum Replikat-Server verbinden.", +"Use TLS" => "Nutze TLS", +"Do not use it additionally for LDAPS connections, it will fail." => "Benutzen Sie es nicht in Verbindung mit LDAPS Verbindungen, es wird fehlschlagen.", +"Case insensitve LDAP server (Windows)" => "LDAP-Server (Windows: Gross- und Kleinschreibung bleibt unbeachtet)", +"Turn off SSL certificate validation." => "Schalten Sie die SSL-Zertifikatsprüfung aus.", +"Not recommended, use it for testing only! If connection only works with this option, import the LDAP server's SSL certificate in your %s server." => "Nur für Testzwecke geeignet, sollte Standardmäßig nicht verwendet werden. Falls die Verbindung nur mit dieser Option funktioniert, importieren Sie das SSL-Zertifikat des LDAP-Servers in Ihren %s Server.", +"Cache Time-To-Live" => "Speichere Time-To-Live zwischen", +"in seconds. A change empties the cache." => "in Sekunden. Eine Änderung leert den Cache.", +"Directory Settings" => "Ordnereinstellungen", +"User Display Name Field" => "Feld für den Anzeigenamen des Benutzers", +"The LDAP attribute to use to generate the user's display name." => "Das LDAP-Attribut zur Generierung des Anzeigenamens des Benutzers.", +"Base User Tree" => "Basis-Benutzerbaum", +"One User Base DN per line" => "Ein Benutzer Basis-DN pro Zeile", +"User Search Attributes" => "Benutzersucheigenschaften", +"Optional; one attribute per line" => "Optional; ein Attribut pro Zeile", +"Group Display Name Field" => "Feld für den Anzeigenamen der Gruppe", +"The LDAP attribute to use to generate the groups's display name." => "Das LDAP-Attribut zur Generierung des Anzeigenamens der Gruppen.", +"Base Group Tree" => "Basis-Gruppenbaum", +"One Group Base DN per line" => "Ein Gruppen Basis-DN pro Zeile", +"Group Search Attributes" => "Gruppensucheigenschaften", +"Group-Member association" => "Assoziation zwischen Gruppe und Benutzer", +"Special Attributes" => "Spezielle Eigenschaften", +"Quota Field" => "Kontingent-Feld", +"Quota Default" => "Standard-Kontingent", +"in bytes" => "in Bytes", +"Email Field" => "E-Mail-Feld", +"User Home Folder Naming Rule" => "Benennungsregel für das Home-Verzeichnis des Benutzers", +"Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." => "Ohne Eingabe wird der Benutzername (Standard) verwendet. Anderenfalls tragen Sie bitte ein LDAP/AD-Attribut ein.", +"Internal Username" => "Interner Benutzername", +"By default the internal username will be created from the UUID attribute. It makes sure that the username is unique and characters do not need to be converted. The internal username has the restriction that only these characters are allowed: [ a-zA-Z0-9_.@- ]. Other characters are replaced with their ASCII correspondence or simply omitted. On collisions a number will be added/increased. The internal username is used to identify a user internally. It is also the default name for the user home folder. It is also a part of remote URLs, for instance for all *DAV services. With this setting, the default behavior can be overridden. To achieve a similar behavior as before ownCloud 5 enter the user display name attribute in the following field. Leave it empty for default behavior. Changes will have effect only on newly mapped (added) LDAP users." => "Standardmässig wird der interne Benutzername mittels des UUID-Attributes erzeugt. Dies stellt sicher, dass der Benutzername einzigartig ist und keinerlei Zeichen konvertiert werden müssen. Der interne Benutzername unterliegt Beschränkungen, die nur die nachfolgenden Zeichen erlauben: [ a-zA-Z0-9_.@- ]. Andere Zeichen werden mittels ihrer korrespondierenden Zeichen ersetzt oder einfach ausgelassen. Bei Kollisionen wird ein Zähler hinzugefügt bzw. der Zähler um einen Wert erhöht. Der interne Benutzername wird benutzt, um einen Benutzer intern zu identifizieren. Es ist ebenso der standardmässig vorausgewählte Namen des Heimatverzeichnisses. Es ist auch ein Teil der Remote-URLs - zum Beispiel für alle *DAV-Dienste. Mit dieser Einstellung kann das Standardverhalten überschrieben werden. Um ein ähnliches Verhalten wie vor ownCloud 5 zu erzielen, fügen Sie das anzuzeigende Attribut des Benutzernamens in das nachfolgende Feld ein. Lassen Sie dies hingegen für das Standardverhalten leer. Die Änderungen werden sich nur auf neu gemappte (hinzugefügte) LDAP-Benutzer auswirken.", +"Internal Username Attribute:" => "Interne Eigenschaften des Benutzers:", +"Override UUID detection" => "UUID-Erkennung überschreiben", +"By default, the UUID attribute is automatically detected. The UUID attribute is used to doubtlessly identify LDAP users and groups. Also, the internal username will be created based on the UUID, if not specified otherwise above. You can override the setting and pass an attribute of your choice. You must make sure that the attribute of your choice can be fetched for both users and groups and it is unique. Leave it empty for default behavior. Changes will have effect only on newly mapped (added) LDAP users and groups." => "Standardmässig wird die UUID-Eigenschaft automatisch erkannt. Die UUID-Eigenschaft wird genutzt, um einen LDAP-Benutzer und Gruppen einwandfrei zu identifizieren. Ausserdem wird der interne Benutzername erzeugt, der auf Eigenschaften der UUID basiert, wenn es oben nicht anders angegeben wurde. Sie müssen allerdings sicherstellen, dass Ihre gewählten Eigenschaften zur Identifikation der Benutzer und Gruppen eindeutig sind und zugeordnet werden können. Lassen Sie es frei, um es beim Standardverhalten zu belassen. Änderungen wirken sich nur auf neu gemappte (hinzugefügte) LDAP-Benutzer und -Gruppen aus.", +"UUID Attribute:" => "UUID-Attribut:", +"Username-LDAP User Mapping" => "LDAP-Benutzernamenzuordnung", +"Usernames are used to store and assign (meta) data. In order to precisely identify and recognize users, each LDAP user will have a internal username. This requires a mapping from username to LDAP user. The created username is mapped to the UUID of the LDAP user. Additionally the DN is cached as well to reduce LDAP interaction, but it is not used for identification. If the DN changes, the changes will be found. The internal username is used all over. Clearing the mappings will have leftovers everywhere. Clearing the mappings is not configuration sensitive, it affects all LDAP configurations! Never clear the mappings in a production environment, only in a testing or experimental stage." => "Die Benutzernamen werden genutzt, um (Meta)Daten zuzuordnen und zu speichern. Um Benutzer eindeutig und präzise zu identifizieren, hat jeder LDAP-Benutzer einen internen Benutzernamen. Dies erfordert eine Zuordnung (mappen) von Benutzernamen zum LDAP-Benutzer. Der erstellte Benutzername wird der UUID des LDAP-Benutzernamens zugeordnet. Zusätzlich wird der DN zwischengespeichert, um die Interaktion mit dem LDAP zu minimieren, was aber nicht der Identifikation dient. Ändert sich der DN, werden die Änderungen durch gefunden. Der interne Benutzername, wird in überall verwendet. Werden die Zuordnungen gelöscht, bleiben überall Reste zurück. Die Löschung der Zuordnungen kann nicht in der Konfiguration vorgenommen werden, beeinflusst aber die LDAP-Konfiguration! Löschen Sie niemals die Zuordnungen in einer produktiven Umgebung. Löschen Sie die Zuordnungen nur in einer Test- oder Experimentierumgebung.", +"Clear Username-LDAP User Mapping" => "Lösche LDAP-Benutzernamenzuordnung", +"Clear Groupname-LDAP Group Mapping" => "Lösche LDAP-Gruppennamenzuordnung", +"Test Configuration" => "Testkonfiguration", +"Help" => "Hilfe" +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/user_ldap/l10n/en_GB.php b/apps/user_ldap/l10n/en_GB.php new file mode 100644 index 0000000000000000000000000000000000000000..d613be34868158b1386040061e459435952527ec --- /dev/null +++ b/apps/user_ldap/l10n/en_GB.php @@ -0,0 +1,87 @@ + "Failed to clear the mappings.", +"Failed to delete the server configuration" => "Failed to delete the server configuration", +"The configuration is valid and the connection could be established!" => "The configuration is valid and the connection could be established!", +"The configuration is valid, but the Bind failed. Please check the server settings and credentials." => "The configuration is valid, but the Bind failed. Please check the server settings and credentials.", +"The configuration is invalid. Please look in the ownCloud log for further details." => "The configuration is invalid. Please look in the ownCloud log for further details.", +"Deletion failed" => "Deletion failed", +"Take over settings from recent server configuration?" => "Take over settings from recent server configuration?", +"Keep settings?" => "Keep settings?", +"Cannot add server configuration" => "Cannot add server configuration", +"mappings cleared" => "mappings cleared", +"Success" => "Success", +"Error" => "Error", +"Connection test succeeded" => "Connection test succeeded", +"Connection test failed" => "Connection test failed", +"Do you really want to delete the current Server Configuration?" => "Do you really want to delete the current Server Configuration?", +"Confirm Deletion" => "Confirm Deletion", +"Warning: Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behavior. Please ask your system administrator to disable one of them." => "Warning: Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behavior. Please ask your system administrator to disable one of them.", +"Warning: The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." => "Warning: The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it.", +"Server configuration" => "Server configuration", +"Add Server Configuration" => "Add Server Configuration", +"Host" => "Host", +"You can omit the protocol, except you require SSL. Then start with ldaps://" => "You can omit the protocol, except you require SSL. Then start with ldaps://", +"Base DN" => "Base DN", +"One Base DN per line" => "One Base DN per line", +"You can specify Base DN for users and groups in the Advanced tab" => "You can specify Base DN for users and groups in the Advanced tab", +"User DN" => "User DN", +"The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty." => "The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty.", +"Password" => "Password", +"For anonymous access, leave DN and Password empty." => "For anonymous access, leave DN and Password empty.", +"User Login Filter" => "User Login Filter", +"Defines the filter to apply, when login is attempted. %%uid replaces the username in the login action. Example: \"uid=%%uid\"" => "Defines the filter to apply, when login is attempted. %%uid replaces the username in the login action. Example: \"uid=%%uid\"", +"User List Filter" => "User List Filter", +"Defines the filter to apply, when retrieving users (no placeholders). Example: \"objectClass=person\"" => "Defines the filter to apply, when retrieving users (no placeholders). Example: \"objectClass=person\"", +"Group Filter" => "Group Filter", +"Defines the filter to apply, when retrieving groups (no placeholders). Example: \"objectClass=posixGroup\"" => "Defines the filter to apply, when retrieving groups (no placeholders). Example: \"objectClass=posixGroup\"", +"Connection Settings" => "Connection Settings", +"Configuration Active" => "Configuration Active", +"When unchecked, this configuration will be skipped." => "When unchecked, this configuration will be skipped.", +"Port" => "Port", +"Backup (Replica) Host" => "Backup (Replica) Host", +"Give an optional backup host. It must be a replica of the main LDAP/AD server." => "Give an optional backup host. It must be a replica of the main LDAP/AD server.", +"Backup (Replica) Port" => "Backup (Replica) Port", +"Disable Main Server" => "Disable Main Server", +"Only connect to the replica server." => "Only connect to the replica server.", +"Use TLS" => "Use TLS", +"Do not use it additionally for LDAPS connections, it will fail." => "Do not use it additionally for LDAPS connections, it will fail.", +"Case insensitve LDAP server (Windows)" => "Case insensitve LDAP server (Windows)", +"Turn off SSL certificate validation." => "Turn off SSL certificate validation.", +"Not recommended, use it for testing only! If connection only works with this option, import the LDAP server's SSL certificate in your %s server." => "Not recommended, use it for testing only! If connection only works with this option, import the LDAP server's SSL certificate in your %s server.", +"Cache Time-To-Live" => "Cache Time-To-Live", +"in seconds. A change empties the cache." => "in seconds. A change empties the cache.", +"Directory Settings" => "Directory Settings", +"User Display Name Field" => "User Display Name Field", +"The LDAP attribute to use to generate the user's display name." => "The LDAP attribute to use to generate the user's display name.", +"Base User Tree" => "Base User Tree", +"One User Base DN per line" => "One User Base DN per line", +"User Search Attributes" => "User Search Attributes", +"Optional; one attribute per line" => "Optional; one attribute per line", +"Group Display Name Field" => "Group Display Name Field", +"The LDAP attribute to use to generate the groups's display name." => "The LDAP attribute to use to generate the group's display name.", +"Base Group Tree" => "Base Group Tree", +"One Group Base DN per line" => "One Group Base DN per line", +"Group Search Attributes" => "Group Search Attributes", +"Group-Member association" => "Group-Member association", +"Special Attributes" => "Special Attributes", +"Quota Field" => "Quota Field", +"Quota Default" => "Quota Default", +"in bytes" => "in bytes", +"Email Field" => "Email Field", +"User Home Folder Naming Rule" => "User Home Folder Naming Rule", +"Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." => "Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute.", +"Internal Username" => "Internal Username", +"By default the internal username will be created from the UUID attribute. It makes sure that the username is unique and characters do not need to be converted. The internal username has the restriction that only these characters are allowed: [ a-zA-Z0-9_.@- ]. Other characters are replaced with their ASCII correspondence or simply omitted. On collisions a number will be added/increased. The internal username is used to identify a user internally. It is also the default name for the user home folder. It is also a part of remote URLs, for instance for all *DAV services. With this setting, the default behavior can be overridden. To achieve a similar behavior as before ownCloud 5 enter the user display name attribute in the following field. Leave it empty for default behavior. Changes will have effect only on newly mapped (added) LDAP users." => "By default the internal username will be created from the UUID attribute. It makes sure that the username is unique and characters do not need to be converted. The internal username has the restriction that only these characters are allowed: [ a-zA-Z0-9_.@- ]. Other characters are replaced with their ASCII correspondence or simply omitted. On collisions a number will be added/increased. The internal username is used to identify a user internally. It is also the default name for the user home folder. It is also a part of remote URLs, for instance for all *DAV services. With this setting, the default behavior can be overridden. To achieve a similar behaviour as before ownCloud 5 enter the user display name attribute in the following field. Leave it empty for default behaviour. Changes will have effect only on newly mapped (added) LDAP users.", +"Internal Username Attribute:" => "Internal Username Attribute:", +"Override UUID detection" => "Override UUID detection", +"By default, the UUID attribute is automatically detected. The UUID attribute is used to doubtlessly identify LDAP users and groups. Also, the internal username will be created based on the UUID, if not specified otherwise above. You can override the setting and pass an attribute of your choice. You must make sure that the attribute of your choice can be fetched for both users and groups and it is unique. Leave it empty for default behavior. Changes will have effect only on newly mapped (added) LDAP users and groups." => "By default, the UUID attribute is automatically detected. The UUID attribute is used to unambiguously identify LDAP users and groups. Also, the internal username will be created based on the UUID, if not specified otherwise above. You can override the setting and pass an attribute of your choice. You must make sure that the attribute of your choice can be fetched for both users and groups and it is unique. Leave it empty for default behaviour. Changes will have effect only on newly mapped (added) LDAP users and groups.", +"UUID Attribute:" => "UUID Attribute:", +"Username-LDAP User Mapping" => "Username-LDAP User Mapping", +"Usernames are used to store and assign (meta) data. In order to precisely identify and recognize users, each LDAP user will have a internal username. This requires a mapping from username to LDAP user. The created username is mapped to the UUID of the LDAP user. Additionally the DN is cached as well to reduce LDAP interaction, but it is not used for identification. If the DN changes, the changes will be found. The internal username is used all over. Clearing the mappings will have leftovers everywhere. Clearing the mappings is not configuration sensitive, it affects all LDAP configurations! Never clear the mappings in a production environment, only in a testing or experimental stage." => "Usernames are used to store and assign (meta) data. In order to precisely identify and recognise users, each LDAP user will have a internal username. This requires a mapping from username to LDAP user. The created username is mapped to the UUID of the LDAP user. Additionally the DN is cached as well to reduce LDAP interaction, but it is not used for identification. If the DN changes, the changes will be found. The internal username is used all over. Clearing the mappings will have leftovers everywhere. Clearing the mappings is not configuration sensitive, it affects all LDAP configurations! Never clear the mappings in a production environment, only in a testing or experimental stage.", +"Clear Username-LDAP User Mapping" => "Clear Username-LDAP User Mapping", +"Clear Groupname-LDAP Group Mapping" => "Clear Groupname-LDAP Group Mapping", +"Test Configuration" => "Test Configuration", +"Help" => "Help" +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/user_ldap/l10n/es.php b/apps/user_ldap/l10n/es.php index e59942736359a3ea784f40e795f9c27b3bebe688..4f37d5177a79a5015fb08e09dd7ffca9090bfb73 100644 --- a/apps/user_ldap/l10n/es.php +++ b/apps/user_ldap/l10n/es.php @@ -16,6 +16,7 @@ $TRANSLATIONS = array( "Connection test failed" => "La prueba de conexión falló", "Do you really want to delete the current Server Configuration?" => "¿Realmente desea eliminar la configuración actual del servidor?", "Confirm Deletion" => "Confirmar eliminación", +"Warning: Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behavior. Please ask your system administrator to disable one of them." => "Advertencia: Las apps user_ldap y user_webdavauth son incompatibles. Puede que experimente un comportamiento inesperado. Pregunte al su administrador de sistemas para desactivar uno de ellos.", "Warning: The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." => "Advertencia: El módulo LDAP de PHP no está instalado, el sistema no funcionará. Por favor consulte al administrador del sistema para instalarlo.", "Server configuration" => "Configuración del Servidor", "Add Server Configuration" => "Agregar configuracion del servidor", @@ -29,8 +30,11 @@ $TRANSLATIONS = array( "Password" => "Contraseña", "For anonymous access, leave DN and Password empty." => "Para acceso anónimo, deje DN y contraseña vacíos.", "User Login Filter" => "Filtro de inicio de sesión de usuario", +"Defines the filter to apply, when login is attempted. %%uid replaces the username in the login action. Example: \"uid=%%uid\"" => "Define el filtro a aplicar cuando se intenta identificar. %%uid remplazará al nombre de usuario en el proceso de identificación. Por ejemplo: \"uid=%%uid\"", "User List Filter" => "Lista de filtros de usuario", +"Defines the filter to apply, when retrieving users (no placeholders). Example: \"objectClass=person\"" => "Define el filtro a aplicar, cuando se obtienen usuarios (sin comodines). Por ejemplo: \"objectClass=person\"", "Group Filter" => "Filtro de grupo", +"Defines the filter to apply, when retrieving groups (no placeholders). Example: \"objectClass=posixGroup\"" => "Define el filtro a aplicar, cuando se obtienen grupos (sin comodines). Por ejemplo: \"objectClass=posixGroup\"", "Connection Settings" => "Configuración de conexión", "Configuration Active" => "Configuracion activa", "When unchecked, this configuration will be skipped." => "Cuando deseleccione, esta configuracion sera omitida.", @@ -39,19 +43,23 @@ $TRANSLATIONS = array( "Give an optional backup host. It must be a replica of the main LDAP/AD server." => "Dar un servidor de copia de seguridad opcional. Debe ser una réplica del servidor principal LDAP / AD.", "Backup (Replica) Port" => "Puerto para copias de seguridad (Replica)", "Disable Main Server" => "Deshabilitar servidor principal", +"Only connect to the replica server." => "Conectar sólo con el servidor de réplica.", "Use TLS" => "Usar TLS", "Do not use it additionally for LDAPS connections, it will fail." => "No lo use para conexiones LDAPS, Fallará.", "Case insensitve LDAP server (Windows)" => "Servidor de LDAP no sensible a mayúsculas/minúsculas (Windows)", "Turn off SSL certificate validation." => "Apagar la validación por certificado SSL.", +"Not recommended, use it for testing only! If connection only works with this option, import the LDAP server's SSL certificate in your %s server." => "No se recomienda, ¡utilízalo únicamente para pruebas! Si la conexión únicamente funciona con esta opción, importa el certificado SSL del servidor LDAP en tu servidor %s.", "Cache Time-To-Live" => "Cache TTL", "in seconds. A change empties the cache." => "en segundos. Un cambio vacía la caché.", "Directory Settings" => "Configuracion de directorio", "User Display Name Field" => "Campo de nombre de usuario a mostrar", +"The LDAP attribute to use to generate the user's display name." => "El campo LDAP a usar para generar el nombre para mostrar del usuario.", "Base User Tree" => "Árbol base de usuario", "One User Base DN per line" => "Un DN Base de Usuario por línea", "User Search Attributes" => "Atributos de la busqueda de usuario", "Optional; one attribute per line" => "Opcional; un atributo por linea", "Group Display Name Field" => "Campo de nombre de grupo a mostrar", +"The LDAP attribute to use to generate the groups's display name." => "El campo LDAP a usar para generar el nombre para mostrar del grupo.", "Base Group Tree" => "Árbol base de grupo", "One Group Base DN per line" => "Un DN Base de Grupo por línea", "Group Search Attributes" => "Atributos de busqueda de grupo", @@ -64,10 +72,13 @@ $TRANSLATIONS = array( "User Home Folder Naming Rule" => "Regla para la carpeta Home de usuario", "Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." => "Vacío para el nombre de usuario (por defecto). En otro caso, especifique un atributo LDAP/AD.", "Internal Username" => "Nombre de usuario interno", +"By default the internal username will be created from the UUID attribute. It makes sure that the username is unique and characters do not need to be converted. The internal username has the restriction that only these characters are allowed: [ a-zA-Z0-9_.@- ]. Other characters are replaced with their ASCII correspondence or simply omitted. On collisions a number will be added/increased. The internal username is used to identify a user internally. It is also the default name for the user home folder. It is also a part of remote URLs, for instance for all *DAV services. With this setting, the default behavior can be overridden. To achieve a similar behavior as before ownCloud 5 enter the user display name attribute in the following field. Leave it empty for default behavior. Changes will have effect only on newly mapped (added) LDAP users." => "El nombre de usuario interno será creado de forma predeterminada desde el atributo UUID. Esto asegura que el nombre de usuario es único y los caracteres no necesitan ser convertidos. En el nombre de usuario interno sólo se pueden usar estos caracteres: [ a-zA-Z0-9_.@- ]. El resto de caracteres son sustituidos por su correspondiente en ASCII o simplemente omitidos. En caso de duplicidades, se añadirá o incrementará un número. El nombre de usuario interno es usado para identificar un usuario. Es también el nombre predeterminado para la carpeta personal del usuario en ownCloud. También es parte de URLs remotas, por ejemplo, para todos los servicios *DAV. Con esta configuración el comportamiento predeterminado puede ser cambiado. Para conseguir un comportamiento similar a como era antes de ownCloud 5, introduzca el campo del nombre para mostrar del usuario en la siguiente caja. Déjelo vacío para el comportamiento predeterminado. Los cambios solo tendrán efecto en los usuarios LDAP mapeados (añadidos) recientemente.", "Internal Username Attribute:" => "Atributo Nombre de usuario Interno:", "Override UUID detection" => "Sobrescribir la detección UUID", +"By default, the UUID attribute is automatically detected. The UUID attribute is used to doubtlessly identify LDAP users and groups. Also, the internal username will be created based on the UUID, if not specified otherwise above. You can override the setting and pass an attribute of your choice. You must make sure that the attribute of your choice can be fetched for both users and groups and it is unique. Leave it empty for default behavior. Changes will have effect only on newly mapped (added) LDAP users and groups." => "Por defecto, el atributo UUID es autodetectado. Este atributo es usado para identificar indudablemente usuarios y grupos LDAP. Además, el nombre de usuario interno será creado en base al UUID, si no ha sido especificado otro comportamiento arriba. Puedes sobrescribir la configuración y pasar un atributo de tu elección. Debes asegurarte de que el atributo de tu elección sea accesible por los usuarios y grupos y ser único. Déjalo en blanco para usar el comportamiento por defecto. Los cambios tendrán efecto solo en los usuarios y grupos de LDAP mapeados (añadidos) recientemente.", "UUID Attribute:" => "Atributo UUID:", "Username-LDAP User Mapping" => "Asignación del Nombre de usuario de un usuario LDAP", +"Usernames are used to store and assign (meta) data. In order to precisely identify and recognize users, each LDAP user will have a internal username. This requires a mapping from username to LDAP user. The created username is mapped to the UUID of the LDAP user. Additionally the DN is cached as well to reduce LDAP interaction, but it is not used for identification. If the DN changes, the changes will be found. The internal username is used all over. Clearing the mappings will have leftovers everywhere. Clearing the mappings is not configuration sensitive, it affects all LDAP configurations! Never clear the mappings in a production environment, only in a testing or experimental stage." => "Los usuarios son usados para almacenar y asignar (meta) datos. Con el fin de identificar de forma precisa y reconocer usuarios, cada usuario de LDAP tendrá un nombre de usuario interno. Esto requiere un mapeo entre el nombre de usuario y el usuario del LDAP. El nombre de usuario creado es mapeado respecto al UUID del usuario en el LDAP. De forma adicional, el DN es cacheado para reducir la interacción entre el LDAP, pero no es usado para identificar. Si el DN cambia, los cambios serán aplicados. El nombre de usuario interno es usado por encima de todo. Limpiar los mapeos dejará restos por todas partes, no es sensible a configuración, ¡afecta a todas las configuraciones del LDAP! Nunca limpies los mapeos en un entorno de producción, únicamente en una fase de desarrollo o experimental.", "Clear Username-LDAP User Mapping" => "Borrar la asignación de los Nombres de usuario de los usuarios LDAP", "Clear Groupname-LDAP Group Mapping" => "Borrar la asignación de los Nombres de grupo de los grupos de LDAP", "Test Configuration" => "Configuración de prueba", diff --git a/apps/user_ldap/l10n/es_AR.php b/apps/user_ldap/l10n/es_AR.php index ecfcae32f46e387bc0d9db48aa9a9fca2169f5d4..2436df8de7747baf96c523b2f96e34975a7385c3 100644 --- a/apps/user_ldap/l10n/es_AR.php +++ b/apps/user_ldap/l10n/es_AR.php @@ -16,6 +16,7 @@ $TRANSLATIONS = array( "Connection test failed" => "Falló es test de conexión", "Do you really want to delete the current Server Configuration?" => "¿Realmente desea borrar la configuración actual del servidor?", "Confirm Deletion" => "Confirmar borrado", +"Warning: Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behavior. Please ask your system administrator to disable one of them." => "Advertencia: Las apps user_ldap y user_webdavauth son incompatibles. Puede ser que experimentes comportamientos inesperados. Pedile al administrador que desactive uno de ellos.", "Warning: The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." => "Atención: El módulo PHP LDAP no está instalado, este elemento no va a funcionar. Por favor, pedile al administrador que lo instale.", "Server configuration" => "Configuración del Servidor", "Add Server Configuration" => "Añadir Configuración del Servidor", @@ -29,8 +30,11 @@ $TRANSLATIONS = array( "Password" => "Contraseña", "For anonymous access, leave DN and Password empty." => "Para acceso anónimo, dejá DN y contraseña vacíos.", "User Login Filter" => "Filtro de inicio de sesión de usuario", +"Defines the filter to apply, when login is attempted. %%uid replaces the username in the login action. Example: \"uid=%%uid\"" => "Define el filtro a aplicar cuando se intenta ingresar. %%uid remplaza el nombre de usuario en el proceso de identificación. Por ejemplo: \"uid=%%uid\"", "User List Filter" => "Lista de filtros de usuario", +"Defines the filter to apply, when retrieving users (no placeholders). Example: \"objectClass=person\"" => "Define el filtro a aplicar al obtener usuarios (sin comodines). Por ejemplo: \"objectClass=person\"", "Group Filter" => "Filtro de grupo", +"Defines the filter to apply, when retrieving groups (no placeholders). Example: \"objectClass=posixGroup\"" => "Define el filtro a aplicar al obtener grupos (sin comodines). Por ejemplo: \"objectClass=posixGroup\"", "Connection Settings" => "Configuración de Conección", "Configuration Active" => "Configuración activa", "When unchecked, this configuration will be skipped." => "Si no está seleccionada, esta configuración será omitida.", @@ -39,19 +43,23 @@ $TRANSLATIONS = array( "Give an optional backup host. It must be a replica of the main LDAP/AD server." => "Dar un servidor de copia de seguridad opcional. Debe ser una réplica del servidor principal LDAP/AD.", "Backup (Replica) Port" => "Puerto para copia de seguridad (réplica)", "Disable Main Server" => "Deshabilitar el Servidor Principal", +"Only connect to the replica server." => "Conectarse únicamente al servidor de réplica.", "Use TLS" => "Usar TLS", "Do not use it additionally for LDAPS connections, it will fail." => "No usar adicionalmente para conexiones LDAPS, las mismas fallarán", "Case insensitve LDAP server (Windows)" => "Servidor de LDAP sensible a mayúsculas/minúsculas (Windows)", "Turn off SSL certificate validation." => "Desactivar la validación por certificado SSL.", +"Not recommended, use it for testing only! If connection only works with this option, import the LDAP server's SSL certificate in your %s server." => "No es recomendado, ¡Usalo solamente para pruebas! Si la conexión únicamente funciona con esta opción, importá el certificado SSL del servidor LDAP en tu servidor %s.", "Cache Time-To-Live" => "Tiempo de vida del caché", "in seconds. A change empties the cache." => "en segundos. Cambiarlo vacía la cache.", "Directory Settings" => "Configuración de Directorio", "User Display Name Field" => "Campo de nombre de usuario a mostrar", +"The LDAP attribute to use to generate the user's display name." => "El atributo LDAP a usar para generar el nombre de usuario mostrado.", "Base User Tree" => "Árbol base de usuario", "One User Base DN per line" => "Una DN base de usuario por línea", "User Search Attributes" => "Atributos de la búsqueda de usuario", "Optional; one attribute per line" => "Opcional; un atributo por linea", "Group Display Name Field" => "Campo de nombre de grupo a mostrar", +"The LDAP attribute to use to generate the groups's display name." => "El atributo LDAP a usar para generar el nombre de grupo mostrado.", "Base Group Tree" => "Árbol base de grupo", "One Group Base DN per line" => "Una DN base de grupo por línea", "Group Search Attributes" => "Atributos de búsqueda de grupo", @@ -64,10 +72,13 @@ $TRANSLATIONS = array( "User Home Folder Naming Rule" => "Regla de nombre de los directorios de usuario", "Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." => "Vacío para el nombre de usuario (por defecto). En otro caso, especificá un atributo LDAP/AD.", "Internal Username" => "Nombre interno de usuario", +"By default the internal username will be created from the UUID attribute. It makes sure that the username is unique and characters do not need to be converted. The internal username has the restriction that only these characters are allowed: [ a-zA-Z0-9_.@- ]. Other characters are replaced with their ASCII correspondence or simply omitted. On collisions a number will be added/increased. The internal username is used to identify a user internally. It is also the default name for the user home folder. It is also a part of remote URLs, for instance for all *DAV services. With this setting, the default behavior can be overridden. To achieve a similar behavior as before ownCloud 5 enter the user display name attribute in the following field. Leave it empty for default behavior. Changes will have effect only on newly mapped (added) LDAP users." => "Por defecto, el nombre de usuario interno es creado a partir del atributo UUID. Esto asegura que el nombre de usuario es único y no es necesaria una conversión de caracteres. El nombre de usuario interno sólo se pueden usar estos caracteres: [ a-zA-Z0-9_.@- ]. El resto de caracteres son sustituidos por su correspondiente en ASCII o simplemente omitidos. En caso colisiones, se agregará o incrementará un número. El nombre de usuario interno es usado para identificar un usuario. Es también el nombre predeterminado para el directorio personal del usuario en ownCloud. También es parte de las URLs remotas, por ejemplo, para los servicios *DAV. Con esta opción, se puede cambiar el comportamiento por defecto. Para conseguir un comportamiento similar a versiones anteriores a ownCloud 5, ingresá el atributo del nombre mostrado en el campo siguiente. Dejalo vacío para el comportamiento por defecto. Los cambios solo tendrán efecto en los nuevos usuarios LDAP mapeados (agregados).", "Internal Username Attribute:" => "Atributo Nombre Interno de usuario:", "Override UUID detection" => "Sobrescribir la detección UUID", +"By default, the UUID attribute is automatically detected. The UUID attribute is used to doubtlessly identify LDAP users and groups. Also, the internal username will be created based on the UUID, if not specified otherwise above. You can override the setting and pass an attribute of your choice. You must make sure that the attribute of your choice can be fetched for both users and groups and it is unique. Leave it empty for default behavior. Changes will have effect only on newly mapped (added) LDAP users and groups." => "Por defecto, el atributo UUID es detectado automáticamente. Este atributo es usado para identificar de manera certera usuarios y grupos LDAP. Además, el nombre de usuario interno será creado en base al UUID, si no fue especificado otro comportamiento más arriba. Podés sobrescribir la configuración y pasar un atributo de tu elección. Tenés que asegurarte que el atributo de tu elección sea accesible por los usuarios y grupos y que sea único. Dejalo en blanco para usar el comportamiento por defecto. Los cambios tendrán efecto sólo en los nuevos usuarios y grupos de LDAP mapeados (agregados).", "UUID Attribute:" => "Atributo UUID:", "Username-LDAP User Mapping" => "Asignación del Nombre de usuario de un usuario LDAP", +"Usernames are used to store and assign (meta) data. In order to precisely identify and recognize users, each LDAP user will have a internal username. This requires a mapping from username to LDAP user. The created username is mapped to the UUID of the LDAP user. Additionally the DN is cached as well to reduce LDAP interaction, but it is not used for identification. If the DN changes, the changes will be found. The internal username is used all over. Clearing the mappings will have leftovers everywhere. Clearing the mappings is not configuration sensitive, it affects all LDAP configurations! Never clear the mappings in a production environment, only in a testing or experimental stage." => "Los usuarios son usados para almacenar y asignar datos (metadatos). Con el fin de identificar de forma precisa y reconocer usuarios, a cada usuario de LDAP se será asignado un nombre de usuario interno. Esto requiere un mapeo entre el nombre de usuario y el usuario del LDAP. El nombre de usuario creado es mapeado respecto al UUID del usuario en el LDAP. De forma adicional, el DN es dejado en caché para reducir la interacción entre el LDAP, pero no es usado para la identificación. Si el DN cambia, los cambios van a ser aplicados. El nombre de usuario interno es usado en todos los lugares. Vaciar los mapeos, deja restos por todas partes. Vaciar los mapeos, no es sensible a configuración, ¡afecta a todas las configuraciones del LDAP! Nunca limpies los mapeos en un entorno de producción, solamente en fase de desarrollo o experimental.", "Clear Username-LDAP User Mapping" => "Borrar la asignación de los Nombres de usuario de los usuarios LDAP", "Clear Groupname-LDAP Group Mapping" => "Borrar la asignación de los Nombres de grupo de los grupos de LDAP", "Test Configuration" => "Probar configuración", diff --git a/apps/user_ldap/l10n/fr.php b/apps/user_ldap/l10n/fr.php index 0c7d3ad078f83e328589bab8a57951bb9f8b486e..8b6027b81e6dda2c16df98ffb705ec60510ea692 100644 --- a/apps/user_ldap/l10n/fr.php +++ b/apps/user_ldap/l10n/fr.php @@ -16,6 +16,7 @@ $TRANSLATIONS = array( "Connection test failed" => "Test de connexion échoué", "Do you really want to delete the current Server Configuration?" => "Êtes-vous vraiment sûr de vouloir effacer la configuration actuelle du serveur ?", "Confirm Deletion" => "Confirmer la suppression", +"Warning: Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behavior. Please ask your system administrator to disable one of them." => "Avertissement : Les applications user_ldap et user_webdavauth sont incompatibles. Des dysfonctionnements peuvent survenir. Contactez votre administrateur système pour qu'il désactive l'une d'elles.", "Warning: The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." => "Attention : Le module php LDAP n'est pas installé, par conséquent cette extension ne pourra fonctionner. Veuillez contacter votre administrateur système afin qu'il l'installe.", "Server configuration" => "Configuration du serveur", "Add Server Configuration" => "Ajouter une configuration du serveur", @@ -29,8 +30,11 @@ $TRANSLATIONS = array( "Password" => "Mot de passe", "For anonymous access, leave DN and Password empty." => "Pour un accès anonyme, laisser le DN utilisateur et le mot de passe vides.", "User Login Filter" => "Modèle d'authentification utilisateurs", +"Defines the filter to apply, when login is attempted. %%uid replaces the username in the login action. Example: \"uid=%%uid\"" => "Définit le filtre à appliquer lors d'une tentative de connexion. %%uid remplace le nom d'utilisateur lors de la connexion. Exemple : \"uid=%%uid\"", "User List Filter" => "Filtre d'utilisateurs", +"Defines the filter to apply, when retrieving users (no placeholders). Example: \"objectClass=person\"" => "Définit le filtre à appliquer lors de la récupération des utilisateurs. Exemple : \"objectClass=person\"", "Group Filter" => "Filtre de groupes", +"Defines the filter to apply, when retrieving groups (no placeholders). Example: \"objectClass=posixGroup\"" => "Définit le filtre à appliquer lors de la récupération des groupes. Exemple : \"objectClass=posixGroup\"", "Connection Settings" => "Paramètres de connexion", "Configuration Active" => "Configuration active", "When unchecked, this configuration will be skipped." => "Lorsque non cochée, la configuration sera ignorée.", @@ -39,19 +43,23 @@ $TRANSLATIONS = array( "Give an optional backup host. It must be a replica of the main LDAP/AD server." => "Fournir un serveur de backup optionnel. Il doit s'agir d'une réplique du serveur LDAP/AD principal.", "Backup (Replica) Port" => "Port du serveur de backup (réplique)", "Disable Main Server" => "Désactiver le serveur principal", +"Only connect to the replica server." => "Se connecter uniquement au serveur de replica.", "Use TLS" => "Utiliser TLS", "Do not use it additionally for LDAPS connections, it will fail." => "À ne pas utiliser pour les connexions LDAPS (cela échouera).", "Case insensitve LDAP server (Windows)" => "Serveur LDAP insensible à la casse (Windows)", "Turn off SSL certificate validation." => "Désactiver la validation du certificat SSL.", +"Not recommended, use it for testing only! If connection only works with this option, import the LDAP server's SSL certificate in your %s server." => "Non recommandé, à utiliser à des fins de tests uniquement. Si la connexion ne fonctionne qu'avec cette option, importez le certificat SSL du serveur LDAP dans le serveur %s.", "Cache Time-To-Live" => "Durée de vie du cache", "in seconds. A change empties the cache." => "en secondes. Tout changement vide le cache.", "Directory Settings" => "Paramètres du répertoire", "User Display Name Field" => "Champ \"nom d'affichage\" de l'utilisateur", +"The LDAP attribute to use to generate the user's display name." => "L'attribut LDAP utilisé pour générer le nom d'utilisateur affiché.", "Base User Tree" => "DN racine de l'arbre utilisateurs", "One User Base DN per line" => "Un DN racine utilisateur par ligne", "User Search Attributes" => "Recherche des attributs utilisateur", "Optional; one attribute per line" => "Optionnel, un attribut par ligne", "Group Display Name Field" => "Champ \"nom d'affichage\" du groupe", +"The LDAP attribute to use to generate the groups's display name." => "L'attribut LDAP utilisé pour générer le nom de groupe affiché.", "Base Group Tree" => "DN racine de l'arbre groupes", "One Group Base DN per line" => "Un DN racine groupe par ligne", "Group Search Attributes" => "Recherche des attributs du groupe", @@ -64,10 +72,13 @@ $TRANSLATIONS = array( "User Home Folder Naming Rule" => "Convention de nommage du répertoire utilisateur", "Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." => "Laisser vide ", "Internal Username" => "Nom d'utilisateur interne", +"By default the internal username will be created from the UUID attribute. It makes sure that the username is unique and characters do not need to be converted. The internal username has the restriction that only these characters are allowed: [ a-zA-Z0-9_.@- ]. Other characters are replaced with their ASCII correspondence or simply omitted. On collisions a number will be added/increased. The internal username is used to identify a user internally. It is also the default name for the user home folder. It is also a part of remote URLs, for instance for all *DAV services. With this setting, the default behavior can be overridden. To achieve a similar behavior as before ownCloud 5 enter the user display name attribute in the following field. Leave it empty for default behavior. Changes will have effect only on newly mapped (added) LDAP users." => "Par défaut le nom d'utilisateur interne sera créé à partir de l'attribut UUID. Ceci permet d'assurer que le nom d'utilisateur est unique et que les caractères ne nécessitent pas de conversion. Le nom d'utilisateur interne doit contenir uniquement les caractères suivants : [ a-zA-Z0-9_.@- ]. Les autres caractères sont remplacés par leur correspondance ASCII ou simplement omis. En cas de collision, un nombre est incrémenté/décrémenté. Le nom d'utilisateur interne est utilisé pour identifier l'utilisateur au sein du système. C'est aussi le nom par défaut du répertoire utilisateur dans ownCloud. C'est aussi le port d'URLs distants, par exemple pour tous les services *DAV. Le comportement par défaut peut être modifié à l'aide de ce paramètre. Pour obtenir un comportement similaire aux versions précédentes à ownCloud 5, saisir le nom d'utilisateur à afficher dans le champ suivant. Laissez à blanc pour le comportement par défaut. Les modifications prendront effet seulement pour les nouveaux (ajoutés) utilisateurs LDAP.", "Internal Username Attribute:" => "Nom d'utilisateur interne:", "Override UUID detection" => "Surcharger la détection d'UUID", +"By default, the UUID attribute is automatically detected. The UUID attribute is used to doubtlessly identify LDAP users and groups. Also, the internal username will be created based on the UUID, if not specified otherwise above. You can override the setting and pass an attribute of your choice. You must make sure that the attribute of your choice can be fetched for both users and groups and it is unique. Leave it empty for default behavior. Changes will have effect only on newly mapped (added) LDAP users and groups." => "Par défaut, l'attribut UUID est automatiquement détecté. Cet attribut est utilisé pour identifier les utilisateurs et groupes de façon fiable. Un nom d'utilisateur interne basé sur l'UUID sera automatiquement créé, sauf s'il est spécifié autrement ci-dessus. Vous pouvez modifier ce comportement et définir l'attribut de votre choix. Vous devez alors vous assurer que l'attribut de votre choix peut être récupéré pour les utilisateurs ainsi que pour les groupes et qu'il soit unique. Laisser à blanc pour le comportement par défaut. Les modifications seront effectives uniquement pour les nouveaux (ajoutés) utilisateurs et groupes LDAP.", "UUID Attribute:" => "Attribut UUID :", "Username-LDAP User Mapping" => "Association Nom d'utilisateur-Utilisateur LDAP", +"Usernames are used to store and assign (meta) data. In order to precisely identify and recognize users, each LDAP user will have a internal username. This requires a mapping from username to LDAP user. The created username is mapped to the UUID of the LDAP user. Additionally the DN is cached as well to reduce LDAP interaction, but it is not used for identification. If the DN changes, the changes will be found. The internal username is used all over. Clearing the mappings will have leftovers everywhere. Clearing the mappings is not configuration sensitive, it affects all LDAP configurations! Never clear the mappings in a production environment, only in a testing or experimental stage." => "Les noms d'utilisateurs sont utilisés pour le stockage et l'assignation de (meta) données. Pour identifier et reconnaitre précisément les utilisateurs, chaque utilisateur LDAP aura un nom interne spécifique. Cela requiert l'association d'un nom d'utilisateur ownCloud à un nom d'utilisateur LDAP. Le nom d'utilisateur créé est associé à l'attribut UUID de l'utilisateur LDAP. Par ailleurs, le DN est mémorisé en cache pour limiter les interactions LDAP mais il n'est pas utilisé pour l'identification. Si le DN est modifié, ces modifications seront retrouvées. Seul le nom interne à ownCloud est utilisé au sein du produit. Supprimer les associations créera des orphelins et l'action affectera toutes les configurations LDAP. NE JAMAIS SUPPRIMER LES ASSOCIATIONS EN ENVIRONNEMENT DE PRODUCTION, mais uniquement sur des environnements de tests et d'expérimentation.", "Clear Username-LDAP User Mapping" => "Supprimer l'association utilisateur interne-utilisateur LDAP", "Clear Groupname-LDAP Group Mapping" => "Supprimer l'association nom de groupe-groupe LDAP", "Test Configuration" => "Tester la configuration", diff --git a/apps/user_ldap/l10n/hu_HU.php b/apps/user_ldap/l10n/hu_HU.php index 6961869f3e06906d98704342e03ff22f10e3794b..b43dcbc2c8769cbed8d6b2a23b6bb23e24479758 100644 --- a/apps/user_ldap/l10n/hu_HU.php +++ b/apps/user_ldap/l10n/hu_HU.php @@ -16,6 +16,7 @@ $TRANSLATIONS = array( "Connection test failed" => "A kapcsolatellenőrzés eredménye: nem sikerült", "Do you really want to delete the current Server Configuration?" => "Tényleg törölni szeretné a kiszolgáló beállításait?", "Confirm Deletion" => "A törlés megerősítése", +"Warning: Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behavior. Please ask your system administrator to disable one of them." => "Figyelem: a user_ldap és user_webdavauth alkalmazások nem kompatibilisek. Együttes használatuk váratlan eredményekhez vezethet. Kérje meg a rendszergazdát, hogy a kettő közül kapcsolja ki az egyiket.", "Warning: The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." => "Figyelmeztetés: Az LDAP PHP modul nincs telepítve, ezért ez az alrendszer nem fog működni. Kérje meg a rendszergazdát, hogy telepítse!", "Server configuration" => "A kiszolgálók beállításai", "Add Server Configuration" => "Új kiszolgáló beállításának hozzáadása", @@ -29,8 +30,11 @@ $TRANSLATIONS = array( "Password" => "Jelszó", "For anonymous access, leave DN and Password empty." => "Bejelentkezés nélküli eléréshez ne töltse ki a DN és Jelszó mezőket!", "User Login Filter" => "Szűrő a bejelentkezéshez", +"Defines the filter to apply, when login is attempted. %%uid replaces the username in the login action. Example: \"uid=%%uid\"" => "Ez a szűrő érvényes a bejelentkezés megkísérlésekor. Ekkor az %%uid változó helyére a bejelentkezési név kerül. Például: \"uid=%%uid\"", "User List Filter" => "A felhasználók szűrője", +"Defines the filter to apply, when retrieving users (no placeholders). Example: \"objectClass=person\"" => "Ez a szűrő érvényes a felhasználók listázásakor (nincs helyettesíthető változó). Például: \"objectClass=person\"", "Group Filter" => "A csoportok szűrője", +"Defines the filter to apply, when retrieving groups (no placeholders). Example: \"objectClass=posixGroup\"" => "Ez a szűrő érvényes a csoportok listázásakor (nincs helyettesíthető változó). Például: \"objectClass=posixGroup\"", "Connection Settings" => "Kapcsolati beállítások", "Configuration Active" => "A beállítás aktív", "When unchecked, this configuration will be skipped." => "Ha nincs kipipálva, ez a beállítás kihagyódik.", @@ -39,19 +43,23 @@ $TRANSLATIONS = array( "Give an optional backup host. It must be a replica of the main LDAP/AD server." => "Adjon meg egy opcionális másodkiszolgálót. Ez a fő LDAP/AD kiszolgáló szinkron másolata (replikája) kell legyen.", "Backup (Replica) Port" => "A másodkiszolgáló (replika) portszáma", "Disable Main Server" => "A fő szerver kihagyása", +"Only connect to the replica server." => "Csak a másodlagos (másolati) kiszolgálóhoz kapcsolódjunk.", "Use TLS" => "Használjunk TLS-t", "Do not use it additionally for LDAPS connections, it will fail." => "LDAPS kapcsolatok esetén ne kapcsoljuk be, mert nem fog működni.", "Case insensitve LDAP server (Windows)" => "Az LDAP-kiszolgáló nem tesz különbséget a kis- és nagybetűk között (Windows)", "Turn off SSL certificate validation." => "Ne ellenőrizzük az SSL-tanúsítvány érvényességét", +"Not recommended, use it for testing only! If connection only works with this option, import the LDAP server's SSL certificate in your %s server." => "Használata nem javasolt (kivéve tesztelési céllal). Ha a kapcsolat csak ezzel a beállítással működik, akkor importálja az LDAP-kiszolgáló SSL tanúsítványát a(z) %s kiszolgálóra!", "Cache Time-To-Live" => "A gyorsítótár tárolási időtartama", "in seconds. A change empties the cache." => "másodpercben. A változtatás törli a cache tartalmát.", "Directory Settings" => "Címtár beállítások", "User Display Name Field" => "A felhasználónév mezője", +"The LDAP attribute to use to generate the user's display name." => "Ebből az LDAP attribútumból képződik a felhasználó megjelenítendő neve.", "Base User Tree" => "A felhasználói fa gyökere", "One User Base DN per line" => "Soronként egy felhasználói fa gyökerét adhatjuk meg", "User Search Attributes" => "A felhasználók lekérdezett attribútumai", "Optional; one attribute per line" => "Nem kötelező megadni, soronként egy attribútum", "Group Display Name Field" => "A csoport nevének mezője", +"The LDAP attribute to use to generate the groups's display name." => "Ebből az LDAP attribútumból képződik a csoport megjelenítendő neve.", "Base Group Tree" => "A csoportfa gyökere", "One Group Base DN per line" => "Soronként egy csoportfa gyökerét adhatjuk meg", "Group Search Attributes" => "A csoportok lekérdezett attribútumai", @@ -64,6 +72,7 @@ $TRANSLATIONS = array( "User Home Folder Naming Rule" => "A home könyvtár elérési útvonala", "Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." => "Hagyja üresen, ha a felhasználónevet kívánja használni. Ellenkező esetben adjon meg egy LDAP/AD attribútumot!", "Internal Username" => "Belső felhasználónév", +"By default the internal username will be created from the UUID attribute. It makes sure that the username is unique and characters do not need to be converted. The internal username has the restriction that only these characters are allowed: [ a-zA-Z0-9_.@- ]. Other characters are replaced with their ASCII correspondence or simply omitted. On collisions a number will be added/increased. The internal username is used to identify a user internally. It is also the default name for the user home folder. It is also a part of remote URLs, for instance for all *DAV services. With this setting, the default behavior can be overridden. To achieve a similar behavior as before ownCloud 5 enter the user display name attribute in the following field. Leave it empty for default behavior. Changes will have effect only on newly mapped (added) LDAP users." => "Alapértelmezetten a belső felhasználónév az UUID tulajdonságból jön létre. Ez biztosítja a felhasználónév egyediségét és hogy a nem kell konvertálni a karaktereket benne. A belső felhasználónévnél a megkötés az, hogy csak a következő karakterek engdélyezettek benne: [ a-zA-Z0-9_.@- ]. Ezeken a karaktereken kivül minden karakter le lesz cserélve az adott karakter ASCII kódtáblában használható párjára vagy ha ilyen nincs akkor egyszerűen ki lesz hagyva. Ha így mégis ütköznének a nevek akkor hozzá lesz füzve egy folyamatosan növekvő számláló rész. A belső felhasználónevet lehet használni a felhasználó azonosítására a programon belül. Illetve ez lesz az alapáértelmezett neve a felhasználó kezdő könyvtárának az ownCloud-ban. Illetve...............................", "Internal Username Attribute:" => "A belső felhasználónév attribútuma:", "Override UUID detection" => "Az UUID-felismerés felülbírálása", "UUID Attribute:" => "UUID attribútum:", diff --git a/apps/user_ldap/l10n/lt_LT.php b/apps/user_ldap/l10n/lt_LT.php index 7e8b389af7f318e49a6f6b436935a1af8bf48121..f0522016825353a2bfbf26997d39c68a0e694928 100644 --- a/apps/user_ldap/l10n/lt_LT.php +++ b/apps/user_ldap/l10n/lt_LT.php @@ -1,12 +1,57 @@ "Nepavyko išvalyti sąsajų.", +"Failed to delete the server configuration" => "Nepavyko pašalinti serverio konfigūracijos", "Deletion failed" => "Ištrinti nepavyko", +"Keep settings?" => "Išlaikyti nustatymus?", +"mappings cleared" => "susiejimai išvalyti", +"Success" => "Sėkmingai", "Error" => "Klaida", +"Connection test succeeded" => "Ryšio patikrinimas pavyko", +"Connection test failed" => "Ryšio patikrinimas nepavyko", +"Do you really want to delete the current Server Configuration?" => "Ar tikrai norite ištrinti dabartinę serverio konfigūraciją?", +"Confirm Deletion" => "Patvirtinkite trynimą", +"Server configuration" => "Serverio konfigūravimas", +"Add Server Configuration" => "Pridėti serverio konfigūraciją", +"Host" => "Mazgas", +"Base DN" => "Bazinis DN", +"One Base DN per line" => "Vienas bazinis DN eilutėje", +"User DN" => "Naudotojas DN", "Password" => "Slaptažodis", +"For anonymous access, leave DN and Password empty." => "Anoniminiam prisijungimui, palikite DN ir Slaptažodis laukus tuščius.", +"User Login Filter" => "Naudotojo prisijungimo filtras", +"User List Filter" => "Naudotojo sąrašo filtras", "Group Filter" => "Grupės filtras", +"Connection Settings" => "Ryšio nustatymai", +"Configuration Active" => "Konfigūracija aktyvi", +"When unchecked, this configuration will be skipped." => "Kai nepažymėta, ši konfigūracija bus praleista.", "Port" => "Prievadas", +"Backup (Replica) Host" => "Atsarginės kopijos (Replica) mazgas", +"Backup (Replica) Port" => "Atsarginės kopijos (Replica) prievadas", +"Disable Main Server" => "Išjungti pagrindinį serverį", +"Only connect to the replica server." => "Tik prisijungti prie reprodukcinio (replica) serverio.", "Use TLS" => "Naudoti TLS", "Turn off SSL certificate validation." => "Išjungti SSL sertifikato tikrinimą.", +"Directory Settings" => "Katalogo nustatymai", +"Base User Tree" => "Bazinis naudotojo medis", +"User Search Attributes" => "Naudotojo paieškos atributai", +"Base Group Tree" => "Bazinis grupės medis", +"Group Search Attributes" => "Grupės paieškos atributai", +"Group-Member association" => "Grupės-Nario sąsaja", +"Special Attributes" => "Specialūs atributai", +"Quota Field" => "Kvotos laukas", +"Quota Default" => "Numatyta kvota", +"in bytes" => "baitais", +"Email Field" => "El. pašto laukas", +"User Home Folder Naming Rule" => "Naudotojo namų aplanko pavadinimo taisyklė", +"Internal Username" => "Vidinis naudotojo vardas", +"Internal Username Attribute:" => "Vidinis naudotojo vardo atributas:", +"Override UUID detection" => "Perrašyti UUID aptikimą", +"UUID Attribute:" => "UUID atributas:", +"Username-LDAP User Mapping" => "Naudotojo vardo - LDAP naudotojo sąsaja", +"Clear Username-LDAP User Mapping" => "Išvalyti naudotojo vardo - LDAP naudotojo sąsają", +"Clear Groupname-LDAP Group Mapping" => "Išvalyti grupės pavadinimo - LDAP naudotojo sąsają", +"Test Configuration" => "Bandyti konfigūraciją", "Help" => "Pagalba" ); $PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/apps/user_ldap/l10n/nn_NO.php b/apps/user_ldap/l10n/nn_NO.php index 5e584aa31e35e07ffb8bcf5f755867d0476d7864..470114d9359ea55f56a6d2e3c4a2a637c2dd0a45 100644 --- a/apps/user_ldap/l10n/nn_NO.php +++ b/apps/user_ldap/l10n/nn_NO.php @@ -2,6 +2,7 @@ $TRANSLATIONS = array( "Deletion failed" => "Feil ved sletting", "Error" => "Feil", +"Host" => "Tenar", "Password" => "Passord", "Help" => "Hjelp" ); diff --git a/apps/user_ldap/l10n/pa.php b/apps/user_ldap/l10n/pa.php new file mode 100644 index 0000000000000000000000000000000000000000..ac486a8ca2fb80bbc2075c698d694734ca63f7dc --- /dev/null +++ b/apps/user_ldap/l10n/pa.php @@ -0,0 +1,6 @@ + "ਗਲਤੀ", +"Password" => "ਪਾਸਵਰ" +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/user_ldap/l10n/ru.php b/apps/user_ldap/l10n/ru.php index f26e26f1e77cd04c3f36864c45f773545d34774b..f1cf51dc51bffe35c0d84b60722b07927214375b 100644 --- a/apps/user_ldap/l10n/ru.php +++ b/apps/user_ldap/l10n/ru.php @@ -30,8 +30,11 @@ $TRANSLATIONS = array( "Password" => "Пароль", "For anonymous access, leave DN and Password empty." => "Для анонимного доступа оставьте DN и пароль пустыми.", "User Login Filter" => "Фильтр входа пользователей", +"Defines the filter to apply, when login is attempted. %%uid replaces the username in the login action. Example: \"uid=%%uid\"" => "Определяет фильтр для применения при попытке входа. %%uid заменяет имя пользователя при входе в систему. Например: \"uid=%%uid\"", "User List Filter" => "Фильтр списка пользователей", +"Defines the filter to apply, when retrieving users (no placeholders). Example: \"objectClass=person\"" => "Определяет фильтр, использующийся при получении пользователей (без подмены переменных). Например: \"objectClass=person\"", "Group Filter" => "Фильтр группы", +"Defines the filter to apply, when retrieving groups (no placeholders). Example: \"objectClass=posixGroup\"" => "Определяет фильтр, использующийся при получении групп (без подмены переменных). Например: \"objectClass=posixGroup\"", "Connection Settings" => "Настройки подключения", "Configuration Active" => "Конфигурация активна", "When unchecked, this configuration will be skipped." => "Когда галочка снята, эта конфигурация будет пропущена.", @@ -40,19 +43,23 @@ $TRANSLATIONS = array( "Give an optional backup host. It must be a replica of the main LDAP/AD server." => "Укажите дополнительный резервный сервер. Он должен быть репликой главного LDAP/AD сервера.", "Backup (Replica) Port" => "Порт резервного сервера", "Disable Main Server" => "Отключение главного сервера", +"Only connect to the replica server." => "Только подключение к серверу реплик.", "Use TLS" => "Использовать TLS", "Do not use it additionally for LDAPS connections, it will fail." => "Не используйте совместно с безопасными подключениями (LDAPS), это не сработает.", "Case insensitve LDAP server (Windows)" => "Нечувствительный к регистру сервер LDAP (Windows)", "Turn off SSL certificate validation." => "Отключить проверку сертификата SSL.", +"Not recommended, use it for testing only! If connection only works with this option, import the LDAP server's SSL certificate in your %s server." => "Не рекомендуется, используйте только в режиме тестирования! Если соединение работает только с этой опцией, импортируйте на ваш %s сервер сертификат SSL сервера LDAP.", "Cache Time-To-Live" => "Кэш времени жизни", "in seconds. A change empties the cache." => "в секундах. Изменение очистит кэш.", "Directory Settings" => "Настройки каталога", "User Display Name Field" => "Поле отображаемого имени пользователя", +"The LDAP attribute to use to generate the user's display name." => "Атрибут LDAP, который используется для генерации отображаемого имени пользователя.", "Base User Tree" => "База пользовательского дерева", "One User Base DN per line" => "По одной базовому DN пользователей в строке.", "User Search Attributes" => "Поисковые атрибуты пользователя", "Optional; one attribute per line" => "Опционально; один атрибут на линию", "Group Display Name Field" => "Поле отображаемого имени группы", +"The LDAP attribute to use to generate the groups's display name." => "Атрибут LDAP, который используется для генерации отображаемого имени группы.", "Base Group Tree" => "База группового дерева", "One Group Base DN per line" => "По одной базовому DN групп в строке.", "Group Search Attributes" => "Атрибуты поиска для группы", @@ -65,10 +72,13 @@ $TRANSLATIONS = array( "User Home Folder Naming Rule" => "Правило именования Домашней Папки Пользователя", "Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." => "Оставьте имя пользователя пустым (по умолчанию). Иначе укажите атрибут LDAP/AD.", "Internal Username" => "Внутреннее имя пользователя", +"By default the internal username will be created from the UUID attribute. It makes sure that the username is unique and characters do not need to be converted. The internal username has the restriction that only these characters are allowed: [ a-zA-Z0-9_.@- ]. Other characters are replaced with their ASCII correspondence or simply omitted. On collisions a number will be added/increased. The internal username is used to identify a user internally. It is also the default name for the user home folder. It is also a part of remote URLs, for instance for all *DAV services. With this setting, the default behavior can be overridden. To achieve a similar behavior as before ownCloud 5 enter the user display name attribute in the following field. Leave it empty for default behavior. Changes will have effect only on newly mapped (added) LDAP users." => "По-умолчанию внутреннее имя пользователя будет создано из атрибута UUID. Таким образом имя пользователя становится уникальным и не требует конвертации символов. Внутреннее имя пользователя может состоять только из следующих символов: [ a-zA-Z0-9_.@- ]. Остальные символы замещаются соответствиями из таблицы ASCII или же просто пропускаются. При совпадении к имени будет добавлено число. Внутреннее имя пользователя используется для внутренней идентификации пользователя. Также оно является именем по-умолчанию для папки пользователя в ownCloud. Оно также портом для удаленных ссылок, к примеру, для всех сервисов *DAV. С помощию данной настройки можно изменить поведение по-умолчанию. Чтобы достичь поведения, как было настроено до изменения, ownCloud 5 выводит атрибут имени пользователя в этом поле. Оставьте его пустым для режима по-умолчанию. Изменения будут иметь эффект только для новых подключенных (добавленных) пользователей LDAP.", "Internal Username Attribute:" => "Аттрибут для внутреннего имени:", "Override UUID detection" => "Переопределить нахождение UUID", +"By default, the UUID attribute is automatically detected. The UUID attribute is used to doubtlessly identify LDAP users and groups. Also, the internal username will be created based on the UUID, if not specified otherwise above. You can override the setting and pass an attribute of your choice. You must make sure that the attribute of your choice can be fetched for both users and groups and it is unique. Leave it empty for default behavior. Changes will have effect only on newly mapped (added) LDAP users and groups." => "По-умолчанию, ownCloud определяет атрибут UUID автоматически. Этот атрибут используется для того, чтобы достоверно индентифицировать пользователей и группы LDAP. Также, на основании атрибута UUID создается внутреннее имя пользователя, если выше не указано иначе. Вы можете переопределить эту настройку и указать свой атрибут по выбору. Вы должны удостовериться, что выбранный вами атрибут может быть выбран для пользователей и групп, а также то, что он уникальный. Оставьте поле пустым для поведения по-умолчанию. Изменения вступят в силу только для новых подключенных (добавленных) пользователей и групп LDAP.", "UUID Attribute:" => "Аттрибут для UUID:", "Username-LDAP User Mapping" => "Соответствия Имя-Пользователь LDAP", +"Usernames are used to store and assign (meta) data. In order to precisely identify and recognize users, each LDAP user will have a internal username. This requires a mapping from username to LDAP user. The created username is mapped to the UUID of the LDAP user. Additionally the DN is cached as well to reduce LDAP interaction, but it is not used for identification. If the DN changes, the changes will be found. The internal username is used all over. Clearing the mappings will have leftovers everywhere. Clearing the mappings is not configuration sensitive, it affects all LDAP configurations! Never clear the mappings in a production environment, only in a testing or experimental stage." => "ownCloud использует имена пользователей для хранения и назначения метаданных. Для точной идентификации и распознавания пользователей, каждый пользователь LDAP будет иметь свое внутреннее имя пользователя. Это требует привязки имени пользователя ownCloud к пользователю LDAP. При создании имя пользователя назначается идентификатору UUID пользователя LDAP. Помимо этого кешируется доменное имя (DN) для уменьшения числа обращений к LDAP, однако оно не используется для идентификации. Если доменное имя было изменено, об этом станет известно ownCloud. Внутреннее имя ownCloud используется повсеместно в ownCloud. После сброса привязок в базе могут сохраниться остатки старой информации. Сброс привязок не привязан к конфигурации, он повлияет на все LDAP подключения! Ни в коем случае не рекомендуется сбрасывать привязки если система уже находится в эксплуатации, только на этапе тестирования.", "Clear Username-LDAP User Mapping" => "Очистить соответствия Имя-Пользователь LDAP", "Clear Groupname-LDAP Group Mapping" => "Очистить соответствия Группа-Группа LDAP", "Test Configuration" => "Тестовая конфигурация", diff --git a/apps/user_ldap/l10n/sk_SK.php b/apps/user_ldap/l10n/sk_SK.php index c5bb6a8a50c3f17abefdde988c2e096b29291be1..df71a71e933b5463b3b6ec70c4a162a7582b77bc 100644 --- a/apps/user_ldap/l10n/sk_SK.php +++ b/apps/user_ldap/l10n/sk_SK.php @@ -30,8 +30,11 @@ $TRANSLATIONS = array( "Password" => "Heslo", "For anonymous access, leave DN and Password empty." => "Pre anonymný prístup ponechajte údaje DN a Heslo prázdne.", "User Login Filter" => "Filter prihlásenia používateľov", +"Defines the filter to apply, when login is attempted. %%uid replaces the username in the login action. Example: \"uid=%%uid\"" => "Určuje použitý filter, pri pokuse o prihlásenie. %%uid nahradzuje používateľské meno v činnosti prihlásenia. Napríklad: \"uid=%%uid\"", "User List Filter" => "Filter zoznamov používateľov", +"Defines the filter to apply, when retrieving users (no placeholders). Example: \"objectClass=person\"" => "Definuje použitý filter, pri získavaní používateľov (bez \"placeholderov\"). Napríklad: \"objectClass=osoba\"", "Group Filter" => "Filter skupiny", +"Defines the filter to apply, when retrieving groups (no placeholders). Example: \"objectClass=posixGroup\"" => "Definuje použitý filter, pri získavaní skupín (bez \"placeholderov\"). Napríklad: \"objectClass=posixSkupina\"", "Connection Settings" => "Nastavenie pripojenia", "Configuration Active" => "Nastavenia sú aktívne ", "When unchecked, this configuration will be skipped." => "Ak nie je zaškrtnuté, nastavenie bude preskočené.", @@ -45,6 +48,7 @@ $TRANSLATIONS = array( "Do not use it additionally for LDAPS connections, it will fail." => "Nepoužívajte pre pripojenie LDAPS, zlyhá.", "Case insensitve LDAP server (Windows)" => "LDAP server nerozlišuje veľkosť znakov (Windows)", "Turn off SSL certificate validation." => "Vypnúť overovanie SSL certifikátu.", +"Not recommended, use it for testing only! If connection only works with this option, import the LDAP server's SSL certificate in your %s server." => "Neodporúčané, použite iba pri testovaní! Pokiaľ spojenie funguje iba z daným nastavením, importujte SSL certifikát LDAP servera do vášho %s servera.", "Cache Time-To-Live" => "Životnosť objektov v cache", "in seconds. A change empties the cache." => "v sekundách. Zmena vyprázdni vyrovnávaciu pamäť.", "Directory Settings" => "Nastavenie priečinka", diff --git a/apps/user_ldap/l10n/sr@latin.php b/apps/user_ldap/l10n/sr@latin.php index 07db505ecf338e8baee5dd1267f696579f433355..24fff94fc656d41d6563bc7dfa76e748025dbcc1 100644 --- a/apps/user_ldap/l10n/sr@latin.php +++ b/apps/user_ldap/l10n/sr@latin.php @@ -1,5 +1,6 @@ "Greška", "Password" => "Lozinka", "Help" => "Pomoć" ); diff --git a/apps/user_ldap/l10n/sv.php b/apps/user_ldap/l10n/sv.php index c7fb33195d74de4267a08077cd35ea18665e6648..3288438c09b94a44617d0b14ece333e530510984 100644 --- a/apps/user_ldap/l10n/sv.php +++ b/apps/user_ldap/l10n/sv.php @@ -30,8 +30,11 @@ $TRANSLATIONS = array( "Password" => "Lösenord", "For anonymous access, leave DN and Password empty." => "För anonym åtkomst, lämna DN och lösenord tomt.", "User Login Filter" => "Filter logga in användare", +"Defines the filter to apply, when login is attempted. %%uid replaces the username in the login action. Example: \"uid=%%uid\"" => "Definierar filter som tillämpas vid inloggning. %%uid ersätter användarnamn vid inloggningen. Exempel: \"uid=%%uid\"", "User List Filter" => "Filter lista användare", +"Defines the filter to apply, when retrieving users (no placeholders). Example: \"objectClass=person\"" => "Definierar filter som tillämpas vid sökning efter användare (inga platshållare). Exempel: \"objectClass=person\"", "Group Filter" => "Gruppfilter", +"Defines the filter to apply, when retrieving groups (no placeholders). Example: \"objectClass=posixGroup\"" => "Definierar filter som tillämpas vid sökning efter grupper (inga platshållare). Exempel: \"objectClass=posixGroup\"", "Connection Settings" => "Uppkopplingsinställningar", "Configuration Active" => "Konfiguration aktiv", "When unchecked, this configuration will be skipped." => "Ifall denna är avbockad så kommer konfigurationen att skippas.", @@ -45,6 +48,7 @@ $TRANSLATIONS = array( "Do not use it additionally for LDAPS connections, it will fail." => "Använd inte för LDAPS-anslutningar, det kommer inte att fungera.", "Case insensitve LDAP server (Windows)" => "LDAP-servern är okänslig för gemener och versaler (Windows)", "Turn off SSL certificate validation." => "Stäng av verifiering av SSL-certifikat.", +"Not recommended, use it for testing only! If connection only works with this option, import the LDAP server's SSL certificate in your %s server." => "Rekommenderas inte, använd endast för test! Om anslutningen bara fungerar med denna inställning behöver du importera LDAP-serverns SSL-certifikat till din %s server.", "Cache Time-To-Live" => "Cache Time-To-Live", "in seconds. A change empties the cache." => "i sekunder. En förändring tömmer cache.", "Directory Settings" => "Mappinställningar", diff --git a/apps/user_webdavauth/l10n/de_CH.php b/apps/user_webdavauth/l10n/de_CH.php new file mode 100644 index 0000000000000000000000000000000000000000..2c31957d2515627eae7aa19daa946e6291568a44 --- /dev/null +++ b/apps/user_webdavauth/l10n/de_CH.php @@ -0,0 +1,7 @@ + "WebDAV-Authentifizierung", +"Address: " => "Adresse:", +"The user credentials will be sent to this address. This plugin checks the response and will interpret the HTTP statuscodes 401 and 403 as invalid credentials, and all other responses as valid credentials." => "Die Benutzerdaten werden an diese Adresse gesendet. Dieses Plugin prüft die Antwort und wird die HTTP-Statuscodes 401 und 403 als ungültige Daten interpretieren und alle anderen Antworten als gültige Daten." +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/user_webdavauth/l10n/en_GB.php b/apps/user_webdavauth/l10n/en_GB.php new file mode 100644 index 0000000000000000000000000000000000000000..c0982083377141e2f7e89bb27d504197c6396c7a --- /dev/null +++ b/apps/user_webdavauth/l10n/en_GB.php @@ -0,0 +1,7 @@ + "WebDAV Authentication", +"Address: " => "Address: ", +"The user credentials will be sent to this address. This plugin checks the response and will interpret the HTTP statuscodes 401 and 403 as invalid credentials, and all other responses as valid credentials." => "The user credentials will be sent to this address. This plugin checks the response and will interpret the HTTP statuscodes 401 and 403 as invalid credentials, and all other responses as valid credentials." +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/user_webdavauth/l10n/es.php b/apps/user_webdavauth/l10n/es.php index cd8ec6659a4f519e21a8b333282215c3555e0f6b..951aabe24aed434a87e6cf46c4f298c41920ac8b 100644 --- a/apps/user_webdavauth/l10n/es.php +++ b/apps/user_webdavauth/l10n/es.php @@ -1,7 +1,7 @@ "Autenticación de WevDAV", +"WebDAV Authentication" => "Autenticación mediante WevDAV", "Address: " => "Dirección:", -"The user credentials will be sent to this address. This plugin checks the response and will interpret the HTTP statuscodes 401 and 403 as invalid credentials, and all other responses as valid credentials." => "onwCloud enviará las credenciales de usuario a esta dirección. Este complemento verifica la respuesta e interpretará los códigos de respuesta HTTP 401 y 403 como credenciales inválidas y todas las otras respuestas como credenciales válidas." +"The user credentials will be sent to this address. This plugin checks the response and will interpret the HTTP statuscodes 401 and 403 as invalid credentials, and all other responses as valid credentials." => "Las credenciales de usuario se enviarán a esta dirección. Este complemento verifica la respuesta e interpretará los códigos de respuesta HTTP 401 y 403 como credenciales inválidas y todas las otras respuestas como credenciales válidas." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/user_webdavauth/l10n/es_AR.php b/apps/user_webdavauth/l10n/es_AR.php index 608b0ad817938738d8db88727e0427e45e81a36f..4ec0bf5a626c55dd0429a983fc89b0f611a702af 100644 --- a/apps/user_webdavauth/l10n/es_AR.php +++ b/apps/user_webdavauth/l10n/es_AR.php @@ -1,5 +1,7 @@ "Autenticación de WevDAV" +"WebDAV Authentication" => "Autenticación de WebDAV", +"Address: " => "Dirección:", +"The user credentials will be sent to this address. This plugin checks the response and will interpret the HTTP statuscodes 401 and 403 as invalid credentials, and all other responses as valid credentials." => "Las credenciales del usuario serán enviadas a esta dirección. Este plug-in verificará la respuesta e interpretará los códigos de estado HTTP 401 y 403 como credenciales inválidas y cualquier otra respuesta como válida." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/user_webdavauth/l10n/fa.php b/apps/user_webdavauth/l10n/fa.php new file mode 100644 index 0000000000000000000000000000000000000000..ad061226d43f20b9bdf3f80d6c5947f4cc629a69 --- /dev/null +++ b/apps/user_webdavauth/l10n/fa.php @@ -0,0 +1,5 @@ + "اعتبار سنجی WebDAV " +); +$PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/user_webdavauth/l10n/fr.php b/apps/user_webdavauth/l10n/fr.php index 0130e35c816a62fca579fffc657d50226d1a421c..709fa53dac5b807362b794bb588f020d0917da16 100644 --- a/apps/user_webdavauth/l10n/fr.php +++ b/apps/user_webdavauth/l10n/fr.php @@ -1,5 +1,7 @@ "Authentification WebDAV" +"WebDAV Authentication" => "Authentification WebDAV", +"Address: " => "Adresse :", +"The user credentials will be sent to this address. This plugin checks the response and will interpret the HTTP statuscodes 401 and 403 as invalid credentials, and all other responses as valid credentials." => "Les informations de connexion de l'utilisateur seront envoyées à cette adresse. Ce module analyse le code de la réponse HTTP et considère les codes 401 et 403 comme une authentification invalide et tout autre valeur comme une authentification valide." ); $PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/apps/user_webdavauth/l10n/hu_HU.php b/apps/user_webdavauth/l10n/hu_HU.php index 63fc084ff4cf7f2a73754d3f960d3db8f8eb9cdc..0b946e25e70fa212f198c9076bb835c42b1c02a0 100644 --- a/apps/user_webdavauth/l10n/hu_HU.php +++ b/apps/user_webdavauth/l10n/hu_HU.php @@ -1,5 +1,7 @@ "WebDAV hitelesítés" +"WebDAV Authentication" => "WebDAV hitelesítés", +"Address: " => "Címek:", +"The user credentials will be sent to this address. This plugin checks the response and will interpret the HTTP statuscodes 401 and 403 as invalid credentials, and all other responses as valid credentials." => "A felhasználói hitelesítő adatai el lesznek küldve erre a címre. Ez a bővítőmodul leellenőrzi a választ és ha a HTTP hibakód nem 401 vagy 403 azaz érvénytelen a hitelesítő adat, akkor minden más válasz érvényes lesz." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/user_webdavauth/l10n/lt_LT.php b/apps/user_webdavauth/l10n/lt_LT.php index 90fc2d5ac3ef78e253f0e061694a9a331e719141..41a7fa9502d52832ac244ad9d05e3d2acb3b97fc 100644 --- a/apps/user_webdavauth/l10n/lt_LT.php +++ b/apps/user_webdavauth/l10n/lt_LT.php @@ -1,5 +1,7 @@ "WebDAV autorizavimas" +"WebDAV Authentication" => "WebDAV autentikacija", +"Address: " => "Adresas:", +"The user credentials will be sent to this address. This plugin checks the response and will interpret the HTTP statuscodes 401 and 403 as invalid credentials, and all other responses as valid credentials." => "Naudotojo duomenys bus nusiųsti šiuo adresu. Šis įskiepis patikrins gautą atsakymą ir interpretuos HTTP būsenos kodą 401 ir 403 kaip negaliojančius duomenis, ir visus kitus gautus atsakymus kaip galiojančius duomenis. " ); $PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/apps/user_webdavauth/l10n/nn_NO.php b/apps/user_webdavauth/l10n/nn_NO.php index 519b942f9f53b750709090673b377bdbba73c61b..909231b5f5826ca6c91bd72e77bec3bc5b03d24e 100644 --- a/apps/user_webdavauth/l10n/nn_NO.php +++ b/apps/user_webdavauth/l10n/nn_NO.php @@ -1,5 +1,7 @@ "WebDAV-autentisering" +"WebDAV Authentication" => "WebDAV-autentisering", +"Address: " => "Adresse:", +"The user credentials will be sent to this address. This plugin checks the response and will interpret the HTTP statuscodes 401 and 403 as invalid credentials, and all other responses as valid credentials." => "Innloggingsinformasjon blir sendt til denne nettadressa. Dette programtillegget kontrollerer svaret og tolkar HTTP-statuskodane 401 og 403 som ugyldige, og alle andre svar som gyldige." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/user_webdavauth/l10n/uk.php b/apps/user_webdavauth/l10n/uk.php index fcde044ec753d256dea8b03b62b13f09ebeca92f..dff8b308c5d5f0f2ba36c02b34d8f9977b6e63f4 100644 --- a/apps/user_webdavauth/l10n/uk.php +++ b/apps/user_webdavauth/l10n/uk.php @@ -1,5 +1,6 @@ "Аутентифікація WebDAV" +"WebDAV Authentication" => "Аутентифікація WebDAV", +"Address: " => "Адреса:" ); $PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/apps/user_webdavauth/l10n/zh_CN.php b/apps/user_webdavauth/l10n/zh_CN.php index 69046042160cdb6cde7fd9e865d648bc613d5c9d..a225ea7f577edf1c76ee2a0e43e65c7b194b27a6 100644 --- a/apps/user_webdavauth/l10n/zh_CN.php +++ b/apps/user_webdavauth/l10n/zh_CN.php @@ -1,5 +1,7 @@ "WebDAV 认证" +"WebDAV Authentication" => "WebDAV 认证", +"Address: " => "地址:", +"The user credentials will be sent to this address. This plugin checks the response and will interpret the HTTP statuscodes 401 and 403 as invalid credentials, and all other responses as valid credentials." => "用户的身份将会被发送到此 URL。这个插件检查返回值并且将 HTTP 状态编码 401 和 403 解释为非法身份,其他所有返回值为合法身份。" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/autotest.sh b/autotest.sh index a343f6a25ab7bb887b2d1135614e9229316315e3..83f184fa9c065fa12088d700536b4405d4b57182 100755 --- a/autotest.sh +++ b/autotest.sh @@ -142,12 +142,7 @@ EOF rm -rf coverage-html-$1 mkdir coverage-html-$1 php -f enable_all.php - if [ "$1" == "sqlite" ] ; then - # coverage only with sqlite - causes segfault on ci.tmit.eu - reason unknown - phpunit --configuration phpunit-autotest.xml --log-junit autotest-results-$1.xml --coverage-clover autotest-clover-$1.xml --coverage-html coverage-html-$1 $2 $3 - else - phpunit --configuration phpunit-autotest.xml --log-junit autotest-results-$1.xml $2 $3 - fi + phpunit --configuration phpunit-autotest.xml --log-junit autotest-results-$1.xml --coverage-clover autotest-clover-$1.xml --coverage-html coverage-html-$1 $2 $3 } # diff --git a/config/config.sample.php b/config/config.sample.php index 24ba541ac5c8d5f268df6b66db305a0aafc42bb4..29085af4716240f866ad22087180fc86cab2edda 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -71,9 +71,6 @@ $CONFIG = array( /* Enable the help menu item in the settings */ "knowledgebaseenabled" => true, -/* URL to use for the help page, server should understand OCS */ -"knowledgebaseurl" => "http://api.apps.owncloud.com/v1", - /* Enable installing apps from the appstore */ "appstoreenabled" => true, @@ -141,10 +138,22 @@ $CONFIG = array( /* Loglevel to start logging at. 0=DEBUG, 1=INFO, 2=WARN, 3=ERROR (default is WARN) */ "loglevel" => "", +/* date format to be used while writing to the owncloud logfile */ +'logdateformat' => 'F d, Y H:i:s', + /* Append all database queries and parameters to the log file. (watch out, this option can increase the size of your log file)*/ "log_query" => false, +/* + * Configure the size in bytes log rotation should happen, 0 or false disables the rotation. + * This rotates the current owncloud logfile to a new name, this way the total log usage + * will stay limited and older entries are available for a while longer. The + * total disk usage is twice the configured size. + * WARNING: When you use this, the log entries will eventually be lost. + */ +'log_rotate_size' => false, // 104857600, // 100 MiB + /* Lifetime of the remember login cookie, default is 15 days */ "remember_login_cookie_lifetime" => 60*60*24*15, @@ -190,6 +199,24 @@ $CONFIG = array( 'customclient_android' => '', //https://play.google.com/store/apps/details?id=com.owncloud.android 'customclient_ios' => '', //https://itunes.apple.com/us/app/owncloud/id543672169?mt=8 -// date format to be used while writing to the owncloud logfile -'logdateformat' => 'F d, Y H:i:s' +// PREVIEW +'enable_previews' => true, +/* the max width of a generated preview, if value is null, there is no limit */ +'preview_max_x' => null, +/* the max height of a generated preview, if value is null, there is no limit */ +'preview_max_y' => null, +/* the max factor to scale a preview, default is set to 10 */ +'preview_max_scale_factor' => 10, +/* custom path for libreoffice / openoffice binary */ +'preview_libreoffice_path' => '/usr/bin/libreoffice', +/* cl parameters for libreoffice / openoffice */ +'preview_office_cl_parameters' => '', + +/* whether avatars should be enabled */ +'enable_avatars' => true, + +// Extra SSL options to be used for configuration +'openssl' => array( + //'config' => '/absolute/location/of/openssl.cnf', +), ); diff --git a/console.php b/console.php index 4aec5bdc24ffe1bb32ca0ddb0d9bc8f1b4499457..25b8b312539309e2c4ff8b4dcdb29d98602e7470 100644 --- a/console.php +++ b/console.php @@ -6,6 +6,8 @@ * See the COPYING-README file. */ +use Symfony\Component\Console\Application; + $RUNTIME_NOAPPS = true; require_once 'lib/base.php'; @@ -20,17 +22,13 @@ if (!OC::$CLI) { exit(0); } -if ($argc <= 1) { - echo "Usage:" . PHP_EOL; - echo " " . basename($argv[0]) . " " . PHP_EOL; - exit(0); -} - -$command = $argv[1]; -array_shift($argv); - -if ($command === 'files:scan') { - require_once 'apps/files/console/scan.php'; -} else { - echo "Unknown command '$command'" . PHP_EOL; +$defaults = new OC_Defaults; +$application = new Application($defaults->getName(), \OC_Util::getVersionString()); +require_once 'core/register_command.php'; +foreach(OC_App::getAllApps() as $app) { + $file = OC_App::getAppPath($app).'/appinfo/register_command.php'; + if(file_exists($file)) { + require $file; + } } +$application->run(); diff --git a/core/ajax/preview.php b/core/ajax/preview.php new file mode 100644 index 0000000000000000000000000000000000000000..af0f0493f4ce67e8e7706ab2709f1a7afe930312 --- /dev/null +++ b/core/ajax/preview.php @@ -0,0 +1,40 @@ +setFile($file); + $preview->setMaxX($maxX); + $preview->setMaxY($maxY); + $preview->setScalingUp($scalingUp); + + $preview->show(); +}catch(\Exception $e) { + \OC_Response::setStatus(500); + \OC_Log::write('core', $e->getmessage(), \OC_Log::DEBUG); +} \ No newline at end of file diff --git a/core/ajax/share.php b/core/ajax/share.php index bdcb61284ecdd8603a7165790c4d7420fed49d53..648f0a71bd44da7c93fbaccb88388c7db92aac99 100644 --- a/core/ajax/share.php +++ b/core/ajax/share.php @@ -181,10 +181,10 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo // } // } // } + $groups = OC_Group::getGroups($_GET['search']); if ($sharePolicy == 'groups_only') { - $groups = OC_Group::getUserGroups(OC_User::getUser()); - } else { - $groups = OC_Group::getGroups(); + $usergroups = OC_Group::getUserGroups(OC_User::getUser()); + $groups = array_intersect($groups, $usergroups); } $count = 0; $users = array(); @@ -213,15 +213,18 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo } } $count = 0; + + // enable l10n support + $l = OC_L10N::get('core'); + foreach ($groups as $group) { if ($count < 15) { - if (stripos($group, $_GET['search']) !== false - && (!isset($_GET['itemShares']) + if (!isset($_GET['itemShares']) || !isset($_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]) || !is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]) - || !in_array($group, $_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]))) { + || !in_array($group, $_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP])) { $shareWith[] = array( - 'label' => $group.' (group)', + 'label' => $group.' ('.$l->t('group').')', 'value' => array( 'shareType' => OCP\Share::SHARE_TYPE_GROUP, 'shareWith' => $group diff --git a/core/avatar/controller.php b/core/avatar/controller.php new file mode 100644 index 0000000000000000000000000000000000000000..22693824461d70fe87d8c1c0ee13db9bbce0621e --- /dev/null +++ b/core/avatar/controller.php @@ -0,0 +1,158 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OC\Core\Avatar; + +class Controller { + public static function getAvatar($args) { + \OC_JSON::checkLoggedIn(); + \OC_JSON::callCheck(); + + $user = stripslashes($args['user']); + $size = (int)$args['size']; + if ($size > 2048) { + $size = 2048; + } + // Undefined size + elseif ($size === 0) { + $size = 64; + } + + $avatar = new \OC_Avatar($user); + $image = $avatar->get($size); + + \OC_Response::disableCaching(); + \OC_Response::setLastModifiedHeader(time()); + if ($image instanceof \OC_Image) { + \OC_Response::setETagHeader(crc32($image->data())); + $image->show(); + } else { + // Signalizes $.avatar() to display a defaultavatar + \OC_JSON::success(array("data"=> array("displayname"=> \OC_User::getDisplayName($user)) )); + } + } + + public static function postAvatar($args) { + \OC_JSON::checkLoggedIn(); + \OC_JSON::callCheck(); + + $user = \OC_User::getUser(); + + if (isset($_POST['path'])) { + $path = stripslashes($_POST['path']); + $view = new \OC\Files\View('/'.$user.'/files'); + $newAvatar = $view->file_get_contents($path); + } elseif (!empty($_FILES)) { + $files = $_FILES['files']; + if ( + $files['error'][0] === 0 && + is_uploaded_file($files['tmp_name'][0]) && + !\OC\Files\Filesystem::isFileBlacklisted($files['tmp_name'][0]) + ) { + $newAvatar = file_get_contents($files['tmp_name'][0]); + unlink($files['tmp_name'][0]); + } + } else { + $l = new \OC_L10n('core'); + \OC_JSON::error(array("data" => array("message" => $l->t("No image or file provided")) )); + return; + } + + try { + $avatar = new \OC_Avatar($user); + $avatar->set($newAvatar); + \OC_JSON::success(); + } catch (\OC\NotSquareException $e) { + $image = new \OC_Image($newAvatar); + + if ($image->valid()) { + \OC_Cache::set('tmpavatar', $image->data(), 7200); + \OC_JSON::error(array("data" => "notsquare")); + } else { + $l = new \OC_L10n('core'); + + $mimeType = $image->mimeType(); + if ($mimeType !== 'image/jpeg' && $mimeType !== 'image/png') { + \OC_JSON::error(array("data" => array("message" => $l->t("Unknown filetype")) )); + } + + if (!$image->valid()) { + \OC_JSON::error(array("data" => array("message" => $l->t("Invalid image")) )); + } + } + } catch (\Exception $e) { + \OC_JSON::error(array("data" => array("message" => $e->getMessage()) )); + } + } + + public static function deleteAvatar($args) { + \OC_JSON::checkLoggedIn(); + \OC_JSON::callCheck(); + + $user = \OC_User::getUser(); + + try { + $avatar = new \OC_Avatar($user); + $avatar->remove(); + \OC_JSON::success(); + } catch (\Exception $e) { + \OC_JSON::error(array("data" => array("message" => $e->getMessage()) )); + } + } + + public static function getTmpAvatar($args) { + \OC_JSON::checkLoggedIn(); + \OC_JSON::callCheck(); + + $tmpavatar = \OC_Cache::get('tmpavatar'); + if (is_null($tmpavatar)) { + $l = new \OC_L10n('core'); + \OC_JSON::error(array("data" => array("message" => $l->t("No temporary profile picture available, try again")) )); + return; + } + + $image = new \OC_Image($tmpavatar); + \OC_Response::disableCaching(); + \OC_Response::setLastModifiedHeader(time()); + \OC_Response::setETagHeader(crc32($image->data())); + $image->show(); + } + + public static function postCroppedAvatar($args) { + \OC_JSON::checkLoggedIn(); + \OC_JSON::callCheck(); + + $user = \OC_User::getUser(); + if (isset($_POST['crop'])) { + $crop = $_POST['crop']; + } else { + $l = new \OC_L10n('core'); + \OC_JSON::error(array("data" => array("message" => $l->t("No crop data provided")) )); + return; + } + + $tmpavatar = \OC_Cache::get('tmpavatar'); + if (is_null($tmpavatar)) { + $l = new \OC_L10n('core'); + \OC_JSON::error(array("data" => array("message" => $l->t("No temporary profile picture available, try again")) )); + return; + } + + $image = new \OC_Image($tmpavatar); + $image->crop($crop['x'], $crop['y'], $crop['w'], $crop['h']); + try { + $avatar = new \OC_Avatar($user); + $avatar->set($image->data()); + // Clean up + \OC_Cache::remove('tmpavatar'); + \OC_JSON::success(); + } catch (\Exception $e) { + \OC_JSON::error(array("data" => array("message" => $e->getMessage()) )); + } + } +} diff --git a/core/command/status.php b/core/command/status.php new file mode 100644 index 0000000000000000000000000000000000000000..ea9825b0f619fbf4006335fa68e5867dd348a604 --- /dev/null +++ b/core/command/status.php @@ -0,0 +1,34 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OC\Core\Command; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +class Status extends Command { + protected function configure() { + $this + ->setName('status') + ->setDescription('show some status information') + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) { + $values = array( + 'installed' => \OC_Config::getValue('installed') ? 'true' : 'false', + 'version' => implode('.', \OC_Util::getVersion()), + 'versionstring' => \OC_Util::getVersionString(), + 'edition' => \OC_Util::getEditionString(), + ); + print_r($values); + } +} diff --git a/core/css/apps.css b/core/css/apps.css new file mode 100644 index 0000000000000000000000000000000000000000..f6c20e6cc6a420d3da2f854f639ed464bf47c5c2 --- /dev/null +++ b/core/css/apps.css @@ -0,0 +1,238 @@ +/* ---- APP STYLING ---- */ + +#app { + height: 100%; + width: 100%; +} +#app * { + -moz-box-sizing: border-box; box-sizing: border-box; +} + +/* Navigation: folder like structure */ +#app-navigation { + width: 300px; + height: 100%; + float: left; + -moz-box-sizing: border-box; box-sizing: border-box; + background-color: #f8f8f8; + border-right: 1px solid #ccc; + padding-bottom: 44px; +} +#app-navigation > ul { + height: 100%; + overflow: auto; + -moz-box-sizing: border-box; box-sizing: border-box; +} +#app-navigation li { + position: relative; + width: 100%; + -moz-box-sizing: border-box; box-sizing: border-box; + text-shadow: 0 1px 0 rgba(255,255,255,.9); +} +#app-navigation .active, +#app-navigation .active a, +#app-navigation li:hover > a { + background-color: #ddd; + text-shadow: 0 1px 0 rgba(255,255,255,.7); +} + +/* special rules for first-level entries and folders */ +#app-navigation > ul > li { + background-color: #f8f8f8; +} + +#app-navigation .with-icon a { + padding-left: 44px; + background-size: 16px 16px; + background-position: 14px center; + background-repeat: no-repeat; +} + +#app-navigation li > a { + display: block; + width: 100%; + line-height: 44px; + padding: 0 12px; + overflow: hidden; + -moz-box-sizing: border-box; box-sizing: border-box; + white-space: nowrap; + text-overflow: ellipsis; + color: #333; +} + +#app-navigation .collapse { + display: none; /* hide collapse button intially */ +} +#app-navigation .collapsible > .collapse { + position: absolute; + height: 44px; + width: 44px; + margin: 0; + padding: 0; + background: none; background-image: url('../img/actions/triangle-s.svg'); + background-size: 16px; background-repeat: no-repeat; background-position: center; + border: none; + border-radius: 0; + outline: none !important; + box-shadow: none; +} +#app-navigation .collapsible:hover > a { + background-image: none; +} +#app-navigation .collapsible:hover > .collapse { + display: block; +} + +#app-navigation .collapsible .collapse { + -moz-transform: rotate(-90deg); + -webkit-transform: rotate(-90deg); + -ms-transform:rotate(-90deg); + -o-transform:rotate(-90deg); + transform: rotate(-90deg); +} +#app-navigation .collapsible.open .collapse { + -moz-transform: rotate(0); + -webkit-transform: rotate(0); + -ms-transform:rotate(0); + -o-transform:rotate(0); + transform: rotate(0); +} + +/* Second level nesting for lists */ +#app-navigation > ul ul { + display: none; +} +#app-navigation > ul ul li > a { + padding-left: 32px; +} +#app-navigation > .with-icon ul li > a { + padding-left: 48px; + background-position: 24px center; +} + +#app-navigation .open { + background-image: linear-gradient(top, rgb(238,238,238) 0%, rgb(245,245,245) 100%); + background-image: -o-linear-gradient(top, rgb(238,238,238) 0%, rgb(245,245,245) 100%); + background-image: -moz-linear-gradient(top, rgb(238,238,238) 0%, rgb(245,245,245) 100%); + background-image: -webkit-linear-gradient(top, rgb(238,238,238) 0%, rgb(245,245,245) 100%); + background-image: -ms-linear-gradient(top, rgb(238,238,238) 0%, rgb(245,245,245) 100%); +} + +#app-navigation > ul .open:hover { + -moz-box-shadow: inset 0 0 3px #ccc; -webkit-box-shadow: inset 0 0 3px #ccc; box-shadow: inset 0 0 3px #ccc; +} + +#app-navigation > ul .open ul { + display: block; +} + + +/* counter and actions */ +#app-navigation .utils { + position: absolute; + padding: 7px 7px 0 0; + right: 0; + top: 0; + bottom: 0; + font-size: 12px; +} + #app-navigation .utils button, + #app-navigation .utils .counter { + width: 44px; + height: 44px; + padding-top: 12px; + } + + +/* drag and drop */ +#app-navigation .drag-and-drop { + -moz-transition: padding-bottom 500ms ease 0s; + -o-transition: padding-bottom 500ms ease 0s; + -webkit-transition: padding-bottom 500ms ease 0s; + -ms-transition: padding-bottom 500ms ease 0s; + transition: padding-bottom 500ms ease 0s; + padding-bottom: 40px; +} +#app-navigation .personalblock > legend { /* TODO @Raydiation: still needed? */ + padding: 10px 0; margin: 0; +} +#app-navigation .error { + color: #dd1144; +} + +#app-navigation .app-navigation-separator { + border-bottom: 1px solid #ddd; +} + + + +/* Part where the content will be loaded into */ +#app-content { + height: 100%; + overflow-y: auto; +} + +/* settings area */ +#app-settings { + position: fixed; + width: 299px; + bottom: 0; + border-top: 1px solid #ccc; +} +#app-settings-header { + background-color: #eee; +} +#app-settings-content { + display: none; + padding: 10px; + background-color: #eee; +} +#app-settings.open #app-settings-content { + display: block; +} + +.settings-button { + display: block; + height: 44px; + width: 100%; + padding: 0; + margin: 0; + background-color: transparent; background-image: url('../img/actions/settings.svg'); + background-position: 10px center; background-repeat: no-repeat; + box-shadow: none; + border: 0; + border-radius: 0; +} +.settings-button:hover { + background-color: #ddd; +} + +/* icons */ +.folder-icon, .delete-icon, .edit-icon, .progress-icon { + background-repeat: no-repeat; + background-position: center; +} +.folder-icon { background-image: url('../img/places/folder.svg'); } +.delete-icon { background-image: url('../img/actions/delete.svg'); } +.delete-icon:hover, .delete-icon:focus { + background-image: url('../img/actions/delete-hover.svg'); +} +.edit-icon { background-image: url('../img/actions/rename.svg'); } +.progress-icon { + background-image: url('../img/loading.gif'); + background-size: 16px; + /* force show the loading icon, not only on hover */ + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; + filter:alpha(opacity=100); + opacity: 1 !important; + display: inline !important; +} + +/* buttons */ +button.loading { + background-image: url('../img/loading.gif'); + background-position: right 10px center; background-repeat: no-repeat; + background-size: 16px; + padding-right: 30px; +} + diff --git a/core/css/fixes.css b/core/css/fixes.css new file mode 100644 index 0000000000000000000000000000000000000000..a33bd94bb10f0f3e20015e3f9babc8e07c63e27f --- /dev/null +++ b/core/css/fixes.css @@ -0,0 +1,50 @@ +/* ---- BROWSER-SPECIFIC FIXES ---- */ + +/* remove dotted outlines in Firefox */ +::-moz-focus-inner { + border: 0; +} + +.lte8 .delete-icon { background-image: url('../img/actions/delete.png'); } +.lte8 .delete-icon:hover, .delete-icon:focus { + background-image: url('../img/actions/delete-hover.png'); +} + +/* IE8 needs background to be set to same color to make transparency look good. */ +.lte9 #body-login form input[type="text"] { + border: 1px solid lightgrey; /* use border to add 1px line between input fields */ + background-color: white; /* don't change background on hover */ +} +.lte9 #body-login form input[type="password"] { + /* leave out top border for 1px line between input fields*/ + border-left: 1px solid lightgrey; + border-right: 1px solid lightgrey; + border-bottom: 1px solid lightgrey; + background-color: white; /* don't change background on hover */ +} +.lte9 #body-login form label.infield { + background-color: white; /* don't change background on hover */ + -ms-filter: "progid:DXImageTransform.Microsoft.Chroma(color='white')"; +} + +/* disable opacity of info text on gradient + since we cannot set a good backround color to use the filter&background hack as with the input labels */ +.lte9 #body-login p.info { + filter: initial; +} + +/* deactivate show password toggle for IE. Does not work for 8 and 9+ have their own implementation. */ +.ie #show, .ie #show+label { + display: none; + visibility: hidden; +} + +/* fix installation screen rendering issue for IE8+9 */ +.lte9 #body-login { + height: auto !important; +} + +/* oc-dialog only uses box shadow which is not supported by ie8 */ +.ie8 .oc-dialog { + border: 1px solid #888888; +} diff --git a/core/css/styles.css b/core/css/styles.css index dee0778afbb3edeeed1d5e4881fec299ea0c35d3..dcdeda8a9c95d7aecf57db686a81bb23f23b8e4f 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -40,6 +40,11 @@ body { background:#fefefe; font:normal .8em/1.6em "Helvetica Neue",Helvetica,Ari .header-right { float:right; vertical-align:middle; padding:0.5em; } .header-right > * { vertical-align:middle; } +#header .avatardiv { + text-shadow: none; + float: left; + display: inline-block; +} /* INPUTS */ input[type="text"], input[type="password"], input[type="search"], input[type="number"], input[type="email"], input[type="url"], @@ -145,18 +150,25 @@ a.disabled, a.disabled:hover, a.disabled:focus { .searchbox input[type="search"] { font-size:1.2em; padding:.2em .5em .2em 1.5em; background:#fff url('../img/actions/search.svg') no-repeat .5em center; border:0; -moz-border-radius:1em; -webkit-border-radius:1em; border-radius:1em; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)"; filter:alpha(opacity=70);opacity:.7; -webkit-transition:opacity 300ms; -moz-transition:opacity 300ms; -o-transition:opacity 300ms; transition:opacity 300ms; margin-top:10px; float:right; } input[type="submit"].enabled { background:#66f866; border:1px solid #5e5; -moz-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #cfc inset; -webkit-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #cfc inset; box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #cfc inset; } -#select_all{ margin-top:.4em } + + /* CONTENT ------------------------------------------------------------------ */ #controls { - position:fixed; - height:2.8em; width:100%; - padding:0 70px 0 0.5em; margin:0; - -moz-box-sizing:border-box; box-sizing:border-box; - -moz-box-shadow:0 -3px 7px #000; -webkit-box-shadow:0 -3px 7px #000; box-shadow:0 -3px 7px #000; - background:#eee; border-bottom:1px solid #e7e7e7; z-index:50; + position: fixed; + height: 36px; + width: 100%; + padding: 0 75px 0 6px; + margin: 0; + background: #eee; + border-bottom: 1px solid #e7e7e7; + z-index: 50; + -moz-box-sizing: border-box; box-sizing: border-box; + -moz-box-shadow: 0 -3px 7px #000; -webkit-box-shadow: 0 -3px 7px #000; box-shadow: 0 -3px 7px #000; +} +#controls .button { + display: inline-block; } -#controls .button { display:inline-block; } #content { position:relative; height:100%; width:100%; } #content .hascontrols { position: relative; top: 2.9em; } @@ -176,7 +188,14 @@ input[type="submit"].enabled { background:#66f866; border:1px solid #5e5; -moz-b #leftcontent a { height:100%; display:block; margin:0; padding:0 1em 0 0; float:left; } #rightcontent, .rightcontent { position:fixed; top:6.4em; left:24.5em; overflow:auto } - +#emptycontent { + font-size:1.5em; font-weight:bold; + color:#888; text-shadow:#fff 0 1px 0; + position: absolute; + text-align: center; + top: 50%; + width: 100%; +} /* LOG IN & INSTALLATION ------------------------------------------------------------ */ @@ -255,9 +274,9 @@ input[name="adminpass-clone"] { padding-left:1.8em; width:11.7em !important; } #body-login input[type="password"], #body-login input[type="email"] { border: 1px solid #323233; - -moz-box-shadow: 0 1px 0 rgba(255,255,255,.15), 0 1px 3px rgba(0,0,0,.25) inset; - -webkit-box-shadow: 0 1px 0 rgba(255,255,255,.15), 0 1px 3px rgba(0,0,0,.25) inset; - box-shadow: 0 1px 0 rgba(255,255,255,.15), 0 1px 3px rgba(0,0,0,.25) inset; + -moz-box-shadow: 0 1px 0 rgba(255,255,255,.15), 0 1px 1px rgba(0,0,0,.25) inset; + -webkit-box-shadow: 0 1px 0 rgba(255,255,255,.15), 0 1px 1px rgba(0,0,0,.25) inset; + box-shadow: 0 1px 0 rgba(255,255,255,.15), 0 1px 1px rgba(0,0,0,.25) inset; } /* Nicely grouping input field sets */ @@ -501,6 +520,9 @@ label.infield { cursor:text !important; top:1.05em; left:.85em; } #navigation:hover { overflow-y: auto; /* show scrollbar only on hover */ } +#apps { + height: 100%; +} #navigation a span { display: block; text-decoration: none; @@ -545,14 +567,39 @@ label.infield { cursor:text !important; top:1.05em; left:.85em; } padding-top: 20px; } +/* Apps management as sticky footer, less obtrusive in the list */ +#navigation .wrapper { + min-height: 100%; + margin: 0 auto -72px; +} +#apps-management, #navigation .push { + height: 70px; +} #apps-management { + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; + filter: alpha(opacity=60); opacity: .6; } +#apps-management .icon { + padding-bottom: 0; +} + + /* USER MENU */ -#settings { float:right; margin-top:7px; color:#bbb; text-shadow:0 -1px 0 #000; } -#expand { padding:15px; cursor:pointer; font-weight:bold; } +#settings { + float: right; + margin-top: 7px; + margin-left: 10px; + color: #bbb; + text-shadow: 0 -1px 0 #000; +} +#expand { + padding: 15px 15px 15px 5px; + cursor: pointer; + font-weight: bold; +} #expand:hover, #expand:focus, #expand:active { color:#fff; } #expand img { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)"; filter:alpha(opacity=70); opacity:.7; margin-bottom:-2px; } #expand:hover img, #expand:focus img, #expand:active img { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter:alpha(opacity=100); opacity:1; } @@ -592,6 +639,7 @@ label.infield { cursor:text !important; top:1.05em; left:.85em; } .hidden { display:none; } .bold { font-weight:bold; } .center { text-align:center; } +.inlineblock { display: inline-block; } #notification-container { position: fixed; top: 0px; width: 100%; text-align: center; z-index: 101; line-height: 1.2;} #notification, #update-notification { z-index:101; background-color:#fc4; border:0; padding:0 .7em .3em; display:none; position: relative; top:0; -moz-border-radius-bottomleft:1em; -webkit-border-bottom-left-radius:1em; border-bottom-left-radius:1em; -moz-border-radius-bottomright:1em; -webkit-border-bottom-right-radius:1em; border-bottom-right-radius:1em; } @@ -658,8 +706,21 @@ a.bookmarklet { background-color:#ddd; border:1px solid #ccc; padding:5px;paddin background-color:white; width:100%; } -#oc-dialog-filepicker-content .filelist img { margin: 2px 1em 0 4px; } -#oc-dialog-filepicker-content .filelist .date { float:right;margin-right:1em; } +#oc-dialog-filepicker-content .filelist li { + position: relative; +} +#oc-dialog-filepicker-content .filelist .filename { + position: absolute; + top: 8px; +} +#oc-dialog-filepicker-content .filelist img { + margin: 2px 1em 0 4px; +} +#oc-dialog-filepicker-content .filelist .date { + float: right; + margin-right: 1em; + margin-top: 8px; +} #oc-dialog-filepicker-content .filepicker_element_selected { background-color:lightblue;} .ui-dialog {position:fixed !important;} span.ui-icon {float: left; margin: 3px 7px 30px 0;} @@ -709,286 +770,3 @@ div.crumb:active { opacity:.7; } - - -/* ---- APP STYLING ---- */ -#app { - height: 100%; - width: 100%; -} -#app * { - -moz-box-sizing: border-box; box-sizing: border-box; -} - -/* Navigation: folder like structure */ -#app-navigation { - width: 300px; - height: 100%; - float: left; - -moz-box-sizing: border-box; box-sizing: border-box; - background-color: #f8f8f8; - border-right: 1px solid #ccc; -} -#app-navigation > ul { - height: 100%; - overflow: auto; - -moz-box-sizing: border-box; box-sizing: border-box; -} -#app-navigation li { - position: relative; - width: 100%; - -moz-box-sizing: border-box; box-sizing: border-box; - text-shadow: 0 1px 0 rgba(255,255,255,.9); -} -#app-navigation .active, -#app-navigation .active a, -#app-navigation li:hover > a { - background-color: #ddd; - text-shadow: 0 1px 0 rgba(255,255,255,.7); -} - -/* special rules for first-level entries and folders */ -#app-navigation > ul > li { - background-color: #f8f8f8; -} - -#app-navigation .with-icon a { - padding-left: 44px; - background-size: 16px 16px; - background-position: 14px center; - background-repeat: no-repeat; -} - -#app-navigation li > a { - display: block; - width: 100%; - height: 44px; - padding: 12px; - overflow: hidden; - -moz-box-sizing: border-box; box-sizing: border-box; - white-space: nowrap; - text-overflow: ellipsis; - color: #333; -} - -#app-navigation .collapse { - display: none; /* hide collapse button intially */ -} -#app-navigation .collapsible > .collapse { - position: absolute; - height: 44px; - width: 44px; - margin: 0; - padding: 0; - background: none; background-image: url('../img/actions/triangle-s.svg'); - background-size: 16px; background-repeat: no-repeat; background-position: center; - border: none; - border-radius: 0; - outline: none !important; - box-shadow: none; -} -#app-navigation .collapsible:hover > a { - background-image: none; -} -#app-navigation .collapsible:hover > .collapse { - display: block; -} - -#app-navigation .collapsible .collapse { - -moz-transform: rotate(-90deg); - -webkit-transform: rotate(-90deg); - -ms-transform:rotate(-90deg); - -o-transform:rotate(-90deg); - transform: rotate(-90deg); -} -#app-navigation .collapsible.open .collapse { - -moz-transform: rotate(0); - -webkit-transform: rotate(0); - -ms-transform:rotate(0); - -o-transform:rotate(0); - transform: rotate(0); -} - -/* Second level nesting for lists */ -#app-navigation > ul ul { - display: none; -} -#app-navigation > ul ul li > a { - padding-left: 32px; -} -#app-navigation > .with-icon ul li > a { - padding-left: 48px; - background-position: 24px center; -} - -#app-navigation .open { - background-image: linear-gradient(top, rgb(238,238,238) 0%, rgb(245,245,245) 100%); - background-image: -o-linear-gradient(top, rgb(238,238,238) 0%, rgb(245,245,245) 100%); - background-image: -moz-linear-gradient(top, rgb(238,238,238) 0%, rgb(245,245,245) 100%); - background-image: -webkit-linear-gradient(top, rgb(238,238,238) 0%, rgb(245,245,245) 100%); - background-image: -ms-linear-gradient(top, rgb(238,238,238) 0%, rgb(245,245,245) 100%); -} - -#app-navigation > ul .open:hover { - -moz-box-shadow: inset 0 0 3px #ccc; -webkit-box-shadow: inset 0 0 3px #ccc; box-shadow: inset 0 0 3px #ccc; -} - -#app-navigation > ul .open ul { - display: block; -} - - -/* counter and actions */ -#app-navigation .utils { - position: absolute; - right: 0; - top: 0; - bottom: 0; - font-size: 12px; -} - #app-navigation .utils button, - #app-navigation .utils .counter { - width: 44px; - height: 44px; - padding-top: 12px; - } - - -/* drag and drop */ -#app-navigation .drag-and-drop { - -moz-transition: padding-bottom 500ms ease 0s; - -o-transition: padding-bottom 500ms ease 0s; - -webkit-transition: padding-bottom 500ms ease 0s; - -ms-transition: padding-bottom 500ms ease 0s; - transition: padding-bottom 500ms ease 0s; - padding-bottom: 40px; -} -#app-navigation .personalblock > legend { /* TODO @Raydiation: still needed? */ - padding: 10px 0; margin: 0; -} -#app-navigation .error { - color: #dd1144; -} - -#app-navigation .app-navigation-separator { - border-bottom: 1px solid #ddd; -} - - - -/* Part where the content will be loaded into */ -#app-content { - height: 100%; - overflow-y: auto; -} - -/* settings area */ -#app-settings { - position: fixed; - width: 299px; - bottom: 0; - border-top: 1px solid #ccc; -} -#app-settings-header { - background-color: #eee; -} -#app-settings-content { - display: none; - padding: 10px; - background-color: #eee; -} -#app-settings.open #app-settings-content { - display: block; -} - -.settings-button { - display: block; - height: 32px; - width: 100%; - padding: 0; - margin: 0; - background-color: transparent; background-image: url('../img/actions/settings.svg'); - background-position: 10px center; background-repeat: no-repeat; - box-shadow: none; - border: 0; - border-radius: 0; -} -.settings-button:hover { - background-color: #ddd; -} - -/* icons */ -.folder-icon, .delete-icon, .edit-icon, .progress-icon { - background-repeat: no-repeat; - background-position: center; -} -.folder-icon { background-image: url('../img/places/folder.svg'); } -.delete-icon { background-image: url('../img/actions/delete.svg'); } -.delete-icon:hover, .delete-icon:focus { - background-image: url('../img/actions/delete-hover.svg'); -} -.edit-icon { background-image: url('../img/actions/rename.svg'); } -.progress-icon { - background-image: url('../img/loading.gif'); - background-size: 16px; - /* force show the loading icon, not only on hover */ - -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; - filter:alpha(opacity=100); - opacity: 1 !important; - display: inline !important; -} - -/* buttons */ -button.loading { - background-image: url('../img/loading.gif'); - background-position: right 10px center; background-repeat: no-repeat; - background-size: 16px; - padding-right: 30px; -} - - - - - -/* ---- BROWSER-SPECIFIC FIXES ---- */ - -/* remove dotted outlines in Firefox */ -::-moz-focus-inner { - border: 0; -} -.lte8 .delete-icon { background-image: url('../img/actions/delete.png'); } -.lte8 .delete-icon:hover, .delete-icon:focus { - background-image: url('../img/actions/delete-hover.png'); -} - -/* IE8 needs background to be set to same color to make transparency look good. */ -.lte9 #body-login form input[type="text"] { - border: 1px solid lightgrey; /* use border to add 1px line between input fields */ - background-color: white; /* don't change background on hover */ -} -.lte9 #body-login form input[type="password"] { - /* leave out top border for 1px line between input fields*/ - border-left: 1px solid lightgrey; - border-right: 1px solid lightgrey; - border-bottom: 1px solid lightgrey; - background-color: white; /* don't change background on hover */ -} -.lte9 #body-login form label.infield { - background-color: white; /* don't change background on hover */ - -ms-filter: "progid:DXImageTransform.Microsoft.Chroma(color='white')"; -} -/* disable opacity of info text on gradient - sice we cannot set a good backround color to use the filter&background hack as with the input labels */ -.lte9 #body-login p.info { - filter: initial; -} -/* deactivate show password toggle for IE. Does not work for 8 and 9+ have their own implementation. */ -.ie #show, .ie #show+label { - display: none; - visibility: hidden; -} - -/* fix installation screen rendering issue for IE8+9 */ -.lte9 #body-login { - height: auto !important; -} diff --git a/core/img/actions/triangle-e.png b/core/img/actions/triangle-e.png new file mode 100644 index 0000000000000000000000000000000000000000..09d398f602e7985787925f20826dc839cde6f7df Binary files /dev/null and b/core/img/actions/triangle-e.png differ diff --git a/core/img/actions/triangle-e.svg b/core/img/actions/triangle-e.svg new file mode 100644 index 0000000000000000000000000000000000000000..c3d908b366f8eda379ba03347060c336d38e0f7d --- /dev/null +++ b/core/img/actions/triangle-e.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/filetypes/application-epub+zip.png b/core/img/filetypes/application-epub+zip.png new file mode 100644 index 0000000000000000000000000000000000000000..b3e3b28b4d51b91305d967d445879de4cf25fcbe Binary files /dev/null and b/core/img/filetypes/application-epub+zip.png differ diff --git a/core/img/filetypes/application-epub+zip.svg b/core/img/filetypes/application-epub+zip.svg new file mode 100644 index 0000000000000000000000000000000000000000..041f9f15e6847977c52600f94b917124ab2ea6ad --- /dev/null +++ b/core/img/filetypes/application-epub+zip.svg @@ -0,0 +1,761 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/application-msexcel.png b/core/img/filetypes/application-msexcel.png deleted file mode 100644 index b977d7e52e2446ea01201c5c7209ac3a05f12c9f..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/application-msexcel.png and /dev/null differ diff --git a/core/img/filetypes/application-mspowerpoint.png b/core/img/filetypes/application-mspowerpoint.png deleted file mode 100644 index c4eff0387d5888c638ba09473ba6d2369f7b56f0..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/application-mspowerpoint.png and /dev/null differ diff --git a/core/img/filetypes/application-msword.png b/core/img/filetypes/application-msword.png deleted file mode 100644 index ae8ecbf47672a874c0958d0d113a56162c2bd364..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/application-msword.png and /dev/null differ diff --git a/core/img/filetypes/application-pdf.png b/core/img/filetypes/application-pdf.png index 8f8095e46fa4965700afe1f9d065d8a37b101676..a9ab6d279b6147ad8d0f6319ecdde08a637c8e70 100644 Binary files a/core/img/filetypes/application-pdf.png and b/core/img/filetypes/application-pdf.png differ diff --git a/core/img/filetypes/application-pdf.svg b/core/img/filetypes/application-pdf.svg new file mode 100644 index 0000000000000000000000000000000000000000..47c2caabdad0fb841017072628e05a6252fe8152 --- /dev/null +++ b/core/img/filetypes/application-pdf.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/application-rss+xml.png b/core/img/filetypes/application-rss+xml.png index 315c4f4fa62cb720326ba3f54259666ba3999e42..e5bb322c5733e7d2961fd27e049e4249a0d2a5c1 100644 Binary files a/core/img/filetypes/application-rss+xml.png and b/core/img/filetypes/application-rss+xml.png differ diff --git a/core/img/filetypes/application-rss+xml.svg b/core/img/filetypes/application-rss+xml.svg new file mode 100644 index 0000000000000000000000000000000000000000..4fd98545a7de5cc4e476a4a80b3a1e64677b333e --- /dev/null +++ b/core/img/filetypes/application-rss+xml.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/application-sgf.png b/core/img/filetypes/application-sgf.png deleted file mode 100644 index 48996c54394314e0f78157c6b06e472d90ce6038..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/application-sgf.png and /dev/null differ diff --git a/core/img/filetypes/application-vnd.oasis.opendocument.formula.png b/core/img/filetypes/application-vnd.oasis.opendocument.formula.png deleted file mode 100644 index e0cf49542d44e8a72f53a170b524bf73b6c94fef..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/application-vnd.oasis.opendocument.formula.png and /dev/null differ diff --git a/core/img/filetypes/application-vnd.oasis.opendocument.graphics.png b/core/img/filetypes/application-vnd.oasis.opendocument.graphics.png deleted file mode 100644 index b326a0543a5e4505ecea5aba7bbb0ebe07bfc902..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/application-vnd.oasis.opendocument.graphics.png and /dev/null differ diff --git a/core/img/filetypes/application-vnd.oasis.opendocument.presentation.png b/core/img/filetypes/application-vnd.oasis.opendocument.presentation.png deleted file mode 100644 index 7c6fd24684095b2e90d6706e80dfae9d4ad394a7..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/application-vnd.oasis.opendocument.presentation.png and /dev/null differ diff --git a/core/img/filetypes/application-vnd.oasis.opendocument.spreadsheet.png b/core/img/filetypes/application-vnd.oasis.opendocument.spreadsheet.png deleted file mode 100644 index 8b0e85b067039c2bd583db7fd94d746a6848547b..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/application-vnd.oasis.opendocument.spreadsheet.png and /dev/null differ diff --git a/core/img/filetypes/application-vnd.oasis.opendocument.text.png b/core/img/filetypes/application-vnd.oasis.opendocument.text.png deleted file mode 100644 index 48452eb3e864edda22f57c862e72945879f58321..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/application-vnd.oasis.opendocument.text.png and /dev/null differ diff --git a/core/img/filetypes/application-x-7z-compressed.png b/core/img/filetypes/application-x-7z-compressed.png deleted file mode 100644 index 2cd08aebf954b1fbd87e53856815e091d7b29d16..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/application-x-7z-compressed.png and /dev/null differ diff --git a/core/img/filetypes/application-x-bzip-compressed-tar.png b/core/img/filetypes/application-x-bzip-compressed-tar.png deleted file mode 100644 index 2cd08aebf954b1fbd87e53856815e091d7b29d16..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/application-x-bzip-compressed-tar.png and /dev/null differ diff --git a/core/img/filetypes/application-x-bzip.png b/core/img/filetypes/application-x-bzip.png deleted file mode 100644 index 2cd08aebf954b1fbd87e53856815e091d7b29d16..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/application-x-bzip.png and /dev/null differ diff --git a/core/img/filetypes/application-x-compressed-tar.png b/core/img/filetypes/application-x-compressed-tar.png deleted file mode 100644 index 2cd08aebf954b1fbd87e53856815e091d7b29d16..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/application-x-compressed-tar.png and /dev/null differ diff --git a/core/img/filetypes/application-x-deb.png b/core/img/filetypes/application-x-deb.png deleted file mode 100644 index 2cd08aebf954b1fbd87e53856815e091d7b29d16..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/application-x-deb.png and /dev/null differ diff --git a/core/img/filetypes/application-x-debian-package.png b/core/img/filetypes/application-x-debian-package.png deleted file mode 100644 index 1d6db5f933a4adcdc492dd91c4c75017005f4fcf..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/application-x-debian-package.png and /dev/null differ diff --git a/core/img/filetypes/application-x-gzip.png b/core/img/filetypes/application-x-gzip.png deleted file mode 100644 index 2cd08aebf954b1fbd87e53856815e091d7b29d16..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/application-x-gzip.png and /dev/null differ diff --git a/core/img/filetypes/application-x-lzma-compressed-tar.png b/core/img/filetypes/application-x-lzma-compressed-tar.png deleted file mode 100644 index 2cd08aebf954b1fbd87e53856815e091d7b29d16..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/application-x-lzma-compressed-tar.png and /dev/null differ diff --git a/core/img/filetypes/application-x-rar.png b/core/img/filetypes/application-x-rar.png deleted file mode 100644 index 2cd08aebf954b1fbd87e53856815e091d7b29d16..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/application-x-rar.png and /dev/null differ diff --git a/core/img/filetypes/application-x-rpm.png b/core/img/filetypes/application-x-rpm.png deleted file mode 100644 index 2cd08aebf954b1fbd87e53856815e091d7b29d16..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/application-x-rpm.png and /dev/null differ diff --git a/core/img/filetypes/application-x-tar.png b/core/img/filetypes/application-x-tar.png deleted file mode 100644 index 2cd08aebf954b1fbd87e53856815e091d7b29d16..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/application-x-tar.png and /dev/null differ diff --git a/core/img/filetypes/application-x-tarz.png b/core/img/filetypes/application-x-tarz.png deleted file mode 100644 index 2cd08aebf954b1fbd87e53856815e091d7b29d16..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/application-x-tarz.png and /dev/null differ diff --git a/core/img/filetypes/application-zip.png b/core/img/filetypes/application-zip.png deleted file mode 100644 index 2cd08aebf954b1fbd87e53856815e091d7b29d16..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/application-zip.png and /dev/null differ diff --git a/core/img/filetypes/application.png b/core/img/filetypes/application.png index 1dee9e366094e87db68c606d0522d72d4b939818..9152cc1b744f1c06d0d5ae87c2965311f117fc1c 100644 Binary files a/core/img/filetypes/application.png and b/core/img/filetypes/application.png differ diff --git a/core/img/filetypes/application.svg b/core/img/filetypes/application.svg new file mode 100644 index 0000000000000000000000000000000000000000..870a4ac24671ef2562c30a86ddcda62e23f8d635 --- /dev/null +++ b/core/img/filetypes/application.svg @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/audio.png b/core/img/filetypes/audio.png index a8b3ede3df956f8d505543b190bc8d1b5b4dce75..3f56a7e2a9a976c91965495dfe7bc76667df5f75 100644 Binary files a/core/img/filetypes/audio.png and b/core/img/filetypes/audio.png differ diff --git a/core/img/filetypes/audio.svg b/core/img/filetypes/audio.svg new file mode 100644 index 0000000000000000000000000000000000000000..d5eda38e8aaf39c5a54521ed95d185903f6d2643 --- /dev/null +++ b/core/img/filetypes/audio.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/calendar.png b/core/img/filetypes/calendar.png new file mode 100644 index 0000000000000000000000000000000000000000..d85b1db651c258b22d7707dbdf57a19bc92f832a Binary files /dev/null and b/core/img/filetypes/calendar.png differ diff --git a/core/img/filetypes/calendar.svg b/core/img/filetypes/calendar.svg new file mode 100644 index 0000000000000000000000000000000000000000..0016749b93614c3dfb2a95e24001e17e85417ad4 --- /dev/null +++ b/core/img/filetypes/calendar.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/code-script.png b/core/img/filetypes/code-script.png deleted file mode 100644 index 63fe6ceff5bfcedb9670279d4bb8d25807f6ecee..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/code-script.png and /dev/null differ diff --git a/core/img/filetypes/code.png b/core/img/filetypes/code.png deleted file mode 100644 index 0c76bd1297751b66230f74719504b2adb02b1615..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/code.png and /dev/null differ diff --git a/core/img/filetypes/database.png b/core/img/filetypes/database.png index 3d09261a26eb97c6dedc1d3504cbc2cf915eb642..24788b2a37f04a4d44d09fabc5ef8c062015fa42 100644 Binary files a/core/img/filetypes/database.png and b/core/img/filetypes/database.png differ diff --git a/core/img/filetypes/database.svg b/core/img/filetypes/database.svg new file mode 100644 index 0000000000000000000000000000000000000000..6dfac54e68b2de928371dbaa1fd30f43a78fd7cb --- /dev/null +++ b/core/img/filetypes/database.svg @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/core/img/filetypes/file.png b/core/img/filetypes/file.png index 8b8b1ca0000bc8fa8d0379926736029f8fabe364..c20f13c2e13af5bccf96b77dd66a6a0df0508c90 100644 Binary files a/core/img/filetypes/file.png and b/core/img/filetypes/file.png differ diff --git a/core/img/filetypes/file.svg b/core/img/filetypes/file.svg new file mode 100644 index 0000000000000000000000000000000000000000..3d91c3411439a69c131882426d83008dc00c4ba0 --- /dev/null +++ b/core/img/filetypes/file.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/flash.png b/core/img/filetypes/flash.png index 9f5db634a4fb42ad33c7a78f5488f03308d3317c..bcde641da3ca196a8212a5b6d91a62013f1430ab 100644 Binary files a/core/img/filetypes/flash.png and b/core/img/filetypes/flash.png differ diff --git a/core/img/filetypes/flash.svg b/core/img/filetypes/flash.svg new file mode 100644 index 0000000000000000000000000000000000000000..cb823703d9b42c512a3c1c15765ed82163fef4d5 --- /dev/null +++ b/core/img/filetypes/flash.svg @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/folder-drag-accept.png b/core/img/filetypes/folder-drag-accept.png new file mode 100644 index 0000000000000000000000000000000000000000..19c2d2eebd41e50454157f035df9c69dbcfc5717 Binary files /dev/null and b/core/img/filetypes/folder-drag-accept.png differ diff --git a/core/img/filetypes/folder-drag-accept.svg b/core/img/filetypes/folder-drag-accept.svg new file mode 100644 index 0000000000000000000000000000000000000000..a7885c80be77e1c4d9ecd1f73c2a4259856ff6f1 --- /dev/null +++ b/core/img/filetypes/folder-drag-accept.svg @@ -0,0 +1,335 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/folder-external.png b/core/img/filetypes/folder-external.png new file mode 100644 index 0000000000000000000000000000000000000000..997f07b2bacc1ae5bb09b5addb1539254fffb6c6 Binary files /dev/null and b/core/img/filetypes/folder-external.png differ diff --git a/core/img/filetypes/folder-external.svg b/core/img/filetypes/folder-external.svg new file mode 100644 index 0000000000000000000000000000000000000000..89ec9a8ecaae43de01426d4946890aae0e2ec016 --- /dev/null +++ b/core/img/filetypes/folder-external.svg @@ -0,0 +1,68 @@ + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/folder-public.png b/core/img/filetypes/folder-public.png new file mode 100644 index 0000000000000000000000000000000000000000..c716607e26e3c2cf8f82dd754e820d475cb99f70 Binary files /dev/null and b/core/img/filetypes/folder-public.png differ diff --git a/core/img/filetypes/folder-public.svg b/core/img/filetypes/folder-public.svg new file mode 100644 index 0000000000000000000000000000000000000000..a949833f95a49f570750c3faed1016db06f4a0a2 --- /dev/null +++ b/core/img/filetypes/folder-public.svg @@ -0,0 +1,68 @@ + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/folder-shared.png b/core/img/filetypes/folder-shared.png new file mode 100644 index 0000000000000000000000000000000000000000..e547a242062eb9687929fb640e99d33468e85500 Binary files /dev/null and b/core/img/filetypes/folder-shared.png differ diff --git a/core/img/filetypes/folder-shared.svg b/core/img/filetypes/folder-shared.svg new file mode 100644 index 0000000000000000000000000000000000000000..56aa9634d27306803bc02897f76afc5a52c772a2 --- /dev/null +++ b/core/img/filetypes/folder-shared.svg @@ -0,0 +1,68 @@ + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/folder.png b/core/img/filetypes/folder.png index 784e8fa48234f4f64b6922a6758f254ee0ca08ec..b7be63d58369d5da485f12ead9ca6982c8e8e563 100644 Binary files a/core/img/filetypes/folder.png and b/core/img/filetypes/folder.png differ diff --git a/core/img/filetypes/folder.svg b/core/img/filetypes/folder.svg new file mode 100644 index 0000000000000000000000000000000000000000..92d4cc2271816f50eabae1e5b092f117561adc1a --- /dev/null +++ b/core/img/filetypes/folder.svg @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/font.png b/core/img/filetypes/font.png index 81e41de7d3a9bcc50267b34d0005487d5c7cc7c0..9404c3ca6ac330d3639a00e0b4c618e52172c2a2 100644 Binary files a/core/img/filetypes/font.png and b/core/img/filetypes/font.png differ diff --git a/core/img/filetypes/font.svg b/core/img/filetypes/font.svg new file mode 100644 index 0000000000000000000000000000000000000000..8fca5ff9eff1ba40f42db87a027ded7dd235e70f --- /dev/null +++ b/core/img/filetypes/font.svg @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/image-svg+xml.png b/core/img/filetypes/image-svg+xml.png index a1291c2dfad75b289f88ab762a3a32ccb436c1ed..e3dd52489d3772962e22cdf47569b53616fe73eb 100644 Binary files a/core/img/filetypes/image-svg+xml.png and b/core/img/filetypes/image-svg+xml.png differ diff --git a/core/img/filetypes/image-svg+xml.svg b/core/img/filetypes/image-svg+xml.svg new file mode 100644 index 0000000000000000000000000000000000000000..06df5f54da62e2a1413c6b76279eb6b909c364d5 --- /dev/null +++ b/core/img/filetypes/image-svg+xml.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/image.png b/core/img/filetypes/image.png index 4a158fef7e0da8fd19525f574f2c4966443866cf..087f5dcdbdf61777512cbf7985715f0a12124a19 100644 Binary files a/core/img/filetypes/image.png and b/core/img/filetypes/image.png differ diff --git a/core/img/filetypes/image.svg b/core/img/filetypes/image.svg new file mode 100644 index 0000000000000000000000000000000000000000..50991f7359df5cb322ca24ac1b41250fb3091bcd --- /dev/null +++ b/core/img/filetypes/image.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/link.png b/core/img/filetypes/link.png deleted file mode 100644 index 68f21d30116710e48a8bf462cb32441e51fad5f6..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/link.png and /dev/null differ diff --git a/core/img/filetypes/model.png b/core/img/filetypes/model.png deleted file mode 100644 index 7851cf34c946e5667221e3478668503eb1cd733f..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/model.png and /dev/null differ diff --git a/core/img/filetypes/ms-excel.png b/core/img/filetypes/ms-excel.png deleted file mode 100644 index b977d7e52e2446ea01201c5c7209ac3a05f12c9f..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/ms-excel.png and /dev/null differ diff --git a/core/img/filetypes/ms-powerpoint.png b/core/img/filetypes/ms-powerpoint.png deleted file mode 100644 index c4eff0387d5888c638ba09473ba6d2369f7b56f0..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/ms-powerpoint.png and /dev/null differ diff --git a/core/img/filetypes/package-x-generic.png b/core/img/filetypes/package-x-generic.png new file mode 100644 index 0000000000000000000000000000000000000000..e08cc5480ce6d314765a370c2d9012772305c7fe Binary files /dev/null and b/core/img/filetypes/package-x-generic.png differ diff --git a/core/img/filetypes/package-x-generic.svg b/core/img/filetypes/package-x-generic.svg new file mode 100644 index 0000000000000000000000000000000000000000..13ab5b7550e2daa8661925a1508cb5f96ccbeb17 --- /dev/null +++ b/core/img/filetypes/package-x-generic.svg @@ -0,0 +1,62 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/presentation.png b/core/img/filetypes/presentation.png deleted file mode 100644 index b4aaad9a45c9abbee2d47611a6963101b64a8023..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/presentation.png and /dev/null differ diff --git a/core/img/filetypes/readme-2.txt b/core/img/filetypes/readme-2.txt deleted file mode 100644 index 5a606f9a0bb06cd53594eb4bd7cb0028dc48c686..0000000000000000000000000000000000000000 --- a/core/img/filetypes/readme-2.txt +++ /dev/null @@ -1,28 +0,0 @@ -15.02.2012 - -Following new icons have been added: -core/img/filetypes/application-vnd.oasis.opendocument.formula.png -core/img/filetypes/application-vnd.oasis.opendocument.graphics.png -core/img/filetypes/application-vnd.oasis.opendocument.presentation.png -core/img/filetypes/application-vnd.oasis.opendocument.spreadsheet.png -core/img/filetypes/application-vnd.oasis.opendocument.text.png - Download: http://odftoolkit.org/ODF-Icons#ODF_Icons - License: Apache 2.0 - -core/img/filetypes/application-x-7z-compressed.png -core/img/filetypes/application-x-bzip-compressed-tar.png -core/img/filetypes/application-x-bzip.png -core/img/filetypes/application-x-compressed-tar.png -core/img/filetypes/application-x-deb.png -core/img/filetypes/application-x-debian-package.png -core/img/filetypes/application-x-gzip.png -core/img/filetypes/application-x-lzma-compressed-tar.png -core/img/filetypes/application-x-rar.png -core/img/filetypes/application-x-rpm.png -core/img/filetypes/application-x-tar.png -core/img/filetypes/application-x-tarz.png -core/img/filetypes/application-zip.png - Author: Gomez Hyuuga - License: Creative Commons Attribution-Share Alike 3.0 Unported License - Download: http://kde-look.org/content/show.php/?content=101767 - diff --git a/core/img/filetypes/readme.txt b/core/img/filetypes/readme.txt deleted file mode 100644 index 400a64d7857425f6aa49877a91a9bf8a5737400a..0000000000000000000000000000000000000000 --- a/core/img/filetypes/readme.txt +++ /dev/null @@ -1,22 +0,0 @@ -Silk icon set 1.3 - -_________________________________________ -Mark James -http://www.famfamfam.com/lab/icons/silk/ -_________________________________________ - -This work is licensed under a -Creative Commons Attribution 2.5 License. -[ http://creativecommons.org/licenses/by/2.5/ ] - -This means you may use it for any purpose, -and make any changes you like. -All I ask is that you include a link back -to this page in your credits. - -Are you using this icon set? Send me an email -(including a link or picture if available) to -mjames@gmail.com - -Any other questions about this icon set please -contact mjames@gmail.com \ No newline at end of file diff --git a/core/img/filetypes/ruby.png b/core/img/filetypes/ruby.png deleted file mode 100644 index f59b7c4365fa1720af1aa04eb47167ddaa6eeed4..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/ruby.png and /dev/null differ diff --git a/core/img/filetypes/spreadsheet.png b/core/img/filetypes/spreadsheet.png deleted file mode 100644 index abcd93689a08ec9bdbf0984927e8da06c043c7cd..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/spreadsheet.png and /dev/null differ diff --git a/core/img/filetypes/text-calendar.png b/core/img/filetypes/text-calendar.png deleted file mode 100644 index 658913852d60fc6ca8557568d26b8e93e7d56525..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/text-calendar.png and /dev/null differ diff --git a/core/img/filetypes/text-code.png b/core/img/filetypes/text-code.png new file mode 100644 index 0000000000000000000000000000000000000000..753d151f538842c2636a94e0f9231fc4ef1c301f Binary files /dev/null and b/core/img/filetypes/text-code.png differ diff --git a/core/img/filetypes/text-code.svg b/core/img/filetypes/text-code.svg new file mode 100644 index 0000000000000000000000000000000000000000..61a5c19f5119a7e7d655f29c9460daaac95e29e0 --- /dev/null +++ b/core/img/filetypes/text-code.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/text-css.png b/core/img/filetypes/text-css.png deleted file mode 100644 index 23f3101811f2e402b8c581ba2e39977a675e0295..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/text-css.png and /dev/null differ diff --git a/core/img/filetypes/text-html.png b/core/img/filetypes/text-html.png index 55d1072eafda48abb0a5fcecb98b114d866077b9..dd17b7501034216c35e9273dc7e3858d486d2aed 100644 Binary files a/core/img/filetypes/text-html.png and b/core/img/filetypes/text-html.png differ diff --git a/core/img/filetypes/text-html.svg b/core/img/filetypes/text-html.svg new file mode 100644 index 0000000000000000000000000000000000000000..c41964738d00009d54bb1f773ae9ba1fc3e59c27 --- /dev/null +++ b/core/img/filetypes/text-html.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/text-vcard.png b/core/img/filetypes/text-vcard.png index c02f315d20749098a50e79bd9525eed3cda7be6b..2e52d1ecb3a51b897b64d06b8db16e89c398b9e6 100644 Binary files a/core/img/filetypes/text-vcard.png and b/core/img/filetypes/text-vcard.png differ diff --git a/core/img/filetypes/text-vcard.svg b/core/img/filetypes/text-vcard.svg new file mode 100644 index 0000000000000000000000000000000000000000..27054be57e62f3536a56f15796debd964895f693 --- /dev/null +++ b/core/img/filetypes/text-vcard.svg @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/text-x-c++.png b/core/img/filetypes/text-x-c++.png deleted file mode 100644 index a87cf847cb768acb8c600759ce433ce1bad3cdc0..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/text-x-c++.png and /dev/null differ diff --git a/core/img/filetypes/text-x-c.png b/core/img/filetypes/text-x-c.png index 34a05cccf064b35701b61ba1d395048873d7b48e..b9edd1e866e457027339e21329e367e84f9dd304 100644 Binary files a/core/img/filetypes/text-x-c.png and b/core/img/filetypes/text-x-c.png differ diff --git a/core/img/filetypes/text-x-c.svg b/core/img/filetypes/text-x-c.svg new file mode 100644 index 0000000000000000000000000000000000000000..35a6a0cdfe2840ce53d8156732bc3f9171f650dd --- /dev/null +++ b/core/img/filetypes/text-x-c.svg @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/text-x-csharp.png b/core/img/filetypes/text-x-csharp.png deleted file mode 100644 index ffb8fc932f321d19049a51e0134459e7d6549226..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/text-x-csharp.png and /dev/null differ diff --git a/core/img/filetypes/text-x-h.png b/core/img/filetypes/text-x-h.png index e902abb07671254da98cd4eb0f7d21fab89d2332..37a8805b50696aa9cf36c610871a96cb1d5b3bba 100644 Binary files a/core/img/filetypes/text-x-h.png and b/core/img/filetypes/text-x-h.png differ diff --git a/core/img/filetypes/text-x-h.svg b/core/img/filetypes/text-x-h.svg new file mode 100644 index 0000000000000000000000000000000000000000..38ed04690fc7e27c88f13dc47e2131b95b551bde --- /dev/null +++ b/core/img/filetypes/text-x-h.svg @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/text-x-javascript.png b/core/img/filetypes/text-x-javascript.png new file mode 100644 index 0000000000000000000000000000000000000000..24d09ce978181c4b08b67c879553a75fc3c1e97a Binary files /dev/null and b/core/img/filetypes/text-x-javascript.png differ diff --git a/core/img/filetypes/text-x-javascript.svg b/core/img/filetypes/text-x-javascript.svg new file mode 100644 index 0000000000000000000000000000000000000000..0cc52ce6ba7ccd4cf2c8d1c568f67dd684739845 --- /dev/null +++ b/core/img/filetypes/text-x-javascript.svg @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/text-x-php.png b/core/img/filetypes/text-x-php.png deleted file mode 100644 index 7868a25945cd5e5cb7daaca9591927511ca65c0f..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/text-x-php.png and /dev/null differ diff --git a/core/img/filetypes/text-x-python.png b/core/img/filetypes/text-x-python.png new file mode 100644 index 0000000000000000000000000000000000000000..57148f4b90d401b26b324d3eaf530f11032b4726 Binary files /dev/null and b/core/img/filetypes/text-x-python.png differ diff --git a/core/img/filetypes/text-x-python.svg b/core/img/filetypes/text-x-python.svg new file mode 100644 index 0000000000000000000000000000000000000000..00755e6d0c26cdb96ac77cbc40dcab1d5b4e96b7 --- /dev/null +++ b/core/img/filetypes/text-x-python.svg @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/text.png b/core/img/filetypes/text.png index 813f712f726c935f9adf8d2f2dd0d7683791ef11..6b069c82c119a5bc115cd657b9752215b8cd1044 100644 Binary files a/core/img/filetypes/text.png and b/core/img/filetypes/text.png differ diff --git a/core/img/filetypes/text.svg b/core/img/filetypes/text.svg new file mode 100644 index 0000000000000000000000000000000000000000..69a1bcd98c3305fec018e5565d917db2e0ff3669 --- /dev/null +++ b/core/img/filetypes/text.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/video.png b/core/img/filetypes/video.png index b0ce7bb198a3b268bd634d2b26e9b710f3797d37..045754df26fa90c64237a817fe5a151b1aa18ab7 100644 Binary files a/core/img/filetypes/video.png and b/core/img/filetypes/video.png differ diff --git a/core/img/filetypes/video.svg b/core/img/filetypes/video.svg new file mode 100644 index 0000000000000000000000000000000000000000..67691369ac9e5e4f49303395da82eb4e900cf2f7 --- /dev/null +++ b/core/img/filetypes/video.svg @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/web.png b/core/img/filetypes/web.png new file mode 100644 index 0000000000000000000000000000000000000000..c380231264555a13531b8fc6b1ed9d5c1f533a4e Binary files /dev/null and b/core/img/filetypes/web.png differ diff --git a/core/img/filetypes/web.svg b/core/img/filetypes/web.svg new file mode 100644 index 0000000000000000000000000000000000000000..67775a2233b6b2786c383e7e6430e570013d34c6 --- /dev/null +++ b/core/img/filetypes/web.svg @@ -0,0 +1,45 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/x-.png b/core/img/filetypes/x-.png deleted file mode 100644 index 8443c23eb944cf8ef49c9d13cd496502f46f1885..0000000000000000000000000000000000000000 Binary files a/core/img/filetypes/x-.png and /dev/null differ diff --git a/core/img/filetypes/x-office-document.png b/core/img/filetypes/x-office-document.png new file mode 100644 index 0000000000000000000000000000000000000000..fcd28e9a292f84e04b7ae031755b3b9823aabf64 Binary files /dev/null and b/core/img/filetypes/x-office-document.png differ diff --git a/core/img/filetypes/x-office-document.svg b/core/img/filetypes/x-office-document.svg new file mode 100644 index 0000000000000000000000000000000000000000..fc51a3a1b70291f286f4aae9413b85afecd81049 --- /dev/null +++ b/core/img/filetypes/x-office-document.svg @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/x-office-presentation.png b/core/img/filetypes/x-office-presentation.png new file mode 100644 index 0000000000000000000000000000000000000000..7ee552ba7c80dd6f285a4acd5b4a2cba62c140a9 Binary files /dev/null and b/core/img/filetypes/x-office-presentation.png differ diff --git a/core/img/filetypes/x-office-presentation.svg b/core/img/filetypes/x-office-presentation.svg new file mode 100644 index 0000000000000000000000000000000000000000..821798d50fdac40fc08e567e0d75260ec62cd1b9 --- /dev/null +++ b/core/img/filetypes/x-office-presentation.svg @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/x-office-spreadsheet.png b/core/img/filetypes/x-office-spreadsheet.png new file mode 100644 index 0000000000000000000000000000000000000000..dfdc74a8bf660ebd02baa99b0cf40d48478dd032 Binary files /dev/null and b/core/img/filetypes/x-office-spreadsheet.png differ diff --git a/core/img/filetypes/x-office-spreadsheet.svg b/core/img/filetypes/x-office-spreadsheet.svg new file mode 100644 index 0000000000000000000000000000000000000000..af40bb252a2035c8cbe08aae5c9297e02087fa0b --- /dev/null +++ b/core/img/filetypes/x-office-spreadsheet.svg @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/js/avatar.js b/core/js/avatar.js new file mode 100644 index 0000000000000000000000000000000000000000..57e6daa0930251fba4fa314bf36864e5209da8f2 --- /dev/null +++ b/core/js/avatar.js @@ -0,0 +1,11 @@ +$(document).ready(function(){ + if (OC.currentUser) { + $('#header .avatardiv').avatar(OC.currentUser, 32); + // Personal settings + $('#avatar .avatardiv').avatar(OC.currentUser, 128); + } + // User settings + $.each($('td.avatar .avatardiv'), function(i, element) { + $(element).avatar($(element).parent().parent().data('uid'), 32); + }); +}); diff --git a/core/js/jquery.avatar.js b/core/js/jquery.avatar.js new file mode 100644 index 0000000000000000000000000000000000000000..88a4c25d1eecfc401f7a684d6228a086eb8df44a --- /dev/null +++ b/core/js/jquery.avatar.js @@ -0,0 +1,87 @@ +/** + * Copyright (c) 2013 Christopher Schäpers + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +/** + * This plugin inserts the right avatar for the user, depending on, whether a + * custom avatar is uploaded - which it uses then - or not, and display a + * placeholder with the first letter of the users name instead. + * For this it queries the core_avatar_get route, thus this plugin is fit very + * tightly for owncloud, and it may not work anywhere else. + * + * You may use this on any
    + * Here I'm using
    as an example. + * + * There are 4 ways to call this: + * + * 1. $('.avatardiv').avatar('jdoe', 128); + * This will make the div to jdoe's fitting avatar, with a size of 128px. + * + * 2. $('.avatardiv').avatar('jdoe'); + * This will make the div to jdoe's fitting avatar. If the div aready has a + * height, it will be used for the avatars size. Otherwise this plugin will + * search for 'size' DOM data, to use for avatar size. If neither are available + * it will default to 64px. + * + * 3. $('.avatardiv').avatar(); + * This will search the DOM for 'user' data, to use as the username. If there + * is no username available it will default to a placeholder with the value of + * "x". The size will be determined the same way, as the second example. + * + * 4. $('.avatardiv').avatar('jdoe', 128, true); + * This will behave like the first example, except it will also append random + * hashes to the custom avatar images, to force image reloading in IE8. + */ + +(function ($) { + $.fn.avatar = function(user, size, ie8fix) { + if (typeof(size) === 'undefined') { + if (this.height() > 0) { + size = this.height(); + } else if (this.data('size') > 0) { + size = this.data('size'); + } else { + size = 64; + } + } + + this.height(size); + this.width(size); + + if (typeof(user) === 'undefined') { + if (typeof(this.data('user')) !== 'undefined') { + user = this.data('user'); + } else { + this.placeholder('x'); + return; + } + } + + // sanitize + user = user.replace(/\//g,''); + + var $div = this; + + OC.Router.registerLoadedCallback(function() { + var url = OC.Router.generate('core_avatar_get', {user: user, size: size})+'?requesttoken='+oc_requesttoken; + $.get(url, function(result) { + if (typeof(result) === 'object') { + if (result.data && result.data.displayname) { + $div.placeholder(user, result.data.displayname); + } else { + $div.placeholder(user); + } + } else { + if (ie8fix === true) { + $div.html(''); + } else { + $div.html(''); + } + } + }); + }); + }; +}(jQuery)); diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js index bafbd0e0e9f9dbe69f9f47e117a6b2aeef9c506f..02cd6ac146635895de58127b0f38a03b0d1a88eb 100644 --- a/core/js/jquery.ocdialog.js +++ b/core/js/jquery.ocdialog.js @@ -39,7 +39,8 @@ return; } // Escape - if(event.keyCode === 27 && self.options.closeOnEscape) { + if(event.keyCode === 27 && event.type === 'keydown' && self.options.closeOnEscape) { + event.stopImmediatePropagation(); self.close(); return false; } @@ -83,24 +84,28 @@ var self = this; switch(key) { case 'title': - var $title = $('

    ' + this.options.title - + '

    '); //
    '); if(this.$title) { - this.$title.replaceWith($title); + this.$title.text(value); } else { + var $title = $('

    ' + + value + + '

    '); this.$title = $title.prependTo(this.$dialog); } this._setSizes(); break; case 'buttons': - var $buttonrow = $('
    '); if(this.$buttonrow) { - this.$buttonrow.replaceWith($buttonrow); + this.$buttonrow.empty(); } else { + var $buttonrow = $('
    '); this.$buttonrow = $buttonrow.appendTo(this.$dialog); } $.each(value, function(idx, val) { var $button = $('
    + + *dbprefix*timestamp + + + id + 1 + integer + 0 + true + 4 + + + + timestamptest + timestamp + + false + + +
    + diff --git a/tests/data/testavatar.png b/tests/data/testavatar.png new file mode 100644 index 0000000000000000000000000000000000000000..24770fb634f028fbff8c0625e987ead5bb0471c9 Binary files /dev/null and b/tests/data/testavatar.png differ diff --git a/tests/data/testcal.ics b/tests/data/testcal.ics new file mode 100644 index 0000000000000000000000000000000000000000..e05f01ba1c2755e9c7f02a6959e107fc2d97c61a --- /dev/null +++ b/tests/data/testcal.ics @@ -0,0 +1,13 @@ +BEGIN:VCALENDAR +PRODID:-//some random cal software//EN +VERSION:2.0 +BEGIN:VEVENT +CREATED:20130102T120000Z +LAST-MODIFIED:20130102T120000Z +DTSTAMP:20130102T120000Z +UID:f106ecdf-c716-43ef-9d94-4e6f19f2fcfb +SUMMARY:a test cal file +DTSTART;VALUE=DATE:20130101 +DTEND;VALUE=DATE:20130102 +END:VEVENT +END:VCALENDAR \ No newline at end of file diff --git a/tests/data/testcontact.vcf b/tests/data/testcontact.vcf new file mode 100644 index 0000000000000000000000000000000000000000..2af963d6916eecf7d2ee39a2c3018f64b171c6e6 --- /dev/null +++ b/tests/data/testcontact.vcf @@ -0,0 +1,6 @@ +BEGIN:VCARD +VERSION:3.0 +PRODID:-//some random contact software//EN +N:def;abc;;; +FN:abc def +END:VCARD \ No newline at end of file diff --git a/tests/lib/appframework/AppTest.php b/tests/lib/appframework/AppTest.php new file mode 100644 index 0000000000000000000000000000000000000000..80abaefc43b0a4e285a982facc079b61d6a1e6d5 --- /dev/null +++ b/tests/lib/appframework/AppTest.php @@ -0,0 +1,99 @@ +. + * + */ + + +namespace OC\AppFramework; + + +class AppTest extends \PHPUnit_Framework_TestCase { + + private $container; + private $api; + private $controller; + private $dispatcher; + private $params; + private $headers; + private $output; + private $controllerName; + private $controllerMethod; + + protected function setUp() { + $this->container = new \OC\AppFramework\DependencyInjection\DIContainer('test'); + $this->controller = $this->getMockBuilder( + 'OC\AppFramework\Controller\Controller') + ->disableOriginalConstructor() + ->getMock(); + $this->dispatcher = $this->getMockBuilder( + 'OC\AppFramework\Http\Dispatcher') + ->disableOriginalConstructor() + ->getMock(); + + + $this->headers = array('key' => 'value'); + $this->output = 'hi'; + $this->controllerName = 'Controller'; + $this->controllerMethod = 'method'; + + $this->container[$this->controllerName] = $this->controller; + $this->container['Dispatcher'] = $this->dispatcher; + } + + + public function testControllerNameAndMethodAreBeingPassed(){ + $return = array(null, array(), null); + $this->dispatcher->expects($this->once()) + ->method('dispatch') + ->with($this->equalTo($this->controller), + $this->equalTo($this->controllerMethod)) + ->will($this->returnValue($return)); + + $this->expectOutputString(''); + + App::main($this->controllerName, $this->controllerMethod, array(), + $this->container); + } + + + /* + FIXME: this complains about shit headers which are already sent because + of the content length. Would be cool if someone could fix this + + public function testOutputIsPrinted(){ + $return = array(null, array(), $this->output); + $this->dispatcher->expects($this->once()) + ->method('dispatch') + ->with($this->equalTo($this->controller), + $this->equalTo($this->controllerMethod)) + ->will($this->returnValue($return)); + + $this->expectOutputString($this->output); + + App::main($this->controllerName, $this->controllerMethod, array(), + $this->container); + } + */ + + // FIXME: if someone manages to test the headers output, I'd be grateful + + +} diff --git a/tests/lib/appframework/controller/ControllerTest.php b/tests/lib/appframework/controller/ControllerTest.php new file mode 100644 index 0000000000000000000000000000000000000000..4441bddfca9f4685385744aafa29671592222843 --- /dev/null +++ b/tests/lib/appframework/controller/ControllerTest.php @@ -0,0 +1,155 @@ +. + * + */ + + +namespace Test\AppFramework\Controller; + +use OC\AppFramework\Http\Request; +use OC\AppFramework\Controller\Controller; +use OCP\AppFramework\Http\TemplateResponse; + + +//require_once __DIR__ . "/../classloader.php"; + + +class ChildController extends Controller {}; + +class ControllerTest extends \PHPUnit_Framework_TestCase { + + /** + * @var Controller + */ + private $controller; + private $api; + + protected function setUp(){ + $request = new Request( + array( + 'get' => array('name' => 'John Q. Public', 'nickname' => 'Joey'), + 'post' => array('name' => 'Jane Doe', 'nickname' => 'Janey'), + 'urlParams' => array('name' => 'Johnny Weissmüller'), + 'files' => array('file' => 'filevalue'), + 'env' => array('PATH' => 'daheim'), + 'session' => array('sezession' => 'kein'), + 'method' => 'hi', + ) + ); + + $this->api = $this->getMock('OC\AppFramework\Core\API', + array('getAppName'), array('test')); + $this->api->expects($this->any()) + ->method('getAppName') + ->will($this->returnValue('apptemplate_advanced')); + + $this->controller = new ChildController($this->api, $request); + } + + + public function testParamsGet(){ + $this->assertEquals('Johnny Weissmüller', $this->controller->params('name', 'Tarzan')); + } + + + public function testParamsGetDefault(){ + $this->assertEquals('Tarzan', $this->controller->params('Ape Man', 'Tarzan')); + } + + + public function testParamsFile(){ + $this->assertEquals('filevalue', $this->controller->params('file', 'filevalue')); + } + + + public function testGetUploadedFile(){ + $this->assertEquals('filevalue', $this->controller->getUploadedFile('file')); + } + + + + public function testGetUploadedFileDefault(){ + $this->assertEquals('default', $this->controller->params('files', 'default')); + } + + + public function testGetParams(){ + $params = array( + 'name' => 'Johnny Weissmüller', + 'nickname' => 'Janey', + ); + + $this->assertEquals($params, $this->controller->getParams()); + } + + + public function testRender(){ + $this->assertTrue($this->controller->render('') instanceof TemplateResponse); + } + + + public function testSetParams(){ + $params = array('john' => 'foo'); + $response = $this->controller->render('home', $params); + + $this->assertEquals($params, $response->getParams()); + } + + + public function testRenderRenderAs(){ + $ocTpl = $this->getMock('Template', array('fetchPage')); + $ocTpl->expects($this->once()) + ->method('fetchPage'); + + $api = $this->getMock('OC\AppFramework\Core\API', + array('getAppName', 'getTemplate'), array('app')); + $api->expects($this->any()) + ->method('getAppName') + ->will($this->returnValue('app')); + $api->expects($this->once()) + ->method('getTemplate') + ->with($this->equalTo('home'), $this->equalTo('admin'), $this->equalTo('app')) + ->will($this->returnValue($ocTpl)); + + $this->controller = new ChildController($api, new Request()); + $this->controller->render('home', array(), 'admin')->render(); + } + + + public function testRenderHeaders(){ + $headers = array('one', 'two'); + $response = $this->controller->render('', array(), '', $headers); + + $this->assertTrue(in_array($headers[0], $response->getHeaders())); + $this->assertTrue(in_array($headers[1], $response->getHeaders())); + } + + + public function testGetRequestMethod(){ + $this->assertEquals('hi', $this->controller->method()); + } + + + public function testGetEnvVariable(){ + $this->assertEquals('daheim', $this->controller->env('PATH')); + } + +} diff --git a/tests/lib/appframework/dependencyinjection/DIContainerTest.php b/tests/lib/appframework/dependencyinjection/DIContainerTest.php new file mode 100644 index 0000000000000000000000000000000000000000..25fdd202839340ad233dff21caff16b8bb01e3b8 --- /dev/null +++ b/tests/lib/appframework/dependencyinjection/DIContainerTest.php @@ -0,0 +1,98 @@ +. + * + */ + + +namespace OC\AppFramework\DependencyInjection; + +use \OC\AppFramework\Http\Request; + + +//require_once(__DIR__ . "/../classloader.php"); + + +class DIContainerTest extends \PHPUnit_Framework_TestCase { + + private $container; + + protected function setUp(){ + $this->container = new DIContainer('name'); + $this->api = $this->getMock('OC\AppFramework\Core\API', array('getTrans'), array('hi')); + } + + private function exchangeAPI(){ + $this->api->expects($this->any()) + ->method('getTrans') + ->will($this->returnValue('yo')); + $this->container['API'] = $this->api; + } + + public function testProvidesAPI(){ + $this->assertTrue(isset($this->container['API'])); + } + + + public function testProvidesRequest(){ + $this->assertTrue(isset($this->container['Request'])); + } + + + public function testProvidesSecurityMiddleware(){ + $this->assertTrue(isset($this->container['SecurityMiddleware'])); + } + + + public function testProvidesMiddlewareDispatcher(){ + $this->assertTrue(isset($this->container['MiddlewareDispatcher'])); + } + + + public function testProvidesAppName(){ + $this->assertTrue(isset($this->container['AppName'])); + } + + + public function testAppNameIsSetCorrectly(){ + $this->assertEquals('name', $this->container['AppName']); + } + + + public function testMiddlewareDispatcherIncludesSecurityMiddleware(){ + $this->container['Request'] = new Request(); + $security = $this->container['SecurityMiddleware']; + $dispatcher = $this->container['MiddlewareDispatcher']; + + $this->assertContains($security, $dispatcher->getMiddlewares()); + } + + + public function testMiddlewareDispatcherDoesNotIncludeTwigWhenTplDirectoryNotSet(){ + $this->container['Request'] = new Request(); + $this->exchangeAPI(); + $dispatcher = $this->container['MiddlewareDispatcher']; + + $this->assertEquals(1, count($dispatcher->getMiddlewares())); + } + +} diff --git a/tests/lib/appframework/http/DispatcherTest.php b/tests/lib/appframework/http/DispatcherTest.php new file mode 100644 index 0000000000000000000000000000000000000000..849b0ca97a68dcb1bb0456c0c87e1750427065cd --- /dev/null +++ b/tests/lib/appframework/http/DispatcherTest.php @@ -0,0 +1,218 @@ +. + * + */ + + +namespace OC\AppFramework\Http; + +use OC\AppFramework\Core\API; +use OC\AppFramework\Middleware\MiddlewareDispatcher; + +//require_once(__DIR__ . "/../classloader.php"); + + +class DispatcherTest extends \PHPUnit_Framework_TestCase { + + + private $middlewareDispatcher; + private $dispatcher; + private $controllerMethod; + private $response; + private $lastModified; + private $etag; + private $http; + + protected function setUp() { + $this->controllerMethod = 'test'; + + $api = $this->getMockBuilder( + '\OC\AppFramework\Core\API') + ->disableOriginalConstructor() + ->getMock(); + $request = $this->getMockBuilder( + '\OC\AppFramework\Http\Request') + ->disableOriginalConstructor() + ->getMock(); + $this->http = $this->getMockBuilder( + '\OC\AppFramework\Http\Http') + ->disableOriginalConstructor() + ->getMock(); + + $this->middlewareDispatcher = $this->getMockBuilder( + '\OC\AppFramework\Middleware\MiddlewareDispatcher') + ->disableOriginalConstructor() + ->getMock(); + $this->controller = $this->getMock( + '\OC\AppFramework\Controller\Controller', + array($this->controllerMethod), array($api, $request)); + + $this->dispatcher = new Dispatcher( + $this->http, $this->middlewareDispatcher); + + $this->response = $this->getMockBuilder( + '\OCP\AppFramework\Http\Response') + ->disableOriginalConstructor() + ->getMock(); + + $this->lastModified = new \DateTime(null, new \DateTimeZone('GMT')); + $this->etag = 'hi'; + } + + + private function setMiddlewareExpections($out=null, + $httpHeaders=null, $responseHeaders=array(), + $ex=false, $catchEx=true) { + + if($ex) { + $exception = new \Exception(); + $this->middlewareDispatcher->expects($this->once()) + ->method('beforeController') + ->with($this->equalTo($this->controller), + $this->equalTo($this->controllerMethod)) + ->will($this->throwException($exception)); + if($catchEx) { + $this->middlewareDispatcher->expects($this->once()) + ->method('afterException') + ->with($this->equalTo($this->controller), + $this->equalTo($this->controllerMethod), + $this->equalTo($exception)) + ->will($this->returnValue($this->response)); + } else { + $this->middlewareDispatcher->expects($this->once()) + ->method('afterException') + ->with($this->equalTo($this->controller), + $this->equalTo($this->controllerMethod), + $this->equalTo($exception)) + ->will($this->returnValue(null)); + return; + } + } else { + $this->middlewareDispatcher->expects($this->once()) + ->method('beforeController') + ->with($this->equalTo($this->controller), + $this->equalTo($this->controllerMethod)); + $this->controller->expects($this->once()) + ->method($this->controllerMethod) + ->will($this->returnValue($this->response)); + } + + $this->response->expects($this->once()) + ->method('render') + ->will($this->returnValue($out)); + $this->response->expects($this->once()) + ->method('getStatus') + ->will($this->returnValue(Http::STATUS_OK)); + $this->response->expects($this->once()) + ->method('getLastModified') + ->will($this->returnValue($this->lastModified)); + $this->response->expects($this->once()) + ->method('getETag') + ->will($this->returnValue($this->etag)); + $this->response->expects($this->once()) + ->method('getHeaders') + ->will($this->returnValue($responseHeaders)); + $this->http->expects($this->once()) + ->method('getStatusHeader') + ->with($this->equalTo(Http::STATUS_OK), + $this->equalTo($this->lastModified), + $this->equalTo($this->etag)) + ->will($this->returnValue($httpHeaders)); + + $this->middlewareDispatcher->expects($this->once()) + ->method('afterController') + ->with($this->equalTo($this->controller), + $this->equalTo($this->controllerMethod), + $this->equalTo($this->response)) + ->will($this->returnValue($this->response)); + + $this->middlewareDispatcher->expects($this->once()) + ->method('afterController') + ->with($this->equalTo($this->controller), + $this->equalTo($this->controllerMethod), + $this->equalTo($this->response)) + ->will($this->returnValue($this->response)); + + $this->middlewareDispatcher->expects($this->once()) + ->method('beforeOutput') + ->with($this->equalTo($this->controller), + $this->equalTo($this->controllerMethod), + $this->equalTo($out)) + ->will($this->returnValue($out)); + + + } + + + public function testDispatcherReturnsArrayWith2Entries() { + $this->setMiddlewareExpections(); + + $response = $this->dispatcher->dispatch($this->controller, + $this->controllerMethod); + $this->assertNull($response[0]); + $this->assertEquals(array(), $response[1]); + $this->assertNull($response[2]); + } + + + public function testHeadersAndOutputAreReturned(){ + $out = 'yo'; + $httpHeaders = 'Http'; + $responseHeaders = array('hell' => 'yeah'); + $this->setMiddlewareExpections($out, $httpHeaders, $responseHeaders); + + $response = $this->dispatcher->dispatch($this->controller, + $this->controllerMethod); + + $this->assertEquals($httpHeaders, $response[0]); + $this->assertEquals($responseHeaders, $response[1]); + $this->assertEquals($out, $response[2]); + } + + + public function testExceptionCallsAfterException() { + $out = 'yo'; + $httpHeaders = 'Http'; + $responseHeaders = array('hell' => 'yeah'); + $this->setMiddlewareExpections($out, $httpHeaders, $responseHeaders, true); + + $response = $this->dispatcher->dispatch($this->controller, + $this->controllerMethod); + + $this->assertEquals($httpHeaders, $response[0]); + $this->assertEquals($responseHeaders, $response[1]); + $this->assertEquals($out, $response[2]); + } + + + public function testExceptionThrowsIfCanNotBeHandledByAfterException() { + $out = 'yo'; + $httpHeaders = 'Http'; + $responseHeaders = array('hell' => 'yeah'); + $this->setMiddlewareExpections($out, $httpHeaders, $responseHeaders, true, false); + + $this->setExpectedException('\Exception'); + $response = $this->dispatcher->dispatch($this->controller, + $this->controllerMethod); + + } + +} diff --git a/tests/lib/appframework/http/DownloadResponseTest.php b/tests/lib/appframework/http/DownloadResponseTest.php new file mode 100644 index 0000000000000000000000000000000000000000..64fe7992b6a83d8f50d345ab61d79e1805ac8b9f --- /dev/null +++ b/tests/lib/appframework/http/DownloadResponseTest.php @@ -0,0 +1,51 @@ +. + * + */ + + +namespace OC\AppFramework\Http; + + +//require_once(__DIR__ . "/../classloader.php"); + + +class ChildDownloadResponse extends DownloadResponse {}; + + +class DownloadResponseTest extends \PHPUnit_Framework_TestCase { + + protected $response; + + protected function setUp(){ + $this->response = new ChildDownloadResponse('file', 'content'); + } + + + public function testHeaders() { + $headers = $this->response->getHeaders(); + + $this->assertContains('attachment; filename="file"', $headers['Content-Disposition']); + $this->assertContains('content', $headers['Content-Type']); + } + + +} diff --git a/tests/lib/appframework/http/HttpTest.php b/tests/lib/appframework/http/HttpTest.php new file mode 100644 index 0000000000000000000000000000000000000000..382d511b116449aa0ecda0047db07110ebbd93ad --- /dev/null +++ b/tests/lib/appframework/http/HttpTest.php @@ -0,0 +1,87 @@ +. + * + */ + + +namespace OC\AppFramework\Http; + + +//require_once(__DIR__ . "/../classloader.php"); + + + +class HttpTest extends \PHPUnit_Framework_TestCase { + + private $server; + private $http; + + protected function setUp(){ + $this->server = array(); + $this->http = new Http($this->server); + } + + + public function testProtocol() { + $header = $this->http->getStatusHeader(Http::STATUS_TEMPORARY_REDIRECT); + $this->assertEquals('HTTP/1.1 307 Temporary Redirect', $header); + } + + + public function testProtocol10() { + $this->http = new Http($this->server, 'HTTP/1.0'); + $header = $this->http->getStatusHeader(Http::STATUS_OK); + $this->assertEquals('HTTP/1.0 200 OK', $header); + } + + + public function testEtagMatchReturnsNotModified() { + $http = new Http(array('HTTP_IF_NONE_MATCH' => 'hi')); + + $header = $http->getStatusHeader(Http::STATUS_OK, null, 'hi'); + $this->assertEquals('HTTP/1.1 304 Not Modified', $header); + } + + + public function testLastModifiedMatchReturnsNotModified() { + $dateTime = new \DateTime(null, new \DateTimeZone('GMT')); + $dateTime->setTimestamp('12'); + + $http = new Http( + array( + 'HTTP_IF_MODIFIED_SINCE' => 'Thu, 01 Jan 1970 00:00:12 +0000') + ); + + $header = $http->getStatusHeader(Http::STATUS_OK, $dateTime); + $this->assertEquals('HTTP/1.1 304 Not Modified', $header); + } + + + + public function testTempRedirectBecomesFoundInHttp10() { + $http = new Http(array(), 'HTTP/1.0'); + + $header = $http->getStatusHeader(Http::STATUS_TEMPORARY_REDIRECT); + $this->assertEquals('HTTP/1.0 302 Found', $header); + } + // TODO: write unittests for http codes + +} diff --git a/tests/lib/appframework/http/JSONResponseTest.php b/tests/lib/appframework/http/JSONResponseTest.php new file mode 100644 index 0000000000000000000000000000000000000000..534c54cbcee726f473c1b55d59162d95b20e01bb --- /dev/null +++ b/tests/lib/appframework/http/JSONResponseTest.php @@ -0,0 +1,98 @@ +. + * + */ + + +namespace OC\AppFramework\Http; + + +use OCP\AppFramework\Http\JSONResponse; + +//require_once(__DIR__ . "/../classloader.php"); + + + +class JSONResponseTest extends \PHPUnit_Framework_TestCase { + + /** + * @var JSONResponse + */ + private $json; + + protected function setUp() { + $this->json = new JSONResponse(); + } + + + public function testHeader() { + $headers = $this->json->getHeaders(); + $this->assertEquals('application/json; charset=utf-8', $headers['Content-type']); + } + + + public function testSetData() { + $params = array('hi', 'yo'); + $this->json->setData($params); + + $this->assertEquals(array('hi', 'yo'), $this->json->getData()); + } + + + public function testSetRender() { + $params = array('test' => 'hi'); + $this->json->setData($params); + + $expected = '{"test":"hi"}'; + + $this->assertEquals($expected, $this->json->render()); + } + + + public function testRender() { + $params = array('test' => 'hi'); + $this->json->setData($params); + + $expected = '{"test":"hi"}'; + + $this->assertEquals($expected, $this->json->render()); + } + + + public function testShouldHaveXContentHeaderByDefault() { + $headers = $this->json->getHeaders(); + $this->assertEquals('nosniff', $headers['X-Content-Type-Options']); + } + + + public function testConstructorAllowsToSetData() { + $data = array('hi'); + $code = 300; + $response = new JSONResponse($data, $code); + + $expected = '["hi"]'; + $this->assertEquals($expected, $response->render()); + $this->assertEquals($code, $response->getStatus()); + } + +} diff --git a/tests/lib/appframework/http/RedirectResponseTest.php b/tests/lib/appframework/http/RedirectResponseTest.php new file mode 100644 index 0000000000000000000000000000000000000000..1946655b0fa54ea6c95ab9cdb3fff6e0fbefe2a9 --- /dev/null +++ b/tests/lib/appframework/http/RedirectResponseTest.php @@ -0,0 +1,55 @@ +. + * + */ + + +namespace OC\AppFramework\Http; + + +//require_once(__DIR__ . "/../classloader.php"); + + + +class RedirectResponseTest extends \PHPUnit_Framework_TestCase { + + + protected $response; + + protected function setUp(){ + $this->response = new RedirectResponse('/url'); + } + + + public function testHeaders() { + $headers = $this->response->getHeaders(); + $this->assertEquals('/url', $headers['Location']); + $this->assertEquals(Http::STATUS_TEMPORARY_REDIRECT, + $this->response->getStatus()); + } + + + public function testGetRedirectUrl(){ + $this->assertEquals('/url', $this->response->getRedirectUrl()); + } + + +} diff --git a/tests/lib/appframework/http/RequestTest.php b/tests/lib/appframework/http/RequestTest.php new file mode 100644 index 0000000000000000000000000000000000000000..0371c870cf292682b70a35a35fac70d3020f2468 --- /dev/null +++ b/tests/lib/appframework/http/RequestTest.php @@ -0,0 +1,76 @@ + array('name' => 'John Q. Public', 'nickname' => 'Joey'), + ); + + $request = new Request($vars); + + // Countable + $this->assertEquals(2, count($request)); + // Array access + $this->assertEquals('Joey', $request['nickname']); + // "Magic" accessors + $this->assertEquals('Joey', $request->{'nickname'}); + $this->assertTrue(isset($request['nickname'])); + $this->assertTrue(isset($request->{'nickname'})); + $this->assertEquals(false, isset($request->{'flickname'})); + // Only testing 'get', but same approach for post, files etc. + $this->assertEquals('Joey', $request->get['nickname']); + // Always returns null if variable not set. + $this->assertEquals(null, $request->{'flickname'}); + } + + // urlParams has precedence over POST which has precedence over GET + public function testPrecedence() { + $vars = array( + 'get' => array('name' => 'John Q. Public', 'nickname' => 'Joey'), + 'post' => array('name' => 'Jane Doe', 'nickname' => 'Janey'), + 'urlParams' => array('user' => 'jw', 'name' => 'Johnny Weissmüller'), + ); + + $request = new Request($vars); + + $this->assertEquals(3, count($request)); + $this->assertEquals('Janey', $request->{'nickname'}); + $this->assertEquals('Johnny Weissmüller', $request->{'name'}); + } + + + /** + * @expectedException RuntimeException + */ + public function testImmutableArrayAccess() { + $vars = array( + 'get' => array('name' => 'John Q. Public', 'nickname' => 'Joey'), + ); + + $request = new Request($vars); + $request['nickname'] = 'Janey'; + } + + /** + * @expectedException RuntimeException + */ + public function testImmutableMagicAccess() { + $vars = array( + 'get' => array('name' => 'John Q. Public', 'nickname' => 'Joey'), + ); + + $request = new Request($vars); + $request->{'nickname'} = 'Janey'; + } + +} diff --git a/tests/lib/appframework/http/ResponseTest.php b/tests/lib/appframework/http/ResponseTest.php new file mode 100644 index 0000000000000000000000000000000000000000..7e09086f80172d3f4bd0a9245434560347b47363 --- /dev/null +++ b/tests/lib/appframework/http/ResponseTest.php @@ -0,0 +1,120 @@ +. + * + */ + + +namespace OC\AppFramework\Http; + + +use OCP\AppFramework\Http\Response; + + +class ResponseTest extends \PHPUnit_Framework_TestCase { + + /** + * @var \OCP\AppFramework\Http\Response + */ + private $childResponse; + + protected function setUp(){ + $this->childResponse = new Response(); + } + + + public function testAddHeader(){ + $this->childResponse->addHeader('hello', 'world'); + $headers = $this->childResponse->getHeaders(); + $this->assertEquals('world', $headers['hello']); + } + + + public function testAddHeaderValueNullDeletesIt(){ + $this->childResponse->addHeader('hello', 'world'); + $this->childResponse->addHeader('hello', null); + $this->assertEquals(1, count($this->childResponse->getHeaders())); + } + + + public function testCacheHeadersAreDisabledByDefault(){ + $headers = $this->childResponse->getHeaders(); + $this->assertEquals('no-cache, must-revalidate', $headers['Cache-Control']); + } + + + public function testRenderReturnNullByDefault(){ + $this->assertEquals(null, $this->childResponse->render()); + } + + + public function testGetStatus() { + $default = $this->childResponse->getStatus(); + + $this->childResponse->setStatus(Http::STATUS_NOT_FOUND); + + $this->assertEquals(Http::STATUS_OK, $default); + $this->assertEquals(Http::STATUS_NOT_FOUND, $this->childResponse->getStatus()); + } + + + public function testGetEtag() { + $this->childResponse->setEtag('hi'); + $this->assertEquals('hi', $this->childResponse->getEtag()); + } + + + public function testGetLastModified() { + $lastModified = new \DateTime(null, new \DateTimeZone('GMT')); + $lastModified->setTimestamp(1); + $this->childResponse->setLastModified($lastModified); + $this->assertEquals($lastModified, $this->childResponse->getLastModified()); + } + + + + public function testCacheSecondsZero() { + $this->childResponse->cacheFor(0); + + $headers = $this->childResponse->getHeaders(); + $this->assertEquals('no-cache, must-revalidate', $headers['Cache-Control']); + } + + + public function testCacheSeconds() { + $this->childResponse->cacheFor(33); + + $headers = $this->childResponse->getHeaders(); + $this->assertEquals('max-age=33, must-revalidate', + $headers['Cache-Control']); + } + + + + public function testEtagLastModifiedHeaders() { + $lastModified = new \DateTime(null, new \DateTimeZone('GMT')); + $lastModified->setTimestamp(1); + $this->childResponse->setLastModified($lastModified); + $headers = $this->childResponse->getHeaders(); + $this->assertEquals('Thu, 01 Jan 1970 00:00:01 +0000', $headers['Last-Modified']); + } + + +} diff --git a/tests/lib/appframework/http/TemplateResponseTest.php b/tests/lib/appframework/http/TemplateResponseTest.php new file mode 100644 index 0000000000000000000000000000000000000000..3c6d29cd3392bfcb1a7c9b07923a1578a7abe212 --- /dev/null +++ b/tests/lib/appframework/http/TemplateResponseTest.php @@ -0,0 +1,161 @@ +. + * + */ + + +namespace OC\AppFramework\Http; + +use OCP\AppFramework\Http\TemplateResponse; + + +class TemplateResponseTest extends \PHPUnit_Framework_TestCase { + + /** + * @var \OCP\AppFramework\Http\TemplateResponse + */ + private $tpl; + + /** + * @var \OCP\AppFramework\IApi + */ + private $api; + + protected function setUp() { + $this->api = $this->getMock('OC\AppFramework\Core\API', + array('getAppName'), array('test')); + $this->api->expects($this->any()) + ->method('getAppName') + ->will($this->returnValue('app')); + + $this->tpl = new TemplateResponse($this->api, 'home'); + } + + + public function testSetParams(){ + $params = array('hi' => 'yo'); + $this->tpl->setParams($params); + + $this->assertEquals(array('hi' => 'yo'), $this->tpl->getParams()); + } + + + public function testGetTemplateName(){ + $this->assertEquals('home', $this->tpl->getTemplateName()); + } + + + public function testRender(){ + $ocTpl = $this->getMock('Template', array('fetchPage')); + $ocTpl->expects($this->once()) + ->method('fetchPage'); + + $api = $this->getMock('OC\AppFramework\Core\API', + array('getAppName', 'getTemplate'), array('app')); + $api->expects($this->any()) + ->method('getAppName') + ->will($this->returnValue('app')); + $api->expects($this->once()) + ->method('getTemplate') + ->with($this->equalTo('home'), $this->equalTo('user'), $this->equalTo('app')) + ->will($this->returnValue($ocTpl)); + + $tpl = new TemplateResponse($api, 'home'); + + $tpl->render(); + } + + + public function testRenderAssignsParams(){ + $params = array('john' => 'doe'); + + $ocTpl = $this->getMock('Template', array('assign', 'fetchPage')); + $ocTpl->expects($this->once()) + ->method('assign') + ->with($this->equalTo('john'), $this->equalTo('doe')); + + $api = $this->getMock('OC\AppFramework\Core\API', + array('getAppName', 'getTemplate'), array('app')); + $api->expects($this->any()) + ->method('getAppName') + ->will($this->returnValue('app')); + $api->expects($this->once()) + ->method('getTemplate') + ->with($this->equalTo('home'), $this->equalTo('user'), $this->equalTo('app')) + ->will($this->returnValue($ocTpl)); + + $tpl = new TemplateResponse($api, 'home'); + $tpl->setParams($params); + + $tpl->render(); + } + + + public function testRenderDifferentApp(){ + $ocTpl = $this->getMock('Template', array('fetchPage')); + $ocTpl->expects($this->once()) + ->method('fetchPage'); + + $api = $this->getMock('OC\AppFramework\Core\API', + array('getAppName', 'getTemplate'), array('app')); + $api->expects($this->any()) + ->method('getAppName') + ->will($this->returnValue('app')); + $api->expects($this->once()) + ->method('getTemplate') + ->with($this->equalTo('home'), $this->equalTo('user'), $this->equalTo('app2')) + ->will($this->returnValue($ocTpl)); + + $tpl = new TemplateResponse($api, 'home', 'app2'); + + $tpl->render(); + } + + + public function testRenderDifferentRenderAs(){ + $ocTpl = $this->getMock('Template', array('fetchPage')); + $ocTpl->expects($this->once()) + ->method('fetchPage'); + + $api = $this->getMock('OC\AppFramework\Core\API', + array('getAppName', 'getTemplate'), array('app')); + $api->expects($this->any()) + ->method('getAppName') + ->will($this->returnValue('app')); + $api->expects($this->once()) + ->method('getTemplate') + ->with($this->equalTo('home'), $this->equalTo('admin'), $this->equalTo('app')) + ->will($this->returnValue($ocTpl)); + + $tpl = new TemplateResponse($api, 'home'); + $tpl->renderAs('admin'); + + $tpl->render(); + } + + + public function testGetRenderAs(){ + $render = 'myrender'; + $this->tpl->renderAs($render); + $this->assertEquals($render, $this->tpl->getRenderAs()); + } + +} diff --git a/tests/lib/appframework/middleware/MiddlewareDispatcherTest.php b/tests/lib/appframework/middleware/MiddlewareDispatcherTest.php new file mode 100644 index 0000000000000000000000000000000000000000..43727846dcf3863af85aa4b14f272d060b805ec6 --- /dev/null +++ b/tests/lib/appframework/middleware/MiddlewareDispatcherTest.php @@ -0,0 +1,285 @@ +. + * + */ + + +namespace OC\AppFramework; + +use OC\AppFramework\Http\Request; +use OC\AppFramework\Middleware\Middleware; +use OC\AppFramework\Middleware\MiddlewareDispatcher; +use OCP\AppFramework\Http\Response; + + +// needed to test ordering +class TestMiddleware extends Middleware { + public static $beforeControllerCalled = 0; + public static $afterControllerCalled = 0; + public static $afterExceptionCalled = 0; + public static $beforeOutputCalled = 0; + + public $beforeControllerOrder = 0; + public $afterControllerOrder = 0; + public $afterExceptionOrder = 0; + public $beforeOutputOrder = 0; + + public $controller; + public $methodName; + public $exception; + public $response; + public $output; + + private $beforeControllerThrowsEx; + + public function __construct($beforeControllerThrowsEx) { + self::$beforeControllerCalled = 0; + self::$afterControllerCalled = 0; + self::$afterExceptionCalled = 0; + self::$beforeOutputCalled = 0; + $this->beforeControllerThrowsEx = $beforeControllerThrowsEx; + } + + public function beforeController($controller, $methodName){ + self::$beforeControllerCalled++; + $this->beforeControllerOrder = self::$beforeControllerCalled; + $this->controller = $controller; + $this->methodName = $methodName; + if($this->beforeControllerThrowsEx){ + throw new \Exception(); + } + } + + public function afterException($controller, $methodName, \Exception $exception){ + self::$afterExceptionCalled++; + $this->afterExceptionOrder = self::$afterExceptionCalled; + $this->controller = $controller; + $this->methodName = $methodName; + $this->exception = $exception; + parent::afterException($controller, $methodName, $exception); + } + + public function afterController($controller, $methodName, Response $response){ + self::$afterControllerCalled++; + $this->afterControllerOrder = self::$afterControllerCalled; + $this->controller = $controller; + $this->methodName = $methodName; + $this->response = $response; + return parent::afterController($controller, $methodName, $response); + } + + public function beforeOutput($controller, $methodName, $output){ + self::$beforeOutputCalled++; + $this->beforeOutputOrder = self::$beforeOutputCalled; + $this->controller = $controller; + $this->methodName = $methodName; + $this->output = $output; + return parent::beforeOutput($controller, $methodName, $output); + } +} + + +class MiddlewareDispatcherTest extends \PHPUnit_Framework_TestCase { + + public $exception; + public $response; + private $out; + private $method; + private $controller; + + /** + * @var MiddlewareDispatcher + */ + private $dispatcher; + + + public function setUp() { + $this->dispatcher = new MiddlewareDispatcher(); + $this->controller = $this->getControllerMock(); + $this->method = 'method'; + $this->response = new Response(); + $this->out = 'hi'; + $this->exception = new \Exception(); + } + + + private function getAPIMock(){ + return $this->getMock('OC\AppFramework\Core\API', + array('getAppName'), array('app')); + } + + + private function getControllerMock(){ + return $this->getMock('OC\AppFramework\Controller\Controller', array('method'), + array($this->getAPIMock(), new Request())); + } + + + private function getMiddleware($beforeControllerThrowsEx=false){ + $m1 = new TestMiddleware($beforeControllerThrowsEx); + $this->dispatcher->registerMiddleware($m1); + return $m1; + } + + + public function testAfterExceptionShouldReturnResponseOfMiddleware(){ + $response = new Response(); + $m1 = $this->getMock('\OC\AppFramework\Middleware\Middleware', + array('afterException', 'beforeController')); + $m1->expects($this->never()) + ->method('afterException'); + + $m2 = $this->getMock('OC\AppFramework\Middleware\Middleware', + array('afterException', 'beforeController')); + $m2->expects($this->once()) + ->method('afterException') + ->will($this->returnValue($response)); + + $this->dispatcher->registerMiddleware($m1); + $this->dispatcher->registerMiddleware($m2); + + $this->dispatcher->beforeController($this->controller, $this->method); + $this->assertEquals($response, $this->dispatcher->afterException($this->controller, $this->method, $this->exception)); + } + + + public function testAfterExceptionShouldThrowAgainWhenNotHandled(){ + $m1 = new TestMiddleware(false); + $m2 = new TestMiddleware(true); + + $this->dispatcher->registerMiddleware($m1); + $this->dispatcher->registerMiddleware($m2); + + $this->setExpectedException('\Exception'); + $this->dispatcher->beforeController($this->controller, $this->method); + $this->dispatcher->afterException($this->controller, $this->method, $this->exception); + } + + + public function testBeforeControllerCorrectArguments(){ + $m1 = $this->getMiddleware(); + $this->dispatcher->beforeController($this->controller, $this->method); + + $this->assertEquals($this->controller, $m1->controller); + $this->assertEquals($this->method, $m1->methodName); + } + + + public function testAfterControllerCorrectArguments(){ + $m1 = $this->getMiddleware(); + + $this->dispatcher->afterController($this->controller, $this->method, $this->response); + + $this->assertEquals($this->controller, $m1->controller); + $this->assertEquals($this->method, $m1->methodName); + $this->assertEquals($this->response, $m1->response); + } + + + public function testAfterExceptionCorrectArguments(){ + $m1 = $this->getMiddleware(); + + $this->setExpectedException('\Exception'); + + $this->dispatcher->beforeController($this->controller, $this->method); + $this->dispatcher->afterException($this->controller, $this->method, $this->exception); + + $this->assertEquals($this->controller, $m1->controller); + $this->assertEquals($this->method, $m1->methodName); + $this->assertEquals($this->exception, $m1->exception); + } + + + public function testBeforeOutputCorrectArguments(){ + $m1 = $this->getMiddleware(); + + $this->dispatcher->beforeOutput($this->controller, $this->method, $this->out); + + $this->assertEquals($this->controller, $m1->controller); + $this->assertEquals($this->method, $m1->methodName); + $this->assertEquals($this->out, $m1->output); + } + + + public function testBeforeControllerOrder(){ + $m1 = $this->getMiddleware(); + $m2 = $this->getMiddleware(); + + $this->dispatcher->beforeController($this->controller, $this->method); + + $this->assertEquals(1, $m1->beforeControllerOrder); + $this->assertEquals(2, $m2->beforeControllerOrder); + } + + public function testAfterControllerOrder(){ + $m1 = $this->getMiddleware(); + $m2 = $this->getMiddleware(); + + $this->dispatcher->afterController($this->controller, $this->method, $this->response); + + $this->assertEquals(2, $m1->afterControllerOrder); + $this->assertEquals(1, $m2->afterControllerOrder); + } + + + public function testAfterExceptionOrder(){ + $m1 = $this->getMiddleware(); + $m2 = $this->getMiddleware(); + + $this->setExpectedException('\Exception'); + $this->dispatcher->beforeController($this->controller, $this->method); + $this->dispatcher->afterException($this->controller, $this->method, $this->exception); + + $this->assertEquals(1, $m1->afterExceptionOrder); + $this->assertEquals(1, $m2->afterExceptionOrder); + } + + + public function testBeforeOutputOrder(){ + $m1 = $this->getMiddleware(); + $m2 = $this->getMiddleware(); + + $this->dispatcher->beforeOutput($this->controller, $this->method, $this->out); + + $this->assertEquals(2, $m1->beforeOutputOrder); + $this->assertEquals(1, $m2->beforeOutputOrder); + } + + + public function testExceptionShouldRunAfterExceptionOfOnlyPreviouslyExecutedMiddlewares(){ + $m1 = $this->getMiddleware(); + $m2 = $this->getMiddleware(true); + $m3 = $this->getMock('\OC\AppFramework\Middleware\Middleware'); + $m3->expects($this->never()) + ->method('afterException'); + $m3->expects($this->never()) + ->method('beforeController'); + $m3->expects($this->never()) + ->method('afterController'); + + $this->dispatcher->registerMiddleware($m3); + + $this->dispatcher->beforeOutput($this->controller, $this->method, $this->out); + + $this->assertEquals(2, $m1->beforeOutputOrder); + $this->assertEquals(1, $m2->beforeOutputOrder); + } +} diff --git a/tests/lib/appframework/middleware/MiddlewareTest.php b/tests/lib/appframework/middleware/MiddlewareTest.php new file mode 100644 index 0000000000000000000000000000000000000000..5e2930ac6a36a426127e164286ae1093a8006680 --- /dev/null +++ b/tests/lib/appframework/middleware/MiddlewareTest.php @@ -0,0 +1,83 @@ +. + * + */ + + +namespace OC\AppFramework; + +use OC\AppFramework\Http\Request; +use OC\AppFramework\Middleware\Middleware; + + +class ChildMiddleware extends Middleware {}; + + +class MiddlewareTest extends \PHPUnit_Framework_TestCase { + + /** + * @var Middleware + */ + private $middleware; + private $controller; + private $exception; + private $api; + + protected function setUp(){ + $this->middleware = new ChildMiddleware(); + + $this->api = $this->getMock('OC\AppFramework\Core\API', + array(), array('test')); + + $this->controller = $this->getMock('OC\AppFramework\Controller\Controller', + array(), array($this->api, new Request())); + $this->exception = new \Exception(); + $this->response = $this->getMock('OCP\AppFramework\Http\Response'); + } + + + public function testBeforeController() { + $this->middleware->beforeController($this->controller, null); + $this->assertNull(null); + } + + + public function testAfterExceptionRaiseAgainWhenUnhandled() { + $this->setExpectedException('Exception'); + $afterEx = $this->middleware->afterException($this->controller, null, $this->exception); + } + + + public function testAfterControllerReturnResponseWhenUnhandled() { + $response = $this->middleware->afterController($this->controller, null, $this->response); + + $this->assertEquals($this->response, $response); + } + + + public function testBeforeOutputReturnOutputhenUnhandled() { + $output = $this->middleware->beforeOutput($this->controller, null, 'test'); + + $this->assertEquals('test', $output); + } + + +} diff --git a/tests/lib/appframework/middleware/security/SecurityMiddlewareTest.php b/tests/lib/appframework/middleware/security/SecurityMiddlewareTest.php new file mode 100644 index 0000000000000000000000000000000000000000..3ed44282a7b0b3a625fd6ef88a2a67e90464123c --- /dev/null +++ b/tests/lib/appframework/middleware/security/SecurityMiddlewareTest.php @@ -0,0 +1,296 @@ +. + * + */ + + +namespace OC\AppFramework\Middleware\Security; + +use OC\AppFramework\Http\Http; +use OC\AppFramework\Http\Request; +use OC\AppFramework\Http\RedirectResponse; +use OCP\AppFramework\Http\JSONResponse; + + +class SecurityMiddlewareTest extends \PHPUnit_Framework_TestCase { + + private $middleware; + private $controller; + private $secException; + private $secAjaxException; + private $request; + + public function setUp() { + $api = $this->getMock('OC\AppFramework\Core\API', array(), array('test')); + $this->controller = $this->getMock('OC\AppFramework\Controller\Controller', + array(), array($api, new Request())); + + $this->request = new Request(); + $this->middleware = new SecurityMiddleware($api, $this->request); + $this->secException = new SecurityException('hey', false); + $this->secAjaxException = new SecurityException('hey', true); + } + + + private function getAPI(){ + return $this->getMock('OC\AppFramework\Core\API', + array('isLoggedIn', 'passesCSRFCheck', 'isAdminUser', + 'isSubAdminUser', 'activateNavigationEntry', + 'getUserId'), + array('app')); + } + + + private function checkNavEntry($method, $shouldBeActivated=false){ + $api = $this->getAPI(); + + if($shouldBeActivated){ + $api->expects($this->once()) + ->method('activateNavigationEntry'); + } else { + $api->expects($this->never()) + ->method('activateNavigationEntry'); + } + + $sec = new SecurityMiddleware($api, $this->request); + $sec->beforeController('\OC\AppFramework\Middleware\Security\SecurityMiddlewareTest', $method); + } + + + /** + * @PublicPage + * @NoCSRFRequired + */ + public function testSetNavigationEntry(){ + $this->checkNavEntry('testSetNavigationEntry', true); + } + + + private function ajaxExceptionStatus($method, $test, $status) { + $api = $this->getAPI(); + $api->expects($this->any()) + ->method($test) + ->will($this->returnValue(false)); + + // isAdminUser requires isLoggedIn call to return true + if ($test === 'isAdminUser') { + $api->expects($this->any()) + ->method('isLoggedIn') + ->will($this->returnValue(true)); + } + + $sec = new SecurityMiddleware($api, $this->request); + + try { + $sec->beforeController('\OC\AppFramework\Middleware\Security\SecurityMiddlewareTest', + $method); + } catch (SecurityException $ex){ + $this->assertEquals($status, $ex->getCode()); + } + } + + public function testAjaxStatusLoggedInCheck() { + $this->ajaxExceptionStatus( + 'testAjaxStatusLoggedInCheck', + 'isLoggedIn', + Http::STATUS_UNAUTHORIZED + ); + } + + /** + * @NoCSRFRequired + * @NoAdminRequired + */ + public function testAjaxNotAdminCheck() { + $this->ajaxExceptionStatus( + 'testAjaxNotAdminCheck', + 'isAdminUser', + Http::STATUS_FORBIDDEN + ); + } + + /** + * @PublicPage + */ + public function testAjaxStatusCSRFCheck() { + $this->ajaxExceptionStatus( + 'testAjaxStatusCSRFCheck', + 'passesCSRFCheck', + Http::STATUS_PRECONDITION_FAILED + ); + } + + /** + * @PublicPage + * @NoCSRFRequired + */ + public function testAjaxStatusAllGood() { + $this->ajaxExceptionStatus( + 'testAjaxStatusAllGood', + 'isLoggedIn', + 0 + ); + $this->ajaxExceptionStatus( + 'testAjaxStatusAllGood', + 'isAdminUser', + 0 + ); + $this->ajaxExceptionStatus( + 'testAjaxStatusAllGood', + 'isSubAdminUser', + 0 + ); + $this->ajaxExceptionStatus( + 'testAjaxStatusAllGood', + 'passesCSRFCheck', + 0 + ); + } + + + /** + * @PublicPage + * @NoCSRFRequired + */ + public function testNoChecks(){ + $api = $this->getAPI(); + $api->expects($this->never()) + ->method('passesCSRFCheck') + ->will($this->returnValue(true)); + $api->expects($this->never()) + ->method('isAdminUser') + ->will($this->returnValue(true)); + $api->expects($this->never()) + ->method('isLoggedIn') + ->will($this->returnValue(true)); + + $sec = new SecurityMiddleware($api, $this->request); + $sec->beforeController('\OC\AppFramework\Middleware\Security\SecurityMiddlewareTest', + 'testNoChecks'); + } + + + private function securityCheck($method, $expects, $shouldFail=false){ + $api = $this->getAPI(); + $api->expects($this->once()) + ->method($expects) + ->will($this->returnValue(!$shouldFail)); + + // admin check requires login + if ($expects === 'isAdminUser') { + $api->expects($this->once()) + ->method('isLoggedIn') + ->will($this->returnValue(true)); + } + + $sec = new SecurityMiddleware($api, $this->request); + + if($shouldFail){ + $this->setExpectedException('\OC\AppFramework\Middleware\Security\SecurityException'); + } else { + $this->setExpectedException(null); + } + + $sec->beforeController('\OC\AppFramework\Middleware\Security\SecurityMiddlewareTest', $method); + } + + + /** + * @PublicPage + */ + public function testCsrfCheck(){ + $this->securityCheck('testCsrfCheck', 'passesCSRFCheck'); + } + + + /** + * @PublicPage + */ + public function testFailCsrfCheck(){ + $this->securityCheck('testFailCsrfCheck', 'passesCSRFCheck', true); + } + + + /** + * @NoCSRFRequired + * @NoAdminRequired + */ + public function testLoggedInCheck(){ + $this->securityCheck('testLoggedInCheck', 'isLoggedIn'); + } + + + /** + * @NoCSRFRequired + * @NoAdminRequired + */ + public function testFailLoggedInCheck(){ + $this->securityCheck('testFailLoggedInCheck', 'isLoggedIn', true); + } + + + /** + * @NoCSRFRequired + */ + public function testIsAdminCheck(){ + $this->securityCheck('testIsAdminCheck', 'isAdminUser'); + } + + + /** + * @NoCSRFRequired + */ + public function testFailIsAdminCheck(){ + $this->securityCheck('testFailIsAdminCheck', 'isAdminUser', true); + } + + + public function testAfterExceptionNotCaughtThrowsItAgain(){ + $ex = new \Exception(); + $this->setExpectedException('\Exception'); + $this->middleware->afterException($this->controller, 'test', $ex); + } + + + public function testAfterExceptionReturnsRedirect(){ + $api = $this->getMock('OC\AppFramework\Core\API', array(), array('test')); + $this->controller = $this->getMock('OC\AppFramework\Controller\Controller', + array(), array($api, new Request())); + + $this->request = new Request( + array('server' => array('HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'))); + $this->middleware = new SecurityMiddleware($api, $this->request); + $response = $this->middleware->afterException($this->controller, 'test', + $this->secException); + + $this->assertTrue($response instanceof RedirectResponse); + } + + + public function testAfterAjaxExceptionReturnsJSONError(){ + $response = $this->middleware->afterException($this->controller, 'test', + $this->secAjaxException); + + $this->assertTrue($response instanceof JSONResponse); + } + + +} diff --git a/tests/lib/appframework/routing/RoutingTest.php b/tests/lib/appframework/routing/RoutingTest.php new file mode 100644 index 0000000000000000000000000000000000000000..a7aa922db12becd05a88115ca7608275d466f70f --- /dev/null +++ b/tests/lib/appframework/routing/RoutingTest.php @@ -0,0 +1,213 @@ + array( + array('name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'GET') + )); + + $this->assertSimpleRoute($routes, 'folders.open', 'GET', '/folders/{folderId}/open', 'FoldersController', 'open'); + } + + public function testSimpleRouteWithMissingVerb() + { + $routes = array('routes' => array( + array('name' => 'folders#open', 'url' => '/folders/{folderId}/open') + )); + + $this->assertSimpleRoute($routes, 'folders.open', 'GET', '/folders/{folderId}/open', 'FoldersController', 'open'); + } + + public function testSimpleRouteWithLowercaseVerb() + { + $routes = array('routes' => array( + array('name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete') + )); + + $this->assertSimpleRoute($routes, 'folders.open', 'DELETE', '/folders/{folderId}/open', 'FoldersController', 'open'); + } + + /** + * @expectedException \UnexpectedValueException + */ + public function testSimpleRouteWithBrokenName() + { + $routes = array('routes' => array( + array('name' => 'folders_open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete') + )); + + // router mock + $router = $this->getMock("\OC_Router", array('create')); + + // load route configuration + $container = new DIContainer('app1'); + $config = new RouteConfig($container, $router, $routes); + + $config->register(); + } + + public function testSimpleRouteWithUnderScoreNames() + { + $routes = array('routes' => array( + array('name' => 'admin_folders#open_current', 'url' => '/folders/{folderId}/open', 'verb' => 'delete') + )); + + $this->assertSimpleRoute($routes, 'admin_folders.open_current', 'DELETE', '/folders/{folderId}/open', 'AdminFoldersController', 'openCurrent'); + } + + public function testResource() + { + $routes = array('resources' => array('accounts' => array('url' => '/accounts'))); + + $this->assertResource($routes, 'accounts', '/accounts', 'AccountsController', 'accountId'); + } + + public function testResourceWithUnderScoreName() + { + $routes = array('resources' => array('admin_accounts' => array('url' => '/admin/accounts'))); + + $this->assertResource($routes, 'admin_accounts', '/admin/accounts', 'AdminAccountsController', 'adminAccountId'); + } + + private function assertSimpleRoute($routes, $name, $verb, $url, $controllerName, $actionName) + { + // route mocks + $route = $this->mockRoute($verb, $controllerName, $actionName); + + // router mock + $router = $this->getMock("\OC_Router", array('create')); + + // we expect create to be called once: + $router + ->expects($this->once()) + ->method('create') + ->with($this->equalTo('app1.' . $name), $this->equalTo($url)) + ->will($this->returnValue($route)); + + // load route configuration + $container = new DIContainer('app1'); + $config = new RouteConfig($container, $router, $routes); + + $config->register(); + } + + private function assertResource($yaml, $resourceName, $url, $controllerName, $paramName) + { + // router mock + $router = $this->getMock("\OC_Router", array('create')); + + // route mocks + $indexRoute = $this->mockRoute('GET', $controllerName, 'index'); + $showRoute = $this->mockRoute('GET', $controllerName, 'show'); + $createRoute = $this->mockRoute('POST', $controllerName, 'create'); + $updateRoute = $this->mockRoute('PUT', $controllerName, 'update'); + $destroyRoute = $this->mockRoute('DELETE', $controllerName, 'destroy'); + + $urlWithParam = $url . '/{' . $paramName . '}'; + + // we expect create to be called once: + $router + ->expects($this->at(0)) + ->method('create') + ->with($this->equalTo('app1.' . $resourceName . '.index'), $this->equalTo($url)) + ->will($this->returnValue($indexRoute)); + + $router + ->expects($this->at(1)) + ->method('create') + ->with($this->equalTo('app1.' . $resourceName . '.show'), $this->equalTo($urlWithParam)) + ->will($this->returnValue($showRoute)); + + $router + ->expects($this->at(2)) + ->method('create') + ->with($this->equalTo('app1.' . $resourceName . '.create'), $this->equalTo($url)) + ->will($this->returnValue($createRoute)); + + $router + ->expects($this->at(3)) + ->method('create') + ->with($this->equalTo('app1.' . $resourceName . '.update'), $this->equalTo($urlWithParam)) + ->will($this->returnValue($updateRoute)); + + $router + ->expects($this->at(4)) + ->method('create') + ->with($this->equalTo('app1.' . $resourceName . '.destroy'), $this->equalTo($urlWithParam)) + ->will($this->returnValue($destroyRoute)); + + // load route configuration + $container = new DIContainer('app1'); + $config = new RouteConfig($container, $router, $yaml); + + $config->register(); + } + + /** + * @param $verb + * @param $controllerName + * @param $actionName + * @return \PHPUnit_Framework_MockObject_MockObject + */ + private function mockRoute($verb, $controllerName, $actionName) + { + $container = new DIContainer('app1'); + $route = $this->getMock("\OC_Route", array('method', 'action'), array(), '', false); + $route + ->expects($this->exactly(1)) + ->method('method') + ->with($this->equalTo($verb)) + ->will($this->returnValue($route)); + + $route + ->expects($this->exactly(1)) + ->method('action') + ->with($this->equalTo(new RouteActionHandler($container, $controllerName, $actionName))) + ->will($this->returnValue($route)); + return $route; + } + +} + +/* +# +# sample routes.yaml for ownCloud +# +# the section simple describes one route + +routes: + - name: folders#open + url: /folders/{folderId}/open + verb: GET + # controller: name.split()[0] + # action: name.split()[1] + +# for a resource following actions will be generated: +# - index +# - create +# - show +# - update +# - destroy +# - new +resources: + accounts: + url: /accounts + + folders: + url: /accounts/{accountId}/folders + # actions can be used to define additional actions on the resource + actions: + - name: validate + verb: GET + on-collection: false + + * */ diff --git a/tests/lib/appframework/utility/MethodAnnotationReaderTest.php b/tests/lib/appframework/utility/MethodAnnotationReaderTest.php new file mode 100644 index 0000000000000000000000000000000000000000..c68812aa5c76dbcb3c76ea4a1d0e50893c368c98 --- /dev/null +++ b/tests/lib/appframework/utility/MethodAnnotationReaderTest.php @@ -0,0 +1,55 @@ +. + * + */ + + +namespace OC\AppFramework\Utility; + + +class MethodAnnotationReaderTest extends \PHPUnit_Framework_TestCase { + + + /** + * @Annotation + */ + public function testReadAnnotation(){ + $reader = new MethodAnnotationReader('\OC\AppFramework\Utility\MethodAnnotationReaderTest', + 'testReadAnnotation'); + + $this->assertTrue($reader->hasAnnotation('Annotation')); + } + + + /** + * @Annotation + * @param test + */ + public function testReadAnnotationNoLowercase(){ + $reader = new MethodAnnotationReader('\OC\AppFramework\Utility\MethodAnnotationReaderTest', + 'testReadAnnotationNoLowercase'); + + $this->assertTrue($reader->hasAnnotation('Annotation')); + $this->assertFalse($reader->hasAnnotation('param')); + } + + +} diff --git a/tests/lib/avatar.php b/tests/lib/avatar.php new file mode 100644 index 0000000000000000000000000000000000000000..1c5195f8eb1952d6174c8c7c04770509ee0cbfb0 --- /dev/null +++ b/tests/lib/avatar.php @@ -0,0 +1,26 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +class Test_Avatar extends PHPUnit_Framework_TestCase { + + public function testAvatar() { + $this->markTestSkipped("Setting custom avatars with encryption doesn't work yet"); + + $avatar = new \OC_Avatar(\OC_User::getUser()); + + $this->assertEquals(false, $avatar->get()); + + $expected = new OC_Image(\OC::$SERVERROOT.'/tests/data/testavatar.png'); + $avatar->set($expected->data()); + $expected->resize(64); + $this->assertEquals($expected->data(), $avatar->get()->data()); + + $avatar->remove(); + $this->assertEquals(false, $avatar->get()); + } +} diff --git a/tests/lib/cache.php b/tests/lib/cache.php index 3dcf39f7d605df9b0c325264b25414c6f8d037e5..8fefa25f65d97f55468cd3835b33dd5031d30f3c 100644 --- a/tests/lib/cache.php +++ b/tests/lib/cache.php @@ -8,7 +8,7 @@ abstract class Test_Cache extends PHPUnit_Framework_TestCase { /** - * @var OC_Cache cache; + * @var \OC\Cache cache; */ protected $instance; diff --git a/tests/lib/cache/file.php b/tests/lib/cache/file.php index 038cb21b2576a54ac1b76d635a3279951a0a94d5..3767c83fcb1c28d76153c0e6de733ee4705d728a 100644 --- a/tests/lib/cache/file.php +++ b/tests/lib/cache/file.php @@ -20,7 +20,9 @@ * */ -class Test_Cache_File extends Test_Cache { +namespace Test\Cache; + +class FileCache extends \Test_Cache { private $user; private $datadir; @@ -30,8 +32,8 @@ class Test_Cache_File extends Test_Cache { public function setUp() { //clear all proxies and hooks so we can do clean testing - OC_FileProxy::clearProxies(); - OC_Hook::clear('OC_Filesystem'); + \OC_FileProxy::clearProxies(); + \OC_Hook::clear('OC_Filesystem'); //disabled atm //enable only the encryption hook if needed @@ -44,27 +46,27 @@ class Test_Cache_File extends Test_Cache { $storage = new \OC\Files\Storage\Temporary(array()); \OC\Files\Filesystem::mount($storage,array(),'/'); $datadir = str_replace('local::', '', $storage->getId()); - $this->datadir = OC_Config::getValue('datadirectory', OC::$SERVERROOT.'/data'); - OC_Config::setValue('datadirectory', $datadir); + $this->datadir = \OC_Config::getValue('datadirectory', \OC::$SERVERROOT.'/data'); + \OC_Config::setValue('datadirectory', $datadir); - OC_User::clearBackends(); - OC_User::useBackend(new OC_User_Dummy()); + \OC_User::clearBackends(); + \OC_User::useBackend(new \OC_User_Dummy()); //login - OC_User::createUser('test', 'test'); + \OC_User::createUser('test', 'test'); - $this->user=OC_User::getUser(); - OC_User::setUserId('test'); + $this->user = \OC_User::getUser(); + \OC_User::setUserId('test'); //set up the users dir - $rootView=new \OC\Files\View(''); + $rootView = new \OC\Files\View(''); $rootView->mkdir('/test'); - $this->instance=new OC_Cache_File(); + $this->instance=new \OC\Cache\File(); } public function tearDown() { - OC_User::setUserId($this->user); - OC_Config::setValue('datadirectory', $this->datadir); + \OC_User::setUserId($this->user); + \OC_Config::setValue('datadirectory', $this->datadir); } } diff --git a/tests/lib/cache/usercache.php b/tests/lib/cache/usercache.php new file mode 100644 index 0000000000000000000000000000000000000000..21b7f848ab6d85f4a4ce83c6a71cf414826b423d --- /dev/null +++ b/tests/lib/cache/usercache.php @@ -0,0 +1,68 @@ +. +* +*/ + +namespace Test\Cache; + +class UserCache extends \Test_Cache { + private $user; + private $datadir; + + public function setUp() { + //clear all proxies and hooks so we can do clean testing + \OC_FileProxy::clearProxies(); + \OC_Hook::clear('OC_Filesystem'); + + //disabled atm + //enable only the encryption hook if needed + //if(OC_App::isEnabled('files_encryption')) { + // OC_FileProxy::register(new OC_FileProxy_Encryption()); + //} + + //set up temporary storage + \OC\Files\Filesystem::clearMounts(); + $storage = new \OC\Files\Storage\Temporary(array()); + \OC\Files\Filesystem::mount($storage,array(),'/'); + $datadir = str_replace('local::', '', $storage->getId()); + $this->datadir = \OC_Config::getValue('datadirectory', \OC::$SERVERROOT.'/data'); + \OC_Config::setValue('datadirectory', $datadir); + + \OC_User::clearBackends(); + \OC_User::useBackend(new \OC_User_Dummy()); + + //login + \OC_User::createUser('test', 'test'); + + $this->user = \OC_User::getUser(); + \OC_User::setUserId('test'); + + //set up the users dir + $rootView=new \OC\Files\View(''); + $rootView->mkdir('/test'); + + $this->instance=new \OC\Cache\UserCache(); + } + + public function tearDown() { + \OC_User::setUserId($this->user); + \OC_Config::setValue('datadirectory', $this->datadir); + } +} diff --git a/tests/lib/connector/sabre/aborteduploaddetectionplugin.php b/tests/lib/connector/sabre/aborteduploaddetectionplugin.php new file mode 100644 index 0000000000000000000000000000000000000000..bef0e4c4d7d13aab36fe1e1f8446da8238ce7e9c --- /dev/null +++ b/tests/lib/connector/sabre/aborteduploaddetectionplugin.php @@ -0,0 +1,97 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +class Test_OC_Connector_Sabre_AbortedUploadDetectionPlugin extends PHPUnit_Framework_TestCase { + + /** + * @var Sabre_DAV_Server + */ + private $server; + + /** + * @var OC_Connector_Sabre_AbortedUploadDetectionPlugin + */ + private $plugin; + + public function setUp() { + $this->server = new Sabre_DAV_Server(); + $this->plugin = new OC_Connector_Sabre_AbortedUploadDetectionPlugin(); + $this->plugin->initialize($this->server); + } + + /** + * @dataProvider lengthProvider + */ + public function testLength($expected, $headers) + { + $this->server->httpRequest = new Sabre_HTTP_Request($headers); + $length = $this->plugin->getLength(); + $this->assertEquals($expected, $length); + } + + /** + * @dataProvider verifyContentLengthProvider + */ + public function testVerifyContentLength($fileSize, $headers) + { + $this->plugin->fileView = $this->buildFileViewMock($fileSize); + + $this->server->httpRequest = new Sabre_HTTP_Request($headers); + $this->plugin->verifyContentLength('foo.txt'); + $this->assertTrue(true); + } + + /** + * @dataProvider verifyContentLengthFailedProvider + * @expectedException Sabre_DAV_Exception_BadRequest + */ + public function testVerifyContentLengthFailed($fileSize, $headers) + { + $this->plugin->fileView = $this->buildFileViewMock($fileSize); + + // we expect unlink to be called + $this->plugin->fileView->expects($this->once())->method('unlink'); + + + $this->server->httpRequest = new Sabre_HTTP_Request($headers); + $this->plugin->verifyContentLength('foo.txt'); + } + + public function verifyContentLengthProvider() { + return array( + array(1024, array()), + array(1024, array('HTTP_X_EXPECTED_ENTITY_LENGTH' => '1024')), + array(512, array('HTTP_CONTENT_LENGTH' => '512')), + ); + } + + public function verifyContentLengthFailedProvider() { + return array( + array(1025, array('HTTP_X_EXPECTED_ENTITY_LENGTH' => '1024')), + array(525, array('HTTP_CONTENT_LENGTH' => '512')), + ); + } + + public function lengthProvider() { + return array( + array(null, array()), + array(1024, array('HTTP_X_EXPECTED_ENTITY_LENGTH' => '1024')), + array(512, array('HTTP_CONTENT_LENGTH' => '512')), + array(2048, array('HTTP_X_EXPECTED_ENTITY_LENGTH' => '2048', 'HTTP_CONTENT_LENGTH' => '1024')), + ); + } + + private function buildFileViewMock($fileSize) { + // mock filesysten + $view = $this->getMock('\OC\Files\View', array('filesize', 'unlink'), array(), '', FALSE); + $view->expects($this->any())->method('filesize')->withAnyParameters()->will($this->returnValue($fileSize)); + + return $view; + } + +} diff --git a/tests/lib/connector/sabre/objecttree.php b/tests/lib/connector/sabre/objecttree.php new file mode 100644 index 0000000000000000000000000000000000000000..1d76bb596766035b264b4ebf9ce67efd6e615460 --- /dev/null +++ b/tests/lib/connector/sabre/objecttree.php @@ -0,0 +1,87 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace Test\OC\Connector\Sabre; + + +use OC_Connector_Sabre_Directory; +use PHPUnit_Framework_TestCase; +use Sabre_DAV_Exception_Forbidden; + +class TestDoubleFileView extends \OC\Files\View{ + + public function __construct($updatables, $canRename = true) { + $this->updatables = $updatables; + $this->canRename = $canRename; + } + + public function isUpdatable($path) { + return $this->updatables[$path]; + } + + public function rename($path1, $path2) { + return $this->canRename; + } +} + +class ObjectTree extends PHPUnit_Framework_TestCase { + + /** + * @dataProvider moveFailedProvider + * @expectedException Sabre_DAV_Exception_Forbidden + */ + public function testMoveFailed($source, $dest, $updatables) { + $this->moveTest($source, $dest, $updatables); + } + + /** + * @dataProvider moveSuccessProvider + */ + public function testMoveSuccess($source, $dest, $updatables) { + $this->moveTest($source, $dest, $updatables); + $this->assertTrue(true); + } + + function moveFailedProvider() { + return array( + array('a/b', 'a/c', array('a' => false, 'a/b' => false, 'a/c' => false)), + array('a/b', 'b/b', array('a' => false, 'a/b' => false, 'b' => false, 'b/b' => false)), + array('a/b', 'b/b', array('a' => false, 'a/b' => true, 'b' => false, 'b/b' => false)), + array('a/b', 'b/b', array('a' => true, 'a/b' => true, 'b' => false, 'b/b' => false)), + ); + } + + function moveSuccessProvider() { + return array( + array('a/b', 'a/c', array('a' => false, 'a/b' => true, 'a/c' => false)), + array('a/b', 'b/b', array('a' => true, 'a/b' => true, 'b' => true, 'b/b' => false)), + ); + } + + /** + * @param $source + * @param $dest + * @param $updatables + */ + private function moveTest($source, $dest, $updatables) { + $rootDir = new OC_Connector_Sabre_Directory(''); + $objectTree = $this->getMock('\OC\Connector\Sabre\ObjectTree', + array('nodeExists', 'getNodeForPath'), + array($rootDir)); + + $objectTree->expects($this->once()) + ->method('getNodeForPath') + ->with($this->identicalTo($source)) + ->will($this->returnValue(false)); + + /** @var $objectTree \OC\Connector\Sabre\ObjectTree */ + $objectTree->fileView = new TestDoubleFileView($updatables); + $objectTree->move($source, $dest); + } + +} diff --git a/tests/lib/db.php b/tests/lib/db.php index 51edbf7b309bdfd9c6608aa7ebbb23311511ed2e..c87bee4ab99781cad34878f1622d7c306607a9e7 100644 --- a/tests/lib/db.php +++ b/tests/lib/db.php @@ -15,7 +15,7 @@ class Test_DB extends PHPUnit_Framework_TestCase { public function setUp() { $dbfile = OC::$SERVERROOT.'/tests/data/db_structure.xml'; - $r = '_'.OC_Util::generate_random_bytes('4').'_'; + $r = '_'.OC_Util::generateRandomBytes('4').'_'; $content = file_get_contents( $dbfile ); $content = str_replace( '*dbprefix*', '*dbprefix*'.$r, $content ); file_put_contents( self::$schema_file, $content ); @@ -145,4 +145,42 @@ class Test_DB extends PHPUnit_Framework_TestCase { $this->assertEquals(1, $result->numRows()); } + + /** + * Tests whether the database is configured so it accepts and returns dates + * in the expected format. + */ + public function testTimestampDateFormat() { + $table = '*PREFIX*'.$this->test_prefix.'timestamp'; + $column = 'timestamptest'; + + $expectedFormat = 'Y-m-d H:i:s'; + $expected = new \DateTime; + + $query = OC_DB::prepare("INSERT INTO `$table` (`$column`) VALUES (?)"); + $result = $query->execute(array($expected->format($expectedFormat))); + $this->assertEquals( + 1, + $result, + "Database failed to accept dates in the format '$expectedFormat'." + ); + + $id = OC_DB::insertid($table); + $query = OC_DB::prepare("SELECT * FROM `$table` WHERE `id` = ?"); + $result = $query->execute(array($id)); + $row = $result->fetchRow(); + + $actual = \DateTime::createFromFormat($expectedFormat, $row[$column]); + $this->assertInstanceOf( + '\DateTime', + $actual, + "Database failed to return dates in the format '$expectedFormat'." + ); + + $this->assertEquals( + $expected, + $actual, + 'Failed asserting that the returned date is the same as the inserted.' + ); + } } diff --git a/tests/lib/dbschema.php b/tests/lib/dbschema.php index c2e55eabf4b6b18026fec3732c135f2d1365cd90..7de90c047caa091bb370e8a642f8933b835efa6c 100644 --- a/tests/lib/dbschema.php +++ b/tests/lib/dbschema.php @@ -16,7 +16,7 @@ class Test_DBSchema extends PHPUnit_Framework_TestCase { $dbfile = OC::$SERVERROOT.'/tests/data/db_structure.xml'; $dbfile2 = OC::$SERVERROOT.'/tests/data/db_structure2.xml'; - $r = '_'.OC_Util::generate_random_bytes('4').'_'; + $r = '_'.OC_Util::generateRandomBytes('4').'_'; $content = file_get_contents( $dbfile ); $content = str_replace( '*dbprefix*', '*dbprefix*'.$r, $content ); file_put_contents( $this->schema_file, $content ); diff --git a/tests/lib/files/cache/permissions.php b/tests/lib/files/cache/permissions.php index 7e6e11e2eb29c09e6fe9a5fdcf2dd293f7e82c98..4b284c2c8e287f6bdaf87cd8b24d1f95e27e20a5 100644 --- a/tests/lib/files/cache/permissions.php +++ b/tests/lib/files/cache/permissions.php @@ -8,6 +8,8 @@ namespace Test\Files\Cache; +use OC\Files\Storage\Temporary; + class Permissions extends \PHPUnit_Framework_TestCase { /*** * @var \OC\Files\Cache\Permissions $permissionsCache @@ -55,4 +57,19 @@ class Permissions extends \PHPUnit_Framework_TestCase { $this->permissionsCache->removeMultiple($ids, $user); } + + public function testUpdatePermissionsOnRescan() { + $storage = new Temporary(array()); + $scanner = $storage->getScanner(); + $cache = $storage->getCache(); + $permissionsCache = $storage->getPermissionsCache(); + + $storage->file_put_contents('foo.txt', 'bar'); + $scanner->scan(''); + $id = $cache->getId('foo.txt'); + $permissionsCache->set($id, 'test', 1); + + $scanner->scan(''); + $this->assertEquals(-1, $permissionsCache->get($id, 'test')); + } } diff --git a/tests/lib/files/cache/scanner.php b/tests/lib/files/cache/scanner.php index f6deb93a49e1a37215878327bd7cd056b1078af4..3f3a045377a8efba7351a4987f59dd749b748a99 100644 --- a/tests/lib/files/cache/scanner.php +++ b/tests/lib/files/cache/scanner.php @@ -24,6 +24,21 @@ class Scanner extends \PHPUnit_Framework_TestCase { */ private $cache; + function setUp() { + $this->storage = new \OC\Files\Storage\Temporary(array()); + $this->scanner = new \OC\Files\Cache\Scanner($this->storage); + $this->cache = new \OC\Files\Cache\Cache($this->storage); + } + + function tearDown() { + if ($this->cache) { + $ids = $this->cache->getAll(); + $permissionsCache = $this->storage->getPermissionsCache(); + $permissionsCache->removeMultiple($ids, \OC_User::getUser()); + $this->cache->clear(); + } + } + function testFile() { $data = "dummy file data\n"; $this->storage->file_put_contents('foo.txt', $data); @@ -184,18 +199,38 @@ class Scanner extends \PHPUnit_Framework_TestCase { $this->assertFalse($this->cache->inCache('folder/bar.txt')); } - function setUp() { - $this->storage = new \OC\Files\Storage\Temporary(array()); - $this->scanner = new \OC\Files\Cache\Scanner($this->storage); - $this->cache = new \OC\Files\Cache\Cache($this->storage); + public function testScanRemovedFile(){ + $this->fillTestFolders(); + + $this->scanner->scan(''); + $this->assertTrue($this->cache->inCache('folder/bar.txt')); + $this->storage->unlink('folder/bar.txt'); + $this->scanner->scanFile('folder/bar.txt'); + $this->assertFalse($this->cache->inCache('folder/bar.txt')); } - function tearDown() { - if ($this->cache) { - $ids = $this->cache->getAll(); - $permissionsCache = $this->storage->getPermissionsCache(); - $permissionsCache->removeMultiple($ids, \OC_User::getUser()); - $this->cache->clear(); - } + public function testETagRecreation() { + $this->fillTestFolders(); + + $this->scanner->scan('folder/bar.txt'); + + // manipulate etag to simulate an empty etag + $this->scanner->scan('', \OC\Files\Cache\Scanner::SCAN_SHALLOW, \OC\Files\Cache\Scanner::REUSE_ETAG); + $data0 = $this->cache->get('folder/bar.txt'); + $data1 = $this->cache->get('folder'); + $data2 = $this->cache->get(''); + $data0['etag'] = ''; + $this->cache->put('folder/bar.txt', $data0); + + // rescan + $this->scanner->scan('folder/bar.txt', \OC\Files\Cache\Scanner::SCAN_SHALLOW, \OC\Files\Cache\Scanner::REUSE_ETAG); + + // verify cache content + $newData0 = $this->cache->get('folder/bar.txt'); + $newData1 = $this->cache->get('folder'); + $newData2 = $this->cache->get(''); + $this->assertNotEmpty($newData0['etag']); + $this->assertNotEquals($data1['etag'], $newData1['etag']); + $this->assertNotEquals($data2['etag'], $newData2['etag']); } } diff --git a/tests/lib/files/node/file.php b/tests/lib/files/node/file.php new file mode 100644 index 0000000000000000000000000000000000000000..76938a0dcc8bcb44601d60974c6e035a2b433915 --- /dev/null +++ b/tests/lib/files/node/file.php @@ -0,0 +1,664 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace Test\Files\Node; + +use OCP\Files\NotFoundException; +use OCP\Files\NotPermittedException; +use OC\Files\View; + +class File extends \PHPUnit_Framework_TestCase { + private $user; + + public function setUp() { + $this->user = new \OC\User\User('', new \OC_User_Dummy); + } + + public function testDelete() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->exactly(2)) + ->method('emit') + ->will($this->returnValue(true)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + + $view->expects($this->once()) + ->method('getFileInfo') + ->with('/bar/foo') + ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL))); + + $view->expects($this->once()) + ->method('unlink') + ->with('/bar/foo') + ->will($this->returnValue(true)); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $node->delete(); + } + + public function testDeleteHooks() { + $test = $this; + $hooksRun = 0; + /** + * @param \OC\Files\Node\File $node + */ + $preListener = function ($node) use (&$test, &$hooksRun) { + $test->assertInstanceOf('\OC\Files\Node\File', $node); + $test->assertEquals('foo', $node->getInternalPath()); + $test->assertEquals('/bar/foo', $node->getPath()); + $test->assertEquals(1, $node->getId()); + $hooksRun++; + }; + + /** + * @param \OC\Files\Node\File $node + */ + $postListener = function ($node) use (&$test, &$hooksRun) { + $test->assertInstanceOf('\OC\Files\Node\NonExistingFile', $node); + $test->assertEquals('foo', $node->getInternalPath()); + $test->assertEquals('/bar/foo', $node->getPath()); + $hooksRun++; + }; + + /** + * @var \OC\Files\Mount\Manager $manager + */ + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = new \OC\Files\Node\Root($manager, $view, $this->user); + $root->listen('\OC\Files', 'preDelete', $preListener); + $root->listen('\OC\Files', 'postDelete', $postListener); + + $view->expects($this->any()) + ->method('getFileInfo') + ->with('/bar/foo') + ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL, 'fileid' => 1))); + + $view->expects($this->once()) + ->method('unlink') + ->with('/bar/foo') + ->will($this->returnValue(true)); + + $view->expects($this->any()) + ->method('resolvePath') + ->with('/bar/foo') + ->will($this->returnValue(array(null, 'foo'))); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $node->delete(); + $this->assertEquals(2, $hooksRun); + } + + /** + * @expectedException \OCP\Files\NotPermittedException + */ + public function testDeleteNotPermitted() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + + $view->expects($this->once()) + ->method('getFileInfo') + ->with('/bar/foo') + ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_READ))); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $node->delete(); + } + + public function testGetContent() { + /** + * @var \OC\Files\Mount\Manager $manager + */ + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = new \OC\Files\Node\Root($manager, $view, $this->user); + + $hook = function ($file) { + throw new \Exception('Hooks are not supposed to be called'); + }; + + $root->listen('\OC\Files', 'preWrite', $hook); + $root->listen('\OC\Files', 'postWrite', $hook); + + $view->expects($this->once()) + ->method('file_get_contents') + ->with('/bar/foo') + ->will($this->returnValue('bar')); + + $view->expects($this->once()) + ->method('getFileInfo') + ->with('/bar/foo') + ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_READ))); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $this->assertEquals('bar', $node->getContent()); + } + + /** + * @expectedException \OCP\Files\NotPermittedException + */ + public function testGetContentNotPermitted() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + + $view->expects($this->once()) + ->method('getFileInfo') + ->with('/bar/foo') + ->will($this->returnValue(array('permissions' => 0))); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $node->getContent(); + } + + public function testPutContent() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + + $view->expects($this->once()) + ->method('getFileInfo') + ->with('/bar/foo') + ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL))); + + $view->expects($this->once()) + ->method('file_put_contents') + ->with('/bar/foo', 'bar') + ->will($this->returnValue(true)); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $node->putContent('bar'); + } + + /** + * @expectedException \OCP\Files\NotPermittedException + */ + public function testPutContentNotPermitted() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + + $view->expects($this->once()) + ->method('getFileInfo') + ->with('/bar/foo') + ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_READ))); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $node->putContent('bar'); + } + + public function testGetMimeType() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + + $view->expects($this->once()) + ->method('getMimeType') + ->with('/bar/foo') + ->will($this->returnValue('text/plain')); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $this->assertEquals('text/plain', $node->getMimeType()); + } + + public function testFOpenRead() { + $stream = fopen('php://memory', 'w+'); + fwrite($stream, 'bar'); + rewind($stream); + + /** + * @var \OC\Files\Mount\Manager $manager + */ + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = new \OC\Files\Node\Root($manager, $view, $this->user); + + $hook = function ($file) { + throw new \Exception('Hooks are not supposed to be called'); + }; + + $root->listen('\OC\Files', 'preWrite', $hook); + $root->listen('\OC\Files', 'postWrite', $hook); + + $view->expects($this->once()) + ->method('fopen') + ->with('/bar/foo', 'r') + ->will($this->returnValue($stream)); + + $view->expects($this->once()) + ->method('getFileInfo') + ->with('/bar/foo') + ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL))); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $fh = $node->fopen('r'); + $this->assertEquals($stream, $fh); + $this->assertEquals('bar', fread($fh, 3)); + } + + public function testFOpenWrite() { + $stream = fopen('php://memory', 'w+'); + + /** + * @var \OC\Files\Mount\Manager $manager + */ + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = new \OC\Files\Node\Root($manager, new $view, $this->user); + + $hooksCalled = 0; + $hook = function ($file) use (&$hooksCalled) { + $hooksCalled++; + }; + + $root->listen('\OC\Files', 'preWrite', $hook); + $root->listen('\OC\Files', 'postWrite', $hook); + + $view->expects($this->once()) + ->method('fopen') + ->with('/bar/foo', 'w') + ->will($this->returnValue($stream)); + + $view->expects($this->once()) + ->method('getFileInfo') + ->with('/bar/foo') + ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL))); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $fh = $node->fopen('w'); + $this->assertEquals($stream, $fh); + fwrite($fh, 'bar'); + rewind($fh); + $this->assertEquals('bar', fread($stream, 3)); + $this->assertEquals(2, $hooksCalled); + } + + /** + * @expectedException \OCP\Files\NotPermittedException + */ + public function testFOpenReadNotPermitted() { + /** + * @var \OC\Files\Mount\Manager $manager + */ + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = new \OC\Files\Node\Root($manager, $view, $this->user); + + $hook = function ($file) { + throw new \Exception('Hooks are not supposed to be called'); + }; + + $view->expects($this->once()) + ->method('getFileInfo') + ->with('/bar/foo') + ->will($this->returnValue(array('permissions' => 0))); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $node->fopen('r'); + } + + /** + * @expectedException \OCP\Files\NotPermittedException + */ + public function testFOpenReadWriteNoReadPermissions() { + /** + * @var \OC\Files\Mount\Manager $manager + */ + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = new \OC\Files\Node\Root($manager, $view, $this->user); + + $hook = function () { + throw new \Exception('Hooks are not supposed to be called'); + }; + + $view->expects($this->once()) + ->method('getFileInfo') + ->with('/bar/foo') + ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_UPDATE))); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $node->fopen('w'); + } + + /** + * @expectedException \OCP\Files\NotPermittedException + */ + public function testFOpenReadWriteNoWritePermissions() { + /** + * @var \OC\Files\Mount\Manager $manager + */ + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = new \OC\Files\Node\Root($manager, new $view, $this->user); + + $hook = function () { + throw new \Exception('Hooks are not supposed to be called'); + }; + + $view->expects($this->once()) + ->method('getFileInfo') + ->with('/bar/foo') + ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_READ))); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $node->fopen('w'); + } + + public function testCopySameStorage() { + /** + * @var \OC\Files\Mount\Manager $manager + */ + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + + $view->expects($this->any()) + ->method('copy') + ->with('/bar/foo', '/bar/asd'); + + $view->expects($this->any()) + ->method('getFileInfo') + ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL, 'fileid' => 3))); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $parentNode = new \OC\Files\Node\Folder($root, $view, '/bar'); + $newNode = new \OC\Files\Node\File($root, $view, '/bar/asd'); + + $root->expects($this->exactly(2)) + ->method('get') + ->will($this->returnValueMap(array( + array('/bar/asd', $newNode), + array('/bar', $parentNode) + ))); + + $target = $node->copy('/bar/asd'); + $this->assertInstanceOf('\OC\Files\Node\File', $target); + $this->assertEquals(3, $target->getId()); + } + + /** + * @expectedException \OCP\Files\NotPermittedException + */ + public function testCopyNotPermitted() { + /** + * @var \OC\Files\Mount\Manager $manager + */ + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + /** + * @var \OC\Files\Storage\Storage | \PHPUnit_Framework_MockObject_MockObject $storage + */ + $storage = $this->getMock('\OC\Files\Storage\Storage'); + + $root->expects($this->never()) + ->method('getMount'); + + $storage->expects($this->never()) + ->method('copy'); + + $view->expects($this->any()) + ->method('getFileInfo') + ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_READ, 'fileid' => 3))); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $parentNode = new \OC\Files\Node\Folder($root, $view, '/bar'); + + $root->expects($this->once()) + ->method('get') + ->will($this->returnValueMap(array( + array('/bar', $parentNode) + ))); + + $node->copy('/bar/asd'); + } + + /** + * @expectedException \OCP\Files\NotFoundException + */ + public function testCopyNoParent() { + /** + * @var \OC\Files\Mount\Manager $manager + */ + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + + $view->expects($this->never()) + ->method('copy'); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + + $root->expects($this->once()) + ->method('get') + ->with('/bar/asd') + ->will($this->throwException(new NotFoundException())); + + $node->copy('/bar/asd/foo'); + } + + /** + * @expectedException \OCP\Files\NotPermittedException + */ + public function testCopyParentIsFile() { + /** + * @var \OC\Files\Mount\Manager $manager + */ + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + + $view->expects($this->never()) + ->method('copy'); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $parentNode = new \OC\Files\Node\File($root, $view, '/bar'); + + $root->expects($this->once()) + ->method('get') + ->will($this->returnValueMap(array( + array('/bar', $parentNode) + ))); + + $node->copy('/bar/asd'); + } + + public function testMoveSameStorage() { + /** + * @var \OC\Files\Mount\Manager $manager + */ + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + + $view->expects($this->any()) + ->method('rename') + ->with('/bar/foo', '/bar/asd'); + + $view->expects($this->any()) + ->method('getFileInfo') + ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL, 'fileid' => 1))); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $parentNode = new \OC\Files\Node\Folder($root, $view, '/bar'); + + $root->expects($this->any()) + ->method('get') + ->will($this->returnValueMap(array(array('/bar', $parentNode), array('/bar/asd', $node)))); + + $target = $node->move('/bar/asd'); + $this->assertInstanceOf('\OC\Files\Node\File', $target); + $this->assertEquals(1, $target->getId()); + $this->assertEquals('/bar/asd', $node->getPath()); + } + + /** + * @expectedException \OCP\Files\NotPermittedException + */ + public function testMoveNotPermitted() { + /** + * @var \OC\Files\Mount\Manager $manager + */ + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + + $view->expects($this->any()) + ->method('getFileInfo') + ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_READ))); + + $view->expects($this->never()) + ->method('rename'); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $parentNode = new \OC\Files\Node\Folder($root, $view, '/bar'); + + $root->expects($this->once()) + ->method('get') + ->with('/bar') + ->will($this->returnValue($parentNode)); + + $node->move('/bar/asd'); + } + + /** + * @expectedException \OCP\Files\NotFoundException + */ + public function testMoveNoParent() { + /** + * @var \OC\Files\Mount\Manager $manager + */ + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + /** + * @var \OC\Files\Storage\Storage | \PHPUnit_Framework_MockObject_MockObject $storage + */ + $storage = $this->getMock('\OC\Files\Storage\Storage'); + + $storage->expects($this->never()) + ->method('rename'); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $parentNode = new \OC\Files\Node\Folder($root, $view, '/bar'); + + $root->expects($this->once()) + ->method('get') + ->with('/bar') + ->will($this->throwException(new NotFoundException())); + + $node->move('/bar/asd'); + } + + /** + * @expectedException \OCP\Files\NotPermittedException + */ + public function testMoveParentIsFile() { + /** + * @var \OC\Files\Mount\Manager $manager + */ + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + + $view->expects($this->never()) + ->method('rename'); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $parentNode = new \OC\Files\Node\File($root, $view, '/bar'); + + $root->expects($this->once()) + ->method('get') + ->with('/bar') + ->will($this->returnValue($parentNode)); + + $node->move('/bar/asd'); + } +} diff --git a/tests/lib/files/node/folder.php b/tests/lib/files/node/folder.php new file mode 100644 index 0000000000000000000000000000000000000000..b1589a276ba4cacca3dfcecc707e5287b3c103fa --- /dev/null +++ b/tests/lib/files/node/folder.php @@ -0,0 +1,479 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace Test\Files\Node; + +use OC\Files\Cache\Cache; +use OC\Files\Node\Node; +use OCP\Files\NotFoundException; +use OCP\Files\NotPermittedException; +use OC\Files\View; + +class Folder extends \PHPUnit_Framework_TestCase { + private $user; + + public function setUp() { + $this->user = new \OC\User\User('', new \OC_User_Dummy); + } + + public function testDelete() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + $root->expects($this->exactly(2)) + ->method('emit') + ->will($this->returnValue(true)); + + $view->expects($this->any()) + ->method('getFileInfo') + ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL))); + + $view->expects($this->once()) + ->method('rmdir') + ->with('/bar/foo') + ->will($this->returnValue(true)); + + $node = new \OC\Files\Node\Folder($root, $view, '/bar/foo'); + $node->delete(); + } + + public function testDeleteHooks() { + $test = $this; + $hooksRun = 0; + /** + * @param \OC\Files\Node\File $node + */ + $preListener = function ($node) use (&$test, &$hooksRun) { + $test->assertInstanceOf('\OC\Files\Node\Folder', $node); + $test->assertEquals('foo', $node->getInternalPath()); + $test->assertEquals('/bar/foo', $node->getPath()); + $hooksRun++; + }; + + /** + * @param \OC\Files\Node\File $node + */ + $postListener = function ($node) use (&$test, &$hooksRun) { + $test->assertInstanceOf('\OC\Files\Node\NonExistingFolder', $node); + $test->assertEquals('foo', $node->getInternalPath()); + $test->assertEquals('/bar/foo', $node->getPath()); + $hooksRun++; + }; + + /** + * @var \OC\Files\Mount\Manager $manager + */ + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = new \OC\Files\Node\Root($manager, $view, $this->user); + $root->listen('\OC\Files', 'preDelete', $preListener); + $root->listen('\OC\Files', 'postDelete', $postListener); + + $view->expects($this->any()) + ->method('getFileInfo') + ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL, 'fileid' => 1))); + + $view->expects($this->once()) + ->method('rmdir') + ->with('/bar/foo') + ->will($this->returnValue(true)); + + $view->expects($this->any()) + ->method('resolvePath') + ->with('/bar/foo') + ->will($this->returnValue(array(null, 'foo'))); + + $node = new \OC\Files\Node\Folder($root, $view, '/bar/foo'); + $node->delete(); + $this->assertEquals(2, $hooksRun); + } + + /** + * @expectedException \OCP\Files\NotPermittedException + */ + public function testDeleteNotPermitted() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + + $view->expects($this->once()) + ->method('getFileInfo') + ->with('/bar/foo') + ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_READ))); + + $node = new \OC\Files\Node\Folder($root, $view, '/bar/foo'); + $node->delete(); + } + + public function testGetDirectoryContent() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + + /** + * @var \OC\Files\Storage\Storage | \PHPUnit_Framework_MockObject_MockObject $storage + */ + $storage = $this->getMock('\OC\Files\Storage\Storage'); + + $cache = $this->getMock('\OC\Files\Cache\Cache', array(), array('')); + $cache->expects($this->any()) + ->method('getStatus') + ->with('foo') + ->will($this->returnValue(Cache::COMPLETE)); + + $cache->expects($this->once()) + ->method('getFolderContents') + ->with('foo') + ->will($this->returnValue(array( + array('fileid' => 2, 'path' => '/bar/foo/asd', 'name' => 'asd', 'size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain'), + array('fileid' => 3, 'path' => '/bar/foo/qwerty', 'name' => 'qwerty', 'size' => 200, 'mtime' => 55, 'mimetype' => 'httpd/unix-directory') + ))); + + $permissionsCache = $this->getMock('\OC\Files\Cache\Permissions', array(), array('/')); + $permissionsCache->expects($this->once()) + ->method('getDirectoryPermissions') + ->will($this->returnValue(array(2 => \OCP\PERMISSION_ALL))); + + $root->expects($this->once()) + ->method('getMountsIn') + ->with('/bar/foo') + ->will($this->returnValue(array())); + + $storage->expects($this->any()) + ->method('getPermissionsCache') + ->will($this->returnValue($permissionsCache)); + $storage->expects($this->any()) + ->method('getCache') + ->will($this->returnValue($cache)); + + $view->expects($this->any()) + ->method('resolvePath') + ->with('/bar/foo') + ->will($this->returnValue(array($storage, 'foo'))); + + $node = new \OC\Files\Node\Folder($root, $view, '/bar/foo'); + $children = $node->getDirectoryListing(); + $this->assertEquals(2, count($children)); + $this->assertInstanceOf('\OC\Files\Node\File', $children[0]); + $this->assertInstanceOf('\OC\Files\Node\Folder', $children[1]); + $this->assertEquals('asd', $children[0]->getName()); + $this->assertEquals('qwerty', $children[1]->getName()); + } + + public function testGet() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + + $root->expects($this->once()) + ->method('get') + ->with('/bar/foo/asd'); + + $node = new \OC\Files\Node\Folder($root, $view, '/bar/foo'); + $node->get('asd'); + } + + public function testNodeExists() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + + $child = new \OC\Files\Node\Folder($root, $view, '/bar/foo/asd'); + + $root->expects($this->once()) + ->method('get') + ->with('/bar/foo/asd') + ->will($this->returnValue($child)); + + $node = new \OC\Files\Node\Folder($root, $view, '/bar/foo'); + $this->assertTrue($node->nodeExists('asd')); + } + + public function testNodeExistsNotExists() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + + $root->expects($this->once()) + ->method('get') + ->with('/bar/foo/asd') + ->will($this->throwException(new NotFoundException())); + + $node = new \OC\Files\Node\Folder($root, $view, '/bar/foo'); + $this->assertFalse($node->nodeExists('asd')); + } + + public function testNewFolder() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + + $view->expects($this->once()) + ->method('getFileInfo') + ->with('/bar/foo') + ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL))); + + $view->expects($this->once()) + ->method('mkdir') + ->with('/bar/foo/asd') + ->will($this->returnValue(true)); + + $node = new \OC\Files\Node\Folder($root, $view, '/bar/foo'); + $child = new \OC\Files\Node\Folder($root, $view, '/bar/foo/asd'); + $result = $node->newFolder('asd'); + $this->assertEquals($child, $result); + } + + /** + * @expectedException \OCP\Files\NotPermittedException + */ + public function testNewFolderNotPermitted() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + + $view->expects($this->once()) + ->method('getFileInfo') + ->with('/bar/foo') + ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_READ))); + + $node = new \OC\Files\Node\Folder($root, $view, '/bar/foo'); + $node->newFolder('asd'); + } + + public function testNewFile() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + + $view->expects($this->once()) + ->method('getFileInfo') + ->with('/bar/foo') + ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL))); + + $view->expects($this->once()) + ->method('touch') + ->with('/bar/foo/asd') + ->will($this->returnValue(true)); + + $node = new \OC\Files\Node\Folder($root, $view, '/bar/foo'); + $child = new \OC\Files\Node\File($root, $view, '/bar/foo/asd'); + $result = $node->newFile('asd'); + $this->assertEquals($child, $result); + } + + /** + * @expectedException \OCP\Files\NotPermittedException + */ + public function testNewFileNotPermitted() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + + $view->expects($this->once()) + ->method('getFileInfo') + ->with('/bar/foo') + ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_READ))); + + $node = new \OC\Files\Node\Folder($root, $view, '/bar/foo'); + $node->newFile('asd'); + } + + public function testGetFreeSpace() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + + $view->expects($this->once()) + ->method('free_space') + ->with('/bar/foo') + ->will($this->returnValue(100)); + + $node = new \OC\Files\Node\Folder($root, $view, '/bar/foo'); + $this->assertEquals(100, $node->getFreeSpace()); + } + + public function testSearch() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + $storage = $this->getMock('\OC\Files\Storage\Storage'); + $cache = $this->getMock('\OC\Files\Cache\Cache', array(), array('')); + + $storage->expects($this->once()) + ->method('getCache') + ->will($this->returnValue($cache)); + + $cache->expects($this->once()) + ->method('search') + ->with('%qw%') + ->will($this->returnValue(array( + array('fileid' => 3, 'path' => 'foo/qwerty', 'name' => 'qwerty', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain') + ))); + + $root->expects($this->once()) + ->method('getMountsIn') + ->with('/bar/foo') + ->will($this->returnValue(array())); + + $view->expects($this->once()) + ->method('resolvePath') + ->will($this->returnValue(array($storage, 'foo'))); + + $node = new \OC\Files\Node\Folder($root, $view, '/bar/foo'); + $result = $node->search('qw'); + $this->assertEquals(1, count($result)); + $this->assertEquals('/bar/foo/qwerty', $result[0]->getPath()); + } + + public function testSearchSubStorages() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + $storage = $this->getMock('\OC\Files\Storage\Storage'); + $cache = $this->getMock('\OC\Files\Cache\Cache', array(), array('')); + $subCache = $this->getMock('\OC\Files\Cache\Cache', array(), array('')); + $subStorage = $this->getMock('\OC\Files\Storage\Storage'); + $subMount = $this->getMock('\OC\Files\Mount\Mount', array(), array(null, '')); + + $subMount->expects($this->once()) + ->method('getStorage') + ->will($this->returnValue($subStorage)); + + $subMount->expects($this->once()) + ->method('getMountPoint') + ->will($this->returnValue('/bar/foo/bar/')); + + $storage->expects($this->once()) + ->method('getCache') + ->will($this->returnValue($cache)); + + $subStorage->expects($this->once()) + ->method('getCache') + ->will($this->returnValue($subCache)); + + $cache->expects($this->once()) + ->method('search') + ->with('%qw%') + ->will($this->returnValue(array( + array('fileid' => 3, 'path' => 'foo/qwerty', 'name' => 'qwerty', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain') + ))); + + $subCache->expects($this->once()) + ->method('search') + ->with('%qw%') + ->will($this->returnValue(array( + array('fileid' => 4, 'path' => 'asd/qweasd', 'name' => 'qweasd', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain') + ))); + + $root->expects($this->once()) + ->method('getMountsIn') + ->with('/bar/foo') + ->will($this->returnValue(array($subMount))); + + $view->expects($this->once()) + ->method('resolvePath') + ->will($this->returnValue(array($storage, 'foo'))); + + + $node = new \OC\Files\Node\Folder($root, $view, '/bar/foo'); + $result = $node->search('qw'); + $this->assertEquals(2, count($result)); + } + + public function testIsSubNode() { + $file = new Node(null, null, '/foo/bar'); + $folder = new \OC\Files\Node\Folder(null, null, '/foo'); + $this->assertTrue($folder->isSubNode($file)); + $this->assertFalse($folder->isSubNode($folder)); + + $file = new Node(null, null, '/foobar'); + $this->assertFalse($folder->isSubNode($file)); + } +} diff --git a/tests/lib/files/node/integration.php b/tests/lib/files/node/integration.php new file mode 100644 index 0000000000000000000000000000000000000000..14e1d05853d9c133d532d8700a14373dcd43a0e2 --- /dev/null +++ b/tests/lib/files/node/integration.php @@ -0,0 +1,122 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace Test\Files\Node; + +use OC\Files\Cache\Cache; +use OC\Files\Mount\Manager; +use OC\Files\Node\Root; +use OCP\Files\NotFoundException; +use OCP\Files\NotPermittedException; +use OC\Files\Storage\Temporary; +use OC\Files\View; +use OC\User\User; + +class IntegrationTests extends \PHPUnit_Framework_TestCase { + /** + * @var \OC\Files\Node\Root $root + */ + private $root; + + /** + * @var \OC\Files\Storage\Storage[] + */ + private $storages; + + /** + * @var \OC\Files\View $view + */ + private $view; + + public function setUp() { + \OC\Files\Filesystem::init('', ''); + \OC\Files\Filesystem::clearMounts(); + $manager = \OC\Files\Filesystem::getMountManager(); + + \OC_Hook::clear('OC_Filesystem'); + + \OC_Hook::connect('OC_Filesystem', 'post_write', '\OC\Files\Cache\Updater', 'writeHook'); + \OC_Hook::connect('OC_Filesystem', 'post_delete', '\OC\Files\Cache\Updater', 'deleteHook'); + \OC_Hook::connect('OC_Filesystem', 'post_rename', '\OC\Files\Cache\Updater', 'renameHook'); + \OC_Hook::connect('OC_Filesystem', 'post_touch', '\OC\Files\Cache\Updater', 'touchHook'); + + $user = new User(uniqid('user'), new \OC_User_Dummy); + \OC_User::setUserId($user->getUID()); + $this->view = new View(); + $this->root = new Root($manager, $this->view, $user); + $storage = new Temporary(array()); + $subStorage = new Temporary(array()); + $this->storages[] = $storage; + $this->storages[] = $subStorage; + $this->root->mount($storage, '/'); + $this->root->mount($subStorage, '/substorage/'); + } + + public function tearDown() { + foreach ($this->storages as $storage) { + $storage->getCache()->clear(); + } + \OC\Files\Filesystem::clearMounts(); + } + + public function testBasicFile() { + $file = $this->root->newFile('/foo.txt'); + $this->assertCount(2, $this->root->getDirectoryListing()); + $this->assertTrue($this->root->nodeExists('/foo.txt')); + $id = $file->getId(); + $this->assertInstanceOf('\OC\Files\Node\File', $file); + $file->putContent('qwerty'); + $this->assertEquals('text/plain', $file->getMimeType()); + $this->assertEquals('qwerty', $file->getContent()); + $this->assertFalse($this->root->nodeExists('/bar.txt')); + $file->move('/bar.txt'); + $this->assertFalse($this->root->nodeExists('/foo.txt')); + $this->assertTrue($this->root->nodeExists('/bar.txt')); + $this->assertEquals('bar.txt', $file->getName()); + $this->assertEquals('bar.txt', $file->getInternalPath()); + + $file->move('/substorage/bar.txt'); + $this->assertNotEquals($id, $file->getId()); + $this->assertEquals('qwerty', $file->getContent()); + } + + public function testBasicFolder() { + $folder = $this->root->newFolder('/foo'); + $this->assertTrue($this->root->nodeExists('/foo')); + $file = $folder->newFile('/bar'); + $this->assertTrue($this->root->nodeExists('/foo/bar')); + $file->putContent('qwerty'); + + $listing = $folder->getDirectoryListing(); + $this->assertEquals(1, count($listing)); + $this->assertEquals($file->getId(), $listing[0]->getId()); + $this->assertEquals($file->getStorage(), $listing[0]->getStorage()); + + + $rootListing = $this->root->getDirectoryListing(); + $this->assertEquals(2, count($rootListing)); + + $folder->move('/asd'); + /** + * @var \OC\Files\Node\File $file + */ + $file = $folder->get('/bar'); + $this->assertInstanceOf('\OC\Files\Node\File', $file); + $this->assertFalse($this->root->nodeExists('/foo/bar')); + $this->assertTrue($this->root->nodeExists('/asd/bar')); + $this->assertEquals('qwerty', $file->getContent()); + $folder->move('/substorage/foo'); + /** + * @var \OC\Files\Node\File $file + */ + $file = $folder->get('/bar'); + $this->assertInstanceOf('\OC\Files\Node\File', $file); + $this->assertTrue($this->root->nodeExists('/substorage/foo/bar')); + $this->assertEquals('qwerty', $file->getContent()); + } +} diff --git a/tests/lib/files/node/node.php b/tests/lib/files/node/node.php new file mode 100644 index 0000000000000000000000000000000000000000..cf5fec30522124ec39d6745d8f01e5555d757348 --- /dev/null +++ b/tests/lib/files/node/node.php @@ -0,0 +1,330 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace Test\Files\Node; + +class Node extends \PHPUnit_Framework_TestCase { + private $user; + + public function setUp() { + $this->user = new \OC\User\User('', new \OC_User_Dummy); + } + + public function testStat() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + + $stat = array( + 'fileid' => 1, + 'size' => 100, + 'etag' => 'qwerty', + 'mtime' => 50, + 'permissions' => 0 + ); + + $view->expects($this->once()) + ->method('stat') + ->with('/bar/foo') + ->will($this->returnValue($stat)); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $this->assertEquals($stat, $node->stat()); + } + + public function testGetId() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + + $stat = array( + 'fileid' => 1, + 'size' => 100, + 'etag' => 'qwerty', + 'mtime' => 50 + ); + + $view->expects($this->once()) + ->method('getFileInfo') + ->with('/bar/foo') + ->will($this->returnValue($stat)); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $this->assertEquals(1, $node->getId()); + } + + public function testGetSize() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + + $view->expects($this->once()) + ->method('filesize') + ->with('/bar/foo') + ->will($this->returnValue(100)); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $this->assertEquals(100, $node->getSize()); + } + + public function testGetEtag() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + + $stat = array( + 'fileid' => 1, + 'size' => 100, + 'etag' => 'qwerty', + 'mtime' => 50 + ); + + $view->expects($this->once()) + ->method('getFileInfo') + ->with('/bar/foo') + ->will($this->returnValue($stat)); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $this->assertEquals('qwerty', $node->getEtag()); + } + + public function testGetMTime() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + /** + * @var \OC\Files\Storage\Storage | \PHPUnit_Framework_MockObject_MockObject $storage + */ + $storage = $this->getMock('\OC\Files\Storage\Storage'); + + $view->expects($this->once()) + ->method('filemtime') + ->with('/bar/foo') + ->will($this->returnValue(50)); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $this->assertEquals(50, $node->getMTime()); + } + + public function testGetStorage() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + /** + * @var \OC\Files\Storage\Storage | \PHPUnit_Framework_MockObject_MockObject $storage + */ + $storage = $this->getMock('\OC\Files\Storage\Storage'); + + $view->expects($this->once()) + ->method('resolvePath') + ->with('/bar/foo') + ->will($this->returnValue(array($storage, 'foo'))); + + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $this->assertEquals($storage, $node->getStorage()); + } + + public function testGetPath() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $this->assertEquals('/bar/foo', $node->getPath()); + } + + public function testGetInternalPath() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + /** + * @var \OC\Files\Storage\Storage | \PHPUnit_Framework_MockObject_MockObject $storage + */ + $storage = $this->getMock('\OC\Files\Storage\Storage'); + + $view->expects($this->once()) + ->method('resolvePath') + ->with('/bar/foo') + ->will($this->returnValue(array($storage, 'foo'))); + + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $this->assertEquals('foo', $node->getInternalPath()); + } + + public function testGetName() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + + $node = new \OC\Files\Node\File($root, $view, '/bar/foo'); + $this->assertEquals('foo', $node->getName()); + } + + public function testTouchSetMTime() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + + $view->expects($this->once()) + ->method('touch') + ->with('/bar/foo', 100) + ->will($this->returnValue(true)); + + $view->expects($this->once()) + ->method('filemtime') + ->with('/bar/foo') + ->will($this->returnValue(100)); + + $view->expects($this->once()) + ->method('getFileInfo') + ->with('/bar/foo') + ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL))); + + $node = new \OC\Files\Node\Node($root, $view, '/bar/foo'); + $node->touch(100); + $this->assertEquals(100, $node->getMTime()); + } + + public function testTouchHooks() { + $test = $this; + $hooksRun = 0; + /** + * @param \OC\Files\Node\File $node + */ + $preListener = function ($node) use (&$test, &$hooksRun) { + $test->assertEquals('foo', $node->getInternalPath()); + $test->assertEquals('/bar/foo', $node->getPath()); + $hooksRun++; + }; + + /** + * @param \OC\Files\Node\File $node + */ + $postListener = function ($node) use (&$test, &$hooksRun) { + $test->assertEquals('foo', $node->getInternalPath()); + $test->assertEquals('/bar/foo', $node->getPath()); + $hooksRun++; + }; + + /** + * @var \OC\Files\Mount\Manager $manager + */ + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = new \OC\Files\Node\Root($manager, $view, $this->user); + $root->listen('\OC\Files', 'preTouch', $preListener); + $root->listen('\OC\Files', 'postTouch', $postListener); + + $view->expects($this->once()) + ->method('touch') + ->with('/bar/foo', 100) + ->will($this->returnValue(true)); + + $view->expects($this->any()) + ->method('resolvePath') + ->with('/bar/foo') + ->will($this->returnValue(array(null, 'foo'))); + + $view->expects($this->any()) + ->method('getFileInfo') + ->with('/bar/foo') + ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL))); + + $node = new \OC\Files\Node\Node($root, $view, '/bar/foo'); + $node->touch(100); + $this->assertEquals(2, $hooksRun); + } + + /** + * @expectedException \OCP\Files\NotPermittedException + */ + public function testTouchNotPermitted() { + $manager = $this->getMock('\OC\Files\Mount\Manager'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user)); + $root->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); + + $view->expects($this->any()) + ->method('getFileInfo') + ->with('/bar/foo') + ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_READ))); + + $node = new \OC\Files\Node\Node($root, $view, '/bar/foo'); + $node->touch(100); + } +} diff --git a/tests/lib/files/node/root.php b/tests/lib/files/node/root.php new file mode 100644 index 0000000000000000000000000000000000000000..97eaf7f716267fc812fa7267d5a0844938ea2047 --- /dev/null +++ b/tests/lib/files/node/root.php @@ -0,0 +1,106 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace Test\Files\Node; + +use OC\Files\Cache\Cache; +use OCP\Files\NotPermittedException; +use OC\Files\Mount\Manager; + +class Root extends \PHPUnit_Framework_TestCase { + private $user; + + public function setUp() { + $this->user = new \OC\User\User('', new \OC_User_Dummy); + } + + public function testGet() { + $manager = new Manager(); + /** + * @var \OC\Files\Storage\Storage $storage + */ + $storage = $this->getMock('\OC\Files\Storage\Storage'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = new \OC\Files\Node\Root($manager, $view, $this->user); + + $view->expects($this->once()) + ->method('getFileInfo') + ->with('/bar/foo') + ->will($this->returnValue(array('fileid' => 10, 'path' => 'bar/foo', 'name', 'mimetype' => 'text/plain'))); + + $view->expects($this->once()) + ->method('is_dir') + ->with('/bar/foo') + ->will($this->returnValue(false)); + + $view->expects($this->once()) + ->method('file_exists') + ->with('/bar/foo') + ->will($this->returnValue(true)); + + $root->mount($storage, ''); + $node = $root->get('/bar/foo'); + $this->assertEquals(10, $node->getId()); + $this->assertInstanceOf('\OC\Files\Node\File', $node); + } + + /** + * @expectedException \OCP\Files\NotFoundException + */ + public function testGetNotFound() { + $manager = new Manager(); + /** + * @var \OC\Files\Storage\Storage $storage + */ + $storage = $this->getMock('\OC\Files\Storage\Storage'); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = new \OC\Files\Node\Root($manager, $view, $this->user); + + $view->expects($this->once()) + ->method('file_exists') + ->with('/bar/foo') + ->will($this->returnValue(false)); + + $root->mount($storage, ''); + $root->get('/bar/foo'); + } + + /** + * @expectedException \OCP\Files\NotPermittedException + */ + public function testGetInvalidPath() { + $manager = new Manager(); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = new \OC\Files\Node\Root($manager, $view, $this->user); + + $root->get('/../foo'); + } + + /** + * @expectedException \OCP\Files\NotFoundException + */ + public function testGetNoStorages() { + $manager = new Manager(); + /** + * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view + */ + $view = $this->getMock('\OC\Files\View'); + $root = new \OC\Files\Node\Root($manager, $view, $this->user); + + $root->get('/bar/foo'); + } +} diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php index 3bac9e770aa1b73fa81bd0b162a3c83618bdc8ce..3043f132b73ea118af1e7bcd1f6e4f752c613f70 100644 --- a/tests/lib/files/view.php +++ b/tests/lib/files/view.php @@ -25,7 +25,7 @@ class View extends \PHPUnit_Framework_TestCase { //login \OC_User::createUser('test', 'test'); - $this->user=\OC_User::getUser(); + $this->user = \OC_User::getUser(); \OC_User::setUserId('test'); \OC\Files\Filesystem::clearMounts(); @@ -325,8 +325,51 @@ class View extends \PHPUnit_Framework_TestCase { $this->assertEquals($cachedData['storage_mtime'], $cachedData['mtime']); } + /** + * @medium + */ + function testViewHooks() { + $storage1 = $this->getTestStorage(); + $storage2 = $this->getTestStorage(); + $defaultRoot = \OC\Files\Filesystem::getRoot(); + \OC\Files\Filesystem::mount($storage1, array(), '/'); + \OC\Files\Filesystem::mount($storage2, array(), $defaultRoot . '/substorage'); + \OC_Hook::connect('OC_Filesystem', 'post_write', $this, 'dummyHook'); + + $rootView = new \OC\Files\View(''); + $subView = new \OC\Files\View($defaultRoot . '/substorage'); + $this->hookPath = null; + + $rootView->file_put_contents('/foo.txt', 'asd'); + $this->assertNull($this->hookPath); + + $subView->file_put_contents('/foo.txt', 'asd'); + $this->assertNotNull($this->hookPath); + $this->assertEquals('/substorage/foo.txt', $this->hookPath); + } + + private $hookPath; + + function dummyHook($params) { + $this->hookPath = $params['path']; + } + + public function testSearchNotOutsideView() { + $storage1 = $this->getTestStorage(); + \OC\Files\Filesystem::mount($storage1, array(), '/'); + $storage1->rename('folder', 'foo'); + $scanner = $storage1->getScanner(); + $scanner->scan(''); + + $view = new \OC\Files\View('/foo'); + + $result = $view->search('.txt'); + $this->assertCount(1, $result); + } + /** * @param bool $scan + * @param string $class * @return \OC\Files\Storage\Storage */ private function getTestStorage($scan = true, $class = '\OC\Files\Storage\Temporary') { diff --git a/tests/lib/helper.php b/tests/lib/helper.php index 67b5a3d43ecc509bd56822e0df00341ea05cb881..b4d896e51967effe1b6a1b55b08f936e9a27fedb 100644 --- a/tests/lib/helper.php +++ b/tests/lib/helper.php @@ -8,40 +8,42 @@ class Test_Helper extends PHPUnit_Framework_TestCase { - function testHumanFileSize() { - $result = OC_Helper::humanFileSize(0); - $expected = '0 B'; - $this->assertEquals($result, $expected); - - $result = OC_Helper::humanFileSize(1024); - $expected = '1 kB'; - $this->assertEquals($result, $expected); - - $result = OC_Helper::humanFileSize(10000000); - $expected = '9.5 MB'; - $this->assertEquals($result, $expected); - - $result = OC_Helper::humanFileSize(500000000000); - $expected = '465.7 GB'; - $this->assertEquals($result, $expected); + /** + * @dataProvider humanFileSizeProvider + */ + public function testHumanFileSize($expected, $input) + { + $result = OC_Helper::humanFileSize($input); + $this->assertEquals($expected, $result); } - function testComputerFileSize() { - $result = OC_Helper::computerFileSize("0 B"); - $expected = '0.0'; - $this->assertEquals($result, $expected); - - $result = OC_Helper::computerFileSize("1 kB"); - $expected = '1024.0'; - $this->assertEquals($result, $expected); + public function humanFileSizeProvider() + { + return array( + array('0 B', 0), + array('1 kB', 1024), + array('9.5 MB', 10000000), + array('465.7 GB', 500000000000), + array('454.7 TB', 500000000000000), + array('444.1 PB', 500000000000000000), + ); + } - $result = OC_Helper::computerFileSize("9.5 MB"); - $expected = '9961472.0'; - $this->assertEquals($result, $expected); + /** + * @dataProvider computerFileSizeProvider + */ + function testComputerFileSize($expected, $input) { + $result = OC_Helper::computerFileSize($input); + $this->assertEquals($expected, $result); + } - $result = OC_Helper::computerFileSize("465.7 GB"); - $expected = '500041567436.8'; - $this->assertEquals($result, $expected); + function computerFileSizeProvider(){ + return array( + array(0.0, "0 B"), + array(1024.0, "1 kB"), + array(9961472.0, "9.5 MB"), + array(500041567436.8, "465.7 GB"), + ); } function testGetMimeType() { diff --git a/tests/lib/image.php b/tests/lib/image.php index 0583c300075b87c88faf0b42689bdefad27e91ed..4aba1b0bc61e56fd46eb7dfaebac55273aed2a34 100644 --- a/tests/lib/image.php +++ b/tests/lib/image.php @@ -7,6 +7,10 @@ */ class Test_Image extends PHPUnit_Framework_TestCase { + public static function tearDownAfterClass() { + unlink(OC::$SERVERROOT.'/tests/data/testimage2.png'); + unlink(OC::$SERVERROOT.'/tests/data/testimage2.jpg'); + } public function testGetMimeTypeForFile() { $mimetype = \OC_Image::getMimeTypeForFile(OC::$SERVERROOT.'/tests/data/testimage.png'); @@ -55,7 +59,6 @@ class Test_Image extends PHPUnit_Framework_TestCase { } public function testMimeType() { - $this->markTestSkipped("When loading from data or base64, imagetype is always image/png, see #4258."); $img = new \OC_Image(OC::$SERVERROOT.'/tests/data/testimage.png'); $this->assertEquals('image/png', $img->mimeType()); @@ -102,35 +105,50 @@ class Test_Image extends PHPUnit_Framework_TestCase { $img->resize(16); $img->save(OC::$SERVERROOT.'/tests/data/testimage2.png'); $this->assertEquals(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage2.png'), $img->data()); + + $img = new \OC_Image(OC::$SERVERROOT.'/tests/data/testimage.jpg'); + $img->resize(128); + $img->save(OC::$SERVERROOT.'/tests/data/testimage2.jpg'); + $this->assertEquals(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage2.jpg'), $img->data()); } public function testData() { - $this->markTestSkipped("\OC_Image->data() converts to png before outputting data, see #4258."); $img = new \OC_Image(OC::$SERVERROOT.'/tests/data/testimage.png'); - $expected = file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.png'); + $raw = imagecreatefromstring(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.png')); + ob_start(); + imagepng($raw); + $expected = ob_get_clean(); $this->assertEquals($expected, $img->data()); $img = new \OC_Image(OC::$SERVERROOT.'/tests/data/testimage.jpg'); - $expected = file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg'); + $raw = imagecreatefromstring(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg')); + ob_start(); + imagejpeg($raw); + $expected = ob_get_clean(); $this->assertEquals($expected, $img->data()); $img = new \OC_Image(OC::$SERVERROOT.'/tests/data/testimage.gif'); - $expected = file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.gif'); + $raw = imagecreatefromstring(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.gif')); + ob_start(); + imagegif($raw); + $expected = ob_get_clean(); $this->assertEquals($expected, $img->data()); } + /** + * @depends testData + */ public function testToString() { - $this->markTestSkipped("\OC_Image->data() converts to png before outputting data, see #4258."); $img = new \OC_Image(OC::$SERVERROOT.'/tests/data/testimage.png'); - $expected = base64_encode(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.png')); + $expected = base64_encode($img->data()); $this->assertEquals($expected, (string)$img); $img = new \OC_Image(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg')); - $expected = base64_encode(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $expected = base64_encode($img->data()); $this->assertEquals($expected, (string)$img); $img = new \OC_Image(OC::$SERVERROOT.'/tests/data/testimage.gif'); - $expected = base64_encode(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.gif')); + $expected = base64_encode($img->data()); $this->assertEquals($expected, (string)$img); } diff --git a/tests/lib/preferences.php b/tests/lib/preferences.php index 612cc81926ba8e33302513f89b5dde73d42e2617..68b794e9ea9526d574710d10552978a0c36efc24 100644 --- a/tests/lib/preferences.php +++ b/tests/lib/preferences.php @@ -1,6 +1,7 @@ + * Copyright (c) 2013 Bart Visscher * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. @@ -124,3 +125,181 @@ class Test_Preferences extends PHPUnit_Framework_TestCase { $this->assertEquals(0, $result->numRows()); } } + +class Test_Preferences_Object extends PHPUnit_Framework_TestCase { + public function testGetUsers() + { + $statementMock = $this->getMock('\Doctrine\DBAL\Statement', array(), array(), '', false); + $statementMock->expects($this->exactly(2)) + ->method('fetchColumn') + ->will($this->onConsecutiveCalls('foo', false)); + $connectionMock = $this->getMock('\OC\DB\Connection', array(), array(), '', false); + $connectionMock->expects($this->once()) + ->method('executeQuery') + ->with($this->equalTo('SELECT DISTINCT `userid` FROM `*PREFIX*preferences`')) + ->will($this->returnValue($statementMock)); + + $preferences = new OC\Preferences($connectionMock); + $apps = $preferences->getUsers(); + $this->assertEquals(array('foo'), $apps); + } + + public function testGetApps() + { + $statementMock = $this->getMock('\Doctrine\DBAL\Statement', array(), array(), '', false); + $statementMock->expects($this->exactly(2)) + ->method('fetchColumn') + ->will($this->onConsecutiveCalls('foo', false)); + $connectionMock = $this->getMock('\OC\DB\Connection', array(), array(), '', false); + $connectionMock->expects($this->once()) + ->method('executeQuery') + ->with($this->equalTo('SELECT DISTINCT `appid` FROM `*PREFIX*preferences` WHERE `userid` = ?'), + $this->equalTo(array('bar'))) + ->will($this->returnValue($statementMock)); + + $preferences = new OC\Preferences($connectionMock); + $apps = $preferences->getApps('bar'); + $this->assertEquals(array('foo'), $apps); + } + + public function testGetKeys() + { + $statementMock = $this->getMock('\Doctrine\DBAL\Statement', array(), array(), '', false); + $statementMock->expects($this->exactly(2)) + ->method('fetchColumn') + ->will($this->onConsecutiveCalls('foo', false)); + $connectionMock = $this->getMock('\OC\DB\Connection', array(), array(), '', false); + $connectionMock->expects($this->once()) + ->method('executeQuery') + ->with($this->equalTo('SELECT `configkey` FROM `*PREFIX*preferences` WHERE `userid` = ? AND `appid` = ?'), + $this->equalTo(array('bar', 'moo'))) + ->will($this->returnValue($statementMock)); + + $preferences = new OC\Preferences($connectionMock); + $keys = $preferences->getKeys('bar', 'moo'); + $this->assertEquals(array('foo'), $keys); + } + + public function testGetValue() + { + $connectionMock = $this->getMock('\OC\DB\Connection', array(), array(), '', false); + $connectionMock->expects($this->exactly(2)) + ->method('fetchAssoc') + ->with($this->equalTo('SELECT `configvalue` FROM `*PREFIX*preferences` WHERE `userid` = ? AND `appid` = ? AND `configkey` = ?'), + $this->equalTo(array('grg', 'bar', 'red'))) + ->will($this->onConsecutiveCalls(array('configvalue'=>'foo'), null)); + + $preferences = new OC\Preferences($connectionMock); + $value = $preferences->getValue('grg', 'bar', 'red'); + $this->assertEquals('foo', $value); + $value = $preferences->getValue('grg', 'bar', 'red', 'def'); + $this->assertEquals('def', $value); + } + + public function testSetValue() + { + $connectionMock = $this->getMock('\OC\DB\Connection', array(), array(), '', false); + $connectionMock->expects($this->exactly(2)) + ->method('fetchColumn') + ->with($this->equalTo('SELECT COUNT(*) FROM `*PREFIX*preferences`' + .' WHERE `userid` = ? AND `appid` = ? AND `configkey` = ?'), + $this->equalTo(array('grg', 'bar', 'foo'))) + ->will($this->onConsecutiveCalls(0, 1)); + $connectionMock->expects($this->once()) + ->method('insert') + ->with($this->equalTo('*PREFIX*preferences'), + $this->equalTo( + array( + 'userid' => 'grg', + 'appid' => 'bar', + 'configkey' => 'foo', + 'configvalue' => 'v1', + ) + )); + $connectionMock->expects($this->once()) + ->method('update') + ->with($this->equalTo('*PREFIX*preferences'), + $this->equalTo( + array( + 'configvalue' => 'v2', + )), + $this->equalTo( + array( + 'userid' => 'grg', + 'appid' => 'bar', + 'configkey' => 'foo', + ) + )); + + $preferences = new OC\Preferences($connectionMock); + $preferences->setValue('grg', 'bar', 'foo', 'v1'); + $preferences->setValue('grg', 'bar', 'foo', 'v2'); + } + + public function testDeleteKey() + { + $connectionMock = $this->getMock('\OC\DB\Connection', array(), array(), '', false); + $connectionMock->expects($this->once()) + ->method('delete') + ->with($this->equalTo('*PREFIX*preferences'), + $this->equalTo( + array( + 'userid' => 'grg', + 'appid' => 'bar', + 'configkey' => 'foo', + ) + )); + + $preferences = new OC\Preferences($connectionMock); + $preferences->deleteKey('grg', 'bar', 'foo'); + } + + public function testDeleteApp() + { + $connectionMock = $this->getMock('\OC\DB\Connection', array(), array(), '', false); + $connectionMock->expects($this->once()) + ->method('delete') + ->with($this->equalTo('*PREFIX*preferences'), + $this->equalTo( + array( + 'userid' => 'grg', + 'appid' => 'bar', + ) + )); + + $preferences = new OC\Preferences($connectionMock); + $preferences->deleteApp('grg', 'bar'); + } + + public function testDeleteUser() + { + $connectionMock = $this->getMock('\OC\DB\Connection', array(), array(), '', false); + $connectionMock->expects($this->once()) + ->method('delete') + ->with($this->equalTo('*PREFIX*preferences'), + $this->equalTo( + array( + 'userid' => 'grg', + ) + )); + + $preferences = new OC\Preferences($connectionMock); + $preferences->deleteUser('grg'); + } + + public function testDeleteAppFromAllUsers() + { + $connectionMock = $this->getMock('\OC\DB\Connection', array(), array(), '', false); + $connectionMock->expects($this->once()) + ->method('delete') + ->with($this->equalTo('*PREFIX*preferences'), + $this->equalTo( + array( + 'appid' => 'bar', + ) + )); + + $preferences = new OC\Preferences($connectionMock); + $preferences->deleteAppFromAllUsers('bar'); + } +} diff --git a/tests/lib/preview.php b/tests/lib/preview.php new file mode 100644 index 0000000000000000000000000000000000000000..d0cdd2c44fba78c7031333e4132117a70f3a9344 --- /dev/null +++ b/tests/lib/preview.php @@ -0,0 +1,149 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace Test; + +class Preview extends \PHPUnit_Framework_TestCase { + + public function testIsPreviewDeleted() { + $user = $this->initFS(); + + $rootView = new \OC\Files\View(''); + $rootView->mkdir('/'.$user); + $rootView->mkdir('/'.$user.'/files'); + + $samplefile = '/'.$user.'/files/test.txt'; + + $rootView->file_put_contents($samplefile, 'dummy file data'); + + $x = 50; + $y = 50; + + $preview = new \OC\Preview($user, 'files/', 'test.txt', $x, $y); + $preview->getPreview(); + + $fileinfo = $rootView->getFileInfo($samplefile); + $fileid = $fileinfo['fileid']; + + $thumbcachefile = '/' . $user . '/' . \OC\Preview::THUMBNAILS_FOLDER . '/' . $fileid . '/' . $x . '-' . $y . '.png'; + + $this->assertEquals($rootView->file_exists($thumbcachefile), true); + + $preview->deletePreview(); + + $this->assertEquals($rootView->file_exists($thumbcachefile), false); + } + + public function testAreAllPreviewsDeleted() { + $user = $this->initFS(); + + $rootView = new \OC\Files\View(''); + $rootView->mkdir('/'.$user); + $rootView->mkdir('/'.$user.'/files'); + + $samplefile = '/'.$user.'/files/test.txt'; + + $rootView->file_put_contents($samplefile, 'dummy file data'); + + $x = 50; + $y = 50; + + $preview = new \OC\Preview($user, 'files/', 'test.txt', $x, $y); + $preview->getPreview(); + + $fileinfo = $rootView->getFileInfo($samplefile); + $fileid = $fileinfo['fileid']; + + $thumbcachefolder = '/' . $user . '/' . \OC\Preview::THUMBNAILS_FOLDER . '/' . $fileid . '/'; + + $this->assertEquals($rootView->is_dir($thumbcachefolder), true); + + $preview->deleteAllPreviews(); + + $this->assertEquals($rootView->is_dir($thumbcachefolder), false); + } + + public function testIsMaxSizeWorking() { + $user = $this->initFS(); + + $maxX = 250; + $maxY = 250; + + \OC_Config::setValue('preview_max_x', $maxX); + \OC_Config::setValue('preview_max_y', $maxY); + + $rootView = new \OC\Files\View(''); + $rootView->mkdir('/'.$user); + $rootView->mkdir('/'.$user.'/files'); + + $samplefile = '/'.$user.'/files/test.txt'; + + $rootView->file_put_contents($samplefile, 'dummy file data'); + + $preview = new \OC\Preview($user, 'files/', 'test.txt', 1000, 1000); + $image = $preview->getPreview(); + + $this->assertEquals($image->width(), $maxX); + $this->assertEquals($image->height(), $maxY); + } + + public function txtBlacklist() { + $txt = 'random text file'; + $ics = file_get_contents(__DIR__ . '/../data/testcal.ics'); + $vcf = file_get_contents(__DIR__ . '/../data/testcontact.vcf'); + + return array( + array('txt', $txt, false), + array('ics', $ics, true), + array('vcf', $vcf, true), + ); + } + + /** + * @dataProvider txtBlacklist + */ + public function testIsTransparent($extension, $data, $expectedResult) { + $user = $this->initFS(); + + $rootView = new \OC\Files\View(''); + $rootView->mkdir('/'.$user); + $rootView->mkdir('/'.$user.'/files'); + + $x = 32; + $y = 32; + + $sample = '/'.$user.'/files/test.'.$extension; + $rootView->file_put_contents($sample, $data); + $preview = new \OC\Preview($user, 'files/', 'test.'.$extension, $x, $y); + $image = $preview->getPreview(); + $resource = $image->resource(); + + //http://stackoverflow.com/questions/5702953/imagecolorat-and-transparency + $colorIndex = imagecolorat($resource, 1, 1); + $colorInfo = imagecolorsforindex($resource, $colorIndex); + $this->assertEquals( + $expectedResult, + $colorInfo['alpha'] === 127, + 'Failed asserting that only previews for text files are transparent.' + ); + } + + private function initFS() { + if(\OC\Files\Filesystem::getView()){ + $user = \OC_User::getUser(); + }else{ + $user=uniqid(); + \OC_User::setUserId($user); + \OC\Files\Filesystem::init($user, '/'.$user.'/files'); + } + + \OC\Files\Filesystem::mount('OC\Files\Storage\Temporary', array(), '/'); + + return $user; + } +} diff --git a/tests/lib/share/share.php b/tests/lib/share/share.php index e7d441a7e780db7ff1c8d20a0a498c8d4a8863a3..8e9eef65d320fad8bb5d8f4af1211f78c9ae0fb0 100644 --- a/tests/lib/share/share.php +++ b/tests/lib/share/share.php @@ -29,6 +29,8 @@ class Test_Share extends PHPUnit_Framework_TestCase { protected $group1; protected $group2; protected $resharing; + protected $dateInFuture; + protected $dateInPast; public function setUp() { OC_User::clearBackends(); @@ -58,6 +60,12 @@ class Test_Share extends PHPUnit_Framework_TestCase { OC::registerShareHooks(); $this->resharing = OC_Appconfig::getValue('core', 'shareapi_allow_resharing', 'yes'); OC_Appconfig::setValue('core', 'shareapi_allow_resharing', 'yes'); + + // 20 Minutes in the past, 20 minutes in the future. + $now = time(); + $dateFormat = 'Y-m-d H:i:s'; + $this->dateInPast = date($dateFormat, $now - 20 * 60); + $this->dateInFuture = date($dateFormat, $now + 20 * 60); } public function tearDown() { @@ -121,6 +129,26 @@ class Test_Share extends PHPUnit_Framework_TestCase { } } + protected function shareUserOneTestFileWithUserTwo() { + OC_User::setUserId($this->user1); + $this->assertTrue( + OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, OCP\PERMISSION_READ), + 'Failed asserting that user 1 successfully shared text.txt with user 2.' + ); + $this->assertEquals( + array('test.txt'), + OCP\Share::getItemShared('test', 'test.txt', Test_Share_Backend::FORMAT_SOURCE), + 'Failed asserting that test.txt is a shared file of user 1.' + ); + + OC_User::setUserId($this->user2); + $this->assertEquals( + array('test.txt'), + OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_SOURCE), + 'Failed asserting that user 2 has access to test.txt after initial sharing.' + ); + } + public function testShareWithUser() { // Invalid shares $message = 'Sharing test.txt failed, because the user '.$this->user1.' is the item owner'; @@ -146,10 +174,7 @@ class Test_Share extends PHPUnit_Framework_TestCase { } // Valid share - $this->assertTrue(OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, OCP\PERMISSION_READ)); - $this->assertEquals(array('test.txt'), OCP\Share::getItemShared('test', 'test.txt', Test_Share_Backend::FORMAT_SOURCE)); - OC_User::setUserId($this->user2); - $this->assertEquals(array('test.txt'), OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_SOURCE)); + $this->shareUserOneTestFileWithUserTwo(); // Attempt to share again OC_User::setUserId($this->user1); @@ -264,6 +289,66 @@ class Test_Share extends PHPUnit_Framework_TestCase { $this->assertEquals(array('test1.txt'), OCP\Share::getItemsSharedWith('test', Test_Share_Backend::FORMAT_TARGET)); } + public function testShareWithUserExpirationExpired() { + $this->shareUserOneTestFileWithUserTwo(); + + OC_User::setUserId($this->user1); + $this->assertTrue( + OCP\Share::setExpirationDate('test', 'test.txt', $this->dateInPast), + 'Failed asserting that user 1 successfully set an expiration date for the test.txt share.' + ); + + OC_User::setUserId($this->user2); + $this->assertFalse( + OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_SOURCE), + 'Failed asserting that user 2 no longer has access to test.txt after expiration.' + ); + } + + public function testShareWithUserExpirationValid() { + $this->shareUserOneTestFileWithUserTwo(); + + OC_User::setUserId($this->user1); + $this->assertTrue( + OCP\Share::setExpirationDate('test', 'test.txt', $this->dateInFuture), + 'Failed asserting that user 1 successfully set an expiration date for the test.txt share.' + ); + + OC_User::setUserId($this->user2); + $this->assertEquals( + array('test.txt'), + OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_SOURCE), + 'Failed asserting that user 2 still has access to test.txt after expiration date has been set.' + ); + } + + protected function shareUserOneTestFileWithGroupOne() { + OC_User::setUserId($this->user1); + $this->assertTrue( + OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_GROUP, $this->group1, OCP\PERMISSION_READ), + 'Failed asserting that user 1 successfully shared text.txt with group 1.' + ); + $this->assertEquals( + array('test.txt'), + OCP\Share::getItemShared('test', 'test.txt', Test_Share_Backend::FORMAT_SOURCE), + 'Failed asserting that test.txt is a shared file of user 1.' + ); + + OC_User::setUserId($this->user2); + $this->assertEquals( + array('test.txt'), + OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_SOURCE), + 'Failed asserting that user 2 has access to test.txt after initial sharing.' + ); + + OC_User::setUserId($this->user3); + $this->assertEquals( + array('test.txt'), + OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_SOURCE), + 'Failed asserting that user 3 has access to test.txt after initial sharing.' + ); + } + public function testShareWithGroup() { // Invalid shares $message = 'Sharing test.txt failed, because the group foobar does not exist'; @@ -285,12 +370,7 @@ class Test_Share extends PHPUnit_Framework_TestCase { OC_Appconfig::setValue('core', 'shareapi_share_policy', $policy); // Valid share - $this->assertTrue(OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_GROUP, $this->group1, OCP\PERMISSION_READ)); - $this->assertEquals(array('test.txt'), OCP\Share::getItemShared('test', 'test.txt', Test_Share_Backend::FORMAT_SOURCE)); - OC_User::setUserId($this->user2); - $this->assertEquals(array('test.txt'), OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_SOURCE)); - OC_User::setUserId($this->user3); - $this->assertEquals(array('test.txt'), OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_SOURCE)); + $this->shareUserOneTestFileWithGroupOne(); // Attempt to share again OC_User::setUserId($this->user1); @@ -410,4 +490,97 @@ class Test_Share extends PHPUnit_Framework_TestCase { $this->assertEquals(array(), OCP\Share::getItemsShared('test')); } + public function testShareWithGroupExpirationExpired() { + $this->shareUserOneTestFileWithGroupOne(); + + OC_User::setUserId($this->user1); + $this->assertTrue( + OCP\Share::setExpirationDate('test', 'test.txt', $this->dateInPast), + 'Failed asserting that user 1 successfully set an expiration date for the test.txt share.' + ); + + OC_User::setUserId($this->user2); + $this->assertFalse( + OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_SOURCE), + 'Failed asserting that user 2 no longer has access to test.txt after expiration.' + ); + + OC_User::setUserId($this->user3); + $this->assertFalse( + OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_SOURCE), + 'Failed asserting that user 3 no longer has access to test.txt after expiration.' + ); + } + + public function testShareWithGroupExpirationValid() { + $this->shareUserOneTestFileWithGroupOne(); + + OC_User::setUserId($this->user1); + $this->assertTrue( + OCP\Share::setExpirationDate('test', 'test.txt', $this->dateInFuture), + 'Failed asserting that user 1 successfully set an expiration date for the test.txt share.' + ); + + OC_User::setUserId($this->user2); + $this->assertEquals( + array('test.txt'), + OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_SOURCE), + 'Failed asserting that user 2 still has access to test.txt after expiration date has been set.' + ); + + OC_User::setUserId($this->user3); + $this->assertEquals( + array('test.txt'), + OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_SOURCE), + 'Failed asserting that user 3 still has access to test.txt after expiration date has been set.' + ); + } + + protected function getShareByValidToken($token) { + $row = OCP\Share::getShareByToken($token); + $this->assertInternalType( + 'array', + $row, + "Failed asserting that a share for token $token exists." + ); + return $row; + } + + public function testShareItemWithLink() { + OC_User::setUserId($this->user1); + $token = OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_LINK, null, OCP\PERMISSION_READ); + $this->assertInternalType( + 'string', + $token, + 'Failed asserting that user 1 successfully shared text.txt as link with token.' + ); + + // testGetShareByTokenNoExpiration + $row = $this->getShareByValidToken($token); + $this->assertEmpty( + $row['expiration'], + 'Failed asserting that the returned row does not have an expiration date.' + ); + + // testGetShareByTokenExpirationValid + $this->assertTrue( + OCP\Share::setExpirationDate('test', 'test.txt', $this->dateInFuture), + 'Failed asserting that user 1 successfully set a future expiration date for the test.txt share.' + ); + $row = $this->getShareByValidToken($token); + $this->assertNotEmpty( + $row['expiration'], + 'Failed asserting that the returned row has an expiration date.' + ); + + // testGetShareByTokenExpirationExpired + $this->assertTrue( + OCP\Share::setExpirationDate('test', 'test.txt', $this->dateInPast), + 'Failed asserting that user 1 successfully set a past expiration date for the test.txt share.' + ); + $this->assertFalse( + OCP\Share::getShareByToken($token), + 'Failed asserting that an expired share could not be found.' + ); + } } diff --git a/tests/lib/tags.php b/tests/lib/tags.php new file mode 100644 index 0000000000000000000000000000000000000000..97e3734cfda6826c0a9b93bed95540ebf4ad1379 --- /dev/null +++ b/tests/lib/tags.php @@ -0,0 +1,166 @@ +. +* +*/ + +class Test_Tags extends PHPUnit_Framework_TestCase { + + protected $objectType; + protected $user; + protected $backupGlobals = FALSE; + + public function setUp() { + + OC_User::clearBackends(); + OC_User::useBackend('dummy'); + $this->user = uniqid('user_'); + $this->objectType = uniqid('type_'); + OC_User::createUser($this->user, 'pass'); + OC_User::setUserId($this->user); + $this->tagMgr = new OC\TagManager($this->user); + + } + + public function tearDown() { + //$query = OC_DB::prepare('DELETE FROM `*PREFIX*vcategories` WHERE `item_type` = ?'); + //$query->execute(array('test')); + } + + public function testInstantiateWithDefaults() { + $defaultTags = array('Friends', 'Family', 'Work', 'Other'); + + $tagger = $this->tagMgr->load($this->objectType, $defaultTags); + + $this->assertEquals(4, count($tagger->getTags())); + } + + public function testAddTags() { + $tags = array('Friends', 'Family', 'Work', 'Other'); + + $tagger = $this->tagMgr->load($this->objectType); + + foreach($tags as $tag) { + $result = $tagger->add($tag); + $this->assertGreaterThan(0, $result, 'add() returned an ID <= 0'); + $this->assertTrue((bool)$result); + } + + $this->assertFalse($tagger->add('Family')); + $this->assertFalse($tagger->add('fAMILY')); + + $this->assertCount(4, $tagger->getTags(), 'Wrong number of added tags'); + } + + public function testAddMultiple() { + $tags = array('Friends', 'Family', 'Work', 'Other'); + + $tagger = $this->tagMgr->load($this->objectType); + + foreach($tags as $tag) { + $this->assertFalse($tagger->hasTag($tag)); + } + + $result = $tagger->addMultiple($tags); + $this->assertTrue((bool)$result); + + foreach($tags as $tag) { + $this->assertTrue($tagger->hasTag($tag)); + } + + $this->assertCount(4, $tagger->getTags(), 'Not all tags added'); + } + + public function testIsEmpty() { + $tagger = $this->tagMgr->load($this->objectType); + + $this->assertEquals(0, count($tagger->getTags())); + $this->assertTrue($tagger->isEmpty()); + + $result = $tagger->add('Tag'); + $this->assertGreaterThan(0, $result, 'add() returned an ID <= 0'); + $this->assertNotEquals(false, $result, 'add() returned false'); + $this->assertFalse($tagger->isEmpty()); + } + + public function testdeleteTags() { + $defaultTags = array('Friends', 'Family', 'Work', 'Other'); + $tagger = $this->tagMgr->load($this->objectType, $defaultTags); + + $this->assertEquals(4, count($tagger->getTags())); + + $tagger->delete('family'); + $this->assertEquals(3, count($tagger->getTags())); + + $tagger->delete(array('Friends', 'Work', 'Other')); + $this->assertEquals(0, count($tagger->getTags())); + + } + + public function testRenameTag() { + $defaultTags = array('Friends', 'Family', 'Wrok', 'Other'); + $tagger = $this->tagMgr->load($this->objectType, $defaultTags); + + $this->assertTrue($tagger->rename('Wrok', 'Work')); + $this->assertTrue($tagger->hasTag('Work')); + $this->assertFalse($tagger->hastag('Wrok')); + $this->assertFalse($tagger->rename('Wrok', 'Work')); + + } + + public function testTagAs() { + $objids = array(1, 2, 3, 4, 5, 6, 7, 8, 9); + + $tagger = $this->tagMgr->load($this->objectType); + + foreach($objids as $id) { + $tagger->tagAs($id, 'Family'); + } + + $this->assertEquals(1, count($tagger->getTags())); + $this->assertEquals(9, count($tagger->getIdsForTag('Family'))); + } + + /** + * @depends testTagAs + */ + public function testUnTag() { + $objIds = array(1, 2, 3, 4, 5, 6, 7, 8, 9); + + // Is this "legal"? + $this->testTagAs(); + $tagger = $this->tagMgr->load($this->objectType); + + foreach($objIds as $id) { + $this->assertTrue(in_array($id, $tagger->getIdsForTag('Family'))); + $tagger->unTag($id, 'Family'); + $this->assertFalse(in_array($id, $tagger->getIdsForTag('Family'))); + } + + $this->assertEquals(1, count($tagger->getTags())); + $this->assertEquals(0, count($tagger->getIdsForTag('Family'))); + } + + public function testFavorite() { + $tagger = $this->tagMgr->load($this->objectType); + $this->assertTrue($tagger->addToFavorites(1)); + $this->assertTrue($tagger->removeFromFavorites(1)); + } + +} diff --git a/tests/lib/user.php b/tests/lib/user.php new file mode 100644 index 0000000000000000000000000000000000000000..66c7f3f0d747a93c1b1437f14a9d5309470473eb --- /dev/null +++ b/tests/lib/user.php @@ -0,0 +1,43 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace Test; + +use OC\Hooks\PublicEmitter; + +class User extends \PHPUnit_Framework_TestCase { + + public function testCheckPassword() { + /** + * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend + */ + $backend = $this->getMock('\OC_User_Dummy'); + $backend->expects($this->once()) + ->method('checkPassword') + ->with($this->equalTo('foo'), $this->equalTo('bar')) + ->will($this->returnValue('foo')); + + $backend->expects($this->any()) + ->method('implementsActions') + ->will($this->returnCallback(function ($actions) { + if ($actions === \OC_USER_BACKEND_CHECK_PASSWORD) { + return true; + } else { + return false; + } + })); + + $manager = \OC_User::getManager(); + $manager->registerBackend($backend); + + $uid = \OC_User::checkPassword('foo', 'bar'); + $this->assertEquals($uid, 'foo'); + } + +} \ No newline at end of file diff --git a/tests/lib/user/manager.php b/tests/lib/user/manager.php index bc49f6db4b281e3c58b2d9051c923c06a04f1d30..00901dd4115c7e83aa4af3859b71957fbfa73dfb 100644 --- a/tests/lib/user/manager.php +++ b/tests/lib/user/manager.php @@ -98,6 +98,51 @@ class Manager extends \PHPUnit_Framework_TestCase { $this->assertTrue($manager->userExists('foo')); } + public function testCheckPassword() { + /** + * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend + */ + $backend = $this->getMock('\OC_User_Dummy'); + $backend->expects($this->once()) + ->method('checkPassword') + ->with($this->equalTo('foo'), $this->equalTo('bar')) + ->will($this->returnValue(true)); + + $backend->expects($this->any()) + ->method('implementsActions') + ->will($this->returnCallback(function ($actions) { + if ($actions === \OC_USER_BACKEND_CHECK_PASSWORD) { + return true; + } else { + return false; + } + })); + + $manager = new \OC\User\Manager(); + $manager->registerBackend($backend); + + $user = $manager->checkPassword('foo', 'bar'); + $this->assertTrue($user instanceof \OC\User\User); + } + + public function testCheckPasswordNotSupported() { + /** + * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend + */ + $backend = $this->getMock('\OC_User_Dummy'); + $backend->expects($this->never()) + ->method('checkPassword'); + + $backend->expects($this->any()) + ->method('implementsActions') + ->will($this->returnValue(false)); + + $manager = new \OC\User\Manager(); + $manager->registerBackend($backend); + + $this->assertFalse($manager->checkPassword('foo', 'bar')); + } + public function testGetOneBackendExists() { /** * @var \OC_User_Dummy | \PHPUnit_Framework_MockObject_MockObject $backend diff --git a/tests/lib/user/session.php b/tests/lib/user/session.php index 274e9e2831eea8bce10721625458fb5d9f85a442..e457a7bda30218463cec7fb1bfdf56ed0e5e8e97 100644 --- a/tests/lib/user/session.php +++ b/tests/lib/user/session.php @@ -61,10 +61,6 @@ class Session extends \PHPUnit_Framework_TestCase { $backend = $this->getMock('OC_User_Dummy'); $user = $this->getMock('\OC\User\User', array(), array('foo', $backend)); - $user->expects($this->once()) - ->method('checkPassword') - ->with('bar') - ->will($this->returnValue(true)); $user->expects($this->once()) ->method('isEnabled') ->will($this->returnValue(true)); @@ -73,8 +69,8 @@ class Session extends \PHPUnit_Framework_TestCase { ->will($this->returnValue('foo')); $manager->expects($this->once()) - ->method('get') - ->with('foo') + ->method('checkPassword') + ->with('foo', 'bar') ->will($this->returnValue($user)); $userSession = new \OC\User\Session($manager, $session); @@ -92,17 +88,13 @@ class Session extends \PHPUnit_Framework_TestCase { $backend = $this->getMock('OC_User_Dummy'); $user = $this->getMock('\OC\User\User', array(), array('foo', $backend)); - $user->expects($this->once()) - ->method('checkPassword') - ->with('bar') - ->will($this->returnValue(true)); $user->expects($this->once()) ->method('isEnabled') ->will($this->returnValue(false)); $manager->expects($this->once()) - ->method('get') - ->with('foo') + ->method('checkPassword') + ->with('foo', 'bar') ->will($this->returnValue($user)); $userSession = new \OC\User\Session($manager, $session); @@ -119,17 +111,13 @@ class Session extends \PHPUnit_Framework_TestCase { $backend = $this->getMock('OC_User_Dummy'); $user = $this->getMock('\OC\User\User', array(), array('foo', $backend)); - $user->expects($this->once()) - ->method('checkPassword') - ->with('bar') - ->will($this->returnValue(false)); $user->expects($this->never()) ->method('isEnabled'); $manager->expects($this->once()) - ->method('get') - ->with('foo') - ->will($this->returnValue($user)); + ->method('checkPassword') + ->with('foo', 'bar') + ->will($this->returnValue(false)); $userSession = new \OC\User\Session($manager, $session); $userSession->login('foo', 'bar'); @@ -145,9 +133,9 @@ class Session extends \PHPUnit_Framework_TestCase { $backend = $this->getMock('OC_User_Dummy'); $manager->expects($this->once()) - ->method('get') - ->with('foo') - ->will($this->returnValue(null)); + ->method('checkPassword') + ->with('foo', 'bar') + ->will($this->returnValue(false)); $userSession = new \OC\User\Session($manager, $session); $userSession->login('foo', 'bar'); diff --git a/tests/lib/user/user.php b/tests/lib/user/user.php index b0d170cbfc56db3016e1859084d1dd8f6c64cdae..de5ccbf38c101912de766d1c0eeb67a20cba27fc 100644 --- a/tests/lib/user/user.php +++ b/tests/lib/user/user.php @@ -100,46 +100,6 @@ class User extends \PHPUnit_Framework_TestCase { $this->assertTrue($user->delete()); } - public function testCheckPassword() { - /** - * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend - */ - $backend = $this->getMock('\OC_User_Dummy'); - $backend->expects($this->once()) - ->method('checkPassword') - ->with($this->equalTo('foo'), $this->equalTo('bar')) - ->will($this->returnValue(true)); - - $backend->expects($this->any()) - ->method('implementsActions') - ->will($this->returnCallback(function ($actions) { - if ($actions === \OC_USER_BACKEND_CHECK_PASSWORD) { - return true; - } else { - return false; - } - })); - - $user = new \OC\User\User('foo', $backend); - $this->assertTrue($user->checkPassword('bar')); - } - - public function testCheckPasswordNotSupported() { - /** - * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend - */ - $backend = $this->getMock('\OC_User_Dummy'); - $backend->expects($this->never()) - ->method('checkPassword'); - - $backend->expects($this->any()) - ->method('implementsActions') - ->will($this->returnValue(false)); - - $user = new \OC\User\User('foo', $backend); - $this->assertFalse($user->checkPassword('bar')); - } - public function testGetHome() { /** * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend diff --git a/tests/lib/util.php b/tests/lib/util.php index 13aa49c8c6f606164a657e08ad1664e4c588bd82..d607a3e77256ec02ae75beb29cc761b6762e9bad 100644 --- a/tests/lib/util.php +++ b/tests/lib/util.php @@ -71,8 +71,8 @@ class Test_Util extends PHPUnit_Framework_TestCase { $this->assertTrue(\OC_Util::isInternetConnectionEnabled()); } - function testGenerate_random_bytes() { - $result = strlen(OC_Util::generate_random_bytes(59)); + function testGenerateRandomBytes() { + $result = strlen(OC_Util::generateRandomBytes(59)); $this->assertEquals(59, $result); } diff --git a/tests/lib/vcategories.php b/tests/lib/vcategories.php deleted file mode 100644 index df5f600f20da3a479daacea277dbb8fe953498f9..0000000000000000000000000000000000000000 --- a/tests/lib/vcategories.php +++ /dev/null @@ -1,128 +0,0 @@ -. -* -*/ - -//require_once("../lib/template.php"); - -class Test_VCategories extends PHPUnit_Framework_TestCase { - - protected $objectType; - protected $user; - protected $backupGlobals = FALSE; - - public function setUp() { - - OC_User::clearBackends(); - OC_User::useBackend('dummy'); - $this->user = uniqid('user_'); - $this->objectType = uniqid('type_'); - OC_User::createUser($this->user, 'pass'); - OC_User::setUserId($this->user); - - } - - public function tearDown() { - //$query = OC_DB::prepare('DELETE FROM `*PREFIX*vcategories` WHERE `item_type` = ?'); - //$query->execute(array('test')); - } - - public function testInstantiateWithDefaults() { - $defcategories = array('Friends', 'Family', 'Work', 'Other'); - - $catmgr = new OC_VCategories($this->objectType, $this->user, $defcategories); - - $this->assertEquals(4, count($catmgr->categories())); - } - - public function testAddCategories() { - $categories = array('Friends', 'Family', 'Work', 'Other'); - - $catmgr = new OC_VCategories($this->objectType, $this->user); - - foreach($categories as $category) { - $result = $catmgr->add($category); - $this->assertTrue((bool)$result); - } - - $this->assertFalse($catmgr->add('Family')); - $this->assertFalse($catmgr->add('fAMILY')); - - $this->assertEquals(4, count($catmgr->categories())); - } - - public function testdeleteCategories() { - $defcategories = array('Friends', 'Family', 'Work', 'Other'); - $catmgr = new OC_VCategories($this->objectType, $this->user, $defcategories); - $this->assertEquals(4, count($catmgr->categories())); - - $catmgr->delete('family'); - $this->assertEquals(3, count($catmgr->categories())); - - $catmgr->delete(array('Friends', 'Work', 'Other')); - $this->assertEquals(0, count($catmgr->categories())); - - } - - public function testrenameCategory() { - $defcategories = array('Friends', 'Family', 'Wrok', 'Other'); - $catmgr = new OC_VCategories($this->objectType, $this->user, $defcategories); - - $this->assertTrue($catmgr->rename('Wrok', 'Work')); - $this->assertTrue($catmgr->hasCategory('Work')); - $this->assertFalse($catmgr->hasCategory('Wrok')); - $this->assertFalse($catmgr->rename('Wrok', 'Work')); - - } - - public function testAddToCategory() { - $objids = array(1, 2, 3, 4, 5, 6, 7, 8, 9); - - $catmgr = new OC_VCategories($this->objectType, $this->user); - - foreach($objids as $id) { - $catmgr->addToCategory($id, 'Family'); - } - - $this->assertEquals(1, count($catmgr->categories())); - $this->assertEquals(9, count($catmgr->idsForCategory('Family'))); - } - - /** - * @depends testAddToCategory - */ - public function testRemoveFromCategory() { - $objids = array(1, 2, 3, 4, 5, 6, 7, 8, 9); - - // Is this "legal"? - $this->testAddToCategory(); - $catmgr = new OC_VCategories($this->objectType, $this->user); - - foreach($objids as $id) { - $this->assertTrue(in_array($id, $catmgr->idsForCategory('Family'))); - $catmgr->removeFromCategory($id, 'Family'); - $this->assertFalse(in_array($id, $catmgr->idsForCategory('Family'))); - } - - $this->assertEquals(1, count($catmgr->categories())); - $this->assertEquals(0, count($catmgr->idsForCategory('Family'))); - } - -} diff --git a/tests/phpunit.xml.dist b/tests/phpunit.xml.dist index 25dfc64cfeb748a9f5f8fbff820c1c8be86ba826..71a4ff2762c1737778cfa1d4b30a3eb15b19086f 100644 --- a/tests/phpunit.xml.dist +++ b/tests/phpunit.xml.dist @@ -11,7 +11,21 @@ .. ../3rdparty + ../apps/files/l10n + ../apps/files_external/l10n + ../apps/files_external/3rdparty + ../apps/files_versions/l10n + ../apps/files_encryption/l10n + ../apps/files_encryption/3rdparty + ../apps/files_sharing/l10n + ../apps/files_trashbin/l10n + ../apps/user_ldap/l10n + ../apps/user_webdavauth/l10n ../lib/MDB2 + ../lib/l10n + ../core/l10n + ../settings/l10n + ../tests