diff --git a/.htaccess b/.htaccess old mode 100755 new mode 100644 index 4ba5095e144e2a8a41afca2b1b263e855fe0688f..714e8af213b5c70578f1cc124e1f216c30d2d9f5 --- a/.htaccess +++ b/.htaccess @@ -6,8 +6,6 @@ RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION -ErrorDocument 403 /core/templates/403.php -ErrorDocument 404 /core/templates/404.php php_value upload_max_filesize 513M php_value post_max_size 513M @@ -20,12 +18,12 @@ php_value mbstring.func_overload 0 RewriteEngine on RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}] -RewriteRule ^.well-known/host-meta /public.php?service=host-meta [QSA,L] -RewriteRule ^.well-known/host-meta.json /public.php?service=host-meta-json [QSA,L] -RewriteRule ^.well-known/carddav /remote.php/carddav/ [R] -RewriteRule ^.well-known/caldav /remote.php/caldav/ [R] -RewriteRule ^apps/calendar/caldav.php remote.php/caldav/ [QSA,L] -RewriteRule ^apps/contacts/carddav.php remote.php/carddav/ [QSA,L] +RewriteRule ^\.well-known/host-meta /public.php?service=host-meta [QSA,L] +RewriteRule ^\.well-known/host-meta\.json /public.php?service=host-meta-json [QSA,L] +RewriteRule ^\.well-known/carddav /remote.php/carddav/ [R] +RewriteRule ^\.well-known/caldav /remote.php/caldav/ [R] +RewriteRule ^apps/calendar/caldav\.php remote.php/caldav/ [QSA,L] +RewriteRule ^apps/contacts/carddav\.php remote.php/carddav/ [QSA,L] RewriteRule ^apps/([^/]*)/(.*\.(php))$ index.php?app=$1&getfile=$2 [QSA,L] RewriteRule ^remote/(.*) remote.php [QSA,L] diff --git a/.jshintrc b/.jshintrc index 77f9e9f143d4c155ea03549df18202cef36decd4..d5da3e30828193581ecb113f423a69ab83e02bf6 100644 --- a/.jshintrc +++ b/.jshintrc @@ -26,6 +26,7 @@ "fakeServer": true, "_": true, "OC": true, + "OCA": true, "t": true, "n": true } diff --git a/3rdparty b/3rdparty index da3c9f651a26cf076249ebf25c477e3791e69ca3..ef80977061d4bc3a2d8ee0bf23a8287a3222b628 160000 --- a/3rdparty +++ b/3rdparty @@ -1 +1 @@ -Subproject commit da3c9f651a26cf076249ebf25c477e3791e69ca3 +Subproject commit ef80977061d4bc3a2d8ee0bf23a8287a3222b628 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 70bd85fabf0ff48b9a1a702f144f701b47dbdad2..ff3b270320a4e8c86bb913787df78a5811de28ea 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,7 +32,7 @@ If you have questions about how to install or use ownCloud, please direct these Help us to maximize the effort we can spend fixing issues and adding new features, by not reporting duplicate issues. [template]: https://raw.github.com/owncloud/core/master/issue_template.md -[mailinglist]: https://mail.kde.org/mailman/listinfo/owncloud +[mailinglist]: http://mailman.owncloud.org/mailman/listinfo/owncloud [forum]: http://forum.owncloud.org/ [irc]: http://webchat.freenode.net/?channels=owncloud&uio=d4 diff --git a/apps/files/ajax/list.php b/apps/files/ajax/list.php index 2d76b685018fec0f690b154672ae0f5c149774bd..bae3628402f73d4303b3625f8555b51a77d8cd84 100644 --- a/apps/files/ajax/list.php +++ b/apps/files/ajax/list.php @@ -17,8 +17,11 @@ $baseUrl = OCP\Util::linkTo('files', 'index.php') . '?dir='; $permissions = $dirInfo->getPermissions(); +$sortAttribute = isset( $_GET['sort'] ) ? $_GET['sort'] : 'name'; +$sortDirection = isset( $_GET['sortdirection'] ) ? ($_GET['sortdirection'] === 'desc') : false; + // make filelist -$files = \OCA\Files\Helper::getFiles($dir); +$files = \OCA\Files\Helper::getFiles($dir, $sortAttribute, $sortDirection); $data['directory'] = $dir; $data['files'] = \OCA\Files\Helper::formatFileInfos($files); diff --git a/apps/files/appinfo/app.php b/apps/files/appinfo/app.php index 15a29133789d33a82a3f687aba758d09884e1718..4b0db457ada50bb8812d216b6fd9438be8dee033 100644 --- a/apps/files/appinfo/app.php +++ b/apps/files/appinfo/app.php @@ -19,3 +19,13 @@ $templateManager->registerTemplate('text/html', 'core/templates/filetemplates/te $templateManager->registerTemplate('application/vnd.oasis.opendocument.presentation', 'core/templates/filetemplates/template.odp'); $templateManager->registerTemplate('application/vnd.oasis.opendocument.text', 'core/templates/filetemplates/template.odt'); $templateManager->registerTemplate('application/vnd.oasis.opendocument.spreadsheet', 'core/templates/filetemplates/template.ods'); + +\OCA\Files\App::getNavigationManager()->add( + array( + "id" => 'files', + "appname" => 'files', + "script" => 'list.php', + "order" => 0, + "name" => $l->t('All files') + ) +); diff --git a/apps/files/appinfo/update.php b/apps/files/appinfo/update.php deleted file mode 100644 index f920f842166700a16c8c75ad059f28117998adbc..0000000000000000000000000000000000000000 --- a/apps/files/appinfo/update.php +++ /dev/null @@ -1,46 +0,0 @@ -getDatabasePlatform()-> - getConcatExpression( '\'{DAV:}\'', '`propertyname`' ); - $query = OC_DB::prepare(' - UPDATE `*PREFIX*properties` - SET `propertyname` = ' . $concat . ' - WHERE `propertyname` NOT LIKE \'{%\' - '); - $query->execute(); -} - -//update from OC 3 - -//try to remove remaining files. -//Give a warning if not possible - -$filesToRemove = array( - 'ajax', - 'appinfo', - 'css', - 'js', - 'l10n', - 'templates', - 'admin.php', - 'download.php', - 'index.php', - 'settings.php' -); - -foreach($filesToRemove as $file) { - $filepath = OC::$SERVERROOT . '/files/' . $file; - if(!file_exists($filepath)) { - continue; - } - $success = OCP\Files::rmdirr($filepath); - if($success === false) { - //probably not sufficient privileges, give up and give a message. - OCP\Util::writeLog('files', 'Could not clean /files/ directory.' - .' Please remove everything except webdav.php from ' . OC::$SERVERROOT . '/files/', OCP\Util::ERROR); - break; - } -} diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 474f1af0720f52fd73b9e1deee3a151825644a49..009cb355ba7d33a01720539900ca3c2f5c5c17c3 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -3,10 +3,11 @@ See the COPYING-README file. */ /* FILE MENU */ -.actions { padding:5px; height:32px; width: 100%; } +.actions { padding:5px; height:32px; display: inline-block; float: left; } .actions input, .actions button, .actions .button { margin:0; float:left; } .actions .button a { color: #555; } .actions .button a:hover, .actions .button a:active { color: #333; } +.actions.hidden { display: none; } #new { z-index: 1010; @@ -75,6 +76,7 @@ top: 44px; width: 100%; } + /* make sure there's enough room for the file actions */ #body-user #filestable { min-width: 688px; /* 768 (mobile break) - 80 (nav width) */ @@ -83,6 +85,40 @@ min-width: 688px; /* 768 (mobile break) - 80 (nav width) */ } +#filestable tbody tr { background-color:#fff; height:51px; } + +.app-files #app-content { + position: relative; +} + +/** + * Override global #controls styles + * to be more flexible / relative + */ +#body-user .app-files #controls { + left: 310px; /* main nav bar + sidebar */ + position: fixed; + padding-left: 0px; +} + +/* this is mostly for file viewer apps, text editor, etc */ +#body-user .app-files.no-sidebar #controls { + left: 0px; + padding-left: 80px; /* main nav bar */ +} + +.app-files #app-navigation { + width: 230px; +} + +.app-files #app-settings { + width: 229px; /* DUH */ +} + +.app-files #app-settings input { + width: 90%; +} + #filestable tbody tr { background-color:#fff; height:40px; } #filestable tbody tr:hover, tbody tr:active { background-color: rgb(240,240,240); @@ -116,10 +152,29 @@ tr:hover span.extension { table tr.mouseOver td { background-color:#eee; } table th { height:24px; padding:0 8px; color:#999; } -table th .name { - position: absolute; - left: 55px; - top: 15px; +table th .columntitle { + display: inline-block; + padding: 15px; + width: 100%; + height: 50px; + box-sizing: border-box; + -moz-box-sizing: border-box; + vertical-align: middle; +} +table th .columntitle.name { + padding-left: 5px; + margin-left: 50px; + max-width: 300px; +} +/* hover effect on sortable column */ +table th a.columntitle:hover { + background-color: #F0F0F0; +} +table th .sort-indicator { + width: 10px; + height: 8px; + margin-left: 10px; + display: inline-block; } table th, table td { border-bottom:1px solid #ddd; text-align:left; font-weight:normal; } table td { @@ -139,8 +194,11 @@ table th#headerName { } table th#headerSize, table td.filesize { min-width: 48px; - padding: 0 16px; text-align: right; + padding: 0; +} +table table td.filesize { + padding: 0 16px; } table th#headerDate, table td.date { -moz-box-sizing: border-box; @@ -161,9 +219,7 @@ table.multiselect thead { z-index: 10; -moz-box-sizing: border-box; box-sizing: border-box; - left: 0; - padding-left: 80px; - width: 100%; + left: 310px; /* main nav bar + sidebar */ } table.multiselect thead th { @@ -197,10 +253,6 @@ table td.filename input.filename { table td.filename a, table td.login, table td.logout, table td.download, table td.upload, table td.create, table td.delete { padding:3px 8px 8px 3px; } table td.filename .nametext, .uploadtext, .modified { float:left; padding:14px 0; } -#modified { - position: absolute; - top: 15px; -} .modified { position: relative; padding-left: 8px; @@ -254,7 +306,7 @@ table td.filename form { font-size:14px; margin-left:48px; margin-right:48px; } /* Use label to have bigger clickable size for checkbox */ #fileList tr td.filename>input[type="checkbox"] + label, -#select_all + label { +.select-all + label { height: 50px; position: absolute; width: 50px; @@ -268,10 +320,10 @@ table td.filename form { font-size:14px; margin-left:48px; margin-right:48px; } #fileList tr td.filename>input[type="checkbox"] + label { left: 0; } -#select_all + label { +.select-all + label { top: 0; } -#select_all { +.select-all { position: absolute; top: 18px; left: 18px; @@ -310,7 +362,6 @@ a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; } /* Actions for selected files */ .selectedActions { - display: none; position: absolute; top: -1px; right: 0; @@ -320,6 +371,9 @@ a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; } display: inline; padding: 17px 5px; } +.selectedActions a.hidden { + display: none; +} .selectedActions a img { position:relative; top:5px; @@ -395,7 +449,7 @@ table.dragshadow td.size { } .mask { z-index: 50; - position: fixed; + position: absolute; top: 0; left: 0; right: 0; diff --git a/apps/files/index.php b/apps/files/index.php index b8ff08c1b05573dadcd74aaeac5dc4d71581f625..e24c535cb208cab1488194ddadc29bb5e444b970 100644 --- a/apps/files/index.php +++ b/apps/files/index.php @@ -28,36 +28,33 @@ OCP\User::checkLoggedIn(); OCP\Util::addStyle('files', 'files'); OCP\Util::addStyle('files', 'upload'); OCP\Util::addStyle('files', 'mobile'); +OCP\Util::addscript('files', 'app'); OCP\Util::addscript('files', 'file-upload'); OCP\Util::addscript('files', 'jquery.iframe-transport'); OCP\Util::addscript('files', 'jquery.fileupload'); OCP\Util::addscript('files', 'jquery-visibility'); +OCP\Util::addscript('files', 'filesummary'); OCP\Util::addscript('files', 'breadcrumb'); OCP\Util::addscript('files', 'filelist'); OCP\App::setActiveNavigationEntry('files_index'); -// Load the files -$dir = isset($_GET['dir']) ? stripslashes($_GET['dir']) : ''; -$dir = \OC\Files\Filesystem::normalizePath($dir); -$dirInfo = \OC\Files\Filesystem::getFileInfo($dir, false); -// Redirect if directory does not exist -if (!$dirInfo || !$dirInfo->getType() === 'dir') { - header('Location: ' . OCP\Util::getScriptName() . ''); - exit(); -} $isIE8 = false; preg_match('/MSIE (.*?);/', $_SERVER['HTTP_USER_AGENT'], $matches); -if (count($matches) > 0 && $matches[1] <= 8){ +if (count($matches) > 0 && $matches[1] <= 9) { $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 = '/'; +// if IE8 and "?dir=path&view=someview" was specified, reformat the URL to use a hash like "#?dir=path&view=someview" +if ($isIE8 && (isset($_GET['dir']) || isset($_GET['view']))) { + $hash = '#?'; + $dir = isset($_GET['dir']) ? $_GET['dir'] : '/'; + $view = isset($_GET['view']) ? $_GET['view'] : 'files'; + $hash = '#?dir=' . \OCP\Util::encodePath($dir); + if ($view !== 'files') { + $hash .= '&view=' . urlencode($view); } - header('Location: ' . OCP\Util::linkTo('files', 'index.php') . '#?dir=' . \OCP\Util::encodePath($dir)); + header('Location: ' . OCP\Util::linkTo('files', 'index.php') . $hash); exit(); } @@ -65,49 +62,62 @@ $user = OC_User::getUser(); $config = \OC::$server->getConfig(); -// needed for share init, permissions will be reloaded -// anyway with ajax load -$permissions = $dirInfo->getPermissions(); - -// information about storage capacities -$storageInfo=OC_Helper::getStorageInfo($dir, $dirInfo); -$freeSpace=$storageInfo['free']; -$uploadLimit=OCP\Util::uploadLimit(); -$maxUploadFilesize=OCP\Util::maxUploadFilesize($dir, $freeSpace); -$publicUploadEnabled = $config->getAppValue('core', 'shareapi_allow_public_upload', 'yes'); +// mostly for the home storage's free space +$dirInfo = \OC\Files\Filesystem::getFileInfo('/', false); +$storageInfo=OC_Helper::getStorageInfo('/', $dirInfo); // if the encryption app is disabled, than everything is fine (INIT_SUCCESSFUL status code) $encryptionInitStatus = 2; if (OC_App::isEnabled('files_encryption')) { - $session = new \OCA\Encryption\Session(new \OC\Files\View('/')); - $encryptionInitStatus = $session->getInitialized(); + $session = new \OCA\Encryption\Session(new \OC\Files\View('/')); + $encryptionInitStatus = $session->getInitialized(); +} + +$nav = new OCP\Template('files', 'appnavigation', ''); + +$navItems = \OCA\Files\App::getNavigationManager()->getAll(); +$nav->assign('navigationItems', $navItems); + +$contentItems = array(); + +function renderScript($appName, $scriptName) { + $content = ''; + $appPath = OC_App::getAppPath($appName); + $scriptPath = $appPath . '/' . $scriptName; + if (file_exists($scriptPath)) { + // TODO: sanitize path / script name ? + ob_start(); + include $scriptPath; + $content = ob_get_contents(); + @ob_end_clean(); + } + return $content; } -$trashEnabled = \OCP\App::isEnabled('files_trashbin'); -$trashEmpty = true; -if ($trashEnabled) { - $trashEmpty = \OCA\Files_Trashbin\Trashbin::isEmpty($user); +// render the container content for every navigation item +foreach ($navItems as $item) { + $content = ''; + if (isset($item['script'])) { + $content = renderScript($item['appname'], $item['script']); + } + $contentItem = array(); + $contentItem['id'] = $item['id']; + $contentItem['content'] = $content; + $contentItems[] = $contentItem; } OCP\Util::addscript('files', 'fileactions'); OCP\Util::addscript('files', 'files'); +OCP\Util::addscript('files', 'navigation'); OCP\Util::addscript('files', 'keyboardshortcuts'); $tmpl = new OCP\Template('files', 'index', 'user'); -$tmpl->assign('dir', $dir); -$tmpl->assign('permissions', $permissions); -$tmpl->assign('trash', $trashEnabled); -$tmpl->assign('trashEmpty', $trashEmpty); -$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize); // minimium of freeSpace and uploadLimit -$tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize)); -$tmpl->assign('freeSpace', $freeSpace); -$tmpl->assign('uploadLimit', $uploadLimit); // PHP upload limit -$tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true))); $tmpl->assign('usedSpacePercent', (int)$storageInfo['relative']); $tmpl->assign('isPublic', false); -$tmpl->assign('publicUploadEnabled', $publicUploadEnabled); $tmpl->assign("encryptedFiles", \OCP\Util::encryptedFiles()); $tmpl->assign("mailNotificationEnabled", $config->getAppValue('core', 'shareapi_allow_mail_notification', 'yes')); $tmpl->assign("allowShareWithLink", $config->getAppValue('core', 'shareapi_allow_links', 'yes')); $tmpl->assign("encryptionInitStatus", $encryptionInitStatus); -$tmpl->assign('disableSharing', false); +$tmpl->assign('appNavigation', $nav); +$tmpl->assign('appContents', $contentItems); +$tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true))); $tmpl->printPage(); diff --git a/apps/files/js/app.js b/apps/files/js/app.js new file mode 100644 index 0000000000000000000000000000000000000000..9155fb38cdbeee986ac6d21194e92651c98d47e1 --- /dev/null +++ b/apps/files/js/app.js @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2014 + * + * @author Vincent Petry + * @copyright 2014 Vincent Petry + * + * This file is licensed under the Affero General Public License version 3 + * or later. + * + * See the COPYING-README file. + * + */ + +/* global dragOptions, folderDropOptions */ +(function() { + + if (!OCA.Files) { + OCA.Files = {}; + } + + var App = { + navigation: null, + + initialize: function() { + this.navigation = new OCA.Files.Navigation($('#app-navigation')); + + // TODO: ideally these should be in a separate class / app (the embedded "all files" app) + this.fileActions = OCA.Files.FileActions; + this.files = OCA.Files.Files; + + this.fileList = new OCA.Files.FileList( + $('#app-content-files'), { + scrollContainer: $('#app-content'), + dragOptions: dragOptions, + folderDropOptions: folderDropOptions + } + ); + this.files.initialize(); + this.fileActions.registerDefaultActions(this.fileList); + this.fileList.setFileActions(this.fileActions); + + // for backward compatibility, the global FileList will + // refer to the one of the "files" view + window.FileList = this.fileList; + + this._setupEvents(); + // trigger URL change event handlers + this._onPopState(OC.Util.History.parseUrlQuery()); + }, + + /** + * Returns the container of the currently visible app. + * + * @return app container + */ + getCurrentAppContainer: function() { + return this.navigation.getActiveContainer(); + }, + + /** + * Setup events based on URL changes + */ + _setupEvents: function() { + OC.Util.History.addOnPopStateHandler(_.bind(this._onPopState, this)); + + // detect when app changed their current directory + $('#app-content').delegate('>div', 'changeDirectory', _.bind(this._onDirectoryChanged, this)); + $('#app-content').delegate('>div', 'changeViewerMode', _.bind(this._onChangeViewerMode, this)); + + $('#app-navigation').on('itemChanged', _.bind(this._onNavigationChanged, this)); + }, + + /** + * Event handler for when the current navigation item has changed + */ + _onNavigationChanged: function(e) { + var params; + if (e && e.itemId) { + params = { + view: e.itemId, + dir: '/' + }; + this._changeUrl(params.view, params.dir); + this.navigation.getActiveContainer().trigger(new $.Event('urlChanged', params)); + } + }, + + /** + * Event handler for when an app notified that its directory changed + */ + _onDirectoryChanged: function(e) { + if (e.dir) { + this._changeUrl(this.navigation.getActiveItem(), e.dir); + } + }, + + /** + * Event handler for when an app notifies that it needs space + * for viewer mode. + */ + _onChangeViewerMode: function(e) { + var state = !!e.viewerModeEnabled; + $('#app-navigation').toggleClass('hidden', state); + $('.app-files').toggleClass('viewer-mode no-sidebar', state); + }, + + /** + * Event handler for when the URL changed + */ + _onPopState: function(params) { + params = _.extend({ + dir: '/', + view: 'files' + }, params); + var lastId = this.navigation.getActiveItem(); + if (!this.navigation.itemExists(params.view)) { + params.view = 'files'; + } + this.navigation.setActiveItem(params.view, {silent: true}); + if (lastId !== this.navigation.getActiveItem()) { + this.navigation.getActiveContainer().trigger(new $.Event('show')); + } + this.navigation.getActiveContainer().trigger(new $.Event('urlChanged', params)); + }, + + /** + * Change the URL to point to the given dir and view + */ + _changeUrl: function(view, dir) { + var params = {dir: dir}; + if (view !== 'files') { + params.view = view; + } + OC.Util.History.pushState(params); + } + }; + OCA.Files.App = App; +})(); + +$(document).ready(function() { + // wait for other apps/extensions to register their event handlers + // in the "ready" clause + _.defer(function() { + OCA.Files.App.initialize(); + }); +}); + diff --git a/apps/files/js/breadcrumb.js b/apps/files/js/breadcrumb.js index 5bc2fac13695d29940872c4dfa6e76931035e923..c017d710d6decad7830193b7a3d4bccc53bc4c02 100644 --- a/apps/files/js/breadcrumb.js +++ b/apps/files/js/breadcrumb.js @@ -159,7 +159,11 @@ this.totalWidth = 64; // FIXME: this class should not know about global elements if ( $('#navigation').length ) { - this.totalWidth += $('#navigation').get(0).offsetWidth; + this.totalWidth += $('#navigation').outerWidth(); + } + + if ( $('#app-navigation').length && !$('#app-navigation').hasClass('hidden')) { + this.totalWidth += $('#app-navigation').outerWidth(); } this.hiddenBreadcrumbs = 0; @@ -167,8 +171,8 @@ this.totalWidth += $(this.breadcrumbs[i]).get(0).offsetWidth; } - $.each($('#controls .actions>div'), function(index, action) { - self.totalWidth += $(action).get(0).offsetWidth; + $.each($('#controls .actions'), function(index, action) { + self.totalWidth += $(action).outerWidth(); }); }, @@ -236,6 +240,6 @@ } }; - window.BreadCrumb = BreadCrumb; + OCA.Files.BreadCrumb = BreadCrumb; })(); diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index 03ebdccb32df25ad3b85d83e972e9508ca5db202..6b0ca793681089edd304deae6ae05d531546b15e 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -18,7 +18,7 @@ * - TODO music upload button */ -/* global OC, t, n */ +/* global Files, FileList, jQuery, oc_requesttoken, humanFileSize, getUniqueName */ /** * Function that will allow us to know if Ajax uploads are supported @@ -65,7 +65,7 @@ OC.Upload = { */ cancelUploads:function() { this.log('canceling uploads'); - jQuery.each(this._uploads,function(i, jqXHR) { + jQuery.each(this._uploads, function(i, jqXHR) { jqXHR.abort(); }); this._uploads = []; @@ -83,7 +83,7 @@ OC.Upload = { isProcessing:function() { var count = 0; - jQuery.each(this._uploads,function(i, data) { + jQuery.each(this._uploads, function(i, data) { if (data.state() === 'pending') { count++; } @@ -205,14 +205,16 @@ OC.Upload = { */ add: function(e, data) { OC.Upload.log('add', e, data); - var that = $(this); - var freeSpace; + var that = $(this), freeSpace; - // 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 + // 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 ) { @@ -244,14 +246,15 @@ OC.Upload = { // in case folder drag and drop is not supported file will point to a directory // http://stackoverflow.com/a/20448357 - if (!file.type && file.size%4096 === 0 && file.size <= 102400) { + if ( ! file.type && file.size%4096 === 0 && file.size <= 102400) { try { - reader = new FileReader(); - reader.readAsBinaryString(f); + var reader = new FileReader(); + reader.readAsBinaryString(file); } catch (NS_ERROR_FILE_ACCESS_DENIED) { //file is a directory data.textStatus = 'dirorzero'; - data.errorThrown = t('files', 'Unable to upload {filename} as it is a directory or has 0 bytes', + data.errorThrown = t('files', + 'Unable to upload {filename} as it is a directory or has 0 bytes', {filename: file.name} ); } @@ -263,7 +266,8 @@ OC.Upload = { // check PHP upload limit if (selection.totalBytes > $('#upload_limit').val()) { data.textStatus = 'sizeexceedlimit'; - data.errorThrown = t('files', 'Total file size {size1} exceeds upload limit {size2}', { + data.errorThrown = t('files', + 'Total file size {size1} exceeds upload limit {size2}', { 'size1': humanFileSize(selection.totalBytes), 'size2': humanFileSize($('#upload_limit').val()) }); @@ -273,7 +277,8 @@ OC.Upload = { freeSpace = $('#free_space').val(); if (freeSpace >= 0 && selection.totalBytes > freeSpace) { data.textStatus = 'notenoughspace'; - data.errorThrown = t('files', 'Not enough free space, you are uploading {size1} but only {size2} is left', { + data.errorThrown = t('files', + 'Not enough free space, you are uploading {size1} but only {size2} is left', { 'size1': humanFileSize(selection.totalBytes), 'size2': humanFileSize($('#free_space').val()) }); @@ -341,7 +346,7 @@ OC.Upload = { // noone set update parameters, we set the minimum data.formData = { requesttoken: oc_requesttoken, - dir: $('#dir').val(), + dir: FileList.getCurrentDirectory(), file_directory: fileDirectory }; } @@ -384,31 +389,29 @@ OC.Upload = { //fetch response from iframe response = data.result[0].body.innerText; } - var result=$.parseJSON(response); + var result = $.parseJSON(response); delete data.jqXHR; + var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload'); + if (result.status === 'error' && result.data && result.data.message){ data.textStatus = 'servererror'; data.errorThrown = result.data.message; - var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload'); fu._trigger('fail', e, data); } else 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[0].data.message; // error message has been translated on server - var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload'); fu._trigger('fail', e, data); } }, @@ -440,7 +443,7 @@ OC.Upload = { fileupload.on('fileuploadstart', function(e, data) { OC.Upload.log('progress handle fileuploadstart', e, data); $('#uploadprogresswrapper input.stop').show(); - $('#uploadprogressbar').progressbar({value:0}); + $('#uploadprogressbar').progressbar({value: 0}); $('#uploadprogressbar').fadeIn(); }); fileupload.on('fileuploadprogress', function(e, data) { @@ -457,7 +460,6 @@ OC.Upload = { $('#uploadprogresswrapper input.stop').fadeOut(); $('#uploadprogressbar').fadeOut(); - Files.updateStorageStatistics(); }); fileupload.on('fileuploadfail', function(e, data) { OC.Upload.log('progress handle fileuploadfail', e, data); @@ -468,8 +470,6 @@ OC.Upload = { } }); - } else { - console.log('skipping file progress because your browser is broken'); } } @@ -509,7 +509,7 @@ OC.Upload = { $('#new li').each(function(i,element) { if ($(element).children('p').length === 0) { $(element).children('form').remove(); - $(element).append('

'+$(element).data('text')+'

'); + $(element).append('

' + $(element).data('text') + '

'); } }); }); @@ -527,16 +527,16 @@ OC.Upload = { $('#new .error').tipsy('hide'); - $('#new li').each(function(i,element) { + $('#new li').each(function(i, element) { if ($(element).children('p').length === 0) { $(element).children('form').remove(); - $(element).append('

'+$(element).data('text')+'

'); + $(element).append('

' + $(element).data('text') + '

'); } }); - var type=$(this).data('type'); - var text=$(this).children('p').text(); - $(this).data('text',text); + var type = $(this).data('type'); + var text = $(this).children('p').text(); + $(this).data('text', text); $(this).children('p').remove(); // add input field @@ -553,7 +553,7 @@ OC.Upload = { var filename = input.val(); if (type === 'web' && filename.length === 0) { throw t('files', 'URL cannot be empty'); - } else if (type !== 'web' && !Files.isFileNameValid(filename)) { + } else if (type !== 'web' && ! Files.isFileNameValid(filename)) { // Files.isFileNameValid(filename) throws an exception itself } else if (FileList.inList(filename)) { throw t('files', '{new_name} already exists', {new_name: filename}); @@ -592,7 +592,7 @@ OC.Upload = { if (FileList.lastAction) { FileList.lastAction(); } - var name = getUniqueName(newname); + var name = FileList.getUniqueName(newname); if (newname !== name) { FileList.checkName(name, newname, true); var hidden = true; @@ -603,10 +603,13 @@ OC.Upload = { case 'file': $.post( OC.filePath('files', 'ajax', 'newfile.php'), - {dir:$('#dir').val(), filename:name}, + { + dir: FileList.getCurrentDirectory(), + filename: name + }, function(result) { if (result.status === 'success') { - FileList.add(result.data, {hidden: hidden, insert: true}); + FileList.add(result.data, {hidden: hidden, animate: true}); } else { OC.dialogs.alert(result.data.message, t('core', 'Could not create file')); } @@ -616,10 +619,13 @@ OC.Upload = { case 'folder': $.post( OC.filePath('files','ajax','newfolder.php'), - {dir:$('#dir').val(), foldername:name}, + { + dir: FileList.getCurrentDirectory(), + foldername: name + }, function(result) { if (result.status === 'success') { - FileList.add(result.data, {hidden: hidden, insert: true}); + FileList.add(result.data, {hidden: hidden, animate: true}); } else { OC.dialogs.alert(result.data.message, t('core', 'Could not create folder')); } @@ -627,39 +633,46 @@ OC.Upload = { ); break; case 'web': - if (name.substr(0,8) !== 'https://' && name.substr(0,7) !== 'http://') { + if (name.substr(0, 8) !== 'https://' && name.substr(0, 7) !== 'http://') { name = 'http://' + name; } - var localName=name; - if (localName.substr(localName.length-1,1)==='/') {//strip / - localName=localName.substr(0,localName.length-1); + var localName = name; + if (localName.substr(localName.length-1, 1) === '/') {//strip / + localName = localName.substr(0, localName.length-1); } - if (localName.indexOf('/')) {//use last part of url - localName=localName.split('/').pop(); + if (localName.indexOf('/')) { //use last part of url + localName = localName.split('/').pop(); } else { //or the domain - localName=(localName.match(/:\/\/(.[^\/]+)/)[1]).replace('www.',''); + localName = (localName.match(/:\/\/(.[^\/]+)/)[1]).replace('www.', ''); } - localName = getUniqueName(localName); + localName = FileList.getUniqueName(localName); //IE < 10 does not fire the necessary events for the progress bar. if ($('html.lte9').length === 0) { - $('#uploadprogressbar').progressbar({value:0}); + $('#uploadprogressbar').progressbar({value: 0}); $('#uploadprogressbar').fadeIn(); } - var eventSource=new OC.EventSource(OC.filePath('files','ajax','newfile.php'),{dir:$('#dir').val(),source:name,filename:localName}); - eventSource.listen('progress',function(progress) { + var eventSource = new OC.EventSource( + OC.filePath('files', 'ajax', 'newfile.php'), + { + dir: FileList.getCurrentDirectory(), + source: name, + filename: localName + } + ); + eventSource.listen('progress', function(progress) { //IE < 10 does not fire the necessary events for the progress bar. if ($('html.lte9').length === 0) { $('#uploadprogressbar').progressbar('value',progress); } }); - eventSource.listen('success',function(data) { + eventSource.listen('success', function(data) { var file = data; $('#uploadprogressbar').fadeOut(); - FileList.add(file, {hidden: hidden, insert: true}); + FileList.add(file, {hidden: hidden, animate: true}); }); - eventSource.listen('error',function(error) { + eventSource.listen('error', function(error) { $('#uploadprogressbar').fadeOut(); var message = (error && error.message) || t('core', 'Error fetching URL'); OC.Notification.show(message); @@ -670,12 +683,12 @@ OC.Upload = { }); break; } - var li=form.parent(); + 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')+'

'); + li.append('

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

'); $('#new>a').click(); } catch (error) { input.attr('title', error); diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index ecdfa72a477eb00d7b8f0b07a892ec8b6e6d35b0..b9cd9816d4c8bed99fde48bf3d003f11a3940c11 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -8,242 +8,255 @@ * */ -/* global OC, FileList, Files */ /* global trashBinApp */ -var FileActions = { - actions: {}, - defaults: {}, - icons: {}, - currentFile: null, - register: function (mime, name, permissions, icon, action, displayName) { - if (!FileActions.actions[mime]) { - FileActions.actions[mime] = {}; - } - if (!FileActions.actions[mime][name]) { - FileActions.actions[mime][name] = {}; - } - if (!displayName) { - displayName = t('files', name); - } - FileActions.actions[mime][name]['action'] = action; - FileActions.actions[mime][name]['permissions'] = permissions; - FileActions.actions[mime][name]['displayName'] = displayName; - FileActions.icons[name] = icon; - }, - setDefault: function (mime, name) { - FileActions.defaults[mime] = name; - }, - get: function (mime, type, permissions) { - var actions = this.getActions(mime, type, permissions); - var filteredActions = {}; - $.each(actions, function (name, action) { - filteredActions[name] = action.action; - }); - return filteredActions; - }, - getActions: function (mime, type, permissions) { - var actions = {}; - if (FileActions.actions.all) { - actions = $.extend(actions, FileActions.actions.all); - } - if (type) {//type is 'dir' or 'file' - if (FileActions.actions[type]) { - actions = $.extend(actions, FileActions.actions[type]); +(function() { + + var FileActions = { + actions: {}, + defaults: {}, + icons: {}, + currentFile: null, + register: function (mime, name, permissions, icon, action, displayName) { + if (!this.actions[mime]) { + this.actions[mime] = {}; } - } - if (mime) { - var mimePart = mime.substr(0, mime.indexOf('/')); - if (FileActions.actions[mimePart]) { - actions = $.extend(actions, FileActions.actions[mimePart]); + if (!this.actions[mime][name]) { + this.actions[mime][name] = {}; } - if (FileActions.actions[mime]) { - actions = $.extend(actions, FileActions.actions[mime]); + if (!displayName) { + displayName = t('files', name); } - } - var filteredActions = {}; - $.each(actions, function (name, action) { - if (action.permissions & permissions) { - filteredActions[name] = action; + this.actions[mime][name]['action'] = action; + this.actions[mime][name]['permissions'] = permissions; + this.actions[mime][name]['displayName'] = displayName; + this.icons[name] = icon; + }, + clear: function() { + this.actions = {}; + this.defaults = {}; + this.icons = {}; + this.currentFile = null; + }, + setDefault: function (mime, name) { + this.defaults[mime] = name; + }, + get: function (mime, type, permissions) { + var actions = this.getActions(mime, type, permissions); + var filteredActions = {}; + $.each(actions, function (name, action) { + filteredActions[name] = action.action; + }); + return filteredActions; + }, + getActions: function (mime, type, permissions) { + var actions = {}; + if (this.actions.all) { + actions = $.extend(actions, this.actions.all); } - }); - return filteredActions; - }, - getDefault: function (mime, type, permissions) { - var mimePart; - if (mime) { - mimePart = mime.substr(0, mime.indexOf('/')); - } - var name = false; - if (mime && FileActions.defaults[mime]) { - name = FileActions.defaults[mime]; - } else if (mime && FileActions.defaults[mimePart]) { - name = FileActions.defaults[mimePart]; - } else if (type && FileActions.defaults[type]) { - name = FileActions.defaults[type]; - } else { - name = FileActions.defaults.all; - } - var actions = this.get(mime, type, permissions); - return actions[name]; - }, - /** - * Display file actions for the given element - * @param parent "td" element of the file for which to display actions - * @param triggerEvent if true, triggers the fileActionsReady on the file - * list afterwards (false by default) - */ - display: function (parent, triggerEvent) { - FileActions.currentFile = parent; - var actions = FileActions.getActions(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions()); - var file = FileActions.getCurrentFile(); - var nameLinks; - if (FileList.findFileEl(file).data('renaming')) { - return; - } + if (type) {//type is 'dir' or 'file' + if (this.actions[type]) { + actions = $.extend(actions, this.actions[type]); + } + } + if (mime) { + var mimePart = mime.substr(0, mime.indexOf('/')); + if (this.actions[mimePart]) { + actions = $.extend(actions, this.actions[mimePart]); + } + if (this.actions[mime]) { + actions = $.extend(actions, this.actions[mime]); + } + } + var filteredActions = {}; + $.each(actions, function (name, action) { + if (action.permissions & permissions) { + filteredActions[name] = action; + } + }); + return filteredActions; + }, + getDefault: function (mime, type, permissions) { + var mimePart; + if (mime) { + mimePart = mime.substr(0, mime.indexOf('/')); + } + var name = false; + if (mime && this.defaults[mime]) { + name = this.defaults[mime]; + } else if (mime && this.defaults[mimePart]) { + name = this.defaults[mimePart]; + } else if (type && this.defaults[type]) { + name = this.defaults[type]; + } else { + name = this.defaults.all; + } + var actions = this.get(mime, type, permissions); + return actions[name]; + }, + /** + * Display file actions for the given element + * @param parent "td" element of the file for which to display actions + * @param triggerEvent if true, triggers the fileActionsReady on the file + * list afterwards (false by default) + */ + display: function (parent, triggerEvent) { + this.currentFile = parent; + var self = this; + var actions = this.getActions(this.getCurrentMimeType(), this.getCurrentType(), this.getCurrentPermissions()); + var file = this.getCurrentFile(); + var nameLinks; + if (parent.closest('tr').data('renaming')) { + return; + } + + // recreate fileactions + nameLinks = parent.children('a.name'); + nameLinks.find('.fileactions, .nametext .action').remove(); + nameLinks.append(''); + var defaultAction = this.getDefault(this.getCurrentMimeType(), this.getCurrentType(), this.getCurrentPermissions()); - // recreate fileactions - nameLinks = parent.children('a.name'); - nameLinks.find('.fileactions, .nametext .action').remove(); - nameLinks.append(''); - var defaultAction = FileActions.getDefault(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions()); + var actionHandler = function (event) { + event.stopPropagation(); + event.preventDefault(); - var actionHandler = function (event) { - event.stopPropagation(); - event.preventDefault(); + self.currentFile = event.data.elem; + var file = self.getCurrentFile(); - FileActions.currentFile = event.data.elem; - var file = FileActions.getCurrentFile(); + event.data.actionFunc(file); + }; - event.data.actionFunc(file); - }; + var addAction = function (name, action, displayName) { - var addAction = function (name, action, displayName) { + if ((name === 'Download' || action !== defaultAction) && name !== 'Delete') { - if ((name === 'Download' || action !== defaultAction) && name !== 'Delete') { + var img = self.icons[name], + actionText = displayName, + actionContainer = 'a.name>span.fileactions'; - var img = FileActions.icons[name], - actionText = displayName, - actionContainer = 'a.name>span.fileactions'; + if (name === 'Rename') { + // rename has only an icon which appears behind + // the file name + actionText = ''; + actionContainer = 'a.name span.nametext'; + } + if (img.call) { + img = img(file); + } + var html = ''; + if (img) { + html += ''; + } + html += ' ' + actionText + ''; - if (name === 'Rename') { - // rename has only an icon which appears behind - // the file name - actionText = ''; - actionContainer = 'a.name span.nametext'; + var element = $(html); + element.data('action', name); + element.on('click', {a: null, elem: parent, actionFunc: actions[name].action}, actionHandler); + parent.find(actionContainer).append(element); } + + }; + + $.each(actions, function (name, action) { + if (name !== 'Share') { + displayName = action.displayName; + ah = action.action; + + addAction(name, ah, displayName); + } + }); + if(actions.Share){ + displayName = t('files', 'Share'); + addAction('Share', actions.Share, displayName); + } + + // remove the existing delete action + parent.parent().children().last().find('.action.delete').remove(); + if (actions['Delete']) { + var img = self.icons['Delete']; + var html; if (img.call) { img = img(file); } - var html = ''; - if (img) { - html += ''; + if (typeof trashBinApp !== 'undefined' && trashBinApp) { + html = ''; + } else { + html = ''; } - html += ' ' + actionText + ''; - var element = $(html); - element.data('action', name); - element.on('click', {a: null, elem: parent, actionFunc: actions[name].action}, actionHandler); - parent.find(actionContainer).append(element); + element.data('action', actions['Delete']); + element.on('click', {a: null, elem: parent, actionFunc: actions['Delete'].action}, actionHandler); + parent.parent().children().last().append(element); } - }; + if (triggerEvent){ + $('#fileList').trigger(jQuery.Event("fileActionsReady")); + } + }, + getCurrentFile: function () { + return this.currentFile.parent().attr('data-file'); + }, + getCurrentMimeType: function () { + return this.currentFile.parent().attr('data-mime'); + }, + getCurrentType: function () { + return this.currentFile.parent().attr('data-type'); + }, + getCurrentPermissions: function () { + return this.currentFile.parent().data('permissions'); + }, - $.each(actions, function (name, action) { - if (name !== 'Share') { - displayName = action.displayName; - ah = action.action; + /** + * Register the actions that are used by default for the files app. + */ + registerDefaultActions: function(fileList) { + // TODO: try to find a way to not make it depend on fileList, + // maybe get a handler or listener to trigger events on + this.register('all', 'Delete', OC.PERMISSION_DELETE, function () { + return OC.imagePath('core', 'actions/delete'); + }, function (filename) { + fileList.do_delete(filename); + $('.tipsy').remove(); + }); - addAction(name, ah, displayName); - } - }); - if(actions.Share){ - displayName = t('files', 'Share'); - addAction('Share', actions.Share, displayName); - } + // t('files', 'Rename') + this.register('all', 'Rename', OC.PERMISSION_UPDATE, function () { + return OC.imagePath('core', 'actions/rename'); + }, function (filename) { + fileList.rename(filename); + }); - // remove the existing delete action - parent.parent().children().last().find('.action.delete').remove(); - if (actions['Delete']) { - var img = FileActions.icons['Delete']; - var html; - if (img.call) { - img = img(file); - } - if (typeof trashBinApp !== 'undefined' && trashBinApp) { - html = ''; + this.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename) { + var dir = fileList.getCurrentDirectory(); + if (dir !== '/') { + dir = dir + '/'; + } + fileList.changeDirectory(dir + filename); + }); + + this.setDefault('dir', 'Open'); + var downloadScope; + if ($('#allowZipDownload').val() == 1) { + downloadScope = 'all'; } else { - html = ''; + downloadScope = 'file'; } - var element = $(html); - element.data('action', actions['Delete']); - element.on('click', {a: null, elem: parent, actionFunc: actions['Delete'].action}, actionHandler); - parent.parent().children().last().append(element); - } - if (triggerEvent){ - $('#fileList').trigger(jQuery.Event("fileActionsReady")); + this.register(downloadScope, 'Download', OC.PERMISSION_READ, function () { + return OC.imagePath('core', 'actions/download'); + }, function (filename) { + var url = OCA.Files.Files.getDownloadUrl(filename, fileList.getCurrentDirectory()); + if (url) { + OC.redirect(url); + } + }); + + fileList.$fileList.trigger(jQuery.Event("fileActionsReady")); } - }, - getCurrentFile: function () { - return FileActions.currentFile.parent().attr('data-file'); - }, - getCurrentMimeType: function () { - return FileActions.currentFile.parent().attr('data-mime'); - }, - getCurrentType: function () { - return FileActions.currentFile.parent().attr('data-type'); - }, - getCurrentPermissions: function () { - return FileActions.currentFile.parent().data('permissions'); - } -}; - -$(document).ready(function () { - var downloadScope; - if ($('#allowZipDownload').val() == 1) { - downloadScope = 'all'; - } else { - downloadScope = 'file'; - } - - if (typeof disableDownloadActions == 'undefined' || !disableDownloadActions) { - FileActions.register(downloadScope, 'Download', OC.PERMISSION_READ, function () { - return OC.imagePath('core', 'actions/download'); - }, function (filename) { - var url = Files.getDownloadUrl(filename); - if (url) { - OC.redirect(url); - } - }); - } - $('#fileList tr').each(function () { - FileActions.display($(this).children('td.filename')); - }); - - $('#fileList').trigger(jQuery.Event("fileActionsReady")); - -}); - -FileActions.register('all', 'Delete', OC.PERMISSION_DELETE, function () { - return OC.imagePath('core', 'actions/delete'); -}, function (filename) { - FileList.do_delete(filename); - $('.tipsy').remove(); -}); - -// t('files', 'Rename') -FileActions.register('all', 'Rename', OC.PERMISSION_UPDATE, function () { - return OC.imagePath('core', 'actions/rename'); -}, function (filename) { - FileList.rename(filename); -}); - -FileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename) { - var dir = $('#dir').val() || '/'; - if (dir !== '/') { - dir = dir + '/'; - } - FileList.changeDirectory(dir + filename); -}); - -FileActions.setDefault('dir', 'Open'); + }; + + OCA.Files.FileActions = FileActions; +})(); + +// for backward compatibility +window.FileActions = OCA.Files.FileActions; + diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index c33b638b5a6520cdc98cdda4fd2a0318da725806..38766e2b80128357a86c4403ce0488f70f84f00c 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -8,1259 +8,1770 @@ * */ -/* global OC, t, n, FileList, FileActions, Files, BreadCrumb */ -/* global procesSelection, dragOptions, folderDropOptions */ -window.FileList = { - appName: t('files', 'Files'), - isEmpty: true, - useUndo:true, - $el: $('#filestable'), - $fileList: $('#fileList'), - breadcrumb: null, - initialized: false, - +(function() { /** - * Initialize the file list and its components + * The FileList class manages a file list view. + * A file list view consists of a controls bar and + * a file list table. */ - initialize: function() { - var self = this; - if (this.initialized) { - return; - } + var FileList = function($el, options) { + this.initialize($el, options); + }; + FileList.prototype = { + SORT_INDICATOR_ASC_CLASS: 'icon-triangle-s', + SORT_INDICATOR_DESC_CLASS: 'icon-triangle-n', + + id: 'files', + appName: t('files', 'Files'), + isEmpty: true, + useUndo:true, + + /** + * Top-level container with controls and file list + */ + $el: null, + + /** + * Files table + */ + $table: null, + + /** + * List of rows (table tbody) + */ + $fileList: null, + + breadcrumb: null, + + /** + * Instance of FileSummary + */ + fileSummary: null, + initialized: false, + + // number of files per page + pageSize: 20, + + /** + * Array of files in the current folder. + * The entries are of file data. + */ + files: [], + + /** + * File actions handler, defaults to OCA.Files.FileActions + */ + fileActions: null, + + /** + * Map of file id to file data + */ + _selectedFiles: {}, + + /** + * Summary of selected files. + * Instance of FileSummary. + */ + _selectionSummary: null, + + /** + * Sort attribute + */ + _sort: 'name', + + /** + * Sort direction: 'asc' or 'desc' + */ + _sortDirection: 'asc', + + /** + * Sort comparator function for the current sort + */ + _sortComparator: null, + + /** + * Current directory + */ + _currentDirectory: null, + + _dragOptions: null, + _folderDropOptions: null, + + /** + * Initialize the file list and its components + * + * @param $el container element with existing markup for the #controls + * and a table + * @param options map of options, see other parameters + * @param scrollContainer scrollable container, defaults to $(window) + * @param dragOptions drag options, disabled by default + * @param folderDropOptions folder drop options, disabled by default + */ + initialize: function($el, options) { + var self = this; + options = options || {}; + if (this.initialized) { + return; + } + + if (options.dragOptions) { + this._dragOptions = options.dragOptions; + } + if (options.folderDropOptions) { + this._folderDropOptions = options.folderDropOptions; + } - // TODO: FileList should not know about global elements - this.$el = $('#filestable'); - this.$fileList = $('#fileList'); + this.$el = $el; + this.$container = options.scrollContainer || $(window); + this.$table = $el.find('table:first'); + this.$fileList = $el.find('#fileList'); + this.fileActions = OCA.Files.FileActions; + this.files = []; + this._selectedFiles = {}; + this._selectionSummary = new OCA.Files.FileSummary(); - this.breadcrumb = new BreadCrumb({ - onClick: this._onClickBreadCrumb, - onDrop: this._onDropOnBreadCrumb, - getCrumbUrl: function(part, index) { - return self.linkTo(part.dir); + this.fileSummary = this._createSummary(); + + this.setSort('name', 'asc'); + + var breadcrumbOptions = { + onClick: _.bind(this._onClickBreadCrumb, this), + getCrumbUrl: function(part) { + return self.linkTo(part.dir); + } + }; + // if dropping on folders is allowed, then also allow on breadcrumbs + if (this._folderDropOptions) { + breadcrumbOptions.onDrop = _.bind(this._onDropOnBreadCrumb, this); } - }); + this.breadcrumb = new OCA.Files.BreadCrumb(breadcrumbOptions); - $('#controls').prepend(this.breadcrumb.$el); + this.$el.find('#controls').prepend(this.breadcrumb.$el); - $(window).resize(function() { - // TODO: debounce this ? - var width = $(this).width(); - FileList.breadcrumb.resize(width, false); - }); - }, + this.$el.find('thead th .columntitle').click(_.bind(this._onClickHeader, this)); - /** - * Event handler when clicking on a bread crumb - */ - _onClickBreadCrumb: function(e) { - var $el = $(e.target).closest('.crumb'), - $targetDir = $el.data('dir'); + $(window).resize(function() { + // TODO: debounce this ? + var width = $(this).width(); + self.breadcrumb.resize(width, false); + }); - if ($targetDir !== undefined) { - e.preventDefault(); - FileList.changeDirectory($targetDir); - } - }, + this.$fileList.on('click','td.filename>a.name', _.bind(this._onClickFile, this)); + this.$fileList.on('change', 'td.filename>input:checkbox', _.bind(this._onClickFileCheckbox, this)); + this.$el.on('urlChanged', _.bind(this._onUrlChanged, this)); + this.$el.find('.select-all').click(_.bind(this._onClickSelectAll, this)); + this.$el.find('.download').click(_.bind(this._onClickDownloadSelected, this)); + this.$el.find('.delete-selected').click(_.bind(this._onClickDeleteSelected, this)); - /** - * Event handler when dropping on a breadcrumb - */ - _onDropOnBreadCrumb: function( event, ui ) { - var target=$(this).data('dir'); - var dir = FileList.getCurrentDirectory(); - while(dir.substr(0,1) === '/') {//remove extra leading /'s - dir=dir.substr(1); - } - dir = '/' + dir; - if (dir.substr(-1,1) !== '/') { - dir = dir + '/'; - } - if (target === dir || target+'/' === dir) { - return; - } - var files = ui.helper.find('tr'); - $(files).each(function(i,row) { - var dir = $(row).data('dir'); - var file = $(row).data('filename'); - //slapdash selector, tracking down our original element that the clone budded off of. - var origin = $('tr[data-id=' + $(row).data('origin') + ']'); - var td = origin.children('td.filename'); - var oldBackgroundImage = td.css('background-image'); - td.css('background-image', 'url('+ OC.imagePath('core', 'loading.gif') + ')'); - $.post(OC.filePath('files', 'ajax', 'move.php'), { dir: dir, file: file, target: target }, function(result) { - if (result) { - if (result.status === 'success') { - FileList.remove(file); - procesSelection(); - $('#notification').hide(); - } else { - $('#notification').hide(); - $('#notification').text(result.data.message); - $('#notification').fadeIn(); + this.setupUploadEvents(); + + this.$container.on('scroll', _.bind(this._onScroll, this)); + }, + + /** + * Event handler for when the URL changed + */ + _onUrlChanged: function(e) { + if (e && e.dir) { + this.changeDirectory(e.dir, false, true); + } + }, + + /** + * Selected/deselects the given file element and updated + * the internal selection cache. + * + * @param $tr single file row element + * @param state true to select, false to deselect + */ + _selectFileEl: function($tr, state) { + var $checkbox = $tr.find('td.filename>input:checkbox'); + var oldData = !!this._selectedFiles[$tr.data('id')]; + var data; + $checkbox.prop('checked', state); + $tr.toggleClass('selected', state); + // already selected ? + if (state === oldData) { + return; + } + data = this.elementToFile($tr); + if (state) { + this._selectedFiles[$tr.data('id')] = data; + this._selectionSummary.add(data); + } + else { + delete this._selectedFiles[$tr.data('id')]; + this._selectionSummary.remove(data); + } + this.$el.find('.select-all').prop('checked', this._selectionSummary.getTotal() === this.files.length); + }, + + /** + * Event handler for when clicking on files to select them + */ + _onClickFile: function(event) { + var $tr = $(event.target).closest('tr'); + if (event.ctrlKey || event.shiftKey) { + event.preventDefault(); + if (event.shiftKey) { + var $lastTr = $(this._lastChecked); + var lastIndex = $lastTr.index(); + var currentIndex = $tr.index(); + var $rows = this.$fileList.children('tr'); + + // last clicked checkbox below current one ? + if (lastIndex > currentIndex) { + var aux = lastIndex; + lastIndex = currentIndex; + currentIndex = aux; + } + + // auto-select everything in-between + for (var i = lastIndex + 1; i < currentIndex; i++) { + this._selectFileEl($rows.eq(i), true); } - } else { - OC.dialogs.alert(t('files', 'Error moving file'), t('files', 'Error')); } - td.css('background-image', oldBackgroundImage); - }); - }); - }, + else { + this._lastChecked = $tr; + } + var $checkbox = $tr.find('td.filename>input:checkbox'); + this._selectFileEl($tr, !$checkbox.prop('checked')); + this.updateSelectionSummary(); + } else { + var filename = $tr.attr('data-file'); + var renaming = $tr.data('renaming'); + if (!renaming) { + this.fileActions.currentFile = $tr.find('td'); + var mime = this.fileActions.getCurrentMimeType(); + var type = this.fileActions.getCurrentType(); + var permissions = this.fileActions.getCurrentPermissions(); + var action = this.fileActions.getDefault(mime,type, permissions); + if (action) { + event.preventDefault(); + action(filename); + } + } + } + }, + + /** + * Event handler for when clicking on a file's checkbox + */ + _onClickFileCheckbox: function(e) { + var $tr = $(e.target).closest('tr'); + this._selectFileEl($tr, !$tr.hasClass('selected')); + this._lastChecked = $tr; + this.updateSelectionSummary(); + }, + + /** + * Event handler for when selecting/deselecting all files + */ + _onClickSelectAll: function(e) { + var checked = $(e.target).prop('checked'); + this.$fileList.find('td.filename>input:checkbox').prop('checked', checked) + .closest('tr').toggleClass('selected', checked); + this._selectedFiles = {}; + this._selectionSummary.clear(); + if (checked) { + for (var i = 0; i < this.files.length; i++) { + var fileData = this.files[i]; + this._selectedFiles[fileData.id] = fileData; + this._selectionSummary.add(fileData); + } + } + this.updateSelectionSummary(); + }, + + /** + * Event handler for when clicking on "Download" for the selected files + */ + _onClickDownloadSelected: function(event) { + var files; + var dir = this.getCurrentDirectory(); + if (this.isAllSelected()) { + files = OC.basename(dir); + dir = OC.dirname(dir) || '/'; + } + else { + files = _.pluck(this.getSelectedFiles(), 'name'); + } + OC.Notification.show(t('files','Your download is being prepared. This might take some time if the files are big.')); + OC.redirect(this.getDownloadUrl(files, dir)); + return false; + }, + + /** + * Event handler for when clicking on "Delete" for the selected files + */ + _onClickDeleteSelected: function(event) { + var files = null; + if (!this.isAllSelected()) { + files = _.pluck(this.getSelectedFiles(), 'name'); + } + this.do_delete(files); + event.preventDefault(); + return false; + }, + + /** + * Event handler when clicking on a table header + */ + _onClickHeader: function(e) { + var $target = $(e.target); + var sort; + if (!$target.is('a')) { + $target = $target.closest('a'); + } + sort = $target.attr('data-sort'); + if (sort) { + if (this._sort === sort) { + this.setSort(sort, (this._sortDirection === 'desc')?'asc':'desc'); + } + else { + this.setSort(sort, 'asc'); + } + this.reload(); + } + }, + + /** + * Event handler when clicking on a bread crumb + */ + _onClickBreadCrumb: function(e) { + var $el = $(e.target).closest('.crumb'), + $targetDir = $el.data('dir'); + + if ($targetDir !== undefined) { + e.preventDefault(); + this.changeDirectory($targetDir); + } + }, + + /** + * Event handler for when scrolling the list container. + * This appends/renders the next page of entries when reaching the bottom. + */ + _onScroll: function(e) { + if (this.$container.scrollTop() + this.$container.height() > this.$el.height() - 100) { + this._nextPage(true); + } + }, + + /** + * Event handler when dropping on a breadcrumb + */ + _onDropOnBreadCrumb: function( event, ui ) { + var $target = $(event.target); + if (!$target.is('.crumb')) { + $target = $target.closest('.crumb'); + } + var targetPath = $(event.target).data('dir'); + var dir = this.getCurrentDirectory(); + while (dir.substr(0,1) === '/') {//remove extra leading /'s + dir = dir.substr(1); + } + dir = '/' + dir; + if (dir.substr(-1,1) !== '/') { + dir = dir + '/'; + } + // do nothing if dragged on current dir + if (targetPath === dir || targetPath + '/' === dir) { + return; + } - /** - * Sets a new page title - */ - setPageTitle: function(title){ - if (title) { - title += ' - '; - } else { - title = ''; - } - title += FileList.appName; - // Sets the page title with the " - ownCloud" suffix as in templates - window.document.title = title + ' - ' + oc_defaults.title; + var files = this.getSelectedFiles(); + if (files.length === 0) { + // single one selected without checkbox? + files = _.map(ui.helper.find('tr'), this.elementToFile); + } - return true; - }, - /** - * Returns the tr element for a given file name - * @param fileName file name - */ - findFileEl: function(fileName){ - // use filterAttr to avoid escaping issues - return this.$fileList.find('tr').filterAttr('data-file', fileName); - }, - /** - * Sets the files to be displayed in the list. - * This operation will rerender the list and update the summary. - * @param filesArray array of file data (map) - */ - setFiles:function(filesArray) { - // detach to make adding multiple rows faster - this.$fileList.detach(); + this.move(_.pluck(files, 'name'), targetPath); + }, - this.$fileList.empty(); + /** + * Sets a new page title + */ + setPageTitle: function(title){ + if (title) { + title += ' - '; + } else { + title = ''; + } + title += this.appName; + // Sets the page title with the " - ownCloud" suffix as in templates + window.document.title = title + ' - ' + oc_defaults.title; - this.isEmpty = filesArray.length === 0; - for (var i = 0; i < filesArray.length; i++) { - this.add(filesArray[i], {updateSummary: false}); - } + return true; + }, + /** + * Returns the tr element for a given file name + * @param fileName file name + */ + findFileEl: function(fileName){ + // use filterAttr to avoid escaping issues + return this.$fileList.find('tr').filterAttr('data-file', fileName); + }, + + /** + * Returns the file data from a given file element. + * @param $el file tr element + * @return file data + */ + elementToFile: function($el){ + $el = $($el); + return { + id: parseInt($el.attr('data-id'), 10), + name: $el.attr('data-file'), + mimetype: $el.attr('data-mime'), + type: $el.attr('data-type'), + size: parseInt($el.attr('data-size'), 10), + etag: $el.attr('data-etag') + }; + }, + + /** + * Appends the next page of files into the table + * @param animate true to animate the new elements + */ + _nextPage: function(animate) { + var index = this.$fileList.children().length, + count = this.pageSize, + tr, + fileData, + newTrs = [], + isAllSelected = this.isAllSelected(); + + if (index >= this.files.length) { + return; + } - this.$el.find('thead').after(this.$fileList); + while (count > 0 && index < this.files.length) { + fileData = this.files[index]; + tr = this._renderRow(fileData, {updateSummary: false}); + this.$fileList.append(tr); + if (isAllSelected || this._selectedFiles[fileData.id]) { + tr.addClass('selected'); + tr.find('input:checkbox').prop('checked', true); + } + if (animate) { + tr.addClass('appear transparent'); + newTrs.push(tr); + } + index++; + count--; + } - this.updateEmptyContent(); - this.$fileList.trigger(jQuery.Event("fileActionsReady")); - // "Files" might not be loaded in extending apps - if (window.Files) { - Files.setupDragAndDrop(); - } - this.updateFileSummary(); - procesSelection(); - $(window).scrollTop(0); + if (animate) { + // defer, for animation + window.setTimeout(function() { + for (var i = 0; i < newTrs.length; i++ ) { + newTrs[i].removeClass('transparent'); + } + }, 0); + } + }, - this.$fileList.trigger(jQuery.Event("updated")); - }, - /** - * Creates a new table row element using the given file data. - * @param fileData map of file attributes - * @param options map of attribute "loading" whether the entry is currently loading - * @return new tr element (not appended to the table) - */ - _createRow: function(fileData, options) { - var td, simpleSize, basename, extension, sizeColor, - icon = OC.Util.replaceSVGIcon(fileData.icon), - name = fileData.name, - type = fileData.type || 'file', - mtime = parseInt(fileData.mtime, 10) || new Date().getTime(), - mime = fileData.mimetype, - linkUrl; - options = options || {}; - - if (type === 'dir') { - mime = mime || 'httpd/unix-directory'; - } + /** + * Sets the files to be displayed in the list. + * This operation will re-render the list and update the summary. + * @param filesArray array of file data (map) + */ + setFiles: function(filesArray) { + // detach to make adding multiple rows faster + this.files = filesArray; - // user should always be able to rename a share mount point - var allowRename = 0; - if (fileData.isShareMountPoint) { - allowRename = OC.PERMISSION_UPDATE; - } + this.$fileList.detach(); + this.$fileList.empty(); - //containing tr - var tr = $('').attr({ - "data-id" : fileData.id, - "data-type": type, - "data-size": fileData.size, - "data-file": name, - "data-mime": mime, - "data-mtime": mtime, - "data-etag": fileData.etag, - "data-permissions": fileData.permissions | allowRename || this.getDirectoryPermissions() - }); - - if (type === 'dir') { - // use default folder icon - icon = icon || OC.imagePath('core', 'filetypes/folder'); - } - else { - icon = icon || OC.imagePath('core', 'filetypes/file'); - } + // clear "Select all" checkbox + this.$el.find('.select-all').prop('checked', false); - // filename td - td = $('').attr({ - "class": "filename", - "style": 'background-image:url(' + icon + '); background-size: 32px;' - }); + this.isEmpty = this.files.length === 0; + this._nextPage(); - // linkUrl - if (type === 'dir') { - linkUrl = FileList.linkTo(FileList.getCurrentDirectory() + '/' + name); - } - else { - linkUrl = Files.getDownloadUrl(name, FileList.getCurrentDirectory()); - } - td.append(''); - var linkElem = $('').attr({ - "class": "name", - "href": linkUrl - }); - - // from here work on the display name - name = fileData.displayName || name; - - // split extension from filename for non dirs - if (type !== 'dir' && name.indexOf('.') !== -1) { - basename = name.substr(0, name.lastIndexOf('.')); - extension = name.substr(name.lastIndexOf('.')); - } else { - basename = name; - extension = false; - } - var nameSpan=$('').addClass('nametext').text(basename); - linkElem.append(nameSpan); - if (extension) { - nameSpan.append($('').addClass('extension').text(extension)); - } - // dirs can show the number of uploaded files - if (type === 'dir') { - linkElem.append($('').attr({ - 'class': 'uploadtext', - 'currentUploads': 0 - })); - } - td.append(linkElem); - tr.append(td); - - // size column - if (typeof(fileData.size) !== 'undefined' && fileData.size >= 0) { - simpleSize = humanFileSize(parseInt(fileData.size, 10)); - sizeColor = Math.round(160-Math.pow((fileData.size/(1024*1024)),2)); - } else { - simpleSize = t('files', 'Pending'); - } + this.$el.find('thead').after(this.$fileList); - td = $('').attr({ - "class": "filesize", - "style": 'color:rgb(' + sizeColor + ',' + sizeColor + ',' + sizeColor + ')' - }).text(simpleSize); - tr.append(td); - - // date column - var modifiedColor = Math.round((Math.round((new Date()).getTime() / 1000) - mtime)/60/60/24*5); - td = $('').attr({ "class": "date" }); - td.append($('').attr({ - "class": "modified", - "title": formatDate(mtime), - "style": 'color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')' - }).text( relative_modified_date(mtime / 1000) )); - tr.find('.filesize').text(simpleSize); - tr.append(td); - return tr; - }, - /** - * Adds an entry to the files table using the data from the given file data - * @param fileData map of file attributes - * @param options map of attributes: - * - "insert" true to insert in a sorted manner, false to append (default) - * - "updateSummary" true to update the summary after adding (default), false otherwise - * @return new tr element (not appended to the table) - */ - add: function(fileData, options) { - options = options || {}; - var type = fileData.type || 'file', - mime = fileData.mimetype, - permissions = parseInt(fileData.permissions, 10) || 0; - - if (fileData.isShareMountPoint) { - permissions = permissions | OC.PERMISSION_UPDATE; - } + this.updateEmptyContent(); + this.$fileList.trigger(jQuery.Event("fileActionsReady")); + + this.fileSummary.calculate(filesArray); + + this.updateSelectionSummary(); + $(window).scrollTop(0); + + this.$fileList.trigger(jQuery.Event("updated")); + }, + /** + * Creates a new table row element using the given file data. + * @param fileData map of file attributes + * @param options map of attribute "loading" whether the entry is currently loading + * @return new tr element (not appended to the table) + */ + _createRow: function(fileData, options) { + var td, simpleSize, basename, extension, sizeColor, + icon = OC.Util.replaceSVGIcon(fileData.icon), + name = fileData.name, + type = fileData.type || 'file', + mtime = parseInt(fileData.mtime, 10) || new Date().getTime(), + mime = fileData.mimetype, + linkUrl; + options = options || {}; + + if (type === 'dir') { + mime = mime || 'httpd/unix-directory'; + } - if (type === 'dir') { - mime = mime || 'httpd/unix-directory'; - } - var tr = this._createRow( - fileData, - options - ); - var filenameTd = tr.find('td.filename'); - - // sorted insert is expensive, so needs to be explicitly - // requested - if (options.insert) { - this.insertElement(fileData.name, type, tr); - } - else { - this.$fileList.append(tr); - } - FileList.isEmpty = false; + // user should always be able to rename a share mount point + var allowRename = 0; + if (fileData.isShareMountPoint) { + allowRename = OC.PERMISSION_UPDATE; + } - // TODO: move dragging to FileActions ? - // enable drag only for deletable files - if (permissions & OC.PERMISSION_DELETE) { - filenameTd.draggable(dragOptions); - } - // allow dropping on folders - if (fileData.type === 'dir') { - filenameTd.droppable(folderDropOptions); - } + //containing tr + var tr = $('').attr({ + "data-id" : fileData.id, + "data-type": type, + "data-size": fileData.size, + "data-file": name, + "data-mime": mime, + "data-mtime": mtime, + "data-etag": fileData.etag, + "data-permissions": fileData.permissions | allowRename || this.getDirectoryPermissions() + }); - if (options.hidden) { - tr.addClass('hidden'); - } + if (type === 'dir') { + // use default folder icon + icon = icon || OC.imagePath('core', 'filetypes/folder'); + } + else { + icon = icon || OC.imagePath('core', 'filetypes/file'); + } - // display actions - FileActions.display(filenameTd, false); + // filename td + td = $('').attr({ + "class": "filename", + "style": 'background-image:url(' + icon + '); background-size: 32px;' + }); - if (fileData.isPreviewAvailable) { - // lazy load / newly inserted td ? - if (!fileData.icon) { - Files.lazyLoadPreview(getPathForPreview(fileData.name), mime, function(url) { - filenameTd.css('background-image', 'url(' + url + ')'); - }, null, null, fileData.etag); + // linkUrl + if (type === 'dir') { + linkUrl = this.linkTo(this.getCurrentDirectory() + '/' + name); } else { - // set the preview URL directly - var urlSpec = { - file: FileList.getCurrentDirectory() + '/' + fileData.name, - c: fileData.etag - }; - var previewUrl = Files.generatePreviewUrl(urlSpec); - previewUrl = previewUrl.replace('(', '%28').replace(')', '%29'); - filenameTd.css('background-image', 'url(' + previewUrl + ')'); + linkUrl = this.getDownloadUrl(name, this.getCurrentDirectory()); } - } + td.append(''); + var linkElem = $('').attr({ + "class": "name", + "href": linkUrl + }); - // defaults to true if not defined - if (typeof(options.updateSummary) === 'undefined' || !!options.updateSummary) { - this.updateFileSummary(); - this.updateEmptyContent(); - } - return tr; - }, - /** - * Returns the current directory - * @return current directory - */ - getCurrentDirectory: function(){ - return $('#dir').val() || '/'; - }, - /** - * Returns the directory permissions - * @return permission value as integer - */ - getDirectoryPermissions: function() { - return parseInt($('#permissions').val(), 10); - }, - /** - * @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) - * @param {boolean} force set to true to force changing directory - */ - changeDirectory: function(targetDir, changeUrl, force) { - var $dir = $('#dir'), - url, - currentDir = $dir.val() || '/'; - targetDir = targetDir || '/'; - if (!force && currentDir === targetDir) { - return; - } - FileList._setCurrentDir(targetDir, changeUrl); - $('#fileList').trigger( - jQuery.Event('changeDirectory', { - dir: targetDir, - previousDir: currentDir - } - )); - FileList.reload(); - }, - linkTo: function(dir) { - return OC.linkTo('files', 'index.php')+"?dir="+ encodeURIComponent(dir).replace(/%2F/g, '/'); - }, + // from here work on the display name + name = fileData.displayName || name; - /** - * Sets the current directory name and updates the breadcrumb. - * @param targetDir directory to display - * @param changeUrl true to also update the URL, false otherwise (default) - */ - _setCurrentDir: function(targetDir, changeUrl) { - var url, - baseDir = OC.basename(targetDir); + // split extension from filename for non dirs + if (type !== 'dir' && name.indexOf('.') !== -1) { + basename = name.substr(0, name.lastIndexOf('.')); + extension = name.substr(name.lastIndexOf('.')); + } else { + basename = name; + extension = false; + } + var nameSpan=$('').addClass('nametext').text(basename); + linkElem.append(nameSpan); + if (extension) { + nameSpan.append($('').addClass('extension').text(extension)); + } + // dirs can show the number of uploaded files + if (type === 'dir') { + linkElem.append($('').attr({ + 'class': 'uploadtext', + 'currentUploads': 0 + })); + } + td.append(linkElem); + tr.append(td); - if (baseDir !== '') { - FileList.setPageTitle(baseDir); - } - else { - FileList.setPageTitle(); - } + // size column + if (typeof(fileData.size) !== 'undefined' && fileData.size >= 0) { + simpleSize = humanFileSize(parseInt(fileData.size, 10)); + sizeColor = Math.round(160-Math.pow((fileData.size/(1024*1024)),2)); + } else { + simpleSize = t('files', 'Pending'); + } - $('#dir').val(targetDir); - if (changeUrl !== false) { - if (window.history.pushState && changeUrl !== false) { - url = FileList.linkTo(targetDir); - window.history.pushState({dir: targetDir}, '', url); + td = $('').attr({ + "class": "filesize", + "style": 'color:rgb(' + sizeColor + ',' + sizeColor + ',' + sizeColor + ')' + }).text(simpleSize); + tr.append(td); + + // date column + var modifiedColor = Math.round((Math.round((new Date()).getTime() / 1000) - mtime)/60/60/24*5); + td = $('').attr({ "class": "date" }); + td.append($('').attr({ + "class": "modified", + "title": formatDate(mtime), + "style": 'color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')' + }).text( relative_modified_date(mtime / 1000) )); + tr.find('.filesize').text(simpleSize); + tr.append(td); + return tr; + }, + + /** + * Adds an entry to the files array and also into the DOM + * in a sorted manner. + * + * @param fileData map of file attributes + * @param options map of attributes: + * - "updateSummary" true to update the summary after adding (default), false otherwise + * @return new tr element (not appended to the table) + */ + add: function(fileData, options) { + var index = -1; + var $tr; + var $rows; + var $insertionPoint; + options = options || {}; + + // there are three situations to cover: + // 1) insertion point is visible on the current page + // 2) insertion point is on a not visible page (visible after scrolling) + // 3) insertion point is at the end of the list + + $rows = this.$fileList.children(); + index = this._findInsertionIndex(fileData); + if (index > this.files.length) { + index = this.files.length; } - // use URL hash for IE8 - else{ - window.location.hash = '?dir='+ encodeURIComponent(targetDir).replace(/%2F/g, '/'); + else { + $insertionPoint = $rows.eq(index); } - } - this.breadcrumb.setDirectory(this.getCurrentDirectory()); - }, - /** - * @brief Reloads the file list using ajax call - */ - reload: function() { - FileList.showMask(); - if (FileList._reloadCall) { - FileList._reloadCall.abort(); - } - FileList._reloadCall = $.ajax({ - url: Files.getAjaxUrl('list'), - data: { - dir : $('#dir').val() - }, - error: function(result) { - FileList.reloadCallback(result); - }, - success: function(result) { - FileList.reloadCallback(result); - } - }); - }, - reloadCallback: function(result) { - delete this._reloadCall; - this.hideMask(); - - if (!result || result.status === 'error') { - OC.Notification.show(result.data.message); - return; - } - if (result.status === 404) { - // go back home - this.changeDirectory('/'); - return; - } - // aborted ? - if (result.status === 0){ - return; - } + // is the insertion point visible ? + if ($insertionPoint.length) { + // only render if it will really be inserted + $tr = this._renderRow(fileData, options); + $insertionPoint.before($tr); + } + else { + // if insertion point is after the last visible + // entry, append + if (index === $rows.length) { + $tr = this._renderRow(fileData, options); + this.$fileList.append($tr); + } + } - // TODO: should rather return upload file size through - // the files list ajax call - Files.updateStorageStatistics(true); + this.isEmpty = false; + this.files.splice(index, 0, fileData); - if (result.data.permissions) { - this.setDirectoryPermissions(result.data.permissions); - } + if ($tr && options.animate) { + $tr.addClass('appear transparent'); + window.setTimeout(function() { + $tr.removeClass('transparent'); + }); + } - this.setFiles(result.data.files); - }, - setDirectoryPermissions: function(permissions) { - var isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0; - $('#permissions').val(permissions); - $('.creatable').toggleClass('hidden', !isCreatable); - $('.notCreatable').toggleClass('hidden', isCreatable); - }, - /** - * Shows/hides action buttons - * - * @param show true for enabling, false for disabling - */ - showActions: function(show){ - $('.actions,#file_action_panel').toggleClass('hidden', !show); - if (show){ - // make sure to display according to permissions - var permissions = this.getDirectoryPermissions(); - var isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0; - $('.creatable').toggleClass('hidden', !isCreatable); - $('.notCreatable').toggleClass('hidden', isCreatable); - // remove old style breadcrumbs (some apps might create them) - $('#controls .crumb').remove(); - // refresh breadcrumbs in case it was replaced by an app - this.breadcrumb.render(); - } - else{ - $('.creatable, .notCreatable').addClass('hidden'); - } - }, - /** - * Enables/disables viewer mode. - * In viewer mode, apps can embed themselves under the controls bar. - * In viewer mode, the actions of the file list will be hidden. - * @param show true for enabling, false for disabling - */ - setViewerMode: function(show){ - this.showActions(!show); - $('#filestable').toggleClass('hidden', show); - }, - /** - * Removes a file entry from the list - * @param name name of the file to remove - * @param options optional options as map: - * "updateSummary": true to update the summary (default), false otherwise - */ - remove:function(name, options){ - options = options || {}; - var fileEl = FileList.findFileEl(name); - if (fileEl.data('permissions') & OC.PERMISSION_DELETE) { - // file is only draggable when delete permissions are set - fileEl.find('td.filename').draggable('destroy'); - } - fileEl.remove(); - // TODO: improve performance on batch update - FileList.isEmpty = !this.$fileList.find('tr:not(.summary)').length; - if (typeof(options.updateSummary) === 'undefined' || !!options.updateSummary) { - FileList.updateEmptyContent(); - FileList.updateFileSummary(); - } - return fileEl; - }, - insertElement:function(name, type, element) { - // find the correct spot to insert the file or folder - var pos, - fileElements = this.$fileList.find('tr[data-file][data-type="'+type+'"]:not(.hidden)'); - if (name.localeCompare($(fileElements[0]).attr('data-file')) < 0) { - pos = -1; - } else if (name.localeCompare($(fileElements[fileElements.length-1]).attr('data-file')) > 0) { - pos = fileElements.length - 1; - } else { - for(pos = 0; pos 0 - && name.localeCompare($(fileElements[pos+1]).attr('data-file')) < 0) - { - break; - } + // defaults to true if not defined + if (typeof(options.updateSummary) === 'undefined' || !!options.updateSummary) { + this.fileSummary.add(fileData, true); + this.updateEmptyContent(); } - } - if (fileElements.exists()) { - if (pos === -1) { - $(fileElements[0]).before(element); - } else { - $(fileElements[pos]).after(element); - } - } else if (type === 'dir' && !FileList.isEmpty) { - this.$fileList.find('tr[data-file]:first').before(element); - } else if (type === 'file' && !FileList.isEmpty) { - this.$fileList.find('tr[data-file]:last').before(element); - } else { - this.$fileList.append(element); - } - FileList.isEmpty = false; - FileList.updateEmptyContent(); - FileList.updateFileSummary(); - }, - rename: function(oldname) { - var tr, td, input, form; - tr = FileList.findFileEl(oldname); - tr.data('renaming',true); - td = tr.children('td.filename'); - input = $('').val(oldname); - form = $('
'); - form.append(input); - td.children('a.name').hide(); - td.append(form); - input.focus(); - //preselect input - var len = input.val().lastIndexOf('.'); - if ( len === -1 || - tr.data('type') === 'dir' ) { - len = input.val().length; - } - input.selectRange(0, len); - var checkInput = function () { - var filename = input.val(); - if (filename !== oldname) { - // Files.isFileNameValid(filename) throws an exception itself - Files.isFileNameValid(filename); - if (FileList.inList(filename)) { - throw t('files', '{new_name} already exists', {new_name: filename}); - } + + return $tr; + }, + + /** + * Creates a new row element based on the given attributes + * and returns it. + * + * @param fileData map of file attributes + * @param options map of attributes: + * - "index" optional index at which to insert the element + * - "updateSummary" true to update the summary after adding (default), false otherwise + * @return new tr element (not appended to the table) + */ + _renderRow: function(fileData, options) { + options = options || {}; + var type = fileData.type || 'file', + mime = fileData.mimetype, + permissions = parseInt(fileData.permissions, 10) || 0; + + if (fileData.isShareMountPoint) { + permissions = permissions | OC.PERMISSION_UPDATE; } - return true; - }; - form.submit(function(event) { - event.stopPropagation(); - event.preventDefault(); - try { - var newname = input.val(); - var directory = FileList.getCurrentDirectory(); - if (newname !== oldname) { - checkInput(); - // save background image, because it's replaced by a spinner while async request - var oldBackgroundImage = td.css('background-image'); - // mark as loading - td.css('background-image', 'url('+ OC.imagePath('core', 'loading.gif') + ')'); - $.ajax({ - url: OC.filePath('files','ajax','rename.php'), - data: { - dir : $('#dir').val(), - newname: newname, - file: oldname - }, - success: function(result) { - if (!result || result.status === 'error') { - OC.dialogs.alert(result.data.message, t('core', 'Could not rename file')); - // revert changes - newname = oldname; - tr.attr('data-file', newname); - var path = td.children('a.name').attr('href'); - td.children('a.name').attr('href', path.replace(encodeURIComponent(oldname), encodeURIComponent(newname))); - var basename = newname; - if (newname.indexOf('.') > 0 && tr.data('type') !== 'dir') { - basename = newname.substr(0,newname.lastIndexOf('.')); - } - td.find('a.name span.nametext').text(basename); - if (newname.indexOf('.') > 0 && tr.data('type') !== 'dir') { - if ( ! td.find('a.name span.extension').exists() ) { - td.find('a.name span.nametext').append(''); - } - td.find('a.name span.extension').text(newname.substr(newname.lastIndexOf('.'))); - } - tr.find('.fileactions').effect('highlight', {}, 5000); - tr.effect('highlight', {}, 5000); - // remove loading mark and recover old image - td.css('background-image', oldBackgroundImage); - } - else { - var fileInfo = result.data; - tr.attr('data-mime', fileInfo.mime); - tr.attr('data-etag', fileInfo.etag); - if (fileInfo.isPreviewAvailable) { - Files.lazyLoadPreview(directory + '/' + fileInfo.name, result.data.mime, function(previewpath) { - tr.find('td.filename').attr('style','background-image:url('+previewpath+')'); - }, null, null, result.data.etag); - } - else { - tr.find('td.filename') - .removeClass('preview') - .attr('style','background-image:url(' - + OC.Util.replaceSVGIcon(fileInfo.icon) - + ')'); - } - } - // reinsert row - tr.detach(); - FileList.insertElement( tr.attr('data-file'), tr.attr('data-type'),tr ); - // update file actions in case the extension changed - FileActions.display( tr.find('td.filename'), true); + if (type === 'dir') { + mime = mime || 'httpd/unix-directory'; + } + var tr = this._createRow( + fileData, + options + ); + var filenameTd = tr.find('td.filename'); + + // TODO: move dragging to FileActions ? + // enable drag only for deletable files + if (this._dragOptions && permissions & OC.PERMISSION_DELETE) { + filenameTd.draggable(this._dragOptions); + } + // allow dropping on folders + if (this._folderDropOptions && fileData.type === 'dir') { + filenameTd.droppable(this._folderDropOptions); + } + + if (options.hidden) { + tr.addClass('hidden'); + } + + // display actions + this.fileActions.display(filenameTd, false); + + if (fileData.isPreviewAvailable) { + // lazy load / newly inserted td ? + if (!fileData.icon) { + this.lazyLoadPreview({ + path: this.getCurrentDirectory() + '/' + fileData.name, + mime: mime, + etag: fileData.etag, + callback: function(url) { + filenameTd.css('background-image', 'url(' + url + ')'); } }); } - input.tipsy('hide'); - tr.data('renaming',false); - tr.attr('data-file', newname); - var path = td.children('a.name').attr('href'); - // FIXME this will fail if the path contains the filename. - td.children('a.name').attr('href', path.replace(encodeURIComponent(oldname), encodeURIComponent(newname))); - var basename = newname; - if (newname.indexOf('.') > 0 && tr.data('type') !== 'dir') { - basename = newname.substr(0, newname.lastIndexOf('.')); + else { + // set the preview URL directly + var urlSpec = { + file: this.getCurrentDirectory() + '/' + fileData.name, + c: fileData.etag + }; + var previewUrl = this.generatePreviewUrl(urlSpec); + previewUrl = previewUrl.replace('(', '%28').replace(')', '%29'); + filenameTd.css('background-image', 'url(' + previewUrl + ')'); } - td.find('a.name span.nametext').text(basename); - if (newname.indexOf('.') > 0 && tr.data('type') !== 'dir') { - if ( ! td.find('a.name span.extension').exists() ) { - td.find('a.name span.nametext').append(''); - } - td.find('a.name span.extension').text(newname.substr(newname.lastIndexOf('.'))); - } - form.remove(); - FileActions.display( tr.find('td.filename'), true); - td.children('a.name').show(); - } catch (error) { - input.attr('title', error); - input.tipsy({gravity: 'w', trigger: 'manual'}); - input.tipsy('show'); - input.addClass('error'); } - return false; - }); - input.keyup(function(event) { - // verify filename on typing - try { - checkInput(); - input.tipsy('hide'); - input.removeClass('error'); - } catch (error) { - input.attr('title', error); - input.tipsy({gravity: 'w', trigger: 'manual'}); - input.tipsy('show'); - input.addClass('error'); - } - if (event.keyCode === 27) { - input.tipsy('hide'); - tr.data('renaming',false); - form.remove(); - td.children('a.name').show(); - } - }); - input.click(function(event) { - event.stopPropagation(); - event.preventDefault(); - }); - input.blur(function() { - form.trigger('submit'); - }); - }, - inList:function(file) { - return FileList.findFileEl(file).length; - }, - /** - * Delete the given files from the given dir - * @param files file names list (without path) - * @param dir directory in which to delete the files, defaults to the current - * directory - */ - do_delete:function(files, dir) { - var params; - if (files && files.substr) { - files=[files]; - } - if (files) { - for (var i=0; i'+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) - var fileSize = ''; - if (!isNaN(summary.totalSize)) { - fileSize = ''+humanFileSize(summary.totalSize)+''; + this._setCurrentDir(targetDir, changeUrl); + this.reload(); + }, + linkTo: function(dir) { + return OC.linkTo('files', 'index.php')+"?dir="+ encodeURIComponent(dir).replace(/%2F/g, '/'); + }, + + /** + * Sets the file actions handler + */ + setFileActions: function(fileActions) { + this.fileActions = fileActions; + }, + + /** + * Sets the current directory name and updates the breadcrumb. + * @param targetDir directory to display + * @param changeUrl true to also update the URL, false otherwise (default) + */ + _setCurrentDir: function(targetDir, changeUrl) { + var previousDir = this.getCurrentDirectory(), + baseDir = OC.basename(targetDir); + + if (baseDir !== '') { + this.setPageTitle(baseDir); + } + else { + this.setPageTitle(); } - var $summary = $(''+info+''+fileSize+''); - this.$fileList.append($summary); + this._currentDirectory = targetDir; - var $dirInfo = $summary.find('.dirinfo'); - var $fileInfo = $summary.find('.fileinfo'); - var $connector = $summary.find('.connector'); + // legacy stuff + this.$el.find('#dir').val(targetDir); - // Show only what's necessary, e.g.: no files: don't show "0 files" - if (summary.totalDirs === 0) { - $dirInfo.addClass('hidden'); - $connector.addClass('hidden'); + if (changeUrl !== false) { + this.$el.trigger(jQuery.Event('changeDirectory', { + dir: targetDir, + previousDir: previousDir + })); } - if (summary.totalFiles === 0) { - $fileInfo.addClass('hidden'); - $connector.addClass('hidden'); + this.breadcrumb.setDirectory(this.getCurrentDirectory()); + }, + /** + * Sets the current sorting and refreshes the list + * + * @param sort sort attribute name + * @param direction sort direction, one of "asc" or "desc" + */ + setSort: function(sort, direction) { + var comparator = FileList.Comparators[sort] || FileList.Comparators.name; + this._sort = sort; + this._sortDirection = (direction === 'desc')?'desc':'asc'; + this._sortComparator = comparator; + if (direction === 'desc') { + this._sortComparator = function(fileInfo1, fileInfo2) { + return -comparator(fileInfo1, fileInfo2); + }; } - } - }, - _calculateFileSummary: function() { - var result = { - totalDirs: 0, - totalFiles: 0, - totalSize: 0 - }; - $.each($('tr[data-file]'), function(index, value) { - var $value = $(value); - if ($value.data('type') === 'dir') { - result.totalDirs++; - } else if ($value.data('type') === 'file') { - result.totalFiles++; - } - if ($value.data('size') !== undefined && $value.data('id') !== -1) { - //Skip shared as it does not count toward quota - result.totalSize += parseInt($value.data('size')); - } - }); - return result; - }, - updateFileSummary: function() { - var $summary = this.$el.find('.summary'); - - // always make it the last element - this.$fileList.append($summary.detach()); - - // Check if we should remove the summary to show "Upload something" - if (this.isEmpty && $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 (!this.isEmpty && $summary.length === 1) { - var fileSummary = this._calculateFileSummary(); - 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', fileSummary.totalDirs)); - $fileInfo.html(n('files', '%n file', '%n files', fileSummary.totalFiles)); - $('.summary .filesize').html(humanFileSize(fileSummary.totalSize)); - - // Show only what's necessary (may be hidden) - if (fileSummary.totalDirs === 0) { - $dirInfo.addClass('hidden'); - $connector.addClass('hidden'); - } else { - $dirInfo.removeClass('hidden'); + this.$el.find('thead th .sort-indicator') + .removeClass(this.SORT_INDICATOR_ASC_CLASS + ' ' + this.SORT_INDICATOR_DESC_CLASS); + this.$el.find('thead th.column-' + sort + ' .sort-indicator') + .addClass(direction === 'desc' ? this.SORT_INDICATOR_DESC_CLASS : this.SORT_INDICATOR_ASC_CLASS); + }, + /** + * @brief Reloads the file list using ajax call + */ + reload: function() { + var self = this; + this._selectedFiles = {}; + this._selectionSummary.clear(); + this.$el.find('.select-all').prop('checked', false); + this.showMask(); + if (this._reloadCall) { + this._reloadCall.abort(); } - if (fileSummary.totalFiles === 0) { - $fileInfo.addClass('hidden'); - $connector.addClass('hidden'); - } else { - $fileInfo.removeClass('hidden'); - } - if (fileSummary.totalDirs > 0 && fileSummary.totalFiles > 0) { - $connector.removeClass('hidden'); + this._reloadCall = $.ajax({ + url: this.getAjaxUrl('list'), + data: { + dir : this.getCurrentDirectory(), + sort: this._sort, + sortdirection: this._sortDirection + }, + error: function(result) { + self.reloadCallback(result); + }, + success: function(result) { + self.reloadCallback(result); + } + }); + }, + reloadCallback: function(result) { + delete this._reloadCall; + this.hideMask(); + + if (!result || result.status === 'error') { + OC.Notification.show(result.data.message); + return; } - } - }, - updateEmptyContent: function() { - var permissions = $('#permissions').val(); - var isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0; - $('#emptycontent').toggleClass('hidden', !isCreatable || !FileList.isEmpty); - $('#filestable thead th').toggleClass('hidden', FileList.isEmpty); - }, - /** - * Shows the loading mask. - * - * @see #hideMask - */ - showMask: function() { - // in case one was shown before - var $mask = $('#content .mask'); - if ($mask.exists()) { - return; - } - this.$el.addClass('hidden'); + if (result.status === 404) { + // go back home + this.changeDirectory('/'); + return; + } + // aborted ? + if (result.status === 0){ + return; + } - $mask = $('
'); + // TODO: should rather return upload file size through + // the files list ajax call + this.updateStorageStatistics(true); - $mask.css('background-image', 'url('+ OC.imagePath('core', 'loading.gif') + ')'); - $mask.css('background-repeat', 'no-repeat'); - $('#content').append($mask); + if (result.data.permissions) { + this.setDirectoryPermissions(result.data.permissions); + } - $mask.removeClass('transparent'); - }, - /** - * Hide the loading mask. - * @see #showMask - */ - hideMask: function() { - $('#content .mask').remove(); - this.$el.removeClass('hidden'); - }, - scrollTo:function(file) { - //scroll to and highlight preselected file - var $scrollToRow = FileList.findFileEl(file); - if ($scrollToRow.exists()) { - $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').toString().toLowerCase().indexOf(query.toLowerCase()) !== -1) { - $(e).addClass("searchresult"); - } else { - $(e).removeClass("searchresult"); + this.setFiles(result.data.files); + }, + + updateStorageStatistics: function(force) { + OCA.Files.Files.updateStorageStatistics(this.getCurrentDirectory(), force); + }, + + getAjaxUrl: function(action, params) { + return OCA.Files.Files.getAjaxUrl(action, params); + }, + + getDownloadUrl: function(files, dir) { + return OCA.Files.Files.getDownloadUrl(files, dir || this.getCurrentDirectory()); + }, + + /** + * Generates a preview URL based on the URL space. + * @param urlSpec map with {x: width, y: height, file: file path} + * @return preview URL + */ + generatePreviewUrl: function(urlSpec) { + urlSpec = urlSpec || {}; + if (!urlSpec.x) { + urlSpec.x = this.$table.data('preview-x') || 36; } - }); - //do not use scrollto to prevent removing searchresult css class - var first = $('#fileList tr.searchresult').first(); - if (first.exists()) { - $(window).scrollTop(first.position().top); - } - }, - unfilter:function() { - $('#fileList tr.searchresult').each(function(i,e) { - $(e).removeClass("searchresult"); - }); - }, - /** - * Returns whether all files are selected - * @return true if all files are selected, false otherwise - */ - isAllSelected: function() { - return $('#select_all').prop('checked'); - } -}; + if (!urlSpec.y) { + urlSpec.y = this.$table.data('preview-y') || 36; + } + urlSpec.y *= window.devicePixelRatio; + urlSpec.x *= window.devicePixelRatio; + urlSpec.forceIcon = 0; + return OC.generateUrl('/core/preview.png?') + $.param(urlSpec); + }, + + /** + * Lazy load a file's preview. + * + * @param path path of the file + * @param mime mime type + * @param callback callback function to call when the image was loaded + * @param etag file etag (for caching) + */ + lazyLoadPreview : function(options) { + var self = this; + var path = options.path; + var mime = options.mime; + var ready = options.callback; + var etag = options.etag; + + // get mime icon url + OCA.Files.Files.getMimeIcon(mime, function(iconURL) { + var previewURL, + urlSpec = {}; + ready(iconURL); // set mimeicon URL + + urlSpec.file = OCA.Files.Files.fixPath(path); + + if (etag){ + // use etag as cache buster + urlSpec.c = etag; + } + else { + console.warn('OCA.Files.FileList.lazyLoadPreview(): missing etag argument'); + } -$(document).ready(function() { - FileList.initialize(); + previewURL = self.generatePreviewUrl(urlSpec); + previewURL = previewURL.replace('(', '%28'); + previewURL = previewURL.replace(')', '%29'); + + // preload image to prevent delay + // this will make the browser cache the image + var img = new Image(); + img.onload = function(){ + // if loading the preview image failed (no preview for the mimetype) then img.width will < 5 + if (img.width > 5) { + ready(previewURL); + } + }; + img.src = previewURL; + }); + }, - // handle upload events - var fileUploadStart = $('#file_upload_start'); + setDirectoryPermissions: function(permissions) { + var isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0; + this.$el.find('#permissions').val(permissions); + this.$el.find('.creatable').toggleClass('hidden', !isCreatable); + this.$el.find('.notCreatable').toggleClass('hidden', isCreatable); + }, + /** + * Shows/hides action buttons + * + * @param show true for enabling, false for disabling + */ + showActions: function(show){ + this.$el.find('.actions,#file_action_panel').toggleClass('hidden', !show); + if (show){ + // make sure to display according to permissions + var permissions = this.getDirectoryPermissions(); + var isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0; + this.$el.find('.creatable').toggleClass('hidden', !isCreatable); + this.$el.find('.notCreatable').toggleClass('hidden', isCreatable); + // remove old style breadcrumbs (some apps might create them) + this.$el.find('#controls .crumb').remove(); + // refresh breadcrumbs in case it was replaced by an app + this.breadcrumb.render(); + } + else{ + this.$el.find('.creatable, .notCreatable').addClass('hidden'); + } + }, + /** + * Enables/disables viewer mode. + * In viewer mode, apps can embed themselves under the controls bar. + * In viewer mode, the actions of the file list will be hidden. + * @param show true for enabling, false for disabling + */ + setViewerMode: function(show){ + this.showActions(!show); + this.$el.find('#filestable').toggleClass('hidden', show); + this.$el.trigger(new $.Event('changeViewerMode', {viewerModeEnabled: show})); + }, + /** + * Removes a file entry from the list + * @param name name of the file to remove + * @param options optional options as map: + * "updateSummary": true to update the summary (default), false otherwise + * @return deleted element + */ + remove: function(name, options){ + options = options || {}; + var fileEl = this.findFileEl(name); + var index = fileEl.index(); + if (!fileEl.length) { + return null; + } + if (this._selectedFiles[fileEl.data('id')]) { + // remove from selection first + this._selectFileEl(fileEl, false); + this.updateSelectionSummary(); + } + if (this._dragOptions && (fileEl.data('permissions') & OC.PERMISSION_DELETE)) { + // file is only draggable when delete permissions are set + fileEl.find('td.filename').draggable('destroy'); + } + this.files.splice(index, 1); + fileEl.remove(); + // TODO: improve performance on batch update + this.isEmpty = !this.files.length; + if (typeof(options.updateSummary) === 'undefined' || !!options.updateSummary) { + this.updateEmptyContent(); + this.fileSummary.remove({type: fileEl.attr('data-type'), size: fileEl.attr('data-size')}, true); + } - fileUploadStart.on('fileuploaddrop', function(e, data) { - OC.Upload.log('filelist handle fileuploaddrop', e, data); + var lastIndex = this.$fileList.children().length; + // if there are less elements visible than one page + // but there are still pending elements in the array, + // then directly append the next page + if (lastIndex < this.files.length && lastIndex < this.pageSize) { + this._nextPage(true); + } - var dropTarget = $(e.originalEvent.target).closest('tr, .crumb'); - if (dropTarget && (dropTarget.data('type') === 'dir' || dropTarget.hasClass('crumb'))) { // drag&drop upload to folder + return fileEl; + }, + /** + * Finds the index of the row before which the given + * fileData should be inserted, considering the current + * sorting + */ + _findInsertionIndex: function(fileData) { + var index = 0; + while (index < this.files.length && this._sortComparator(fileData, this.files[index]) > 0) { + index++; + } + return index; + }, + /** + * Moves a file to a given target folder. + * + * @param fileNames array of file names to move + * @param targetPath absolute target path + */ + move: function(fileNames, targetPath) { + var self = this; + var dir = this.getCurrentDirectory(); + var target = OC.basename(targetPath); + if (!_.isArray(fileNames)) { + fileNames = [fileNames]; + } + _.each(fileNames, function(fileName) { + var $tr = self.findFileEl(fileName); + var $td = $tr.children('td.filename'); + var oldBackgroundImage = $td.css('background-image'); + $td.css('background-image', 'url('+ OC.imagePath('core', 'loading.gif') + ')'); + // TODO: improve performance by sending all file names in a single call + $.post( + OC.filePath('files', 'ajax', 'move.php'), + { + dir: dir, + file: fileName, + target: targetPath + }, + function(result) { + if (result) { + if (result.status === 'success') { + // if still viewing the same directory + if (self.getCurrentDirectory() === dir) { + // recalculate folder size + var oldFile = self.findFileEl(target); + var newFile = self.findFileEl(fileName); + var oldSize = oldFile.data('size'); + var newSize = oldSize + newFile.data('size'); + oldFile.data('size', newSize); + oldFile.find('td.filesize').text(OC.Util.humanFileSize(newSize)); + + // TODO: also update entry in FileList.files + + self.remove(fileName); + } + } else { + OC.Notification.hide(); + if (result.status === 'error' && result.data.message) { + OC.Notification.show(result.data.message); + } + else { + OC.Notification.show(t('files', 'Error moving file.')); + } + // hide notification after 10 sec + setTimeout(function() { + OC.Notification.hide(); + }, 10000); + } + } else { + OC.dialogs.alert(t('files', 'Error moving file'), t('files', 'Error')); + } + $td.css('background-image', oldBackgroundImage); + } + ); + }); - // remember as context - data.context = dropTarget; + }, + + /** + * Triggers file rename input field for the given file name. + * If the user enters a new name, the file will be renamed. + * + * @param oldname file name of the file to rename + */ + rename: function(oldname) { + var self = this; + var tr, td, input, form; + tr = this.findFileEl(oldname); + var oldFileInfo = this.files[tr.index()]; + tr.data('renaming',true); + td = tr.children('td.filename'); + input = $('').val(oldname); + form = $('
'); + form.append(input); + td.children('a.name').hide(); + td.append(form); + input.focus(); + //preselect input + var len = input.val().lastIndexOf('.'); + if ( len === -1 || + tr.data('type') === 'dir' ) { + len = input.val().length; + } + input.selectRange(0, len); + var checkInput = function () { + var filename = input.val(); + if (filename !== oldname) { + // Files.isFileNameValid(filename) throws an exception itself + OCA.Files.Files.isFileNameValid(filename); + if (self.inList(filename)) { + throw t('files', '{new_name} already exists', {new_name: filename}); + } + } + return true; + }; - var dir = dropTarget.data('file'); - // if from file list, need to prepend parent dir - if (dir) { - var parentDir = $('#dir').val() || '/'; - if (parentDir[parentDir.length - 1] !== '/') { - parentDir += '/'; + form.submit(function(event) { + event.stopPropagation(); + event.preventDefault(); + try { + var newName = input.val(); + if (newName !== oldname) { + checkInput(); + // mark as loading + td.css('background-image', 'url('+ OC.imagePath('core', 'loading.gif') + ')'); + $.ajax({ + url: OC.filePath('files','ajax','rename.php'), + data: { + dir : self.getCurrentDirectory(), + newname: newName, + file: oldname + }, + success: function(result) { + var fileInfo; + if (!result || result.status === 'error') { + OC.dialogs.alert(result.data.message, t('core', 'Could not rename file')); + fileInfo = oldFileInfo; + } + else { + fileInfo = result.data; + } + // reinsert row + self.files.splice(tr.index(), 1); + tr.remove(); + self.add(fileInfo); + } + }); + } + input.tipsy('hide'); + tr.data('renaming',false); + tr.attr('data-file', newName); + var path = td.children('a.name').attr('href'); + // FIXME this will fail if the path contains the filename. + td.children('a.name').attr('href', path.replace(encodeURIComponent(oldname), encodeURIComponent(newName))); + var basename = newName; + if (newName.indexOf('.') > 0 && tr.data('type') !== 'dir') { + basename = newName.substr(0, newName.lastIndexOf('.')); + } + td.find('a.name span.nametext').text(basename); + if (newName.indexOf('.') > 0 && tr.data('type') !== 'dir') { + if ( ! td.find('a.name span.extension').exists() ) { + td.find('a.name span.nametext').append(''); + } + td.find('a.name span.extension').text(newName.substr(newName.lastIndexOf('.'))); + } + form.remove(); + self.fileActions.display( tr.find('td.filename'), true); + td.children('a.name').show(); + } catch (error) { + input.attr('title', error); + input.tipsy({gravity: 'w', trigger: 'manual'}); + input.tipsy('show'); + input.addClass('error'); } - dir = parentDir + dir; + return false; + }); + input.keyup(function(event) { + // verify filename on typing + try { + checkInput(); + input.tipsy('hide'); + input.removeClass('error'); + } catch (error) { + input.attr('title', error); + input.tipsy({gravity: 'w', trigger: 'manual'}); + input.tipsy('show'); + input.addClass('error'); + } + if (event.keyCode === 27) { + input.tipsy('hide'); + tr.data('renaming',false); + form.remove(); + td.children('a.name').show(); + } + }); + input.click(function(event) { + event.stopPropagation(); + event.preventDefault(); + }); + input.blur(function() { + form.trigger('submit'); + }); + }, + inList:function(file) { + return this.findFileEl(file).length; + }, + /** + * Delete the given files from the given dir + * @param files file names list (without path) + * @param dir directory in which to delete the files, defaults to the current + * directory + */ + do_delete:function(files, dir) { + var self = this; + var params; + if (files && files.substr) { + files=[files]; } - else{ - // read full path from crumb - dir = dropTarget.data('dir') || '/'; + if (files) { + for (var i=0; itd.date .action.delete').removeClass('delete-icon').addClass('progress-icon'); } - } - }); - fileUploadStart.on('fileuploadadd', function(e, data) { - 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 - } + $.post(OC.filePath('files', 'ajax', 'delete.php'), + params, + function(result) { + if (result.status === 'success') { + if (params.allfiles) { + self.setFiles([]); + } + else { + $.each(files,function(index,file) { + var fileEl = self.remove(file, {updateSummary: false}); + // FIXME: not sure why we need this after the + // element isn't even in the DOM any more + fileEl.find('input[type="checkbox"]').prop('checked', false); + fileEl.removeClass('selected'); + self.fileSummary.remove({type: fileEl.attr('data-type'), size: fileEl.attr('data-size')}); + }); + } + // TODO: this info should be returned by the ajax call! + self.updateEmptyContent(); + self.fileSummary.update(); + self.updateSelectionSummary(); + self.updateStorageStatistics(); + } else { + if (result.status === 'error' && result.data.message) { + OC.Notification.show(result.data.message); + } + else { + OC.Notification.show(t('files', 'Error deleting file.')); + } + // hide notification after 10 sec + setTimeout(function() { + OC.Notification.hide(); + }, 10000); + if (params.allfiles) { + // reload the page as we don't know what files were deleted + // and which ones remain + self.reload(); + } + else { + $.each(files,function(index,file) { + var deleteAction = self.findFileEl(file).find('.action.delete'); + deleteAction.removeClass('progress-icon').addClass('delete-icon'); + }); + } + } + }); + }, + /** + * Creates the file summary section + */ + _createSummary: function() { + var $tr = $(''); + this.$el.find('tfoot').append($tr); + + return new OCA.Files.FileSummary($tr); + }, + updateEmptyContent: function() { + var permissions = this.getDirectoryPermissions(); + var isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0; + this.$el.find('#emptycontent').toggleClass('hidden', !isCreatable || !this.isEmpty); + this.$el.find('#filestable thead th').toggleClass('hidden', this.isEmpty); + }, + /** + * Shows the loading mask. + * + * @see #hideMask + */ + showMask: function() { + // in case one was shown before + var $mask = this.$el.find('.mask'); + if ($mask.exists()) { + return; + } - // 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'), 10); - 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'); - data.context.find('td.filename').attr('style','background-image:url('+img+')'); - uploadText.text(translatedText); - uploadText.show(); - } else { - uploadText.text(translatedText); + this.$table.addClass('hidden'); + + $mask = $('
'); + + $mask.css('background-image', 'url('+ OC.imagePath('core', 'loading.gif') + ')'); + $mask.css('background-repeat', 'no-repeat'); + this.$el.append($mask); + + $mask.removeClass('transparent'); + }, + /** + * Hide the loading mask. + * @see #showMask + */ + hideMask: function() { + this.$el.find('.mask').remove(); + this.$table.removeClass('hidden'); + }, + scrollTo:function(file) { + //scroll to and highlight preselected file + var $scrollToRow = this.findFileEl(file); + if ($scrollToRow.exists()) { + $scrollToRow.addClass('searchresult'); + $(window).scrollTop($scrollToRow.position().top); + //remove highlight when hovered over + $scrollToRow.one('hover', function() { + $scrollToRow.removeClass('searchresult'); + }); } - } + }, + filter:function(query) { + this.$fileList.find('tr').each(function(i,e) { + if ($(e).data('file').toString().toLowerCase().indexOf(query.toLowerCase()) !== -1) { + $(e).addClass("searchresult"); + } else { + $(e).removeClass("searchresult"); + } + }); + //do not use scrollto to prevent removing searchresult css class + var first = this.$fileList.find('tr.searchresult').first(); + if (first.exists()) { + $(window).scrollTop(first.position().top); + } + }, + unfilter:function() { + this.$fileList.find('tr.searchresult').each(function(i,e) { + $(e).removeClass("searchresult"); + }); + }, + /** + * Update UI based on the current selection + */ + updateSelectionSummary: function() { + var summary = this._selectionSummary.summary; + var canDelete; + if (summary.totalFiles === 0 && summary.totalDirs === 0) { + this.$el.find('#headerName a.name>span:first').text(t('files','Name')); + this.$el.find('#headerSize a>span:first').text(t('files','Size')); + this.$el.find('#modified a>span:first').text(t('files','Modified')); + this.$el.find('table').removeClass('multiselect'); + this.$el.find('.selectedActions').addClass('hidden'); + } + else { + canDelete = (this.getDirectoryPermissions() & OC.PERMISSION_DELETE); + this.$el.find('.selectedActions').removeClass('hidden'); + this.$el.find('#headerSize a>span:first').text(OC.Util.humanFileSize(summary.totalSize)); + var selection = ''; + if (summary.totalDirs > 0) { + selection += n('files', '%n folder', '%n folders', summary.totalDirs); + if (summary.totalFiles > 0) { + selection += ' & '; + } + } + if (summary.totalFiles > 0) { + selection += n('files', '%n file', '%n files', summary.totalFiles); + } + this.$el.find('#headerName a.name>span:first').text(selection); + this.$el.find('#modified a>span:first').text(''); + this.$el.find('table').addClass('multiselect'); + this.$el.find('.delete-selected').toggleClass('hidden', !canDelete); + } + }, + + /** + * Returns whether all files are selected + * @return true if all files are selected, false otherwise + */ + isAllSelected: function() { + return this.$el.find('.select-all').prop('checked'); + }, + + /** + * Returns the file info of the selected files + * + * @return array of file names + */ + getSelectedFiles: function() { + return _.values(this._selectedFiles); + }, + + getUniqueName: function(name) { + if (this.findFileEl(name).exists()) { + var numMatch; + var parts=name.split('.'); + var extension = ""; + if (parts.length > 1) { + extension=parts.pop(); + } + var base=parts.join('.'); + numMatch=base.match(/\((\d+)\)/); + var num=2; + if (numMatch && numMatch.length>0) { + num=parseInt(numMatch[numMatch.length-1])+1; + base=base.split('('); + base.pop(); + base=$.trim(base.join('(')); + } + name=base+' ('+num+')'; + if (extension) { + name = name+'.'+extension; + } + // FIXME: ugly recursion + return this.getUniqueName(name); + } + return name; + }, - }); - /* - * when file upload done successfully add row to filelist - * update counter when uploading to sub folder - */ - fileUploadStart.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); + /** + * Setup file upload events related to the file-upload plugin + */ + setupUploadEvents: function() { + var self = this; - if (typeof result[0] !== 'undefined' && result[0].status === 'success') { - var file = result[0]; - var size = 0; + // handle upload events + var fileUploadStart = this.$el.find('#file_upload_start'); - if (data.context && data.context.data('type') === 'dir') { + fileUploadStart.on('fileuploaddrop', function(e, data) { + OC.Upload.log('filelist handle fileuploaddrop', e, data); - // update upload counter ui - var uploadText = data.context.find('.uploadtext'); - var currentUploads = parseInt(uploadText.attr('currentUploads'), 10); - currentUploads -= 1; - uploadText.attr('currentUploads', currentUploads); - var translatedText = n('files', 'Uploading %n file', 'Uploading %n files', currentUploads); - if (currentUploads === 0) { - var img = OC.imagePath('core', 'filetypes/folder'); - data.context.find('td.filename').attr('style','background-image:url('+img+')'); - uploadText.text(translatedText); - uploadText.hide(); - } else { - uploadText.text(translatedText); + var dropTarget = $(e.originalEvent.target).closest('tr, .crumb'); + // check if dropped inside this list at all + if (dropTarget && !self.$el.has(dropTarget).length) { + return false; } - // update folder size - size = parseInt(data.context.data('size'), 10); - size += parseInt(file.size, 10); - data.context.attr('data-size', size); - data.context.find('td.filesize').text(humanFileSize(size)); - } else { - // only append new file if uploaded into the current folder - if (file.directory !== '/' && file.directory !== FileList.getCurrentDirectory()) { - - var fileDirectory = file.directory.replace('/','').replace(/\/$/, "").split('/'); - - if (fileDirectory.length === 1) { - fileDirectory = fileDirectory[0]; - - // Get the directory - var fd = FileList.findFileEl(fileDirectory); - if (fd.length === 0) { - var dir = { - name: fileDirectory, - type: 'dir', - mimetype: 'httpd/unix-directory', - permissions: file.permissions, - size: 0, - id: file.parentId - }; - FileList.add(dir, {insert: true}); + if (dropTarget && (dropTarget.data('type') === 'dir' || dropTarget.hasClass('crumb'))) { // drag&drop upload to folder + + // remember as context + data.context = dropTarget; + + var dir = dropTarget.data('file'); + // if from file list, need to prepend parent dir + if (dir) { + var parentDir = self.getCurrentDirectory(); + if (parentDir[parentDir.length - 1] !== '/') { + parentDir += '/'; } + dir = parentDir + dir; + } + else{ + // read full path from crumb + dir = dropTarget.data('dir') || '/'; + } + + // update folder in form + data.formData = function(form) { + return [ + {name: 'dir', value: dir}, + {name: 'requesttoken', value: oc_requesttoken}, + {name: 'file_directory', value: data.files[0].relativePath} + ]; + }; + } else { + // cancel uploads to current dir if no permission + var isCreatable = (self.getDirectoryPermissions() & OC.PERMISSION_CREATE) !== 0; + if (!isCreatable) { + return false; + } + } + }); + fileUploadStart.on('fileuploadadd', function(e, data) { + OC.Upload.log('filelist handle fileuploadadd', e, data); + + //finish delete if we are uploading a deleted file + if (self.deleteFiles && self.deleteFiles.indexOf(data.files[0].name)!==-1) { + self.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'), 10); + 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'); + data.context.find('td.filename').attr('style','background-image:url('+img+')'); + uploadText.text(translatedText); + uploadText.show(); } else { - fileDirectory = fileDirectory[0]; + uploadText.text(translatedText); } - - fileDirectory = FileList.findFileEl(fileDirectory); + } + + }); + /* + * when file upload done successfully add row to filelist + * update counter when uploading to sub folder + */ + fileUploadStart.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); + + if (typeof result[0] !== 'undefined' && result[0].status === 'success') { + var file = result[0]; + var size = 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'), 10); + currentUploads -= 1; + uploadText.attr('currentUploads', currentUploads); + var translatedText = n('files', 'Uploading %n file', 'Uploading %n files', currentUploads); + if (currentUploads === 0) { + var img = OC.imagePath('core', 'filetypes/folder'); + data.context.find('td.filename').attr('style','background-image:url('+img+')'); + uploadText.text(translatedText); + uploadText.hide(); + } else { + uploadText.text(translatedText); + } + + // update folder size + size = parseInt(data.context.data('size'), 10); + size += parseInt(file.size, 10); + data.context.attr('data-size', size); + data.context.find('td.filesize').text(humanFileSize(size)); + } else { + // only append new file if uploaded into the current folder + if (file.directory !== '/' && file.directory !== self.getCurrentDirectory()) { + + var fileDirectory = file.directory.replace('/','').replace(/\/$/, "").split('/'); + + if (fileDirectory.length === 1) { + fileDirectory = fileDirectory[0]; + + // Get the directory + var fd = self.findFileEl(fileDirectory); + if (fd.length === 0) { + var dir = { + name: fileDirectory, + type: 'dir', + mimetype: 'httpd/unix-directory', + permissions: file.permissions, + size: 0, + id: file.parentId + }; + self.add(dir, {insert: true}); + } + } else { + fileDirectory = fileDirectory[0]; + } + + fileDirectory = self.findFileEl(fileDirectory); + + // update folder size + size = parseInt(fileDirectory.attr('data-size'), 10); + size += parseInt(file.size, 10); + fileDirectory.attr('data-size', size); + fileDirectory.find('td.filesize').text(humanFileSize(size)); + + return; + } + + // add as stand-alone row to filelist + size = t('files', 'Pending'); + if (data.files[0].size>=0) { + size=data.files[0].size; + } + //should the file exist in the list remove it + self.remove(file.name); - // update folder size - size = parseInt(fileDirectory.attr('data-size'), 10); - size += parseInt(file.size, 10); - fileDirectory.attr('data-size', size); - fileDirectory.find('td.filesize').text(humanFileSize(size)); + // create new file context + data.context = self.add(file, {animate: true}); + } + } + }); + fileUploadStart.on('fileuploadstop', function(e, data) { + OC.Upload.log('filelist handle fileuploadstop', e, data); - return; + //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'); + uploadText.parents('td.filename').attr('style','background-image:url('+img+')'); + uploadText.fadeOut(); + uploadText.attr('currentUploads', 0); } + self.updateStorageStatistics(); + }); + fileUploadStart.on('fileuploadfail', function(e, data) { + OC.Upload.log('filelist handle fileuploadfail', e, data); - // add as stand-alone row to filelist - size = t('files', 'Pending'); - if (data.files[0].size>=0) { - size=data.files[0].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'); + uploadText.parents('td.filename').attr('style','background-image:url('+img+')'); + uploadText.fadeOut(); + uploadText.attr('currentUploads', 0); } - //should the file exist in the list remove it - FileList.remove(file.name); + self.updateStorageStatistics(); + }); - // create new file context - data.context = FileList.add(file, {insert: true}); - } - } - }); - fileUploadStart.on('fileuploadstop', function(e, data) { - OC.Upload.log('filelist handle fileuploadstop', e, data); - - //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'); - uploadText.parents('td.filename').attr('style','background-image:url('+img+')'); - uploadText.fadeOut(); - uploadText.attr('currentUploads', 0); - } - }); - fileUploadStart.on('fileuploadfail', function(e, data) { - 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 .uploadtext'); - var img = OC.imagePath('core', 'filetypes/folder'); - uploadText.parents('td.filename').attr('style','background-image:url('+img+')'); - uploadText.fadeOut(); - uploadText.attr('currentUploads', 0); } - }); + }; - $('#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')); - }); - }); - $('#notification:first-child').on('click', '.suggest', function() { - var file = $('#notification > span').attr('data-oldName'); - FileList.findFileEl(file).removeClass('hidden'); - OC.Notification.hide(); - }); - $('#notification:first-child').on('click', '.cancel', function() { - if ($('#notification > span').attr('data-isNewFile')) { - FileList.deleteCanceled = false; - FileList.deleteFiles = [$('#notification > span').attr('data-oldName')]; + /** + * Sort comparators. + */ + FileList.Comparators = { + /** + * Compares two file infos by name, making directories appear + * first. + * + * @param fileInfo1 file info + * @param fileInfo2 file info + * @return -1 if the first file must appear before the second one, + * 0 if they are identify, 1 otherwise. + */ + name: function(fileInfo1, fileInfo2) { + if (fileInfo1.type === 'dir' && fileInfo2.type !== 'dir') { + return -1; + } + if (fileInfo1.type !== 'dir' && fileInfo2.type === 'dir') { + return 1; + } + return fileInfo1.name.localeCompare(fileInfo2.name); + }, + /** + * Compares two file infos by size. + * + * @param fileInfo1 file info + * @param fileInfo2 file info + * @return -1 if the first file must appear before the second one, + * 0 if they are identify, 1 otherwise. + */ + size: function(fileInfo1, fileInfo2) { + return fileInfo1.size - fileInfo2.size; + }, + /** + * Compares two file infos by timestamp. + * + * @param fileInfo1 file info + * @param fileInfo2 file info + * @return -1 if the first file must appear before the second one, + * 0 if they are identify, 1 otherwise. + */ + mtime: function(fileInfo1, fileInfo2) { + return fileInfo1.mtime - fileInfo2.mtime; } - }); - FileList.useUndo=(window.onbeforeunload)?true:false; + }; + + OCA.Files.FileList = FileList; +})(); + +$(document).ready(function() { + // FIXME: unused ? + OCA.Files.FileList.useUndo = (window.onbeforeunload)?true:false; $(window).bind('beforeunload', function () { - if (FileList.lastAction) { - FileList.lastAction(); + if (OCA.Files.FileList.lastAction) { + OCA.Files.FileList.lastAction(); } }); $(window).unload(function () { $(window).trigger('beforeunload'); }); - function decodeQuery(query) { - return query.replace(/\+/g, ' '); - } - - function parseHashQuery() { - var hash = window.location.hash, - pos = hash.indexOf('?'); - if (pos >= 0) { - return hash.substr(pos + 1); - } - return ''; - } - - function parseCurrentDirFromUrl() { - var query = parseHashQuery(), - params; - // try and parse from URL hash first - if (query) { - params = OC.parseQueryString(decodeQuery(query)); - } - // else read from query attributes - if (!params) { - params = OC.parseQueryString(decodeQuery(location.search)); - } - return (params && params.dir) || '/'; - } - - // disable ajax/history API for public app (TODO: until it gets ported) - // 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); - } - }; - - var dir = parseCurrentDirFromUrl(); - // trigger ajax load, deferred to let sub-apps do their overrides first - setTimeout(function() { - FileList.changeDirectory(dir, false, true); - }, 0); - - FileList.createFileSummary(); }); - diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 5e669a796a9efdb95f95f0f69cebb59822408619..92f97f5d3c055fd724b4d25e954ab3f3772fa17f 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -8,379 +8,296 @@ * */ -/* global OC, t, n, FileList, FileActions */ -/* global getURLParameter, isPublic */ -var Files = { - // file space size sync - _updateStorageStatistics: function() { - Files._updateStorageStatisticsTimeout = null; - var currentDir = FileList.getCurrentDirectory(), - state = Files.updateStorageStatistics; - if (state.dir){ - if (state.dir === currentDir) { +/* global getURLParameter */ +/** + * Utility class for file related operations + */ +(function() { + var Files = { + // file space size sync + _updateStorageStatistics: function(currentDir) { + var state = Files.updateStorageStatistics; + if (state.dir){ + if (state.dir === currentDir) { + return; + } + // cancel previous call, as it was for another dir + state.call.abort(); + } + state.dir = currentDir; + state.call = $.getJSON(OC.filePath('files','ajax','getstoragestats.php') + '?dir=' + encodeURIComponent(currentDir),function(response) { + state.dir = null; + state.call = null; + Files.updateMaxUploadFilesize(response); + }); + }, + /** + * Update storage statistics such as free space, max upload, + * etc based on the given directory. + * + * Note this function is debounced to avoid making too + * many ajax calls in a row. + * + * @param dir directory + * @param force whether to force retrieving + */ + updateStorageStatistics: function(dir, force) { + if (!OC.currentUser) { return; } - // cancel previous call, as it was for another dir - state.call.abort(); - } - state.dir = currentDir; - state.call = $.getJSON(OC.filePath('files','ajax','getstoragestats.php') + '?dir=' + encodeURIComponent(currentDir),function(response) { - state.dir = null; - state.call = null; - Files.updateMaxUploadFilesize(response); - }); - }, - updateStorageStatistics: function(force) { - if (!OC.currentUser) { - return; - } - // debounce to prevent calling too often - if (Files._updateStorageStatisticsTimeout) { - clearTimeout(Files._updateStorageStatisticsTimeout); - } - if (force) { - Files._updateStorageStatistics(); - } - else { - Files._updateStorageStatisticsTimeout = setTimeout(Files._updateStorageStatistics, 250); - } - }, - - updateMaxUploadFilesize:function(response) { - if (response === undefined) { - return; - } - if (response.data !== undefined && response.data.uploadMaxFilesize !== undefined) { - $('#max_upload').val(response.data.uploadMaxFilesize); - $('#free_space').val(response.data.freeSpace); - $('#upload.button').attr('original-title', response.data.maxHumanFilesize); - $('#usedSpacePercent').val(response.data.usedSpacePercent); - Files.displayStorageWarnings(); - } - if (response[0] === undefined) { - return; - } - if (response[0].uploadMaxFilesize !== undefined) { - $('#max_upload').val(response[0].uploadMaxFilesize); - $('#upload.button').attr('original-title', response[0].maxHumanFilesize); - $('#usedSpacePercent').val(response[0].usedSpacePercent); - Files.displayStorageWarnings(); - } + if (force) { + Files._updateStorageStatistics(dir); + } + else { + Files._updateStorageStatisticsDebounced(dir); + } + }, - }, + updateMaxUploadFilesize:function(response) { + if (response === undefined) { + return; + } + if (response.data !== undefined && response.data.uploadMaxFilesize !== undefined) { + $('#max_upload').val(response.data.uploadMaxFilesize); + $('#free_space').val(response.data.freeSpace); + $('#upload.button').attr('original-title', response.data.maxHumanFilesize); + $('#usedSpacePercent').val(response.data.usedSpacePercent); + Files.displayStorageWarnings(); + } + if (response[0] === undefined) { + return; + } + if (response[0].uploadMaxFilesize !== undefined) { + $('#max_upload').val(response[0].uploadMaxFilesize); + $('#upload.button').attr('original-title', response[0].maxHumanFilesize); + $('#usedSpacePercent').val(response[0].usedSpacePercent); + Files.displayStorageWarnings(); + } - /** - * Fix path name by removing double slash at the beginning, if any - */ - fixPath: function(fileName) { - if (fileName.substr(0, 2) == '//') { - return fileName.substr(1); - } - return fileName; - }, + }, - /** - * Checks whether the given file name is valid. - * @param name file name to check - * @return true if the file name is valid. - * Throws a string exception with an error message if - * the file name is not valid - */ - isFileNameValid: function (name) { - var trimmedName = name.trim(); - if (trimmedName === '.' || trimmedName === '..') - { - throw t('files', '"{name}" is an invalid file name.', {name: name}); - } else if (trimmedName.length === 0) { - throw t('files', 'File name cannot be empty.'); - } - // check for invalid characters - var invalid_characters = - ['\\', '/', '<', '>', ':', '"', '|', '?', '*', '\n']; - for (var i = 0; i < invalid_characters.length; i++) { - if (trimmedName.indexOf(invalid_characters[i]) !== -1) { - throw t('files', "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed."); + /** + * Fix path name by removing double slash at the beginning, if any + */ + fixPath: function(fileName) { + if (fileName.substr(0, 2) == '//') { + return fileName.substr(1); } - } - return true; - }, - displayStorageWarnings: function() { - if (!OC.Notification.isHidden()) { - return; - } - - var usedSpacePercent = $('#usedSpacePercent').val(); - if (usedSpacePercent > 98) { - OC.Notification.show(t('files', 'Your storage is full, files can not be updated or synced anymore!')); - return; - } - if (usedSpacePercent > 90) { - OC.Notification.show(t('files', 'Your storage is almost full ({usedSpacePercent}%)', {usedSpacePercent: usedSpacePercent})); - } - }, + return fileName; + }, - displayEncryptionWarning: function() { + /** + * Checks whether the given file name is valid. + * @param name file name to check + * @return true if the file name is valid. + * Throws a string exception with an error message if + * the file name is not valid + */ + isFileNameValid: function (name) { + var trimmedName = name.trim(); + if (trimmedName === '.' || trimmedName === '..') + { + throw t('files', '"{name}" is an invalid file name.', {name: name}); + } else if (trimmedName.length === 0) { + throw t('files', 'File name cannot be empty.'); + } + // check for invalid characters + var invalidCharacters = + ['\\', '/', '<', '>', ':', '"', '|', '?', '*', '\n']; + for (var i = 0; i < invalidCharacters.length; i++) { + if (trimmedName.indexOf(invalidCharacters[i]) !== -1) { + throw t('files', "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed."); + } + } + return true; + }, + displayStorageWarnings: function() { + if (!OC.Notification.isHidden()) { + return; + } - if (!OC.Notification.isHidden()) { - return; - } + var usedSpacePercent = $('#usedSpacePercent').val(); + if (usedSpacePercent > 98) { + OC.Notification.show(t('files', 'Your storage is full, files can not be updated or synced anymore!')); + return; + } + if (usedSpacePercent > 90) { + OC.Notification.show(t('files', 'Your storage is almost full ({usedSpacePercent}%)', + {usedSpacePercent: usedSpacePercent})); + } + }, - var encryptedFiles = $('#encryptedFiles').val(); - var initStatus = $('#encryptionInitStatus').val(); - if (initStatus === '0') { // enc not initialized, but should be - OC.Notification.show(t('files', 'Encryption App is enabled but your keys are not initialized, please log-out and log-in again')); - return; - } - if (initStatus === '1') { // encryption tried to init but failed - OC.Notification.show(t('files', 'Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files.')); - return; - } - if (encryptedFiles === '1') { - OC.Notification.show(t('files', 'Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files.')); - return; - } - }, + displayEncryptionWarning: function() { - setupDragAndDrop: function() { - var $fileList = $('#fileList'); + if (!OC.Notification.isHidden()) { + return; + } - //drag/drop of files - $fileList.find('tr td.filename').each(function(i,e) { - if ($(e).parent().data('permissions') & OC.PERMISSION_DELETE) { - $(e).draggable(dragOptions); + var encryptedFiles = $('#encryptedFiles').val(); + var initStatus = $('#encryptionInitStatus').val(); + if (initStatus === '0') { // enc not initialized, but should be + OC.Notification.show(t('files', 'Encryption App is enabled but your keys are not initialized, please log-out and log-in again')); + return; + } + if (initStatus === '1') { // encryption tried to init but failed + OC.Notification.show(t('files', 'Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files.')); + return; + } + if (encryptedFiles === '1') { + OC.Notification.show(t('files', 'Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files.')); + return; } - }); + }, - $fileList.find('tr[data-type="dir"] td.filename').each(function(i,e) { - if ($(e).parent().data('permissions') & OC.PERMISSION_CREATE) { - $(e).droppable(folderDropOptions); + /** + * Returns the download URL of the given file(s) + * @param filename string or array of file names to download + * @param dir optional directory in which the file name is, defaults to the current directory + */ + getDownloadUrl: function(filename, dir) { + if ($.isArray(filename)) { + filename = JSON.stringify(filename); } - }); - }, + var params = { + dir: dir, + files: filename + }; + return this.getAjaxUrl('download', params); + }, - /** - * Returns the download URL of the given file(s) - * @param filename string or array of file names to download - * @param dir optional directory in which the file name is, defaults to the current directory - */ - getDownloadUrl: function(filename, dir) { - if ($.isArray(filename)) { - filename = JSON.stringify(filename); - } - var params = { - dir: dir || FileList.getCurrentDirectory(), - files: filename - }; - return this.getAjaxUrl('download', params); - }, + /** + * Returns the ajax URL for a given action + * @param action action string + * @param params optional params map + */ + getAjaxUrl: function(action, params) { + var q = ''; + if (params) { + q = '?' + OC.buildQueryString(params); + } + return OC.filePath('files', 'ajax', action + '.php') + q; + }, - /** - * Returns the ajax URL for a given action - * @param action action string - * @param params optional params map - */ - getAjaxUrl: function(action, params) { - var q = ''; - if (params) { - q = '?' + OC.buildQueryString(params); - } - return OC.filePath('files', 'ajax', action + '.php') + q; - } -}; -$(document).ready(function() { - // FIXME: workaround for trashbin app - if (window.trashBinApp) { - return; - } - Files.displayEncryptionWarning(); - Files.bindKeyboardShortcuts(document, jQuery); + getMimeIcon: function(mime, ready) { + if (Files.getMimeIcon.cache[mime]) { + ready(Files.getMimeIcon.cache[mime]); + } else { + $.get( OC.filePath('files','ajax','mimeicon.php'), {mime: mime}, function(path) { + if(OC.Util.hasSVGSupport()){ + path = path.substr(0, path.length-4) + '.svg'; + } + Files.getMimeIcon.cache[mime]=path; + ready(Files.getMimeIcon.cache[mime]); + }); + } + }, - Files.setupDragAndDrop(); + /** + * Generates a preview URL based on the URL space. + * @param urlSpec map with {x: width, y: height, file: file path} + * @return preview URL + * @deprecated used OCA.Files.FileList.generatePreviewUrl instead + */ + generatePreviewUrl: function(urlSpec) { + console.warn('DEPRECATED: please use generatePreviewUrl() from an OCA.Files.FileList instance'); + return OCA.Files.App.fileList.generatePreviewUrl(urlSpec); + }, - $('#file_action_panel').attr('activeAction', false); + /** + * Lazy load preview + * @deprecated used OCA.Files.FileList.lazyLoadPreview instead + */ + lazyLoadPreview : function(path, mime, ready, width, height, etag) { + console.warn('DEPRECATED: please use lazyLoadPreview() from an OCA.Files.FileList instance'); + return OCA.Files.App.fileList.lazyLoadPreview({ + path: path, + mime: mime, + callback: ready, + width: width, + height: height, + etag: etag + }); + }, - // Triggers invisible file input - $('#upload a').on('click', function() { - $(this).parent().children('#file_upload_start').trigger('click'); - return false; - }); + /** + * Initialize the files view + */ + initialize: function() { + Files.getMimeIcon.cache = {}; + Files.displayEncryptionWarning(); + Files.bindKeyboardShortcuts(document, $); + + // TODO: move file list related code (upload) to OCA.Files.FileList + $('#file_action_panel').attr('activeAction', false); + + // Triggers invisible file input + $('#upload a').on('click', function() { + $(this).parent().children('#file_upload_start').trigger('click'); + return false; + }); - // Trigger cancelling of file upload - $('#uploadprogresswrapper .stop').on('click', function() { - OC.Upload.cancelUploads(); - procesSelection(); - }); + // Trigger cancelling of file upload + $('#uploadprogresswrapper .stop').on('click', function() { + OC.Upload.cancelUploads(); + }); - // Show trash bin - $('#trash').on('click', function() { - window.location=OC.filePath('files_trashbin', '', 'index.php'); - }); + // drag&drop support using jquery.fileupload + // TODO use OC.dialogs + $(document).bind('drop dragover', function (e) { + e.preventDefault(); // prevent browser from doing anything, if file isn't dropped in dropZone + }); - var lastChecked; - - // Sets the file link behaviour : - $('#fileList').on('click','td.filename a',function(event) { - if (event.ctrlKey || event.shiftKey) { - event.preventDefault(); - if (event.shiftKey) { - var last = $(lastChecked).parent().parent().prevAll().length; - var first = $(this).parent().parent().prevAll().length; - var start = Math.min(first, last); - var end = Math.max(first, last); - var rows = $(this).parent().parent().parent().children('tr'); - for (var i = start; i < end; i++) { - $(rows).each(function(index) { - if (index === i) { - var checkbox = $(this).children().children('input:checkbox'); - $(checkbox).attr('checked', 'checked'); - $(checkbox).parent().parent().addClass('selected'); + //do a background scan if needed + scanFiles(); + + // display storage warnings + setTimeout(Files.displayStorageWarnings, 100); + OC.Notification.setDefault(Files.displayStorageWarnings); + + // only possible at the moment if user is logged in or the files app is loaded + if (OC.currentUser && OCA.Files.App) { + // start on load - we ask the server every 5 minutes + var updateStorageStatisticsInterval = 5*60*1000; + var updateStorageStatisticsIntervalId = setInterval(OCA.Files.App.fileList.updateStorageStatistics, updateStorageStatisticsInterval); + + // TODO: this should also stop when switching to another view + // Use jquery-visibility to de-/re-activate file stats sync + if ($.support.pageVisibility) { + $(document).on({ + 'show.visibility': function() { + if (!updateStorageStatisticsIntervalId) { + updateStorageStatisticsIntervalId = setInterval(OCA.Files.App.fileList.updateStorageStatistics, updateStorageStatisticsInterval); + } + }, + 'hide.visibility': function() { + clearInterval(updateStorageStatisticsIntervalId); + updateStorageStatisticsIntervalId = 0; } }); } } - var checkbox = $(this).parent().children('input:checkbox'); - lastChecked = checkbox; - if ($(checkbox).attr('checked')) { - $(checkbox).removeAttr('checked'); - $(checkbox).parent().parent().removeClass('selected'); - $('#select_all').removeAttr('checked'); - } else { - $(checkbox).attr('checked', 'checked'); - $(checkbox).parent().parent().toggleClass('selected'); - var selectedCount = $('td.filename input:checkbox:checked').length; - if (selectedCount === $('td.filename input:checkbox').length) { - $('#select_all').attr('checked', 'checked'); - } - } - procesSelection(); - } else { - var filename=$(this).parent().parent().attr('data-file'); - var tr = FileList.findFileEl(filename); - var renaming=tr.data('renaming'); - if (!renaming) { - FileActions.currentFile = $(this).parent(); - var mime=FileActions.getCurrentMimeType(); - var type=FileActions.getCurrentType(); - var permissions = FileActions.getCurrentPermissions(); - var action=FileActions.getDefault(mime,type, permissions); - if (action) { - event.preventDefault(); - action(filename); - } - } - } - }); - - // Sets the select_all checkbox behaviour : - $('#select_all').click(function() { - if ($(this).attr('checked')) { - // Check all - $('td.filename input:checkbox').attr('checked', true); - $('td.filename input:checkbox').parent().parent().addClass('selected'); - } else { - // Uncheck all - $('td.filename input:checkbox').attr('checked', false); - $('td.filename input:checkbox').parent().parent().removeClass('selected'); - } - procesSelection(); - }); - - $('#fileList').on('change', 'td.filename input:checkbox',function(event) { - if (event.shiftKey) { - var last = $(lastChecked).parent().parent().prevAll().length; - var first = $(this).parent().parent().prevAll().length; - var start = Math.min(first, last); - var end = Math.max(first, last); - var rows = $(this).parent().parent().parent().children('tr'); - for (var i = start; i < end; i++) { - $(rows).each(function(index) { - if (index === i) { - var checkbox = $(this).children().children('input:checkbox'); - $(checkbox).attr('checked', 'checked'); - $(checkbox).parent().parent().addClass('selected'); - } - }); - } - } - var selectedCount=$('td.filename input:checkbox:checked').length; - $(this).parent().parent().toggleClass('selected'); - if (!$(this).attr('checked')) { - $('#select_all').attr('checked',false); - } else { - if (selectedCount===$('td.filename input:checkbox').length) { - $('#select_all').attr('checked',true); - } - } - procesSelection(); - }); - - $('.download').click('click',function(event) { - var files; - var dir = FileList.getCurrentDirectory(); - if (FileList.isAllSelected()) { - files = OC.basename(dir); - dir = OC.dirname(dir) || '/'; - } - else { - files = Files.getSelectedFiles('name'); - } - OC.Notification.show(t('files','Your download is being prepared. This might take some time if the files are big.')); - OC.redirect(Files.getDownloadUrl(files, dir)); - return false; - }); - - $('.delete-selected').click(function(event) { - var files = Files.getSelectedFiles('name'); - event.preventDefault(); - if (FileList.isAllSelected()) { - files = null; - } - FileList.do_delete(files); - return false; - }); - - // drag&drop support using jquery.fileupload - // TODO use OC.dialogs - $(document).bind('drop dragover', function (e) { - e.preventDefault(); // prevent browser from doing anything, if file isn't dropped in dropZone - }); - - //do a background scan if needed - scanFiles(); - - // display storage warnings - setTimeout(Files.displayStorageWarnings, 100); - OC.Notification.setDefault(Files.displayStorageWarnings); - - // only possible at the moment if user is logged in - if (OC.currentUser) { - // start on load - we ask the server every 5 minutes - var updateStorageStatisticsInterval = 5*60*1000; - var updateStorageStatisticsIntervalId = setInterval(Files.updateStorageStatistics, updateStorageStatisticsInterval); - - // Use jquery-visibility to de-/re-activate file stats sync - if ($.support.pageVisibility) { - $(document).on({ - 'show.visibility': function() { - if (!updateStorageStatisticsIntervalId) { - updateStorageStatisticsIntervalId = setInterval(Files.updateStorageStatistics, updateStorageStatisticsInterval); - } - }, - 'hide.visibility': function() { - clearInterval(updateStorageStatisticsIntervalId); - updateStorageStatisticsIntervalId = 0; + $('#app-settings-header').on('click', function() { + var $settings = $('#app-settings'); + $settings.toggleClass('opened'); + if ($settings.hasClass('opened')) { + $settings.find('input').focus(); } }); + + //scroll to and highlight preselected file + /* + if (getURLParameter('scrollto')) { + FileList.scrollTo(getURLParameter('scrollto')); + } + */ } } - //scroll to and highlight preselected file - if (getURLParameter('scrollto')) { - FileList.scrollTo(getURLParameter('scrollto')); - } -}); + Files._updateStorageStatisticsDebounced = _.debounce(Files._updateStorageStatistics, 250); + OCA.Files.Files = Files; +})(); function scanFiles(force, dir, users) { if (!OC.currentUser) { @@ -414,7 +331,9 @@ function scanFiles(force, dir, users) { scannerEventSource.listen('done',function(count) { scanFiles.scanning=false; console.log('done after ' + count + ' files'); - Files.updateStorageStatistics(); + if (OCA.Files.App) { + OCA.Files.App.fileList.updateStorageStatistics(true); + } }); scannerEventSource.listen('user',function(user) { console.log('scanning files for ' + user); @@ -422,34 +341,23 @@ function scanFiles(force, dir, users) { } scanFiles.scanning=false; -function boolOperationFinished(data, callback) { - result = jQuery.parseJSON(data.responseText); - Files.updateMaxUploadFilesize(result); - if (result.status === 'success') { - callback.call(); - } else { - alert(result.data.message); - } -} - +// TODO: move to FileList var createDragShadow = function(event) { //select dragged file + var FileList = OCA.Files.App.fileList; var isDragSelected = $(event.target).parents('tr').find('td input:first').prop('checked'); if (!isDragSelected) { //select dragged file - $(event.target).parents('tr').find('td input:first').prop('checked',true); + FileList._selectFileEl($(event.target).parents('tr:first'), true); } - var selectedFiles = Files.getSelectedFiles(); + // do not show drag shadow for too many files + var selectedFiles = _.first(FileList.getSelectedFiles(), FileList.pageSize); + selectedFiles = _.sortBy(selectedFiles, FileList._fileInfoCompare); if (!isDragSelected && selectedFiles.length === 1) { //revert the selection - $(event.target).parents('tr').find('td input:first').prop('checked',false); - } - - //also update class when we dragged more than one file - if (selectedFiles.length > 1) { - $(event.target).parents('tr').addClass('selected'); + FileList._selectFileEl($(event.target).parents('tr:first'), false); } // build dragshadow @@ -457,18 +365,21 @@ var createDragShadow = function(event) { var tbody = $(''); dragshadow.append(tbody); - var dir=$('#dir').val(); + var dir = FileList.getCurrentDirectory(); $(selectedFiles).each(function(i,elem) { - var newtr = $('').attr('data-dir', dir).attr('data-filename', elem.name).attr('data-origin', elem.origin); + var newtr = $('') + .attr('data-dir', dir) + .attr('data-file', elem.name) + .attr('data-origin', elem.origin); newtr.append($('').addClass('filename').text(elem.name)); - newtr.append($('').addClass('size').text(humanFileSize(elem.size))); + newtr.append($('').addClass('size').text(OC.Util.humanFileSize(elem.size))); tbody.append(newtr); if (elem.type === 'dir') { newtr.find('td.filename').attr('style','background-image:url('+OC.imagePath('core', 'filetypes/folder.png')+')'); } else { - var path = getPathForPreview(elem.name); - Files.lazyLoadPreview(path, elem.mime, function(previewpath) { + var path = dir + '/' + elem.name; + OCA.Files.App.files.lazyLoadPreview(path, elem.mime, function(previewpath) { newtr.find('td.filename').attr('style','background-image:url('+previewpath+')'); }, null, null, elem.etag); } @@ -479,264 +390,69 @@ var createDragShadow = function(event) { //options for file drag/drop //start&stop handlers needs some cleaning up +// TODO: move to FileList class var dragOptions={ - revert: 'invalid', revertDuration: 300, - opacity: 0.7, zIndex: 100, appendTo: 'body', cursorAt: { left: 24, top: 18 }, - helper: createDragShadow, cursor: 'move', - start: function(event, ui){ - var $selectedFiles = $('td.filename input:checkbox:checked'); - if($selectedFiles.length > 1){ - $selectedFiles.parents('tr').fadeTo(250, 0.2); - } - else{ - $(this).fadeTo(250, 0.2); - } - }, - stop: function(event, ui) { - var $selectedFiles = $('td.filename input:checkbox:checked'); - if($selectedFiles.length > 1){ - $selectedFiles.parents('tr').fadeTo(250, 1); - } - else{ - $(this).fadeTo(250, 1); - } - $('#fileList tr td.filename').addClass('ui-draggable'); + revert: 'invalid', + revertDuration: 300, + opacity: 0.7, + zIndex: 100, + appendTo: 'body', + cursorAt: { left: 24, top: 18 }, + helper: createDragShadow, + cursor: 'move', + start: function(event, ui){ + var $selectedFiles = $('td.filename input:checkbox:checked'); + if($selectedFiles.length > 1){ + $selectedFiles.parents('tr').fadeTo(250, 0.2); + } + else{ + $(this).fadeTo(250, 0.2); } + }, + stop: function(event, ui) { + var $selectedFiles = $('td.filename input:checkbox:checked'); + if($selectedFiles.length > 1){ + $selectedFiles.parents('tr').fadeTo(250, 1); + } + else{ + $(this).fadeTo(250, 1); + } + $('#fileList tr td.filename').addClass('ui-draggable'); + } }; // sane browsers support using the distance option if ( $('html.ie').length === 0) { dragOptions['distance'] = 20; } -var folderDropOptions={ +// TODO: move to FileList class +var folderDropOptions = { hoverClass: "canDrop", drop: function( event, ui ) { - //don't allow moving a file into a selected folder + // don't allow moving a file into a selected folder + var FileList = OCA.Files.App.fileList; if ($(event.target).parents('tr').find('td input:first').prop('checked') === true) { return false; } - var target = $(this).closest('tr').data('file'); - - var files = ui.helper.find('tr'); - $(files).each(function(i,row) { - var dir = $(row).data('dir'); - var file = $(row).data('filename'); - //slapdash selector, tracking down our original element that the clone budded off of. - var origin = $('tr[data-id=' + $(row).data('origin') + ']'); - var td = origin.children('td.filename'); - var oldBackgroundImage = td.css('background-image'); - td.css('background-image', 'url('+ OC.imagePath('core', 'loading.gif') + ')'); - $.post(OC.filePath('files', 'ajax', 'move.php'), { dir: dir, file: file, target: dir+'/'+target }, function(result) { - if (result) { - if (result.status === 'success') { - //recalculate folder size - var oldFile = FileList.findFileEl(target); - var newFile = FileList.findFileEl(file); - var oldSize = oldFile.data('size'); - var newSize = oldSize + newFile.data('size'); - oldFile.data('size', newSize); - oldFile.find('td.filesize').text(humanFileSize(newSize)); - - FileList.remove(file); - procesSelection(); - $('#notification').hide(); - } else { - $('#notification').hide(); - $('#notification').text(result.data.message); - $('#notification').fadeIn(); - } - } else { - OC.dialogs.alert(t('files', 'Error moving file'), t('files', 'Error')); - } - td.css('background-image', oldBackgroundImage); - }); - }); - }, - tolerance: 'pointer' -}; + var targetPath = FileList.getCurrentDirectory() + '/' + $(this).closest('tr').data('file'); -function procesSelection() { - var selected = Files.getSelectedFiles(); - var selectedFiles = selected.filter(function(el) { - return el.type==='file'; - }); - var selectedFolders = selected.filter(function(el) { - return el.type==='dir'; - }); - if (selectedFiles.length === 0 && selectedFolders.length === 0) { - $('#headerName span.name').text(t('files','Name')); - $('#headerSize').text(t('files','Size')); - $('#modified').text(t('files','Modified')); - $('table').removeClass('multiselect'); - $('.selectedActions').hide(); - $('#select_all').removeAttr('checked'); - } - else { - $('.selectedActions').show(); - var totalSize = 0; - for(var i=0; i 0) { - selection += n('files', '%n folder', '%n folders', selectedFolders.length); - if (selectedFiles.length > 0) { - selection += ' & '; - } - } - if (selectedFiles.length>0) { - selection += n('files', '%n file', '%n files', selectedFiles.length); - } - $('#headerName span.name').text(selection); - $('#modified').text(''); - $('table').addClass('multiselect'); - } -} - -/** - * @brief get a list of selected files - * @param {string} property (option) the property of the file requested - * @return {array} - * - * possible values for property: name, mime, size and type - * if property is set, an array with that property for each file is returnd - * if it's ommited an array of objects with all properties is returned - */ -Files.getSelectedFiles = function(property) { - var elements=$('td.filename input:checkbox:checked').parent().parent(); - var files=[]; - elements.each(function(i,element) { - var file={ - name:$(element).attr('data-file'), - mime:$(element).data('mime'), - type:$(element).data('type'), - size:$(element).data('size'), - etag:$(element).data('etag'), - origin: $(element).data('id') - }; - if (property) { - files.push(file[property]); - } else { - files.push(file); - } - }); - return files; -} - -Files.getMimeIcon = function(mime, ready) { - if (Files.getMimeIcon.cache[mime]) { - ready(Files.getMimeIcon.cache[mime]); - } else { - $.get( OC.filePath('files','ajax','mimeicon.php'), {mime: mime}, function(path) { - if(OC.Util.hasSVGSupport()){ - path = path.substr(0, path.length-4) + '.svg'; - } - Files.getMimeIcon.cache[mime]=path; - ready(Files.getMimeIcon.cache[mime]); - }); - } -} -Files.getMimeIcon.cache={}; - -function getPathForPreview(name) { - var path = $('#dir').val() + '/' + name; - return path; -} - -/** - * Generates a preview URL based on the URL space. - * @param urlSpec map with {x: width, y: height, file: file path} - * @return preview URL - */ -Files.generatePreviewUrl = function(urlSpec) { - urlSpec = urlSpec || {}; - if (!urlSpec.x) { - urlSpec.x = $('#filestable').data('preview-x'); - } - if (!urlSpec.y) { - urlSpec.y = $('#filestable').data('preview-y'); - } - urlSpec.y *= window.devicePixelRatio; - urlSpec.x *= window.devicePixelRatio; - urlSpec.forceIcon = 0; - return OC.generateUrl('/core/preview.png?') + $.param(urlSpec); -} - -Files.lazyLoadPreview = function(path, mime, ready, width, height, etag) { - // get mime icon url - Files.getMimeIcon(mime, function(iconURL) { - var previewURL, - urlSpec = {}; - ready(iconURL); // set mimeicon URL - - urlSpec.file = Files.fixPath(path); - - if (etag){ - // use etag as cache buster - urlSpec.c = etag; - } - else { - console.warn('Files.lazyLoadPreview(): missing etag argument'); + var files = FileList.getSelectedFiles(); + if (files.length === 0) { + // single one selected without checkbox? + files = _.map(ui.helper.find('tr'), FileList.elementToFile); } - previewURL = Files.generatePreviewUrl(urlSpec); - previewURL = previewURL.replace('(', '%28'); - previewURL = previewURL.replace(')', '%29'); - - // preload image to prevent delay - // this will make the browser cache the image - var img = new Image(); - img.onload = function(){ - // if loading the preview image failed (no preview for the mimetype) then img.width will < 5 - if (img.width > 5) { - ready(previewURL); - } - }; - img.src = previewURL; - }); + FileList.move(_.pluck(files, 'name'), targetPath); + }, + tolerance: 'pointer' }; -function getUniqueName(name) { - if (FileList.findFileEl(name).exists()) { - var numMatch; - var parts=name.split('.'); - var extension = ""; - if (parts.length > 1) { - extension=parts.pop(); - } - var base=parts.join('.'); - numMatch=base.match(/\((\d+)\)/); - var num=2; - if (numMatch && numMatch.length>0) { - num=parseInt(numMatch[numMatch.length-1])+1; - base=base.split('('); - base.pop(); - base=$.trim(base.join('(')); - } - name=base+' ('+num+')'; - if (extension) { - name = name+'.'+extension; - } - return getUniqueName(name); - } - return name; -} - -function checkTrashStatus() { - $.post(OC.filePath('files_trashbin', 'ajax', 'isEmpty.php'), function(result) { - if (result.data.isEmpty === false) { - $("input[type=button][id=trash]").removeAttr("disabled"); - } - }); -} - // override core's fileDownloadPath (legacy) function fileDownloadPath(dir, file) { - return Files.getDownloadUrl(file, dir); + return OCA.Files.Files.getDownloadUrl(file, dir); } +// for backward compatibility +window.Files = OCA.Files.Files; + diff --git a/apps/files/js/filesummary.js b/apps/files/js/filesummary.js new file mode 100644 index 0000000000000000000000000000000000000000..104dabf1b04ec5e533ee08b30e8a7884a54f8387 --- /dev/null +++ b/apps/files/js/filesummary.js @@ -0,0 +1,195 @@ +/** +* ownCloud +* +* @author Vincent Petry +* @copyright 2014 Vincent Petry +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library 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 AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Affero General Public +* License along with this library. If not, see . +* +*/ + +/* global OC, n, t */ + +(function() { + /** + * The FileSummary class encapsulates the file summary values and + * the logic to render it in the given container + * @param $tr table row element + * $param summary optional initial summary value + */ + var FileSummary = function($tr) { + this.$el = $tr; + this.clear(); + this.render(); + }; + + FileSummary.prototype = { + summary: { + totalFiles: 0, + totalDirs: 0, + totalSize: 0 + }, + + /** + * Adds file + * @param file file to add + * @param update whether to update the display + */ + add: function(file, update) { + if (file.type === 'dir' || file.mime === 'httpd/unix-directory') { + this.summary.totalDirs++; + } + else { + this.summary.totalFiles++; + } + this.summary.totalSize += parseInt(file.size, 10) || 0; + if (!!update) { + this.update(); + } + }, + /** + * Removes file + * @param file file to remove + * @param update whether to update the display + */ + remove: function(file, update) { + if (file.type === 'dir' || file.mime === 'httpd/unix-directory') { + this.summary.totalDirs--; + } + else { + this.summary.totalFiles--; + } + this.summary.totalSize -= parseInt(file.size, 10) || 0; + if (!!update) { + this.update(); + } + }, + /** + * Returns the total of files and directories + */ + getTotal: function() { + return this.summary.totalDirs + this.summary.totalFiles; + }, + /** + * Recalculates the summary based on the given files array + * @param files array of files + */ + calculate: function(files) { + var file; + var summary = { + totalDirs: 0, + totalFiles: 0, + totalSize: 0 + }; + + for (var i = 0; i < files.length; i++) { + file = files[i]; + if (file.type === 'dir' || file.mime === 'httpd/unix-directory') { + summary.totalDirs++; + } + else { + summary.totalFiles++; + } + summary.totalSize += parseInt(file.size, 10) || 0; + } + this.setSummary(summary); + }, + /** + * Clears the summary + */ + clear: function() { + this.calculate([]); + }, + /** + * Sets the current summary values + * @param summary map + */ + setSummary: function(summary) { + this.summary = summary; + this.update(); + }, + + /** + * Renders the file summary element + */ + update: function() { + if (!this.$el) { + return; + } + if (!this.summary.totalFiles && !this.summary.totalDirs) { + this.$el.addClass('hidden'); + return; + } + // There's a summary and data -> Update the summary + this.$el.removeClass('hidden'); + var $dirInfo = this.$el.find('.dirinfo'); + var $fileInfo = this.$el.find('.fileinfo'); + var $connector = this.$el.find('.connector'); + + // Substitute old content with new translations + $dirInfo.html(n('files', '%n folder', '%n folders', this.summary.totalDirs)); + $fileInfo.html(n('files', '%n file', '%n files', this.summary.totalFiles)); + this.$el.find('.filesize').html(OC.Util.humanFileSize(this.summary.totalSize)); + + // Show only what's necessary (may be hidden) + if (this.summary.totalDirs === 0) { + $dirInfo.addClass('hidden'); + $connector.addClass('hidden'); + } else { + $dirInfo.removeClass('hidden'); + } + if (this.summary.totalFiles === 0) { + $fileInfo.addClass('hidden'); + $connector.addClass('hidden'); + } else { + $fileInfo.removeClass('hidden'); + } + if (this.summary.totalDirs > 0 && this.summary.totalFiles > 0) { + $connector.removeClass('hidden'); + } + }, + render: function() { + if (!this.$el) { + return; + } + // TODO: ideally this should be separate to a template or something + var summary = this.summary; + var directoryInfo = n('files', '%n folder', '%n folders', summary.totalDirs); + var fileInfo = n('files', '%n file', '%n files', summary.totalFiles); + + var infoVars = { + dirs: ''+directoryInfo+'', + files: ''+fileInfo+'' + }; + + // don't show the filesize column, if filesize is NaN (e.g. in trashbin) + var fileSize = ''; + if (!isNaN(summary.totalSize)) { + fileSize = '' + OC.Util.humanFileSize(summary.totalSize) + ''; + } + + var info = t('files', '{dirs} and {files}', infoVars); + + var $summary = $(''+info+''+fileSize+''); + + if (!this.summary.totalFiles && !this.summary.totalDirs) { + this.$el.addClass('hidden'); + } + + this.$el.append($summary); + } + }; + OCA.Files.FileSummary = FileSummary; +})(); + diff --git a/apps/files/js/keyboardshortcuts.js b/apps/files/js/keyboardshortcuts.js index 9d6c3ae8c3308ddeeb7774ca000aaf95f8886ef3..b2f2cd0e5828ad9b6ea861c0ebd6eaf7d317eaf2 100644 --- a/apps/files/js/keyboardshortcuts.js +++ b/apps/files/js/keyboardshortcuts.js @@ -12,7 +12,6 @@ * enter: open file/folder * delete/backspace: delete file/folder *****************************/ -var Files = Files || {}; (function(Files) { var keys = []; var keyCodes = { @@ -167,4 +166,4 @@ var Files = Files || {}; removeA(keys, event.keyCode); }); }; -})(Files); +})((OCA.Files && OCA.Files.Files) || {}); diff --git a/apps/files/js/navigation.js b/apps/files/js/navigation.js new file mode 100644 index 0000000000000000000000000000000000000000..c58a284e83fe01eb36ff1fcea06427e6788df1e5 --- /dev/null +++ b/apps/files/js/navigation.js @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2014 + * + * @author Vincent Petry + * @copyright 2014 Vincent Petry + * + * This file is licensed under the Affero General Public License version 3 + * or later. + * + * See the COPYING-README file. + * + */ + +(function() { + + var Navigation = function($el) { + this.initialize($el); + }; + + Navigation.prototype = { + + /** + * Currently selected item in the list + */ + _activeItem: null, + + /** + * Currently selected container + */ + $currentContent: null, + + /** + * Initializes the navigation from the given container + * @param $el element containing the navigation + */ + initialize: function($el) { + this.$el = $el; + this._activeItem = null; + this.$currentContent = null; + this._setupEvents(); + }, + + /** + * Setup UI events + */ + _setupEvents: function() { + this.$el.on('click', 'li a', _.bind(this._onClickItem, this)); + }, + + /** + * Returns the container of the currently active app. + * + * @return app container + */ + getActiveContainer: function() { + return this.$currentContent; + }, + + /** + * Returns the currently active item + * + * @return item ID + */ + getActiveItem: function() { + return this._activeItem; + }, + + /** + * Switch the currently selected item, mark it as selected and + * make the content container visible, if any. + * + * @param string itemId id of the navigation item to select + * @param array options "silent" to not trigger event + */ + setActiveItem: function(itemId, options) { + var oldItemId = this._activeItem; + if (itemId === this._activeItem) { + if (!options || !options.silent) { + this.$el.trigger( + new $.Event('itemChanged', {itemId: itemId, previousItemId: oldItemId}) + ); + } + return; + } + this.$el.find('li').removeClass('selected'); + if (this.$currentContent) { + this.$currentContent.addClass('hidden'); + this.$currentContent.trigger(jQuery.Event('hide')); + } + this._activeItem = itemId; + this.$el.find('li[data-id=' + itemId + ']').addClass('selected'); + this.$currentContent = $('#app-content-' + itemId); + this.$currentContent.removeClass('hidden'); + if (!options || !options.silent) { + this.$currentContent.trigger(jQuery.Event('show')); + this.$el.trigger( + new $.Event('itemChanged', {itemId: itemId, previousItemId: oldItemId}) + ); + } + }, + + /** + * Returns whether a given item exists + */ + itemExists: function(itemId) { + return this.$el.find('li[data-id=' + itemId + ']').length; + }, + + /** + * Event handler for when clicking on an item. + */ + _onClickItem: function(ev) { + var $target = $(ev.target); + var itemId = $target.closest('li').attr('data-id'); + this.setActiveItem(itemId); + return false; + } + }; + + OCA.Files.Navigation = Navigation; + +})(); diff --git a/apps/files/l10n/af_ZA.php b/apps/files/l10n/af_ZA.php index 0157af093e92200cc7790497227e92e62d80165f..62c4ec70ac8561064d3251feb9ae7136c48af6aa 100644 --- a/apps/files/l10n/af_ZA.php +++ b/apps/files/l10n/af_ZA.php @@ -1,5 +1,6 @@ "Deel", "_%n folder_::_%n folders_" => array("",""), "_%n file_::_%n files_" => array("",""), "_Uploading %n file_::_Uploading %n files_" => array("","") diff --git a/apps/files/l10n/ar.php b/apps/files/l10n/ar.php index 9a78e3bbff365f73c5c4142a84f262ecaa76a918..ea715c38882ad1c2c6ab0411e8c7625a158a828d 100644 --- a/apps/files/l10n/ar.php +++ b/apps/files/l10n/ar.php @@ -27,22 +27,22 @@ $TRANSLATIONS = array( "Share" => "شارك", "Delete permanently" => "حذف بشكل دائم", "Rename" => "إعادة تسميه", +"Your download is being prepared. This might take some time if the files are big." => "جاري تجهيز عملية التحميل. قد تستغرق بعض الوقت اذا كان حجم الملفات كبير.", +"Pending" => "قيد الانتظار", "Error moving file" => "حدث خطأ أثناء نقل الملف", "Error" => "خطأ", -"Pending" => "قيد الانتظار", +"Name" => "اسم", +"Size" => "حجم", +"Modified" => "معدل", "_%n folder_::_%n folders_" => array("لا يوجد مجلدات %n","1 مجلد %n","2 مجلد %n","عدد قليل من مجلدات %n","عدد كبير من مجلدات %n","مجلدات %n"), "_%n file_::_%n files_" => array("لا يوجد ملفات %n","ملف %n","2 ملف %n","قليل من ملفات %n","الكثير من ملفات %n"," ملفات %n"), -"{dirs} and {files}" => "{dirs} و {files}", "_Uploading %n file_::_Uploading %n files_" => array("لا يوجد ملفات %n لتحميلها","تحميل 1 ملف %n","تحميل 2 ملف %n","يتم تحميل عدد قليل من ملفات %n","يتم تحميل عدد كبير من ملفات %n","يتم تحميل ملفات %n"), "Your storage is full, files can not be updated or synced anymore!" => "مساحتك التخزينية ممتلئة, لا يمكم تحديث ملفاتك أو مزامنتها بعد الآن !", "Your storage is almost full ({usedSpacePercent}%)" => "مساحتك التخزينية امتلأت تقريبا ", "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "تم تمكين تشفير البرامج لكن لم يتم تهيئة المفاتيح لذا يرجى تسجيل الخروج ثم تسجيل الدخول مرة آخرى.", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted 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." => "جاري تجهيز عملية التحميل. قد تستغرق بعض الوقت اذا كان حجم الملفات كبير.", -"Name" => "اسم", -"Size" => "حجم", -"Modified" => "معدل", +"{dirs} and {files}" => "{dirs} و {files}", "%s could not be renamed" => "%s لا يمكن إعادة تسميته. ", "File handling" => "التعامل مع الملف", "Maximum upload size" => "الحد الأقصى لحجم الملفات التي يمكن رفعها", @@ -52,12 +52,13 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 = غير محدود", "Maximum input size for ZIP files" => "الحد الأقصى المسموح به لملفات ZIP", "Save" => "حفظ", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "استخدم هذا العنوان لـ الدخول الى ملفاتك عن طريق WebDAV", "New" => "جديد", "Text file" => "ملف", "New folder" => "مجلد جديد", "Folder" => "مجلد", "From link" => "من رابط", -"Deleted files" => "حذف الملفات", "Cancel upload" => "إلغاء رفع الملفات", "Nothing in here. Upload something!" => "لا يوجد شيء هنا. إرفع بعض الملفات!", "Download" => "تحميل", diff --git a/apps/files/l10n/ast.php b/apps/files/l10n/ast.php index 5c6af60be3ddc6fd1b99f3926608eb5c89d02344..b0ba541778dfed0c6009d976db8e0ff8f038f82f 100644 --- a/apps/files/l10n/ast.php +++ b/apps/files/l10n/ast.php @@ -1,29 +1,67 @@ "Nun pudo movese %s - Yá existe un ficheru con esi nome.", +"Could not move %s" => "Nun pudo movese %s", "File name cannot be empty." => "El nome de ficheru nun pue quedar baleru.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nome inválidu, los caráuteres \"\\\", \"/\", \"<\", \">\", \":\", \"\", \"|\" \"?\" y \"*\" nun tán permitíos.", +"Unable to set upload directory." => "Nun se puede afitar la carpeta de xubida.", +"Invalid Token" => "Token inválidu", "No file was uploaded. Unknown error" => "Nun se xubió dengún ficheru. Fallu desconocíu", "There is no error, the file uploaded with success" => "Nun hai dengún fallu, el ficheru xubióse ensin problemes", +"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "El ficheru xubíu perpasa la direutiva \"upload_max_filesize\" del ficheru php.ini", "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "El ficheru xubíu perpasa la direutiva \"MAX_FILE_SIZE\" especificada nel formulariu HTML", "The uploaded file was only partially uploaded" => "El ficheru xubióse de mou parcial", "No file was uploaded" => "Nun se xubió dengún ficheru", "Missing a temporary folder" => "Falta una carpeta temporal", "Failed to write to disk" => "Fallu al escribir al discu", "Not enough storage available" => "Nun hai abondu espaciu disponible", +"Upload failed. Could not find uploaded file" => "Xubida fallía. Nun se pudo atopar el ficheru xubíu.", +"Upload failed. Could not get file info." => "Falló la xubida. Nun se pudo obtener la información del ficheru.", +"Invalid directory." => "Carpeta non válida.", "Files" => "Ficheros", +"Unable to upload {filename} as it is a directory or has 0 bytes" => "Nun se pudo xubir {filename}, paez que ye un directoriu o tien 0 bytes", +"Upload cancelled." => "Xubida encaboxada.", +"Could not get result from server." => "Nun se pudo obtener el resultáu del servidor.", +"File upload is in progress. Leaving the page now will cancel the upload." => "La xubida del ficheru ta en progresu. Si dexes esta páxina encaboxarase la xubida.", +"{new_name} already exists" => "{new_name} yá existe", "Share" => "Compartir", +"Delete permanently" => "Desaniciar dafechu", "Rename" => "Renomar", +"Your download is being prepared. This might take some time if the files are big." => "Ta preparándose la descarga. Esto podría llevar dalgún tiempu si los ficheros son grandes.", +"Error moving file" => "Fallu moviendo'l ficheru", "Error" => "Fallu", +"Name" => "Nome", +"Size" => "Tamañu", +"Modified" => "Modificáu", "_%n folder_::_%n folders_" => array("",""), "_%n file_::_%n files_" => array("",""), "_Uploading %n file_::_Uploading %n files_" => array("",""), -"Name" => "Nome", -"Size" => "Tamañu", +"Your storage is full, files can not be updated or synced anymore!" => "L'almacenamientu ta completu, ¡yá nun se pueden anovar o sincronizar ficheros!", +"Your storage is almost full ({usedSpacePercent}%)" => "L'almacenamientu ta casi completu ({usedSpacePercent}%)", +"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Deshabilitose'l cifráu pero los tos ficheros tovía tan cifraos. Por favor, vete a los axustes personales pa descrifrar los tos ficheros.", +"%s could not be renamed" => "Nun se puede renomar %s ", +"File handling" => "Alministración de ficheros", +"Maximum upload size" => "Tamañu máximu de xubida", +"max. possible: " => "máx. posible:", +"Needed for multi-file and folder downloads." => "Ye necesariu pa descargues multificheru y de carpetes", +"Enable ZIP-download" => "Activar descarga ZIP", +"0 is unlimited" => "0 ye illimitao", +"Maximum input size for ZIP files" => "Tamañu máximu d'entrada pa ficheros ZIP", "Save" => "Guardar", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Usa esta direición pa acceder a los ficheros a traviés de WebDAV", +"New" => "Nuevu", +"Text file" => "Ficheru de testu", "New folder" => "Nueva carpeta", "Folder" => "Carpeta", +"From link" => "Dende enllaz", "Cancel upload" => "Encaboxar xuba", +"Nothing in here. Upload something!" => "Nun hai nada equí. ¡Xubi daqué!", "Download" => "Descargar", -"Delete" => "Desaniciar" +"Delete" => "Desaniciar", +"Upload too large" => "La xubida ye demasiao grande", +"The files you are trying to upload exceed the maximum size for file uploads on this server." => "Los ficheros que tas intentando xubir perpasen el tamañu máximu pa les xubíes de ficheros nesti servidor.", +"Files are being scanned, please wait." => "Tan escaniándose los ficheros, espera por favor.", +"Current scanning" => "Escanéu actual" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/bg_BG.php b/apps/files/l10n/bg_BG.php index d9cad21e79e986f09da4dbcf5ee9b5c4f63eeae1..7b5bac636d793089cf2f4586d39cb5d7deaa2e37 100644 --- a/apps/files/l10n/bg_BG.php +++ b/apps/files/l10n/bg_BG.php @@ -12,17 +12,18 @@ $TRANSLATIONS = array( "Share" => "Споделяне", "Delete permanently" => "Изтриване завинаги", "Rename" => "Преименуване", -"Error" => "Грешка", "Pending" => "Чакащо", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), -"_Uploading %n file_::_Uploading %n files_" => array("",""), +"Error" => "Грешка", "Name" => "Име", "Size" => "Размер", "Modified" => "Променено", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), +"_Uploading %n file_::_Uploading %n files_" => array("",""), "Maximum upload size" => "Максимален размер за качване", "0 is unlimited" => "Ползвайте 0 за без ограничения", "Save" => "Запис", +"WebDAV" => "WebDAV", "New" => "Ново", "Text file" => "Текстов файл", "New folder" => "Нова папка", diff --git a/apps/files/l10n/bn_BD.php b/apps/files/l10n/bn_BD.php index 4d71d7dacd386e988619829a623f3d3c9df81056..dd639b4955c294891314bbcc763e3ff7e2bd95d6 100644 --- a/apps/files/l10n/bn_BD.php +++ b/apps/files/l10n/bn_BD.php @@ -19,14 +19,14 @@ $TRANSLATIONS = array( "{new_name} already exists" => "{new_name} টি বিদ্যমান", "Share" => "ভাগাভাগি কর", "Rename" => "পূনঃনামকরণ", -"Error" => "সমস্যা", "Pending" => "মুলতুবি", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), -"_Uploading %n file_::_Uploading %n files_" => array("",""), +"Error" => "সমস্যা", "Name" => "রাম", "Size" => "আকার", "Modified" => "পরিবর্তিত", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), +"_Uploading %n file_::_Uploading %n files_" => array("",""), "File handling" => "ফাইল হ্যার্ডলিং", "Maximum upload size" => "আপলোডের সর্বোচ্চ আকার", "max. possible: " => "অনুমোদিত সর্বোচ্চ আকার", @@ -35,6 +35,7 @@ $TRANSLATIONS = array( "0 is unlimited" => "০ এর অর্থ অসীম", "Maximum input size for ZIP files" => "ZIP ফাইলের ইনপুটের সর্বোচ্চ আকার", "Save" => "সংরক্ষণ", +"WebDAV" => "WebDAV", "New" => "নতুন", "Text file" => "টেক্সট ফাইল", "Folder" => "ফোল্ডার", diff --git a/apps/files/l10n/bs.php b/apps/files/l10n/bs.php index 47276eccda09a949995588f2a27a9c0aee4d3d8e..89ff91da0311abefb470917d664f273112a624df 100644 --- a/apps/files/l10n/bs.php +++ b/apps/files/l10n/bs.php @@ -1,11 +1,11 @@ "Podijeli", +"Name" => "Ime", +"Size" => "Veličina", "_%n folder_::_%n folders_" => array("","",""), "_%n file_::_%n files_" => array("","",""), "_Uploading %n file_::_Uploading %n files_" => array("","",""), -"Name" => "Ime", -"Size" => "Veličina", "Save" => "Spasi", "New folder" => "Nova fascikla", "Folder" => "Fasikla" diff --git a/apps/files/l10n/ca.php b/apps/files/l10n/ca.php index 6938da220b270f23b0791e0f73c12a053321bb58..240e61bfd961d52b2588c9c92c15d81dca739dae 100644 --- a/apps/files/l10n/ca.php +++ b/apps/files/l10n/ca.php @@ -42,14 +42,18 @@ $TRANSLATIONS = array( "Share" => "Comparteix", "Delete permanently" => "Esborra permanentment", "Rename" => "Reanomena", +"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.", +"Pending" => "Pendent", +"Error moving file." => "Error en moure el fitxer.", "Error moving file" => "Error en moure el fitxer", "Error" => "Error", -"Pending" => "Pendent", "Could not rename file" => "No es pot canviar el nom de fitxer", "Error deleting file." => "Error en esborrar 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"), -"{dirs} and {files}" => "{dirs} i {files}", "_Uploading %n file_::_Uploading %n files_" => array("Pujant %n fitxer","Pujant %n fitxers"), "\"{name}\" is an invalid file name." => "\"{name}\" no es un fitxer vàlid.", "Your storage is full, files can not be updated or synced anymore!" => "El vostre espai d'emmagatzemament és ple, els fitxers ja no es poden actualitzar o sincronitzar!", @@ -57,10 +61,7 @@ $TRANSLATIONS = array( "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "L'aplicació d'encriptació està activada però les claus no estan inicialitzades, sortiu i acrediteu-vos de nou.", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "La clau privada de l'aplicació d'encriptació no és vàlida! Actualitzeu la contrasenya de la clau privada a l'arranjament personal per recuperar els fitxers encriptats.", "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.", -"Name" => "Nom", -"Size" => "Mida", -"Modified" => "Modificat", +"{dirs} and {files}" => "{dirs} i {files}", "%s could not be renamed" => "%s no es pot canviar el nom", "File handling" => "Gestió de fitxers", "Maximum upload size" => "Mida màxima de pujada", @@ -70,13 +71,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 és sense límit", "Maximum input size for ZIP files" => "Mida màxima d'entrada per fitxers ZIP", "Save" => "Desa", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Useu aquesta adreça per accedir als fitxers via WebDAV", "New" => "Nou", "New text file" => "Nou fitxer de text", "Text file" => "Fitxer de text", "New folder" => "Carpeta nova", "Folder" => "Carpeta", "From link" => "Des d'enllaç", -"Deleted files" => "Fitxers esborrats", "Cancel upload" => "Cancel·la la pujada", "You don’t have permission to upload or create files here" => "No teniu permisos per a pujar o crear els fitxers aquí", "Nothing in here. Upload something!" => "Res per aquí. Pugeu alguna cosa!", diff --git a/apps/files/l10n/cs_CZ.php b/apps/files/l10n/cs_CZ.php index 40bb288ca1a1fee9201d1e9795cb2831b295f954..1af95dc7fed4e1c595b23e42762df910ec2f3cfd 100644 --- a/apps/files/l10n/cs_CZ.php +++ b/apps/files/l10n/cs_CZ.php @@ -42,14 +42,18 @@ $TRANSLATIONS = array( "Share" => "Sdílet", "Delete permanently" => "Trvale odstranit", "Rename" => "Přejmenovat", +"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.", +"Pending" => "Nevyřízené", +"Error moving file." => "Chyba při přesunu souboru.", "Error moving file" => "Chyba při přesunu souboru", "Error" => "Chyba", -"Pending" => "Nevyřízené", "Could not rename file" => "Nepodařilo se přejmenovat soubor", "Error deleting file." => "Chyba při mazání 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ů"), -"{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ů"), "\"{name}\" is an invalid file name." => "\"{name}\" je neplatným názvem souboru.", "Your storage is full, files can not be updated or synced anymore!" => "Vaše úložiště je plné, nelze aktualizovat ani synchronizovat soubory.", @@ -57,10 +61,7 @@ $TRANSLATIONS = array( "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Aplikace pro šifrování je zapnuta, ale vaše klíče nejsou inicializované. Prosím odhlaste se a znovu přihlaste", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Chybný soukromý klíč pro šifrovací aplikaci. Aktualizujte prosím heslo svého soukromého klíče ve vašem osobním nastavení, abyste znovu získali přístup k vašim zašifrovaným souborům.", "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.", -"Name" => "Název", -"Size" => "Velikost", -"Modified" => "Upraveno", +"{dirs} and {files}" => "{dirs} a {files}", "%s could not be renamed" => "%s nemůže být přejmenován", "Upload (max. %s)" => "Nahrát (max. %s)", "File handling" => "Zacházení se soubory", @@ -71,13 +72,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 znamená bez omezení", "Maximum input size for ZIP files" => "Maximální velikost vstupu pro ZIP soubory", "Save" => "Uložit", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Použijte tuto adresu pro přístup k vašim souborům přes WebDAV", "New" => "Nový", "New text file" => "Nový textový soubor", "Text file" => "Textový soubor", "New folder" => "Nová složka", "Folder" => "Složka", "From link" => "Z odkazu", -"Deleted files" => "Odstraněné soubory", "Cancel upload" => "Zrušit odesílání", "You don’t have permission to upload or create files here" => "Nemáte oprávnění zde nahrávat či vytvářet soubory", "Nothing in here. Upload something!" => "Žádný obsah. Nahrajte něco.", diff --git a/apps/files/l10n/cy_GB.php b/apps/files/l10n/cy_GB.php index f0c12b2fdebe569ab139d181c50d9163e9b7488f..6b4796c3e9a30e334fe9a6670fd0e84a8ebdfdfc 100644 --- a/apps/files/l10n/cy_GB.php +++ b/apps/files/l10n/cy_GB.php @@ -21,17 +21,17 @@ $TRANSLATIONS = array( "Share" => "Rhannu", "Delete permanently" => "Dileu'n barhaol", "Rename" => "Ailenwi", -"Error" => "Gwall", +"Your download is being prepared. This might take some time if the files are big." => "Wrthi'n paratoi i lwytho i lawr. Gall gymryd peth amser os yw'r ffeiliau'n fawr.", "Pending" => "I ddod", +"Error" => "Gwall", +"Name" => "Enw", +"Size" => "Maint", +"Modified" => "Addaswyd", "_%n folder_::_%n folders_" => array("","","",""), "_%n file_::_%n files_" => array("","","",""), "_Uploading %n file_::_Uploading %n files_" => array("","","",""), "Your storage is full, files can not be updated or synced anymore!" => "Mae eich storfa'n llawn, ni ellir diweddaru a chydweddu ffeiliau mwyach!", "Your storage is almost full ({usedSpacePercent}%)" => "Mae eich storfa bron a bod yn llawn ({usedSpacePercent}%)", -"Your download is being prepared. This might take some time if the files are big." => "Wrthi'n paratoi i lwytho i lawr. Gall gymryd peth amser os yw'r ffeiliau'n fawr.", -"Name" => "Enw", -"Size" => "Maint", -"Modified" => "Addaswyd", "File handling" => "Trafod ffeiliau", "Maximum upload size" => "Maint mwyaf llwytho i fyny", "max. possible: " => "mwyaf. posib:", @@ -44,7 +44,6 @@ $TRANSLATIONS = array( "Text file" => "Ffeil destun", "Folder" => "Plygell", "From link" => "Dolen o", -"Deleted files" => "Ffeiliau ddilewyd", "Cancel upload" => "Diddymu llwytho i fyny", "Nothing in here. Upload something!" => "Does dim byd fan hyn. Llwythwch rhywbeth i fyny!", "Download" => "Llwytho i lawr", diff --git a/apps/files/l10n/da.php b/apps/files/l10n/da.php index 9a6ea9c0dce30dba61ad14a0c03327fbb4d73181..1f73fb89f4101bc6a219eefc09e00464ac9b69aa 100644 --- a/apps/files/l10n/da.php +++ b/apps/files/l10n/da.php @@ -42,14 +42,18 @@ $TRANSLATIONS = array( "Share" => "Del", "Delete permanently" => "Slet permanent", "Rename" => "Omdøb", +"Your download is being prepared. This might take some time if the files are big." => "Dit download forberedes. Dette kan tage lidt tid ved større filer.", +"Pending" => "Afventer", +"Error moving file." => "Fejl ved flytning af fil", "Error moving file" => "Fejl ved flytning af fil", "Error" => "Fejl", -"Pending" => "Afventer", "Could not rename file" => "Kunne ikke omdøbe filen", "Error deleting file." => "Fejl ved sletnign af fil.", +"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"), -"{dirs} and {files}" => "{dirs} og {files}", "_Uploading %n file_::_Uploading %n files_" => array("Uploader %n fil","Uploader %n filer"), "\"{name}\" is an invalid file name." => "'{name}' er et ugyldigt filnavn.", "Your storage is full, files can not be updated or synced anymore!" => "Din opbevaringsplads er fyldt op, filer kan ikke opdateres eller synkroniseres længere!", @@ -57,11 +61,9 @@ $TRANSLATIONS = array( "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Krypteringsprogrammet er aktiveret, men din nøgle er ikke igangsat. Log venligst ud og ind igen.", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Ugyldig privat nøgle for krypteringsprogrammet. Opdater venligst dit kodeord for den private nøgle i dine personlige indstillinger. Det kræves for at få adgang til dine krypterede filer.", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Krypteringen blev deaktiveret, men dine filer er stadig krypteret. Gå venligst til dine personlige indstillinger for at dekryptere dine filer. ", -"Your download is being prepared. This might take some time if the files are big." => "Dit download forberedes. Dette kan tage lidt tid ved større filer.", -"Name" => "Navn", -"Size" => "Størrelse", -"Modified" => "Ændret", +"{dirs} and {files}" => "{dirs} og {files}", "%s could not be renamed" => "%s kunne ikke omdøbes", +"Upload (max. %s)" => "Upload (max. %s)", "File handling" => "Filhåndtering", "Maximum upload size" => "Maksimal upload-størrelse", "max. possible: " => "max. mulige: ", @@ -70,13 +72,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 er ubegrænset", "Maximum input size for ZIP files" => "Maksimal størrelse på ZIP filer", "Save" => "Gem", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Brug denne adresse for at tilgå dine filer via WebDAV", "New" => "Ny", "New text file" => "Ny tekstfil", "Text file" => "Tekstfil", "New folder" => "Ny Mappe", "Folder" => "Mappe", "From link" => "Fra link", -"Deleted files" => "Slettede filer", "Cancel upload" => "Fortryd upload", "You don’t have permission to upload or create files here" => "Du har ikke tilladelse til at uploade eller oprette filer her", "Nothing in here. Upload something!" => "Her er tomt. Upload noget!", diff --git a/apps/files/l10n/de.php b/apps/files/l10n/de.php index 1d15469dac62431a5a5034844b59d8d1efd476e0..a1472b6e09bda67e67110299c1787b259d2e9a08 100644 --- a/apps/files/l10n/de.php +++ b/apps/files/l10n/de.php @@ -28,6 +28,7 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "Hochladen fehlgeschlagen. Dateiinformationen konnten nicht abgerufen werden.", "Invalid directory." => "Ungültiges Verzeichnis.", "Files" => "Dateien", +"All files" => "Alle Dateien", "Unable to upload {filename} as it is a directory or has 0 bytes" => "Die Datei {filename} kann nicht hochgeladen werden, da sie entweder ein Verzeichnis oder 0 Bytes groß ist", "Total file size {size1} exceeds upload limit {size2}" => "Die Gesamt-Größe {size1} überschreitet die Upload-Begrenzung {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" => "Nicht genügend freier Speicherplatz, du möchtest {size1} hochladen, es sind jedoch nur noch {size2} verfügbar.", @@ -42,14 +43,18 @@ $TRANSLATIONS = array( "Share" => "Teilen", "Delete permanently" => "Endgültig löschen", "Rename" => "Umbenennen", +"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.", +"Pending" => "Ausstehend", +"Error moving file." => "Fehler beim Verschieben der Datei.", "Error moving file" => "Fehler beim Verschieben der Datei", "Error" => "Fehler", -"Pending" => "Ausstehend", "Could not rename file" => "Die Datei konnte nicht umbenannt werden", "Error deleting file." => "Fehler beim Löschen 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"), -"{dirs} and {files}" => "{dirs} und {files}", "_Uploading %n file_::_Uploading %n files_" => array("%n Datei wird hochgeladen","%n Dateien werden hochgeladen"), "\"{name}\" is an invalid file name." => "\"{name}\" ist kein gültiger Dateiname.", "Your storage is full, files can not be updated or synced anymore!" => "Dein Speicher ist voll, daher können keine Dateien mehr aktualisiert oder synchronisiert werden!", @@ -57,10 +62,7 @@ $TRANSLATIONS = array( "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Die Verschlüsselung-App ist aktiviert, aber Deine Schlüssel sind nicht initialisiert. Bitte melden Dich nochmals ab und wieder an.", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Ungültiger privater Schlüssel für die Verschlüsselung-App. Bitte aktualisiere Dein privates Schlüssel-Passwort, um den Zugriff auf Deine verschlüsselten Dateien wiederherzustellen.", "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.", -"Name" => "Name", -"Size" => "Größe", -"Modified" => "Geändert", +"{dirs} and {files}" => "{dirs} und {files}", "%s could not be renamed" => "%s konnte nicht umbenannt werden", "Upload (max. %s)" => "Hochladen (max. %s)", "File handling" => "Dateibehandlung", @@ -71,13 +73,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 bedeutet unbegrenzt", "Maximum input size for ZIP files" => "Maximale Größe für ZIP-Dateien", "Save" => "Speichern", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Verwenden Sie diese Adresse, um via WebDAV auf Ihre Dateien zuzugreifen", "New" => "Neu", "New text file" => "Neue Textdatei", "Text file" => "Textdatei", "New folder" => "Neuer Ordner", "Folder" => "Ordner", "From link" => "Von einem Link", -"Deleted files" => "Gelöschte Dateien", "Cancel upload" => "Upload abbrechen", "You don’t have permission to upload or create files here" => "Du besitzt hier keine Berechtigung, um Dateien hochzuladen oder zu erstellen", "Nothing in here. Upload something!" => "Alles leer. Lade etwas hoch!", diff --git a/apps/files/l10n/de_CH.php b/apps/files/l10n/de_CH.php index 907b9e1b67ed380b51ff7359cb5ff1dc05a386c3..fc80bfdc7d11615d8852c997741e7eeb36cdccb3 100644 --- a/apps/files/l10n/de_CH.php +++ b/apps/files/l10n/de_CH.php @@ -23,18 +23,18 @@ $TRANSLATIONS = array( "Share" => "Teilen", "Delete permanently" => "Endgültig löschen", "Rename" => "Umbenennen", -"Error" => "Fehler", +"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.", "Pending" => "Ausstehend", +"Error" => "Fehler", +"Name" => "Name", +"Size" => "Grösse", +"Modified" => "Geändert", "_%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"), "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", "File handling" => "Dateibehandlung", "Maximum upload size" => "Maximale Upload-Grösse", @@ -44,12 +44,12 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 bedeutet unbegrenzt", "Maximum input size for ZIP files" => "Maximale Grösse für ZIP-Dateien", "Save" => "Speichern", +"WebDAV" => "WebDAV", "New" => "Neu", "Text file" => "Textdatei", "New folder" => "Neues Verzeichnis", "Folder" => "Ordner", "From link" => "Von einem Link", -"Deleted files" => "Gelöschte Dateien", "Cancel upload" => "Upload abbrechen", "Nothing in here. Upload something!" => "Alles leer. Laden Sie etwas hoch!", "Download" => "Herunterladen", diff --git a/apps/files/l10n/de_DE.php b/apps/files/l10n/de_DE.php index 41ca83e6f8780a8740572dc2d99252dd8e3cecee..d94361a676d9c3087a5e131c18db52a18ddbdc05 100644 --- a/apps/files/l10n/de_DE.php +++ b/apps/files/l10n/de_DE.php @@ -28,6 +28,7 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "Hochladen fehlgeschlagen. Die Dateiinformationen konnten nicht abgerufen werden.", "Invalid directory." => "Ungültiges Verzeichnis.", "Files" => "Dateien", +"All files" => "Alle Dateien", "Unable to upload {filename} as it is a directory or has 0 bytes" => "Die Datei {filename} kann nicht hochgeladen werden, da sie entweder ein Verzeichnis oder 0 Bytes groß ist", "Total file size {size1} exceeds upload limit {size2}" => "Die Gesamt-Größe {size1} überschreitet die Upload-Begrenzung {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" => "Nicht genügend freier Speicherplatz, Sie möchten {size1} hochladen, es sind jedoch nur noch {size2} verfügbar.", @@ -42,14 +43,18 @@ $TRANSLATIONS = array( "Share" => "Teilen", "Delete permanently" => "Endgültig löschen", "Rename" => "Umbenennen", +"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.", +"Pending" => "Ausstehend", +"Error moving file." => "Fehler beim Verschieben der Datei.", "Error moving file" => "Fehler beim Verschieben der Datei", "Error" => "Fehler", -"Pending" => "Ausstehend", "Could not rename file" => "Die Datei konnte nicht umbenannt werden", "Error deleting file." => "Fehler beim Löschen 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"), -"{dirs} and {files}" => "{dirs} und {files}", "_Uploading %n file_::_Uploading %n files_" => array("%n Datei wird hoch geladen","%n Dateien werden hoch geladen"), "\"{name}\" is an invalid file name." => "\"{name}\" ist kein gültiger Dateiname.", "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!", @@ -57,10 +62,7 @@ $TRANSLATIONS = array( "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Verschlüsselung-App ist aktiviert, aber Ihre Schlüssel sind nicht initialisiert. Bitte melden sich nochmals ab und wieder an.", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Ungültiger privater Schlüssel für die Verschlüsselung-App. Bitte aktualisieren Sie Ihr privates Schlüssel-Passwort, um den Zugriff auf Ihre verschlüsselten Dateien wiederherzustellen.", "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.", -"Name" => "Name", -"Size" => "Größe", -"Modified" => "Geändert", +"{dirs} and {files}" => "{dirs} und {files}", "%s could not be renamed" => "%s konnte nicht umbenannt werden", "Upload (max. %s)" => "Hochladen (max. %s)", "File handling" => "Dateibehandlung", @@ -71,13 +73,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 bedeutet unbegrenzt", "Maximum input size for ZIP files" => "Maximale Größe für ZIP-Dateien", "Save" => "Speichern", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Verwenden Sie diese Adresse, um via WebDAV auf Ihre Dateien zuzugreifen", "New" => "Neu", "New text file" => "Neue Textdatei", "Text file" => "Textdatei", "New folder" => "Neuer Ordner", "Folder" => "Ordner", "From link" => "Von einem Link", -"Deleted files" => "Gelöschte Dateien", "Cancel upload" => "Upload abbrechen", "You don’t have permission to upload or create files here" => "Sie besitzen hier keine Berechtigung Dateien hochzuladen oder zu erstellen", "Nothing in here. Upload something!" => "Alles leer. Laden Sie etwas hoch!", diff --git a/apps/files/l10n/el.php b/apps/files/l10n/el.php index f103d0621e5293e3e54641501ab8a1284cb86b34..892926368100a9920010f3c3d397df24250d3271 100644 --- a/apps/files/l10n/el.php +++ b/apps/files/l10n/el.php @@ -42,14 +42,18 @@ $TRANSLATIONS = array( "Share" => "Διαμοιρασμός", "Delete permanently" => "Μόνιμη διαγραφή", "Rename" => "Μετονομασία", +"Your download is being prepared. This might take some time if the files are big." => "Η λήψη προετοιμάζεται. Αυτό μπορεί να πάρει ώρα εάν τα αρχεία έχουν μεγάλο μέγεθος.", +"Pending" => "Εκκρεμεί", +"Error moving file." => "Σφάλμα κατά τη μετακίνηση του αρχείου.", "Error moving file" => "Σφάλμα κατά τη μετακίνηση του αρχείου", "Error" => "Σφάλμα", -"Pending" => "Εκκρεμεί", "Could not rename file" => "Αδυναμία μετονομασίας αρχείου", "Error deleting file." => "Σφάλμα διαγραφής αρχείου.", +"Name" => "Όνομα", +"Size" => "Μέγεθος", +"Modified" => "Τροποποιήθηκε", "_%n folder_::_%n folders_" => array("%n φάκελος","%n φάκελοι"), "_%n file_::_%n files_" => array("%n αρχείο","%n αρχεία"), -"{dirs} and {files}" => "{Κατάλογοι αρχείων} και {αρχεία}", "_Uploading %n file_::_Uploading %n files_" => array("Ανέβασμα %n αρχείου","Ανέβασμα %n αρχείων"), "\"{name}\" is an invalid file name." => "Το \"{name}\" είναι μη έγκυρο όνομα αρχείου.", "Your storage is full, files can not be updated or synced anymore!" => "Ο αποθηκευτικός σας χώρος είναι γεμάτος, τα αρχεία δεν μπορούν να ενημερωθούν ή να συγχρονιστούν πια!", @@ -57,11 +61,9 @@ $TRANSLATIONS = array( "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Η εφαρμογή κρυπτογράφησης είναι ενεργοποιημένη αλλά τα κλειδιά σας δεν έχουν καταγραφεί, παρακαλώ αποσυνδεθείτε και επανασυνδεθείτε.", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted 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." => "Η λήψη προετοιμάζεται. Αυτό μπορεί να πάρει ώρα εάν τα αρχεία έχουν μεγάλο μέγεθος.", -"Name" => "Όνομα", -"Size" => "Μέγεθος", -"Modified" => "Τροποποιήθηκε", +"{dirs} and {files}" => "{Κατάλογοι αρχείων} και {αρχεία}", "%s could not be renamed" => "Αδυναμία μετονομασίας του %s", +"Upload (max. %s)" => "Διαμοιρασμός (max. %s)", "File handling" => "Διαχείριση αρχείων", "Maximum upload size" => "Μέγιστο μέγεθος αποστολής", "max. possible: " => "μέγιστο δυνατό:", @@ -70,13 +72,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 για απεριόριστο", "Maximum input size for ZIP files" => "Μέγιστο μέγεθος για αρχεία ZIP", "Save" => "Αποθήκευση", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Χρησιμοποιήστε αυτήν την διεύθυνση για να αποκτήσετε πρόσβαση στα αρχεία σας μέσω WebDAV", "New" => "Νέο", "New text file" => "Νέο αρχείο κειμένου", "Text file" => "Αρχείο κειμένου", "New folder" => "Νέος κατάλογος", "Folder" => "Φάκελος", "From link" => "Από σύνδεσμο", -"Deleted files" => "Διαγραμμένα αρχεία", "Cancel upload" => "Ακύρωση αποστολής", "You don’t have permission to upload or create files here" => "Δεν έχετε δικαιώματα φόρτωσης ή δημιουργίας αρχείων εδώ", "Nothing in here. Upload something!" => "Δεν υπάρχει τίποτα εδώ. Ανεβάστε κάτι!", diff --git a/apps/files/l10n/en_GB.php b/apps/files/l10n/en_GB.php index 93e1007e37cb96836c8bff6a851f9b5f2211c0bf..e64b7f4cc95e5016e2725f7ed6d5c67650f40b72 100644 --- a/apps/files/l10n/en_GB.php +++ b/apps/files/l10n/en_GB.php @@ -42,14 +42,18 @@ $TRANSLATIONS = array( "Share" => "Share", "Delete permanently" => "Delete permanently", "Rename" => "Rename", +"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.", +"Pending" => "Pending", +"Error moving file." => "Error moving file.", "Error moving file" => "Error moving file", "Error" => "Error", -"Pending" => "Pending", "Could not rename file" => "Could not rename file", "Error deleting file." => "Error deleting file.", +"Name" => "Name", +"Size" => "Size", +"Modified" => "Modified", "_%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"), "\"{name}\" is an invalid file name." => "\"{name}\" is an invalid file name.", "Your storage is full, files can not be updated or synced anymore!" => "Your storage is full, files can not be updated or synced anymore!", @@ -57,10 +61,7 @@ $TRANSLATIONS = array( "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Encryption App is enabled but your keys are not initialised, please log-out and log-in again", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files.", "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.", -"Name" => "Name", -"Size" => "Size", -"Modified" => "Modified", +"{dirs} and {files}" => "{dirs} and {files}", "%s could not be renamed" => "%s could not be renamed", "Upload (max. %s)" => "Upload (max. %s)", "File handling" => "File handling", @@ -71,13 +72,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 is unlimited", "Maximum input size for ZIP files" => "Maximum input size for ZIP files", "Save" => "Save", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Use this address to access your Files via WebDAV", "New" => "New", "New text file" => "New text file", "Text file" => "Text file", "New folder" => "New folder", "Folder" => "Folder", "From link" => "From link", -"Deleted files" => "Deleted files", "Cancel upload" => "Cancel upload", "You don’t have permission to upload or create files here" => "You don’t have permission to upload or create files here", "Nothing in here. Upload something!" => "Nothing in here. Upload something!", diff --git a/apps/files/l10n/en_NZ.php b/apps/files/l10n/en_NZ.php new file mode 100644 index 0000000000000000000000000000000000000000..0157af093e92200cc7790497227e92e62d80165f --- /dev/null +++ b/apps/files/l10n/en_NZ.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/eo.php b/apps/files/l10n/eo.php index dfa6f7ec038713ee487a63ebb9972b6035acaa6a..9aaf72d98ad39bde2820458dcd4f5097979270ae 100644 --- a/apps/files/l10n/eo.php +++ b/apps/files/l10n/eo.php @@ -35,20 +35,20 @@ $TRANSLATIONS = array( "Share" => "Kunhavigi", "Delete permanently" => "Forigi por ĉiam", "Rename" => "Alinomigi", +"Your download is being prepared. This might take some time if the files are big." => "Via elŝuto pretiĝatas. Ĉi tio povas daŭri iom da tempo se la dosieroj grandas.", +"Pending" => "Traktotaj", "Error moving file" => "Eraris movo de dosiero", "Error" => "Eraro", -"Pending" => "Traktotaj", "Could not rename file" => "Ne povis alinomiĝi dosiero", +"Name" => "Nomo", +"Size" => "Grando", +"Modified" => "Modifita", "_%n folder_::_%n folders_" => array("%n dosierujo","%n dosierujoj"), "_%n file_::_%n files_" => array("%n dosiero","%n dosieroj"), -"{dirs} and {files}" => "{dirs} kaj {files}", "_Uploading %n file_::_Uploading %n files_" => array("Alŝutatas %n dosiero","Alŝutatas %n dosieroj"), "Your storage is full, files can not be updated or synced anymore!" => "Via memoro plenas, ne plu eblas ĝisdatigi aŭ sinkronigi dosierojn!", "Your storage is almost full ({usedSpacePercent}%)" => "Via memoro preskaŭ plenas ({usedSpacePercent}%)", -"Your download is being prepared. This might take some time if the files are big." => "Via elŝuto pretiĝatas. Ĉi tio povas daŭri iom da tempo se la dosieroj grandas.", -"Name" => "Nomo", -"Size" => "Grando", -"Modified" => "Modifita", +"{dirs} and {files}" => "{dirs} kaj {files}", "%s could not be renamed" => "%s ne povis alinomiĝi", "File handling" => "Dosieradministro", "Maximum upload size" => "Maksimuma alŝutogrando", @@ -58,12 +58,12 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 signifas senlime", "Maximum input size for ZIP files" => "Maksimuma enirgrando por ZIP-dosieroj", "Save" => "Konservi", +"WebDAV" => "WebDAV", "New" => "Nova", "Text file" => "Tekstodosiero", "New folder" => "Nova dosierujo", "Folder" => "Dosierujo", "From link" => "El ligilo", -"Deleted files" => "Forigitaj dosieroj", "Cancel upload" => "Nuligi alŝuton", "You don’t have permission to upload or create files here" => "Vi ne havas permeson alŝuti aŭ krei dosierojn ĉi tie", "Nothing in here. Upload something!" => "Nenio estas ĉi tie. Alŝutu ion!", diff --git a/apps/files/l10n/es.php b/apps/files/l10n/es.php index fd1d915ea8c90c7c8d9ed71deb88a247f9e7cb93..0a56a324a236c8834dba87910d84df0117878bba 100644 --- a/apps/files/l10n/es.php +++ b/apps/files/l10n/es.php @@ -28,6 +28,7 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "Actualización fallida. No se pudo obtener información del archivo.", "Invalid directory." => "Directorio inválido.", "Files" => "Archivos", +"All files" => "Todos los archivos", "Unable to upload {filename} as it is a directory or has 0 bytes" => "No ha sido posible subir {filename} porque es un directorio o tiene 0 bytes", "Total file size {size1} exceeds upload limit {size2}" => "El tamaño total del archivo {size1} excede el límite {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" => "No hay suficiente espacio libre. Quiere subir {size1} pero solo quedan {size2}", @@ -42,14 +43,18 @@ $TRANSLATIONS = array( "Share" => "Compartir", "Delete permanently" => "Eliminar permanentemente", "Rename" => "Renombrar", +"Your download is being prepared. This might take some time if the files are big." => "Su descarga está siendo preparada. Esto podría tardar algo de tiempo si los archivos son grandes.", +"Pending" => "Pendiente", +"Error moving file." => "Error al mover el archivo.", "Error moving file" => "Error moviendo archivo", "Error" => "Error", -"Pending" => "Pendiente", "Could not rename file" => "No se pudo renombrar el archivo", "Error deleting file." => "Error al borrar el archivo", +"Name" => "Nombre", +"Size" => "Tamaño", +"Modified" => "Modificado", "_%n folder_::_%n folders_" => array("%n carpeta","%n carpetas"), "_%n file_::_%n files_" => array("%n archivo","%n archivos"), -"{dirs} and {files}" => "{dirs} y {files}", "_Uploading %n file_::_Uploading %n files_" => array("Subiendo %n archivo","Subiendo %n archivos"), "\"{name}\" is an invalid file name." => "\"{name}\" es un nombre de archivo inválido.", "Your storage is full, files can not be updated or synced anymore!" => "Su almacenamiento está lleno, ¡los archivos no se actualizarán ni sincronizarán más!", @@ -57,10 +62,7 @@ $TRANSLATIONS = array( "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "La app de crifrado está habilitada pero tus claves no han sido inicializadas, por favor, cierra la sesión y vuelva a iniciarla de nuevo.", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "La clave privada no es válida para la app de cifrado. Por favor, actualiza la contraseña de tu clave privada en tus ajustes personales para recuperar el acceso a tus archivos cifrados.", "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 podría tardar algo de tiempo si los archivos son grandes.", -"Name" => "Nombre", -"Size" => "Tamaño", -"Modified" => "Modificado", +"{dirs} and {files}" => "{dirs} y {files}", "%s could not be renamed" => "%s no pudo ser renombrado", "Upload (max. %s)" => "Subida (máx. %s)", "File handling" => "Administración de archivos", @@ -71,13 +73,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 significa ilimitado", "Maximum input size for ZIP files" => "Tamaño máximo para archivos ZIP de entrada", "Save" => "Guardar", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Use esta URL para acceder via WebDAV", "New" => "Nuevo", "New text file" => "Nuevo archivo de texto", "Text file" => "Archivo de texto", "New folder" => "Nueva carpeta", "Folder" => "Carpeta", "From link" => "Desde enlace", -"Deleted files" => "Archivos eliminados", "Cancel upload" => "Cancelar subida", "You don’t have permission to upload or create files here" => "No tienes permisos para subir o crear archivos aquí.", "Nothing in here. Upload something!" => "No hay nada aquí. ¡Suba algo!", diff --git a/apps/files/l10n/es_AR.php b/apps/files/l10n/es_AR.php index 4d4a349a10da7a029a65b4f1308e6a3f31ddb1ef..9edbe50206ecd7a476335ddc394785da06e750b7 100644 --- a/apps/files/l10n/es_AR.php +++ b/apps/files/l10n/es_AR.php @@ -38,24 +38,24 @@ $TRANSLATIONS = array( "Share" => "Compartir", "Delete permanently" => "Borrar permanentemente", "Rename" => "Cambiar nombre", +"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.", +"Pending" => "Pendientes", "Error moving file" => "Error moviendo el archivo", "Error" => "Error", -"Pending" => "Pendientes", "Could not rename file" => "No se pudo renombrar el archivo", "Error deleting file." => "Error al borrar el archivo.", +"Name" => "Nombre", +"Size" => "Tamaño", +"Modified" => "Modificado", "_%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"), "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 App is enabled but your keys are not initialized, please log-out and log-in again" => "La aplicación de encriptación está habilitada pero las llaves no fueron inicializadas, por favor termine y vuelva a iniciar la sesión", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Llave privada inválida para la aplicación de encriptación. Por favor actualice la clave de la llave privada en las configuraciones personales para recobrar el acceso a sus archivos encriptados.", "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", +"{dirs} and {files}" => "{carpetas} y {archivos}", "%s could not be renamed" => "No se pudo renombrar %s", "File handling" => "Tratamiento de archivos", "Maximum upload size" => "Tamaño máximo de subida", @@ -65,13 +65,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 significa ilimitado", "Maximum input size for ZIP files" => "Tamaño máximo para archivos ZIP de entrada", "Save" => "Guardar", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Usar esta dirección para acceder a tus archivos vía WebDAV", "New" => "Nuevo", "New text file" => "Nuevo archivo de texto", "Text file" => "Archivo de texto", "New folder" => "Nueva Carpeta", "Folder" => "Carpeta", "From link" => "Desde enlace", -"Deleted files" => "Archivos borrados", "Cancel upload" => "Cancelar subida", "You don’t have permission to upload or create files here" => "No tienes permisos para subir o crear archivos aquí", "Nothing in here. Upload something!" => "No hay nada. ¡Subí contenido!", diff --git a/apps/files/l10n/es_BO.php b/apps/files/l10n/es_BO.php new file mode 100644 index 0000000000000000000000000000000000000000..0157af093e92200cc7790497227e92e62d80165f --- /dev/null +++ b/apps/files/l10n/es_BO.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/es_CL.php b/apps/files/l10n/es_CL.php index fa856ad5292d9d6cec61e5af15db45ae15e33107..bdefea1d8c8ad0a76ef063d69cea6952108e457c 100644 --- a/apps/files/l10n/es_CL.php +++ b/apps/files/l10n/es_CL.php @@ -8,6 +8,7 @@ $TRANSLATIONS = array( "_%n file_::_%n files_" => array("",""), "_Uploading %n file_::_Uploading %n files_" => array("",""), "New folder" => "Nuevo directorio", +"Cancel upload" => "cancelar subida", "Download" => "Descargar" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/es_CO.php b/apps/files/l10n/es_CO.php new file mode 100644 index 0000000000000000000000000000000000000000..0157af093e92200cc7790497227e92e62d80165f --- /dev/null +++ b/apps/files/l10n/es_CO.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/es_EC.php b/apps/files/l10n/es_EC.php new file mode 100644 index 0000000000000000000000000000000000000000..0157af093e92200cc7790497227e92e62d80165f --- /dev/null +++ b/apps/files/l10n/es_EC.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/es_MX.php b/apps/files/l10n/es_MX.php index f5f773c760d9756f3c6c344b56c3322e63041d40..5b88655631818cf3fb9c23e2dd49c42ca9b48d02 100644 --- a/apps/files/l10n/es_MX.php +++ b/apps/files/l10n/es_MX.php @@ -38,24 +38,24 @@ $TRANSLATIONS = array( "Share" => "Compartir", "Delete permanently" => "Eliminar permanentemente", "Rename" => "Renombrar", +"Your download is being prepared. This might take some time if the files are big." => "Su descarga está siendo preparada. Esto podría tardar algo de tiempo si los archivos son grandes.", +"Pending" => "Pendiente", "Error moving file" => "Error moviendo archivo", "Error" => "Error", -"Pending" => "Pendiente", "Could not rename file" => "No se pudo renombrar el archivo", "Error deleting file." => "Error borrando el archivo.", +"Name" => "Nombre", +"Size" => "Tamaño", +"Modified" => "Modificado", "_%n folder_::_%n folders_" => array("%n carpeta","%n carpetas"), "_%n file_::_%n files_" => array("%n archivo","%n archivos"), -"{dirs} and {files}" => "{dirs} y {files}", "_Uploading %n file_::_Uploading %n files_" => array("Subiendo %n archivo","Subiendo %n archivos"), "Your storage is full, files can not be updated or synced anymore!" => "Su almacenamiento está lleno, ¡los archivos no se actualizarán ni sincronizarán más!", "Your storage is almost full ({usedSpacePercent}%)" => "Su almacenamiento está casi lleno ({usedSpacePercent}%)", "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "La aplicación de crifrado está habilitada pero tus claves no han sido inicializadas, por favor, cierra la sesión y vuelva a iniciarla de nuevo.", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "La clave privada no es válida para la aplicación de cifrado. Por favor, actualiza la contraseña de tu clave privada en tus ajustes personales para recuperar el acceso a tus archivos cifrados.", "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 podría tardar algo de tiempo si los archivos son grandes.", -"Name" => "Nombre", -"Size" => "Tamaño", -"Modified" => "Modificado", +"{dirs} and {files}" => "{dirs} y {files}", "%s could not be renamed" => "%s no pudo ser renombrado", "File handling" => "Administración de archivos", "Maximum upload size" => "Tamaño máximo de subida", @@ -65,13 +65,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 significa ilimitado", "Maximum input size for ZIP files" => "Tamaño máximo para archivos ZIP de entrada", "Save" => "Guardar", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Utilice esta dirección para acceder a sus archivos vía WebDAV", "New" => "Nuevo", "New text file" => "Nuevo archivo de texto", "Text file" => "Archivo de texto", "New folder" => "Nueva carpeta", "Folder" => "Carpeta", "From link" => "Desde enlace", -"Deleted files" => "Archivos eliminados", "Cancel upload" => "Cancelar subida", "You don’t have permission to upload or create files here" => "No tienes permisos para subir o crear archivos aquí.", "Nothing in here. Upload something!" => "No hay nada aquí. ¡Suba algo!", diff --git a/apps/files/l10n/es_PE.php b/apps/files/l10n/es_PE.php new file mode 100644 index 0000000000000000000000000000000000000000..0157af093e92200cc7790497227e92e62d80165f --- /dev/null +++ b/apps/files/l10n/es_PE.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/es_UY.php b/apps/files/l10n/es_UY.php new file mode 100644 index 0000000000000000000000000000000000000000..0157af093e92200cc7790497227e92e62d80165f --- /dev/null +++ b/apps/files/l10n/es_UY.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 4af93fa9ba27800027d8b1c3c8d055b404cfb336..783152aa5812a46935b2f42e1057af8e96d2528b 100644 --- a/apps/files/l10n/et_EE.php +++ b/apps/files/l10n/et_EE.php @@ -42,14 +42,17 @@ $TRANSLATIONS = array( "Share" => "Jaga", "Delete permanently" => "Kustuta jäädavalt", "Rename" => "Nimeta ümber", +"Your download is being prepared. This might take some time if the files are big." => "Valmistatakse allalaadimist. See võib võtta veidi aega, kui on tegu suurte failidega. ", +"Pending" => "Ootel", "Error moving file" => "Viga faili eemaldamisel", "Error" => "Viga", -"Pending" => "Ootel", "Could not rename file" => "Ei suuda faili ümber nimetada", "Error deleting file." => "Viga faili kustutamisel.", +"Name" => "Nimi", +"Size" => "Suurus", +"Modified" => "Muudetud", "_%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"), "\"{name}\" is an invalid file name." => "\"{name}\" on vigane failinimi.", "Your storage is full, files can not be updated or synced anymore!" => "Sinu andmemaht on täis! Faile ei uuendata ega sünkroniseerita!", @@ -57,10 +60,7 @@ $TRANSLATIONS = array( "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Krüpteerimisrakend on lubatud, kuid võtmeid pole lähtestatud. Palun logi välja ning uuesti sisse.", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Vigane Krüpteerimisrakendi privaatvõti . Palun uuenda oma privaatse võtme parool oma personaasete seadete all taastamaks ligipääsu oma krüpteeritud failidele.", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Krüpteering on keelatud, kuid sinu failid on endiselt krüpteeritud. Palun vaata oma personaalseid seadeid oma failide dekrüpteerimiseks.", -"Your download is being prepared. This might take some time if the files are big." => "Valmistatakse allalaadimist. See võib võtta veidi aega, kui on tegu suurte failidega. ", -"Name" => "Nimi", -"Size" => "Suurus", -"Modified" => "Muudetud", +"{dirs} and {files}" => "{dirs} ja {files}", "%s could not be renamed" => "%s ümbernimetamine ebaõnnestus", "Upload (max. %s)" => "Üleslaadimine (max. %s)", "File handling" => "Failide käsitlemine", @@ -71,13 +71,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 tähendab piiramatut", "Maximum input size for ZIP files" => "Maksimaalne ZIP-faili sisestatava faili suurus", "Save" => "Salvesta", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Kasuta seda aadressi oma failidele ligipääsuks WebDAV kaudu", "New" => "Uus", "New text file" => "Uus tekstifail", "Text file" => "Tekstifail", "New folder" => "Uus kaust", "Folder" => "Kaust", "From link" => "Allikast", -"Deleted files" => "Kustutatud failid", "Cancel upload" => "Tühista üleslaadimine", "You don’t have permission to upload or create files here" => "Sul puuduvad õigused siia failide üleslaadimiseks või tekitamiseks", "Nothing in here. Upload something!" => "Siin pole midagi. Lae midagi üles!", diff --git a/apps/files/l10n/eu.php b/apps/files/l10n/eu.php index e1bb7033ebded45ea884d557dc50b4c0e4927bf1..c3909ac5dac1769064b606745a3d2b504ec1a8d6 100644 --- a/apps/files/l10n/eu.php +++ b/apps/files/l10n/eu.php @@ -3,7 +3,9 @@ $TRANSLATIONS = array( "Could not move %s - File with this name already exists" => "Ezin da %s mugitu - Izen hau duen fitxategia dagoeneko existitzen da", "Could not move %s" => "Ezin dira fitxategiak mugitu %s", "File name cannot be empty." => "Fitxategi izena ezin da hutsa izan.", +"\"%s\" is an invalid file name." => "\"%s\" ez da fitxategi izen baliogarria.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "IZen aliogabea, '\\', '/', '<', '>', ':', '\"', '|', '?' eta '*' ez daude baimenduta.", +"The target folder has been moved or deleted." => "Jatorrizko karpeta mugitu edo ezabatu da.", "The name %s is already used in the folder %s. Please choose a different name." => "%s izena dagoeneko erabilita dago %s karpetan. Mesdez hautatu izen ezberdina.", "Not a valid source" => "Ez da jatorri baliogarria", "Server is not allowed to open URLs, please check the server configuration" => "Zerbitzaria ez dago URLak irekitzeko baimendua, mesedez egiaztatu zerbitzariaren konfigurazioa", @@ -27,6 +29,8 @@ $TRANSLATIONS = array( "Invalid directory." => "Baliogabeko karpeta.", "Files" => "Fitxategiak", "Unable to upload {filename} as it is a directory or has 0 bytes" => "Ezin da {filename} igo karpeta bat delako edo 0 byte dituelako", +"Total file size {size1} exceeds upload limit {size2}" => "Fitxategiaren tamainak {size1} igotzeko muga {size2} gainditzen du", +"Not enough free space, you are uploading {size1} but only {size2} is left" => "Ez dago leku nahikorik, zu {size1} igotzen ari zara baina bakarrik {size2} libre dago", "Upload cancelled." => "Igoera ezeztatuta", "Could not get result from server." => "Ezin da zerbitzaritik emaitzik lortu", "File upload is in progress. Leaving the page now will cancel the upload." => "Fitxategien igoera martxan da. Orria orain uzteak igoera ezeztatutko du.", @@ -38,25 +42,28 @@ $TRANSLATIONS = array( "Share" => "Elkarbanatu", "Delete permanently" => "Ezabatu betirako", "Rename" => "Berrizendatu", +"Your download is being prepared. This might take some time if the files are big." => "Zure deskarga prestatu egin behar da. Denbora bat har lezake fitxategiak handiak badira. ", +"Pending" => "Zain", +"Error moving file." => "Errorea fitxategia mugitzean.", "Error moving file" => "Errorea fitxategia mugitzean", "Error" => "Errorea", -"Pending" => "Zain", "Could not rename file" => "Ezin izan da fitxategia berrizendatu", "Error deleting file." => "Errorea fitxategia ezabatzerakoan.", +"Name" => "Izena", +"Size" => "Tamaina", +"Modified" => "Aldatuta", "_%n folder_::_%n folders_" => array("karpeta %n","%n karpeta"), "_%n file_::_%n files_" => array("fitxategi %n","%n fitxategi"), -"{dirs} and {files}" => "{dirs} eta {files}", "_Uploading %n file_::_Uploading %n files_" => array("Fitxategi %n igotzen","%n fitxategi igotzen"), +"\"{name}\" is an invalid file name." => "\"{name}\" ez da fitxategi izen baliogarria.", "Your storage is full, files can not be updated or synced anymore!" => "Zure biltegiratzea beterik dago, ezingo duzu aurrerantzean fitxategirik igo edo sinkronizatu!", "Your storage is almost full ({usedSpacePercent}%)" => "Zure biltegiratzea nahiko beterik dago (%{usedSpacePercent})", "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Enkriptazio aplikazioa gaituta dago baina zure gakoak ez daude konfiguratuta, mesedez saioa bukatu eta berriro hasi", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Enkriptazio aplikaziorako gako pribatu okerra. Mesedez eguneratu zure gako pribatuaren pasahitza zure ezarpen pertsonaletan zure enkriptatuko fitxategietarako sarrera berreskuratzeko.", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Enkriptazioa desgaitua izan da baina zure fitxategiak oraindik enkriptatuta daude. Mesedez jo zure ezarpen pertsonaletara zure fitxategiak dekodifikatzeko.", -"Your download is being prepared. This might take some time if the files are big." => "Zure deskarga prestatu egin behar da. Denbora bat har lezake fitxategiak handiak badira. ", -"Name" => "Izena", -"Size" => "Tamaina", -"Modified" => "Aldatuta", +"{dirs} and {files}" => "{dirs} eta {files}", "%s could not be renamed" => "%s ezin da berrizendatu", +"Upload (max. %s)" => "Igo (max. %s)", "File handling" => "Fitxategien kudeaketa", "Maximum upload size" => "Igo daitekeen gehienezko tamaina", "max. possible: " => "max, posiblea:", @@ -65,13 +72,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 mugarik gabe esan nahi du", "Maximum input size for ZIP files" => "ZIP fitxategien gehienezko tamaina", "Save" => "Gorde", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "helbidea erabili zure fitxategiak WebDAV bidez eskuratzeko", "New" => "Berria", "New text file" => "Testu fitxategi berria", "Text file" => "Testu fitxategia", "New folder" => "Karpeta berria", "Folder" => "Karpeta", "From link" => "Estekatik", -"Deleted files" => "Ezabatutako fitxategiak", "Cancel upload" => "Ezeztatu igoera", "You don’t have permission to upload or create files here" => "Ez duzu fitxategiak hona igotzeko edo hemen sortzeko baimenik", "Nothing in here. Upload something!" => "Ez dago ezer. Igo zerbait!", diff --git a/apps/files/l10n/fa.php b/apps/files/l10n/fa.php index 4d2a929195f2cd90b2c22d10a9664e1c5ffaebb8..01f2905366b6566e241522e3c51a3ae5f3af6c26 100644 --- a/apps/files/l10n/fa.php +++ b/apps/files/l10n/fa.php @@ -23,17 +23,17 @@ $TRANSLATIONS = array( "Share" => "اشتراک‌گذاری", "Delete permanently" => "حذف قطعی", "Rename" => "تغییرنام", -"Error" => "خطا", +"Your download is being prepared. This might take some time if the files are big." => "دانلود شما در حال آماده شدن است. در صورتیکه پرونده ها بزرگ باشند ممکن است مدتی طول بکشد.", "Pending" => "در انتظار", +"Error" => "خطا", +"Name" => "نام", +"Size" => "اندازه", +"Modified" => "تاریخ", "_%n folder_::_%n folders_" => array(""), "_%n file_::_%n files_" => array(""), "_Uploading %n file_::_Uploading %n files_" => array("در حال بارگذاری %n فایل"), "Your storage is full, files can not be updated or synced anymore!" => "فضای ذخیره ی شما کاملا پر است، بیش از این فایلها بهنگام یا همگام سازی نمی توانند بشوند!", "Your storage is almost full ({usedSpacePercent}%)" => "فضای ذخیره ی شما تقریبا پر است ({usedSpacePercent}%)", -"Your download is being prepared. This might take some time if the files are big." => "دانلود شما در حال آماده شدن است. در صورتیکه پرونده ها بزرگ باشند ممکن است مدتی طول بکشد.", -"Name" => "نام", -"Size" => "اندازه", -"Modified" => "تاریخ", "%s could not be renamed" => "%s نمیتواند تغییر نام دهد.", "File handling" => "اداره پرونده ها", "Maximum upload size" => "حداکثر اندازه بارگزاری", @@ -43,12 +43,13 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 نامحدود است", "Maximum input size for ZIP files" => "حداکثرمقدار برای بار گزاری پرونده های فشرده", "Save" => "ذخیره", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "از این آدرس استفاده کنید تا بتوانید به فایل‌های خود توسط WebDAV دسترسی پیدا کنید", "New" => "جدید", "Text file" => "فایل متنی", "New folder" => "پوشه جدید", "Folder" => "پوشه", "From link" => "از پیوند", -"Deleted files" => "فایل های حذف شده", "Cancel upload" => "متوقف کردن بار گذاری", "Nothing in here. Upload something!" => "اینجا هیچ چیز نیست.", "Download" => "دانلود", diff --git a/apps/files/l10n/fi_FI.php b/apps/files/l10n/fi_FI.php index ba3c921dfeef58870b4eb1c78d2ef8b974ebf273..c25fe7e1e2e094065fd97215577cf7ccf38fec5b 100644 --- a/apps/files/l10n/fi_FI.php +++ b/apps/files/l10n/fi_FI.php @@ -27,6 +27,7 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "Lähetys epäonnistui. Lähettävää tiedostoa ei löydetty.", "Invalid directory." => "Virheellinen kansio.", "Files" => "Tiedostot", +"All files" => "Kaikki tiedostot", "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", "Total file size {size1} exceeds upload limit {size2}" => "Yhteiskoko {size1} ylittää lähetysrajan {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" => "Ei riittävästi vapaata tilaa. Lähetyksesi koko on {size1}, mutta vain {size2} on jäljellä", @@ -41,14 +42,18 @@ $TRANSLATIONS = array( "Share" => "Jaa", "Delete permanently" => "Poista pysyvästi", "Rename" => "Nimeä uudelleen", +"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.", +"Pending" => "Odottaa", +"Error moving file." => "Virhe tiedostoa siirrettäessä.", "Error moving file" => "Virhe tiedostoa siirrettäessä", "Error" => "Virhe", -"Pending" => "Odottaa", "Could not rename file" => "Tiedoston nimeäminen uudelleen epäonnistui", "Error deleting file." => "Virhe tiedostoa poistaessa.", +"Name" => "Nimi", +"Size" => "Koko", +"Modified" => "Muokattu", "_%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"), "\"{name}\" is an invalid file name." => "\"{name}\" on virheellinen tiedostonimi.", "Your storage is full, files can not be updated or synced anymore!" => "Tallennustila on loppu, tiedostoja ei voi enää päivittää tai synkronoida!", @@ -56,10 +61,7 @@ $TRANSLATIONS = array( "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Salaussovellus on käytössä, mutta salausavaimia ei ole alustettu. Ole hyvä ja kirjaudu sisään uudelleen.", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Salaussovelluksen salausavain on virheellinen. Ole hyvä ja päivitä salausavain henkilökohtaisissa asetuksissasi jotta voit taas avata salatuskirjoitetut tiedostosi.", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Salaus poistettiin käytöstä, mutta tiedostosi ovat edelleen salattuina. Siirry henkilökohtaisiin asetuksiin avataksesi tiedostojesi salauksen.", -"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.", -"Name" => "Nimi", -"Size" => "Koko", -"Modified" => "Muokattu", +"{dirs} and {files}" => "{dirs} ja {files}", "%s could not be renamed" => "kohteen %s nimeäminen uudelleen epäonnistui", "Upload (max. %s)" => "Lähetys (enintään %s)", "File handling" => "Tiedostonhallinta", @@ -70,13 +72,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 on rajoittamaton", "Maximum input size for ZIP files" => "ZIP-tiedostojen enimmäiskoko", "Save" => "Tallenna", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Käytä tätä osoitetta käyttääksesi tiedostojasi WebDAVin kautta", "New" => "Uusi", "New text file" => "Uusi tekstitiedosto", "Text file" => "Tekstitiedosto", "New folder" => "Uusi kansio", "Folder" => "Kansio", "From link" => "Linkistä", -"Deleted files" => "Poistetut tiedostot", "Cancel upload" => "Peru lähetys", "You don’t have permission to upload or create files here" => "Käyttöoikeutesi eivät riitä tiedostojen lähettämiseen tai kansioiden luomiseen tähän sijaintiin", "Nothing in here. Upload something!" => "Täällä ei ole mitään. Lähetä tänne jotakin!", diff --git a/apps/files/l10n/fr.php b/apps/files/l10n/fr.php index 26ba8445f4f44eaa093f70d456358fa76d19226a..1ddb94d083930482ba94be48c3f2f69b4e8d054a 100644 --- a/apps/files/l10n/fr.php +++ b/apps/files/l10n/fr.php @@ -42,14 +42,18 @@ $TRANSLATIONS = array( "Share" => "Partager", "Delete permanently" => "Supprimer de façon définitive", "Rename" => "Renommer", +"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.", +"Pending" => "En attente", +"Error moving file." => "Erreur lors du déplacement du fichier.", "Error moving file" => "Erreur lors du déplacement du fichier", "Error" => "Erreur", -"Pending" => "En attente", "Could not rename file" => "Impossible de renommer le fichier", "Error deleting file." => "Erreur pendant la suppression du fichier.", +"Name" => "Nom", +"Size" => "Taille", +"Modified" => "Modifié", "_%n folder_::_%n folders_" => array("%n dossier","%n dossiers"), "_%n file_::_%n files_" => array("%n fichier","%n fichiers"), -"{dirs} and {files}" => "{dirs} et {files}", "_Uploading %n file_::_Uploading %n files_" => array("Téléversement de %n fichier","Téléversement de %n fichiers"), "\"{name}\" is an invalid file name." => "\"{name}\" n'est pas un nom de fichier valide.", "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 !", @@ -57,10 +61,7 @@ $TRANSLATIONS = array( "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "L'application de chiffrement est activée mais vos clés ne sont pas initialisées, veuillez vous déconnecter et ensuite vous reconnecter.", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Votre clef privée pour l'application de chiffrement est invalide ! Veuillez mettre à jour le mot de passe de votre clef privée dans vos paramètres personnels pour récupérer l'accès à vos fichiers chiffrés.", "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.", -"Name" => "Nom", -"Size" => "Taille", -"Modified" => "Modifié", +"{dirs} and {files}" => "{dirs} et {files}", "%s could not be renamed" => "%s ne peut être renommé", "Upload (max. %s)" => "Envoi (max. %s)", "File handling" => "Gestion des fichiers", @@ -71,13 +72,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 est illimité", "Maximum input size for ZIP files" => "Taille maximale pour les fichiers ZIP", "Save" => "Sauvegarder", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Utiliser cette adresse pour accéder à vos fichiers par WebDAV", "New" => "Nouveau", "New text file" => "Nouveau fichier texte", "Text file" => "Fichier texte", "New folder" => "Nouveau dossier", "Folder" => "Dossier", "From link" => "Depuis le lien", -"Deleted files" => "Fichiers supprimés", "Cancel upload" => "Annuler l'envoi", "You don’t have permission to upload or create files here" => "Vous n'avez pas la permission de téléverser ou de créer des fichiers ici", "Nothing in here. Upload something!" => "Il n'y a rien ici ! Envoyez donc quelque chose :)", diff --git a/apps/files/l10n/gl.php b/apps/files/l10n/gl.php index d9c6d0036030cc0e76322821a4c6928e4e8a64aa..98a3a73b296a605053d0ae432cb6f5b13b26c447 100644 --- a/apps/files/l10n/gl.php +++ b/apps/files/l10n/gl.php @@ -28,6 +28,7 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "O envío fracasou. Non foi posíbel obter información do ficheiro.", "Invalid directory." => "O directorio é incorrecto.", "Files" => "Ficheiros", +"All files" => "Todos os ficheiros", "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", "Total file size {size1} exceeds upload limit {size2}" => "O tamaño total do ficheiro {size1} excede do límite de envío {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" => "Non hai espazo libre abondo, o seu envío é de {size1} mais só dispón de {size2}", @@ -42,14 +43,18 @@ $TRANSLATIONS = array( "Share" => "Compartir", "Delete permanently" => "Eliminar permanentemente", "Rename" => "Renomear", +"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.", +"Pending" => "Pendentes", +"Error moving file." => "Produciuse un erro ao mover o ficheiro.", "Error moving file" => "Produciuse un erro ao mover o ficheiro", "Error" => "Erro", -"Pending" => "Pendentes", "Could not rename file" => "Non foi posíbel renomear o ficheiro", "Error deleting file." => "Produciuse un erro ao eliminar 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"), -"{dirs} and {files}" => "{dirs} e {files}", "_Uploading %n file_::_Uploading %n files_" => array("Cargando %n ficheiro","Cargando %n ficheiros"), "\"{name}\" is an invalid file name." => "«{name}» é un nome incorrecto de ficheiro.", "Your storage is full, files can not be updated or synced anymore!" => "O seu espazo de almacenamento está cheo, non é posíbel actualizar ou sincronizar máis os ficheiros!", @@ -57,10 +62,7 @@ $TRANSLATIONS = array( "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "O aplicativo de cifrado está activado, mais as chaves non foron inicializadas, saia da sesión e volva a acceder de novo", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "A chave privada para o aplicativo de cifrado non é correcta. Actualice o contrasinal da súa chave privada nos seus axustes persoais para recuperar o acceso aos seus ficheiros cifrados.", "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.", -"Name" => "Nome", -"Size" => "Tamaño", -"Modified" => "Modificado", +"{dirs} and {files}" => "{dirs} e {files}", "%s could not be renamed" => "%s non pode cambiar de nome", "Upload (max. %s)" => "Envío (máx. %s)", "File handling" => "Manexo de ficheiro", @@ -71,13 +73,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 significa ilimitado", "Maximum input size for ZIP files" => "Tamaño máximo de descarga para os ficheiros ZIP", "Save" => "Gardar", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Empregue esta ligazón para acceder aos seus ficheiros mediante WebDAV", "New" => "Novo", "New text file" => "Ficheiro novo de texto", "Text file" => "Ficheiro de texto", "New folder" => "Novo cartafol", "Folder" => "Cartafol", "From link" => "Desde a ligazón", -"Deleted files" => "Ficheiros eliminados", "Cancel upload" => "Cancelar o envío", "You don’t have permission to upload or create files here" => "Non ten permisos para enviar ou crear ficheiros aquí.", "Nothing in here. Upload something!" => "Aquí non hai nada. Envíe algo.", diff --git a/apps/files/l10n/he.php b/apps/files/l10n/he.php index 6279e675db2b314c7486917ff22ce72c48950fbc..e69599694ebd598a68977750de9499205a514071 100644 --- a/apps/files/l10n/he.php +++ b/apps/files/l10n/he.php @@ -23,15 +23,15 @@ $TRANSLATIONS = array( "Share" => "שתף", "Delete permanently" => "מחק לצמיתות", "Rename" => "שינוי שם", -"Error" => "שגיאה", "Pending" => "ממתין", +"Error" => "שגיאה", +"Name" => "שם", +"Size" => "גודל", +"Modified" => "זמן שינוי", "_%n folder_::_%n folders_" => array("",""), "_%n file_::_%n files_" => array("",""), "_Uploading %n file_::_Uploading %n files_" => array("",""), "Your storage is almost full ({usedSpacePercent}%)" => "שטח האחסון שלך כמעט מלא ({usedSpacePercent}%)", -"Name" => "שם", -"Size" => "גודל", -"Modified" => "זמן שינוי", "File handling" => "טיפול בקבצים", "Maximum upload size" => "גודל העלאה מקסימלי", "max. possible: " => "המרבי האפשרי: ", @@ -40,11 +40,11 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 - ללא הגבלה", "Maximum input size for ZIP files" => "גודל הקלט המרבי לקובצי ZIP", "Save" => "שמירה", +"WebDAV" => "WebDAV", "New" => "חדש", "Text file" => "קובץ טקסט", "Folder" => "תיקייה", "From link" => "מקישור", -"Deleted files" => "קבצים שנמחקו", "Cancel upload" => "ביטול ההעלאה", "Nothing in here. Upload something!" => "אין כאן שום דבר. אולי ברצונך להעלות משהו?", "Download" => "הורדה", diff --git a/apps/files/l10n/hi_IN.php b/apps/files/l10n/hi_IN.php new file mode 100644 index 0000000000000000000000000000000000000000..0157af093e92200cc7790497227e92e62d80165f --- /dev/null +++ b/apps/files/l10n/hi_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/hr.php b/apps/files/l10n/hr.php index 0876dcdd1ec3e87fabb5eab9178754f55fb62834..4e8deeed5131962f3646b897e1076f81c3ade21b 100644 --- a/apps/files/l10n/hr.php +++ b/apps/files/l10n/hr.php @@ -11,14 +11,14 @@ $TRANSLATIONS = array( "File upload is in progress. Leaving the page now will cancel the upload." => "Učitavanje datoteke. Napuštanjem stranice će prekinuti učitavanje.", "Share" => "Podijeli", "Rename" => "Promjeni ime", -"Error" => "Greška", "Pending" => "U tijeku", -"_%n folder_::_%n folders_" => array("","",""), -"_%n file_::_%n files_" => array("","",""), -"_Uploading %n file_::_Uploading %n files_" => array("","",""), +"Error" => "Greška", "Name" => "Ime", "Size" => "Veličina", "Modified" => "Zadnja promjena", +"_%n folder_::_%n folders_" => array("","",""), +"_%n file_::_%n files_" => array("","",""), +"_Uploading %n file_::_Uploading %n files_" => array("","",""), "File handling" => "datoteka za rukovanje", "Maximum upload size" => "Maksimalna veličina prijenosa", "max. possible: " => "maksimalna moguća: ", diff --git a/apps/files/l10n/hu_HU.php b/apps/files/l10n/hu_HU.php index 9ed00326826950738ba82d07768d3c927969842a..89264c0c525a08c94b07a43684916bc8abca0cf5 100644 --- a/apps/files/l10n/hu_HU.php +++ b/apps/files/l10n/hu_HU.php @@ -38,24 +38,24 @@ $TRANSLATIONS = array( "Share" => "Megosztás", "Delete permanently" => "Végleges törlés", "Rename" => "Átnevezés", +"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.", +"Pending" => "Folyamatban", "Error moving file" => "Az állomány áthelyezése nem sikerült.", "Error" => "Hiba", -"Pending" => "Folyamatban", "Could not rename file" => "Az állomány nem nevezhető át", "Error deleting file." => "Hiba a file törlése közben.", +"Name" => "Név", +"Size" => "Méret", +"Modified" => "Módosítva", "_%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"), "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 App is enabled but your keys are not initialized, please log-out and log-in again" => "Az állományok titkosítása engedélyezve van, de az Ön titkos kulcsai nincsenek beállítva. Ezért kérjük, hogy jelentkezzen ki, és lépjen be újra!", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Az állományok titkosításához használt titkos kulcsa érvénytelen. Kérjük frissítse a titkos kulcs jelszót a személyes beállításokban, hogy ismét hozzáférjen a titkosított állományaihoz!", "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.", -"Name" => "Név", -"Size" => "Méret", -"Modified" => "Módosítva", +"{dirs} and {files}" => "{dirs} és {files}", "%s could not be renamed" => "%s átnevezése nem sikerült", "File handling" => "Fájlkezelés", "Maximum upload size" => "Maximális feltölthető fájlméret", @@ -65,13 +65,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 = korlátlan", "Maximum input size for ZIP files" => "ZIP-fájlok maximális kiindulási mérete", "Save" => "Mentés", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Ezt a címet használd, hogy hozzáférj a fileokhoz WebDAV-on keresztül", "New" => "Új", "New text file" => "Új szöveges file", "Text file" => "Szövegfájl", "New folder" => "Új mappa", "Folder" => "Mappa", "From link" => "Feltöltés linkről", -"Deleted files" => "Törölt fájlok", "Cancel upload" => "A feltöltés megszakítása", "You don’t have permission to upload or create files here" => "Önnek nincs jogosultsága ahhoz, hogy ide állományokat töltsön föl, vagy itt újakat hozzon létre", "Nothing in here. Upload something!" => "Itt nincs semmi. Töltsön fel valamit!", diff --git a/apps/files/l10n/ia.php b/apps/files/l10n/ia.php index ff4cb0225b01032cdd381dafaf0ecc343ae3ce58..51d433258bb9f3ad303dc30eee951eb437625e6e 100644 --- a/apps/files/l10n/ia.php +++ b/apps/files/l10n/ia.php @@ -6,12 +6,12 @@ $TRANSLATIONS = array( "Files" => "Files", "Share" => "Compartir", "Error" => "Error", -"_%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("",""), +"_Uploading %n file_::_Uploading %n files_" => array("",""), "Maximum upload size" => "Dimension maxime de incargamento", "Save" => "Salveguardar", "New" => "Nove", diff --git a/apps/files/l10n/id.php b/apps/files/l10n/id.php index d8c0a47789c2d6421f3eec69c2e5d23600b4b3a3..4e9852cd18e04364930ba2ad2c06109a6e834015 100644 --- a/apps/files/l10n/id.php +++ b/apps/files/l10n/id.php @@ -36,24 +36,24 @@ $TRANSLATIONS = array( "Share" => "Bagikan", "Delete permanently" => "Hapus secara permanen", "Rename" => "Ubah nama", +"Your download is being prepared. This might take some time if the files are big." => "Unduhan Anda sedang disiapkan. Prosesnya dapat berlangsung agak lama jika ukuran berkasnya besar.", +"Pending" => "Menunggu", "Error moving file" => "Galat saat memindahkan berkas", "Error" => "Galat", -"Pending" => "Menunggu", "Could not rename file" => "Tidak dapat mengubah nama berkas", "Error deleting file." => "Galat saat menghapus berkas.", +"Name" => "Nama", +"Size" => "Ukuran", +"Modified" => "Dimodifikasi", "_%n folder_::_%n folders_" => array("%n folder"), "_%n file_::_%n files_" => array("%n berkas"), -"{dirs} and {files}" => "{dirs} dan {files}", "_Uploading %n file_::_Uploading %n files_" => array("Mengunggah %n berkas"), "Your storage is full, files can not be updated or synced anymore!" => "Ruang penyimpanan Anda penuh, berkas tidak dapat diperbarui atau disinkronkan lagi!", "Your storage is almost full ({usedSpacePercent}%)" => "Ruang penyimpanan hampir penuh ({usedSpacePercent}%)", "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Aplikasi Enskripsi telah diaktifkan tetapi kunci tidak diinisialisasi, silakan log-out dan log-in lagi", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Kunci privat tidak sah untuk Aplikasi Enskripsi. Silakan perbarui sandi kunci privat anda pada pengaturan pribadi untuk memulihkan akses ke berkas anda yang dienskripsi.", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Enskripi telah dinonaktifkan tetapi berkas anda tetap dienskripsi. Silakan menuju ke pengaturan pribadi untuk deskrip berkas anda.", -"Your download is being prepared. This might take some time if the files are big." => "Unduhan Anda sedang disiapkan. Prosesnya dapat berlangsung agak lama jika ukuran berkasnya besar.", -"Name" => "Nama", -"Size" => "Ukuran", -"Modified" => "Dimodifikasi", +"{dirs} and {files}" => "{dirs} dan {files}", "%s could not be renamed" => "%s tidak dapat diubah nama", "File handling" => "Penanganan berkas", "Maximum upload size" => "Ukuran pengunggahan maksimum", @@ -63,13 +63,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 berarti tidak terbatas", "Maximum input size for ZIP files" => "Ukuran masukan maksimum untuk berkas ZIP", "Save" => "Simpan", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Gunakan alamat ini untuk mengakses Berkas via WebDAV", "New" => "Baru", "New text file" => "Berkas teks baru", "Text file" => "Berkas teks", "New folder" => "Map baru", "Folder" => "Folder", "From link" => "Dari tautan", -"Deleted files" => "Berkas yang dihapus", "Cancel upload" => "Batal pengunggahan", "You don’t have permission to upload or create files here" => "Anda tidak memiliki akses untuk mengunggah atau membuat berkas disini", "Nothing in here. Upload something!" => "Tidak ada apa-apa di sini. Unggah sesuatu!", diff --git a/apps/files/l10n/is.php b/apps/files/l10n/is.php index b8e23b6a3007dc4a044220070ac79a5d76f27f9c..982c6f3742d24c3125e6843714f0de493ad29f53 100644 --- a/apps/files/l10n/is.php +++ b/apps/files/l10n/is.php @@ -19,14 +19,14 @@ $TRANSLATIONS = array( "{new_name} already exists" => "{new_name} er þegar til", "Share" => "Deila", "Rename" => "Endurskýra", -"Error" => "Villa", "Pending" => "Bíður", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), -"_Uploading %n file_::_Uploading %n files_" => array("",""), +"Error" => "Villa", "Name" => "Nafn", "Size" => "Stærð", "Modified" => "Breytt", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), +"_Uploading %n file_::_Uploading %n files_" => array("",""), "File handling" => "Meðhöndlun skrár", "Maximum upload size" => "Hámarks stærð innsendingar", "max. possible: " => "hámark mögulegt: ", @@ -35,6 +35,7 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 er ótakmarkað", "Maximum input size for ZIP files" => "Hámarks inntaksstærð fyrir ZIP skrár", "Save" => "Vista", +"WebDAV" => "WebDAV", "New" => "Nýtt", "Text file" => "Texta skrá", "Folder" => "Mappa", diff --git a/apps/files/l10n/it.php b/apps/files/l10n/it.php index c77fb57c59655736dfb77a08cb4c9584eb55807b..e4fed8fd2f97da23535d2076f00a7cc452112863 100644 --- a/apps/files/l10n/it.php +++ b/apps/files/l10n/it.php @@ -28,6 +28,7 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "Caricamento non riuscito. Impossibile ottenere informazioni sul file.", "Invalid directory." => "Cartella non valida.", "Files" => "File", +"All files" => "Tutti i file", "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.", "Total file size {size1} exceeds upload limit {size2}" => "La dimensione totale del file {size1} supera il limite di caricamento {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" => "Spazio insufficiente, stai caricando {size1}, ma è rimasto solo {size2}", @@ -42,14 +43,18 @@ $TRANSLATIONS = array( "Share" => "Condividi", "Delete permanently" => "Elimina definitivamente", "Rename" => "Rinomina", +"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.", +"Pending" => "In corso", +"Error moving file." => "Errore durante lo spostamento del file.", "Error moving file" => "Errore durante lo spostamento del file", "Error" => "Errore", -"Pending" => "In corso", "Could not rename file" => "Impossibile rinominare il file", "Error deleting file." => "Errore durante l'eliminazione 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"), -"{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"), "\"{name}\" is an invalid file name." => "\"{name}\" non è un nome file valido.", "Your storage is full, files can not be updated or synced anymore!" => "Lo spazio di archiviazione è pieno, i file non possono essere più aggiornati o sincronizzati!", @@ -57,10 +62,7 @@ $TRANSLATIONS = array( "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "L'applicazione di cifratura è abilitata, ma le chiavi non sono state inizializzate, disconnettiti ed effettua nuovamente l'accesso", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Chiave privata non valida per l'applicazione di cifratura. Aggiorna la password della chiave privata nelle impostazioni personali per ripristinare l'accesso ai tuoi file cifrati.", "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.", -"Name" => "Nome", -"Size" => "Dimensione", -"Modified" => "Modificato", +"{dirs} and {files}" => "{dirs} e {files}", "%s could not be renamed" => "%s non può essere rinominato", "Upload (max. %s)" => "Carica (massimo %s)", "File handling" => "Gestione file", @@ -71,13 +73,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 è illimitato", "Maximum input size for ZIP files" => "Dimensione massima per i file ZIP", "Save" => "Salva", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Utilizza questo indirizzo per accedere ai tuoi file con WebDAV", "New" => "Nuovo", "New text file" => "Nuovo file di testo", "Text file" => "File di testo", "New folder" => "Nuova cartella", "Folder" => "Cartella", "From link" => "Da collegamento", -"Deleted files" => "File eliminati", "Cancel upload" => "Annulla invio", "You don’t have permission to upload or create files here" => "Qui non hai i permessi di caricare o creare file", "Nothing in here. Upload something!" => "Non c'è niente qui. Carica qualcosa!", diff --git a/apps/files/l10n/ja.php b/apps/files/l10n/ja.php index 361fd835ce1c3c5790fb207badbfa2bf15e6d107..dfbc590d0afb337405ceff5d68077d47f315a49a 100644 --- a/apps/files/l10n/ja.php +++ b/apps/files/l10n/ja.php @@ -42,14 +42,18 @@ $TRANSLATIONS = array( "Share" => "共有", "Delete permanently" => "完全に削除する", "Rename" => "名前の変更", +"Your download is being prepared. This might take some time if the files are big." => "ダウンロードの準備中です。ファイルサイズが大きい場合は少し時間がかかるかもしれません。", +"Pending" => "中断", +"Error moving file." => "ファイル移動でエラー", "Error moving file" => "ファイルの移動エラー", "Error" => "エラー", -"Pending" => "中断", "Could not rename file" => "ファイルの名前変更ができませんでした", "Error deleting file." => "ファイルの削除エラー。", +"Name" => "名前", +"Size" => "サイズ", +"Modified" => "更新日時", "_%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 個のファイルをアップロード中"), "\"{name}\" is an invalid file name." => "\"{name}\" は無効なファイル名です。", "Your storage is full, files can not be updated or synced anymore!" => "あなたのストレージは一杯です。ファイルの更新と同期はもうできません!", @@ -57,11 +61,9 @@ $TRANSLATIONS = array( "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "暗号化アプリは有効ですが、あなたの暗号化キーは初期化されていません。ログアウトした後に、再度ログインしてください", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted 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." => "ダウンロードの準備中です。ファイルサイズが大きい場合は少し時間がかかるかもしれません。", -"Name" => "名前", -"Size" => "サイズ", -"Modified" => "更新日時", +"{dirs} and {files}" => "{dirs} と {files}", "%s could not be renamed" => "%sの名前を変更できませんでした", +"Upload (max. %s)" => "アップロード ( 最大 %s )", "File handling" => "ファイル操作", "Maximum upload size" => "最大アップロードサイズ", "max. possible: " => "最大容量: ", @@ -70,13 +72,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0を指定した場合は無制限", "Maximum input size for ZIP files" => "ZIPファイルでの最大入力サイズ", "Save" => "保存", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "WebDAV 経由でファイルにアクセス するにはこのアドレスを利用してください", "New" => "新規作成", "New text file" => "新規のテキストファイル作成", "Text file" => "テキストファイル", "New folder" => "新しいフォルダー", "Folder" => "フォルダー", "From link" => "リンク", -"Deleted files" => "ゴミ箱", "Cancel upload" => "アップロードをキャンセル", "You don’t have permission to upload or create files here" => "ここにファイルをアップロードもしくは作成する権限がありません", "Nothing in here. Upload something!" => "ここには何もありません。何かアップロードしてください。", diff --git a/apps/files/l10n/ka_GE.php b/apps/files/l10n/ka_GE.php index ad3a4bff1f183bd8edb81d489e600a76b5573b23..b13a6ac23ce37b784b25df5d3c48e63a486e48ed 100644 --- a/apps/files/l10n/ka_GE.php +++ b/apps/files/l10n/ka_GE.php @@ -21,17 +21,17 @@ $TRANSLATIONS = array( "Share" => "გაზიარება", "Delete permanently" => "სრულად წაშლა", "Rename" => "გადარქმევა", -"Error" => "შეცდომა", +"Your download is being prepared. This might take some time if the files are big." => "გადმოწერის მოთხოვნა მუშავდება. ის მოითხოვს გარკვეულ დროს რაგდან ფაილები არის დიდი ზომის.", "Pending" => "მოცდის რეჟიმში", +"Error" => "შეცდომა", +"Name" => "სახელი", +"Size" => "ზომა", +"Modified" => "შეცვლილია", "_%n folder_::_%n folders_" => array(""), "_%n file_::_%n files_" => array(""), "_Uploading %n file_::_Uploading %n files_" => array(""), "Your storage is full, files can not be updated or synced anymore!" => "თქვენი საცავი გადაივსო. ფაილების განახლება და სინქრონიზირება ვერ მოხერხდება!", "Your storage is almost full ({usedSpacePercent}%)" => "თქვენი საცავი თითქმის გადაივსო ({usedSpacePercent}%)", -"Your download is being prepared. This might take some time if the files are big." => "გადმოწერის მოთხოვნა მუშავდება. ის მოითხოვს გარკვეულ დროს რაგდან ფაილები არის დიდი ზომის.", -"Name" => "სახელი", -"Size" => "ზომა", -"Modified" => "შეცვლილია", "File handling" => "ფაილის დამუშავება", "Maximum upload size" => "მაქსიმუმ ატვირთის ზომა", "max. possible: " => "მაქს. შესაძლებელი:", @@ -40,12 +40,12 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 is unlimited", "Maximum input size for ZIP files" => "ZIP ფაილების მაქსიმუმ დასაშვები ზომა", "Save" => "შენახვა", +"WebDAV" => "WebDAV", "New" => "ახალი", "Text file" => "ტექსტური ფაილი", "New folder" => "ახალი ფოლდერი", "Folder" => "საქაღალდე", "From link" => "მისამართიდან", -"Deleted files" => "წაშლილი ფაილები", "Cancel upload" => "ატვირთვის გაუქმება", "Nothing in here. Upload something!" => "აქ არაფერი არ არის. ატვირთე რამე!", "Download" => "ჩამოტვირთვა", diff --git a/apps/files/l10n/km.php b/apps/files/l10n/km.php index 30bb2998afa55628cef51940305957d1d471b5af..3cfb33854bc9c2b54c21726a5ef3a488b129e8f4 100644 --- a/apps/files/l10n/km.php +++ b/apps/files/l10n/km.php @@ -1,17 +1,37 @@ "ឈ្មោះ​ឯកសារ​មិន​អាច​នៅ​ទទេ​បាន​ឡើយ។", +"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "ឈ្មោះ​មិន​ត្រឹម​ត្រូវ, មិន​អនុញ្ញាត '\\', '/', '<', '>', ':', '\"', '|', '?' និង '*' ទេ។", "Files" => "ឯកសារ", +"Upload cancelled." => "បាន​បោះបង់​ការ​ផ្ទុក​ឡើង។", +"{new_name} already exists" => "មាន​ឈ្មោះ {new_name} រួច​ហើយ", "Share" => "ចែក​រំលែក", +"Delete permanently" => "លុប​ជា​អចិន្ត្រៃយ៍", +"Rename" => "ប្ដូរ​ឈ្មោះ", +"Your download is being prepared. This might take some time if the files are big." => "ការ​ទាញយក​របស់​អ្នក​កំពុង​ត្រូវ​បាន​រៀបចំ​ហើយ។ នេះ​អាច​ចំណាយ​ពេល​មួយ​សំទុះ ប្រសិន​បើ​ឯកសារ​ធំ។", +"Pending" => "កំពុង​រង់ចាំ", "Error" => "កំហុស", +"Name" => "ឈ្មោះ", +"Size" => "ទំហំ", +"Modified" => "បាន​កែ​ប្រែ", "_%n folder_::_%n folders_" => array(""), "_%n file_::_%n files_" => array(""), "_Uploading %n file_::_Uploading %n files_" => array(""), -"Name" => "ឈ្មោះ", -"Size" => "ទំហំ", +"Maximum upload size" => "ទំហំ​ផ្ទុកឡើង​ជា​អតិបរមា", +"Enable ZIP-download" => "បើក​ការ​ទាញយក​ជា ZIP", +"0 is unlimited" => "0 គឺ​មិន​កំណត់", +"Maximum input size for ZIP files" => "ទំហំ​ចូល​ជា​អតិបរមា​សម្រាប់​ឯកសារ ZIP", "Save" => "រក្សាទុក", +"WebDAV" => "WebDAV", +"New" => "ថ្មី", +"Text file" => "ឯកសារ​អក្សរ", "New folder" => "ថត​ថ្មី", "Folder" => "ថត", +"From link" => "ពី​តំណ", +"Cancel upload" => "បោះបង់​ការ​ផ្ទុកឡើង", +"Nothing in here. Upload something!" => "គ្មាន​អ្វី​នៅ​ទីនេះ​ទេ។ ផ្ទុក​ឡើង​អ្វី​មួយ!", "Download" => "ទាញយក", -"Delete" => "លុប" +"Delete" => "លុប", +"Upload too large" => "ផ្ទុក​ឡើង​ធំ​ពេក" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/l10n/ko.php b/apps/files/l10n/ko.php index 21c7ebcdc443cb5b20806af7519014403accdc23..ae885bb7a3f5c2c3edeb2abdaf2e66890f8a4d7b 100644 --- a/apps/files/l10n/ko.php +++ b/apps/files/l10n/ko.php @@ -38,24 +38,24 @@ $TRANSLATIONS = array( "Share" => "공유", "Delete permanently" => "영구히 삭제", "Rename" => "이름 바꾸기", +"Your download is being prepared. This might take some time if the files are big." => "다운로드 준비 중입니다. 파일 크기가 크면 시간이 오래 걸릴 수도 있습니다.", +"Pending" => "대기 중", "Error moving file" => "파일 이동 오류", "Error" => "오류", -"Pending" => "대기 중", "Could not rename file" => "이름을 변경할 수 없음", "Error deleting file." => "파일 삭제 오류.", +"Name" => "이름", +"Size" => "크기", +"Modified" => "수정됨", "_%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개 업로드 중"), "Your storage is full, files can not be updated or synced anymore!" => "저장 공간이 가득 찼습니다. 파일을 업데이트하거나 동기화할 수 없습니다!", "Your storage is almost full ({usedSpacePercent}%)" => "저장 공간이 거의 가득 찼습니다 ({usedSpacePercent}%)", "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "암호화 앱이 활성화되어 있지만 키가 초기화되지 않았습니다. 로그아웃한 후 다시 로그인하십시오", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted 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." => "다운로드 준비 중입니다. 파일 크기가 크면 시간이 오래 걸릴 수도 있습니다.", -"Name" => "이름", -"Size" => "크기", -"Modified" => "수정됨", +"{dirs} and {files}" => "{dirs} 그리고 {files}", "%s could not be renamed" => "%s의 이름을 변경할 수 없습니다", "File handling" => "파일 처리", "Maximum upload size" => "최대 업로드 크기", @@ -65,13 +65,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0은 무제한입니다", "Maximum input size for ZIP files" => "ZIP 파일 최대 크기", "Save" => "저장", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "WebDAV로 파일에 접근하려면 이 주소를 사용하십시오", "New" => "새로 만들기", "New text file" => "새 텍스트 파일", "Text file" => "텍스트 파일", "New folder" => "새 폴더", "Folder" => "폴더", "From link" => "링크에서", -"Deleted files" => "삭제된 파일", "Cancel upload" => "업로드 취소", "You don’t have permission to upload or create files here" => "여기에 파일을 업로드하거나 만들 권한이 없습니다", "Nothing in here. Upload something!" => "내용이 없습니다. 업로드할 수 있습니다!", diff --git a/apps/files/l10n/ku_IQ.php b/apps/files/l10n/ku_IQ.php index 1c9d615ee7e24195c026ebc6bfc1bedcb2e0750e..4afe5e4cc29b447f980360651426ec0064dda400 100644 --- a/apps/files/l10n/ku_IQ.php +++ b/apps/files/l10n/ku_IQ.php @@ -3,10 +3,10 @@ $TRANSLATIONS = array( "Files" => "په‌ڕگەکان", "Share" => "هاوبەشی کردن", "Error" => "هه‌ڵه", +"Name" => "ناو", "_%n folder_::_%n folders_" => array("",""), "_%n file_::_%n files_" => array("",""), "_Uploading %n file_::_Uploading %n files_" => array("",""), -"Name" => "ناو", "Save" => "پاشکه‌وتکردن", "Folder" => "بوخچه", "Download" => "داگرتن" diff --git a/apps/files/l10n/lb.php b/apps/files/l10n/lb.php index 27dc936600b030ffa9090f56af2a7a4716934d89..b742be43c35e6ee90e92f4b414869306d1699c69 100644 --- a/apps/files/l10n/lb.php +++ b/apps/files/l10n/lb.php @@ -12,12 +12,12 @@ $TRANSLATIONS = array( "Share" => "Deelen", "Rename" => "Ëm-benennen", "Error" => "Fehler", -"_%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("",""), +"_Uploading %n file_::_Uploading %n files_" => array("",""), "File handling" => "Fichier handling", "Maximum upload size" => "Maximum Upload Gréisst ", "max. possible: " => "max. méiglech:", diff --git a/apps/files/l10n/lt_LT.php b/apps/files/l10n/lt_LT.php index a8c30016d3c93e69f9e40ad788597ee641d40b59..f6fa6514c5c7e23f2a9e7d2ca75e269eab213dc7 100644 --- a/apps/files/l10n/lt_LT.php +++ b/apps/files/l10n/lt_LT.php @@ -38,24 +38,24 @@ $TRANSLATIONS = array( "Share" => "Dalintis", "Delete permanently" => "Ištrinti negrįžtamai", "Rename" => "Pervadinti", +"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.", +"Pending" => "Laukiantis", "Error moving file" => "Klaida perkeliant failą", "Error" => "Klaida", -"Pending" => "Laukiantis", "Could not rename file" => "Neįmanoma pervadinti failo", "Error deleting file." => "Klaida trinant failą.", +"Name" => "Pavadinimas", +"Size" => "Dydis", +"Modified" => "Pakeista", "_%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ų"), "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 App is enabled but your keys are not initialized, please log-out and log-in again" => "Šifravimo programa įjungta, bet Jūsų raktai nėra pritaikyti. Prašome atsijungti ir vėl prisijungti", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Netinkamas privatus raktas Šifravimo programai. Prašome atnaujinti savo privataus rakto slaptažodį asmeniniuose nustatymuose, kad atkurti prieigą prie šifruotų failų.", "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.", -"Name" => "Pavadinimas", -"Size" => "Dydis", -"Modified" => "Pakeista", +"{dirs} and {files}" => "{dirs} ir {files}", "%s could not be renamed" => "%s negali būti pervadintas", "File handling" => "Failų tvarkymas", "Maximum upload size" => "Maksimalus įkeliamo failo dydis", @@ -65,13 +65,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 yra neribotas", "Maximum input size for ZIP files" => "Maksimalus ZIP archyvo failo dydis", "Save" => "Išsaugoti", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Naudokite šį adresą, kad pasiektumėte savo failus per WebDAV", "New" => "Naujas", "New text file" => "Naujas tekstinis failas", "Text file" => "Teksto failas", "New folder" => "Naujas aplankas", "Folder" => "Katalogas", "From link" => "Iš nuorodos", -"Deleted files" => "Ištrinti failai", "Cancel upload" => "Atšaukti siuntimą", "You don’t have permission to upload or create files here" => "Jūs neturite leidimo čia įkelti arba kurti failus", "Nothing in here. Upload something!" => "Čia tuščia. Įkelkite ką nors!", diff --git a/apps/files/l10n/lv.php b/apps/files/l10n/lv.php index 71f3976816d3f3697ee56d59a30d3fdae9c9b065..970e960384606613120cf3c6a9d6fc162392d372 100644 --- a/apps/files/l10n/lv.php +++ b/apps/files/l10n/lv.php @@ -23,18 +23,18 @@ $TRANSLATIONS = array( "Share" => "Dalīties", "Delete permanently" => "Dzēst pavisam", "Rename" => "Pārsaukt", -"Error" => "Kļūda", +"Your download is being prepared. This might take some time if the files are big." => "Tiek sagatavota lejupielāde. Tas var aizņemt kādu laiciņu, ja datnes ir lielas.", "Pending" => "Gaida savu kārtu", +"Error" => "Kļūda", +"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"), "_Uploading %n file_::_Uploading %n files_" => array("%n","Augšupielāde %n failu","Augšupielāde %n failus"), "Your storage is full, files can not be updated or synced anymore!" => "Jūsu krātuve ir pilna, datnes vairs nevar augšupielādēt vai sinhronizēt!", "Your storage is almost full ({usedSpacePercent}%)" => "Jūsu krātuve ir gandrīz pilna ({usedSpacePercent}%)", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Šifrēšana tika atslēgta, tomēr jūsu faili joprojām ir šifrēti. Atšifrēt failus var Personiskajos uzstādījumos.", -"Your download is being prepared. This might take some time if the files are big." => "Tiek sagatavota lejupielāde. Tas var aizņemt kādu laiciņu, ja datnes ir lielas.", -"Name" => "Nosaukums", -"Size" => "Izmērs", -"Modified" => "Mainīts", "%s could not be renamed" => "%s nevar tikt pārsaukts", "File handling" => "Datņu pārvaldība", "Maximum upload size" => "Maksimālais datņu augšupielādes apjoms", @@ -44,12 +44,12 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 ir neierobežots", "Maximum input size for ZIP files" => "Maksimālais ievades izmērs ZIP datnēm", "Save" => "Saglabāt", +"WebDAV" => "WebDAV", "New" => "Jauna", "Text file" => "Teksta datne", "New folder" => "Jauna mape", "Folder" => "Mape", "From link" => "No saites", -"Deleted files" => "Dzēstās datnes", "Cancel upload" => "Atcelt augšupielādi", "Nothing in here. Upload something!" => "Te vēl nekas nav. Rīkojies, sāc augšupielādēt!", "Download" => "Lejupielādēt", diff --git a/apps/files/l10n/mk.php b/apps/files/l10n/mk.php index e1ff2c0bc27edae9171f60960a97f7497e82bd84..293756282c44fa36eb03b1fb3db7c23b44a3888d 100644 --- a/apps/files/l10n/mk.php +++ b/apps/files/l10n/mk.php @@ -33,20 +33,20 @@ $TRANSLATIONS = array( "Share" => "Сподели", "Delete permanently" => "Трајно избришани", "Rename" => "Преименувај", +"Your download is being prepared. This might take some time if the files are big." => "Вашето преземање се подготвува. Ова може да потрае до колку датотеките се големи.", +"Pending" => "Чека", "Error moving file" => "Грешка при префрлање на датотека", "Error" => "Грешка", -"Pending" => "Чека", "Could not rename file" => "Не можам да ја преименувам датотеката", +"Name" => "Име", +"Size" => "Големина", +"Modified" => "Променето", "_%n folder_::_%n folders_" => array("",""), "_%n file_::_%n files_" => array("",""), -"{dirs} and {files}" => "{dirs} и {files}", "_Uploading %n file_::_Uploading %n files_" => array("",""), "Your storage is full, files can not be updated or synced anymore!" => "Вашиот сториџ е полн, датотеките веќе не можат да се освежуваат или синхронизираат!", "Your storage is almost full ({usedSpacePercent}%)" => "Вашиот сториџ е скоро полн ({usedSpacePercent}%)", -"Your download is being prepared. This might take some time if the files are big." => "Вашето преземање се подготвува. Ова може да потрае до колку датотеките се големи.", -"Name" => "Име", -"Size" => "Големина", -"Modified" => "Променето", +"{dirs} and {files}" => "{dirs} и {files}", "%s could not be renamed" => "%s не може да биде преименуван", "File handling" => "Ракување со датотеки", "Maximum upload size" => "Максимална големина за подигање", @@ -56,11 +56,11 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 е неограничено", "Maximum input size for ZIP files" => "Максимална големина за внес на ZIP датотеки", "Save" => "Сними", +"WebDAV" => "WebDAV", "New" => "Ново", "Text file" => "Текстуална датотека", "Folder" => "Папка", "From link" => "Од врска", -"Deleted files" => "Избришани датотеки", "Cancel upload" => "Откажи прикачување", "Nothing in here. Upload something!" => "Тука нема ништо. Снимете нешто!", "Download" => "Преземи", diff --git a/apps/files/l10n/ms_MY.php b/apps/files/l10n/ms_MY.php index af42a3838b614c9f3711a1fc94aa0e3a4fc009e5..81d3de6299e4f8b87a56fcfcd03738b82897f8b1 100644 --- a/apps/files/l10n/ms_MY.php +++ b/apps/files/l10n/ms_MY.php @@ -11,14 +11,14 @@ $TRANSLATIONS = array( "Upload cancelled." => "Muatnaik dibatalkan.", "Share" => "Kongsi", "Rename" => "Namakan", -"Error" => "Ralat", "Pending" => "Dalam proses", -"_%n folder_::_%n folders_" => array(""), -"_%n file_::_%n files_" => array(""), -"_Uploading %n file_::_Uploading %n files_" => array(""), +"Error" => "Ralat", "Name" => "Nama", "Size" => "Saiz", "Modified" => "Dimodifikasi", +"_%n folder_::_%n folders_" => array(""), +"_%n file_::_%n files_" => array(""), +"_Uploading %n file_::_Uploading %n files_" => array(""), "File handling" => "Pengendalian fail", "Maximum upload size" => "Saiz maksimum muat naik", "max. possible: " => "maksimum:", diff --git a/apps/files/l10n/nb_NO.php b/apps/files/l10n/nb_NO.php index 9887087cca7e0ece456e7408c6e904d5ce46cd55..81f96a81c48b41559973a2678b2439578492b64a 100644 --- a/apps/files/l10n/nb_NO.php +++ b/apps/files/l10n/nb_NO.php @@ -38,24 +38,24 @@ $TRANSLATIONS = array( "Share" => "Del", "Delete permanently" => "Slett permanent", "Rename" => "Gi nytt navn", +"Your download is being prepared. This might take some time if the files are big." => "Nedlastingen din klargjøres. Hvis filene er store kan dette ta litt tid.", +"Pending" => "Ventende", "Error moving file" => "Feil ved flytting av fil", "Error" => "Feil", -"Pending" => "Ventende", "Could not rename file" => "Klarte ikke å gi nytt navn til fil", "Error deleting file." => "Feil ved sletting av fil.", +"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"), -"{dirs} and {files}" => "{dirs} og {files}", "_Uploading %n file_::_Uploading %n files_" => array("Laster opp %n fil","Laster opp %n filer"), "Your storage is full, files can not be updated or synced anymore!" => "Lagringsplass er oppbrukt, filer kan ikke lenger oppdateres eller synkroniseres!", "Your storage is almost full ({usedSpacePercent}%)" => "Lagringsplass er nesten brukt opp ([usedSpacePercent}%)", "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "App for kryptering er aktivert men nøklene dine er ikke satt opp. Logg ut og logg inn igjen.", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Ugyldig privat nøkkel for Krypterings-app. Oppdater passordet for din private nøkkel i dine personlige innstillinger for å gjenopprette tilgang til de krypterte filene dine.", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Kryptering ble slått av men filene dine er fremdeles kryptert. Gå til dine personlige innstillinger for å dekryptere filene dine.", -"Your download is being prepared. This might take some time if the files are big." => "Nedlastingen din klargjøres. Hvis filene er store kan dette ta litt tid.", -"Name" => "Navn", -"Size" => "Størrelse", -"Modified" => "Endret", +"{dirs} and {files}" => "{dirs} og {files}", "%s could not be renamed" => "Kunne ikke gi nytt navn til %s", "File handling" => "Filhåndtering", "Maximum upload size" => "Maksimum opplastingsstørrelse", @@ -65,13 +65,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 er ubegrenset", "Maximum input size for ZIP files" => "Maksimal størrelse på ZIP-filer", "Save" => "Lagre", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Bruk denne adressen for å aksessere filene dine via WebDAV", "New" => "Ny", "New text file" => "Ny tekstfil", "Text file" => "Tekstfil", "New folder" => "Ny mappe", "Folder" => "Mappe", "From link" => "Fra link", -"Deleted files" => "Slettede filer", "Cancel upload" => "Avbryt opplasting", "You don’t have permission to upload or create files here" => "Du har ikke tillatelse til å laste opp eller opprette filer her", "Nothing in here. Upload something!" => "Ingenting her. Last opp noe!", diff --git a/apps/files/l10n/nl.php b/apps/files/l10n/nl.php index e33d26e38d9106a5291b0b09152a53604f080623..b4b6be87304a2f8fcfadb410c0e6852a4d46704b 100644 --- a/apps/files/l10n/nl.php +++ b/apps/files/l10n/nl.php @@ -42,14 +42,18 @@ $TRANSLATIONS = array( "Share" => "Delen", "Delete permanently" => "Verwijder definitief", "Rename" => "Hernoem", +"Your download is being prepared. This might take some time if the files are big." => "Uw download wordt voorbereid. Dit kan enige tijd duren bij grote bestanden.", +"Pending" => "In behandeling", +"Error moving file." => "Fout bij verplaatsen bestand", "Error moving file" => "Fout bij verplaatsen bestand", "Error" => "Fout", -"Pending" => "In behandeling", "Could not rename file" => "Kon niet hernoemen bestand", "Error deleting file." => "Fout bij verwijderen bestand.", +"Name" => "Naam", +"Size" => "Grootte", +"Modified" => "Aangepast", "_%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"), "\"{name}\" is an invalid file name." => "\"{name}\" is een ongeldige bestandsnaam.", "Your storage is full, files can not be updated or synced anymore!" => "Uw opslagruimte zit vol, Bestanden kunnen niet meer worden ge-upload of gesynchroniseerd!", @@ -57,10 +61,7 @@ $TRANSLATIONS = array( "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Crypto app is geactiveerd, maar uw sleutels werden niet geïnitialiseerd. Log uit en log daarna opnieuw in.", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Ongeldige privésleutel voor crypto app. Werk het privésleutel wachtwoord bij in uw persoonlijke instellingen om opnieuw toegang te krijgen tot uw versleutelde bestanden.", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Encryptie is uitgeschakeld maar uw bestanden zijn nog steeds versleuteld. Ga naar uw persoonlijke instellingen om uw bestanden te decoderen.", -"Your download is being prepared. This might take some time if the files are big." => "Uw download wordt voorbereid. Dit kan enige tijd duren bij grote bestanden.", -"Name" => "Naam", -"Size" => "Grootte", -"Modified" => "Aangepast", +"{dirs} and {files}" => "{dirs} en {files}", "%s could not be renamed" => "%s kon niet worden hernoemd", "Upload (max. %s)" => "Upload (max. %s)", "File handling" => "Bestand", @@ -71,13 +72,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 is ongelimiteerd", "Maximum input size for ZIP files" => "Maximale grootte voor ZIP bestanden", "Save" => "Bewaren", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Gebruik deze link om uw bestanden via WebDAV te benaderen", "New" => "Nieuw", "New text file" => "Nieuw tekstbestand", "Text file" => "Tekstbestand", "New folder" => "Nieuwe map", "Folder" => "Map", "From link" => "Vanaf link", -"Deleted files" => "Verwijderde bestanden", "Cancel upload" => "Upload afbreken", "You don’t have permission to upload or create files here" => "U hebt geen toestemming om hier te uploaden of bestanden te maken", "Nothing in here. Upload something!" => "Er bevindt zich hier niets. Upload een bestand!", diff --git a/apps/files/l10n/nn_NO.php b/apps/files/l10n/nn_NO.php index 693bfccb09381c4a5e6d08d4e3e70a0b845a652e..2c6c0479ebcf3b41521e60201abf89975c851e7b 100644 --- a/apps/files/l10n/nn_NO.php +++ b/apps/files/l10n/nn_NO.php @@ -27,20 +27,20 @@ $TRANSLATIONS = array( "Share" => "Del", "Delete permanently" => "Slett for godt", "Rename" => "Endra namn", +"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.", +"Pending" => "Under vegs", "Error moving file" => "Feil ved flytting av fil", "Error" => "Feil", -"Pending" => "Under vegs", +"Name" => "Namn", +"Size" => "Storleik", +"Modified" => "Endra", "_%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"), "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.", -"Name" => "Namn", -"Size" => "Storleik", -"Modified" => "Endra", +"{dirs} and {files}" => "{dirs} og {files}", "%s could not be renamed" => "Klarte ikkje å omdøypa på %s", "File handling" => "Filhandtering", "Maximum upload size" => "Maksimal opplastingsstorleik", @@ -50,11 +50,12 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 er ubegrensa", "Maximum input size for ZIP files" => "Maksimal storleik for ZIP-filer", "Save" => "Lagre", +"WebDAV" => "WebDAV", "New" => "Ny", "Text file" => "Tekst fil", +"New folder" => "Ny mappe", "Folder" => "Mappe", "From link" => "Frå lenkje", -"Deleted files" => "Sletta filer", "Cancel upload" => "Avbryt opplasting", "Nothing in here. Upload something!" => "Ingenting her. Last noko opp!", "Download" => "Last ned", diff --git a/apps/files/l10n/oc.php b/apps/files/l10n/oc.php index f3d790a533fd8fd73677ced8dba6385d3cae498d..3683ae433a67515633b8faa225188ed59046d575 100644 --- a/apps/files/l10n/oc.php +++ b/apps/files/l10n/oc.php @@ -11,14 +11,14 @@ $TRANSLATIONS = array( "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. ", "Share" => "Parteja", "Rename" => "Torna nomenar", -"Error" => "Error", "Pending" => "Al esperar", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), -"_Uploading %n file_::_Uploading %n files_" => array("",""), +"Error" => "Error", "Name" => "Nom", "Size" => "Talha", "Modified" => "Modificat", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), +"_Uploading %n file_::_Uploading %n files_" => array("",""), "File handling" => "Manejament de fichièr", "Maximum upload size" => "Talha maximum d'amontcargament", "max. possible: " => "max. possible: ", diff --git a/apps/files/l10n/pl.php b/apps/files/l10n/pl.php index 30c3496db33e209275bfd94b963db2114a7bd7e3..177ae51391caecb47872926e2cef451d5a40468a 100644 --- a/apps/files/l10n/pl.php +++ b/apps/files/l10n/pl.php @@ -42,14 +42,18 @@ $TRANSLATIONS = array( "Share" => "Udostępnij", "Delete permanently" => "Trwale usuń", "Rename" => "Zmień nazwę", +"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.", +"Pending" => "Oczekujące", +"Error moving file." => "Błąd podczas przenoszenia pliku.", "Error moving file" => "Błąd prz przenoszeniu pliku", "Error" => "Błąd", -"Pending" => "Oczekujące", "Could not rename file" => "Nie można zmienić nazwy pliku", "Error deleting file." => "Błąd podczas usuwania pliku", +"Name" => "Nazwa", +"Size" => "Rozmiar", +"Modified" => "Modyfikacja", "_%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}" => "{dirs} i {files}", "_Uploading %n file_::_Uploading %n files_" => array("Wysyłanie %n pliku","Wysyłanie %n plików","Wysyłanie %n plików"), "\"{name}\" is an invalid file name." => "\"{name}\" jest nieprawidłową nazwą pliku.", "Your storage is full, files can not be updated or synced anymore!" => "Magazyn jest pełny. Pliki nie mogą zostać zaktualizowane lub zsynchronizowane!", @@ -57,10 +61,7 @@ $TRANSLATIONS = array( "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Aplikacja szyfrująca jest aktywna, ale twoje klucze nie zostały zainicjowane, prosze wyloguj się i zaloguj ponownie.", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Klucz prywatny nie jest poprawny! Może Twoje hasło zostało zmienione z zewnątrz. Można zaktualizować hasło klucza prywatnego w ustawieniach osobistych w celu odzyskania dostępu do plików", "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.", -"Name" => "Nazwa", -"Size" => "Rozmiar", -"Modified" => "Modyfikacja", +"{dirs} and {files}" => "{dirs} i {files}", "%s could not be renamed" => "%s nie można zmienić nazwy", "Upload (max. %s)" => "Wysyłka (max. %s)", "File handling" => "Zarządzanie plikami", @@ -71,13 +72,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 - bez limitów", "Maximum input size for ZIP files" => "Maksymalna wielkość pliku wejściowego ZIP ", "Save" => "Zapisz", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Użyj tego adresu do dostępu do twoich plików przez WebDAV", "New" => "Nowy", "New text file" => "Nowy plik tekstowy", "Text file" => "Plik tekstowy", "New folder" => "Nowy folder", "Folder" => "Folder", "From link" => "Z odnośnika", -"Deleted files" => "Pliki usunięte", "Cancel upload" => "Anuluj wysyłanie", "You don’t have permission to upload or create files here" => "Nie masz uprawnień do wczytywania lub tworzenia plików w tym miejscu", "Nothing in here. Upload something!" => "Pusto. Wyślij coś!", diff --git a/apps/files/l10n/pt_BR.php b/apps/files/l10n/pt_BR.php index 10d8892e18faa20d7eba506cde445f4ee388927f..e65504ea474d897cdeac1c050460313d90a697df 100644 --- a/apps/files/l10n/pt_BR.php +++ b/apps/files/l10n/pt_BR.php @@ -28,6 +28,7 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "Falha no envio. Não foi possível obter informações do arquivo.", "Invalid directory." => "Diretório inválido.", "Files" => "Arquivos", +"All files" => "Todos os arquivos", "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", "Total file size {size1} exceeds upload limit {size2}" => "Tamanho total do arquivo {size1} excede limite de envio {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" => "Não há espaço suficiente, você está enviando {size1} mas resta apenas {size2}", @@ -42,14 +43,18 @@ $TRANSLATIONS = array( "Share" => "Compartilhar", "Delete permanently" => "Excluir permanentemente", "Rename" => "Renomear", +"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.", +"Pending" => "Pendente", +"Error moving file." => "Erro movendo o arquivo.", "Error moving file" => "Erro movendo o arquivo", "Error" => "Erro", -"Pending" => "Pendente", "Could not rename file" => "Não foi possível renomear o arquivo", "Error deleting file." => "Erro eliminando o arquivo.", +"Name" => "Nome", +"Size" => "Tamanho", +"Modified" => "Modificado", "_%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"), "\"{name}\" is an invalid file name." => "\"{name}\" é um nome de arquivo inválido.", "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!", @@ -57,10 +62,7 @@ $TRANSLATIONS = array( "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "App de encriptação está ativado, mas as chaves não estão inicializadas, por favor log-out e faça login novamente", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Chave do App de Encriptação é inválida. Por favor, atualize sua senha de chave privada em suas configurações pessoais para recuperar o acesso a seus arquivos criptografados.", "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.", -"Name" => "Nome", -"Size" => "Tamanho", -"Modified" => "Modificado", +"{dirs} and {files}" => "{dirs} e {files}", "%s could not be renamed" => "%s não pode ser renomeado", "Upload (max. %s)" => "Envio (max. %s)", "File handling" => "Tratamento de Arquivo", @@ -71,13 +73,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 para ilimitado", "Maximum input size for ZIP files" => "Tamanho máximo para arquivo ZIP", "Save" => "Guardar", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Use este endereço para ter acesso a seus Arquivos via WebDAV", "New" => "Novo", "New text file" => "Novo arquivo texto", "Text file" => "Arquivo texto", "New folder" => "Nova pasta", "Folder" => "Pasta", "From link" => "Do link", -"Deleted files" => "Arquivos apagados", "Cancel upload" => "Cancelar upload", "You don’t have permission to upload or create files here" => "Você não tem permissão para carregar ou criar arquivos aqui", "Nothing in here. Upload something!" => "Nada aqui.Carrege alguma coisa!", diff --git a/apps/files/l10n/pt_PT.php b/apps/files/l10n/pt_PT.php index c24d2cf8f38e2d1fb6263fa6bee03dd7065af07e..189cdebf791c2626d0210ae94e874c16d3f06148 100644 --- a/apps/files/l10n/pt_PT.php +++ b/apps/files/l10n/pt_PT.php @@ -3,7 +3,9 @@ $TRANSLATIONS = array( "Could not move %s - File with this name already exists" => "Não pôde mover o ficheiro %s - Já existe um ficheiro com esse nome", "Could not move %s" => "Não foi possível move o ficheiro %s", "File name cannot be empty." => "O nome do ficheiro não pode estar vazio.", +"\"%s\" is an invalid file name." => "\"%s\" é um nome de ficheiro inválido.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nome Inválido, os caracteres '\\', '/', '<', '>', ':', '\"', '|', '?' e '*' não são permitidos.", +"The target folder has been moved or deleted." => "A pasta de destino foi movida ou eliminada.", "The name %s is already used in the folder %s. Please choose a different name." => "O nome %s já está em uso na pasta %s. Por favor escolha um nome diferente.", "Not a valid source" => "Não é uma fonte válida", "Server is not allowed to open URLs, please check the server configuration" => "O servidor não consegue abrir URLs, por favor verifique a configuração do servidor", @@ -27,6 +29,8 @@ $TRANSLATIONS = array( "Invalid directory." => "Directório Inválido", "Files" => "Ficheiros", "Unable to upload {filename} as it is a directory or has 0 bytes" => "Incapaz de enviar {filename}, dado que é uma pasta, ou tem 0 bytes", +"Total file size {size1} exceeds upload limit {size2}" => "O tamanho total do ficheiro {size1} excede o limite de carregamento {size2}", +"Not enough free space, you are uploading {size1} but only {size2} is left" => "Não existe espaço suficiente. Está a enviar {size1} mas apenas existe {size2} disponível", "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." => "Envio de ficheiro em progresso. Irá cancelar o envio se sair da página agora.", @@ -38,25 +42,28 @@ $TRANSLATIONS = array( "Share" => "Partilhar", "Delete permanently" => "Eliminar permanentemente", "Rename" => "Renomear", +"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.", +"Pending" => "Pendente", +"Error moving file." => "Erro a mover o ficheiro.", "Error moving file" => "Erro ao mover o ficheiro", "Error" => "Erro", -"Pending" => "Pendente", "Could not rename file" => "Não pôde renomear o ficheiro", "Error deleting file." => "Erro ao apagar o ficheiro.", +"Name" => "Nome", +"Size" => "Tamanho", +"Modified" => "Modificado", "_%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"), +"\"{name}\" is an invalid file name." => "\"{name}\" é um nome de ficheiro inválido.", "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 App is enabled but your keys are not initialized, please log-out and log-in again" => "A Aplicação de Encriptação está ativada, mas as suas chaves não inicializaram. Por favor termine e inicie a sessão novamente", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Chave privada inválida da Aplicação de Encriptação. Por favor atualize a sua senha de chave privada nas definições pessoais, para recuperar o acesso aos seus ficheiros encriptados.", "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", +"{dirs} and {files}" => "{dirs} e {files}", "%s could not be renamed" => "%s não pode ser renomeada", +"Upload (max. %s)" => "Enviar (max. %s)", "File handling" => "Manuseamento de ficheiros", "Maximum upload size" => "Tamanho máximo de envio", "max. possible: " => "max. possivel: ", @@ -65,13 +72,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 é ilimitado", "Maximum input size for ZIP files" => "Tamanho máximo para ficheiros ZIP", "Save" => "Guardar", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Utilize esta ligação para aceder aos seus ficheiros via WebDAV", "New" => "Novo", "New text file" => "Novo ficheiro de texto", "Text file" => "Ficheiro de texto", "New folder" => "Nova Pasta", "Folder" => "Pasta", "From link" => "Da ligação", -"Deleted files" => "Ficheiros eliminados", "Cancel upload" => "Cancelar envio", "You don’t have permission to upload or create files here" => "Você não tem permissão para enviar ou criar ficheiros aqui", "Nothing in here. Upload something!" => "Vazio. Envie alguma coisa!", diff --git a/apps/files/l10n/ro.php b/apps/files/l10n/ro.php index d3927f5daf0c5a05b29d43d25e0e2f5788cdf1d8..befb4bad3ac6237448d2eaaebb7a028e47b730f5 100644 --- a/apps/files/l10n/ro.php +++ b/apps/files/l10n/ro.php @@ -6,7 +6,9 @@ $TRANSLATIONS = array( "\"%s\" is an invalid file name." => "\"%s\" este un nume de fișier nevalid", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nume nevalide, '\\', '/', '<', '>', ':', '\"', '|', '?' și '*' nu sunt permise.", "The target folder has been moved or deleted." => "Dosarul țintă a fost mutat sau șters.", +"The name %s is already used in the folder %s. Please choose a different name." => "Numele %s este deja este folosit în dosarul %s. Te rog alege alt nume.", "Not a valid source" => "Sursă nevalidă", +"Server is not allowed to open URLs, please check the server configuration" => "Serverului nu ii este permis sa deschida URL-ul , verificati setarile serverului", "Error while downloading %s to %s" => "Eroare la descarcarea %s in %s", "Error when creating the file" => "Eroare la crearea fisierului", "Folder name cannot be empty." => "Numele folderului nu poate fi liber.", @@ -40,23 +42,26 @@ $TRANSLATIONS = array( "Share" => "Partajează", "Delete permanently" => "Șterge permanent", "Rename" => "Redenumește", +"Your download is being prepared. This might take some time if the files are big." => "Se pregătește descărcarea. Aceasta poate dura ceva timp dacă fișierele sunt mari.", +"Pending" => "În așteptare", +"Error moving file." => "Eroare la mutarea fișierului.", "Error moving file" => "Eroare la mutarea fișierului", "Error" => "Eroare", -"Pending" => "În așteptare", "Could not rename file" => "Nu s-a putut redenumi fisierul", "Error deleting file." => "Eroare la ștergerea fisierului.", +"Name" => "Nume", +"Size" => "Mărime", +"Modified" => "Modificat", "_%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."), "\"{name}\" is an invalid file name." => "\"{name}\" este un nume de fișier nevalid.", "Your storage is full, files can not be updated or synced anymore!" => "Spațiul de stocare este plin, fișierele nu mai pot fi actualizate sau sincronizate!", "Your storage is almost full ({usedSpacePercent}%)" => "Spațiul de stocare este aproape plin ({usedSpacePercent}%)", +"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Aplicatia de criptare este activata dar tastatura nu este initializata , va rugam deconectati-va si reconectati-va", +"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Cheie privată nevalidă pentru aplicația Încriptare. Te rog, actualizează-ți parola cheii private folosind setările personale pentru a reaccesa fișierele tale încriptate.", "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." => "Se pregătește descărcarea. Aceasta poate dura ceva timp dacă fișierele sunt mari.", -"Name" => "Nume", -"Size" => "Mărime", -"Modified" => "Modificat", +"{dirs} and {files}" => "{dirs} și {files}", "%s could not be renamed" => "%s nu a putut fi redenumit", "Upload (max. %s)" => "Încarcă (max. %s)", "File handling" => "Manipulare fișiere", @@ -67,13 +72,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 este nelimitat", "Maximum input size for ZIP files" => "Dimensiunea maximă de intrare pentru fișierele ZIP", "Save" => "Salvează", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Folosește această adresă pentru acces la fișierele tale folosind WebDAV", "New" => "Nou", "New text file" => "Un nou fișier text", "Text file" => "Fișier text", "New folder" => "Un nou dosar", "Folder" => "Dosar", "From link" => "De la adresa", -"Deleted files" => "Fișiere șterse", "Cancel upload" => "Anulează încărcarea", "You don’t have permission to upload or create files here" => "Nu aveti permisiunea de a incarca sau crea fisiere aici", "Nothing in here. Upload something!" => "Nimic aici. Încarcă ceva!", diff --git a/apps/files/l10n/ru.php b/apps/files/l10n/ru.php index d10a7e2eca5d4745ac70562269f1d2b9d443837a..9ebd626eac65bc4f6b63199cf8f5a781164a8371 100644 --- a/apps/files/l10n/ru.php +++ b/apps/files/l10n/ru.php @@ -42,14 +42,17 @@ $TRANSLATIONS = array( "Share" => "Открыть доступ", "Delete permanently" => "Удалить окончательно", "Rename" => "Переименовать", +"Your download is being prepared. This might take some time if the files are big." => "Идёт подготовка к скачиванию. Это может занять некоторое время, если файлы большого размера.", +"Pending" => "Ожидание", "Error moving file" => "Ошибка при перемещении файла", "Error" => "Ошибка", -"Pending" => "Ожидание", "Could not rename file" => "Не удалось переименовать файл", "Error deleting file." => "Ошибка при удалении файла.", +"Name" => "Имя", +"Size" => "Размер", +"Modified" => "Дата изменения", "_%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 файлов"), "\"{name}\" is an invalid file name." => "\"{name}\" это не правильное имя файла.", "Your storage is full, files can not be updated or synced anymore!" => "Ваше хранилище заполнено, произведите очистку перед загрузкой новых файлов.", @@ -57,10 +60,7 @@ $TRANSLATIONS = array( "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Приложение для шифрования активно, но ваши ключи не инициализированы, пожалуйста, перелогиньтесь", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted 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." => "Идёт подготовка к скачиванию. Это может занять некоторое время, если файлы большого размера.", -"Name" => "Имя", -"Size" => "Размер", -"Modified" => "Дата изменения", +"{dirs} and {files}" => "{dirs} и {files}", "%s could not be renamed" => "%s не может быть переименован", "Upload (max. %s)" => "Загружено (max. %s)", "File handling" => "Управление файлами", @@ -71,13 +71,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 - без ограничений", "Maximum input size for ZIP files" => "Максимальный исходный размер для ZIP файлов", "Save" => "Сохранить", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Используйте этот адресс для доступа к вашим файлам через WebDAV", "New" => "Новый", "New text file" => "Новый текстовый файл", "Text file" => "Текстовый файл", "New folder" => "Новый каталог", "Folder" => "Каталог", "From link" => "Объект по ссылке", -"Deleted files" => "Удалённые файлы", "Cancel upload" => "Отменить загрузку", "You don’t have permission to upload or create files here" => "У вас нет прав для загрузки или создания файлов здесь.", "Nothing in here. Upload something!" => "Здесь ничего нет. Загрузите что-нибудь!", diff --git a/apps/files/l10n/si_LK.php b/apps/files/l10n/si_LK.php index ff6672f71123f0b7d5a26a156908d5f178921084..e8d2a8a53c8e8932cbc3adad2ee94c7ecab2abb4 100644 --- a/apps/files/l10n/si_LK.php +++ b/apps/files/l10n/si_LK.php @@ -13,12 +13,12 @@ $TRANSLATIONS = array( "Share" => "බෙදා හදා ගන්න", "Rename" => "නැවත නම් කරන්න", "Error" => "දෝෂයක්", -"_%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("",""), +"_Uploading %n file_::_Uploading %n files_" => array("",""), "File handling" => "ගොනු පරිහරණය", "Maximum upload size" => "උඩුගත කිරීමක උපරිම ප්‍රමාණය", "max. possible: " => "හැකි උපරිමය:", diff --git a/apps/files/l10n/sk_SK.php b/apps/files/l10n/sk_SK.php index 3d92dc1b5abbbe78cba40d61533d089033e0be05..2372a34aa304baeec70c80868f4c621593cfe31d 100644 --- a/apps/files/l10n/sk_SK.php +++ b/apps/files/l10n/sk_SK.php @@ -42,14 +42,17 @@ $TRANSLATIONS = array( "Share" => "Zdieľať", "Delete permanently" => "Zmazať trvalo", "Rename" => "Premenovať", +"Your download is being prepared. This might take some time if the files are big." => "Vaše sťahovanie sa pripravuje. Ak sú sťahované súbory veľké, môže to chvíľu trvať.", +"Pending" => "Prebieha", "Error moving file" => "Chyba pri presúvaní súboru", "Error" => "Chyba", -"Pending" => "Prebieha", "Could not rename file" => "Nemožno premenovať súbor", "Error deleting file." => "Chyba pri mazaní súboru.", +"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"), -"{dirs} and {files}" => "{dirs} a {files}", "_Uploading %n file_::_Uploading %n files_" => array("Nahrávam %n súbor","Nahrávam %n súbory","Nahrávam %n súborov"), "\"{name}\" is an invalid file name." => "\"{name}\" je neplatné meno súboru.", "Your storage is full, files can not be updated or synced anymore!" => "Vaše úložisko je plné. Súbory nemožno aktualizovať ani synchronizovať!", @@ -57,10 +60,7 @@ $TRANSLATIONS = array( "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Aplikácia na šifrovanie je zapnutá, ale vaše kľúče nie sú inicializované. Odhláste sa a znovu sa prihláste.", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Chybný súkromný kľúč na šifrovanie aplikácií. Zaktualizujte si heslo súkromného kľúča v svojom osobnom nastavení, aby ste znovu získali prístup k svojim zašifrovaným súborom.", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Šifrovanie bolo zakázané, ale vaše súbory sú stále zašifrované. Prosím, choďte do osobného nastavenia pre dešifrovanie súborov.", -"Your download is being prepared. This might take some time if the files are big." => "Vaše sťahovanie sa pripravuje. Ak sú sťahované súbory veľké, môže to chvíľu trvať.", -"Name" => "Názov", -"Size" => "Veľkosť", -"Modified" => "Upravené", +"{dirs} and {files}" => "{dirs} a {files}", "%s could not be renamed" => "%s nemohol byť premenovaný", "Upload (max. %s)" => "Nahrať (max. %s)", "File handling" => "Nastavenie správania sa k súborom", @@ -71,13 +71,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 znamená neobmedzené", "Maximum input size for ZIP files" => "Najväčšia veľkosť ZIP súborov", "Save" => "Uložiť", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Použite túto linku pre prístup k vašim súborom cez WebDAV", "New" => "Nový", "New text file" => "Nový textový súbor", "Text file" => "Textový súbor", "New folder" => "Nový priečinok", "Folder" => "Priečinok", "From link" => "Z odkazu", -"Deleted files" => "Zmazané súbory", "Cancel upload" => "Zrušiť odosielanie", "You don’t have permission to upload or create files here" => "Nemáte oprávnenie sem nahrávať alebo vytvoriť súbory", "Nothing in here. Upload something!" => "Žiadny súbor. Nahrajte niečo!", diff --git a/apps/files/l10n/sl.php b/apps/files/l10n/sl.php index ac304d992ca1b9fa5afb0de02fe99244bd80b420..48f455cc87c72b9ae9afe6edb54f6d2e562947e6 100644 --- a/apps/files/l10n/sl.php +++ b/apps/files/l10n/sl.php @@ -42,14 +42,18 @@ $TRANSLATIONS = array( "Share" => "Souporaba", "Delete permanently" => "Izbriši dokončno", "Rename" => "Preimenuj", +"Your download is being prepared. This might take some time if the files are big." => "Postopek priprave datoteke za prejem je lahko dolgotrajen, kadar je datoteka zelo velika.", +"Pending" => "V čakanju ...", +"Error moving file." => "Napaka premikanja datoteke.", "Error moving file" => "Napaka premikanja datoteke", "Error" => "Napaka", -"Pending" => "V čakanju ...", "Could not rename file" => "Ni mogoče preimenovati datoteke", "Error deleting file." => "Napaka brisanja datoteke.", +"Name" => "Ime", +"Size" => "Velikost", +"Modified" => "Spremenjeno", "_%n folder_::_%n folders_" => array("%n mapa","%n mapi","%n mape","%n map"), "_%n file_::_%n files_" => array("%n datoteka","%n datoteki","%n datoteke","%n datotek"), -"{dirs} and {files}" => "{dirs} in {files}", "_Uploading %n file_::_Uploading %n files_" => array("Posodabljanje %n datoteke","Posodabljanje %n datotek","Posodabljanje %n datotek","Posodabljanje %n datotek"), "\"{name}\" is an invalid file name." => "\"{name}\" je neveljavno ime datoteke.", "Your storage is full, files can not be updated or synced anymore!" => "Shramba je povsem napolnjena. Datotek ni več mogoče posodabljati in usklajevati!", @@ -57,10 +61,7 @@ $TRANSLATIONS = array( "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Program za šifriranje je omogočen, vendar ni začet. Odjavite se in nato ponovno prijavite.", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Ni ustreznega osebnega ključa za program za šifriranje. Posodobite osebni ključ za dostop do šifriranih datotek med nastavitvami.", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Šifriranje je onemogočeno, datoteke pa so še vedno šifrirane. Odšifrirajte jih med nastavitvami.", -"Your download is being prepared. This might take some time if the files are big." => "Postopek priprave datoteke za prejem je lahko dolgotrajen, kadar je datoteka zelo velika.", -"Name" => "Ime", -"Size" => "Velikost", -"Modified" => "Spremenjeno", +"{dirs} and {files}" => "{dirs} in {files}", "%s could not be renamed" => "%s ni mogoče preimenovati", "Upload (max. %s)" => "Pošiljanje (omejitev %s)", "File handling" => "Upravljanje z datotekami", @@ -71,13 +72,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 predstavlja neomejeno vrednost", "Maximum input size for ZIP files" => "Največja vhodna velikost za datoteke ZIP", "Save" => "Shrani", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Uporabite naslov za dostop do datotek rpeko sistema WebDAV.", "New" => "Novo", "New text file" => "Nova besedilna datoteka", "Text file" => "Besedilna datoteka", "New folder" => "Nova mapa", "Folder" => "Mapa", "From link" => "Iz povezave", -"Deleted files" => "Izbrisane datoteke", "Cancel upload" => "Prekliči pošiljanje", "You don’t have permission to upload or create files here" => "Ni ustreznih dovoljenj za pošiljanje ali ustvarjanje datotek na tem mestu.", "Nothing in here. Upload something!" => "Tukaj še ni ničesar. Najprej je treba kakšno datoteko poslati v oblak!", diff --git a/apps/files/l10n/sq.php b/apps/files/l10n/sq.php index a7f1cb3413349d3bb8d70b29098397b1b20dd3f3..5a125683b0ef3064de5a3ed4621c02ab0dc86e8e 100644 --- a/apps/files/l10n/sq.php +++ b/apps/files/l10n/sq.php @@ -25,20 +25,20 @@ $TRANSLATIONS = array( "Share" => "Ndaj", "Delete permanently" => "Fshi përfundimisht", "Rename" => "Riemëro", +"Your download is being prepared. This might take some time if the files are big." => "Shkarkimi juaj është duke u përgatitur. Kjo mund të kërkojë kohë nëse skedarët janë të mëdhenj.", +"Pending" => "Në vijim", "Error moving file" => "Gabim lëvizjen dokumentave", "Error" => "Gabim", -"Pending" => "Në vijim", +"Name" => "Emri", +"Size" => "Madhësia", +"Modified" => "Ndryshuar", "_%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ë"), "Your storage is full, files can not be updated or synced anymore!" => "Hapsira juaj e arkivimit është plot, skedarët nuk mund të përditësohen ose sinkronizohen!", "Your storage is almost full ({usedSpacePercent}%)" => "Hapsira juaj e arkivimit është pothuajse në fund ({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 është duke u përgatitur. Kjo mund të kërkojë kohë nëse skedarët janë të mëdhenj.", -"Name" => "Emri", -"Size" => "Madhësia", -"Modified" => "Ndryshuar", +"{dirs} and {files}" => "{dirs} dhe {files}", "%s could not be renamed" => "Nuk është i mundur riemërtimi i %s", "File handling" => "Trajtimi i Skedarëve", "Maximum upload size" => "Madhësia maksimale e nagarkimit", @@ -48,12 +48,12 @@ $TRANSLATIONS = array( "0 is unlimited" => "o është pa limit", "Maximum input size for ZIP files" => "Maksimumi hyrës i skedarëve ZIP", "Save" => "Ruaj", +"WebDAV" => "WebDAV", "New" => "E re", "Text file" => "Skedar tekst", "New folder" => "Dosje e're", "Folder" => "Dosje", "From link" => "Nga lidhja", -"Deleted files" => "Skedarë të fshirë ", "Cancel upload" => "Anullo ngarkimin", "Nothing in here. Upload something!" => "Këtu nuk ka asgje. Ngarko dicka", "Download" => "Shkarko", diff --git a/apps/files/l10n/sr.php b/apps/files/l10n/sr.php index 866d8dbdd03cb938bdfc936c6f573f52be061aa8..1f0aaab8cf3e53cf8a4e27efcd609dee6c35ee83 100644 --- a/apps/files/l10n/sr.php +++ b/apps/files/l10n/sr.php @@ -21,17 +21,17 @@ $TRANSLATIONS = array( "Share" => "Дели", "Delete permanently" => "Обриши за стално", "Rename" => "Преименуј", -"Error" => "Грешка", +"Your download is being prepared. This might take some time if the files are big." => "Припремам преузимање. Ово може да потраје ако су датотеке велике.", "Pending" => "На чекању", +"Error" => "Грешка", +"Name" => "Име", +"Size" => "Величина", +"Modified" => "Измењено", "_%n folder_::_%n folders_" => array("","",""), "_%n file_::_%n files_" => array("","",""), "_Uploading %n file_::_Uploading %n files_" => array("","",""), "Your storage is full, files can not be updated or synced anymore!" => "Ваше складиште је пуно. Датотеке више не могу бити ажуриране ни синхронизоване.", "Your storage is almost full ({usedSpacePercent}%)" => "Ваше складиште је скоро па пуно ({usedSpacePercent}%)", -"Your download is being prepared. This might take some time if the files are big." => "Припремам преузимање. Ово може да потраје ако су датотеке велике.", -"Name" => "Име", -"Size" => "Величина", -"Modified" => "Измењено", "File handling" => "Управљање датотекама", "Maximum upload size" => "Највећа величина датотеке", "max. possible: " => "највећа величина:", @@ -40,11 +40,11 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 је неограничено", "Maximum input size for ZIP files" => "Највећа величина ZIP датотека", "Save" => "Сачувај", +"WebDAV" => "WebDAV", "New" => "Нова", "Text file" => "текстуална датотека", "Folder" => "фасцикла", "From link" => "Са везе", -"Deleted files" => "Обрисане датотеке", "Cancel upload" => "Прекини отпремање", "Nothing in here. Upload something!" => "Овде нема ничег. Отпремите нешто!", "Download" => "Преузми", diff --git a/apps/files/l10n/sr@latin.php b/apps/files/l10n/sr@latin.php index 38039a19fc155d6e3db82484353cdcad835a965d..8ec42c56c743f25edb7b66a63a86119552c9ad11 100644 --- a/apps/files/l10n/sr@latin.php +++ b/apps/files/l10n/sr@latin.php @@ -9,12 +9,12 @@ $TRANSLATIONS = array( "Share" => "Podeli", "Rename" => "Preimenij", "Error" => "Greška", -"_%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("","",""), +"_Uploading %n file_::_Uploading %n files_" => array("","",""), "Maximum upload size" => "Maksimalna veličina pošiljke", "Save" => "Snimi", "Nothing in here. Upload something!" => "Ovde nema ničeg. Pošaljite nešto!", diff --git a/apps/files/l10n/sv.php b/apps/files/l10n/sv.php index f3d0170a30324f3d2e7d73be797bc00499740742..657eef47567e4e7e6acc60433c164d510150c526 100644 --- a/apps/files/l10n/sv.php +++ b/apps/files/l10n/sv.php @@ -28,6 +28,7 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "Uppladdning misslyckades. Gick inte att hämta filinformation.", "Invalid directory." => "Felaktig mapp.", "Files" => "Filer", +"All files" => "Alla filer", "Unable to upload {filename} as it is a directory or has 0 bytes" => "Kan inte ladda upp {filename} eftersom den antingen är en mapp eller har 0 bytes.", "Total file size {size1} exceeds upload limit {size2}" => "Totala filstorleken {size1} överskrider uppladdningsgränsen {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" => "Inte tillräckligt med ledigt utrymme, du laddar upp {size1} men endast {size2} finns kvar.", @@ -42,14 +43,18 @@ $TRANSLATIONS = array( "Share" => "Dela", "Delete permanently" => "Radera permanent", "Rename" => "Byt namn", +"Your download is being prepared. This might take some time if the files are big." => "Din nedladdning förbereds. Det kan ta tid om det är stora filer.", +"Pending" => "Väntar", +"Error moving file." => "Fel vid flytt av fil.", "Error moving file" => "Fel uppstod vid flyttning av fil", "Error" => "Fel", -"Pending" => "Väntar", "Could not rename file" => "Kan ej byta filnamn", "Error deleting file." => "Kunde inte ta bort filen.", +"Name" => "Namn", +"Size" => "Storlek", +"Modified" => "Ändrad", "_%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"), "\"{name}\" is an invalid file name." => "\"{name}\" är ett ogiltligt filnamn.", "Your storage is full, files can not be updated or synced anymore!" => "Ditt lagringsutrymme är fullt, filer kan inte längre uppdateras eller synkroniseras!", @@ -57,10 +62,7 @@ $TRANSLATIONS = array( "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Krypteringsprogrammet är aktiverat men dina nycklar är inte initierade. Vänligen logga ut och in igen", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Ogiltig privat nyckel i krypteringsprogrammet. Vänligen uppdatera lösenordet till din privata nyckel under dina personliga inställningar för att återfå tillgång till dina krypterade filer.", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Kryptering inaktiverades men dina filer är fortfarande krypterade. Vänligen gå till sidan för dina personliga inställningar för att dekryptera dina filer.", -"Your download is being prepared. This might take some time if the files are big." => "Din nedladdning förbereds. Det kan ta tid om det är stora filer.", -"Name" => "Namn", -"Size" => "Storlek", -"Modified" => "Ändrad", +"{dirs} and {files}" => "{dirs} och {files}", "%s could not be renamed" => "%s kunde inte namnändras", "Upload (max. %s)" => "Ladda upp (max. %s)", "File handling" => "Filhantering", @@ -71,13 +73,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 är oändligt", "Maximum input size for ZIP files" => "Största tillåtna storlek för ZIP-filer", "Save" => "Spara", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Använd denna adress till nå dina Filer via WebDAV", "New" => "Ny", "New text file" => "Ny textfil", "Text file" => "Textfil", "New folder" => "Ny mapp", "Folder" => "Mapp", "From link" => "Från länk", -"Deleted files" => "Raderade filer", "Cancel upload" => "Avbryt uppladdning", "You don’t have permission to upload or create files here" => "Du har ej tillåtelse att ladda upp eller skapa filer här", "Nothing in here. Upload something!" => "Ingenting här. Ladda upp något!", diff --git a/apps/files/l10n/ta_IN.php b/apps/files/l10n/ta_IN.php new file mode 100644 index 0000000000000000000000000000000000000000..0157af093e92200cc7790497227e92e62d80165f --- /dev/null +++ b/apps/files/l10n/ta_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/ta_LK.php b/apps/files/l10n/ta_LK.php index 0ab17785b93642004f0673e2013551116b9b50c1..bba3ce994220ebd10661663e81da94f9c2dfddc4 100644 --- a/apps/files/l10n/ta_LK.php +++ b/apps/files/l10n/ta_LK.php @@ -14,14 +14,14 @@ $TRANSLATIONS = array( "{new_name} already exists" => "{new_name} ஏற்கனவே உள்ளது", "Share" => "பகிர்வு", "Rename" => "பெயர்மாற்றம்", -"Error" => "வழு", "Pending" => "நிலுவையிலுள்ள", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), -"_Uploading %n file_::_Uploading %n files_" => array("",""), +"Error" => "வழு", "Name" => "பெயர்", "Size" => "அளவு", "Modified" => "மாற்றப்பட்டது", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), +"_Uploading %n file_::_Uploading %n files_" => array("",""), "File handling" => "கோப்பு கையாளுதல்", "Maximum upload size" => "பதிவேற்றக்கூடிய ஆகக்கூடிய அளவு ", "max. possible: " => "ஆகக் கூடியது:", diff --git a/apps/files/l10n/te.php b/apps/files/l10n/te.php index b2cf4c01d8a6175e7415859bfe4a5f8c4a50a07a..0cf230fd55dacbcc833663a3100d4290dff09d0a 100644 --- a/apps/files/l10n/te.php +++ b/apps/files/l10n/te.php @@ -2,11 +2,11 @@ $TRANSLATIONS = array( "Delete permanently" => "శాశ్వతంగా తొలగించు", "Error" => "పొరపాటు", +"Name" => "పేరు", +"Size" => "పరిమాణం", "_%n folder_::_%n folders_" => array("",""), "_%n file_::_%n files_" => array("",""), "_Uploading %n file_::_Uploading %n files_" => array("",""), -"Name" => "పేరు", -"Size" => "పరిమాణం", "Save" => "భద్రపరచు", "New folder" => "కొత్త సంచయం", "Folder" => "సంచయం", diff --git a/apps/files/l10n/th_TH.php b/apps/files/l10n/th_TH.php index f0fd29da7e4cefcc684afe9acbe15099fe83adc0..67ebb99f660c6f520d5a6b502803a845bd2e214c 100644 --- a/apps/files/l10n/th_TH.php +++ b/apps/files/l10n/th_TH.php @@ -20,17 +20,17 @@ $TRANSLATIONS = array( "{new_name} already exists" => "{new_name} มีอยู่แล้วในระบบ", "Share" => "แชร์", "Rename" => "เปลี่ยนชื่อ", -"Error" => "ข้อผิดพลาด", +"Your download is being prepared. This might take some time if the files are big." => "กำลังเตรียมดาวน์โหลดข้อมูล หากไฟล์มีขนาดใหญ่ อาจใช้เวลาสักครู่", "Pending" => "อยู่ระหว่างดำเนินการ", +"Error" => "ข้อผิดพลาด", +"Name" => "ชื่อ", +"Size" => "ขนาด", +"Modified" => "แก้ไขแล้ว", "_%n folder_::_%n folders_" => array(""), "_%n file_::_%n files_" => array(""), "_Uploading %n file_::_Uploading %n files_" => array(""), "Your storage is full, files can not be updated or synced anymore!" => "พื้นที่จัดเก็บข้อมูลของคุณเต็มแล้ว ไม่สามารถอัพเดทหรือผสานไฟล์ต่างๆได้อีกต่อไป", "Your storage is almost full ({usedSpacePercent}%)" => "พื้นที่จัดเก็บข้อมูลของคุณใกล้เต็มแล้ว ({usedSpacePercent}%)", -"Your download is being prepared. This might take some time if the files are big." => "กำลังเตรียมดาวน์โหลดข้อมูล หากไฟล์มีขนาดใหญ่ อาจใช้เวลาสักครู่", -"Name" => "ชื่อ", -"Size" => "ขนาด", -"Modified" => "แก้ไขแล้ว", "File handling" => "การจัดกาไฟล์", "Maximum upload size" => "ขนาดไฟล์สูงสุดที่อัพโหลดได้", "max. possible: " => "จำนวนสูงสุดที่สามารถทำได้: ", @@ -39,6 +39,7 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 หมายถึงไม่จำกัด", "Maximum input size for ZIP files" => "ขนาดไฟล์ ZIP สูงสุด", "Save" => "บันทึก", +"WebDAV" => "WebDAV", "New" => "อัพโหลดไฟล์ใหม่", "Text file" => "ไฟล์ข้อความ", "New folder" => "โฟลเดอร์ใหม่", diff --git a/apps/files/l10n/tr.php b/apps/files/l10n/tr.php index 77c310fc9ebc691f8da163a106e66f787c5bb3f1..45e8062ad6809e4b0126d4e8ff838abc99c03ddb 100644 --- a/apps/files/l10n/tr.php +++ b/apps/files/l10n/tr.php @@ -28,6 +28,7 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "Yükleme başarısız. Dosya bilgisi alınamadı.", "Invalid directory." => "Geçersiz dizin.", "Files" => "Dosyalar", +"All files" => "Tüm dosyalar", "Unable to upload {filename} as it is a directory or has 0 bytes" => "Bir dizin veya 0 bayt olduğundan {filename} yüklenemedi", "Total file size {size1} exceeds upload limit {size2}" => "Toplam dosya boyutu {size1}, {size2} gönderme sınırını aşıyor", "Not enough free space, you are uploading {size1} but only {size2} is left" => "Yeterince boş alan yok. Gönderdiğiniz boyut {size1} ancak {size2} alan mevcut", @@ -41,15 +42,19 @@ $TRANSLATIONS = array( "Error fetching URL" => "Adres getirilirken hata", "Share" => "Paylaş", "Delete permanently" => "Kalıcı olarak sil", -"Rename" => "İsim değiştir.", +"Rename" => "Yeniden adlandır", +"Your download is being prepared. This might take some time if the files are big." => "İndirmeniz hazırlanıyor. Dosya büyük ise biraz zaman alabilir.", +"Pending" => "Bekliyor", +"Error moving file." => "Dosya taşıma hatası.", "Error moving file" => "Dosya taşıma hatası", "Error" => "Hata", -"Pending" => "Bekliyor", "Could not rename file" => "Dosya adlandırılamadı", "Error deleting file." => "Dosya silinirken hata.", +"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"), -"{dirs} and {files}" => "{dirs} ve {files}", "_Uploading %n file_::_Uploading %n files_" => array("%n dosya yükleniyor","%n dosya yükleniyor"), "\"{name}\" is an invalid file name." => "\"{name}\" geçersiz bir dosya adı.", "Your storage is full, files can not be updated or synced anymore!" => "Depolama alanınız dolu, artık dosyalar güncellenmeyecek veya eşitlenmeyecek.", @@ -57,10 +62,7 @@ $TRANSLATIONS = array( "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Şifreleme Uygulaması etkin ancak anahtarlarınız başlatılmamış. Lütfen oturumu kapatıp yeniden açın", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Şifreleme Uygulaması için geçersiz özel anahtar. Lütfen şifreli dosyalarınıza erişimi tekrar kazanabilmek için kişisel ayarlarınızdan özel anahtar parolanızı güncelleyin.", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Şifreleme işlemi durduruldu ancak dosyalarınız şifreli. Dosyalarınızın şifresini kaldırmak için lütfen kişisel ayarlar kısmına geçin.", -"Your download is being prepared. This might take some time if the files are big." => "İndirmeniz hazırlanıyor. Dosya büyük ise biraz zaman alabilir.", -"Name" => "İsim", -"Size" => "Boyut", -"Modified" => "Değiştirilme", +"{dirs} and {files}" => "{dirs} ve {files}", "%s could not be renamed" => "%s yeniden adlandırılamadı", "Upload (max. %s)" => "Yükle (azami: %s)", "File handling" => "Dosya işlemleri", @@ -71,13 +73,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 limitsiz demektir", "Maximum input size for ZIP files" => "ZIP dosyaları için en fazla girdi boyutu", "Save" => "Kaydet", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Dosyalarınıza WebDAV aracılığıyla erişmek için bu adresi kullanın", "New" => "Yeni", "New text file" => "Yeni metin dosyası", "Text file" => "Metin dosyası", "New folder" => "Yeni klasör", "Folder" => "Klasör", "From link" => "Bağlantıdan", -"Deleted files" => "Silinmiş dosyalar", "Cancel upload" => "Yüklemeyi iptal et", "You don’t have permission to upload or create files here" => "Buraya dosya yükleme veya oluşturma izniniz yok", "Nothing in here. Upload something!" => "Burada hiçbir şey yok. Bir şeyler yükleyin!", diff --git a/apps/files/l10n/ug.php b/apps/files/l10n/ug.php index 58ccba94c1338db34eac094d57291f9846673721..b104f60794763bede78f124e8aadd67ae0f131e4 100644 --- a/apps/files/l10n/ug.php +++ b/apps/files/l10n/ug.php @@ -13,20 +13,20 @@ $TRANSLATIONS = array( "Share" => "ھەمبەھىر", "Delete permanently" => "مەڭگۈلۈك ئۆچۈر", "Rename" => "ئات ئۆزگەرت", -"Error" => "خاتالىق", "Pending" => "كۈتۈۋاتىدۇ", -"_%n folder_::_%n folders_" => array(""), -"_%n file_::_%n files_" => array(""), -"_Uploading %n file_::_Uploading %n files_" => array(""), +"Error" => "خاتالىق", "Name" => "ئاتى", "Size" => "چوڭلۇقى", "Modified" => "ئۆزگەرتكەن", +"_%n folder_::_%n folders_" => array(""), +"_%n file_::_%n files_" => array(""), +"_Uploading %n file_::_Uploading %n files_" => array(""), "Save" => "ساقلا", +"WebDAV" => "WebDAV", "New" => "يېڭى", "Text file" => "تېكىست ھۆججەت", "New folder" => "يېڭى قىسقۇچ", "Folder" => "قىسقۇچ", -"Deleted files" => "ئۆچۈرۈلگەن ھۆججەتلەر", "Cancel upload" => "يۈكلەشتىن ۋاز كەچ", "Nothing in here. Upload something!" => "بۇ جايدا ھېچنېمە يوق. Upload something!", "Download" => "چۈشۈر", diff --git a/apps/files/l10n/uk.php b/apps/files/l10n/uk.php index 5643dedb9d4c64fe617b42671343dabb0cb020f8..efdbcc2c4b43d22db8b408a75475408d72df767e 100644 --- a/apps/files/l10n/uk.php +++ b/apps/files/l10n/uk.php @@ -26,19 +26,19 @@ $TRANSLATIONS = array( "Share" => "Поділитися", "Delete permanently" => "Видалити назавжди", "Rename" => "Перейменувати", +"Your download is being prepared. This might take some time if the files are big." => "Ваше завантаження готується. Це може зайняти деякий час, якщо файли завеликі.", +"Pending" => "Очікування", "Error moving file" => "Помилка переміщення файлу", "Error" => "Помилка", -"Pending" => "Очікування", "Could not rename file" => "Неможливо перейменувати файл", +"Name" => "Ім'я", +"Size" => "Розмір", +"Modified" => "Змінено", "_%n folder_::_%n folders_" => array("%n тека","%n тека","%n теки"), "_%n file_::_%n files_" => array("%n файл","%n файлів","%n файли"), "_Uploading %n file_::_Uploading %n files_" => array("","",""), "Your storage is full, files can not be updated or synced anymore!" => "Ваше сховище переповнене, файли більше не можуть бути оновлені або синхронізовані !", "Your storage is almost full ({usedSpacePercent}%)" => "Ваше сховище майже повне ({usedSpacePercent}%)", -"Your download is being prepared. This might take some time if the files are big." => "Ваше завантаження готується. Це може зайняти деякий час, якщо файли завеликі.", -"Name" => "Ім'я", -"Size" => "Розмір", -"Modified" => "Змінено", "%s could not be renamed" => "%s не може бути перейменований", "File handling" => "Робота з файлами", "Maximum upload size" => "Максимальний розмір відвантажень", @@ -48,12 +48,12 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 є безліміт", "Maximum input size for ZIP files" => "Максимальний розмір завантажуємого ZIP файлу", "Save" => "Зберегти", +"WebDAV" => "WebDAV", "New" => "Створити", "Text file" => "Текстовий файл", "New folder" => "Нова тека", "Folder" => "Тека", "From link" => "З посилання", -"Deleted files" => "Видалено файлів", "Cancel upload" => "Перервати завантаження", "Nothing in here. Upload something!" => "Тут нічого немає. Відвантажте що-небудь!", "Download" => "Завантажити", diff --git a/apps/files/l10n/ur_PK.php b/apps/files/l10n/ur_PK.php index b9548acde92c17a83f69260c7f9bf7f50dc1cba1..203f93b5e80933a2bd6eda103548acf5f5b89120 100644 --- a/apps/files/l10n/ur_PK.php +++ b/apps/files/l10n/ur_PK.php @@ -1,8 +1,12 @@ "تقسیم", "Error" => "ایرر", +"Name" => "اسم", "_%n folder_::_%n folders_" => array("",""), "_%n file_::_%n files_" => array("",""), -"_Uploading %n file_::_Uploading %n files_" => array("","") +"_Uploading %n file_::_Uploading %n files_" => array("",""), +"Save" => "حفظ", +"Delete" => "حذف کریں" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/vi.php b/apps/files/l10n/vi.php index 058add4bb73b13b1a5b83be1b60ce67785f1b0ab..c8b8a6960405bf196d6e37a9f548f6fc10b8bb1b 100644 --- a/apps/files/l10n/vi.php +++ b/apps/files/l10n/vi.php @@ -37,23 +37,23 @@ $TRANSLATIONS = array( "Share" => "Chia sẻ", "Delete permanently" => "Xóa vĩnh vễn", "Rename" => "Sửa tên", +"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.", +"Pending" => "Đang chờ", "Error moving file" => "Lỗi di chuyển tập tin", "Error" => "Lỗi", -"Pending" => "Đang chờ", "Could not rename file" => "Không thể đổi tên file", "Error deleting file." => "Lỗi xóa file,", +"Name" => "Tên", +"Size" => "Kích cỡ", +"Modified" => "Thay đổi", "_%n folder_::_%n folders_" => array("%n thư mục"), "_%n file_::_%n files_" => array("%n tập tin"), -"{dirs} and {files}" => "{dirs} và {files}", "_Uploading %n file_::_Uploading %n files_" => array("Đang tải lên %n tập tin"), "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 App is enabled but your keys are not initialized, please log-out and log-in again" => "Ứng dụng mã hóa đã được kích hoạt nhưng bạn chưa khởi tạo khóa. Vui lòng đăng xuất ra và đăng nhập lại", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Mã hóa đã bị vô hiệu nhưng những tập tin của bạn vẫn được mã hóa. Vui lòng vào phần thiết lập cá nhân để giải mã chúng.", -"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.", -"Name" => "Tên", -"Size" => "Kích cỡ", -"Modified" => "Thay đổi", +"{dirs} and {files}" => "{dirs} và {files}", "%s could not be renamed" => "%s không thể đổi tên", "File handling" => "Xử lý tập tin", "Maximum upload size" => "Kích thước tối đa ", @@ -63,13 +63,13 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 là không giới hạn", "Maximum input size for ZIP files" => "Kích thước tối đa cho các tập tin ZIP", "Save" => "Lưu", +"WebDAV" => "WebDAV", "New" => "Tạo mới", "New text file" => "File text mới", "Text file" => "Tập tin văn bản", "New folder" => "Tạo thư mục", "Folder" => "Thư mục", "From link" => "Từ liên kết", -"Deleted files" => "File đã bị xóa", "Cancel upload" => "Hủy upload", "You don’t have permission to upload or create files here" => "Bạn không có quyền upload hoặc tạo files ở đây", "Nothing in here. Upload something!" => "Không có gì ở đây .Hãy tải lên một cái gì đó !", diff --git a/apps/files/l10n/zh_CN.php b/apps/files/l10n/zh_CN.php index 82cc68a49955fe509aec277f8faffe811ea30385..39c7f86ece3e68af6d43b93d0008e21bdb4de4b0 100644 --- a/apps/files/l10n/zh_CN.php +++ b/apps/files/l10n/zh_CN.php @@ -3,7 +3,9 @@ $TRANSLATIONS = array( "Could not move %s - File with this name already exists" => "无法移动 %s - 同名文件已存在", "Could not move %s" => "无法移动 %s", "File name cannot be empty." => "文件名不能为空。", +"\"%s\" is an invalid file name." => "“%s” 是一个无效的文件名。", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "无效名称,'\\', '/', '<', '>', ':', '\"', '|', '?' 和 '*' 不被允许使用。", +"The target folder has been moved or deleted." => "目标文件夹已经被移动或删除。", "The name %s is already used in the folder %s. Please choose a different name." => "文件名 %s 是已经在 %s 中存在的名称。请使用其他名称。", "Not a valid source" => "不是一个可用的源", "Server is not allowed to open URLs, please check the server configuration" => "服务器没有允许打开URL网址,请检查服务器配置", @@ -27,6 +29,8 @@ $TRANSLATIONS = array( "Invalid directory." => "无效文件夹。", "Files" => "文件", "Unable to upload {filename} as it is a directory or has 0 bytes" => "不能上传文件 {filename} ,由于它是一个目录或者为0字节", +"Total file size {size1} exceeds upload limit {size2}" => "总文件大小 {size1} 超过上传限制 {size2}", +"Not enough free space, you are uploading {size1} but only {size2} is left" => "没有足够的可用空间,您正在上传 {size1} 的文件但是只有 {size2} 可用。", "Upload cancelled." => "上传已取消", "Could not get result from server." => "不能从服务器得到结果", "File upload is in progress. Leaving the page now will cancel the upload." => "文件正在上传中。现在离开此页会导致上传动作被取消。", @@ -38,25 +42,28 @@ $TRANSLATIONS = array( "Share" => "分享", "Delete permanently" => "永久删除", "Rename" => "重命名", +"Your download is being prepared. This might take some time if the files are big." => "下载正在准备中。如果文件较大可能会花费一些时间。", +"Pending" => "等待", +"Error moving file." => "移动文件出错。", "Error moving file" => "移动文件错误", "Error" => "错误", -"Pending" => "等待", "Could not rename file" => "不能重命名文件", "Error deleting file." => "删除文件出错。", +"Name" => "名称", +"Size" => "大小", +"Modified" => "修改日期", "_%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 个文件"), +"\"{name}\" is an invalid file name." => "“{name}”是一个无效的文件名。", "Your storage is full, files can not be updated or synced anymore!" => "您的存储空间已满,文件将无法更新或同步!", "Your storage is almost full ({usedSpacePercent}%)" => "您的存储空间即将用完 ({usedSpacePercent}%)", "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "加密应用被启用了,但是你的加密密钥没有初始化,请重新登出登录系统一次。", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted 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." => "下载正在准备中。如果文件较大可能会花费一些时间。", -"Name" => "名称", -"Size" => "大小", -"Modified" => "修改日期", +"{dirs} and {files}" => "{dirs} 和 {files}", "%s could not be renamed" => "%s 不能被重命名", +"Upload (max. %s)" => "上传 (最大 %s)", "File handling" => "文件处理", "Maximum upload size" => "最大上传大小", "max. possible: " => "最大允许: ", @@ -65,13 +72,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 为无限制", "Maximum input size for ZIP files" => "ZIP 文件的最大输入大小", "Save" => "保存", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "使用这个地址 通过 WebDAV 访问您的文件", "New" => "新建", "New text file" => "创建文本文件", "Text file" => "文本文件", "New folder" => "添加文件夹", "Folder" => "文件夹", "From link" => "来自链接", -"Deleted files" => "已删除文件", "Cancel upload" => "取消上传", "You don’t have permission to upload or create files here" => "您没有权限来上传湖州哦和创建文件", "Nothing in here. Upload something!" => "这里还什么都没有。上传些东西吧!", diff --git a/apps/files/l10n/zh_HK.php b/apps/files/l10n/zh_HK.php index 13aa6ac3e35cdeebfc9a17f7ea95409d19a25b9b..62a37f4040513b1f2d5834f0bdade6272c2cd035 100644 --- a/apps/files/l10n/zh_HK.php +++ b/apps/files/l10n/zh_HK.php @@ -3,11 +3,11 @@ $TRANSLATIONS = array( "Files" => "文件", "Share" => "分享", "Error" => "錯誤", +"Name" => "名稱", +"Size" => "大小", "_%n folder_::_%n folders_" => array(""), "_%n file_::_%n files_" => array(""), "_Uploading %n file_::_Uploading %n files_" => array(""), -"Name" => "名稱", -"Size" => "大小", "Save" => "儲存", "New folder" => "新文件夾", "Download" => "下載", diff --git a/apps/files/l10n/zh_TW.php b/apps/files/l10n/zh_TW.php index 92bc13189df16e3acb1d40e286d103f1d2f12c79..9e56c853ad7aaa9590500cdb2330e51d36bfda44 100644 --- a/apps/files/l10n/zh_TW.php +++ b/apps/files/l10n/zh_TW.php @@ -36,23 +36,23 @@ $TRANSLATIONS = array( "Share" => "分享", "Delete permanently" => "永久刪除", "Rename" => "重新命名", +"Your download is being prepared. This might take some time if the files are big." => "正在準備您的下載,若您的檔案較大,將會需要更多時間。", +"Pending" => "等候中", "Error moving file" => "移動檔案失敗", "Error" => "錯誤", -"Pending" => "等候中", "Could not rename file" => "無法重新命名", +"Name" => "名稱", +"Size" => "大小", +"Modified" => "修改時間", "_%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 個檔案正在上傳"), "Your storage is full, files can not be updated or synced anymore!" => "您的儲存空間已滿,沒有辦法再更新或是同步檔案!", "Your storage is almost full ({usedSpacePercent}%)" => "您的儲存空間快要滿了 ({usedSpacePercent}%)", "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "檔案加密已啓用,但是您的金鑰尚未初始化,請重新登入一次", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted 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." => "正在準備您的下載,若您的檔案較大,將會需要更多時間。", -"Name" => "名稱", -"Size" => "大小", -"Modified" => "修改時間", +"{dirs} and {files}" => "{dirs} 和 {files}", "%s could not be renamed" => "無法重新命名 %s", "File handling" => "檔案處理", "Maximum upload size" => "上傳限制", @@ -62,12 +62,13 @@ $TRANSLATIONS = array( "0 is unlimited" => "0代表沒有限制", "Maximum input size for ZIP files" => "ZIP 壓縮前的原始大小限制", "Save" => "儲存", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "使用這個地址來透過 WebDAV 存取檔案", "New" => "新增", "Text file" => "文字檔", "New folder" => "新資料夾", "Folder" => "資料夾", "From link" => "從連結", -"Deleted files" => "回收桶", "Cancel upload" => "取消上傳", "You don’t have permission to upload or create files here" => "您沒有權限在這裡上傳或建立檔案", "Nothing in here. Upload something!" => "這裡還沒有東西,上傳一些吧!", diff --git a/apps/files/lib/app.php b/apps/files/lib/app.php index ed4aa32c66246bb0058f1a76d94b6c7c392d6c4a..e32225d06805451ae98c85f8d2873182e5942a71 100644 --- a/apps/files/lib/app.php +++ b/apps/files/lib/app.php @@ -30,6 +30,11 @@ class App { */ private $l10n; + /** + * @var \OCP\INavigationManager + */ + private static $navigationManager; + /** * @var \OC\Files\View */ @@ -40,6 +45,18 @@ class App { $this->l10n = $l10n; } + /** + * Returns the app's navigation manager + * + * @return \OCP\INavigationManager + */ + public static function getNavigationManager() { + if (self::$navigationManager === null) { + self::$navigationManager = new \OC\NavigationManager(); + } + return self::$navigationManager; + } + /** * rename a file * diff --git a/apps/files/lib/helper.php b/apps/files/lib/helper.php index 0ae87d12fbfb3974a90b47bd388dcc30ef096a5c..7d8906e22514b9f9383685519839a7a7682c2250 100644 --- a/apps/files/lib/helper.php +++ b/apps/files/lib/helper.php @@ -1,7 +1,16 @@ + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ namespace OCA\Files; +/** + * Helper class for manipulating file information + */ class Helper { public static function buildFileStorageStatistics($dir) { @@ -9,12 +18,12 @@ class Helper $storageInfo = \OC_Helper::getStorageInfo($dir); $l = new \OC_L10N('files'); - $maxUploadFilesize = \OCP\Util::maxUploadFilesize($dir, $storageInfo['free']); - $maxHumanFilesize = \OCP\Util::humanFileSize($maxUploadFilesize); - $maxHumanFilesize = $l->t('Upload (max. %s)', array($maxHumanFilesize)); + $maxUploadFileSize = \OCP\Util::maxUploadFilesize($dir, $storageInfo['free']); + $maxHumanFileSize = \OCP\Util::humanFileSize($maxUploadFileSize); + $maxHumanFileSize = $l->t('Upload (max. %s)', array($maxHumanFileSize)); - return array('uploadMaxFilesize' => $maxUploadFilesize, - 'maxHumanFilesize' => $maxHumanFilesize, + return array('uploadMaxFilesize' => $maxUploadFileSize, + 'maxHumanFilesize' => $maxHumanFileSize, 'freeSpace' => $storageInfo['free'], 'usedSpacePercent' => (int)$storageInfo['relative']); } @@ -27,20 +36,11 @@ class Helper */ public static function determineIcon($file) { if($file['type'] === 'dir') { - $dir = $file['directory']; $icon = \OC_Helper::mimetypeIcon('dir'); - $absPath = $file->getPath(); - $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') { - $icon = \OC_Helper::mimetypeIcon('dir-shared'); - } elseif ($sid[0] !== 'local' and $sid[0] !== 'home') { - $icon = \OC_Helper::mimetypeIcon('dir-external'); - } - } + if ($file->isShared()) { + $icon = \OC_Helper::mimetypeIcon('dir-shared'); + } elseif ($file->isMounted()) { + $icon = \OC_Helper::mimetypeIcon('dir-external'); } }else{ $icon = \OC_Helper::mimetypeIcon($file->getMimetype()); @@ -57,7 +57,7 @@ class Helper * @param \OCP\Files\FileInfo $b file * @return int -1 if $a must come before $b, 1 otherwise */ - public static function fileCmp($a, $b) { + public static function compareFileNames($a, $b) { $aType = $a->getType(); $bType = $b->getType(); if ($aType === 'dir' and $bType !== 'dir') { @@ -69,6 +69,32 @@ class Helper } } + /** + * Comparator function to sort files by date + * + * @param \OCP\Files\FileInfo $a file + * @param \OCP\Files\FileInfo $b file + * @return int -1 if $a must come before $b, 1 otherwise + */ + public static function compareTimestamp($a, $b) { + $aTime = $a->getMTime(); + $bTime = $b->getMTime(); + return $aTime - $bTime; + } + + /** + * Comparator function to sort files by size + * + * @param \OCP\Files\FileInfo $a file + * @param \OCP\Files\FileInfo $b file + * @return int -1 if $a must come before $b, 1 otherwise + */ + public static function compareSize($a, $b) { + $aSize = $a->getSize(); + $bSize = $b->getSize(); + return $aSize - $bSize; + } + /** * Formats the file info to be returned as JSON to the client. * @@ -120,12 +146,35 @@ class Helper * returns it as a sorted array of FileInfo. * * @param string $dir path to the directory + * @param string $sortAttribute attribute to sort on + * @param bool $sortDescending true for descending sort, false otherwise * @return \OCP\Files\FileInfo[] files */ - public static function getFiles($dir) { + public static function getFiles($dir, $sortAttribute = 'name', $sortDescending = false) { $content = \OC\Files\Filesystem::getDirectoryContent($dir); - usort($content, array('\OCA\Files\Helper', 'fileCmp')); - return $content; + return self::sortFiles($content, $sortAttribute, $sortDescending); + } + + /** + * Sort the given file info array + * + * @param \OCP\Files\FileInfo[] $files files to sort + * @param string $sortAttribute attribute to sort on + * @param bool $sortDescending true for descending sort, false otherwise + * @return \OCP\Files\FileInfo[] sorted files + */ + public static function sortFiles($files, $sortAttribute = 'name', $sortDescending = false) { + $sortFunc = 'compareFileNames'; + if ($sortAttribute === 'mtime') { + $sortFunc = 'compareTimestamp'; + } else if ($sortAttribute === 'size') { + $sortFunc = 'compareSize'; + } + usort($files, array('\OCA\Files\Helper', $sortFunc)); + if ($sortDescending) { + $files = array_reverse($files); + } + return $files; } } diff --git a/apps/files/list.php b/apps/files/list.php new file mode 100644 index 0000000000000000000000000000000000000000..e583839b2519449f3e1e366ec1b98fd18da8cec7 --- /dev/null +++ b/apps/files/list.php @@ -0,0 +1,38 @@ + + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library 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 AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this library. If not, see . + * + */ + +// Check if we are a user +OCP\User::checkLoggedIn(); + +$config = \OC::$server->getConfig(); +// TODO: move this to the generated config.js +$publicUploadEnabled = $config->getAppValue('core', 'shareapi_allow_public_upload', 'yes'); +$uploadLimit=OCP\Util::uploadLimit(); + +// renders the controls and table headers template +$tmpl = new OCP\Template('files', 'list', ''); +$tmpl->assign('uploadLimit', $uploadLimit); // PHP upload limit +$tmpl->assign('publicUploadEnabled', $publicUploadEnabled); +$tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true))); +$tmpl->printPage(); + diff --git a/apps/files/templates/appnavigation.php b/apps/files/templates/appnavigation.php new file mode 100644 index 0000000000000000000000000000000000000000..86436bbe8c4733398c0bf809a610a04a941286fe --- /dev/null +++ b/apps/files/templates/appnavigation.php @@ -0,0 +1,17 @@ +
+
    + + + +
+
+
+ +
+
+

t('WebDAV'));?>

+
+ t('Use this address to access your Files via WebDAV', array(link_to_docs('user-webdav'))));?> +
+
+
diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index a8437835d959bf8ca662de8492684a6b26fc82d5..8cab4ce220b864523a5b898fb98383574aa7b306 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -1,115 +1,15 @@ -
- -
- - -
- - - - - - - - - - - - - - - -
-
-
-

- t('The files you are trying to upload exceed the maximum size for file uploads on this server.'));?> -

-
-
-

- t('Files are being scanned, please wait.'));?> -

-

- t('Current scanning'));?> -

-
+ +printPage(); ?> +
+ + + +
- diff --git a/apps/files/templates/list.php b/apps/files/templates/list.php new file mode 100644 index 0000000000000000000000000000000000000000..8f11f965b2d960f30f17dc1e1a34d29e54e79cf9 --- /dev/null +++ b/apps/files/templates/list.php @@ -0,0 +1,107 @@ +
+ +
+ + +
+ + + + + + + + + + + + + + + +
+ + +
+
+

+ t('The files you are trying to upload exceed the maximum size for file uploads on this server.'));?> +

+
+
+

+ t('Files are being scanned, please wait.'));?> +

+

+ t('Current scanning'));?> +

+
diff --git a/apps/files/tests/ajax_rename.php b/apps/files/tests/ajax_rename.php index 74ca1e4495da1409742df4fb142ba2eacc54ad5b..9928053e5015ac0861f604e5a84cd76b1c771e97 100644 --- a/apps/files/tests/ajax_rename.php +++ b/apps/files/tests/ajax_rename.php @@ -24,6 +24,16 @@ class Test_OC_Files_App_Rename extends \PHPUnit_Framework_TestCase { private static $user; + /** + * @var PHPUnit_Framework_MockObject_MockObject + */ + private $viewMock; + + /** + * @var \OCA\Files\App + */ + private $files; + function setUp() { // mock OC_L10n if (!self::$user) { @@ -56,7 +66,7 @@ class Test_OC_Files_App_Rename extends \PHPUnit_Framework_TestCase { } /** - * @brief test rename of file/folder + * test rename of file/folder */ function testRenameFolder() { $dir = '/'; @@ -72,7 +82,7 @@ class Test_OC_Files_App_Rename extends \PHPUnit_Framework_TestCase { ->method('getFileInfo') ->will($this->returnValue(new \OC\Files\FileInfo( '/', - null, + new \OC\Files\Storage\Local(array('datadir' => '/')), '/', array( 'fileid' => 123, diff --git a/apps/files/tests/helper.php b/apps/files/tests/helper.php new file mode 100644 index 0000000000000000000000000000000000000000..9b3603cd5633197d272898ac71d0744ddeb2ffcb --- /dev/null +++ b/apps/files/tests/helper.php @@ -0,0 +1,98 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +require_once __DIR__ . '/../lib/helper.php'; + +use OCA\Files; + +/** + * Class Test_Files_Helper + */ +class Test_Files_Helper extends \PHPUnit_Framework_TestCase { + + private function makeFileInfo($name, $size, $mtime, $isDir = false) { + return new \OC\Files\FileInfo( + '/', + null, + '/', + array( + 'name' => $name, + 'size' => $size, + 'mtime' => $mtime, + 'type' => $isDir ? 'dir' : 'file', + 'mimetype' => $isDir ? 'httpd/unix-directory' : 'application/octet-stream' + ) + ); + } + + /** + * Returns a file list for testing + */ + private function getTestFileList() { + return array( + self::makeFileInfo('a.txt', 4, 1000), + self::makeFileInfo('q.txt', 5, 150), + self::makeFileInfo('subdir2', 87, 128, true), + self::makeFileInfo('b.txt', 166, 800), + self::makeFileInfo('o.txt', 12, 100), + self::makeFileInfo('subdir', 88, 125, true), + ); + } + + function sortDataProvider() { + return array( + array( + 'name', + false, + array('subdir', 'subdir2', 'a.txt', 'b.txt', 'o.txt', 'q.txt'), + ), + array( + 'name', + true, + array('q.txt', 'o.txt', 'b.txt', 'a.txt', 'subdir2', 'subdir'), + ), + array( + 'size', + false, + array('a.txt', 'q.txt', 'o.txt', 'subdir2', 'subdir', 'b.txt'), + ), + array( + 'size', + true, + array('b.txt', 'subdir', 'subdir2', 'o.txt', 'q.txt', 'a.txt'), + ), + array( + 'mtime', + false, + array('o.txt', 'subdir', 'subdir2', 'q.txt', 'b.txt', 'a.txt'), + ), + array( + 'mtime', + true, + array('a.txt', 'b.txt', 'q.txt', 'subdir2', 'subdir', 'o.txt'), + ), + ); + } + + /** + * @dataProvider sortDataProvider + */ + public function testSortByName($sort, $sortDescending, $expectedOrder) { + $files = self::getTestFileList(); + $files = \OCA\Files\Helper::sortFiles($files, $sort, $sortDescending); + $fileNames = array(); + foreach ($files as $fileInfo) { + $fileNames[] = $fileInfo->getName(); + } + $this->assertEquals( + $expectedOrder, + $fileNames + ); + } + +} diff --git a/apps/files/tests/js/appSpec.js b/apps/files/tests/js/appSpec.js new file mode 100644 index 0000000000000000000000000000000000000000..0e9abad6989c9c84b04e82a532aaeee309bcd103 --- /dev/null +++ b/apps/files/tests/js/appSpec.js @@ -0,0 +1,220 @@ +/** +* ownCloud +* +* @author Vincent Petry +* @copyright 2014 Vincent Petry +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library 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 AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Affero General Public +* License along with this library. If not, see . +* +*/ + +describe('OCA.Files.App tests', function() { + var App = OCA.Files.App; + var pushStateStub; + var parseUrlQueryStub; + + beforeEach(function() { + $('#testArea').append( + '
' + + '
' + + '
' + + '
' + + '' + + '' + + '
' + + '
' + + '' + ); + + pushStateStub = sinon.stub(OC.Util.History, 'pushState'); + parseUrlQueryStub = sinon.stub(OC.Util.History, 'parseUrlQuery'); + parseUrlQueryStub.returns({}); + + App.initialize(); + }); + afterEach(function() { + App.navigation = null; + App.fileList = null; + App.files = null; + App.fileActions.clear(); + App.fileActions = null; + + pushStateStub.restore(); + parseUrlQueryStub.restore(); + }); + + describe('initialization', function() { + it('initializes the default file list with the default file actions', function() { + expect(App.fileList).toBeDefined(); + expect(App.fileList.fileActions.actions.all).toBeDefined(); + expect(App.fileList.$el.is('#app-content-files')).toEqual(true); + }); + }); + + describe('URL handling', function() { + it('pushes the state to the URL when current app changed directory', function() { + $('#app-content-files').trigger(new $.Event('changeDirectory', {dir: 'subdir'})); + expect(pushStateStub.calledOnce).toEqual(true); + expect(pushStateStub.getCall(0).args[0].dir).toEqual('subdir'); + expect(pushStateStub.getCall(0).args[0].view).not.toBeDefined(); + + $('li[data-id=other]>a').click(); + pushStateStub.reset(); + + $('#app-content-other').trigger(new $.Event('changeDirectory', {dir: 'subdir'})); + expect(pushStateStub.calledOnce).toEqual(true); + expect(pushStateStub.getCall(0).args[0].dir).toEqual('subdir'); + expect(pushStateStub.getCall(0).args[0].view).toEqual('other'); + }); + describe('onpopstate', function() { + it('sends "urlChanged" event to current app', function() { + var handler = sinon.stub(); + $('#app-content-files').on('urlChanged', handler); + App._onPopState({view: 'files', dir: '/somedir'}); + expect(handler.calledOnce).toEqual(true); + expect(handler.getCall(0).args[0].view).toEqual('files'); + expect(handler.getCall(0).args[0].dir).toEqual('/somedir'); + }); + it('sends "show" event to current app and sets navigation', function() { + var showHandlerFiles = sinon.stub(); + var showHandlerOther = sinon.stub(); + var hideHandlerFiles = sinon.stub(); + var hideHandlerOther = sinon.stub(); + $('#app-content-files').on('show', showHandlerFiles); + $('#app-content-files').on('hide', hideHandlerFiles); + $('#app-content-other').on('show', showHandlerOther); + $('#app-content-other').on('hide', hideHandlerOther); + App._onPopState({view: 'other', dir: '/somedir'}); + expect(showHandlerFiles.notCalled).toEqual(true); + expect(hideHandlerFiles.calledOnce).toEqual(true); + expect(showHandlerOther.calledOnce).toEqual(true); + expect(hideHandlerOther.notCalled).toEqual(true); + + showHandlerFiles.reset(); + showHandlerOther.reset(); + hideHandlerFiles.reset(); + hideHandlerOther.reset(); + + App._onPopState({view: 'files', dir: '/somedir'}); + expect(showHandlerFiles.calledOnce).toEqual(true); + expect(hideHandlerFiles.notCalled).toEqual(true); + expect(showHandlerOther.notCalled).toEqual(true); + expect(hideHandlerOther.calledOnce).toEqual(true); + + expect(App.navigation.getActiveItem()).toEqual('files'); + expect($('#app-content-files').hasClass('hidden')).toEqual(false); + expect($('#app-content-other').hasClass('hidden')).toEqual(true); + }); + it('does not send "show" or "hide" event to current app when already visible', function() { + var showHandler = sinon.stub(); + var hideHandler = sinon.stub(); + $('#app-content-files').on('show', showHandler); + $('#app-content-files').on('hide', hideHandler); + App._onPopState({view: 'files', dir: '/somedir'}); + expect(showHandler.notCalled).toEqual(true); + expect(hideHandler.notCalled).toEqual(true); + }); + it('state defaults to files app with root dir', function() { + var handler = sinon.stub(); + parseUrlQueryStub.returns({}); + $('#app-content-files').on('urlChanged', handler); + App._onPopState(); + expect(handler.calledOnce).toEqual(true); + expect(handler.getCall(0).args[0].view).toEqual('files'); + expect(handler.getCall(0).args[0].dir).toEqual('/'); + }); + it('activates files app if invalid view is passed', function() { + App._onPopState({view: 'invalid', dir: '/somedir'}); + + expect(App.navigation.getActiveItem()).toEqual('files'); + expect($('#app-content-files').hasClass('hidden')).toEqual(false); + }); + }); + describe('navigation', function() { + it('switches the navigation item and panel visibility when onpopstate', function() { + App._onPopState({view: 'other', dir: '/somedir'}); + expect(App.navigation.getActiveItem()).toEqual('other'); + expect($('#app-content-files').hasClass('hidden')).toEqual(true); + expect($('#app-content-other').hasClass('hidden')).toEqual(false); + expect($('li[data-id=files]').hasClass('selected')).toEqual(false); + expect($('li[data-id=other]').hasClass('selected')).toEqual(true); + + App._onPopState({view: 'files', dir: '/somedir'}); + + expect(App.navigation.getActiveItem()).toEqual('files'); + expect($('#app-content-files').hasClass('hidden')).toEqual(false); + expect($('#app-content-other').hasClass('hidden')).toEqual(true); + expect($('li[data-id=files]').hasClass('selected')).toEqual(true); + expect($('li[data-id=other]').hasClass('selected')).toEqual(false); + }); + it('clicking on navigation switches the panel visibility', function() { + $('li[data-id=other]>a').click(); + expect(App.navigation.getActiveItem()).toEqual('other'); + expect($('#app-content-files').hasClass('hidden')).toEqual(true); + expect($('#app-content-other').hasClass('hidden')).toEqual(false); + expect($('li[data-id=files]').hasClass('selected')).toEqual(false); + expect($('li[data-id=other]').hasClass('selected')).toEqual(true); + + $('li[data-id=files]>a').click(); + expect(App.navigation.getActiveItem()).toEqual('files'); + expect($('#app-content-files').hasClass('hidden')).toEqual(false); + expect($('#app-content-other').hasClass('hidden')).toEqual(true); + expect($('li[data-id=files]').hasClass('selected')).toEqual(true); + expect($('li[data-id=other]').hasClass('selected')).toEqual(false); + }); + it('clicking on navigation sends "show" and "urlChanged" event', function() { + var handler = sinon.stub(); + var showHandler = sinon.stub(); + $('#app-content-other').on('urlChanged', handler); + $('#app-content-other').on('show', showHandler); + $('li[data-id=other]>a').click(); + expect(handler.calledOnce).toEqual(true); + expect(handler.getCall(0).args[0].view).toEqual('other'); + expect(handler.getCall(0).args[0].dir).toEqual('/'); + expect(showHandler.calledOnce).toEqual(true); + }); + it('clicking on activate navigation only sends "urlChanged" event', function() { + var handler = sinon.stub(); + var showHandler = sinon.stub(); + $('#app-content-files').on('urlChanged', handler); + $('#app-content-files').on('show', showHandler); + $('li[data-id=files]>a').click(); + expect(handler.calledOnce).toEqual(true); + expect(handler.getCall(0).args[0].view).toEqual('files'); + expect(handler.getCall(0).args[0].dir).toEqual('/'); + expect(showHandler.notCalled).toEqual(true); + }); + }); + describe('viewer mode', function() { + it('toggles the sidebar when viewer mode is enabled', function() { + $('#app-content-files').trigger( + new $.Event('changeViewerMode', {viewerModeEnabled: true} + )); + expect($('#app-navigation').hasClass('hidden')).toEqual(true); + expect($('.app-files').hasClass('viewer-mode no-sidebar')).toEqual(true); + + $('#app-content-files').trigger( + new $.Event('changeViewerMode', {viewerModeEnabled: false} + )); + + expect($('#app-navigation').hasClass('hidden')).toEqual(false); + expect($('.app-files').hasClass('viewer-mode no-sidebar')).toEqual(false); + }); + }); + }); +}); diff --git a/apps/files/tests/js/breadcrumbSpec.js b/apps/files/tests/js/breadcrumbSpec.js index 1bfe5308a278c0dcabfcff3a9661ec14c01b47fc..e3d9c757a7c0a1e01031b2ed6b28f56aefd448b4 100644 --- a/apps/files/tests/js/breadcrumbSpec.js +++ b/apps/files/tests/js/breadcrumbSpec.js @@ -20,7 +20,9 @@ */ /* global BreadCrumb */ -describe('BreadCrumb tests', function() { +describe('OCA.Files.BreadCrumb tests', function() { + var BreadCrumb = OCA.Files.BreadCrumb; + describe('Rendering', function() { var bc; beforeEach(function() { diff --git a/apps/files/tests/js/fileactionsSpec.js b/apps/files/tests/js/fileactionsSpec.js index 3c22c84b866d979397eaaac831a402dbd72149be..9152dbb58c30a6961f3265698f95d7d70b53827e 100644 --- a/apps/files/tests/js/fileactionsSpec.js +++ b/apps/files/tests/js/fileactionsSpec.js @@ -19,34 +19,45 @@ * */ -/* global OC, FileActions, FileList */ -describe('FileActions tests', function() { - var $filesTable; +describe('OCA.Files.FileActions tests', function() { + var $filesTable, fileList; + var FileActions = OCA.Files.FileActions; beforeEach(function() { // init horrible parameters - var $body = $('body'); + var $body = $('#testArea'); $body.append(''); $body.append(''); // dummy files table $filesTable = $body.append('
'); + fileList = new OCA.Files.FileList($('#testArea')); + FileActions.registerDefaultActions(fileList); }); afterEach(function() { + FileActions.clear(); + fileList = undefined; $('#dir, #permissions, #filestable').remove(); }); + it('calling clear() clears file actions', function() { + FileActions.clear(); + expect(FileActions.actions).toEqual({}); + expect(FileActions.defaults).toEqual({}); + expect(FileActions.icons).toEqual({}); + expect(FileActions.currentFile).toBe(null); + }); it('calling display() sets file actions', function() { var fileData = { id: 18, type: 'file', name: 'testName.txt', - mimetype: 'plain/text', + mimetype: 'text/plain', size: '1234', etag: 'a01234c', mtime: '123456' }; // note: FileActions.display() is called implicitly - var $tr = FileList.add(fileData); + var $tr = fileList.add(fileData); // actions defined after call expect($tr.find('.action.action-download').length).toEqual(1); @@ -60,12 +71,12 @@ describe('FileActions tests', function() { id: 18, type: 'file', name: 'testName.txt', - mimetype: 'plain/text', + mimetype: 'text/plain', size: '1234', etag: 'a01234c', mtime: '123456' }; - var $tr = FileList.add(fileData); + var $tr = fileList.add(fileData); FileActions.display($tr.find('td.filename'), true); FileActions.display($tr.find('td.filename'), true); @@ -81,12 +92,12 @@ describe('FileActions tests', function() { id: 18, type: 'file', name: 'testName.txt', - mimetype: 'plain/text', + mimetype: 'text/plain', size: '1234', etag: 'a01234c', mtime: '123456' }; - var $tr = FileList.add(fileData); + var $tr = fileList.add(fileData); FileActions.display($tr.find('td.filename'), true); $tr.find('.action-download').click(); @@ -96,17 +107,17 @@ describe('FileActions tests', function() { redirectStub.restore(); }); it('deletes file when clicking delete', function() { - var deleteStub = sinon.stub(FileList, 'do_delete'); + var deleteStub = sinon.stub(fileList, 'do_delete'); var fileData = { id: 18, type: 'file', name: 'testName.txt', - mimetype: 'plain/text', + mimetype: 'text/plain', size: '1234', etag: 'a01234c', mtime: '123456' }; - var $tr = FileList.add(fileData); + var $tr = fileList.add(fileData); FileActions.display($tr.find('td.filename'), true); $tr.find('.action.delete').click(); diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js index ca85a360cf508a0e684b17e123b76fa7da7039de..bfc983c7483bd7140146deb566f42b328b6f93ee 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -19,27 +19,45 @@ * */ -/* global OC, FileList */ -describe('FileList tests', function() { - var testFiles, alertStub, notificationStub, - pushStateStub; +describe('OCA.Files.FileList tests', function() { + var testFiles, alertStub, notificationStub, fileList; + var FileActions = OCA.Files.FileActions; - beforeEach(function() { - // init horrible parameters - var $body = $('body'); - $body.append(''); - $body.append(''); - // dummy files table - $body.append('
'); - - // prevents URL changes during tests - pushStateStub = sinon.stub(window.history, 'pushState'); + /** + * Generate test file data + */ + function generateFiles(startIndex, endIndex) { + var files = []; + var name; + for (var i = startIndex; i <= endIndex; i++) { + name = 'File with index '; + if (i < 10) { + // do not rely on localeCompare here + // and make the sorting predictable + // cross-browser + name += '0'; + } + name += i + '.txt'; + files.push({ + id: i, + type: 'file', + name: name, + mimetype: 'text/plain', + size: i * 2, + etag: 'abc' + }); + } + return files; + } + beforeEach(function() { alertStub = sinon.stub(OC.dialogs, 'alert'); notificationStub = sinon.stub(OC.Notification, 'show'); // init parameters and test table elements $('#testArea').append( + '
' + + // init horrible parameters '' + '' + // dummy controls @@ -48,11 +66,24 @@ describe('FileList tests', function() { '
' + '
' + // dummy table + // TODO: at some point this will be rendered by the fileList class itself! '' + - '' + - '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + '
' + - '
Empty content message
' + '
Empty content message
' + + '' ); testFiles = [{ @@ -60,48 +91,52 @@ describe('FileList tests', function() { type: 'file', name: 'One.txt', mimetype: 'text/plain', - size: 12 + size: 12, + etag: 'abc' }, { id: 2, type: 'file', name: 'Two.jpg', mimetype: 'image/jpeg', - size: 12049 + size: 12049, + etag: 'def', }, { id: 3, type: 'file', name: 'Three.pdf', mimetype: 'application/pdf', - size: 58009 + size: 58009, + etag: '123', }, { id: 4, type: 'dir', name: 'somedir', mimetype: 'httpd/unix-directory', - size: 250 + size: 250, + etag: '456' }]; - FileList.initialize(); + fileList = new OCA.Files.FileList($('#app-content-files')); + FileActions.clear(); + FileActions.registerDefaultActions(fileList); + fileList.setFileActions(FileActions); }); afterEach(function() { testFiles = undefined; - FileList.initialized = false; - FileList.isEmpty = true; - delete FileList._reloadCall; + fileList = undefined; - $('#dir, #permissions, #filestable').remove(); + FileActions.clear(); notificationStub.restore(); alertStub.restore(); - pushStateStub.restore(); }); describe('Getters', function() { it('Returns the current directory', function() { $('#dir').val('/one/two/three'); - expect(FileList.getCurrentDirectory()).toEqual('/one/two/three'); + expect(fileList.getCurrentDirectory()).toEqual('/one/two/three'); }); it('Returns the directory permissions as int', function() { $('#permissions').val('23'); - expect(FileList.getDirectoryPermissions()).toEqual(23); + expect(fileList.getDirectoryPermissions()).toEqual(23); }); }); describe('Adding files', function() { @@ -119,12 +154,12 @@ describe('FileList tests', function() { id: 18, type: 'file', name: 'testName.txt', - mimetype: 'plain/text', + mimetype: 'text/plain', size: '1234', etag: 'a01234c', mtime: '123456' }; - var $tr = FileList.add(fileData); + var $tr = fileList.add(fileData); expect($tr).toBeDefined(); expect($tr[0].tagName.toLowerCase()).toEqual('tr'); @@ -134,12 +169,14 @@ describe('FileList tests', function() { expect($tr.attr('data-size')).toEqual('1234'); expect($tr.attr('data-etag')).toEqual('a01234c'); expect($tr.attr('data-permissions')).toEqual('31'); - expect($tr.attr('data-mime')).toEqual('plain/text'); + expect($tr.attr('data-mime')).toEqual('text/plain'); expect($tr.attr('data-mtime')).toEqual('123456'); - expect($tr.find('a.name').attr('href')).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=testName.txt'); + expect($tr.find('a.name').attr('href')) + .toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=testName.txt'); + expect($tr.find('.nametext').text().trim()).toEqual('testName.txt'); expect($tr.find('.filesize').text()).toEqual('1 kB'); - expect(FileList.findFileEl('testName.txt')[0]).toEqual($tr[0]); + expect(fileList.findFileEl('testName.txt')[0]).toEqual($tr[0]); }); it('generates dir element with correct attributes when calling add() with dir data', function() { var fileData = { @@ -151,7 +188,7 @@ describe('FileList tests', function() { etag: 'a01234c', mtime: '123456' }; - var $tr = FileList.add(fileData); + var $tr = fileList.add(fileData); expect($tr).toBeDefined(); expect($tr[0].tagName.toLowerCase()).toEqual('tr'); @@ -166,7 +203,7 @@ describe('FileList tests', function() { expect($tr.find('.filesize').text()).toEqual('1 kB'); - expect(FileList.findFileEl('testFolder')[0]).toEqual($tr[0]); + expect(fileList.findFileEl('testFolder')[0]).toEqual($tr[0]); }); it('generates file element with default attributes when calling add() with minimal data', function() { var fileData = { @@ -174,8 +211,8 @@ describe('FileList tests', function() { name: 'testFile.txt' }; - clock.tick(123456); - var $tr = FileList.add(fileData); + clock.tick(123456); + var $tr = fileList.add(fileData); expect($tr).toBeDefined(); expect($tr[0].tagName.toLowerCase()).toEqual('tr'); @@ -195,8 +232,8 @@ describe('FileList tests', function() { type: 'dir', name: 'testFolder' }; - clock.tick(123456); - var $tr = FileList.add(fileData); + clock.tick(123456); + var $tr = fileList.add(fileData); expect($tr).toBeDefined(); expect($tr[0].tagName.toLowerCase()).toEqual('tr'); @@ -217,40 +254,81 @@ describe('FileList tests', function() { name: 'testFolder', size: '0' }; - var $tr = FileList.add(fileData); + var $tr = fileList.add(fileData); expect($tr.find('.filesize').text()).toEqual('0 B'); }); - it('adds new file to the end of the list before the summary', function() { + it('adds new file to the end of the list', function() { + var $tr; var fileData = { type: 'file', - name: 'P comes after O.txt' + name: 'ZZZ.txt' }; - FileList.setFiles(testFiles); - $tr = FileList.add(fileData); + fileList.setFiles(testFiles); + $tr = fileList.add(fileData); expect($tr.index()).toEqual(4); - expect($tr.next().hasClass('summary')).toEqual(true); }); - it('adds new file at correct position in insert mode', function() { + it('inserts files in a sorted manner when insert option is enabled', function() { + var $tr; + for (var i = 0; i < testFiles.length; i++) { + fileList.add(testFiles[i]); + } + expect(fileList.files[0].name).toEqual('somedir'); + expect(fileList.files[1].name).toEqual('One.txt'); + expect(fileList.files[2].name).toEqual('Three.pdf'); + expect(fileList.files[3].name).toEqual('Two.jpg'); + }); + it('inserts new file at correct position', function() { + var $tr; var fileData = { type: 'file', name: 'P comes after O.txt' }; - FileList.setFiles(testFiles); - $tr = FileList.add(fileData, {insert: true}); + for (var i = 0; i < testFiles.length; i++) { + fileList.add(testFiles[i]); + } + $tr = fileList.add(fileData); // after "One.txt" + expect($tr.index()).toEqual(2); + expect(fileList.files[2]).toEqual(fileData); + }); + it('inserts new folder at correct position in insert mode', function() { + var $tr; + var fileData = { + type: 'dir', + name: 'somedir2 comes after somedir' + }; + for (var i = 0; i < testFiles.length; i++) { + fileList.add(testFiles[i]); + } + $tr = fileList.add(fileData); expect($tr.index()).toEqual(1); + expect(fileList.files[1]).toEqual(fileData); + }); + it('inserts new file at the end correctly', function() { + var $tr; + var fileData = { + type: 'file', + name: 'zzz.txt' + }; + for (var i = 0; i < testFiles.length; i++) { + fileList.add(testFiles[i]); + } + $tr = fileList.add(fileData); + expect($tr.index()).toEqual(4); + expect(fileList.files[4]).toEqual(fileData); }); it('removes empty content message and shows summary when adding first file', function() { + var $summary; var fileData = { type: 'file', name: 'first file.txt', size: 12 }; - FileList.setFiles([]); - expect(FileList.isEmpty).toEqual(true); - FileList.add(fileData); - $summary = $('#fileList .summary'); - expect($summary.length).toEqual(1); + fileList.setFiles([]); + expect(fileList.isEmpty).toEqual(true); + fileList.add(fileData); + $summary = $('#filestable .summary'); + expect($summary.hasClass('hidden')).toEqual(false); // yes, ugly... expect($summary.find('.info').text()).toEqual('0 folders and 1 file'); expect($summary.find('.dirinfo').hasClass('hidden')).toEqual(true); @@ -258,45 +336,49 @@ describe('FileList tests', function() { expect($summary.find('.filesize').text()).toEqual('12 B'); expect($('#filestable thead th').hasClass('hidden')).toEqual(false); expect($('#emptycontent').hasClass('hidden')).toEqual(true); - expect(FileList.isEmpty).toEqual(false); + expect(fileList.isEmpty).toEqual(false); }); }); describe('Removing files from the list', function() { it('Removes file from list when calling remove() and updates summary', function() { + var $summary; var $removedEl; - FileList.setFiles(testFiles); - $removedEl = FileList.remove('One.txt'); + fileList.setFiles(testFiles); + $removedEl = fileList.remove('One.txt'); expect($removedEl).toBeDefined(); expect($removedEl.attr('data-file')).toEqual('One.txt'); - expect($('#fileList tr:not(.summary)').length).toEqual(3); - expect(FileList.findFileEl('One.txt').length).toEqual(0); + expect($('#fileList tr').length).toEqual(3); + expect(fileList.files.length).toEqual(3); + expect(fileList.findFileEl('One.txt').length).toEqual(0); - $summary = $('#fileList .summary'); - expect($summary.length).toEqual(1); + $summary = $('#filestable .summary'); + expect($summary.hasClass('hidden')).toEqual(false); expect($summary.find('.info').text()).toEqual('1 folder and 2 files'); expect($summary.find('.dirinfo').hasClass('hidden')).toEqual(false); expect($summary.find('.fileinfo').hasClass('hidden')).toEqual(false); expect($summary.find('.filesize').text()).toEqual('69 kB'); - expect(FileList.isEmpty).toEqual(false); + expect(fileList.isEmpty).toEqual(false); }); it('Shows empty content when removing last file', function() { - FileList.setFiles([testFiles[0]]); - FileList.remove('One.txt'); - expect($('#fileList tr:not(.summary)').length).toEqual(0); - expect(FileList.findFileEl('One.txt').length).toEqual(0); + var $summary; + fileList.setFiles([testFiles[0]]); + fileList.remove('One.txt'); + expect($('#fileList tr').length).toEqual(0); + expect(fileList.files.length).toEqual(0); + expect(fileList.findFileEl('One.txt').length).toEqual(0); - $summary = $('#fileList .summary'); - expect($summary.length).toEqual(0); + $summary = $('#filestable .summary'); + expect($summary.hasClass('hidden')).toEqual(true); expect($('#filestable thead th').hasClass('hidden')).toEqual(true); expect($('#emptycontent').hasClass('hidden')).toEqual(false); - expect(FileList.isEmpty).toEqual(true); + expect(fileList.isEmpty).toEqual(true); }); }); describe('Deleting files', function() { function doDelete() { var request, query; // note: normally called from FileActions - FileList.do_delete(['One.txt', 'Two.jpg']); + fileList.do_delete(['One.txt', 'Two.jpg']); expect(fakeServer.requests.length).toEqual(1); request = fakeServer.requests[0]; @@ -306,7 +388,8 @@ describe('FileList tests', function() { expect(OC.parseQueryString(query)).toEqual({'dir': '/subdir', files: '["One.txt","Two.jpg"]'}); } it('calls delete.php, removes the deleted entries and updates summary', function() { - FileList.setFiles(testFiles); + var $summary; + fileList.setFiles(testFiles); doDelete(); fakeServer.requests[0].respond( @@ -315,25 +398,40 @@ describe('FileList tests', function() { JSON.stringify({status: 'success'}) ); - expect(FileList.findFileEl('One.txt').length).toEqual(0); - expect(FileList.findFileEl('Two.jpg').length).toEqual(0); - expect(FileList.findFileEl('Three.pdf').length).toEqual(1); - expect(FileList.$fileList.find('tr:not(.summary)').length).toEqual(2); + expect(fileList.findFileEl('One.txt').length).toEqual(0); + expect(fileList.findFileEl('Two.jpg').length).toEqual(0); + expect(fileList.findFileEl('Three.pdf').length).toEqual(1); + expect(fileList.$fileList.find('tr').length).toEqual(2); - $summary = $('#fileList .summary'); - expect($summary.length).toEqual(1); + $summary = $('#filestable .summary'); + expect($summary.hasClass('hidden')).toEqual(false); expect($summary.find('.info').text()).toEqual('1 folder and 1 file'); expect($summary.find('.dirinfo').hasClass('hidden')).toEqual(false); expect($summary.find('.fileinfo').hasClass('hidden')).toEqual(false); expect($summary.find('.filesize').text()).toEqual('57 kB'); - expect(FileList.isEmpty).toEqual(false); + expect(fileList.isEmpty).toEqual(false); expect($('#filestable thead th').hasClass('hidden')).toEqual(false); expect($('#emptycontent').hasClass('hidden')).toEqual(true); expect(notificationStub.notCalled).toEqual(true); }); + it('shows spinner on files to be deleted', function() { + fileList.setFiles(testFiles); + doDelete(); + + expect(fileList.findFileEl('One.txt').find('.progress-icon:not(.delete-icon)').length).toEqual(1); + expect(fileList.findFileEl('Three.pdf').find('.delete-icon:not(.progress-icon)').length).toEqual(1); + }); + it('shows spinner on all files when deleting all', function() { + fileList.setFiles(testFiles); + + fileList.do_delete(); + + expect(fileList.$fileList.find('tr .progress-icon:not(.delete-icon)').length).toEqual(4); + }); it('updates summary when deleting last file', function() { - FileList.setFiles([testFiles[0], testFiles[1]]); + var $summary; + fileList.setFiles([testFiles[0], testFiles[1]]); doDelete(); fakeServer.requests[0].respond( @@ -342,16 +440,17 @@ describe('FileList tests', function() { JSON.stringify({status: 'success'}) ); - expect(FileList.$fileList.find('tr:not(.summary)').length).toEqual(0); + expect(fileList.$fileList.find('tr').length).toEqual(0); - $summary = $('#fileList .summary'); - expect($summary.length).toEqual(0); - expect(FileList.isEmpty).toEqual(true); + $summary = $('#filestable .summary'); + expect($summary.hasClass('hidden')).toEqual(true); + expect(fileList.isEmpty).toEqual(true); + expect(fileList.files.length).toEqual(0); expect($('#filestable thead th').hasClass('hidden')).toEqual(true); expect($('#emptycontent').hasClass('hidden')).toEqual(false); }); it('bring back deleted item when delete call failed', function() { - FileList.setFiles(testFiles); + fileList.setFiles(testFiles); doDelete(); fakeServer.requests[0].respond( @@ -361,9 +460,9 @@ describe('FileList tests', function() { ); // files are still in the list - expect(FileList.findFileEl('One.txt').length).toEqual(1); - expect(FileList.findFileEl('Two.jpg').length).toEqual(1); - expect(FileList.$fileList.find('tr:not(.summary)').length).toEqual(4); + expect(fileList.findFileEl('One.txt').length).toEqual(1); + expect(fileList.findFileEl('Two.jpg').length).toEqual(1); + expect(fileList.$fileList.find('tr').length).toEqual(4); expect(notificationStub.calledOnce).toEqual(true); }); @@ -372,37 +471,43 @@ describe('FileList tests', function() { function doRename() { var $input, request; - FileList.setFiles(testFiles); + for (var i = 0; i < testFiles.length; i++) { + fileList.add(testFiles[i]); + } // trigger rename prompt - FileList.rename('One.txt'); - $input = FileList.$fileList.find('input.filename'); - $input.val('One_renamed.txt').blur(); + fileList.rename('One.txt'); + $input = fileList.$fileList.find('input.filename'); + $input.val('Tu_after_three.txt'); + // trigger submit because triggering blur doesn't work in all browsers + $input.closest('form').trigger('submit'); expect(fakeServer.requests.length).toEqual(1); - var request = fakeServer.requests[0]; + request = fakeServer.requests[0]; expect(request.url.substr(0, request.url.indexOf('?'))).toEqual(OC.webroot + '/index.php/apps/files/ajax/rename.php'); - expect(OC.parseQueryString(request.url)).toEqual({'dir': '/subdir', newname: 'One_renamed.txt', file: 'One.txt'}); + expect(OC.parseQueryString(request.url)).toEqual({'dir': '/subdir', newname: 'Tu_after_three.txt', file: 'One.txt'}); // element is renamed before the request finishes - expect(FileList.findFileEl('One.txt').length).toEqual(0); - expect(FileList.findFileEl('One_renamed.txt').length).toEqual(1); + expect(fileList.findFileEl('One.txt').length).toEqual(0); + expect(fileList.findFileEl('Tu_after_three.txt').length).toEqual(1); // input is gone - expect(FileList.$fileList.find('input.filename').length).toEqual(0); + expect(fileList.$fileList.find('input.filename').length).toEqual(0); } - it('Keeps renamed file entry if rename ajax call suceeded', function() { + it('Inserts renamed file entry at correct position if rename ajax call suceeded', function() { doRename(); fakeServer.requests[0].respond(200, {'Content-Type': 'application/json'}, JSON.stringify({ status: 'success', data: { - name: 'One_renamed.txt' + name: 'Tu_after_three.txt', + type: 'file' } })); // element stays renamed - expect(FileList.findFileEl('One.txt').length).toEqual(0); - expect(FileList.findFileEl('One_renamed.txt').length).toEqual(1); + expect(fileList.findFileEl('One.txt').length).toEqual(0); + expect(fileList.findFileEl('Tu_after_three.txt').length).toEqual(1); + expect(fileList.findFileEl('Tu_after_three.txt').index()).toEqual(2); // after Two.txt expect(alertStub.notCalled).toEqual(true); }); @@ -417,8 +522,9 @@ describe('FileList tests', function() { })); // element was reverted - expect(FileList.findFileEl('One.txt').length).toEqual(1); - expect(FileList.findFileEl('One_renamed.txt').length).toEqual(0); + expect(fileList.findFileEl('One.txt').length).toEqual(1); + expect(fileList.findFileEl('One.txt').index()).toEqual(1); // after somedir + expect(fileList.findFileEl('Tu_after_three.txt').length).toEqual(0); expect(alertStub.calledOnce).toEqual(true); }); @@ -429,12 +535,12 @@ describe('FileList tests', function() { fakeServer.requests[0].respond(200, {'Content-Type': 'application/json'}, JSON.stringify({ status: 'success', data: { - name: 'One_renamed.txt' + name: 'Tu_after_three.txt' } })); - $tr = FileList.findFileEl('One_renamed.txt'); - expect($tr.find('a.name').attr('href')).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=One_renamed.txt'); + $tr = fileList.findFileEl('Tu_after_three.txt'); + expect($tr.find('a.name').attr('href')).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=Tu_after_three.txt'); }); // FIXME: fix this in the source code! xit('Correctly updates file link after rename when path has same name', function() { @@ -446,56 +552,151 @@ describe('FileList tests', function() { fakeServer.requests[0].respond(200, {'Content-Type': 'application/json'}, JSON.stringify({ status: 'success', data: { - name: 'One_renamed.txt' + name: 'Tu_after_three.txt' } })); - $tr = FileList.findFileEl('One_renamed.txt'); + $tr = fileList.findFileEl('Tu_after_three.txt'); expect($tr.find('a.name').attr('href')).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=One.txt'); }); }); + describe('Moving files', function() { + beforeEach(function() { + fileList.setFiles(testFiles); + }); + it('Moves single file to target folder', function() { + var request; + fileList.move('One.txt', '/somedir'); + + expect(fakeServer.requests.length).toEqual(1); + request = fakeServer.requests[0]; + expect(request.url).toEqual(OC.webroot + '/index.php/apps/files/ajax/move.php'); + expect(OC.parseQueryString(request.requestBody)).toEqual({dir: '/subdir', file: 'One.txt', target: '/somedir'}); + + fakeServer.requests[0].respond(200, {'Content-Type': 'application/json'}, JSON.stringify({ + status: 'success', + data: { + name: 'One.txt', + type: 'file' + } + })); + + expect(fileList.findFileEl('One.txt').length).toEqual(0); + + // folder size has increased + expect(fileList.findFileEl('somedir').data('size')).toEqual(262); + expect(fileList.findFileEl('somedir').find('.filesize').text()).toEqual('262 B'); + + expect(notificationStub.notCalled).toEqual(true); + }); + it('Moves list of files to target folder', function() { + var request; + fileList.move(['One.txt', 'Two.jpg'], '/somedir'); + + expect(fakeServer.requests.length).toEqual(2); + request = fakeServer.requests[0]; + expect(request.url).toEqual(OC.webroot + '/index.php/apps/files/ajax/move.php'); + expect(OC.parseQueryString(request.requestBody)).toEqual({dir: '/subdir', file: 'One.txt', target: '/somedir'}); + + request = fakeServer.requests[1]; + expect(request.url).toEqual(OC.webroot + '/index.php/apps/files/ajax/move.php'); + expect(OC.parseQueryString(request.requestBody)).toEqual({dir: '/subdir', file: 'Two.jpg', target: '/somedir'}); + + fakeServer.requests[0].respond(200, {'Content-Type': 'application/json'}, JSON.stringify({ + status: 'success', + data: { + name: 'One.txt', + type: 'file' + } + })); + + expect(fileList.findFileEl('One.txt').length).toEqual(0); + + // folder size has increased + expect(fileList.findFileEl('somedir').data('size')).toEqual(262); + expect(fileList.findFileEl('somedir').find('.filesize').text()).toEqual('262 B'); + + fakeServer.requests[1].respond(200, {'Content-Type': 'application/json'}, JSON.stringify({ + status: 'success', + data: { + name: 'Two.jpg', + type: 'file' + } + })); + + expect(fileList.findFileEl('Two.jpg').length).toEqual(0); + + // folder size has increased + expect(fileList.findFileEl('somedir').data('size')).toEqual(12311); + expect(fileList.findFileEl('somedir').find('.filesize').text()).toEqual('12 kB'); + + expect(notificationStub.notCalled).toEqual(true); + }); + it('Shows notification if a file could not be moved', function() { + var request; + fileList.move('One.txt', '/somedir'); + + expect(fakeServer.requests.length).toEqual(1); + request = fakeServer.requests[0]; + expect(request.url).toEqual(OC.webroot + '/index.php/apps/files/ajax/move.php'); + expect(OC.parseQueryString(request.requestBody)).toEqual({dir: '/subdir', file: 'One.txt', target: '/somedir'}); + + fakeServer.requests[0].respond(200, {'Content-Type': 'application/json'}, JSON.stringify({ + status: 'error', + data: { + message: 'Error while moving file', + } + })); + + expect(fileList.findFileEl('One.txt').length).toEqual(1); + + expect(notificationStub.calledOnce).toEqual(true); + expect(notificationStub.getCall(0).args[0]).toEqual('Error while moving file'); + }); + }); describe('List rendering', function() { it('renders a list of files using add()', function() { - var addSpy = sinon.spy(FileList, 'add'); - FileList.setFiles(testFiles); - expect(addSpy.callCount).toEqual(4); - expect($('#fileList tr:not(.summary)').length).toEqual(4); - addSpy.restore(); + expect(fileList.files.length).toEqual(0); + expect(fileList.files).toEqual([]); + fileList.setFiles(testFiles); + expect($('#fileList tr').length).toEqual(4); + expect(fileList.files.length).toEqual(4); + expect(fileList.files).toEqual(testFiles); }); it('updates summary using the file sizes', function() { var $summary; - FileList.setFiles(testFiles); - $summary = $('#fileList .summary'); - expect($summary.length).toEqual(1); + fileList.setFiles(testFiles); + $summary = $('#filestable .summary'); + expect($summary.hasClass('hidden')).toEqual(false); expect($summary.find('.info').text()).toEqual('1 folder and 3 files'); expect($summary.find('.filesize').text()).toEqual('69 kB'); }); it('shows headers, summary and hide empty content message after setting files', function(){ - FileList.setFiles(testFiles); + fileList.setFiles(testFiles); expect($('#filestable thead th').hasClass('hidden')).toEqual(false); expect($('#emptycontent').hasClass('hidden')).toEqual(true); - expect(FileList.$fileList.find('.summary').length).toEqual(1); + expect(fileList.$el.find('.summary').hasClass('hidden')).toEqual(false); }); it('hides headers, summary and show empty content message after setting empty file list', function(){ - FileList.setFiles([]); + fileList.setFiles([]); expect($('#filestable thead th').hasClass('hidden')).toEqual(true); expect($('#emptycontent').hasClass('hidden')).toEqual(false); - expect(FileList.$fileList.find('.summary').length).toEqual(0); + expect(fileList.$el.find('.summary').hasClass('hidden')).toEqual(true); }); it('hides headers, empty content message, and summary when list is empty and user has no creation permission', function(){ $('#permissions').val(0); - FileList.setFiles([]); + fileList.setFiles([]); expect($('#filestable thead th').hasClass('hidden')).toEqual(true); expect($('#emptycontent').hasClass('hidden')).toEqual(true); - expect(FileList.$fileList.find('.summary').length).toEqual(0); + expect(fileList.$el.find('.summary').hasClass('hidden')).toEqual(true); }); it('calling findFileEl() can find existing file element', function() { - FileList.setFiles(testFiles); - expect(FileList.findFileEl('Two.jpg').length).toEqual(1); + fileList.setFiles(testFiles); + expect(fileList.findFileEl('Two.jpg').length).toEqual(1); }); it('calling findFileEl() returns empty when file not found in file', function() { - FileList.setFiles(testFiles); - expect(FileList.findFileEl('unexist.dat').length).toEqual(0); + fileList.setFiles(testFiles); + expect(fileList.findFileEl('unexist.dat').length).toEqual(0); }); it('only add file if in same current directory', function() { $('#dir').val('/current dir'); @@ -504,21 +705,126 @@ describe('FileList tests', function() { name: 'testFile.txt', directory: '/current dir' }; - var $tr = FileList.add(fileData); - expect(FileList.findFileEl('testFile.txt').length).toEqual(1); + var $tr = fileList.add(fileData); + expect(fileList.findFileEl('testFile.txt').length).toEqual(1); }); it('triggers "fileActionsReady" event after update', function() { var handler = sinon.stub(); - FileList.$fileList.on('fileActionsReady', handler); - FileList.setFiles(testFiles); + fileList.$fileList.on('fileActionsReady', handler); + fileList.setFiles(testFiles); expect(handler.calledOnce).toEqual(true); }); it('triggers "updated" event after update', function() { var handler = sinon.stub(); - FileList.$fileList.on('updated', handler); - FileList.setFiles(testFiles); + fileList.$fileList.on('updated', handler); + fileList.setFiles(testFiles); expect(handler.calledOnce).toEqual(true); }); + it('does not update summary when removing non-existing files', function() { + var $summary; + // single file + fileList.setFiles([testFiles[0]]); + $summary = $('#filestable .summary'); + expect($summary.hasClass('hidden')).toEqual(false); + expect($summary.find('.info').text()).toEqual('0 folders and 1 file'); + fileList.remove('unexist.txt'); + expect($summary.hasClass('hidden')).toEqual(false); + expect($summary.find('.info').text()).toEqual('0 folders and 1 file'); + }); + }); + describe('Rendering next page on scroll', function() { + beforeEach(function() { + fileList.setFiles(generateFiles(0, 64)); + }); + it('renders only the first page', function() { + expect(fileList.files.length).toEqual(65); + expect($('#fileList tr').length).toEqual(20); + }); + it('renders the second page when scrolling down (trigger nextPage)', function() { + // TODO: can't simulate scrolling here, so calling nextPage directly + fileList._nextPage(true); + expect($('#fileList tr').length).toEqual(40); + fileList._nextPage(true); + expect($('#fileList tr').length).toEqual(60); + fileList._nextPage(true); + expect($('#fileList tr').length).toEqual(65); + fileList._nextPage(true); + // stays at 65 + expect($('#fileList tr').length).toEqual(65); + }); + it('inserts into the DOM if insertion point is in the visible page ', function() { + fileList.add({ + id: 2000, + type: 'file', + name: 'File with index 15b.txt' + }); + expect($('#fileList tr').length).toEqual(21); + expect(fileList.findFileEl('File with index 15b.txt').index()).toEqual(16); + }); + it('does not inserts into the DOM if insertion point is not the visible page ', function() { + fileList.add({ + id: 2000, + type: 'file', + name: 'File with index 28b.txt' + }); + expect($('#fileList tr').length).toEqual(20); + expect(fileList.findFileEl('File with index 28b.txt').length).toEqual(0); + fileList._nextPage(true); + expect($('#fileList tr').length).toEqual(40); + expect(fileList.findFileEl('File with index 28b.txt').index()).toEqual(29); + }); + it('appends into the DOM when inserting a file after the last visible element', function() { + fileList.add({ + id: 2000, + type: 'file', + name: 'File with index 19b.txt' + }); + expect($('#fileList tr').length).toEqual(21); + fileList._nextPage(true); + expect($('#fileList tr').length).toEqual(41); + }); + it('appends into the DOM when inserting a file on the last page when visible', function() { + fileList._nextPage(true); + expect($('#fileList tr').length).toEqual(40); + fileList._nextPage(true); + expect($('#fileList tr').length).toEqual(60); + fileList._nextPage(true); + expect($('#fileList tr').length).toEqual(65); + fileList._nextPage(true); + fileList.add({ + id: 2000, + type: 'file', + name: 'File with index 88.txt' + }); + expect($('#fileList tr').length).toEqual(66); + fileList._nextPage(true); + expect($('#fileList tr').length).toEqual(66); + }); + it('shows additional page when appending a page of files and scrolling down', function() { + var newFiles = generateFiles(66, 81); + for (var i = 0; i < newFiles.length; i++) { + fileList.add(newFiles[i]); + } + expect($('#fileList tr').length).toEqual(20); + fileList._nextPage(true); + expect($('#fileList tr').length).toEqual(40); + fileList._nextPage(true); + expect($('#fileList tr').length).toEqual(60); + fileList._nextPage(true); + expect($('#fileList tr').length).toEqual(80); + fileList._nextPage(true); + expect($('#fileList tr').length).toEqual(81); + fileList._nextPage(true); + expect($('#fileList tr').length).toEqual(81); + }); + it('automatically renders next page when there are not enough elements visible', function() { + // delete the 15 first elements + for (var i = 0; i < 15; i++) { + fileList.remove(fileList.files[0].name); + } + // still makes sure that there are 20 elements visible, if any + expect($('#fileList tr').length).toEqual(25); + }); }); describe('file previews', function() { var previewLoadStub; @@ -534,7 +840,7 @@ describe('FileList tests', function() { } beforeEach(function() { - previewLoadStub = sinon.stub(Files, 'lazyLoadPreview'); + previewLoadStub = sinon.stub(OCA.Files.FileList.prototype, 'lazyLoadPreview'); }); afterEach(function() { previewLoadStub.restore(); @@ -544,7 +850,7 @@ describe('FileList tests', function() { type: 'file', name: 'testFile.txt' }; - var $tr = FileList.add(fileData); + var $tr = fileList.add(fileData); var $td = $tr.find('td.filename'); expect(getImageUrl($td)).toEqual(OC.webroot + '/core/img/filetypes/file.svg'); expect(previewLoadStub.notCalled).toEqual(true); @@ -554,7 +860,7 @@ describe('FileList tests', function() { type: 'dir', name: 'test dir' }; - var $tr = FileList.add(fileData); + var $tr = fileList.add(fileData); var $td = $tr.find('td.filename'); expect(getImageUrl($td)).toEqual(OC.webroot + '/core/img/filetypes/folder.svg'); expect(previewLoadStub.notCalled).toEqual(true); @@ -565,7 +871,7 @@ describe('FileList tests', function() { name: 'test dir', icon: OC.webroot + '/core/img/filetypes/application-pdf.svg' }; - var $tr = FileList.add(fileData); + var $tr = fileList.add(fileData); var $td = $tr.find('td.filename'); expect(getImageUrl($td)).toEqual(OC.webroot + '/core/img/filetypes/application-pdf.svg'); expect(previewLoadStub.notCalled).toEqual(true); @@ -576,12 +882,12 @@ describe('FileList tests', function() { name: 'test dir', isPreviewAvailable: true }; - var $tr = FileList.add(fileData); + var $tr = fileList.add(fileData); var $td = $tr.find('td.filename'); expect(getImageUrl($td)).toEqual(OC.webroot + '/core/img/filetypes/file.svg'); expect(previewLoadStub.calledOnce).toEqual(true); // third argument is callback - previewLoadStub.getCall(0).args[2](OC.webroot + '/somepath.png'); + previewLoadStub.getCall(0).args[0].callback(OC.webroot + '/somepath.png'); expect(getImageUrl($td)).toEqual(OC.webroot + '/somepath.png'); }); it('renders default file type icon when no icon was provided and no preview is available', function() { @@ -590,7 +896,7 @@ describe('FileList tests', function() { name: 'test dir', isPreviewAvailable: false }; - var $tr = FileList.add(fileData); + var $tr = fileList.add(fileData); var $td = $tr.find('td.filename'); expect(getImageUrl($td)).toEqual(OC.webroot + '/core/img/filetypes/file.svg'); expect(previewLoadStub.notCalled).toEqual(true); @@ -598,26 +904,38 @@ describe('FileList tests', function() { }); describe('viewer mode', function() { it('enabling viewer mode hides files table and action buttons', function() { - FileList.setViewerMode(true); + fileList.setViewerMode(true); expect($('#filestable').hasClass('hidden')).toEqual(true); expect($('.actions').hasClass('hidden')).toEqual(true); expect($('.notCreatable').hasClass('hidden')).toEqual(true); }); it('disabling viewer mode restores files table and action buttons', function() { - FileList.setViewerMode(true); - FileList.setViewerMode(false); + fileList.setViewerMode(true); + fileList.setViewerMode(false); expect($('#filestable').hasClass('hidden')).toEqual(false); expect($('.actions').hasClass('hidden')).toEqual(false); expect($('.notCreatable').hasClass('hidden')).toEqual(true); }); it('disabling viewer mode restores files table and action buttons with correct permissions', function() { $('#permissions').val(0); - FileList.setViewerMode(true); - FileList.setViewerMode(false); + fileList.setViewerMode(true); + fileList.setViewerMode(false); expect($('#filestable').hasClass('hidden')).toEqual(false); expect($('.actions').hasClass('hidden')).toEqual(true); expect($('.notCreatable').hasClass('hidden')).toEqual(false); }); + it('toggling viewer mode triggers event', function() { + var handler = sinon.stub(); + fileList.$el.on('changeViewerMode', handler); + fileList.setViewerMode(true); + expect(handler.calledOnce).toEqual(true); + expect(handler.getCall(0).args[0].viewerModeEnabled).toEqual(true); + + handler.reset(); + fileList.setViewerMode(false); + expect(handler.calledOnce).toEqual(true); + expect(handler.getCall(0).args[0].viewerModeEnabled).toEqual(false); + }); }); describe('loading file list', function() { beforeEach(function() { @@ -636,22 +954,22 @@ describe('FileList tests', function() { ]); }); it('fetches file list from server and renders it when reload() is called', function() { - FileList.reload(); + fileList.reload(); expect(fakeServer.requests.length).toEqual(1); var url = fakeServer.requests[0].url; var query = url.substr(url.indexOf('?') + 1); - expect(OC.parseQueryString(query)).toEqual({'dir': '/subdir'}); + expect(OC.parseQueryString(query)).toEqual({'dir': '/subdir', sort: 'name', sortdirection: 'asc'}); fakeServer.respond(); - expect($('#fileList tr:not(.summary)').length).toEqual(4); - expect(FileList.findFileEl('One.txt').length).toEqual(1); + expect($('#fileList tr').length).toEqual(4); + expect(fileList.findFileEl('One.txt').length).toEqual(1); }); it('switches dir and fetches file list when calling changeDirectory()', function() { - FileList.changeDirectory('/anothersubdir'); - expect(FileList.getCurrentDirectory()).toEqual('/anothersubdir'); + fileList.changeDirectory('/anothersubdir'); + expect(fileList.getCurrentDirectory()).toEqual('/anothersubdir'); expect(fakeServer.requests.length).toEqual(1); var url = fakeServer.requests[0].url; var query = url.substr(url.indexOf('?') + 1); - expect(OC.parseQueryString(query)).toEqual({'dir': '/anothersubdir'}); + expect(OC.parseQueryString(query)).toEqual({'dir': '/anothersubdir', sort: 'name', sortdirection: 'asc'}); fakeServer.respond(); }); it('switches to root dir when current directory does not exist', function() { @@ -661,14 +979,14 @@ describe('FileList tests', function() { }, '' ]); - FileList.changeDirectory('/unexist'); + fileList.changeDirectory('/unexist'); fakeServer.respond(); - expect(FileList.getCurrentDirectory()).toEqual('/'); + expect(fileList.getCurrentDirectory()).toEqual('/'); }); it('shows mask before loading file list then hides it at the end', function() { - var showMaskStub = sinon.stub(FileList, 'showMask'); - var hideMaskStub = sinon.stub(FileList, 'hideMask'); - FileList.changeDirectory('/anothersubdir'); + var showMaskStub = sinon.stub(fileList, 'showMask'); + var hideMaskStub = sinon.stub(fileList, 'hideMask'); + fileList.changeDirectory('/anothersubdir'); expect(showMaskStub.calledOnce).toEqual(true); expect(hideMaskStub.calledOnce).toEqual(false); fakeServer.respond(); @@ -677,18 +995,23 @@ describe('FileList tests', function() { showMaskStub.restore(); hideMaskStub.restore(); }); - it('changes URL to target dir', function() { - FileList.changeDirectory('/somedir'); - expect(pushStateStub.calledOnce).toEqual(true); - expect(pushStateStub.getCall(0).args[0]).toEqual({dir: '/somedir'}); - expect(pushStateStub.getCall(0).args[2]).toEqual(OC.webroot + '/index.php/apps/files?dir=/somedir'); + it('triggers "changeDirectory" event when changing directory', function() { + var handler = sinon.stub(); + $('#app-content-files').on('changeDirectory', handler); + fileList.changeDirectory('/somedir'); + expect(handler.calledOnce).toEqual(true); + expect(handler.getCall(0).args[0].dir).toEqual('/somedir'); + }); + it('changes the directory when receiving "urlChanged" event', function() { + $('#app-content-files').trigger(new $.Event('urlChanged', {view: 'files', dir: '/somedir'})); + expect(fileList.getCurrentDirectory()).toEqual('/somedir'); }); it('refreshes breadcrumb after update', function() { - var setDirSpy = sinon.spy(FileList.breadcrumb, 'setDirectory'); - FileList.changeDirectory('/anothersubdir'); + var setDirSpy = sinon.spy(fileList.breadcrumb, 'setDirectory'); + fileList.changeDirectory('/anothersubdir'); fakeServer.respond(); - expect(FileList.breadcrumb.setDirectory.calledOnce).toEqual(true); - expect(FileList.breadcrumb.setDirectory.calledWith('/anothersubdir')).toEqual(true); + expect(fileList.breadcrumb.setDirectory.calledOnce).toEqual(true); + expect(fileList.breadcrumb.setDirectory.calledWith('/anothersubdir')).toEqual(true); setDirSpy.restore(); }); }); @@ -709,20 +1032,20 @@ describe('FileList tests', function() { ]); }); it('clicking on root breadcrumb changes directory to root', function() { - FileList.changeDirectory('/subdir/two/three with space/four/five'); + fileList.changeDirectory('/subdir/two/three with space/four/five'); fakeServer.respond(); - var changeDirStub = sinon.stub(FileList, 'changeDirectory'); - FileList.breadcrumb.$el.find('.crumb:eq(0)').click(); + var changeDirStub = sinon.stub(fileList, 'changeDirectory'); + fileList.breadcrumb.$el.find('.crumb:eq(0)').click(); expect(changeDirStub.calledOnce).toEqual(true); expect(changeDirStub.getCall(0).args[0]).toEqual('/'); changeDirStub.restore(); }); it('clicking on breadcrumb changes directory', function() { - FileList.changeDirectory('/subdir/two/three with space/four/five'); + fileList.changeDirectory('/subdir/two/three with space/four/five'); fakeServer.respond(); - var changeDirStub = sinon.stub(FileList, 'changeDirectory'); - FileList.breadcrumb.$el.find('.crumb:eq(3)').click(); + var changeDirStub = sinon.stub(fileList, 'changeDirectory'); + fileList.breadcrumb.$el.find('.crumb:eq(3)').click(); expect(changeDirStub.calledOnce).toEqual(true); expect(changeDirStub.getCall(0).args[0]).toEqual('/subdir/two/three with space'); @@ -730,9 +1053,9 @@ describe('FileList tests', function() { }); it('dropping files on breadcrumb calls move operation', function() { var request, query, testDir = '/subdir/two/three with space/four/five'; - FileList.changeDirectory(testDir); + fileList.changeDirectory(testDir); fakeServer.respond(); - var $crumb = FileList.breadcrumb.$el.find('.crumb:eq(3)'); + var $crumb = fileList.breadcrumb.$el.find('.crumb:eq(3)'); // no idea what this is but is required by the handler var ui = { helper: { @@ -740,14 +1063,12 @@ describe('FileList tests', function() { } }; // returns a list of tr that were dragged - // FIXME: why are their attributes different than the - // regular file trs ? ui.helper.find.returns([ - $(''), - $('') + $(''), + $('') ]); // simulate drop event - FileList._onDropOnBreadCrumb.call($crumb, new $.Event('drop'), ui); + fileList._onDropOnBreadCrumb(new $.Event('drop', {target: $crumb}), ui); // will trigger two calls to move.php (first one was previous list.php) expect(fakeServer.requests.length).toEqual(3); @@ -773,10 +1094,10 @@ describe('FileList tests', function() { }); }); it('dropping files on same dir breadcrumb does nothing', function() { - var request, query, testDir = '/subdir/two/three with space/four/five'; - FileList.changeDirectory(testDir); + var testDir = '/subdir/two/three with space/four/five'; + fileList.changeDirectory(testDir); fakeServer.respond(); - var $crumb = FileList.breadcrumb.$el.find('.crumb:last'); + var $crumb = fileList.breadcrumb.$el.find('.crumb:last'); // no idea what this is but is required by the handler var ui = { helper: { @@ -784,14 +1105,12 @@ describe('FileList tests', function() { } }; // returns a list of tr that were dragged - // FIXME: why are their attributes different than the - // regular file trs ? ui.helper.find.returns([ - $(''), - $('') + $(''), + $('') ]); // simulate drop event - FileList._onDropOnBreadCrumb.call($crumb, new $.Event('drop'), ui); + fileList._onDropOnBreadCrumb(new $.Event('drop', {target: $crumb}), ui); // no extra server request expect(fakeServer.requests.length).toEqual(1); @@ -799,16 +1118,498 @@ describe('FileList tests', function() { }); describe('Download Url', function() { it('returns correct download URL for single files', function() { - expect(Files.getDownloadUrl('some file.txt')).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=some%20file.txt'); - expect(Files.getDownloadUrl('some file.txt', '/anotherpath/abc')).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fanotherpath%2Fabc&files=some%20file.txt'); + expect(fileList.getDownloadUrl('some file.txt')).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=some%20file.txt'); + expect(fileList.getDownloadUrl('some file.txt', '/anotherpath/abc')).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fanotherpath%2Fabc&files=some%20file.txt'); $('#dir').val('/'); - expect(Files.getDownloadUrl('some file.txt')).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2F&files=some%20file.txt'); + expect(fileList.getDownloadUrl('some file.txt')).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2F&files=some%20file.txt'); }); it('returns correct download URL for multiple files', function() { - expect(Files.getDownloadUrl(['a b c.txt', 'd e f.txt'])).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=%5B%22a%20b%20c.txt%22%2C%22d%20e%20f.txt%22%5D'); + expect(fileList.getDownloadUrl(['a b c.txt', 'd e f.txt'])).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=%5B%22a%20b%20c.txt%22%2C%22d%20e%20f.txt%22%5D'); }); it('returns the correct ajax URL', function() { - expect(Files.getAjaxUrl('test', {a:1, b:'x y'})).toEqual(OC.webroot + '/index.php/apps/files/ajax/test.php?a=1&b=x%20y'); + expect(fileList.getAjaxUrl('test', {a:1, b:'x y'})).toEqual(OC.webroot + '/index.php/apps/files/ajax/test.php?a=1&b=x%20y'); + }); + }); + describe('File selection', function() { + beforeEach(function() { + fileList.setFiles(testFiles); + }); + it('Selects a file when clicking its checkbox', function() { + var $tr = fileList.findFileEl('One.txt'); + expect($tr.find('input:checkbox').prop('checked')).toEqual(false); + $tr.find('td.filename input:checkbox').click(); + + expect($tr.find('input:checkbox').prop('checked')).toEqual(true); + }); + it('Selects/deselect a file when clicking on the name while holding Ctrl', function() { + var $tr = fileList.findFileEl('One.txt'); + var $tr2 = fileList.findFileEl('Three.pdf'); + var e; + expect($tr.find('input:checkbox').prop('checked')).toEqual(false); + expect($tr2.find('input:checkbox').prop('checked')).toEqual(false); + e = new $.Event('click'); + e.ctrlKey = true; + $tr.find('td.filename .name').trigger(e); + + expect($tr.find('input:checkbox').prop('checked')).toEqual(true); + expect($tr2.find('input:checkbox').prop('checked')).toEqual(false); + + // click on second entry, does not clear the selection + e = new $.Event('click'); + e.ctrlKey = true; + $tr2.find('td.filename .name').trigger(e); + expect($tr.find('input:checkbox').prop('checked')).toEqual(true); + expect($tr2.find('input:checkbox').prop('checked')).toEqual(true); + + expect(_.pluck(fileList.getSelectedFiles(), 'name')).toEqual(['One.txt', 'Three.pdf']); + + // deselect now + e = new $.Event('click'); + e.ctrlKey = true; + $tr2.find('td.filename .name').trigger(e); + expect($tr.find('input:checkbox').prop('checked')).toEqual(true); + expect($tr2.find('input:checkbox').prop('checked')).toEqual(false); + expect(_.pluck(fileList.getSelectedFiles(), 'name')).toEqual(['One.txt']); + }); + it('Selects a range when clicking on one file then Shift clicking on another one', function() { + var $tr = fileList.findFileEl('One.txt'); + var $tr2 = fileList.findFileEl('Three.pdf'); + var e; + $tr.find('td.filename input:checkbox').click(); + e = new $.Event('click'); + e.shiftKey = true; + $tr2.find('td.filename .name').trigger(e); + + expect($tr.find('input:checkbox').prop('checked')).toEqual(true); + expect($tr2.find('input:checkbox').prop('checked')).toEqual(true); + expect(fileList.findFileEl('Two.jpg').find('input:checkbox').prop('checked')).toEqual(true); + var selection = _.pluck(fileList.getSelectedFiles(), 'name'); + expect(selection.length).toEqual(3); + expect(selection).toContain('One.txt'); + expect(selection).toContain('Two.jpg'); + expect(selection).toContain('Three.pdf'); + }); + it('Selects a range when clicking on one file then Shift clicking on another one that is above the first one', function() { + var $tr = fileList.findFileEl('One.txt'); + var $tr2 = fileList.findFileEl('Three.pdf'); + var e; + $tr2.find('td.filename input:checkbox').click(); + e = new $.Event('click'); + e.shiftKey = true; + $tr.find('td.filename .name').trigger(e); + + expect($tr.find('input:checkbox').prop('checked')).toEqual(true); + expect($tr2.find('input:checkbox').prop('checked')).toEqual(true); + expect(fileList.findFileEl('Two.jpg').find('input:checkbox').prop('checked')).toEqual(true); + var selection = _.pluck(fileList.getSelectedFiles(), 'name'); + expect(selection.length).toEqual(3); + expect(selection).toContain('One.txt'); + expect(selection).toContain('Two.jpg'); + expect(selection).toContain('Three.pdf'); + }); + it('Selecting all files will automatically check "select all" checkbox', function() { + expect($('.select-all').prop('checked')).toEqual(false); + $('#fileList tr td.filename input:checkbox').click(); + expect($('.select-all').prop('checked')).toEqual(true); + }); + it('Selecting all files on the first visible page will not automatically check "select all" checkbox', function() { + fileList.setFiles(generateFiles(0, 41)); + expect($('.select-all').prop('checked')).toEqual(false); + $('#fileList tr td.filename input:checkbox').click(); + expect($('.select-all').prop('checked')).toEqual(false); + }); + it('Clicking "select all" will select/deselect all files', function() { + fileList.setFiles(generateFiles(0, 41)); + $('.select-all').click(); + expect($('.select-all').prop('checked')).toEqual(true); + $('#fileList tr input:checkbox').each(function() { + expect($(this).prop('checked')).toEqual(true); + }); + expect(_.pluck(fileList.getSelectedFiles(), 'name').length).toEqual(42); + + $('.select-all').click(); + expect($('.select-all').prop('checked')).toEqual(false); + + $('#fileList tr input:checkbox').each(function() { + expect($(this).prop('checked')).toEqual(false); + }); + expect(_.pluck(fileList.getSelectedFiles(), 'name').length).toEqual(0); + }); + it('Clicking "select all" then deselecting a file will uncheck "select all"', function() { + $('.select-all').click(); + expect($('.select-all').prop('checked')).toEqual(true); + + var $tr = fileList.findFileEl('One.txt'); + $tr.find('input:checkbox').click(); + + expect($('.select-all').prop('checked')).toEqual(false); + expect(_.pluck(fileList.getSelectedFiles(), 'name').length).toEqual(3); + }); + it('Updates the selection summary when doing a few manipulations with "Select all"', function() { + $('.select-all').click(); + expect($('.select-all').prop('checked')).toEqual(true); + + var $tr = fileList.findFileEl('One.txt'); + // unselect one + $tr.find('input:checkbox').click(); + + expect($('.select-all').prop('checked')).toEqual(false); + expect(_.pluck(fileList.getSelectedFiles(), 'name').length).toEqual(3); + + // select all + $('.select-all').click(); + expect($('.select-all').prop('checked')).toEqual(true); + expect(_.pluck(fileList.getSelectedFiles(), 'name').length).toEqual(4); + + // unselect one + $tr.find('input:checkbox').click(); + expect($('.select-all').prop('checked')).toEqual(false); + expect(_.pluck(fileList.getSelectedFiles(), 'name').length).toEqual(3); + + // re-select it + $tr.find('input:checkbox').click(); + expect($('.select-all').prop('checked')).toEqual(true); + expect(_.pluck(fileList.getSelectedFiles(), 'name').length).toEqual(4); + }); + it('Auto-selects files on next page when "select all" is checked', function() { + fileList.setFiles(generateFiles(0, 41)); + $('.select-all').click(); + + expect(fileList.$fileList.find('tr input:checkbox:checked').length).toEqual(20); + fileList._nextPage(true); + expect(fileList.$fileList.find('tr input:checkbox:checked').length).toEqual(40); + fileList._nextPage(true); + expect(fileList.$fileList.find('tr input:checkbox:checked').length).toEqual(42); + expect(_.pluck(fileList.getSelectedFiles(), 'name').length).toEqual(42); + }); + it('Selecting files updates selection summary', function() { + var $summary = $('#headerName a.name>span:first'); + expect($summary.text()).toEqual('Name'); + fileList.findFileEl('One.txt').find('input:checkbox').click(); + fileList.findFileEl('Three.pdf').find('input:checkbox').click(); + fileList.findFileEl('somedir').find('input:checkbox').click(); + expect($summary.text()).toEqual('1 folder & 2 files'); + }); + it('Unselecting files hides selection summary', function() { + var $summary = $('#headerName a.name>span:first'); + fileList.findFileEl('One.txt').find('input:checkbox').click().click(); + expect($summary.text()).toEqual('Name'); + }); + it('Select/deselect files shows/hides file actions', function() { + var $actions = $('#headerName .selectedActions'); + var $checkbox = fileList.findFileEl('One.txt').find('input:checkbox'); + expect($actions.hasClass('hidden')).toEqual(true); + $checkbox.click(); + expect($actions.hasClass('hidden')).toEqual(false); + $checkbox.click(); + expect($actions.hasClass('hidden')).toEqual(true); + }); + it('Selection is cleared when switching dirs', function() { + $('.select-all').click(); + var data = { + status: 'success', + data: { + files: testFiles, + permissions: 31 + } + }; + fakeServer.respondWith(/\/index\.php\/apps\/files\/ajax\/list.php/, [ + 200, { + "Content-Type": "application/json" + }, + JSON.stringify(data) + ]); + fileList.changeDirectory('/'); + fakeServer.respond(); + expect($('.select-all').prop('checked')).toEqual(false); + expect(_.pluck(fileList.getSelectedFiles(), 'name')).toEqual([]); + }); + it('getSelectedFiles returns the selected files even when they are on the next page', function() { + var selectedFiles; + fileList.setFiles(generateFiles(0, 41)); + $('.select-all').click(); + // unselect one to not have the "allFiles" case + fileList.$fileList.find('tr input:checkbox:first').click(); + + // only 20 files visible, must still return all the selected ones + selectedFiles = _.pluck(fileList.getSelectedFiles(), 'name'); + + expect(selectedFiles.length).toEqual(41); + }); + describe('Selection overlay', function() { + it('show delete action according to directory permissions', function() { + fileList.setFiles(testFiles); + $('#permissions').val(OC.PERMISSION_READ | OC.PERMISSION_DELETE); + $('.select-all').click(); + expect(fileList.$el.find('.delete-selected').hasClass('hidden')).toEqual(false); + $('.select-all').click(); + $('#permissions').val(OC.PERMISSION_READ); + $('.select-all').click(); + expect(fileList.$el.find('.delete-selected').hasClass('hidden')).toEqual(true); + }); + }); + describe('Actions', function() { + beforeEach(function() { + fileList.findFileEl('One.txt').find('input:checkbox').click(); + fileList.findFileEl('Three.pdf').find('input:checkbox').click(); + fileList.findFileEl('somedir').find('input:checkbox').click(); + }); + it('getSelectedFiles returns the selected file data', function() { + var files = fileList.getSelectedFiles(); + expect(files.length).toEqual(3); + expect(files[0]).toEqual({ + id: 1, + name: 'One.txt', + mimetype: 'text/plain', + type: 'file', + size: 12, + etag: 'abc' + }); + expect(files[1]).toEqual({ + id: 3, + type: 'file', + name: 'Three.pdf', + mimetype: 'application/pdf', + size: 58009, + etag: '123' + }); + expect(files[2]).toEqual({ + id: 4, + type: 'dir', + name: 'somedir', + mimetype: 'httpd/unix-directory', + size: 250, + etag: '456' + }); + }); + it('Removing a file removes it from the selection', function() { + fileList.remove('Three.pdf'); + var files = fileList.getSelectedFiles(); + expect(files.length).toEqual(2); + expect(files[0]).toEqual({ + id: 1, + name: 'One.txt', + mimetype: 'text/plain', + type: 'file', + size: 12, + etag: 'abc' + }); + expect(files[1]).toEqual({ + id: 4, + type: 'dir', + name: 'somedir', + mimetype: 'httpd/unix-directory', + size: 250, + etag: '456' + }); + }); + describe('Download', function() { + it('Opens download URL when clicking "Download"', function() { + var redirectStub = sinon.stub(OC, 'redirect'); + $('.selectedActions .download').click(); + expect(redirectStub.calledOnce).toEqual(true); + expect(redirectStub.getCall(0).args[0]).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=%5B%22One.txt%22%2C%22Three.pdf%22%2C%22somedir%22%5D'); + redirectStub.restore(); + }); + it('Downloads root folder when all selected in root folder', function() { + $('#dir').val('/'); + $('.select-all').click(); + var redirectStub = sinon.stub(OC, 'redirect'); + $('.selectedActions .download').click(); + expect(redirectStub.calledOnce).toEqual(true); + expect(redirectStub.getCall(0).args[0]).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2F&files='); + redirectStub.restore(); + }); + it('Downloads parent folder when all selected in subfolder', function() { + $('.select-all').click(); + var redirectStub = sinon.stub(OC, 'redirect'); + $('.selectedActions .download').click(); + expect(redirectStub.calledOnce).toEqual(true); + expect(redirectStub.getCall(0).args[0]).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2F&files=subdir'); + redirectStub.restore(); + }); + }); + describe('Delete', function() { + it('Deletes selected files when "Delete" clicked', function() { + var request; + $('.selectedActions .delete-selected').click(); + expect(fakeServer.requests.length).toEqual(1); + request = fakeServer.requests[0]; + expect(request.url).toEqual(OC.webroot + '/index.php/apps/files/ajax/delete.php'); + expect(OC.parseQueryString(request.requestBody)) + .toEqual({'dir': '/subdir', files: '["One.txt","Three.pdf","somedir"]'}); + fakeServer.requests[0].respond( + 200, + { 'Content-Type': 'application/json' }, + JSON.stringify({status: 'success'}) + ); + expect(fileList.findFileEl('One.txt').length).toEqual(0); + expect(fileList.findFileEl('Three.pdf').length).toEqual(0); + expect(fileList.findFileEl('somedir').length).toEqual(0); + expect(fileList.findFileEl('Two.jpg').length).toEqual(1); + }); + it('Deletes all files when all selected when "Delete" clicked', function() { + var request; + $('.select-all').click(); + $('.selectedActions .delete-selected').click(); + expect(fakeServer.requests.length).toEqual(1); + request = fakeServer.requests[0]; + expect(request.url).toEqual(OC.webroot + '/index.php/apps/files/ajax/delete.php'); + expect(OC.parseQueryString(request.requestBody)) + .toEqual({'dir': '/subdir', allfiles: 'true'}); + fakeServer.requests[0].respond( + 200, + { 'Content-Type': 'application/json' }, + JSON.stringify({status: 'success'}) + ); + expect(fileList.isEmpty).toEqual(true); + }); + }); + }); + it('resets the file selection on reload', function() { + fileList.$el.find('.select-all').click(); + fileList.reload(); + expect(fileList.$el.find('.select-all').prop('checked')).toEqual(false); + expect(fileList.getSelectedFiles()).toEqual([]); + }); + }); + describe('Sorting files', function() { + it('Sorts by name by default', function() { + fileList.reload(); + expect(fakeServer.requests.length).toEqual(1); + var url = fakeServer.requests[0].url; + var query = OC.parseQueryString(url.substr(url.indexOf('?') + 1)); + expect(query.sort).toEqual('name'); + expect(query.sortdirection).toEqual('asc'); + }); + it('Reloads file list with a different sort when clicking on column header of unsorted column', function() { + fileList.$el.find('.column-size .columntitle').click(); + expect(fakeServer.requests.length).toEqual(1); + var url = fakeServer.requests[0].url; + var query = OC.parseQueryString(url.substr(url.indexOf('?') + 1)); + expect(query.sort).toEqual('size'); + expect(query.sortdirection).toEqual('asc'); + }); + it('Toggles sort direction when clicking on already sorted column', function() { + fileList.$el.find('.column-name .columntitle').click(); + expect(fakeServer.requests.length).toEqual(1); + var url = fakeServer.requests[0].url; + var query = OC.parseQueryString(url.substr(url.indexOf('?') + 1)); + expect(query.sort).toEqual('name'); + expect(query.sortdirection).toEqual('desc'); + }); + it('Toggles the sort indicator when clicking on a column header', function() { + var ASC_CLASS = fileList.SORT_INDICATOR_ASC_CLASS; + var DESC_CLASS = fileList.SORT_INDICATOR_DESC_CLASS; + fileList.$el.find('.column-size .columntitle').click(); + // moves triangle to size column + expect( + fileList.$el.find('.column-name .sort-indicator').hasClass(ASC_CLASS + ' ' + DESC_CLASS) + ).toEqual(false); + expect( + fileList.$el.find('.column-size .sort-indicator').hasClass(ASC_CLASS) + ).toEqual(true); + + // click again on size column, reverses direction + fileList.$el.find('.column-size .columntitle').click(); + expect( + fileList.$el.find('.column-size .sort-indicator').hasClass(DESC_CLASS) + ).toEqual(true); + + // click again on size column, reverses direction + fileList.$el.find('.column-size .columntitle').click(); + expect( + fileList.$el.find('.column-size .sort-indicator').hasClass(ASC_CLASS) + ).toEqual(true); + + // click on mtime column, moves indicator there + fileList.$el.find('.column-mtime .columntitle').click(); + expect( + fileList.$el.find('.column-size .sort-indicator').hasClass(ASC_CLASS + ' ' + DESC_CLASS) + ).toEqual(false); + expect( + fileList.$el.find('.column-mtime .sort-indicator').hasClass(ASC_CLASS) + ).toEqual(true); + }); + it('Uses correct sort comparator when inserting files', function() { + testFiles.sort(OCA.Files.FileList.Comparators.size); + // this will make it reload the testFiles with the correct sorting + fileList.$el.find('.column-size .columntitle').click(); + expect(fakeServer.requests.length).toEqual(1); + fakeServer.requests[0].respond( + 200, + { 'Content-Type': 'application/json' }, + JSON.stringify({ + status: 'success', + data: { + files: testFiles, + permissions: 31 + } + }) + ); + var newFileData = { + id: 999, + type: 'file', + name: 'new file.txt', + mimetype: 'text/plain', + size: 40001, + etag: '999' + }; + fileList.add(newFileData); + expect(fileList.files.length).toEqual(5); + expect(fileList.$fileList.find('tr').length).toEqual(5); + expect(fileList.findFileEl('One.txt').index()).toEqual(0); + expect(fileList.findFileEl('somedir').index()).toEqual(1); + expect(fileList.findFileEl('Two.jpg').index()).toEqual(2); + expect(fileList.findFileEl('new file.txt').index()).toEqual(3); + expect(fileList.findFileEl('Three.pdf').index()).toEqual(4); + }); + it('Uses correct reversed sort comparator when inserting files', function() { + testFiles.sort(OCA.Files.FileList.Comparators.size); + testFiles.reverse(); + // this will make it reload the testFiles with the correct sorting + fileList.$el.find('.column-size .columntitle').click(); + expect(fakeServer.requests.length).toEqual(1); + fakeServer.requests[0].respond( + 200, + { 'Content-Type': 'application/json' }, + JSON.stringify({ + status: 'success', + data: { + files: testFiles, + permissions: 31 + } + }) + ); + // reverse sort + fileList.$el.find('.column-size .columntitle').click(); + fakeServer.requests[1].respond( + 200, + { 'Content-Type': 'application/json' }, + JSON.stringify({ + status: 'success', + data: { + files: testFiles, + permissions: 31 + } + }) + ); + var newFileData = { + id: 999, + type: 'file', + name: 'new file.txt', + mimetype: 'text/plain', + size: 40001, + etag: '999' + }; + fileList.add(newFileData); + expect(fileList.files.length).toEqual(5); + expect(fileList.$fileList.find('tr').length).toEqual(5); + expect(fileList.findFileEl('One.txt').index()).toEqual(4); + expect(fileList.findFileEl('somedir').index()).toEqual(3); + expect(fileList.findFileEl('Two.jpg').index()).toEqual(2); + expect(fileList.findFileEl('new file.txt').index()).toEqual(1); + expect(fileList.findFileEl('Three.pdf').index()).toEqual(0); }); }); }); diff --git a/apps/files/tests/js/filesSpec.js b/apps/files/tests/js/filesSpec.js index 018c8ef0f3cff215a718a9491e9fbad12a47c1b2..4f8d5a29318ee97776c7ef880d9053a0d08e472c 100644 --- a/apps/files/tests/js/filesSpec.js +++ b/apps/files/tests/js/filesSpec.js @@ -19,8 +19,9 @@ * */ -/* global Files */ -describe('Files tests', function() { +describe('OCA.Files.Files tests', function() { + var Files = OCA.Files.Files; + describe('File name validation', function() { it('Validates correct file names', function() { var fileNames = [ @@ -82,4 +83,18 @@ describe('Files tests', function() { } }); }); + describe('getDownloadUrl', function() { + it('returns the ajax download URL when filename and dir specified', function() { + var url = Files.getDownloadUrl('test file.txt', '/subdir'); + expect(url).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=test%20file.txt'); + }); + it('returns the ajax download URL when filename and root dir specific', function() { + var url = Files.getDownloadUrl('test file.txt', '/'); + expect(url).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2F&files=test%20file.txt'); + }); + it('returns the ajax download URL when multiple files specified', function() { + var url = Files.getDownloadUrl(['test file.txt', 'abc.txt'], '/subdir'); + expect(url).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=%5B%22test%20file.txt%22%2C%22abc.txt%22%5D'); + }); + }); }); diff --git a/apps/files/tests/js/filesummarySpec.js b/apps/files/tests/js/filesummarySpec.js new file mode 100644 index 0000000000000000000000000000000000000000..5e39dd1d23282374a7cb396f4cf1655b3ee842f3 --- /dev/null +++ b/apps/files/tests/js/filesummarySpec.js @@ -0,0 +1,88 @@ +/** +* ownCloud +* +* @author Vincent Petry +* @copyright 2014 Vincent Petry +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library 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 AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Affero General Public +* License along with this library. If not, see . +* +*/ + +/* global FileSummary */ +describe('OCA.Files.FileSummary tests', function() { + var FileSummary = OCA.Files.FileSummary; + var $container; + + beforeEach(function() { + $container = $('
').find('tr'); + }); + afterEach(function() { + $container = null; + }); + + it('renders summary as text', function() { + var s = new FileSummary($container); + s.setSummary({ + totalDirs: 5, + totalFiles: 2, + totalSize: 256000 + }); + expect($container.hasClass('hidden')).toEqual(false); + expect($container.find('.info').text()).toEqual('5 folders and 2 files'); + expect($container.find('.filesize').text()).toEqual('250 kB'); + }); + it('hides summary when no files or folders', function() { + var s = new FileSummary($container); + s.setSummary({ + totalDirs: 0, + totalFiles: 0, + totalSize: 0 + }); + expect($container.hasClass('hidden')).toEqual(true); + }); + it('increases summary when adding files', function() { + var s = new FileSummary($container); + s.setSummary({ + totalDirs: 5, + totalFiles: 2, + totalSize: 256000 + }); + s.add({type: 'file', size: 256000}); + s.add({type: 'dir', size: 100}); + s.update(); + expect($container.hasClass('hidden')).toEqual(false); + expect($container.find('.info').text()).toEqual('6 folders and 3 files'); + expect($container.find('.filesize').text()).toEqual('500 kB'); + expect(s.summary.totalDirs).toEqual(6); + expect(s.summary.totalFiles).toEqual(3); + expect(s.summary.totalSize).toEqual(512100); + }); + it('decreases summary when removing files', function() { + var s = new FileSummary($container); + s.setSummary({ + totalDirs: 5, + totalFiles: 2, + totalSize: 256000 + }); + s.remove({type: 'file', size: 128000}); + s.remove({type: 'dir', size: 100}); + s.update(); + expect($container.hasClass('hidden')).toEqual(false); + expect($container.find('.info').text()).toEqual('4 folders and 1 file'); + expect($container.find('.filesize').text()).toEqual('125 kB'); + expect(s.summary.totalDirs).toEqual(4); + expect(s.summary.totalFiles).toEqual(1); + expect(s.summary.totalSize).toEqual(127900); + }); +}); diff --git a/apps/files/triggerupdate.php b/apps/files/triggerupdate.php index a37b9823add43ac72061790d987a9ec7610c8ab8..3f85da9913b04b1cd3d8955a508091d42caf991f 100644 --- a/apps/files/triggerupdate.php +++ b/apps/files/triggerupdate.php @@ -6,7 +6,7 @@ if (OC::$CLI) { if (count($argv) === 2) { $file = $argv[1]; list(, $user) = explode('/', $file); - OCP\JSON::checkUserExists($owner); + OCP\JSON::checkUserExists($user); OC_Util::setupFS($user); $view = new \OC\Files\View(''); /** diff --git a/apps/files_encryption/ajax/adminrecovery.php b/apps/files_encryption/ajax/adminrecovery.php index 61e43acc2c33141401c53df32649988705242727..303ba0e16e12dd9b71aa49ee163e8aaa99f0ddad 100644 --- a/apps/files_encryption/ajax/adminrecovery.php +++ b/apps/files_encryption/ajax/adminrecovery.php @@ -5,7 +5,7 @@ * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. * - * @brief Script to handle admin settings for encrypted key recovery + * Script to handle admin settings for encrypted key recovery */ use OCA\Encryption; diff --git a/apps/files_encryption/ajax/changeRecoveryPassword.php b/apps/files_encryption/ajax/changeRecoveryPassword.php index 945f054ea844832c41de2ef90c9fe6e9b1535f91..0cb010d3b566be84dd1d9fae6a03b0786aef6587 100644 --- a/apps/files_encryption/ajax/changeRecoveryPassword.php +++ b/apps/files_encryption/ajax/changeRecoveryPassword.php @@ -5,7 +5,7 @@ * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. * - * @brief Script to change recovery key password + * Script to change recovery key password * */ @@ -23,7 +23,7 @@ $oldPassword = $_POST['oldPassword']; $newPassword = $_POST['newPassword']; $view = new \OC\Files\View('/'); -$util = new \OCA\Encryption\Util(new \OC_FilesystemView('/'), \OCP\User::getUser()); +$util = new \OCA\Encryption\Util(new \OC\Files\View('/'), \OCP\User::getUser()); $proxyStatus = \OC_FileProxy::$enabled; \OC_FileProxy::$enabled = false; diff --git a/apps/files_encryption/ajax/getMigrationStatus.php b/apps/files_encryption/ajax/getMigrationStatus.php index 7c9e0dcc51c51d7ecc54bfda8879b806da44be09..adceb949044efafab7fb346775924c841d9168f7 100644 --- a/apps/files_encryption/ajax/getMigrationStatus.php +++ b/apps/files_encryption/ajax/getMigrationStatus.php @@ -4,7 +4,7 @@ * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. * - * @brief check migration status + * check migration status */ use OCA\Encryption\Util; @@ -18,7 +18,7 @@ $migrationStatus = Util::MIGRATION_COMPLETED; if ($loginname !== '' && $password !== '') { $username = \OCP\User::checkPassword($loginname, $password); if ($username) { - $util = new Util(new \OC_FilesystemView('/'), $username); + $util = new Util(new \OC\Files\View('/'), $username); $migrationStatus = $util->getMigrationStatus(); } } diff --git a/apps/files_encryption/ajax/updatePrivateKeyPassword.php b/apps/files_encryption/ajax/updatePrivateKeyPassword.php index 29c72952ae9de4457cc5d63340c4caef9658615f..f7d20c486cf41f200652b1e4fbfe5abae81ce0a9 100644 --- a/apps/files_encryption/ajax/updatePrivateKeyPassword.php +++ b/apps/files_encryption/ajax/updatePrivateKeyPassword.php @@ -5,7 +5,7 @@ * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. * - * @brief Script to change recovery key password + * Script to change recovery key password * */ diff --git a/apps/files_encryption/ajax/userrecovery.php b/apps/files_encryption/ajax/userrecovery.php index d6c94bde81e5501981f13a084982d00b7932c515..0f3b973d69ab8be1938a0fcff07833f957b22b35 100644 --- a/apps/files_encryption/ajax/userrecovery.php +++ b/apps/files_encryption/ajax/userrecovery.php @@ -4,7 +4,7 @@ * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. * - * @brief Script to handle admin settings for encrypted key recovery + * Script to handle admin settings for encrypted key recovery */ use OCA\Encryption; @@ -19,7 +19,7 @@ if ( ) { $userId = \OCP\USER::getUser(); - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); $util = new \OCA\Encryption\Util($view, $userId); // Save recovery preference to DB diff --git a/apps/files_encryption/appinfo/app.php b/apps/files_encryption/appinfo/app.php index 21de421c1956efebd98a391bbf3db4dd6cc36aba..104e8568caa62f022f865f36b3e6bca25d749904 100644 --- a/apps/files_encryption/appinfo/app.php +++ b/apps/files_encryption/appinfo/app.php @@ -40,7 +40,7 @@ if (!OC_Config::getValue('maintenance', false)) { \OC_Util::setupFS(); } - $view = new OC_FilesystemView('/'); + $view = new OC\Files\View('/'); $sessionReady = OCA\Encryption\Helper::checkRequirements(); if($sessionReady) { diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php index 5f0494e62ca38361e2b0b39c42b2218fef5b5536..c1ccb927df582224fe9fa92e94c75b68b7b3ca5f 100644 --- a/apps/files_encryption/hooks/hooks.php +++ b/apps/files_encryption/hooks/hooks.php @@ -36,7 +36,7 @@ class Hooks { private static $deleteFiles = array(); /** - * @brief Startup encryption backend upon user login + * Startup encryption backend upon user login * @note This method should never be called for users using client side encryption */ public static function login($params) { @@ -48,7 +48,7 @@ class Hooks { $l = new \OC_L10N('files_encryption'); - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); // ensure filesystem is loaded if(!\OC\Files\Filesystem::$loaded) { @@ -93,7 +93,7 @@ class Hooks { // If migration not yet done if ($ready) { - $userView = new \OC_FilesystemView('/' . $params['uid']); + $userView = new \OC\Files\View('/' . $params['uid']); // Set legacy encryption key if it exists, to support // depreciated encryption system @@ -136,26 +136,26 @@ class Hooks { } /** - * @brief setup encryption backend upon user created + * setup encryption backend upon user created * @note This method should never be called for users using client side encryption */ public static function postCreateUser($params) { if (\OCP\App::isEnabled('files_encryption')) { - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); $util = new Util($view, $params['uid']); Helper::setupUser($util, $params['password']); } } /** - * @brief cleanup encryption backend upon user deleted + * cleanup encryption backend upon user deleted * @note This method should never be called for users using client side encryption */ public static function postDeleteUser($params) { if (\OCP\App::isEnabled('files_encryption')) { - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); // cleanup public key $publicKey = '/public-keys/' . $params['uid'] . '.public.key'; @@ -171,7 +171,7 @@ class Hooks { } /** - * @brief If the password can't be changed within ownCloud, than update the key password in advance. + * If the password can't be changed within ownCloud, than update the key password in advance. */ public static function preSetPassphrase($params) { if (\OCP\App::isEnabled('files_encryption')) { @@ -182,7 +182,7 @@ class Hooks { } /** - * @brief Change a user's encryption passphrase + * Change a user's encryption passphrase * @param array $params keys: uid, password */ public static function setPassphrase($params) { @@ -196,7 +196,7 @@ class Hooks { // the necessary keys) if (Crypt::mode() === 'server') { - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); if ($params['uid'] === \OCP\User::getUser()) { @@ -259,10 +259,10 @@ class Hooks { } /* - * @brief check if files can be encrypted to every user. + * check if files can be encrypted to every user. */ /** - * @param $params + * @param array $params */ public static function preShared($params) { @@ -308,7 +308,7 @@ class Hooks { if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); $session = new \OCA\Encryption\Session($view); $userId = \OCP\User::getUser(); $util = new Util($view, $userId); @@ -350,7 +350,7 @@ class Hooks { if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); $userId = \OCP\User::getUser(); $util = new Util($view, $userId); $path = \OC\Files\Filesystem::getPath($params['fileSource']); @@ -398,12 +398,12 @@ class Hooks { } /** - * @brief mark file as renamed so that we know the original source after the file was renamed + * mark file as renamed so that we know the original source after the file was renamed * @param array $params with the old path and the new path */ public static function preRename($params) { $user = \OCP\User::getUser(); - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); $util = new Util($view, $user); list($ownerOld, $pathOld) = $util->getUidAndFilename($params['oldpath']); @@ -421,8 +421,8 @@ class Hooks { } /** - * @brief after a file is renamed, rename its keyfile and share-keys also fix the file size and fix also the sharing - * @param array with oldpath and newpath + * after a file is renamed, rename its keyfile and share-keys also fix the file size and fix also the sharing + * @param array $params array with oldpath and newpath * * This function is connected to the rename signal of OC_Filesystem and adjust the name and location * of the stored versions along the actual file @@ -437,7 +437,7 @@ class Hooks { $proxyStatus = \OC_FileProxy::$enabled; \OC_FileProxy::$enabled = false; - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); $session = new \OCA\Encryption\Session($view); $userId = \OCP\User::getUser(); $util = new Util($view, $userId); @@ -557,7 +557,7 @@ class Hooks { } /** - * @brief if the file was really deleted we remove the encryption keys + * if the file was really deleted we remove the encryption keys * @param array $params * @return boolean|null */ @@ -597,7 +597,7 @@ class Hooks { } /** - * @brief remember the file which should be deleted and it's owner + * remember the file which should be deleted and it's owner * @param array $params * @return boolean|null */ @@ -610,7 +610,7 @@ class Hooks { return true; } - $util = new Util(new \OC_FilesystemView('/'), \OCP\USER::getUser()); + $util = new Util(new \OC\Files\View('/'), \OCP\USER::getUser()); list($owner, $ownerPath) = $util->getUidAndFilename($path); self::$deleteFiles[$params[\OC\Files\Filesystem::signal_param_path]] = array( diff --git a/apps/files_encryption/l10n/ast.php b/apps/files_encryption/l10n/ast.php index 7e08e073095487247c93f3b6da960ee610c49b57..8b51ec775db5521af73d9795ed614c4f9a42b510 100644 --- a/apps/files_encryption/l10n/ast.php +++ b/apps/files_encryption/l10n/ast.php @@ -1,13 +1,44 @@ "Contraseña camudada esitosamente.", -"Could not change the password. Maybe the old password was not correct." => "Nun pue camudase la contraseña. Quiciabes la contraseña vieya nun fore correuta.", -"personal settings" => "axustes personales", +"Recovery key successfully enabled" => "Habilitóse la recuperación de ficheros", +"Could not enable recovery key. Please check your recovery key password!" => "Nun pudo habilitase la clave de recuperación. Por favor comprueba la contraseña.", +"Recovery key successfully disabled" => "Clave de recuperación deshabilitada", +"Could not disable recovery key. Please check your recovery key password!" => "Nun pudo deshabilitase la clave de recuperación. Por favor comprueba la contraseña!", +"Password successfully changed." => "Camudóse la contraseña", +"Could not change the password. Maybe the old password was not correct." => "Nun pudo camudase la contraseña. Comprueba que la contraseña actual seya correuta.", +"Private key password successfully updated." => "Contraseña de clave privada anovada correchamente.", +"Could not update the private key password. Maybe the old password was not correct." => "Nun pudo camudase la contraseña. Pue que la contraseña antigua nun seya correuta.", +"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "¡L'aplicación de cifráu nun s'anició! Seique se restableciera mentanto la sesión. Por favor intenta zarrar la sesión y volver a aniciala p'aniciar l'aplicación de cifráu.", +"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "¡La clave privada nun ye válida! Seique la contraseña se camudase dende fuera de %s (Ex:El to direutoriu corporativu). Pues anovar la contraseña de la clave privada nes tos opciones personales pa recuperar l'accesu a los ficheros.", +"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Nun pudo descifrase esti ficheru, dablemente seya un ficheru compartíu. Solicita al propietariu del mesmu que vuelva a compartilu contigo.", +"Unknown error please check your system settings or contact your administrator" => "Fallu desconocíu. Verifica la configuración del sistema o ponte en contautu col alministrador", +"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úrate de que PHP 5.3.3 o postreru ta instaláu y que la estensión OpenSSL de PHP ta habilitada y configurada correutamente. Pel momentu, l'aplicación de cifráu deshabilitóse.", +"Following users are not set up for encryption:" => "Los siguientes usuarios nun se configuraron pal cifráu:", +"Initial encryption started... This can take some time. Please wait." => "Cifráu aniciáu..... Esto pue llevar un tiempu. Por favor espera.", +"Initial encryption running... Please try again later." => "Cifráu inicial en cursu... Inténtalo dempués.", +"Go directly to your " => "Dir direutamente a", +"personal settings" => "opciones personales", "Encryption" => "Cifráu", -"Enabled" => "Habilitáu", +"Enable recovery key (allow to recover users files in case of password loss):" => "Habilitar la clave de recuperación (permite recuperar los ficheros del usuariu en casu de perda de la contraseña);", +"Recovery key password" => "Contraseña de clave de recuperación", +"Repeat Recovery key password" => "Repeti la contraseña de clave de recuperación", +"Enabled" => "Habilitar", "Disabled" => "Deshabilitáu", -"Change Password" => "Camudar conseña", -" If you don't remember your old password you can ask your administrator to recover your files." => "Si nun recuerdes la to contraseña vieya pues entrugar al to alministrador pa recuperar los tos ficheros.", -"Could not update file recovery" => "Nun pue anovase'l ficheru de recuperación" +"Change recovery key password:" => "Camudar la contraseña de la clave de recuperación", +"Old Recovery key password" => "Clave de recuperación vieya", +"New Recovery key password" => "Clave de recuperación nueva", +"Repeat New Recovery key password" => "Repetir la clave de recuperación nueva", +"Change Password" => "Camudar contraseña", +"Your private key password no longer match your log-in password:" => "La to contraseña de clave privada yá nun concasa cola contraseña d'accesu:", +"Set your old private key password to your current log-in password." => "Afitar la contraseña de la to clave privada vieya a la to contraseña actual d'accesu.", +" If you don't remember your old password you can ask your administrator to recover your files." => "Si nun recuerdes la contraseña vieya, pues pidir a alministrador que te recupere los ficheros.", +"Old log-in password" => "Contraseña d'accesu vieya", +"Current log-in password" => "Contraseña d'accesu actual", +"Update Private Key Password" => "Anovar Contraseña de Clave Privada", +"Enable password recovery:" => "Habilitar la recuperación de contraseña:", +"Enabling this option will allow you to reobtain access to your encrypted files in case of password loss" => "Habilitar esta opción va permitite volver a tener accesu a los ficheros cifraos en casu de perda de contraseña", +"File recovery settings updated" => "Opciones de recuperación de ficheros anovada", +"Could not update file recovery" => "Nun pudo anovase la recuperación de ficheros" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_encryption/l10n/fa.php b/apps/files_encryption/l10n/fa.php index 3f8d631e1067a885bceb3ab039c04eb5decae9b6..420fd7423f8448b09f356a505341b778963bb1be 100644 --- a/apps/files_encryption/l10n/fa.php +++ b/apps/files_encryption/l10n/fa.php @@ -9,6 +9,7 @@ $TRANSLATIONS = array( "Private key password successfully updated." => "رمزعبور کلید خصوصی با موفقیت به روز شد.", "Could not update the private key password. Maybe the old password was not correct." => "رمزعبور کلید خصوصی را نمی تواند به روز کند. شاید رمزعبور قدیمی صحیح نمی باشد.", "Missing requirements." => "نیازمندی های گمشده", +"Following users are not set up for encryption:" => "کاربران زیر برای رمزنگاری تنظیم نشده اند", "personal settings" => "تنظیمات شخصی", "Encryption" => "رمزگذاری", "Enable recovery key (allow to recover users files in case of password loss):" => "فعال کردن کلید بازیابی(اجازه بازیابی فایل های کاربران در صورت از دست دادن رمزعبور):", diff --git a/apps/files_encryption/l10n/pt_PT.php b/apps/files_encryption/l10n/pt_PT.php index 9a1963953e3427e2b07dd7c6afb60b19c11c9bc0..409f1917a4794033fb1f017962cbd9a9339dbaec 100644 --- a/apps/files_encryption/l10n/pt_PT.php +++ b/apps/files_encryption/l10n/pt_PT.php @@ -10,17 +10,21 @@ $TRANSLATIONS = array( "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Não foi possível desencriptar este ficheiro, possivelmente é um ficheiro partilhado. Peça ao proprietário do ficheiro para voltar a partilhar o ficheiro consigo.", "Unknown error please check your system settings or contact your administrator" => "Erro desconhecido. Verifique por favor as definições do sistema ou contacte o seu administrador", "Missing requirements." => "Faltam alguns requisitos.", +"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, certifique-se que PHP 5.3.3 ou mais recente está instalado e que OpenSSL juntamente com a extensão PHP está ativada e corretamente configurada. Por agora, a aplicação de encriptação está desactivada.", "Following users are not set up for encryption:" => "Os utilizadores seguintes não estão marcados para cifragem:", +"Initial encryption started... This can take some time. Please wait." => "A encriptação inicial começou... Pode demorar algum tempo. Aguarde, por favor.", "Go directly to your " => "Ir directamente para o seu", "personal settings" => "configurações personalizadas ", "Encryption" => "Encriptação", "Enable recovery key (allow to recover users files in case of password loss):" => "Active a chave de recuperação (permite recuperar os ficheiros no caso de perda da password):", "Recovery key password" => "Chave de recuperação da conta", +"Repeat Recovery key password" => "Repetir a chave de recuperação da conta", "Enabled" => "Activado", "Disabled" => "Desactivado", "Change recovery key password:" => "Alterar a chave de recuperação:", "Old Recovery key password" => "Chave anterior de recuperação da conta", "New Recovery key password" => "Nova chave de recuperação da conta", +"Repeat New Recovery key password" => "Repetir a nova chave de recuperação da conta", "Change Password" => "Mudar a Password", "Old log-in password" => "Password anterior da conta", "Current log-in password" => "Password actual da conta", diff --git a/apps/files_encryption/l10n/tr.php b/apps/files_encryption/l10n/tr.php index 85e35f5dddf93ad177c59f3132ac8d0899913d42..ba87330c480e5490a58676d80906b20d343391cb 100644 --- a/apps/files_encryption/l10n/tr.php +++ b/apps/files_encryption/l10n/tr.php @@ -9,7 +9,7 @@ $TRANSLATIONS = array( "Private key password successfully updated." => "Gizli anahtar parolası başarıyla güncellendi", "Could not update the private key password. Maybe the old password was not correct." => "Gizli anahtar parolası güncellenemedi. Eski parola hatalı olabilir.", "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Şifreleme uygulaması başlatılamadı! Oturumunuz sırasında şifreleme uygulaması tekrar etkinleştirilmiş olabilir. Lütfen şifreleme uygulamasını başlatmak için oturumu kapatıp yeniden oturum açmayı deneyin.", -"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Gizli anahtarınız geçerli değil! Muhtemelen parolanız ownCloud sistemi %s dışarısında değiştirildi (örn. şirket dizininde). Gizli anahtar parolanızı kişisel ayarlarınızda güncelleyerek şifreli dosyalarınıza erişimi kurtarabilirsiniz.", +"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Gizli anahtarınız geçerli değil! Muhtemelen parolanız %s dışarısında değiştirildi (örn. şirket dizininde). Gizli anahtar parolanızı kişisel ayarlarınızda güncelleyerek şifreli dosyalarınıza erişimi kurtarabilirsiniz.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Bu dosya muhtemelen bir paylaşılan dosya olduğundan şifresi çözülemiyor. Lütfen dosyayı sizinle bir daha paylaşması için dosya sahibi ile iletişime geçin.", "Unknown error please check your system settings or contact your administrator" => "Bilinmeyen hata. Lütfen sistem ayarlarınızı denetleyin veya yöneticiniz ile iletişime geçin", "Missing requirements." => "Gereklilikler eksik.", diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php index a4f7bd35497543c000c43358b0118a6c482ef6e6..ec7b3bc92e47c20994769c97804cb4232a9914dc 100755 --- a/apps/files_encryption/lib/crypt.php +++ b/apps/files_encryption/lib/crypt.php @@ -40,7 +40,7 @@ class Crypt { /** - * @brief return encryption mode client or server side encryption + * return encryption mode client or server side encryption * @param string $user name (use system wide setting if name=null) * @return string 'client' or 'server' */ @@ -51,7 +51,7 @@ class Crypt { } /** - * @brief Create a new encryption keypair + * Create a new encryption keypair * @return array publicKey, privatekey */ public static function createKeypair() { @@ -85,7 +85,7 @@ class Crypt { } /** - * @brief Add arbitrary padding to encrypted data + * Add arbitrary padding to encrypted data * @param string $data data to be padded * @return string padded data * @note In order to end up with data exactly 8192 bytes long we must @@ -102,7 +102,7 @@ class Crypt { } /** - * @brief Remove arbitrary padding to encrypted data + * Remove arbitrary padding to encrypted data * @param string $padded padded data to remove padding from * @return string unpadded data on success, false on error */ @@ -124,8 +124,8 @@ class Crypt { } /** - * @brief Check if a file's contents contains an IV and is symmetrically encrypted - * @param $content + * Check if a file's contents contains an IV and is symmetrically encrypted + * @param string $content * @return boolean * @note see also OCA\Encryption\Util->isEncryptedPath() */ @@ -178,11 +178,10 @@ class Crypt { } /** - * @brief Check if a file is encrypted via legacy system - * @param $data + * Check if a file is encrypted via legacy system + * @param boolean $isCatFileContent * @param string $relPath The path of the file, relative to user/data; * e.g. filename or /Docs/filename, NOT admin/files/filename - * @param boolean $isCatFileContent * @return boolean */ public static function isLegacyEncryptedContent($isCatFileContent, $relPath) { @@ -209,7 +208,7 @@ class Crypt { } /** - * @brief Symmetrically encrypt a string + * Symmetrically encrypt a string * @param string $plainContent * @param string $iv * @param string $passphrase @@ -229,7 +228,7 @@ class Crypt { } /** - * @brief Symmetrically decrypt a string + * Symmetrically decrypt a string * @param string $encryptedContent * @param string $iv * @param string $passphrase @@ -251,10 +250,10 @@ class Crypt { } /** - * @brief Concatenate encrypted data with its IV and padding + * Concatenate encrypted data with its IV and padding * @param string $content content to be concatenated * @param string $iv IV to be concatenated - * @returns string concatenated content + * @return string concatenated content */ private static function concatIv($content, $iv) { @@ -265,9 +264,9 @@ class Crypt { } /** - * @brief Split concatenated data and IV into respective parts + * Split concatenated data and IV into respective parts * @param string $catFile concatenated data to be split - * @returns array keys: encrypted, iv + * @return array keys: encrypted, iv */ private static function splitIv($catFile) { @@ -290,7 +289,7 @@ class Crypt { } /** - * @brief Symmetrically encrypts a string and returns keyfile content + * Symmetrically encrypts a string and returns keyfile content * @param string $plainContent content to be encrypted in keyfile * @param string $passphrase * @return false|string encrypted content combined with IV @@ -322,15 +321,15 @@ class Crypt { /** - * @brief Symmetrically decrypts keyfile content - * @param $keyfileContent + * Symmetrically decrypts keyfile content + * @param string $keyfileContent * @param string $passphrase * @throws \Exception * @return string|false * @internal param string $source * @internal param string $target * @internal param string $key the decryption key - * @returns string decrypted content + * @return string decrypted content * * This function decrypts a file */ @@ -359,10 +358,10 @@ class Crypt { } /** - * @brief Decrypt private key and check if the result is a valid keyfile + * Decrypt private key and check if the result is a valid keyfile * @param string $encryptedKey encrypted keyfile * @param string $passphrase to decrypt keyfile - * @returns encrypted private key or false + * @return string|false encrypted private key or false * * This function decrypts a file */ @@ -386,10 +385,10 @@ class Crypt { } /** - * @brief Create asymmetrically encrypted keyfile content using a generated key + * Create asymmetrically encrypted keyfile content using a generated key * @param string $plainContent content to be encrypted * @param array $publicKeys array keys must be the userId of corresponding user - * @returns array keys: keys (array, key = userId), data + * @return array keys: keys (array, key = userId), data * @note symmetricDecryptFileContent() can decrypt files created using this method */ public static function multiKeyEncrypt($plainContent, array $publicKeys) { @@ -434,13 +433,13 @@ class Crypt { } /** - * @brief Asymmetrically encrypt a file using multiple public keys - * @param $encryptedContent - * @param $shareKey - * @param $privateKey + * Asymmetrically encrypt a file using multiple public keys + * @param string $encryptedContent + * @param string $shareKey + * @param mixed $privateKey * @return false|string * @internal param string $plainContent content to be encrypted - * @returns string $plainContent decrypted string + * @return string $plainContent decrypted string * @note symmetricDecryptFileContent() can be used to decrypt files created using this method * * This function decrypts a file @@ -468,7 +467,7 @@ class Crypt { } /** - * @brief Generates a pseudo random initialisation vector + * Generates a pseudo random initialisation vector * @return String $iv generated IV */ private static function generateIv() { @@ -497,8 +496,8 @@ class Crypt { } /** - * @brief Generate a pseudo random 256-bit ASCII key, used as file key - * @returns $key Generated key + * Generate a pseudo random 256-bit ASCII key, used as file key + * @return string|false Generated key */ public static function generateKey() { @@ -523,8 +522,8 @@ class Crypt { } /** - * @brief Get the blowfish encryption handler for a key - * @param $key string (optional) + * Get the blowfish encryption handler for a key + * @param string $key (optional) * @return \Crypt_Blowfish blowfish object * * if the key is left out, the default handler will be used @@ -544,7 +543,7 @@ class Crypt { } /** - * @brief decrypts content using legacy blowfish system + * decrypts content using legacy blowfish system * @param string $content the cleartext message you want to decrypt * @param string $passphrase * @return string cleartext content @@ -561,7 +560,7 @@ class Crypt { } /** - * @param $data + * @param string $data * @param string $key * @param int $maxLength * @return string diff --git a/apps/files_encryption/lib/helper.php b/apps/files_encryption/lib/helper.php index 8cbbe8a45a6ef62f638a675414d392f486887ba4..564e97e0592765dcea1878b25dd45e6b66d65837 100755 --- a/apps/files_encryption/lib/helper.php +++ b/apps/files_encryption/lib/helper.php @@ -24,7 +24,7 @@ namespace OCA\Encryption; /** - * @brief Class to manage registration of hooks an various helper methods + * Class to manage registration of hooks an various helper methods * @package OCA\Encryption */ class Helper { @@ -32,7 +32,7 @@ class Helper { private static $tmpFileMapping; // Map tmp files to files in data/user/files /** - * @brief register share related hooks + * register share related hooks * */ public static function registerShareHooks() { @@ -43,7 +43,7 @@ class Helper { } /** - * @brief register user related hooks + * register user related hooks * */ public static function registerUserHooks() { @@ -56,7 +56,7 @@ class Helper { } /** - * @brief register filesystem related hooks + * register filesystem related hooks * */ public static function registerFilesystemHooks() { @@ -68,7 +68,7 @@ class Helper { } /** - * @brief register app management related hooks + * register app management related hooks * */ public static function registerAppHooks() { @@ -78,7 +78,7 @@ class Helper { } /** - * @brief setup user for files_encryption + * setup user for files_encryption * * @param Util $util * @param string $password @@ -100,9 +100,9 @@ class Helper { } /** - * @brief enable recovery + * enable recovery * - * @param $recoveryKeyId + * @param string $recoveryKeyId * @param string $recoveryPassword * @internal param \OCA\Encryption\Util $util * @internal param string $password @@ -153,7 +153,7 @@ class Helper { $return = true; } else { // get recovery key and check the password - $util = new \OCA\Encryption\Util(new \OC_FilesystemView('/'), \OCP\User::getUser()); + $util = new \OCA\Encryption\Util(new \OC\Files\View('/'), \OCP\User::getUser()); $return = $util->checkRecoveryPassword($recoveryPassword); if ($return) { $appConfig->setValue('files_encryption', 'recoveryAdminEnabled', 1); @@ -164,7 +164,7 @@ class Helper { } /** - * @brief Check if a path is a .part file + * Check if a path is a .part file * @param string $path Path that may identify a .part file * @return bool */ @@ -181,7 +181,7 @@ class Helper { /** - * @brief Remove .path extension from a file path + * Remove .path extension from a file path * @param string $path Path that may identify a .part file * @return string File path without .part extension * @note this is needed for reusing keys @@ -208,13 +208,13 @@ class Helper { } /** - * @brief disable recovery + * disable recovery * * @param string $recoveryPassword * @return bool */ public static function adminDisableRecovery($recoveryPassword) { - $util = new Util(new \OC_FilesystemView('/'), \OCP\User::getUser()); + $util = new Util(new \OC\Files\View('/'), \OCP\User::getUser()); $return = $util->checkRecoveryPassword($recoveryPassword); if ($return) { @@ -227,7 +227,7 @@ class Helper { /** - * @brief checks if access is public/anonymous user + * checks if access is public/anonymous user * @return bool */ public static function isPublicAccess() { @@ -239,7 +239,7 @@ class Helper { } /** - * @brief Format a path to be relative to the /user/files/ directory + * Format a path to be relative to the /user/files/ directory * @param string $path the absolute path * @return string e.g. turns '/admin/files/test.txt' into 'test.txt' */ @@ -259,7 +259,7 @@ class Helper { } /** - * @brief try to get the user from the path if no user is logged in + * try to get the user from the path if no user is logged in * @param string $path * @return mixed user or false if we couldn't determine a user */ @@ -294,7 +294,7 @@ class Helper { } /** - * @brief get path to the corresponding file in data/user/files if path points + * get path to the corresponding file in data/user/files if path points * to a version or to a file in cache * @param string $path path to a version or a file in the trash * @return string path to corresponding file relative to data/user/files @@ -327,12 +327,12 @@ class Helper { } /** - * @brief create directory recursively + * create directory recursively * @param string $path * @param \OC\Files\View $view */ public static function mkdirr($path, $view) { - $dirname = \OC_Filesystem::normalizePath(dirname($path)); + $dirname = \OC\Files\Filesystem::normalizePath(dirname($path)); $dirParts = explode('/', $dirname); $dir = ""; foreach ($dirParts as $part) { @@ -344,7 +344,7 @@ class Helper { } /** - * @brief redirect to a error page + * redirect to a error page * @param Session $session */ public static function redirectToErrorPage($session, $errorCode = null) { @@ -428,7 +428,7 @@ class Helper { } /** - * @brief glob uses different pattern than regular expressions, escape glob pattern only + * glob uses different pattern than regular expressions, escape glob pattern only * @param string $path unescaped path * @return string path */ @@ -437,7 +437,7 @@ class Helper { } /** - * @brief remember from which file the tmp file (getLocalFile() call) was created + * remember from which file the tmp file (getLocalFile() call) was created * @param string $tmpFile path of tmp file * @param string $originalFile path of the original file relative to data/ */ @@ -446,7 +446,7 @@ class Helper { } /** - * @brief get the path of the original file + * get the path of the original file * @param string $tmpFile path of the tmp file * @return string|false path of the original file or false */ diff --git a/apps/files_encryption/lib/keymanager.php b/apps/files_encryption/lib/keymanager.php index cb9f5e64af37aa3e54f64a0b18ddfa959a61fbc9..3c51c5efba20759d6ceab8fbb157528aedbc2d81 100755 --- a/apps/files_encryption/lib/keymanager.php +++ b/apps/files_encryption/lib/keymanager.php @@ -24,20 +24,20 @@ namespace OCA\Encryption; /** - * @brief Class to manage storage and retrieval of encryption keys + * Class to manage storage and retrieval of encryption keys * @note Where a method requires a view object, it's root must be '/' */ class Keymanager { /** - * @brief retrieve the ENCRYPTED private key from a user + * retrieve the ENCRYPTED private key from a user * - * @param \OC_FilesystemView $view + * @param \OC\Files\View $view * @param string $user * @return string private key or false (hopefully) * @note the key returned by this method must be decrypted before use */ - public static function getPrivateKey(\OC_FilesystemView $view, $user) { + public static function getPrivateKey(\OC\Files\View $view, $user) { $path = '/' . $user . '/' . 'files_encryption' . '/' . $user . '.private.key'; $key = false; @@ -55,12 +55,12 @@ class Keymanager { } /** - * @brief retrieve public key for a specified user - * @param \OC_FilesystemView $view - * @param $userId + * retrieve public key for a specified user + * @param \OC\Files\View $view + * @param string $userId * @return string public key or false */ - public static function getPublicKey(\OC_FilesystemView $view, $userId) { + public static function getPublicKey(\OC\Files\View $view, $userId) { $proxyStatus = \OC_FileProxy::$enabled; \OC_FileProxy::$enabled = false; @@ -74,12 +74,12 @@ class Keymanager { } /** - * @brief Retrieve a user's public and private key - * @param \OC_FilesystemView $view - * @param $userId + * Retrieve a user's public and private key + * @param \OC\Files\View $view + * @param string $userId * @return array keys: privateKey, publicKey */ - public static function getUserKeys(\OC_FilesystemView $view, $userId) { + public static function getUserKeys(\OC\Files\View $view, $userId) { return array( 'publicKey' => self::getPublicKey($view, $userId), @@ -89,12 +89,12 @@ class Keymanager { } /** - * @brief Retrieve public keys for given users - * @param \OC_FilesystemView $view + * Retrieve public keys for given users + * @param \OC\Files\View $view * @param array $userIds * @return array of public keys for the specified users */ - public static function getPublicKeys(\OC_FilesystemView $view, array $userIds) { + public static function getPublicKeys(\OC\Files\View $view, array $userIds) { $keys = array(); @@ -109,9 +109,9 @@ class Keymanager { } /** - * @brief store file encryption key + * store file encryption key * - * @param \OC_FilesystemView $view + * @param \OC\Files\View $view * @param \OCA\Encryption\Util $util * @param string $path relative path of the file, including filename * @param string $catfile keyfile content @@ -119,7 +119,7 @@ class Keymanager { * @note The keyfile is not encrypted here. Client code must * asymmetrically encrypt the keyfile before passing it to this method */ - public static function setFileKey(\OC_FilesystemView $view, $util, $path, $catfile) { + public static function setFileKey(\OC\Files\View $view, $util, $path, $catfile) { $proxyStatus = \OC_FileProxy::$enabled; \OC_FileProxy::$enabled = false; @@ -167,8 +167,8 @@ class Keymanager { } /** - * @brief retrieve keyfile for an encrypted file - * @param \OC_FilesystemView $view + * retrieve keyfile for an encrypted file + * @param \OC\Files\View $view * @param \OCA\Encryption\Util $util * @param string|false $filePath * @internal param \OCA\Encryption\file $string name @@ -210,9 +210,9 @@ class Keymanager { } /** - * @brief Delete a keyfile + * Delete a keyfile * - * @param \OC_FilesystemView $view + * @param \OC\Files\View $view * @param string $path path of the file the key belongs to * @param string $userId the user to whom the file belongs * @return bool Outcome of unlink operation @@ -266,7 +266,7 @@ class Keymanager { } /** - * @brief store private key from the user + * store private key from the user * @param string $key * @return bool * @note Encryption of the private key must be performed by client code @@ -276,7 +276,7 @@ class Keymanager { $user = \OCP\User::getUser(); - $view = new \OC_FilesystemView('/' . $user . '/files_encryption'); + $view = new \OC\Files\View('/' . $user . '/files_encryption'); $proxyStatus = \OC_FileProxy::$enabled; \OC_FileProxy::$enabled = false; @@ -293,16 +293,16 @@ class Keymanager { } /** - * @brief store share key + * store share key * - * @param \OC_FilesystemView $view + * @param \OC\Files\View $view * @param string $path where the share key is stored - * @param $shareKey + * @param string $shareKey * @return bool true/false * @note The keyfile is not encrypted here. Client code must * asymmetrically encrypt the keyfile before passing it to this method */ - private static function setShareKey(\OC_FilesystemView $view, $path, $shareKey) { + private static function setShareKey(\OC\Files\View $view, $path, $shareKey) { $proxyStatus = \OC_FileProxy::$enabled; \OC_FileProxy::$enabled = false; @@ -319,14 +319,14 @@ class Keymanager { } /** - * @brief store multiple share keys for a single file - * @param \OC_FilesystemView $view + * store multiple share keys for a single file + * @param \OC\Files\View $view * @param \OCA\Encryption\Util $util * @param string $path * @param array $shareKeys * @return bool */ - public static function setShareKeys(\OC_FilesystemView $view, $util, $path, array $shareKeys) { + public static function setShareKeys(\OC\Files\View $view, $util, $path, array $shareKeys) { // $shareKeys must be an array with the following format: // [userId] => [encrypted key] @@ -365,8 +365,8 @@ class Keymanager { } /** - * @brief retrieve shareKey for an encrypted file - * @param \OC_FilesystemView $view + * retrieve shareKey for an encrypted file + * @param \OC\Files\View $view * @param string $userId * @param \OCA\Encryption\Util $util * @param string $filePath @@ -374,7 +374,7 @@ class Keymanager { * @note The sharekey returned is encrypted. Decryption * of the keyfile must be performed by client code */ - public static function getShareKey(\OC_FilesystemView $view, $userId, $util, $filePath) { + public static function getShareKey(\OC\Files\View $view, $userId, $util, $filePath) { // try reusing key file if part file $proxyStatus = \OC_FileProxy::$enabled; @@ -406,8 +406,8 @@ class Keymanager { } /** - * @brief delete all share keys of a given file - * @param \OC_FilesystemView $view + * delete all share keys of a given file + * @param \OC\Files\View $view * @param string $userId owner of the file * @param string $filePath path to the file, relative to the owners file dir */ @@ -445,9 +445,9 @@ class Keymanager { } /** - * @brief Delete a single user's shareKey for a single file + * Delete a single user's shareKey for a single file */ - public static function delShareKey(\OC_FilesystemView $view, $userIds, $filePath) { + public static function delShareKey(\OC\Files\View $view, $userIds, $filePath) { $proxyStatus = \OC_FileProxy::$enabled; \OC_FileProxy::$enabled = false; @@ -486,7 +486,7 @@ class Keymanager { } /** - * @brief recursively delete share keys from given users + * recursively delete share keys from given users * * @param string $dir directory * @param array $userIds user ids for which the share keys should be deleted @@ -512,11 +512,11 @@ class Keymanager { } /** - * @brief Make preparations to vars and filesystem for saving a keyfile + * Make preparations to vars and filesystem for saving a keyfile * @param string|boolean $path * @param string $basePath */ - public static function keySetPreparation(\OC_FilesystemView $view, $path, $basePath, $userId) { + public static function keySetPreparation(\OC\Files\View $view, $path, $basePath, $userId) { $targetPath = ltrim($path, '/'); @@ -542,7 +542,7 @@ class Keymanager { } /** - * @brief extract filename from share key name + * extract filename from share key name * @param string $shareKey (filename.userid.sharekey) * @return string|false filename or false */ diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php index ae2d8d63e23a65912381979e57bc715ba0051b4e..ae3df834e9f417394a65f732b0338c4a736b5a57 100644 --- a/apps/files_encryption/lib/proxy.php +++ b/apps/files_encryption/lib/proxy.php @@ -24,7 +24,7 @@ */ /** - * @brief Encryption proxy which handles filesystem operations before and after + * Encryption proxy which handles filesystem operations before and after * execution and encrypts, and handles keyfiles accordingly. Used for * webui. */ @@ -53,10 +53,11 @@ class Proxy extends \OC_FileProxy { private static function shouldEncrypt($path, $mode = 'w') { $userId = Helper::getUser($path); + $session = new Session(new \OC\Files\View()); // don't call the crypt stream wrapper, if... if ( - \OCP\App::isEnabled('files_encryption') === false // encryption is disabled + $session->getInitialized() !== Session::INIT_SUCCESSFUL // encryption successful initialized || Crypt::mode() !== 'server' // we are not in server-side-encryption mode || strpos($path, '/' . $userId . '/files') !== 0 // path is not in files/ || substr($path, 0, 8) === 'crypt://' // we are already in crypt mode @@ -64,7 +65,7 @@ class Proxy extends \OC_FileProxy { return false; } - $view = new \OC_FilesystemView(''); + $view = new \OC\Files\View(''); $util = new Util($view, $userId); // for write operation we always encrypt the files, for read operations @@ -78,8 +79,8 @@ class Proxy extends \OC_FileProxy { } /** - * @param $path - * @param $data + * @param string $path + * @param string $data * @return bool */ public function preFile_put_contents($path, &$data) { @@ -89,7 +90,7 @@ class Proxy extends \OC_FileProxy { if (!is_resource($data)) { // get root view - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); // get relative path $relativePath = \OCA\Encryption\Helper::stripUserFilesPath($path); @@ -100,7 +101,7 @@ class Proxy extends \OC_FileProxy { // create random cache folder $cacheFolder = rand(); - $path_slices = explode('/', \OC_Filesystem::normalizePath($path)); + $path_slices = explode('/', \OC\Files\Filesystem::normalizePath($path)); $path_slices[2] = "cache/".$cacheFolder; $tmpPath = implode('/', $path_slices); @@ -124,7 +125,7 @@ class Proxy extends \OC_FileProxy { // in the post proxy $tmpFileInfo = $view->getFileInfo($tmpPath); if ( isset($tmpFileInfo['size']) ) { - self::$unencryptedSizes[\OC_Filesystem::normalizePath($path)] = $tmpFileInfo['size']; + self::$unencryptedSizes[\OC\Files\Filesystem::normalizePath($path)] = $tmpFileInfo['size']; } // remove our temp file @@ -143,15 +144,15 @@ class Proxy extends \OC_FileProxy { } /** - * @brief update file cache with the new unencrypted size after file was written + * update file cache with the new unencrypted size after file was written * @param string $path * @param mixed $result * @return mixed */ public function postFile_put_contents($path, $result) { - $normalizedPath = \OC_Filesystem::normalizePath($path); + $normalizedPath = \OC\Files\Filesystem::normalizePath($path); if ( isset(self::$unencryptedSizes[$normalizedPath]) ) { - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); $view->putFileInfo($normalizedPath, array('encrypted' => true, 'unencrypted_size' => self::$unencryptedSizes[$normalizedPath])); unset(self::$unencryptedSizes[$normalizedPath]); @@ -167,7 +168,7 @@ class Proxy extends \OC_FileProxy { public function postFile_get_contents($path, $data) { $plainData = null; - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); // init session $session = new \OCA\Encryption\Session($view); @@ -211,7 +212,7 @@ class Proxy extends \OC_FileProxy { } /** - * @brief remember initial fopen mode because sometimes it gets changed during the request + * remember initial fopen mode because sometimes it gets changed during the request * @param string $path path * @param string $mode type of access */ @@ -224,8 +225,8 @@ class Proxy extends \OC_FileProxy { /** - * @param $path - * @param $result + * @param string $path + * @param resource $result * @return resource */ public function postFopen($path, &$result) { @@ -260,8 +261,8 @@ class Proxy extends \OC_FileProxy { } /** - * @param $path - * @param $data + * @param string $path + * @param array $data * @return array */ public function postGetFileInfo($path, $data) { @@ -284,13 +285,13 @@ class Proxy extends \OC_FileProxy { } /** - * @param $path - * @param $size - * @return bool + * @param string $path + * @param int $size + * @return int|bool */ public function postFileSize($path, $size) { - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); $userId = Helper::getUser($path); $util = new Util($view, $userId); @@ -339,26 +340,24 @@ class Proxy extends \OC_FileProxy { $fileInfo['unencrypted_size'] = $fixSize; // put file info if not .part file if (!Helper::isPartialFilePath($relativePath)) { - $view->putFileInfo($path, $fileInfo); + $view->putFileInfo($path, array('unencrypted_size' => $fixSize)); } } $size = $fileInfo['unencrypted_size']; } else { - // self healing if file was removed from file cache - if (!$fileInfo) { - $fileInfo = array(); - } + + $fileInfoUpdates = array(); $fixSize = $util->getFileSize($path); if ($fixSize > 0) { $size = $fixSize; - $fileInfo['encrypted'] = true; - $fileInfo['unencrypted_size'] = $size; + $fileInfoUpdates['encrypted'] = true; + $fileInfoUpdates['unencrypted_size'] = $size; // put file info if not .part file if (!Helper::isPartialFilePath($relativePath)) { - $view->putFileInfo($path, $fileInfo); + $view->putFileInfo($path, $fileInfoUpdates); } } diff --git a/apps/files_encryption/lib/session.php b/apps/files_encryption/lib/session.php index 3daaa06425faf30dcbb5b65c7a6334780bb75f06..93be6691f96bbc0d0e6db2db632f7b8a1357782a 100644 --- a/apps/files_encryption/lib/session.php +++ b/apps/files_encryption/lib/session.php @@ -36,8 +36,8 @@ class Session { /** - * @brief if session is started, check if ownCloud key pair is set up, if not create it - * @param \OC_FilesystemView $view + * if session is started, check if ownCloud key pair is set up, if not create it + * @param \OC\Files\View $view * * @note The ownCloud key pair is used to allow public link sharing even if encryption is enabled */ @@ -105,7 +105,7 @@ class Session { } /** - * @brief Sets user private key to session + * Sets user private key to session * @param string $privateKey * @return bool * @@ -120,8 +120,8 @@ class Session { } /** - * @brief Sets status of encryption app - * @param string $init INIT_SUCCESSFUL, INIT_EXECUTED, NOT_INOITIALIZED + * Sets status of encryption app + * @param string $init INIT_SUCCESSFUL, INIT_EXECUTED, NOT_INITIALIZED * @return bool * * @note this doesn not indicate of the init was successful, we just remeber the try! @@ -135,7 +135,7 @@ class Session { } /** - * @brief remove encryption keys and init status from session + * remove encryption keys and init status from session */ public function closeSession() { \OC::$session->remove('encryptionInitialized'); @@ -144,8 +144,8 @@ class Session { /** - * @brief Gets status if we already tried to initialize the encryption app - * @returns init status INIT_SUCCESSFUL, INIT_EXECUTED, NOT_INOITIALIZED + * Gets status if we already tried to initialize the encryption app + * @return string init status INIT_SUCCESSFUL, INIT_EXECUTED, NOT_INITIALIZED * * @note this doesn not indicate of the init was successful, we just remeber the try! */ @@ -158,8 +158,8 @@ class Session { } /** - * @brief Gets user or public share private key from session - * @returns string $privateKey The user's plaintext private key + * Gets user or public share private key from session + * @return string $privateKey The user's plaintext private key * */ public function getPrivateKey() { @@ -176,7 +176,7 @@ class Session { } /** - * @brief Sets public user private key to session + * Sets public user private key to session * @param string $privateKey * @return bool */ @@ -189,8 +189,8 @@ class Session { } /** - * @brief Gets public share private key from session - * @returns string $privateKey + * Gets public share private key from session + * @return string $privateKey * */ public function getPublicSharePrivateKey() { @@ -204,7 +204,7 @@ class Session { /** - * @brief Sets user legacy key to session + * Sets user legacy key to session * @param string $legacyKey * @return bool */ @@ -216,8 +216,8 @@ class Session { } /** - * @brief Gets user legacy key from session - * @returns string $legacyKey The user's plaintext legacy key + * Gets user legacy key from session + * @return string $legacyKey The user's plaintext legacy key * */ public function getLegacyKey() { diff --git a/apps/files_encryption/lib/stream.php b/apps/files_encryption/lib/stream.php index df5de558867867f41c38d1c9b2548ada7264d1b6..341114214d50227ff7c39dea15b5e53056e335f8 100644 --- a/apps/files_encryption/lib/stream.php +++ b/apps/files_encryption/lib/stream.php @@ -31,7 +31,7 @@ namespace OCA\Encryption; /** - * @brief Provides 'crypt://' stream wrapper protocol. + * Provides 'crypt://' stream wrapper protocol. * @note We use a stream wrapper because it is the most secure way to handle * decrypted content transfers. There is no safe way to decrypt the entire file * somewhere on the server, so we have to encrypt and decrypt blocks on the fly. @@ -79,10 +79,10 @@ class Stream { private $privateKey; /** - * @param $path raw path relative to data/ - * @param $mode - * @param $options - * @param $opened_path + * @param string $path raw path relative to data/ + * @param string $mode + * @param int $options + * @param string $opened_path * @return bool */ public function stream_open($path, $mode, $options, &$opened_path) { @@ -91,7 +91,7 @@ class Stream { $this->newFile = false; if (!isset($this->rootView)) { - $this->rootView = new \OC_FilesystemView('/'); + $this->rootView = new \OC\Files\View('/'); } $this->session = new \OCA\Encryption\Session($this->rootView); @@ -179,15 +179,15 @@ class Stream { } /** - * @brief Returns the current position of the file pointer - * @return int position of the file pointer + * Returns the current position of the file pointer + * @return int position of the file pointer */ public function stream_tell() { return ftell($this->handle); } /** - * @param $offset + * @param int $offset * @param int $whence * @return bool true if fseek was successful, otherwise false */ @@ -202,7 +202,7 @@ class Stream { } /** - * @param $count + * @param int $count * @return bool|string * @throws \Exception */ @@ -246,7 +246,7 @@ class Stream { } /** - * @brief Encrypt and pad data ready for writing to disk + * Encrypt and pad data ready for writing to disk * @param string $plainData data to be encrypted * @param string $key key to use for encryption * @return string encrypted data on success, false on failure @@ -267,7 +267,7 @@ class Stream { } /** - * @brief Fetch the plain encryption key for the file and set it as plainKey property + * Fetch the plain encryption key for the file and set it as plainKey property * @internal param bool $generate if true, a new key will be generated if none can be found * @return bool true on key found and set, false on key not found and new key generated and set */ @@ -318,7 +318,7 @@ class Stream { } /** - * @brief Handle plain data from the stream, and write it in 8192 byte blocks + * Handle plain data from the stream, and write it in 8192 byte blocks * @param string $data data to be written to disk * @note the data will be written to the path stored in the stream handle, set in stream_open() * @note $data is only ever be a maximum of 8192 bytes long. This is set by PHP internally. stream_write() is called multiple times in a loop on data larger than 8192 bytes @@ -426,9 +426,9 @@ class Stream { /** - * @param $option - * @param $arg1 - * @param $arg2 + * @param int $option + * @param int $arg1 + * @param int|null $arg2 */ public function stream_set_option($option, $arg1, $arg2) { $return = false; @@ -454,7 +454,7 @@ class Stream { } /** - * @param $mode + * @param int $mode */ public function stream_lock($mode) { return flock($this->handle, $mode); diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php index 6372ab31b6ec1c2e111825f26dc0926cd2ad4dd3..d20efc3ac7be9894eb3ed55179324103bc812e1c 100644 --- a/apps/files_encryption/lib/util.php +++ b/apps/files_encryption/lib/util.php @@ -25,8 +25,8 @@ namespace OCA\Encryption; /** - * @brief Class for utilities relating to encrypted file storage system - * @param \OC_FilesystemView $view expected to have OC '/' as root path + * Class for utilities relating to encrypted file storage system + * @param \OC\Files\View $view expected to have OC '/' as root path * @param string $userId ID of the logged in user * @param int $client indicating status of client side encryption. Currently * unused, likely to become obsolete shortly @@ -38,7 +38,7 @@ class Util { const MIGRATION_IN_PROGRESS = -1; // migration is running const MIGRATION_OPEN = 0; // user still needs to be migrated - private $view; // OC_FilesystemView object for filesystem operations + private $view; // OC\Files\View object for filesystem operations private $userId; // ID of the user we use to encrypt/decrypt files private $keyId; // ID of the key we want to manipulate private $client; // Client side encryption mode flag @@ -53,8 +53,8 @@ class Util { private $isPublic; /** - * @param \OC_FilesystemView $view - * @param $userId + * @param \OC\Files\View $view + * @param string $userId * @param bool $client */ public function __construct($view, $userId, $client = false) { @@ -111,7 +111,7 @@ class Util { } /** - * @brief check if the users private & public key exists + * check if the users private & public key exists * @return boolean */ public function userKeysExists() { @@ -125,7 +125,7 @@ class Util { } /** - * @brief Sets up user folders and keys for serverside encryption + * Sets up user folders and keys for serverside encryption * * @param string $passphrase to encrypt server-stored private key with * @return bool @@ -222,7 +222,7 @@ class Util { } /** - * @brief Check whether pwd recovery is enabled for a given user + * Check whether pwd recovery is enabled for a given user * @return bool 1 = yes, 0 = no, false = no record * * @note If records are not being returned, check for a hidden space @@ -264,7 +264,7 @@ class Util { } /** - * @brief Enable / disable pwd recovery for a given user + * Enable / disable pwd recovery for a given user * @param bool $enabled Whether to enable or disable recovery * @return bool */ @@ -300,7 +300,7 @@ class Util { } /** - * @brief Find all files and their encryption status within a directory + * Find all files and their encryption status within a directory * @param string $directory The path of the parent directory to search * @param bool $found the founded files if called again * @return mixed false if 0 found, array on success. Keys: name, path @@ -421,7 +421,7 @@ class Util { } /** - * @brief Check if a given path identifies an encrypted file + * Check if a given path identifies an encrypted file * @param string $path * @return boolean */ @@ -463,7 +463,7 @@ class Util { } /** - * @brief get the file size of the unencrypted file + * get the file size of the unencrypted file * @param string $path absolute path * @return bool */ @@ -537,7 +537,7 @@ class Util { } /** - * @brief fix the file size of the encrypted file + * fix the file size of the encrypted file * @param string $path absolute path * @return boolean true / false if file is encrypted */ @@ -594,7 +594,7 @@ class Util { } /** - * @brief encrypt versions from given file + * encrypt versions from given file * @param array $filelist list of encrypted files, relative to data/user/files * @return boolean */ @@ -640,7 +640,7 @@ class Util { } /** - * @brief decrypt versions from given file + * decrypt versions from given file * @param string $filelist list of decrypted files, relative to data/user/files * @return boolean */ @@ -686,7 +686,7 @@ class Util { } /** - * @brief Decrypt all files + * Decrypt all files * @return bool */ public function decryptAll() { @@ -788,8 +788,8 @@ class Util { } if ($successful) { - $this->view->deleteAll($this->keyfilesPath); - $this->view->deleteAll($this->shareKeysPath); + $this->view->rename($this->keyfilesPath, $this->keyfilesPath . '.backup'); + $this->view->rename($this->shareKeysPath, $this->shareKeysPath . '.backup'); } \OC_FileProxy::$enabled = true; @@ -799,7 +799,7 @@ class Util { } /** - * @brief Encrypt all files in a directory + * Encrypt all files in a directory * @param string $dirPath the directory whose files will be encrypted * @param null $legacyPassphrase * @param null $newPassphrase @@ -926,7 +926,7 @@ class Util { } /** - * @brief Return important encryption related paths + * Return important encryption related paths * @param string $pathName Name of the directory to return the path of * @return string path */ @@ -970,7 +970,7 @@ class Util { } /** - * @brief Filter an array of UIDs to return only ones ready for sharing + * Filter an array of UIDs to return only ones ready for sharing * @param array $unfilteredUsers users to be checked for sharing readiness * @return array as multi-dimensional array. keys: ready, unready */ @@ -1017,7 +1017,7 @@ class Util { } /** - * @brief Decrypt a keyfile + * Decrypt a keyfile * @param string $filePath * @param string $privateKey * @return false|string @@ -1036,7 +1036,7 @@ class Util { } /** - * @brief Encrypt keyfile to multiple users + * Encrypt keyfile to multiple users * @param Session $session * @param array $users list of users which should be able to access the file * @param string $filePath path of the file to be shared @@ -1097,7 +1097,7 @@ class Util { } /** - * @brief Find, sanitise and format users sharing a file + * Find, sanitise and format users sharing a file * @note This wraps other methods into a portable bundle * @param boolean $sharingEnabled * @param string $filePath path relativ to current users files folder @@ -1176,7 +1176,7 @@ class Util { } /** - * @brief set migration status + * set migration status * @param int $status * @return boolean */ @@ -1199,7 +1199,7 @@ class Util { } /** - * @brief start migration mode to initially encrypt users data + * start migration mode to initially encrypt users data * @return boolean */ public function beginMigration() { @@ -1221,7 +1221,7 @@ class Util { } /** - * @brief close migration mode after users data has been encrypted successfully + * close migration mode after users data has been encrypted successfully * @return boolean */ public function finishMigration() { @@ -1237,8 +1237,8 @@ class Util { } /** - * @brief check if files are already migrated to the encryption system - * @return migration status, false = in case of no record + * check if files are already migrated to the encryption system + * @return int|false migration status, false = in case of no record * @note If records are not being returned, check for a hidden space * at the start of the uid in db */ @@ -1288,7 +1288,7 @@ class Util { } /** - * @brief get uid of the owners of the file and the path to the file + * get uid of the owners of the file and the path to the file * @param string $path Path of the file to check * @throws \Exception * @note $shareFilePath must be relative to data/UID/files. Files @@ -1361,13 +1361,13 @@ class Util { return array( $fileOwnerUid, - \OC_Filesystem::normalizePath($filename) + \OC\Files\Filesystem::normalizePath($filename) ); } } /** - * @brief go recursively through a dir and collect all files and sub files. + * go recursively through a dir and collect all files and sub files. * @param string $dir relative to the users files folder * @return array with list of files relative to the users files folder */ @@ -1397,9 +1397,8 @@ class Util { } /** - * @brief get owner of the shared files. - * @param $id - * @internal param int $Id of a share + * get owner of the shared files. + * @param int $id ID of a share * @return string owner */ public function getOwnerFromSharedFile($id) { @@ -1479,7 +1478,7 @@ class Util { } /** - * @param $password + * @param string $password * @return bool */ public function checkRecoveryPassword($password) { @@ -1512,7 +1511,7 @@ class Util { } /** - * @brief add recovery key to all encrypted files + * add recovery key to all encrypted files */ public function addRecoveryKeys($path = '/') { $dirContent = $this->view->getDirectoryContent($this->keyfilesPath . $path); @@ -1522,7 +1521,7 @@ class Util { if ($item['type'] === 'dir') { $this->addRecoveryKeys($filePath . '/'); } else { - $session = new \OCA\Encryption\Session(new \OC_FilesystemView('/')); + $session = new \OCA\Encryption\Session(new \OC\Files\View('/')); $sharingEnabled = \OCP\Share::isEnabled(); // remove '.key' extension from path e.g. 'file.txt.key' to 'file.txt' $file = substr($filePath, 0, -4); @@ -1533,7 +1532,7 @@ class Util { } /** - * @brief remove recovery key to all encrypted files + * remove recovery key to all encrypted files */ public function removeRecoveryKeys($path = '/') { $dirContent = $this->view->getDirectoryContent($this->keyfilesPath . $path); @@ -1551,7 +1550,7 @@ class Util { } /** - * @brief decrypt given file with recovery key and encrypt it again to the owner and his new key + * decrypt given file with recovery key and encrypt it again to the owner and his new key * @param string $file * @param string $privateKey recovery key to decrypt the file */ @@ -1599,7 +1598,7 @@ class Util { } /** - * @brief collect all files and recover them one by one + * collect all files and recover them one by one * @param string $path to look for files keys * @param string $privateKey private recovery key which is used to decrypt the files */ @@ -1619,7 +1618,7 @@ class Util { } /** - * @brief recover users files in case of password lost + * recover users files in case of password lost * @param string $recoveryPassword */ public function recoverUsersFiles($recoveryPassword) { @@ -1638,8 +1637,8 @@ class Util { } /** - * @brief check if the file is stored on a system wide mount point - * @param $path relative to /data/user with leading '/' + * check if the file is stored on a system wide mount point + * @param string $path relative to /data/user with leading '/' * @return boolean */ public function isSystemWideMountPoint($path) { @@ -1655,7 +1654,7 @@ class Util { } /** - * @brief decrypt private key and add it to the current session + * decrypt private key and add it to the current session * @param array $params with 'uid' and 'password' * @return mixed session or false */ @@ -1683,7 +1682,7 @@ class Util { } /* - * @brief remove encryption related keys from the session + * remove encryption related keys from the session */ public function closeEncryptionSession() { $session = new \OCA\Encryption\Session($this->view); diff --git a/apps/files_encryption/settings-personal.php b/apps/files_encryption/settings-personal.php index 09e9df05352a9a121761f07d979534e95a826147..e9875518f67956b3f7227b735bac07eb7d51cbbd 100644 --- a/apps/files_encryption/settings-personal.php +++ b/apps/files_encryption/settings-personal.php @@ -12,7 +12,7 @@ $tmpl = new OCP\Template('files_encryption', 'settings-personal'); $user = \OCP\USER::getUser(); -$view = new \OC_FilesystemView('/'); +$view = new \OC\Files\View('/'); $util = new \OCA\Encryption\Util($view, $user); $session = new \OCA\Encryption\Session($view); diff --git a/apps/files_encryption/tests/crypt.php b/apps/files_encryption/tests/crypt.php index 123943ea26a9c6cca7593f508c38f7aebf587808..b22cd214eaaad1738e1b6590f8dc42ec5f05198d 100755 --- a/apps/files_encryption/tests/crypt.php +++ b/apps/files_encryption/tests/crypt.php @@ -34,7 +34,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase { public $dataUrl; public $dataShort; /** - * @var OC_FilesystemView + * @var OC\Files\View */ public $view; public $legacyEncryptedData; @@ -79,7 +79,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase { $this->genPublicKey = $keypair['publicKey']; $this->genPrivateKey = $keypair['privateKey']; - $this->view = new \OC_FilesystemView('/'); + $this->view = new \OC\Files\View('/'); // remember files_trashbin state $this->stateFilesTrashbin = OC_App::isEnabled('files_trashbin'); @@ -157,7 +157,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase { $filename = 'tmp-' . uniqid() . '.test'; - $util = new Encryption\Util(new \OC_FilesystemView(), $this->userId); + $util = new Encryption\Util(new \OC\Files\View(), $this->userId); $cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/'. $filename, $this->dataShort); @@ -206,7 +206,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief Test that data that is written by the crypto stream wrapper + * Test that data that is written by the crypto stream wrapper * @note Encrypted data is manually prepared and decrypted here to avoid dependency on success of stream_read * @note If this test fails with truncate content, check that enough array slices are being rejoined to form $e, as the crypt.php file may have gotten longer and broken the manual * reassembly of its data @@ -216,7 +216,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase { // Generate a a random filename $filename = 'tmp-' . uniqid() . '.test'; - $util = new Encryption\Util(new \OC_FilesystemView(), $this->userId); + $util = new Encryption\Util(new \OC\Files\View(), $this->userId); // Save long data as encrypted file using stream wrapper $cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/' . $filename, $this->dataLong . $this->dataLong); @@ -293,7 +293,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief Test that data that is read by the crypto stream wrapper + * Test that data that is read by the crypto stream wrapper */ function testSymmetricStreamDecryptShortFileContent() { @@ -388,7 +388,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test decryption using legacy blowfish method + * test decryption using legacy blowfish method */ function testLegacyDecryptShort() { @@ -402,7 +402,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test decryption using legacy blowfish method + * test decryption using legacy blowfish method */ function testLegacyDecryptLong() { @@ -660,9 +660,9 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase { /** - * @brief encryption using legacy blowfish method + * encryption using legacy blowfish method * @param string $data data to encrypt - * @param $passwd string password + * @param string $passwd password * @return string */ function legacyEncrypt($data, $passwd) { diff --git a/apps/files_encryption/tests/hooks.php b/apps/files_encryption/tests/hooks.php index 047084ca2c177713202d75b30fd402c067027e90..fcb369c7238eec877bfdc0d0ca996fcd97d1f1d2 100644 --- a/apps/files_encryption/tests/hooks.php +++ b/apps/files_encryption/tests/hooks.php @@ -32,7 +32,7 @@ use OCA\Encryption; /** * Class Test_Encryption_Hooks - * @brief this class provide basic hook app tests + * this class provide basic hook app tests */ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase { @@ -40,7 +40,7 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase { const TEST_ENCRYPTION_HOOKS_USER2 = "test-encryption-hooks-user2"; /** - * @var \OC_FilesystemView + * @var \OC\Files\View */ public $user1View; // view on /data/user1/files public $user2View; // view on /data/user2/files @@ -83,9 +83,9 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase { \OC_User::setUserId(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1); // init filesystem view - $this->user1View = new \OC_FilesystemView('/'. \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1 . '/files'); - $this->user2View = new \OC_FilesystemView('/'. \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2 . '/files'); - $this->rootView = new \OC_FilesystemView('/'); + $this->user1View = new \OC\Files\View('/'. \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1 . '/files'); + $this->user2View = new \OC\Files\View('/'. \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2 . '/files'); + $this->rootView = new \OC\Files\View('/'); // init short data $this->data = 'hats'; @@ -259,7 +259,7 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase { } /** - * @brief test rename operation + * test rename operation */ function testRenameHook() { diff --git a/apps/files_encryption/tests/keymanager.php b/apps/files_encryption/tests/keymanager.php index 0caf12e91a3eb2eae92b83ce741208792ea80292..2bd2ddc8e68d13d5973e5a23748edc1750c4bcf4 100644 --- a/apps/files_encryption/tests/keymanager.php +++ b/apps/files_encryption/tests/keymanager.php @@ -29,7 +29,7 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase { public $pass; public $stateFilesTrashbin; /** - * @var OC_FilesystemView + * @var OC\Files\View */ public $view; public $randomKey; @@ -68,7 +68,7 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase { $this->genPublicKey = $keypair['publicKey']; $this->genPrivateKey = $keypair['privateKey']; - $this->view = new \OC_FilesystemView('/'); + $this->view = new \OC\Files\View('/'); \OC_User::setUserId(\Test_Encryption_Keymanager::TEST_USER); $this->userId = \Test_Encryption_Keymanager::TEST_USER; @@ -257,4 +257,4 @@ class TestProtectedKeymanagerMethods extends \OCA\Encryption\Keymanager { public static function testGetFilenameFromShareKey($sharekey) { return self::getFilenameFromShareKey($sharekey); } -} \ No newline at end of file +} diff --git a/apps/files_encryption/tests/proxy.php b/apps/files_encryption/tests/proxy.php index 647ee955eb1ac7d763f1504956c725459af475ce..8d6bc81b08d217b03e61ca09cb7cf62fa78f8469 100644 --- a/apps/files_encryption/tests/proxy.php +++ b/apps/files_encryption/tests/proxy.php @@ -33,7 +33,7 @@ use OCA\Encryption; /** * Class Test_Encryption_Proxy - * @brief this class provide basic proxy app tests + * this class provide basic proxy app tests */ class Test_Encryption_Proxy extends \PHPUnit_Framework_TestCase { @@ -42,7 +42,7 @@ class Test_Encryption_Proxy extends \PHPUnit_Framework_TestCase { public $userId; public $pass; /** - * @var \OC_FilesystemView + * @var \OC\Files\View */ public $view; // view in /data/user/files public $rootView; // view on /data/user @@ -75,8 +75,8 @@ class Test_Encryption_Proxy extends \PHPUnit_Framework_TestCase { $this->pass = \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1; // init filesystem view - $this->view = new \OC_FilesystemView('/'. \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1 . '/files'); - $this->rootView = new \OC_FilesystemView('/'. \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1 ); + $this->view = new \OC\Files\View('/'. \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1 . '/files'); + $this->rootView = new \OC\Files\View('/'. \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1 ); // init short data $this->data = 'hats'; @@ -91,7 +91,7 @@ class Test_Encryption_Proxy extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test if postFileSize returns the unencrypted file size + * test if postFileSize returns the unencrypted file size */ function testPostFileSize() { diff --git a/apps/files_encryption/tests/share.php b/apps/files_encryption/tests/share.php index 512671c5767b5140c7d93de0727751e4c07080c4..bb3d7505a5df6adc0b96e8a055c147204ef0da42 100755 --- a/apps/files_encryption/tests/share.php +++ b/apps/files_encryption/tests/share.php @@ -48,7 +48,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase { public $filename; public $dataShort; /** - * @var OC_FilesystemView + * @var OC\Files\View */ public $view; public $folder1; @@ -92,7 +92,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase { function setUp() { $this->dataShort = 'hats'; - $this->view = new \OC_FilesystemView('/'); + $this->view = new \OC\Files\View('/'); $this->folder1 = '/folder1'; $this->subfolder = '/subfolder1'; @@ -669,7 +669,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase { // login as admin \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1); - $util = new \OCA\Encryption\Util(new \OC_FilesystemView('/'), \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1); + $util = new \OCA\Encryption\Util(new \OC\Files\View('/'), \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1); // check if recovery password match $this->assertTrue($util->checkRecoveryPassword('test123')); @@ -777,7 +777,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase { // login as user2 \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2); - $util = new \OCA\Encryption\Util(new \OC_FilesystemView('/'), \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2); + $util = new \OCA\Encryption\Util(new \OC\Files\View('/'), \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2); // enable recovery for admin $this->assertTrue($util->setRecoveryForUser(1)); @@ -959,7 +959,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase { /** - * @brief test moving a shared file out of the Shared folder + * test moving a shared file out of the Shared folder */ function testRename() { diff --git a/apps/files_encryption/tests/stream.php b/apps/files_encryption/tests/stream.php index fed2e7d89d10d8eacc6d3d3ef36a5ea53a9ac584..5df9cdbe1f1468c56232a90b368d6d31bd559448 100644 --- a/apps/files_encryption/tests/stream.php +++ b/apps/files_encryption/tests/stream.php @@ -33,7 +33,7 @@ use OCA\Encryption; /** * Class Test_Encryption_Stream - * @brief this class provide basic stream tests + * this class provide basic stream tests */ class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase { @@ -42,7 +42,7 @@ class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase { public $userId; public $pass; /** - * @var \OC_FilesystemView + * @var \OC\Files\View */ public $view; public $dataShort; @@ -71,7 +71,7 @@ class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase { $this->pass = \Test_Encryption_Stream::TEST_ENCRYPTION_STREAM_USER1; // init filesystem view - $this->view = new \OC_FilesystemView('/'); + $this->view = new \OC\Files\View('/'); // init short data $this->dataShort = 'hats'; @@ -183,7 +183,7 @@ class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test if stream wrapper can read files outside from the data folder + * test if stream wrapper can read files outside from the data folder */ function testStreamFromLocalFile() { diff --git a/apps/files_encryption/tests/trashbin.php b/apps/files_encryption/tests/trashbin.php index 2f9ecfd9d5d1faab63f2b3d37d4a422a42aefed1..5d54b7db24f0b989f03bfad72e38b7ee4bdf5eda 100755 --- a/apps/files_encryption/tests/trashbin.php +++ b/apps/files_encryption/tests/trashbin.php @@ -34,7 +34,7 @@ use OCA\Encryption; /** * Class Test_Encryption_Trashbin - * @brief this class provide basic trashbin app tests + * this class provide basic trashbin app tests */ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase { @@ -43,7 +43,7 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase { public $userId; public $pass; /** - * @var \OC_FilesystemView + * @var \OC\Files\View */ public $view; public $dataShort; @@ -81,7 +81,7 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase { $this->pass = \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1; // init filesystem view - $this->view = new \OC_FilesystemView('/'); + $this->view = new \OC\Files\View('/'); // init short data $this->dataShort = 'hats'; @@ -114,7 +114,7 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test delete file + * test delete file */ function testDeleteFile() { @@ -186,7 +186,7 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test restore file + * test restore file * * @depends testDeleteFile */ @@ -218,7 +218,7 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test delete file forever + * test delete file forever */ function testPermanentDeleteFile() { diff --git a/apps/files_encryption/tests/util.php b/apps/files_encryption/tests/util.php index a29ef831a526c1205c5c1797c87ac181fb5fe470..a4dcc5cc8bdcffa26e86c55cbefec523e1df21e4 100755 --- a/apps/files_encryption/tests/util.php +++ b/apps/files_encryption/tests/util.php @@ -29,7 +29,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { public $publicKeyDir; public $pass; /** - * @var OC_FilesystemView + * @var OC\Files\View */ public $view; public $keyfilesPath; @@ -92,7 +92,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { $this->privateKeyPath = $this->encryptionDir . '/' . $this->userId . '.private.key'; // e.g. data/admin/admin.private.key - $this->view = new \OC_FilesystemView('/'); + $this->view = new \OC\Files\View('/'); $this->util = new Encryption\Util($this->view, $this->userId); @@ -121,7 +121,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test that paths set during User construction are correct + * test that paths set during User construction are correct */ function testKeyPaths() { $util = new Encryption\Util($this->view, $this->userId); @@ -136,7 +136,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test detection of encrypted files + * test detection of encrypted files */ function testIsEncryptedPath() { @@ -171,7 +171,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test setup of encryption directories + * test setup of encryption directories */ function testSetupServerSide() { $this->assertEquals(true, $this->util->setupServerSide($this->pass)); @@ -179,14 +179,14 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test checking whether account is ready for encryption, + * test checking whether account is ready for encryption, */ function testUserIsReady() { $this->assertEquals(true, $this->util->ready()); } /** - * @brief test checking whether account is not ready for encryption, + * test checking whether account is not ready for encryption, */ // function testUserIsNotReady() { // $this->view->unlink($this->publicKeyDir); @@ -200,12 +200,12 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test checking whether account is not ready for encryption, + * test checking whether account is not ready for encryption, */ function testIsLegacyUser() { \Test_Encryption_Util::loginHelper(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER); - $userView = new \OC_FilesystemView('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER); + $userView = new \OC\Files\View('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER); // Disable encryption proxy to prevent recursive calls $proxyStatus = \OC_FileProxy::$enabled; @@ -279,7 +279,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { } /** -< * @brief Test that data that is read by the crypto stream wrapper +< * Test that data that is read by the crypto stream wrapper */ function testGetFileSize() { \Test_Encryption_Util::loginHelper(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_USER1); @@ -349,10 +349,12 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { $this->view->unlink($this->userId . '/files/' . $filename); } - function testDecryptAll() { $filename = "/decryptAll" . uniqid() . ".txt"; + $datadir = \OC_Config::getValue('datadirectory', \OC::$SERVERROOT . '/data/'); + $userdir = $datadir . '/' . $this->userId . '/files/'; + $util = new Encryption\Util($this->view, $this->userId); $this->view->file_put_contents($this->userId . '/files/' . $filename, $this->dataShort); @@ -362,13 +364,47 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { $this->assertTrue($fileInfoEncrypted instanceof \OC\Files\FileInfo); $this->assertEquals($fileInfoEncrypted['encrypted'], 1); - // decrypt all encrypted files - $result = $util->decryptAll('/' . $this->userId . '/' . 'files'); + $encContent = file_get_contents($userdir . $filename); - $this->assertTrue($result); + \OC_App::disable('files_encryption'); - $fileInfoUnencrypted = $this->view->getFileInfo($this->userId . '/files/' . $filename); + $user = \OCP\User::getUser(); + $this->logoutHelper(); + $this->loginHelper($user, false, false, false); + + $content = file_get_contents($userdir . $filename); + + //content should be encrypted + $this->assertSame($encContent, $content); + + // now we load the encryption app again + OC_App::loadApp('files_encryption'); + + // init encryption app + $params = array('uid' => \OCP\User::getUser(), + 'password' => \OCP\User::getUser()); + + $view = new OC\Files\View('/'); + $util = new \OCA\Encryption\Util($view, \OCP\User::getUser()); + $result = $util->initEncryption($params); + + $this->assertTrue($result instanceof \OCA\Encryption\Session); + + $successful = $util->decryptAll(); + + $this->assertTrue($successful); + + $this->logoutHelper(); + $this->loginHelper($user, false, false, false); + + // file should be unencrypted and fileInfo should contain the correct values + $content = file_get_contents($userdir . $filename); + + // now we should get the plain data + $this->assertSame($this->dataShort, $content); + + $fileInfoUnencrypted = $this->view->getFileInfo($this->userId . '/files/' . $filename); $this->assertTrue($fileInfoUnencrypted instanceof \OC\Files\FileInfo); // check if mtime and etags unchanged @@ -377,10 +413,21 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { // file should no longer be encrypted $this->assertEquals(0, $fileInfoUnencrypted['encrypted']); + // check if the keys where moved to the backup location + $this->assertTrue($this->view->is_dir($this->userId . '/files_encryption/keyfiles.backup')); + $this->assertTrue($this->view->file_exists($this->userId . '/files_encryption/keyfiles.backup/' . $filename . '.key')); + $this->assertTrue($this->view->is_dir($this->userId . '/files_encryption/share-keys.backup')); + $this->assertTrue($this->view->file_exists($this->userId . '/files_encryption/share-keys.backup/' . $filename . '.' . $user . '.shareKey')); + + // cleanup $this->view->unlink($this->userId . '/files/' . $filename); + $this->view->deleteAll($this->userId . '/files_encryption/keyfiles.backup'); + $this->view->deleteAll($this->userId . '/files_encryption/share-keys.backup'); + OC_App::enable('files_encryption'); } + function testDescryptAllWithBrokenFiles() { $file1 = "/decryptAll1" . uniqid() . ".txt"; @@ -446,8 +493,11 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { $this->assertFalse($this->view->is_dir($this->userId . '/files_encryption/keyfiles/')); $this->assertFalse($this->view->is_dir($this->userId . '/files_encryption/share-keys/')); + //cleanup $this->view->unlink($this->userId . '/files/' . $file1); $this->view->unlink($this->userId . '/files/' . $file2); + $this->view->deleteAll($this->userId . '/files_encryption/keyfiles.backup'); + $this->view->deleteAll($this->userId . '/files_encryption/share-keys.backup'); } @@ -457,8 +507,8 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { function testEncryptLegacyFiles() { \Test_Encryption_Util::loginHelper(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER); - $userView = new \OC_FilesystemView('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER); - $view = new \OC_FilesystemView('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER . '/files'); + $userView = new \OC\Files\View('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER); + $view = new \OC\Files\View('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER . '/files'); // Disable encryption proxy to prevent recursive calls $proxyStatus = \OC_FileProxy::$enabled; @@ -504,11 +554,11 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { } /** - * @param $user + * @param string $user * @param bool $create * @param bool $password */ - public static function loginHelper($user, $create = false, $password = false) { + public static function loginHelper($user, $create = false, $password = false, $loadEncryption = true) { if ($create) { try { \OC_User::createUser($user, $user); @@ -527,9 +577,11 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { \OC_User::setUserId($user); \OC_Util::setupFS($user); - $params['uid'] = $user; - $params['password'] = $password; - OCA\Encryption\Hooks::login($params); + if ($loadEncryption) { + $params['uid'] = $user; + $params['password'] = $password; + OCA\Encryption\Hooks::login($params); + } } public static function logoutHelper() { @@ -543,7 +595,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { * to be able to test the migration path * * @param integer $status needed migration status for test - * @param $user for which user the status should be set + * @param string $user for which user the status should be set * @return boolean */ private function setMigrationStatus($status, $user) { diff --git a/apps/files_encryption/tests/webdav.php b/apps/files_encryption/tests/webdav.php index 1fe4c13d59e8bae7622d38848fd4281bfcf9d410..d33dc58cf920a80d1a016efdcfc35fec30be17af 100755 --- a/apps/files_encryption/tests/webdav.php +++ b/apps/files_encryption/tests/webdav.php @@ -34,7 +34,7 @@ use OCA\Encryption; /** * Class Test_Encryption_Webdav * - * @brief this class provide basic webdav tests for PUT,GET and DELETE + * this class provide basic webdav tests for PUT,GET and DELETE */ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase { @@ -43,7 +43,7 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase { public $userId; public $pass; /** - * @var \OC_FilesystemView + * @var \OC\Files\View */ public $view; public $dataShort; @@ -82,7 +82,7 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase { $this->pass = \Test_Encryption_Webdav::TEST_ENCRYPTION_WEBDAV_USER1; // init filesystem view - $this->view = new \OC_FilesystemView('/'); + $this->view = new \OC\Files\View('/'); // init short data $this->dataShort = 'hats'; @@ -112,7 +112,7 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase { } /** - * @brief test webdav put random file + * test webdav put random file */ function testWebdavPUT() { @@ -167,7 +167,7 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase { } /** - * @brief test webdav get random file + * test webdav get random file * * @depends testWebdavPUT */ @@ -190,7 +190,7 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase { } /** - * @brief test webdav delete random file + * test webdav delete random file * @depends testWebdavGET */ function testWebdavDELETE($filename) { @@ -216,7 +216,7 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase { } /** - * @brief handle webdav request + * handle webdav request * * @param bool $body * diff --git a/apps/files_external/3rdparty/irodsphp/LICENSE.txt b/apps/files_external/3rdparty/irodsphp/LICENSE.txt deleted file mode 100644 index caca18c59be22dfb02626982a299408f1b561859..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/LICENSE.txt +++ /dev/null @@ -1,28 +0,0 @@ -iRODS license terms and copyright info from the irods site at: https://www.irods.org/index.php/License - -License -iRODS Copyright and Licensing - -iRODS is open source software released under a BSD License, see license text in "iRODS License Terms and Conditions" below. -The BSD license has been described in very general terms as allowing you to do whatever you want to with the software and -source code as long as you acknowledge who wrote it and that, as with any open source software, there is no warranty and you're using the code "as is." -In the spirit of collaborative open source software, the iRODS community encourages you to communicate with us, letting us know what features you like, -features that would be useful, problems, bugs, suggestions, etc., and to perhaps contribute source code. -The iRODS community has formed the Data Intensive Cyberinfrastructure Foundation, a 501(c)(3) nonprofit corporation established to serve - as the home of the iRODS open source community over the long term. If you choose to contribute new code, you'll receive full acknowledgment. All you do is complete the Contributor's Agreement, under which you retain copyright ownership - in your code but give a free license to the iRODS nonprofit foundation, allowing your code to be integrated into iRODS and in turn released under the BSD license. -Note: The above text is an educational overview of iRODS open source licensing, and not intended as legal advice nor is it part of the iRODS license agreement, which is below. As always, for legal advice consult an attorney. - -iRODS License Terms and Conditions Notice - -Copyright (c) 2005-2011, Regents of the University of California, the University of North Carolina, and the Data Intensive Cyberinfrastructure Foundation -All rights reserved. -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -Neither the name of the University of California, San Diego (UCSD) nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT -NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/doc_config.ini b/apps/files_external/3rdparty/irodsphp/prods/doc_config.ini deleted file mode 100644 index f72b4a230dbdead5330fd85def298a3545d31cab..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/doc_config.ini +++ /dev/null @@ -1,87 +0,0 @@ -;; phpDocumentor demonstration parse configuration file -;; -;; RUN THIS FILE FROM THE INSTALL DIRECTORY -;; CHANGE HERE: - -;; where should the documentation be written? -;; legal values: a legal path -;target = /home/CelloG/output -target = ./doc - - -;; DONT CHANGE BELOW HERE -;; -;; This file is designed to cut down on repetitive typing on the command-line or web interface -;; You can copy this file to create a number of configuration files that can be used with the -;; command-line switch -c, as in phpdoc -c default.ini or phpdoc -c myini.ini. The web -;; interface will automatically generate a list of .ini files that can be used. -;; -;; ALL .ini files must be in the user subdirectory of phpDocumentor with an extension of .ini -;; -;; Copyright 2002, Greg Beaver -;; -;; WARNING: do not change the - -[Parse Data] -;; title of all the documentation -;; legal values: any string -title = PRODS (iRODS PHP Client API) Documentation - -;; parse files that start with a . like .bash_profile -;; legal values: true, false -hidden = false - -;; show elements marked @access private in documentation by setting this to on -;; legal values: on, off -parseprivate = off - -;; parse with javadoc-like description (first sentence is always the short description) -;; legal values: on, off -javadocdesc = on - -;target=/dev/null - -;; add any custom @tags separated by commas here -;; legal values: any legal tagname separated by commas. -;customtags = mytag1,mytag2 - -;; what is the main package? -;; legal values: alphanumeric string plus - and _ -defaultpackagename = Prods - -;; output any parsing information? set to on for cron jobs -;; legal values: on -;quiet = on - -;; limit output to the specified packages, even if others are parsed -;; legal values: package names separated by commas -;packageoutput = package1,package2 - -;; comma-separated list of files to parse -;; legal values: paths separated by commas -;filename = /path/to/file1,/path/to/file2,fileincurrentdirectory - -;; comma-separated list of directories to parse -;; legal values: directory paths separated by commas -;directory = /path1,/path2,.,..,subdirectory -;directory = /home/jeichorn/cvs/pear -;directory = /you-MUST/change-me/to-fit/your-environment -;directory = . - -directory = ./src,./tutorials - -;; comma-separated list of files, directories or wildcards ? and * (any wildcard) to ignore -;; legal values: any wildcard strings separated by commas -;; remember, this pathing is RELATIVE to the top-most directory in your "directory" value -;ignore = path/to/ignore*,*list.php,myfile.php,subdirectory/ -ignore = templates_c/,*HTML/default/*,spec/,*.inc.php,packet/,set*.php,ProdsStreamer.class.php,RODSMessage.class.php,RODSConn.class.php,RODSKeyValPair.class.php,RODSConnManager.class.php - -;; comma-separated list of Converters to use in outputformat:Convertername:templatedirectory format -;; legal values: HTML:frames:default,HTML:frames:l0l33t,HTML:frames:phpdoc.de,HTML:frames:phphtmllib -;; HTML:frames:phpedit,HTML:frames:DOM/default,HTML:frames:DOM/l0l33t,HTML:frames:DOM/phpdoc.de -;; HTML:Smarty:default,HTML:Smarty:PHP,PDF:default:default,CHM:default:default,XML:DocBook:default -output=HTML:Smarty:PHP - -;; turn this option on if you want highlighted source code for every file -;; legal values: on/off -sourcecode = on diff --git a/apps/files_external/3rdparty/irodsphp/prods/release_notes.txt b/apps/files_external/3rdparty/irodsphp/prods/release_notes.txt deleted file mode 100644 index 7e1b0549cff8c8306ca52decdf9bc7ec76dd0842..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/release_notes.txt +++ /dev/null @@ -1,34 +0,0 @@ - -*'''Project''': PHP Prods API for iRODS -*'''Date''': 06/04/2013 -*'''Release Version''': 3.3.0-beta1 -*'''git tag''': 3.3.0-beta1 - -==News== - -PHP API for iRODS - -This alpha is a merge of community supported additions for PAM and tickets - - -GForge for iDrop-swing is at: [[https://code.renci.org/gf/project/irodsphp/]] - -==Requirements== - -Note that the following bug and feature requests are logged in GForge with related commit information [[https://code.renci.org/gf/project/irodsphp/tracker/]] - -==Features== - -*[#1280] Add PAM support to PHP - -*[#1122] Add Ticket support to PHP - -==Bug Fixes== - - - -==Outstanding Issues== - -Please consult [[https://code.renci.org/gf/project/irodsphp/tracker/]] - -for the latest open bugs and Jargon feature requests diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/LICENSE.txt b/apps/files_external/3rdparty/irodsphp/prods/src/LICENSE.txt deleted file mode 100644 index caca18c59be22dfb02626982a299408f1b561859..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/LICENSE.txt +++ /dev/null @@ -1,28 +0,0 @@ -iRODS license terms and copyright info from the irods site at: https://www.irods.org/index.php/License - -License -iRODS Copyright and Licensing - -iRODS is open source software released under a BSD License, see license text in "iRODS License Terms and Conditions" below. -The BSD license has been described in very general terms as allowing you to do whatever you want to with the software and -source code as long as you acknowledge who wrote it and that, as with any open source software, there is no warranty and you're using the code "as is." -In the spirit of collaborative open source software, the iRODS community encourages you to communicate with us, letting us know what features you like, -features that would be useful, problems, bugs, suggestions, etc., and to perhaps contribute source code. -The iRODS community has formed the Data Intensive Cyberinfrastructure Foundation, a 501(c)(3) nonprofit corporation established to serve - as the home of the iRODS open source community over the long term. If you choose to contribute new code, you'll receive full acknowledgment. All you do is complete the Contributor's Agreement, under which you retain copyright ownership - in your code but give a free license to the iRODS nonprofit foundation, allowing your code to be integrated into iRODS and in turn released under the BSD license. -Note: The above text is an educational overview of iRODS open source licensing, and not intended as legal advice nor is it part of the iRODS license agreement, which is below. As always, for legal advice consult an attorney. - -iRODS License Terms and Conditions Notice - -Copyright (c) 2005-2011, Regents of the University of California, the University of North Carolina, and the Data Intensive Cyberinfrastructure Foundation -All rights reserved. -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -Neither the name of the University of California, San Diego (UCSD) nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT -NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/Prods.inc.php b/apps/files_external/3rdparty/irodsphp/prods/src/Prods.inc.php deleted file mode 100644 index 7e0fafdad83c452b92d459fe476c05f04e7f6517..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/Prods.inc.php +++ /dev/null @@ -1,3 +0,0 @@ - - * @copyright Copyright © 2007, TBD - * @package Prods - */ - -require_once("autoload.inc.php"); - -class ProdsDir extends ProdsPath -{ - /** - * @var RODSDirStats - */ - public $stats; - - private $child_dirs; - private $child_files; - private $all_children; - private $position; - - /** - * Default Constructor. - * - * @param RODSAccount account iRODS account used for connection - * @param string $path_str the path of this dir - * @param boolean $verify whether verify if the path exsits - * @param RODSDirStats $stats if the stats for this dir is already known, initilize it here. - * @return a new ProdsDir - */ - public function __construct(RODSAccount &$account, $path_str, $verify = false, - RODSDirStats $stats = NULL) - { - $this->position = 0; - $this->stats = $stats; - parent::__construct($account, $path_str); - if ($verify === true) { - if ($this->exists() === false) { - throw new RODSException("Directory '$this' does not exist", - 'PERR_PATH_DOES_NOT_EXISTS'); - } - } - } - - - /** - * Create a ProdsDir object from URI string. - * @param string $path the URI Sting - * @param boolean $verify whether verify if the path exsits - * @return a new ProdsDir - */ - public static function fromURI($path, $verify=false) - { - if (0!=strncmp($path,"rods://",7)) - $path="rods://".$path; - $url=parse_url($path); - - $host=isset($url['host'])?$url['host']:''; - $port=isset($url['port'])?$url['port']:''; - - $user=''; - $zone=''; - $authtype='irods'; - if (isset($url['user'])) - { - if (strstr($url['user'],".")!==false) { - $user_array=@explode(".",$url['user']); - if (count($user_array)===3) { - $user=$user_array[0]; - $zone=$user_array[1]; - $authtype=$user_array[2]; - } - else { - $user=$user_array[0]; - $zone=$user_array[1]; - } - } - else - $user=$url['user']; - } - - $pass=isset($url['pass'])?$url['pass']:''; - - $account=new RODSAccount($host, $port, $user, $pass, $zone, '', $authtype); - - $path_str=isset($url['path'])?$url['path']:''; - - // treat query and fragment as part of name - if (isset($url['query'])&&(strlen($url['query'])>0)) - $path_str=$path_str.'?'.$url['query']; - if (isset($url['fragment'])&&(strlen($url['fragment'])>0)) - $path_str=$path_str.'#'.$url['fragment']; - - if (empty($path_str)) - $path_str='/'; - - return (new ProdsDir($account,$path_str,$verify)); - } - - /** - * Verify if this dir exist with server. This function shouldn't be called directly, use {@link exists} - */ - //protected function verify() - protected function verify($get_cb=array('RODSConnManager','getConn'), - $rel_cb=array('RODSConnManager', 'releaseConn')) - { - //$conn = RODSConnManager::getConn($this->account); - $conn = call_user_func_array($get_cb, array(&$this->account)); - $this->path_exists= $conn -> dirExists ($this->path_str); - //RODSConnManager::releaseConn($conn); - call_user_func($rel_cb, $conn); - } - - /** - * get next file or directory from the directory, where the internal iterator points to. - * @return next file or directory from the directory. The file always come first and dir comes later. return false on failure - */ - public function getNextChild() - { - if (!$this->all_children) - $this->all_children=$this->getAllChildren(); - if (($this->position>=count($this->all_children))||($this->position<0)) - return false; - $names=array_keys($this->all_children); - $ret_val=$this->all_children[$names[$this->position]]; - $this->position++; - return $ret_val; - } - - - /** - * Get children files of this dir. - * - * @param array $orderby An associated array specifying how to sort the result by attributes. See details in method {@link findFiles}; - * @param int $startingInx starting index of all files. default is 0. - * @param int $maxresults max results returned. if negative, it returns all rows. default is -1 - * @param int &$total_num_rows number of all results - * @param boolean $logical_file whether to return only logical files, if false, it returns all replica with resource name, if true, it returns only 1 logical file, with num_replica available in the stats. default is false. - * @return an array of ProdsFile - */ - public function getChildFiles(array $orderby=array(), $startingInx=0, - $maxresults=-1, &$total_num_rows=-1, $logicalFile=false) - { - $terms=array("descendantOnly"=>true,"recursive"=>false, 'logicalFile'=>$logicalFile); - return $this->findFiles($terms,$total_num_rows,$startingInx,$maxresults,$orderby); - } - - /** - * Resets the directory stream to the beginning of the directory. - */ - public function rewind() - { - $this->position = 0; - } - - - /** - * @return all children (files and dirs) of current dir - */ - public function getAllChildren() - { - $this->all_children = array(); - $this->all_children = array_merge($this->all_children, - $this->getChildFiles()); - $this->all_children = array_merge($this->all_children, - $this->getChildDirs()); - - return $this->all_children; - } - - /** - * Get children directories of this dir. - * @param $orderby An associated array specifying how to sort the result by attributes. See details in method {@link findDirs}; - * Note that if the current dir is root '/', it will not return '/' as its child, unlike iCommand's current behavior. - * @return an array of ProdsDir - */ - public function getChildDirs(array $orderby = array(), $startingInx = 0, - $maxresults = -1, &$total_num_rows = -1) - { - $terms = array("descendantOnly" => true, "recursive" => false); - return $this->findDirs($terms, $total_num_rows, $startingInx, $maxresults, $orderby); - } - - /** - * Make a new directory under this directory - * @param string $name full path of the new dir to be made on server - * @return ProdsDir the new directory just created (or already exists) - */ - // public function mkdir($name) - public function mkdir($name, - $get_cb = array('RODSConnManager', 'getConn'), - $rel_cb = array('RODSConnManager', 'releaseConn')) - { - //$conn = RODSConnManager::getConn($this->account); - $conn = call_user_func_array($get_cb, array(&$this->account)); - $conn->mkdir($this->path_str . "/$name"); - //RODSConnManager::releaseConn($conn); - call_user_func($rel_cb, $conn); - return (new ProdsDir($this->account, $this->path_str . "/$name")); - } - - /** - * remove this directory - * @param boolean $recursive whether recursively delete all child files and child directories recursively. - * @param boolean $force whether force delete the file/dir. If force delete, all files will be wiped physically. Else, they are moved to trash derectory. - * @param array $additional_flags An array of keyval pairs (array) reprenting additional flags passed to the server/client message. Each keyval pair is an array with first element repsenting the key, and second element representing the value (default to ''). Supported keys are: - * - 'irodsRmTrash' - whether this rm is a rmtrash operation - * - 'irodsAdminRmTrash' - whether this rm is a rmtrash operation done by admin user - * @param mixed $status_update_func It can be an string or array that represents the status update function (see http://us.php.net/manual/en/language.pseudo-types.php#language.types.callback), which can update status based on the server status update. Leave it blank or 'null' if there is no need to update the status. The function will be called with an assossive arry as parameter, supported fields are: - * - 'filesCnt' - finished number of files from previous update (normally 10 but not the last update) - * - 'lastObjPath' - last object that was processed. - * If this function returns 1, progress will be stopped. - */ - // public function rmdir($recursive=true,$force=false, $additional_flags=array(), - // $status_update_func=null) - public function rmdir($recursive = true, $force = false, $additional_flags = array(), - $status_update_func = null, - $get_cb = array('RODSConnManager', 'getConn'), - $rel_cb = array('RODSConnManager', 'releaseConn')) - { - //$conn = RODSConnManager::getConn($this->account); - $conn = call_user_func_array($get_cb, array(&$this->account)); - $conn->rmdir($this->path_str, $recursive, $force, $additional_flags, - $status_update_func); - // RODSConnManager::releaseConn($conn); - call_user_func($rel_cb, $conn); - } - - /** - * get the dir stats - * @param boolean $force_reload If stats already present in the object, and this flag is true, a force reload will be done. - * @return RODSDirStats the stats object, note that if this object will not refresh unless $force_reload flag is used. - */ - // public function getStats($force_reload=false) - public function getStats($force_reload = false, - $get_cb = array('RODSConnManager', 'getConn'), - $rel_cb = array('RODSConnManager', 'releaseConn')) - { - if (($force_reload === false) && ($this->stats)) - return $this->stats; - - //$conn = RODSConnManager::getConn($this->account); - $conn = call_user_func_array($get_cb, array(&$this->account)); - $stats = $conn->getDirStats($this->path_str); - //RODSConnManager::releaseConn($conn); - call_user_func($rel_cb, $conn); - - if ($stats === false) $this->stats = NULL; - else $this->stats = $stats; - return $this->stats; - } - - public function getACL() - { - - $collection = $this->path_str; - - $connLocal = RODSConnManager::getConn($this->account); - $que_result_coll = $connLocal->genQuery( - array("COL_COLL_INHERITANCE", "COL_COLL_NAME", "COL_COLL_OWNER_NAME", "COL_COLL_ID"), - array(new RODSQueryCondition("COL_COLL_NAME", $collection))); - - $users['COL_COLL_INHERITANCE'] = (int)($que_result_coll['COL_COLL_INHERITANCE'][0]); - - $que_result_users = $connLocal->genQuery( - array("COL_DATA_ACCESS_NAME", "COL_DATA_ACCESS_USER_ID"), - array(new RODSQueryCondition("COL_DATA_ACCESS_DATA_ID", $que_result_coll['COL_COLL_ID'][0]))); - - for($i=0; $igenQuery( - array("COL_USER_NAME", "COL_USER_ZONE"), - array(new RODSQueryCondition("COL_USER_ID", $que_result_users["COL_DATA_ACCESS_USER_ID"][$i]))); - - $users['COL_USERS'][] = (object) array( - "COL_USER_NAME" => $que_result_user_info['COL_USER_NAME'][0], - "COL_USER_ZONE" => $que_result_user_info['COL_USER_ZONE'][0], - "COL_DATA_ACCESS_NAME" => $que_result_users['COL_DATA_ACCESS_NAME'][$i] - ); - } - - RODSConnManager::releaseConn($connLocal); - return $users; - - - } - - /** - * get the dir statistics, such as total number of files under this dir - * @param string $fld Name of the statistics, supported values are: - * - num_dirs number of directories - * - num_files number of files - * @param boolean $recursive wheather recursively through the sub collections, default is true. - * @return result, an integer value, assosiated with the query. - */ - //public function queryStatistics($fld, $recursive=true) - public function queryStatistics($fld, $recursive = true, - $get_cb = array('RODSConnManager', 'getConn'), - $rel_cb = array('RODSConnManager', 'releaseConn')) - { - $condition = new RODSGenQueConds(); - $select = new RODSGenQueSelFlds(); - $ret_data_index = ''; - switch ($fld) { - case 'num_dirs' : - $select->add('COL_COLL_ID', 'count'); - $ret_data_index = 'COL_COLL_ID'; - if ($recursive === true) - $condition->add('COL_COLL_NAME', 'like', $this->path_str . '/%'); - else - $condition->add('COL_COLL_PARENT_NAME', '=', $this->path_str); - break; - case 'num_files' : - $select->add('COL_D_DATA_ID', 'count'); - $ret_data_index = 'COL_D_DATA_ID'; - if ($recursive === true) - $condition->add('COL_COLL_NAME', 'like', $this->path_str . '/%', - array(array('op' => '=', 'val' => $this->path_str))); - else - $condition->add('COL_COLL_NAME', '=', $this->path_str); - break; - default : - throw new RODSException("Query field '$fld' not supported!", - 'PERR_USER_INPUT_ERROR'); - } - - //$conn = RODSConnManager::getConn($this->account); - $conn = call_user_func_array($get_cb, array(&$this->account)); - $results = $conn->query($select, $condition); - //RODSConnManager::releaseConn($conn); - call_user_func($rel_cb, $conn); - $result_values = $results->getValues(); - - if (isset($result_values[$ret_data_index][0])) - return intval($result_values[$ret_data_index][0]); - else { - throw new RODSException("Query did not get value back with expected " . - "index: $ret_data_index!", 'GENERAL_PRODS_ERR'); - } - } - - /** - * query metadata, and find matching files. - * @param array $terms an assositive array of search conditions, supported ones are: - * - 'name' (string) - partial name of the target (file or dir) - * - 'descendantOnly' (boolean) - whether to search among this directory's decendents. default is false. - * - 'recursive' (boolean) - whether to search recursively, among all decendents and their children. default is false. This option only works when 'descendantOnly' is true - * - 'logicalFile' (boolean) - whether to return logical file, instead of all replicas for each file. if true, the resource name for each file will be null, instead, num_replicas will be provided. default is false. - * - 'smtime' (int) - start last-modified-time in unix timestamp. The specified time is included in query, in other words the search can be thought was "mtime >= specified time" - * - 'emtime' (int) - end last-modified-time in unix timestamp. The specified time is not included in query, in other words the search can be thought was "mtime < specified time" - * - 'owner' (string) - owner name of the file - * - 'rescname' (string) - resource name of the file - * - 'metadata' (array of RODSMeta) - array of metadata. - * @param int &$total_count This value (passed by reference) returns the total potential count of search results - * @param int $start starting index of search results. - * @param int $limit up to how many results to be returned. If negative, give all results back. - * @param array $sort_flds associative array with following keys: - * - 'name' - name of the file or dir - * - 'size' - size of the file - * - 'mtime' - last modified time - * - 'ctime' - creation time - * - 'owner' - owner of the file - * - 'typename' - file/data type - * - 'dirname' - directory/collection name for the file - * The results are sorted by specified array keys. - * The possible array value must be boolean: true stands for 'asc' and false stands for 'desc', default is 'asc' - * @return array of ProdsPath objects (ProdsFile or ProdsDir). - */ - //public function findFiles(array $terms, &$total_count, $start=0, $limit=-1, array $sort_flds=array()) - public function findFiles(array $terms, &$total_count, $start = 0, $limit = -1, - array $sort_flds = array(), - $get_cb = array('RODSConnManager', 'getConn'), - $rel_cb = array('RODSConnManager', 'releaseConn')) - { - $flds = array("COL_DATA_NAME" => NULL, "COL_D_DATA_ID" => NULL, - "COL_DATA_TYPE_NAME" => NULL, "COL_D_RESC_NAME" => NULL, - "COL_DATA_SIZE" => NULL, "COL_D_OWNER_NAME" => NULL, "COL_D_OWNER_ZONE" => NULL, - "COL_D_CREATE_TIME" => NULL, "COL_D_MODIFY_TIME" => NULL, - "COL_COLL_NAME" => NULL, "COL_D_COMMENTS" => NULL); - - foreach ($sort_flds as $sort_fld_key => $sort_fld_val) { - switch ($sort_fld_key) { - case 'name': - if ($sort_fld_val === false) - $flds['COL_DATA_NAME'] = 'order_by_desc'; - else - $flds['COL_DATA_NAME'] = 'order_by_asc'; - break; - - case 'size': - if ($sort_fld_val === false) - $flds['COL_DATA_SIZE'] = 'order_by_desc'; - else - $flds['COL_DATA_SIZE'] = 'order_by_asc'; - break; - - case 'mtime': - if ($sort_fld_val === false) - $flds['COL_D_MODIFY_TIME'] = 'order_by_desc'; - else - $flds['COL_D_MODIFY_TIME'] = 'order_by_asc'; - break; - - case 'ctime': - if ($sort_fld_val === false) - $flds['COL_D_CREATE_TIME'] = 'order_by_desc'; - else - $flds['COL_D_CREATE_TIME'] = 'order_by_asc'; - break; - - case 'typename': - if ($sort_fld_val === false) - $flds['COL_DATA_TYPE_NAME'] = 'order_by_desc'; - else - $flds['COL_DATA_TYPE_NAME'] = 'order_by_asc'; - break; - - case 'owner': - if ($sort_fld_val === false) - $flds['COL_D_OWNER_NAME'] = 'order_by_desc'; - else - $flds['COL_D_OWNER_NAME'] = 'order_by_asc'; - break; - - case 'dirname': - if ($sort_fld_val === false) - $flds['COL_COLL_NAME'] = 'order_by_desc'; - else - $flds['COL_COLL_NAME'] = 'order_by_asc'; - break; - - default: - /* - throw new RODSException("Sort field name '$sort_fld_key' is not valid", - 'PERR_USER_INPUT_ERROR'); - break; - */ - } - } - $select = new RODSGenQueSelFlds(array_keys($flds), array_values($flds)); - - $descendantOnly = false; - $recursive = false; - $logicalFile = false; - $condition = new RODSGenQueConds(); - foreach ($terms as $term_key => $term_val) { - switch ($term_key) { - case 'name': - //$condition->add('COL_DATA_NAME', 'like', '%'.$term_val.'%'); - $condition->add('COL_DATA_NAME', 'like', $term_val); - break; - case 'smtime': - $condition->add('COL_D_MODIFY_TIME', '>=', $term_val); - break; - case 'emtime': - $condition->add('COL_D_MODIFY_TIME', '<', $term_val); - break; - case 'owner': - $condition->add('COL_D_OWNER_NAME', '=', $term_val); - break; - case 'ownerzone': - $condition->add('COL_D_OWNER_ZONE', '=', $term_val); - break; - case 'rescname': - $condition->add('COL_D_RESC_NAME', '=', $term_val); - break; - case 'metadata': - $meta_array = $term_val; - foreach ($meta_array as $meta) { - if (isset($meta->name)) { - if ($meta->nameop === 'like') { - $condition->add('COL_META_DATA_ATTR_NAME', 'like', '%' . $meta->name . '%'); - } else if (isset($meta->nameop)) { - $condition->add('COL_META_DATA_ATTR_NAME', $meta->nameop, $meta->name); - } else { - $condition->add('COL_META_DATA_ATTR_NAME', '=', $meta->name); - } - } - if (isset($meta->value)) { - if ($meta->op === 'like') { - $condition->add('COL_META_DATA_ATTR_VALUE', 'like', '%' . $meta->value . '%'); - } else if (isset($meta->op)) { - $condition->add('COL_META_DATA_ATTR_VALUE', $meta->op, $meta->value); - } else { - $condition->add('COL_META_DATA_ATTR_VALUE', '=', $meta->value); - } - } - if (isset($meta->unit)) { - if ($meta->unitop === 'like') { - $condition->add('COL_META_DATA_ATTR_UNIT', 'like', '%' . $meta->unit . '%'); - } else if (isset($meta->unitop)) { - $condition->add('COL_META_DATA_ATTR_UNIT', $meta->unitop, $meta->unit); - } else { - $condition->add('COL_META_DATA_ATTR_UNIT', '=', $meta->unit); - } - } - } - break; - - case 'descendantOnly': - if (true === $term_val) - $descendantOnly = true; - break; - - case 'recursive': - if (true === $term_val) - $recursive = true; - break; - - case 'logicalFile': - if (true === $term_val) - $logicalFile = true; - break; - - default: - throw new RODSException("Term field name '$term_key' is not valid", - 'PERR_USER_INPUT_ERROR'); - break; - } - } - - if ($descendantOnly === true) { - if ($recursive === true) - $condition->add('COL_COLL_NAME', 'like', $this->path_str . '/%', - array(array('op' => '=', 'val' => $this->path_str))); - else - $condition->add('COL_COLL_NAME', '=', $this->path_str); - } - - if ($logicalFile === true) { - $select->update('COL_D_RESC_NAME', 'count'); - $select->update('COL_DATA_SIZE', 'max'); - $select->update('COL_D_CREATE_TIME', 'min'); - $select->update('COL_D_MODIFY_TIME', 'max'); - } - - //$conn = RODSConnManager::getConn($this->account); - $conn = call_user_func_array($get_cb, array(&$this->account)); - $results = $conn->query($select, $condition, $start, $limit); - //RODSConnManager::releaseConn($conn); - call_user_func($rel_cb, $conn); - - $total_count = $results->getTotalCount(); - $result_values = $results->getValues(); - $found = array(); - for ($i = 0; $i < $results->getNumRow(); $i++) { - $resc_name = ($logicalFile === true) ? NULL : $result_values['COL_D_RESC_NAME'][$i]; - $num_replica = ($logicalFile === true) ? intval($result_values['COL_D_RESC_NAME'][$i]) : NULL; - $stats = new RODSFileStats( - $result_values['COL_DATA_NAME'][$i], - $result_values['COL_DATA_SIZE'][$i], - $result_values['COL_D_OWNER_NAME'][$i], - $result_values['COL_D_OWNER_ZONE'][$i], - $result_values['COL_D_MODIFY_TIME'][$i], - $result_values['COL_D_CREATE_TIME'][$i], - $result_values['COL_D_DATA_ID'][$i], - $result_values['COL_DATA_TYPE_NAME'][$i], - $resc_name, - $result_values['COL_D_COMMENTS'][$i], - $num_replica - ); - - if ($result_values['COL_COLL_NAME'][$i] == '/') - $full_path = '/' . $result_values['COL_DATA_NAME'][$i]; - else - $full_path = $result_values['COL_COLL_NAME'][$i] . '/' . - $result_values['COL_DATA_NAME'][$i]; - $found[] = new ProdsFile($this->account, $full_path, false, $stats); - } - return $found; - } - - /** - * query metadata, and find matching diretories. - * @param array $terms an assositive array of search conditions, supported ones are: - * - 'name' (string) - partial name of the target (file or dir) - * - 'descendantOnly' (boolean) - whether to search among this directory's decendents. default is false. - * - 'recursive' (boolean) - whether to search recursively, among all decendents and their children. default is false. This option only works when 'descendantOnly' is true - * - 'smtime' (int) - start last-modified-time in unix timestamp. The specified time is included in query, in other words the search can be thought was "mtime >= specified time" - * - 'emtime' (int) - end last-modified-time in unix timestamp. The specified time is not included in query, in other words the search can be thought was "mtime < specified time" - * - 'owner' (string) - owner name of the dir - * - 'metadata' (array of RODSMeta) - array of metadata. - * @param int &$total_count This value (passed by reference) returns the total potential count of search results - * @param int $start starting index of search results. - * @param int $limit up to how many results to be returned. If negative, give all results back. - * @param array $sort_flds associative array with following keys: - * - 'name' - name of the dir - * - 'mtime' - last modified time - * - 'ctime' - creation time - * - 'owner' - owner of the dir - * The results are sorted by specified array keys. - * The possible array value must be boolean: true stands for 'asc' and false stands for 'desc', default is 'asc' - * @return array of ProdsPath objects (ProdsFile or ProdsDir). - */ - public function findDirs(array $terms, &$total_count, $start = 0, $limit = -1, - array $sort_flds = array()) - { - $flds = array("COL_COLL_NAME" => NULL, "COL_COLL_ID" => NULL, - "COL_COLL_OWNER_NAME" => NULL, 'COL_COLL_OWNER_ZONE' => NULL, - "COL_COLL_CREATE_TIME" => NULL, "COL_COLL_MODIFY_TIME" => NULL, - "COL_COLL_COMMENTS" => NULL); - - foreach ($sort_flds as $sort_fld_key => $sort_fld_val) { - switch ($sort_fld_key) { - case 'name': - if ($sort_fld_val === false) - $flds['COL_COLL_NAME'] = 'order_by_desc'; - else - $flds['COL_COLL_NAME'] = 'order_by_asc'; - break; - - case 'mtime': - if ($sort_fld_val === false) - $flds['COL_COLL_MODIFY_TIME'] = 'order_by_desc'; - else - $flds['COL_COLL_MODIFY_TIME'] = 'order_by_asc'; - break; - - case 'ctime': - if ($sort_fld_val === false) - $flds['COL_COLL_CREATE_TIME'] = 'order_by_desc'; - else - $flds['COL_COLL_CREATE_TIME'] = 'order_by_asc'; - break; - - case 'owner': - if ($sort_fld_val === false) - $flds['COL_COLL_OWNER_NAME'] = 'order_by_desc'; - else - $flds['COL_COLL_OWNER_NAME'] = 'order_by_asc'; - break; - - default: - /* - throw new RODSException("Sort field name '$sort_fld_key' is not valid", - 'PERR_USER_INPUT_ERROR'); - */ - break; - } - } - $select = new RODSGenQueSelFlds(array_keys($flds), array_values($flds)); - - $descendantOnly = false; - $recursive = false; - $condition = new RODSGenQueConds(); - foreach ($terms as $term_key => $term_val) { - switch ($term_key) { - case 'name': - //$condition->add('COL_COLL_NAME', 'like', '%'.$term_val.'%'); - $condition->add('COL_COLL_NAME', 'like', $term_val); - break; - case 'smtime': - $condition->add('COL_COLL_MODIFY_TIME', '>=', $term_val); - break; - case 'emtime': - $condition->add('COL_COLL_MODIFY_TIME', '<', $term_val); - break; - case 'owner': - $condition->add('COL_COLL_OWNER_NAME', '=', $term_val); - break; - case 'metadata': - $meta_array = $term_val; - foreach ($meta_array as $meta) { - $condition->add('COL_META_COLL_ATTR_NAME', '=', $meta->name); - if (isset($meta->op)) - $op = $meta->op; - else - $op = '='; - if ($op == 'like') - //$value='%'.$meta->value.'%'; - $value = $meta->value; - else - $value = $meta->value; - $condition->add('COL_META_COLL_ATTR_VALUE', $op, $value); - } - break; - - case 'descendantOnly': - if (true === $term_val) - $descendantOnly = true; - break; - - case 'recursive': - if (true === $term_val) - $recursive = true; - break; - - default: - throw new RODSException("Term field name '$term_key' is not valid", - 'PERR_USER_INPUT_ERROR'); - break; - } - } - - if ($descendantOnly === true) { - // eliminate '/' from children, if current path is already root - if ($this->path_str == '/') - $condition->add('COL_COLL_NAME', '<>', '/'); - - if ($recursive === true) - $condition->add('COL_COLL_PARENT_NAME', 'like', $this->path_str . '/%', - array(array('op' => '=', 'val' => $this->path_str))); - else - $condition->add('COL_COLL_PARENT_NAME', '=', $this->path_str); - } - - $conn = RODSConnManager::getConn($this->account); - $results = $conn->query($select, $condition, $start, $limit); - RODSConnManager::releaseConn($conn); - - $total_count = $results->getTotalCount(); - $result_values = $results->getValues(); - $found = array(); - for ($i = 0; $i < $results->getNumRow(); $i++) { - $full_path = $result_values['COL_COLL_NAME'][$i]; - $acctual_name = basename($result_values['COL_COLL_NAME'][$i]); - $stats = new RODSDirStats( - $acctual_name, - $result_values['COL_COLL_OWNER_NAME'][$i], - $result_values['COL_COLL_OWNER_ZONE'][$i], - $result_values['COL_COLL_MODIFY_TIME'][$i], - $result_values['COL_COLL_CREATE_TIME'][$i], - $result_values['COL_COLL_ID'][$i], - $result_values['COL_COLL_COMMENTS'][$i]); - - $found[] = new ProdsDir($this->account, $full_path, false, $stats); - } - return $found; - } -} diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/ProdsFile.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/ProdsFile.class.php deleted file mode 100644 index 3fa5da0dcc9368daf3b68535933977357c19c915..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/ProdsFile.class.php +++ /dev/null @@ -1,434 +0,0 @@ - - * @copyright Copyright © 2007, TBD - * @package Prods - */ - -require_once("autoload.inc.php"); - -class ProdsFile extends ProdsPath -{ - public $stats; - - private $rodsconn; //real RODS connection - private $l1desc; //lvl 1 descriptor on RODS server - private $conn; //the connection to RODS agent l1desc lives on. - private $rescname; //resource name. - private $openmode; //open mode used if file is opened - private $position; //current position of the file, if opened. - - /** - * The class constructor - */ - public function __construct(RODSAccount &$account, $path_str, - $verify = false, RODSFileStats $stats = NULL) - { - $this->l1desc = -1; - $this->stats = $stats; - - if ($path_str{strlen($path_str) - 1} == '/') { - throw new RODSException("Invalid file name '$path_str' ", - 'PERR_USER_INPUT_PATH_ERROR'); - } - - parent::__construct($account, $path_str); - if ($verify === true) { - if ($this->exists() === false) { - throw new RODSException("File '$this' does not exist", - 'PERR_PATH_DOES_NOT_EXISTS'); - } - } - } - - - /** - * Create a new ProdsFile object from URI string. - * @param string $path the URI Sting - * @param boolean $verify whether verify if the path exsits - * @return a new ProdsDir - */ - public static function fromURI($path, $verify=false) - { - if (0!=strncmp($path,"rods://",7)) - $path="rods://".$path; - $url=parse_url($path); - - $host=isset($url['host'])?$url['host']:''; - $port=isset($url['port'])?$url['port']:''; - - $user=''; - $zone=''; - $authtype='irods'; - if (isset($url['user'])) - { - if (strstr($url['user'],".")!==false) { - $user_array=@explode(".",$url['user']); - if (count($user_array)===3) { - $user=$user_array[0]; - $zone=$user_array[1]; - $authtype=$user_array[2]; - } - else { - $user=$user_array[0]; - $zone=$user_array[1]; - } - } - else - $user=$url['user']; - } - - $pass=isset($url['pass'])?$url['pass']:''; - - $account=new RODSAccount($host, $port, $user, $pass, $zone, '', $authtype); - - $path_str=isset($url['path'])?$url['path']:''; - - // treat query and fragment as part of name - if (isset($url['query'])&&(strlen($url['query'])>0)) - $path_str=$path_str.'?'.$url['query']; - if (isset($url['fragment'])&&(strlen($url['fragment'])>0)) - $path_str=$path_str.'#'.$url['fragment']; - - if (empty($path_str)) - $path_str='/'; - - return (new ProdsFile($account,$path_str,$verify)); - } - - /** - * Verify if this file exist with server. This function shouldn't be called directly, use {@link exists} - */ - protected function verify() - { - $conn = RODSConnManager::getConn($this->account); - $this->path_exists= $conn -> fileExists ($this->path_str); - RODSConnManager::releaseConn($conn); - } - - /** - * get the file stats - */ - public function getStats() - { - $conn = RODSConnManager::getConn($this->account); - $stats=$conn->getFileStats($this->path_str); - RODSConnManager::releaseConn($conn); - - if ($stats===false) $this->stats=NULL; - else $this->stats=$stats; - return $this->stats; - } - - /** - * Open a file path (string) exists on RODS server. - * - * @param string $mode open mode. Supported modes are: - * - 'r' Open for reading only; place the file pointer at the beginning of the file. - * - 'r+' Open for reading and writing; place the file pointer at the beginning of the file. - * - 'w' Open for writing only; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it. - * - 'w+' Open for reading and writing; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it. - * - 'a' Open for writing only; place the file pointer at the end of the file. If the file does not exist, attempt to create it. - * - 'a+' Open for reading and writing; place the file pointer at the end of the file. If the file does not exist, attempt to create it. - * - 'x' Create and open for writing only; place the file pointer at the beginning of the file. If the file already exists, the fopen() call will fail by returning FALSE and generating an error of level E_WARNING. If the file does not exist, attempt to create it. This is equivalent to specifying O_EXCL|O_CREAT flags for the underlying open(2) system call. - * - 'x+' Create and open for reading and writing; place the file pointer at the beginning of the file. If the file already exists, the fopen() call will fail by returning FALSE and generating an error of level E_WARNING. If the file does not exist, attempt to create it. This is equivalent to specifying O_EXCL|O_CREAT flags for the underlying open(2) system call. - * @param string $rescname. Note that this parameter is required only if the file does not exists (create mode). If the file already exists, and if file resource is unknown or unique or you-dont-care for that file, leave the field, or pass NULL. - * @param boolean $assum_file_exists. This parameter specifies whether file exists. If the value is false, this mothod will check with RODS server to make sure. If value is true, the check will NOT be done. Default value is false. - * @param string $filetype. This parameter only make sense when you want to specify the file type, if file does not exists (create mode). If not specified, it defaults to "generic" - * @param integer $cmode. This parameter is only used for "createmode". It specifies the file mode on physical storage system (RODS vault), in octal 4 digit format. For instance, 0644 is owner readable/writeable, and nothing else. 0777 is all readable, writable, and excutable. If not specified, and the open flag requirs create mode, it defaults to 0644. - */ - public function open($mode, $rescname = NULL, - $assum_file_exists = false, $filetype = 'generic', $cmode = 0644) - { - if ($this->l1desc >= 0) - return; - - if (!empty($rescname)) - $this->rescname = $rescname; - - $this->conn = RODSConnManager::getConn($this->account); - $this->l1desc = $this->conn->openFileDesc($this->path_str, $mode, - $this->postion, $rescname, $assum_file_exists, $filetype, $cmode); - $this->openmode = $mode; - RODSConnManager::releaseConn($this->conn); - } - - /** - * get the file open mode, if opened previously - * @return string open mode, if not opened, it return NULL - */ - public function getOpenmode() - { - return $this->openmode; - } - - /** - * get the file current position, if opened previously - * @return string open mode, if not opened, it return NULL - */ - public function tell() - { - return $this->position; - } - - /** - * unlink the file on server - * @param string $rescname resource name. Not required if there is no other replica. - * @param boolean $force flag (true or false) indicating whether force delete or not. - */ - public function unlink($rescname = NULL, $force = false) - { - $conn = RODSConnManager::getConn($this->account); - $conn->fileUnlink($this->path_str, $rescname, $force); - RODSConnManager::releaseConn($conn); - } - /** - * close the file descriptor (private) made from RODS server earlier. - */ - public function close() - { - if ($this->l1desc >= 0) { - while ($this->conn->isIdle() === false) { - trigger_error("The connection is not available! sleep for a while and retry...", - E_USER_WARNING); - usleep(50); - } - $this->conn->lock(); - $this->conn->closeFileDesc($this->l1desc); - $this->conn->unlock(); - $this->conn = null; //release the connection - $this->l1desc = -1; - } - } - - /** - * reads up to length bytes from the file. Reading stops when up to length bytes have been read, EOF (end of file) is reached - * - * @param int $length up to how many bytes to read. - * @return the read string. - */ - public function read($length) - { - if ($this->l1desc < 0) { - throw new RODSException("File '$this' is not opened! l1desc=$this->l1desc", - 'PERR_USER_INPUT_ERROR'); - } - - while ($this->conn->isIdle() === false) { - trigger_error("The connection is not available! sleep for a while and retry...", - E_USER_WARNING); - usleep(50); - } - - $this->conn->lock(); - $retval = $this->conn->fileRead($this->l1desc, $length); - $this->position = $this->position + strlen($retval); - $this->conn->unlock(); - return $retval; - } - - /** - * write up to length bytes to the server. this function is binary safe. - * @param string $string contents to be written. - * @param int $length up to how many bytes to write. - * @return the number of bytes written. - */ - public function write($string, $length = NULL) - { - if ($this->l1desc < 0) { - throw new RODSException("File '$this' is not opened! l1desc=$this->l1desc", - 'PERR_USER_INPUT_ERROR'); - } - - while ($this->conn->isIdle() === false) { - trigger_error("The connection is not available! sleep for a while and retry...", - E_USER_WARNING); - usleep(50); - } - - $this->conn->lock(); - $retval = $this->conn->fileWrite($this->l1desc, $string, $length); - $this->position = $this->position + (int)$retval; - $this->conn->unlock(); - return $retval; - } - - /** - * Sets the file position for the file. The new position, measured in bytes from the beginning of the file, is obtained by adding offset to the position specified by whence, whose values are defined as follows: - * SEEK_SET - Set position equal to offset bytes. - * SEEK_CUR - Set position to current location plus offset. - * SEEK_END - Set position to end-of-file plus offset. (To move to a position before the end-of-file, you need to pass a negative value in offset.) - * If whence is not specified, it is assumed to be SEEK_SET. - * @return int the current offset - */ - public function seek($offset, $whence = SEEK_SET) - { - if ($this->l1desc < 0) { - throw new RODSException("File '$this' is not opened! l1desc=$this->l1desc", - 'PERR_USER_INPUT_ERROR'); - } - - while ($this->conn->isIdle() === false) { - trigger_error("The connection is not available! sleep for a while and retry...", - E_USER_WARNING); - usleep(50); - } - - $this->conn->lock(); - $retval = $this->conn->fileSeek($this->l1desc, $offset, $whence); - $this->position = (int)$retval; - $this->conn->unlock(); - return $retval; - } - - /** - * Sets the file position to the beginning of the file stream. - */ - public function rewind() - { - while ($this->conn->isIdle() === false) { - trigger_error("The connection is not available! sleep for a while and retry...", - E_USER_WARNING); - usleep(50); - } - - $this->seek(0, SEEK_SET); - $this->position = 0; - } - - /** - * get the file descriptor (private) made from RODS server earlier. - */ - public function getL1desc() - { - return $this->l1desc; - } - - /** - * Because RODS server can only do file operations in a single connection, a RODS - * connection is 'reserved' when file is opened, and released when closed. - */ - public function getConn() - { - return $this->conn; - } - - /** - * Replicate file to resources with options. - * @param string $desc_resc destination resource - * @param array $options an assosive array of options: - * - 'all' (boolean): only meaningful if input resource is a resource group. Replicate to all the resources in the resource group. - * - 'backupMode' (boolean): if a good copy already exists in this resource, don't make another copy. - * - 'admin' (boolean): admin user uses this option to backup/replicate other users files - * - 'replNum' (integer): the replica to copy, typically not needed - * - 'srcResc' (string): specifies the source resource of the data object to be replicate, only copies stored in this resource will be replicated. Otherwise, one of the copy will be replicated - * These options are all 'optional', if omitted, the server will try to do it anyway - * @return number of bytes written if success, in case of faliure, throw an exception - */ - public function repl($desc_resc, array $options = array()) - { - $conn = RODSConnManager::getConn($this->account); - $bytesWritten = $conn->repl($this->path_str, $desc_resc, $options); - RODSConnManager::releaseConn($conn); - - return $bytesWritten; - } - - /** - * get replica information for this file - * @return array of array, each child array is a associative and contains: - * [repl_num] : replica number - * [chk_sum] : checksum of the file - * [size] : size of the file (replica) - * [resc_name] : resource name - * [resc_repl_status] : replica status (dirty bit), whether this replica is dirty (modifed), and requirs synchs to other replicas. - * [resc_grp_name] : resource group name - * [resc_type] : resource type name - * [resc_class] : resource class name - * [resc_loc] : resource location - * [resc_freespace]: resource freespace - * [data_status] : data status - * [ctime] : data creation time (unix timestamp) - * [mtime] : data last modified time (unix timestamp) - */ - public function getReplInfo() - { - $select = new RODSGenQueSelFlds( - array("COL_DATA_REPL_NUM", "COL_D_DATA_CHECKSUM", 'COL_DATA_SIZE', - "COL_D_RESC_NAME", "COL_D_RESC_GROUP_NAME", - "COL_D_DATA_STATUS", "COL_D_CREATE_TIME", - "COL_D_MODIFY_TIME", 'COL_R_TYPE_NAME', 'COL_R_CLASS_NAME', - 'COL_R_LOC', 'COL_R_FREE_SPACE', 'COL_D_REPL_STATUS') - ); - $condition = new RODSGenQueConds( - array("COL_COLL_NAME", "COL_DATA_NAME"), - array("=", "="), - array($this->parent_path, $this->name) - ); - - $conn = RODSConnManager::getConn($this->account); - $que_result = $conn->query($select, $condition); - RODSConnManager::releaseConn($conn); - - $ret_arr = array(); - for ($i = 0; $i < $que_result->getNumRow(); $i++) { - $ret_arr_row = array(); - $que_result_val = $que_result->getValues(); - $ret_arr_row['repl_num'] = $que_result_val['COL_DATA_REPL_NUM'][$i]; - $ret_arr_row['chk_sum'] = $que_result_val['COL_D_DATA_CHECKSUM'][$i]; - $ret_arr_row['size'] = $que_result_val['COL_DATA_SIZE'][$i]; - $ret_arr_row['resc_name'] = $que_result_val['COL_D_RESC_NAME'][$i]; - $ret_arr_row['resc_grp_name'] = $que_result_val['COL_D_RESC_GROUP_NAME'][$i]; - $ret_arr_row['data_status'] = $que_result_val['COL_D_DATA_STATUS'][$i]; - $ret_arr_row['ctime'] = $que_result_val['COL_D_CREATE_TIME'][$i]; - $ret_arr_row['mtime'] = $que_result_val['COL_D_MODIFY_TIME'][$i]; - $ret_arr_row['resc_type'] = $que_result_val['COL_R_TYPE_NAME'][$i]; - $ret_arr_row['resc_class'] = $que_result_val['COL_R_CLASS_NAME'][$i]; - $ret_arr_row['resc_loc'] = $que_result_val['COL_R_LOC'][$i]; - $ret_arr_row['resc_freespace'] = $que_result_val['COL_R_FREE_SPACE'][$i]; - $ret_arr_row['resc_repl_status'] = $que_result_val['COL_D_REPL_STATUS'][$i]; - $ret_arr[] = $ret_arr_row; - } - return $ret_arr; - } - - /** - * Get ACL (users and their rights on a file) - * @param string $filepath input file path string - * @return RODSFileStats. If file does not exists, return fales. - */ - public function getACL() - { - - $filepath = $this->path_str; - $parent = dirname($filepath); - $filename = basename($filepath); - -// $cond = array(new RODSQueryCondition("COL_COLL_NAME", $parent), -// new RODSQueryCondition("COL_DATA_NAME", $filename)); - $cond = array(new RODSQueryCondition("COL_DATA_NAME", $filename), - new RODSQueryCondition("COL_COLL_NAME", $parent)); - - $connLocal = RODSConnManager::getConn($this->account); - $que_result = $connLocal->genQuery( - array("COL_USER_NAME", "COL_USER_ZONE", "COL_DATA_ACCESS_NAME"), - $cond, array()); - RODSConnManager::releaseConn($connLocal); - if ($que_result === false) return false; - - - for($i=0; $i < sizeof($que_result['COL_USER_NAME']); $i++) { - $users[] = (object) array( - "COL_USER_NAME" => $que_result['COL_USER_NAME'][$i], - "COL_USER_ZONE" => $que_result['COL_USER_ZONE'][$i], - "COL_DATA_ACCESS_NAME" => $que_result['COL_DATA_ACCESS_NAME'][$i] - ); - } - return $users; - } -} - - - - diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/ProdsPath.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/ProdsPath.class.php deleted file mode 100644 index fdf100b77a4ba85fa7c1ad2b18605ba6ee27d2f5..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/ProdsPath.class.php +++ /dev/null @@ -1,281 +0,0 @@ - - * @copyright Copyright © 2007, TBD - * @package Prods - */ - -require_once("autoload.inc.php"); - -require_once(CLASS_DIR . "/ProdsConfig.inc.php"); - -/** - * ProdsPath class. This class is a abastract class for objects that can be represented as a path, such as file or directory - * @package Prods - */ -abstract class ProdsPath -{ - /** - * string path - * @var string - */ - public $path_str; - - public $account; - - protected $path_exists; - - protected $parent_path; - protected $name; - - /** - * Default Constructor. Because this class is abstract, this constructor should not be called directly. - * - * @param RODSAccount account iRODS account used for connection - * @param string $path_str the path of this dir - * @return ProdsPath a new ProdsPath - */ - public function __construct(RODSAccount &$account, $path_str) - { - $this->account = $account; - - // strip the tailing "/" - while ((strlen($path_str) > 1) && ($path_str{strlen($path_str) - 1} == '/')) { - $path_str = substr($path_str, 0, strlen($path_str) - 1); - } - // remove duplicate '/' characters - $path_str = str_replace('//', '/', $path_str); - $this->path_str = $path_str; - if ($path_str == '/') { - $this->parent_path = null; - } else { - $this->parent_path = dirname($this->path_str); - } - $this->name = basename($this->path_str); - } - - public function __toString() - { - return $this->account . $this->path_str; - } - - /** - * Whether this path (dir or file) exists on the server. - * @return boolean - */ - public function exists() - { - if (isset($this->path_exists)) - return $this->path_exists; - - else { - $this->verify(); - return $this->path_exists; - } - } - - /** - * Verify if a path exist with server. This function shouldn't be called directly, use {@link exists} - */ - abstract protected function verify(); - - /** - * Get meta data of this path (file or dir). - * @return array array of RODSMeta. - */ - //public function getMeta() - public function getMeta($get_cb = array('RODSConnManager', 'getConn'), - $rel_cb = array('RODSConnManager', 'releaseConn')) - { - if ($this instanceof ProdsFile) - $type = 'd'; - else - if ($this instanceof ProdsDir) - $type = 'c'; - else - throw new RODSException("Unsupported data type:" . get_class($this), - "PERR_INTERNAL_ERR"); - //$conn = RODSConnManager::getConn($this->account); - $conn = call_user_func_array($get_cb, array(&$this->account)); - $meta_array = $conn->getMeta($type, $this->path_str); - //RODSConnManager::releaseConn($conn); - call_user_func($rel_cb, $conn); - return $meta_array; - } - - /** - * update metadata to this path (file or dir) - */ - public function updateMeta(RODSMeta $meta_old, RODSMeta $meta_new) - { - $this->rmMeta($meta_old); - $this->addMeta($meta_new); - } - - /** - * Add metadata to this path (file or dir) - */ - // public function addMeta(RODSMeta $meta) - public function addMeta(RODSMeta $meta, - $get_cb = array('RODSConnManager', 'getConn'), - $rel_cb = array('RODSConnManager', 'releaseConn')) - { - if ($this instanceof ProdsFile) - $type = 'd'; - else - if ($this instanceof ProdsDir) - $type = 'c'; - else - throw new RODSException("Unsupported data type:" . get_class($this), - "PERR_INTERNAL_ERR"); - - //$conn = RODSConnManager::getConn($this->account); - $conn = call_user_func_array($get_cb, array(&$this->account)); - $conn->addMeta($type, $this->path_str, $meta); - //RODSConnManager::releaseConn($conn); - call_user_func($rel_cb, $conn); - } - - /** - * remove metadata to this path (file or dir) - */ - // public function rmMeta(RODSMeta $meta) - public function rmMeta(RODSMeta $meta, - $get_cb = array('RODSConnManager', 'getConn'), - $rel_cb = array('RODSConnManager', 'releaseConn')) - { - if ($this instanceof ProdsFile) - $type = 'd'; - else - if ($this instanceof ProdsDir) - $type = 'c'; - else - throw new RODSException("Unsupported data type:" . get_class($this), - "PERR_INTERNAL_ERR"); - - //$conn = RODSConnManager::getConn($this->account); - $conn = call_user_func_array($get_cb, array(&$this->account)); - $conn->rmMeta($type, $this->path_str, $meta); - //RODSConnManager::releaseConn($conn); - call_user_func($rel_cb, $conn); - } - - /** - * remove metadata of this path (file or dir) by id - * @param integer metaid id of the metadata entry - */ - // public function rmMetaByID ($metaid) - public function rmMetaByID($metaid, - $get_cb = array('RODSConnManager', 'getConn'), - $rel_cb = array('RODSConnManager', 'releaseConn')) - { - if ($this instanceof ProdsFile) - $type = 'd'; - else - if ($this instanceof ProdsDir) - $type = 'c'; - else - throw new RODSException("Unsupported data type:" . get_class($this), - "PERR_INTERNAL_ERR"); - - //$conn = RODSConnManager::getConn($this->account); - $conn = call_user_func_array($get_cb, array(&$this->account)); - $conn->rmMetaByID($type, $this->path_str, $metaid); - //RODSConnManager::releaseConn($conn); - call_user_func($rel_cb, $conn); - } - - /** - * copy meta data from this path (file or dir) to $dest path - */ - // public function cpMeta(ProdsPath $dest) - public function cpMeta(ProdsPath $dest, - $get_cb = array('RODSConnManager', 'getConn'), - $rel_cb = array('RODSConnManager', 'releaseConn')) - { - if ($this instanceof ProdsFile) - $type_src = 'd'; - else - if ($this instanceof ProdsDir) - $type_src = 'c'; - else - throw new RODSException("Unsupported data type:" . get_class($this), - "PERR_INTERNAL_ERR"); - - if ($dest instanceof ProdsFile) - $type_dest = 'd'; - else - if ($dest instanceof ProdsDir) - $type_dest = 'c'; - else - throw new RODSException("Unsupported data type:" . get_class($this), - "PERR_INTERNAL_ERR"); - - //$conn = RODSConnManager::getConn($this->account); - $conn = call_user_func_array($get_cb, array(&$this->account)); - $conn->cpMeta($type_src, $type_dest, $this->path_str, $dest->path_str); - //RODSConnManager::releaseConn($conn); - call_user_func($rel_cb, $conn); - } - - /** - * rename this path (file of dir) - * @param string $new_path_str new path string to be renamed to. - */ - // public function rename($new_path_str) - public function rename($new_path_str, - $get_cb = array('RODSConnManager', 'getConn'), - $rel_cb = array('RODSConnManager', 'releaseConn')) - { - if ($this instanceof ProdsFile) - $type = 0; - else - $type = 1; - //$conn = RODSConnManager::getConn($this->account); - $conn = call_user_func_array($get_cb, array(&$this->account)); - $conn->rename($this->path_str, $new_path_str, $type); - //RODSConnManager::releaseConn($conn); - call_user_func($rel_cb, $conn); - $this->path_str = $new_path_str; - $this->parent_path = dirname($this->path_str); - $this->name = basename($this->path_str); - } - - /** - * Get name of this path. note that this is not the full path. for instance if path is "/foo/bar", the name is "bar" - * @return string name of the path. - */ - public function getName() - { - return $this->name; - } - - /** - * Get string form of this path. note that this is the full path. - * @return string form of the path. - */ - public function getPath() - { - return $this->path_str; - } - - /** - * Get parent's path of this path. - * @return string parent's path. - */ - public function getParentPath() - { - return $this->parent_path; - } - - /** - * Get URI of this path. - * @return string this path's URI. - */ - public function toURI() - { - return $this->account->toURI() . $this->path_str; - } - -} diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/ProdsQuery.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/ProdsQuery.class.php deleted file mode 100644 index 5e8dc92d594d8b3ce43767a05dea46c4435f9766..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/ProdsQuery.class.php +++ /dev/null @@ -1,105 +0,0 @@ - - * @copyright Copyright © 2007, TBD - * @package Prods - */ -require_once("autoload.inc.php"); - -class ProdsQuery -{ - public $account; - - public function __construct(RODSAccount $account) - { - $this->account = $account; - } - - /** - * Get all user defined metadata names for all files on the server. - * @return array of strings (metadata names). - */ - public function getMetadataNamesForAllFiles() - { - $flds = array("COL_META_DATA_ATTR_NAME" => NULL); - $select = new RODSGenQueSelFlds(array_keys($flds), array_values($flds)); - $condition = new RODSGenQueConds(); - $condition->add('COL_D_DATA_ID', '>=', '0'); - $conn = RODSConnManager::getConn($this->account); - $results = $conn->query($select, $condition); - RODSConnManager::releaseConn($conn); - - if ($results->getNumRow() < 1) - return array(); - else { - $values = $results->getValues(); - return $values['COL_META_DATA_ATTR_NAME']; - } - } - - /** - * Get all user defined metadata names for all directories(collections) on the server. - * @return array of strings (metadata names). - */ - public function getMetadataNamesForAllDirs() - { - $flds = array("COL_META_COLL_ATTR_NAME" => NULL); - $select = new RODSGenQueSelFlds(array_keys($flds), array_values($flds)); - $condition = new RODSGenQueConds(); - $condition->add('COL_COLL_ID', '>=', '0'); - $conn = RODSConnManager::getConn($this->account); - $results = $conn->query($select, $condition); - RODSConnManager::releaseConn($conn); - - if ($results->getNumRow() < 1) - return array(); - else { - $values = $results->getValues(); - return $values['COL_META_COLL_ATTR_NAME']; - } - } - - /** - * Get all resources registered on the server - * @return array with fields: id, name, type, zone, class, loc, info, comment, ctime, mtime, vault_path, free_space. If user not found return empty array. - */ - public function getResources() - { - // set selected value - $flds = array("COL_R_RESC_ID" => NULL, "COL_R_RESC_NAME" => NULL, - "COL_R_ZONE_NAME" => NULL, "COL_R_TYPE_NAME" => NULL, - "COL_R_CLASS_NAME" => NULL, "COL_R_LOC" => NULL, - "COL_R_VAULT_PATH" => NULL, "COL_R_FREE_SPACE" => NULL, - "COL_R_RESC_INFO" => NULL, "COL_R_RESC_COMMENT" => NULL, - "COL_R_CREATE_TIME" => NULL, "COL_R_MODIFY_TIME" => NULL); - $select = new RODSGenQueSelFlds(array_keys($flds), array_values($flds)); - $condition = new RODSGenQueConds(); - $conn = RODSConnManager::getConn($this->account); - $results = $conn->query($select, $condition); - RODSConnManager::releaseConn($conn); - $result_vals = $results->getValues(); - $retval = array(); - for ($i = 0; $i < $results->getNumRow(); $i++) { - $retval_row = array(); - $retval_row['id'] = $result_vals["COL_R_RESC_ID"][$i]; - $retval_row['name'] = $result_vals["COL_R_RESC_NAME"][$i]; - $retval_row['type'] = $result_vals["COL_R_TYPE_NAME"][$i]; - $retval_row['zone'] = $result_vals["COL_R_ZONE_NAME"][$i]; - $retval_row['class'] = $result_vals["COL_R_CLASS_NAME"][$i]; - $retval_row['loc'] = $result_vals["COL_R_LOC"][$i]; - $retval_row['info'] = $result_vals["COL_R_RESC_INFO"][$i]; - $retval_row['comment'] = $result_vals["COL_R_RESC_COMMENT"][$i]; - $retval_row['ctime'] = $result_vals["COL_R_CREATE_TIME"][$i]; - $retval_row['mtime'] = $result_vals["COL_R_MODIFY_TIME"][$i]; - $retval_row['vault_path'] = $result_vals["COL_R_VAULT_PATH"][$i]; - $retval_row['free_space'] = $result_vals["COL_R_FREE_SPACE"][$i]; - $retval[] = $retval_row; - } - return $retval; - - } -} diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/ProdsRule.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/ProdsRule.class.php deleted file mode 100644 index d14d87ad1aa9aed61948facbf21ae0235c907641..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/ProdsRule.class.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @copyright Copyright © 2007, TBD - * @package Prods - */ -require_once("autoload.inc.php"); - -class ProdsRule -{ - public $account; - public $body; - public $inp_params; - public $out_params; - public $remotesvr; - public $options; - - /* - * @param RODSAccount account this is the account used to connect to iRODS server - * @param string $rule_body body of the rule. Read this tutorial for details about rules: http://www.irods.org/index.php/Executing_user_defined_rules/workflow - * @param array $inp_params associative array defining input parameters for micro services used in this rule. only string and keyval pair are supported at this time. If the array value is a string, then type is string, if the array value is an RODSKeyValPair object, it will be treated a keyval pair - * @param array $out_params an array of names (strings) - * @param array $remotesvr if this rule need to run at remote server, this associative array should have the following keys: - * - 'host' remote host name or address - * - 'port' remote port - * - 'zone' remote zone - * if any of the value is empty, this option will be ignored. - * @param RODSKeyValPair $options an RODSKeyValPair specifying additional options, purpose of this is unknown at the developement time. Leave it alone if you are as clueless as me... - */ - public function __construct(RODSAccount $account, $rule_body, - array $inp_params = array(), array $out_params = array(), - array $remotesvr = array(), RODSKeyValPair $options = null) - { - $this->account = $account; - $this->rule_body = $rule_body; - $this->inp_params = $inp_params; - $this->out_params = $out_params; - $this->remotesvr = $remotesvr; - if (isset($options)) - $this->options = $options; - else - $this->options = new RODSKeyValPair(); - } - - /** - * Excute the rule, assign - * @return an associative array. Each array key is the lable, and each array value's type will depend on the type of $out_param, at this moment, only string and RODSKeyValPair are supported - */ - public function execute() - { - $conn = RODSConnManager::getConn($this->account); - $result = $conn->execUserRule($this->rule_body, $this->inp_params, - $this->out_params, $this->remotesvr, $this->options = null); - RODSConnManager::releaseConn($conn); - - return $result; - } -} diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/ProdsStreamer.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/ProdsStreamer.class.php deleted file mode 100644 index 67ef096c5c5be494099d1d5c368eba49fa918762..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/ProdsStreamer.class.php +++ /dev/null @@ -1,434 +0,0 @@ - - * @copyright Copyright © 2007, TBD - * @package Prods - */ - -require_once("autoload.inc.php"); - -class ProdsStreamer -{ - /** - * current position of the file or dir - * - * @access private - */ - private $position; - - /** - * Name of the directory/collection specified in the URI to opendir(). - * - * @access private - */ - private $dir; - - /** - * Name of the file specified in the URI to fopen(). - * - * @access private - */ - private $file; - - - /** - * url_stat() handler. - * - * @access private - */ - public function url_stat($path) - { - try { - $file=ProdsDir::fromURI($path); - $conn = RODSConnManager::getConn($file->account); - - $stats = $this->stat_file($conn, $file->path_str); - if (!$stats) { - $stats = $this->stat_dir($conn, $file->path_str); - } - - RODSConnManager::releaseConn($conn); - - return $stats; - - } catch (Exception $e) { - trigger_error("Got an exception:$e", E_USER_WARNING); - return false; - } - } - - /** - * @param $conn - * @param $file - * @return mixed - */ - private function stat_dir($conn, $path_str) { - try { - $irods_stats = $conn->getDirStats($path_str); - if (!$irods_stats) - return false; - $stats = array(); - $stats[0] = $stats['dev'] = 0; - $stats[1] = $stats['ino'] = 0; - $stats[2] = $stats['mode'] = octdec('040755'); - $stats[3] = $stats['nlink'] = 1; - $stats[4] = $stats['uid'] = 0; - $stats[5] = $stats['gid'] = 0; - $stats[6] = $stats['rdev'] = -1; - $stats[7] = $stats['size'] = 0; - $stats[8] = $stats['atime'] = time(); - $stats[9] = $stats['mtime'] = $irods_stats->mtime; - $stats[10] = $stats['ctime'] = $irods_stats->ctime; - $stats[11] = $stats['blksize'] = -1; - $stats[12] = $stats['blocks'] = -1; - return $stats; - } catch (Exception $e) { - trigger_error("Got an exception: $e", E_USER_WARNING); - return false; - } - } - - /** - * @param $conn - * @param $file - * @return mixed - */ - private function stat_file($conn, $path_str) { - try { - $irods_stats = $conn->getFileStats($path_str); - if (!$irods_stats) - return false; - $stats = array(); - $stats[0] = $stats['dev'] = 0; - $stats[1] = $stats['ino'] = 0; - $stats[2] = $stats['mode'] = octdec('100644'); - $stats[3] = $stats['nlink'] = 1; - $stats[4] = $stats['uid'] = 0; - $stats[5] = $stats['gid'] = 0; - $stats[6] = $stats['rdev'] = -1; - $stats[7] = $stats['size'] = $irods_stats->size; - $stats[8] = $stats['atime'] = time(); - $stats[9] = $stats['mtime'] = $irods_stats->mtime; - $stats[10] = $stats['ctime'] = $irods_stats->ctime; - $stats[11] = $stats['blksize'] = -1; - $stats[12] = $stats['blocks'] = -1; - return $stats; - } catch (Exception $e) { - trigger_error("Got an exception: $e", E_USER_WARNING); - return false; - } - } - - /** - * mkdir() handler. - * - * @access private - */ - function mkdir ($url, $mode, $options) { - try { - $file=ProdsDir::fromURI($url); - $conn = RODSConnManager::getConn($file->account); - $conn->mkdir($file->path_str); - - RODSConnManager::releaseConn($conn); - return true; - } catch (Exception $e) { - trigger_error("Got an exception:$e", E_USER_WARNING); - return false; - } - } - - /** - * rmdir() handler - * - * @param $url - * @return bool - */ - function rmdir ($url) { - try { - $file=ProdsDir::fromURI($url); - $conn = RODSConnManager::getConn($file->account); - $conn->rmdir($file->path_str); - - RODSConnManager::releaseConn($conn); - return true; - } catch (Exception $e) { - trigger_error("Got an exception:$e", E_USER_WARNING); - return false; - } - } - - /** - * unlink() handler. - * - * @access private - */ - function unlink ($url) { - try { - $file=ProdsDir::fromURI($url); - $conn = RODSConnManager::getConn($file->account); - if (is_dir($url)) { - $conn->rmdir($file->path_str, true, true); - } else { - $conn->fileUnlink($file->path_str, NULL, true); - } - - RODSConnManager::releaseConn($conn); - return true; - } catch (Exception $e) { - trigger_error("Got an exception:$e", E_USER_WARNING); - return false; - } - } - - /** - * rename() handler. - * - * @access private - */ - function rename ($url_from, $url_to) { - try { - $file_from=ProdsDir::fromURI($url_from); - $file_to=ProdsDir::fromURI($url_to); - $conn = RODSConnManager::getConn($file_from->account); - - if (is_dir($url_from)) { - $conn->rename($file_from->path_str, $file_to->path_str, 0); - } else { - $conn->rename($file_from->path_str, $file_to->path_str, 1); - } - - RODSConnManager::releaseConn($conn); - return true; - } catch (Exception $e) { - trigger_error("Got an exception:$e", E_USER_WARNING); - return false; - } - } - - /** - * opendir() handler. - * - * @access private - */ - public function dir_opendir ($path, $options) - { - try { - $this->dir=ProdsDir::fromURI($path,true); - return true; - } catch (Exception $e) { - trigger_error("Got an exception:$e", E_USER_WARNING); - return false; - } - } - - /** - * readdir() handler. - * - * @access private - */ - public function dir_readdir() - { - try { - $child = $this->dir->getNextChild(); - if ($child === false) return false; - return $child->getName(); - } catch (Exception $e) { - trigger_error("Got an exception:$e", E_USER_WARNING); - return false; - } - } - - /** - * fread() and fgets() handler. - * - * @access private - */ - public function stream_read ($count) { - if (in_array ($this->file->getOpenMode(), array ('w', 'a', 'x'))) { - return false; - } - try { - $ret = $this->file->read($count); - $this->position=$this->file->tell(); - return $ret; - } catch (Exception $e) { - trigger_error("Got an exception:$e", E_USER_WARNING); - return false; - } - } - - /** - * fwrite() handler. - * - * @access private - */ - public function stream_write ($data) { - if ($this->file->getOpenMode() =='r') { - return false; - } - try { - $ret = $this->file->write($data); - $this->position=$this->file->tell(); - return $ret; - } catch (Exception $e) { - trigger_error("Got an exception:$e", E_USER_WARNING); - return false; - } - } - /** - * rewinddir() handler. - * - * @access private - */ - public function dir_rewinddir() - { - try { - $this->dir->rewind(); - return true; - } catch (Exception $e) { - trigger_error("Got an exception:$e", E_USER_WARNING); - return false; - } - } - - /** - * closedir() handler. - * - * @access private - */ - public function dir_closedir() - { - try { - $this->dir->rewind(); - return true; - } catch (Exception $e) { - trigger_error("Got an exception:$e", E_USER_WARNING); - return false; - } - } - - /** - * fopen() handler. - * - * @access private - */ - public function stream_open($path, $mode, $options, &$opened_path) - { - - // get rid of tailing 'b', if any. - if (($mode{strlen($mode) - 1} == 'b') && (strlen($mode) > 1)) - $mode = substr($mode, 0, strlen($mode) - 1); - try { - $this->file = ProdsFile::fromURI($path); - $this->file->open($mode); - return true; - } catch (Exception $e) { - trigger_error("Got an exception:$e", E_USER_WARNING); - return false; - } - } - - /** - * fstat() handler. - * - * @access private - */ - function stream_stat () { - - try { - $stats=$this->file->getStats(); - return array ( - -1, -1, -1, -1, -1, -1, $stats->size, time (), $stats->mtime, $stats->ctime, -1, -1, - 'dev' => -1, - 'ino' => -1, - 'mode' => -1, - 'nlink' => -1, - 'uid' => -1, - 'gid' => -1, - 'rdev' => -1, - 'size' => $stats->size, - 'atime' => time (), - 'mtime' => $stats->mtime, - 'ctime' => $stats->ctime, - 'blksize' => -1, - 'blocks' => -1, - ); - } catch (Exception $e) { - trigger_error("Got an exception:$e", E_USER_WARNING); - return false; - } - } - - /** - * fclose() handler. - * - * @access private - */ - function stream_close () { - $this->file->close(); - $this->position = 0; - $this->file = null; - $this->dir = null; - } - - /** - * ftell() handler. - * - * @access private - */ - function stream_tell() - { - return $this->position; - } - - /** - * feof() handler. - * - * @access private - */ - function stream_eof() - { - try { - $stats = $this->file->getStats(); - return $this->position >= $stats->size; - } catch (Exception $e) { - trigger_error("Got an exception:$e", E_USER_WARNING); - return true; - } - } - - /** - * fseek() handler. - * - * @access private - */ - function stream_seek($offset, $whence) - { - try { - $this->file->seek($offset, $whence); - return true; - } catch (Exception $e) { - trigger_error("Got an exception:$e", E_USER_WARNING); - return false; - } - } - - /** - * fflush() handler. Please Note: This method must be called for any - * changes to be committed to the repository. - * - * @access private - */ - function stream_flush() - { - return true; - } -} - -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/ProdsTicket.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/ProdsTicket.class.php deleted file mode 100644 index 0038a9c073a3f0e66e527516b95fd9f28192f210..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/ProdsTicket.class.php +++ /dev/null @@ -1,41 +0,0 @@ - - * Date: 30.01.13 - * Time: 14:15 - */ - -require_once("autoload.inc.php"); - -class ProdsTicket -{ - private $account; - - public function __construct( RODSAccount &$account ) - { - $this->account = $account; - } - - /* - * This is just a stupid wrapper - * It proxifies RODSConn->createTicket - */ - public function createTicket( $object, $permission = 'read', $ticket = '' ) - { - $conn = RODSConnManager::getConn($this->account); - $ticket = $conn->createTicket($object, $permission, $ticket ); - RODSConnManager::releaseConn($conn); - return $ticket; - } - - /* - * This is also a stupid wrapper - * It proxifies RODSConn->deleteTicket - */ - public function deleteTicket( $ticket ) - { - $conn = RODSConnManager::getConn($this->account); - $ticket = $conn->deleteTicket( $ticket ); - RODSConnManager::releaseConn($conn); - } -} \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSAccount.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSAccount.class.php deleted file mode 100644 index ba4c5ad96b053da6bf38001d8398e5f91caaee56..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RODSAccount.class.php +++ /dev/null @@ -1,201 +0,0 @@ -host=$host; - $this->port=$port; - $this->user=$user; - $this->pass=$pass; - $this->zone=$zone; - $this->default_resc=$default_resc; - $this->auth_type=$auth_type; - $this->ticket = $ticket; - } - - /** - * Create a RODSAccount object from URI string. - * @param string $uri - * @return a new RODSAccount object - */ - public static function fromURI($uri) - { - $url=parse_url($uri); - - $host=isset($url['host'])?$url['host']:''; - $port=isset($url['port'])?$url['port']:''; - - $user=''; - $zone=''; - $authtype='irods'; - if (isset($url['user'])) - { - if (strstr($url['user'],".")!==false) { - $user_array=@explode(".",$url['user']); - if (count($user_array)===3) { - $user=$user_array[0]; - $zone=$user_array[1]; - $authtype=$user_array[2]; - } - else { - $user=$user_array[0]; - $zone=$user_array[1]; - } - } - else - $user=$url['user']; - } - - $pass=isset($url['pass'])?$url['pass']:''; - - return (new RODSAccount($host, $port, $user, $pass, $zone, "", $authtype,$ticket = '')); - } - - - - public function equals(RODSAccount $other) - { - if (!isset($other)) - return false; - - if (($this->host == $other->host) && - ($this->port == $other->port) && - ($this->user == $other->user) - ) { - $ret_val = true; - } else - $ret_val = false; - - //echo ( "$this->host,$this->port,$this->user vs. $other->host,$other->port,$other->user = $ret_val"); - //flush(); - return $ret_val; - } - - public function getSignature() - { - return (bin2hex(md5("$this->user.$this->zone:this->pass@$this->host:$this->port.$this->ticket", TRUE))); - } - - public function __toString() - { - return "$this->user.$this->zone:(password hidden)@$this->host:$this->port"; - } - - public function toURI() - { - return ($this->user . - (empty($this->zone) ? '' : '.' . $this->zone) . - "@" . $this->host . ":" . $this->port); - } - - /** - * Get user information - * @param string username, if not specified, it will use current username instead - * @return array with fields: id, name, type, zone, dn, info, comment, ctime, mtime. If user not found return empty array. - */ - public function getUserInfo($username = NULL, - $get_cb = array('RODSConnManager', 'getConn'), - $rel_cb = array('RODSConnManager', 'releaseConn')) - { - //$conn = RODSConnManager::getConn($this); - $conn = call_user_func_array($get_cb, array(&$this)); - //TODO: Overcome fear of passing $this by reference or stop passing $this by reference - $userinfo = $conn->getUserInfo($username); - //RODSConnManager::releaseConn($conn); - call_user_func($rel_cb, $conn); - if ((!empty($userinfo)) && (!empty($userinfo['zone']))) - $this->zone = $userinfo['zone']; - return $userinfo; - } - - /** - * Get a temp password for current user - * @return string of temp password - */ - public function getTempPassword($get_cb = array('RODSConnManager', 'getConn'), - $rel_cb = array('RODSConnManager', 'releaseConn')) - { - //$conn = RODSConnManager::getConn($this); - $conn = call_user_func_array($get_cb, array(&$this)); - //TODO: Overcome fear of passing $this by reference or stop passing $this by reference - $temppass = $conn->getTempPassword(); - // RODSConnManager::releaseConn($conn); - call_user_func($rel_cb, $conn); - return $temppass; - } - - /** - * Get user's home directory - * @param string init_path, if specified, it will overwrite the default path - * @return ProdsDir User's home directory - */ - public function getUserHomeDir($init_path = NULL) - { - if (empty($this->zone)) - $this->getUserInfo(); - if (isset($init_path)) { - $dir = new ProdsDir($this, $init_path); - if ($dir->exists()) { - return $dir; - } - } - return new ProdsDir($this, "/$this->zone/home/$this->user"); - } - - /** - * Get user's home directory URI - * @param string init_path, if specified, it will overwrite the default path - * @return String User's home - */ - public function getUserHomeDirURI($init_path = NULL) - { - $dir = $this->getUserHomeDir($init_path); - return $dir->toURI(); - } - - /** - * Get user's trash directory - * @return ProdsDir User's trash dir - */ - public function getUserTrashDir() - { - if (empty($this->zone)) - $this->getUserInfo(); - return new ProdsDir($this, "/$this->zone/trash/home/$this->user"); - } - - /** - * Get user's trash directory URI - * @return String User's trash URI - */ - public function getUserTrashDirURI() - { - $dir = $this->getUserTrashDir(); - 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 deleted file mode 100644 index c10f880a5cc435da896b161edc6e531751680788..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RODSConn.class.php +++ /dev/null @@ -1,1613 +0,0 @@ - - * @copyright Copyright © 2007, TBD - * @package RODSConn - */ - - -require_once("autoload.inc.php"); -require_once("RodsAPINum.inc.php"); -require_once("RodsConst.inc.php"); - -if (!defined("O_RDONLY")) define ("O_RDONLY", 0); -if (!defined("O_WRONLY")) define ("O_WRONLY", 1); -if (!defined("O_RDWR")) define ("O_RDWR", 2); -if (!defined("O_TRUNC")) define ("O_TRUNC", 512); - -class RODSConn -{ - private $conn; // (resource) socket connection to RODS server - - private $account; // RODS user account - - private $idle; - private $id; - - public $connected; - - /** - * Makes a new connection to RODS server, with supplied user information (name, passwd etc.) - * @param string $host hostname - * @param string $port port number - * @param string $user username - * @param string $pass passwd - * @param string $zone zonename - */ - public function __construct(RODSAccount &$account) - { - $this->account=$account; - $this->connected=false; - $this->conn=NULL; - $this->idle=true; - } - - public function __destruct() - { - if ($this->connected===true) - $this->disconnect(); - } - - public function equals(RODSConn $other) - { - return $this->account->equals($other->account); - } - - public function getSignature() - { - return $this->account->getSignature(); - } - - public function lock() - { - $this->idle=false; - } - - public function unlock() - { - $this->idle=true; - } - - public function isIdle() - { - return ($this->idle); - } - - public function getId() - { - return $this->id; - } - - public function setId($id) - { - $this->id=$id; - } - - public function getAccount() - { - return $this->account; - } - - public function connect() - { - $host=$this->account->host; - $port=$this->account->port; - $user=$this->account->user; - $pass=$this->account->pass; - $zone=$this->account->zone; - $auth_type = $this->account->auth_type; - - // if we're going to use PAM, set up the socket context - // options for SSL connections when we open the connection - if (strcasecmp($auth_type, "PAM") == 0) { - $ssl_opts = array('ssl' => array()); - if (array_key_exists('ssl', $GLOBALS['PRODS_CONFIG'])) { - $ssl_conf = $GLOBALS['PRODS_CONFIG']['ssl']; - if (array_key_exists('verify_peer', $ssl_conf)) { - if (strcasecmp("true", $ssl_conf['verify_peer']) == 0) { - $ssl_opts['ssl']['verify_peer'] = true; - } - } - if (array_key_exists('allow_self_signed', $ssl_conf)) { - if (strcasecmp("true", $ssl_conf['allow_self_signed']) == 0) { - $ssl_opts['ssl']['allow_self_signed'] = true; - } - } - if (array_key_exists('cafile', $ssl_conf)) { - $ssl_opts['ssl']['cafile'] = $ssl_conf['cafile']; - } - if (array_key_exists('capath', $ssl_conf)) { - $ssl_opts['ssl']['capath'] = $ssl_conf['capath']; - } - } - $ssl_ctx = stream_context_get_default($ssl_opts); - $sock_timeout = ini_get("default_socket_timeout"); - $conn = @stream_socket_client("tcp://$host:$port", $errno, $errstr, - $sock_timeout, STREAM_CLIENT_CONNECT, $ssl_ctx); - } - else { - $conn = @fsockopen($host, $port, $errno, $errstr); - } - if (!$conn) - throw new RODSException("Connection to '$host:$port' failed.1: ($errno)$errstr. ", - "SYS_SOCK_OPEN_ERR"); - $this->conn=$conn; - - // connect to RODS server - $msg=RODSMessage::packConnectMsg($user,$zone); - fwrite($conn, $msg); - - $msg=new RODSMessage(); - $intInfo=$msg->unpack($conn); - if ($intInfo<0) - { - throw new RODSException("Connection to '$host:$port' failed.2. User: $user Zone: $zone", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - - // are we doing PAM authentication - if (strcasecmp($auth_type, "PAM") == 0) - { - // Ask server to turn on SSL - $req_packet = new RP_sslStartInp(); - $msg=new RODSMessage("RODS_API_REQ_T", $req_packet, - $GLOBALS['PRODS_API_NUMS']['SSL_START_AN']); - fwrite($conn, $msg->pack()); - $msg=new RODSMessage(); - $intInfo=$msg->unpack($conn); - if ($intInfo<0) - { - throw new RODSException("Connection to '$host:$port' failed.ssl1. User: $user Zone: $zone", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - // Turn on SSL on our side - if (!stream_socket_enable_crypto($conn, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) { - throw new RODSException("Error turning on SSL on connection to server '$host:$port'."); - } - - // all good ... do the PAM authentication over the encrypted connection - $req_packet = new RP_pamAuthRequestInp($user, $pass, -1); - $msg=new RODSMessage("RODS_API_REQ_T", $req_packet, - $GLOBALS['PRODS_API_NUMS']['PAM_AUTH_REQUEST_AN']); - fwrite($conn, $msg->pack()); - $msg=new RODSMessage(); - $intInfo=$msg->unpack($conn); - if ($intInfo<0) - { - throw new RODSException("PAM auth failed at server '$host:$port' User: $user Zone: $zone", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - - // Update the account object with the temporary password - // and set the auth_type to irods for this connection - $pack = $msg->getBody(); - $pass = $this->account->pass = $pack->irodsPamPassword; - - // Done authentication ... turn ask the server to turn off SSL - $req_packet = new RP_sslEndInp(); - $msg=new RODSMessage("RODS_API_REQ_T", $req_packet, - $GLOBALS['PRODS_API_NUMS']['SSL_END_AN']); - fwrite($conn, $msg->pack()); - $msg=new RODSMessage(); - $intInfo=$msg->unpack($conn); - if ($intInfo<0) - { - throw new RODSException("Connection to '$host:$port' failed.ssl2. User: $user Zone: $zone", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - // De-activate SSL on the connection - stream_socket_enable_crypto($conn, false); - - // nasty hack ... some characters are left over to be read - // from the socket after the SSL shutdown, and I can't - // figure out how to consume them via SSL routines, so I - // just read them and throw them away. They need to be consumed - // or later reads get out of sync with the API responses - $r = array($conn); - $w = $e = null; - while (stream_select($r, $w, $e, 0) > 0) { - $s = fread($conn, 1); - } - - } - - // request authentication - $msg=new RODSMessage("RODS_API_REQ_T",NULL, - $GLOBALS['PRODS_API_NUMS']['AUTH_REQUEST_AN']); - fwrite($conn, $msg->pack()); - - // get chalange string - $msg=new RODSMessage(); - $intInfo=$msg->unpack($conn); - if ($intInfo<0) - { - throw new RODSException("Connection to '$host:$port' failed.3. User: $user Zone: $zone", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - $pack=$msg->getBody(); - $challenge_b64encoded=$pack->challenge; - $challenge=base64_decode($challenge_b64encoded); - - // encode chalange with passwd - $pad_pass=str_pad($pass,MAX_PASSWORD_LEN,"\0"); - $pwmd5=md5($challenge.$pad_pass,true); - for ($i=0;$ipack()); - - // check if we are connected - // get chalange string - $msg=new RODSMessage(); - $intInfo=$msg->unpack($conn); - if ($intInfo<0) - { - $this->disconnect(); - throw new RODSException("Connection to '$host:$port' failed.4 (login failed, possible wrong user/passwd). User: $user Pass: $pass Zone: $zone", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - - $this->connected=true; - // use ticket if specified - if( !empty($this->account->ticket) ) { - $ticket_packet = new RP_ticketAdminInp('session', $this->account->ticket); - $msg = new RODSMessage('RODS_API_REQ_T', $ticket_packet, 723); - fwrite($conn, $msg->pack()); - - // get response - $msg = new RODSMessage(); - $intInfo = $msg->unpack($conn); - if ($intInfo < 0) { - $this->disconnect(); - throw new RODSException('Cannot set session ticket.', - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - } - - } - /** - * Close the connection (socket) - */ - public function disconnect($force = false) - { - if (($this->connected === false) && ($force !== true)) - return; - - $msg = new RODSMessage("RODS_DISCONNECT_T"); - fwrite($this->conn, $msg->pack()); - fclose($this->conn); - $this->connected = false; - } - - public function createTicket( $object, $permission = 'read', $ticket = '' ) - { - if ($this->connected === false) { - throw new RODSException("createTicket needs an active connection, but the connection is currently inactive", - 'PERR_CONN_NOT_ACTIVE'); - } - if( empty($ticket) ) - { - // create a 16 characters long ticket - $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; - for ($i = 0; $i < 16; $i++) - $ticket .= $chars[mt_rand(1, strlen($chars))-1]; - } - - $ticket_packet = new RP_ticketAdminInp('create', $ticket, $permission, $object); - $msg = new RODSMessage('RODS_API_REQ_T', $ticket_packet, 723); - fwrite($this->conn, $msg->pack()); - - // get response - $msg = new RODSMessage(); - $intInfo = $msg->unpack($this->conn); - if ($intInfo < 0) { - throw new RODSException('Cannot create ticket "'.$ticket.'" for object "'.$object.'" with permission "'.$permission.'".', - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - - return $ticket; - } - - public function deleteTicket( $ticket ) - { - if ($this->connected === false) { - throw new RODSException("deleteTicket needs an active connection, but the connection is currently inactive", - 'PERR_CONN_NOT_ACTIVE'); - } - $ticket_packet = new RP_ticketAdminInp('delete', $ticket); - $msg = new RODSMessage('RODS_API_REQ_T', $ticket_packet, 723); - fwrite($this->conn, $msg->pack()); - - // get response - $msg = new RODSMessage(); - $intInfo = $msg->unpack($this->conn); - if ($intInfo < 0) { - throw new RODSException('Cannot delete ticket "'.$ticket.'".', - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - } - - /** - * Get a temp password from the server. - * @param string $key key obtained from server to generate password. If this key is not specified, this function will ask server for a new key. - * @return string temp password - */ - public function getTempPassword($key = NULL) - { - if ($this->connected === false) { - throw new RODSException("getTempPassword needs an active connection, but the connection is currently inactive", - 'PERR_CONN_NOT_ACTIVE'); - } - if (NULL == $key) - $key = $this->getKeyForTempPassword(); - - $auth_str = str_pad($key . $this->account->pass, 100, "\0"); - $pwmd5 = bin2hex(md5($auth_str, true)); - - return $pwmd5; - } - - - /** - * Get a key for temp password from the server. this key can then be hashed together with real password to generate an temp password. - * @return string key for temp password - */ - public function getKeyForTempPassword() - { - if ($this->connected === false) { - throw new RODSException("getKeyForTempPassword needs an active connection, but the connection is currently inactive", - 'PERR_CONN_NOT_ACTIVE'); - } - $msg = new RODSMessage("RODS_API_REQ_T", null, - $GLOBALS['PRODS_API_NUMS']['GET_TEMP_PASSWORD_AN']); - - fwrite($this->conn, $msg->pack()); // send it - $msg = new RODSMessage(); - $intInfo = (int)$msg->unpack($this->conn); - if ($intInfo < 0) { - throw new RODSException("RODSConn::getKeyForTempPassword has got an error from the server", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - return ($msg->getBody()->stringToHashWith); - } - - /** - * Get user information - * @param string username, if not specified, it will use current username instead - * @return array with fields: id, name, type, zone, dn, info, comment, ctime, mtime. If user not found return empty array. - */ - public function getUserInfo($user = NULL) - { - if (!isset($user)) - $user = $this->account->user; - - // set selected value - $select_val = array("COL_USER_ID", "COL_USER_NAME", "COL_USER_TYPE", - "COL_USER_ZONE", "COL_USER_DN", "COL_USER_INFO", - "COL_USER_COMMENT", "COL_USER_CREATE_TIME", "COL_USER_MODIFY_TIME"); - $cond = array(new RODSQueryCondition("COL_USER_NAME", $user)); - $que_result = $this->genQuery($select_val, $cond); - - if (false === $que_result) { - return array(); - } else { - $retval = array(); - $retval['id'] = $que_result["COL_USER_ID"][0]; - $retval['name'] = $que_result["COL_USER_NAME"][0]; - $retval['type'] = $que_result["COL_USER_TYPE"][0]; - // $retval['zone']=$que_result["COL_USER_ZONE"][0]; This can cause confusion if - // username is same as another federated grid - sometimes multiple records are returned. - // Changed source to force user to provide a zone until another method is suggested. - if ($this->account->zone == "") { - $retval['zone'] = $que_result["COL_USER_ZONE"][0]; - } else { - $retval['zone'] = $this->account->zone; - } - $retval['dn'] = $que_result["COL_USER_DN"][0]; - $retval['info'] = $que_result["COL_USER_INFO"][0]; - $retval['comment'] = $que_result["COL_USER_COMMENT"][0]; - $retval['ctime'] = $que_result["COL_USER_CREATE_TIME"][0]; - $retval['mtime'] = $que_result["COL_USER_MODIFY_TIME"][0]; - - return $retval; - } - } - - /** - * Make a new directory - * @param string $dir input direcotory path string - */ - public function mkdir($dir) - { - $collInp_pk = new RP_CollInp($dir); - $msg = new RODSMessage("RODS_API_REQ_T", $collInp_pk, - $GLOBALS['PRODS_API_NUMS']['COLL_CREATE_AN']); - fwrite($this->conn, $msg->pack()); // send it - $msg = new RODSMessage(); - $intInfo = (int)$msg->unpack($this->conn); - if ($intInfo < 0) { - if (RODSException::rodsErrCodeToAbbr($intInfo) == 'CATALOG_ALREADY_HAS_ITEM_BY_THAT_NAME') { - throw new RODSException("Collection '$dir' Already exists!", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - throw new RODSException("RODSConn::mkdir has got an error from the server", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - } - - /** - * remove a directory - * @param string $dirpath input direcotory path string - * @param boolean $recursive whether recursively delete all child files and child directories recursively. - * @param boolean $force whether force delete the file/dir. If force delete, all files will be wiped physically. Else, they are moved to trash derectory. - * @param array $additional_flags An array of keyval pairs (array) reprenting additional flags passed to the server/client message. Each keyval pair is an array with first element repsenting the key, and second element representing the value (default to ''). Supported keys are: - * - 'irodsRmTrash' - whether this rm is a rmtrash operation - * - 'irodsAdminRmTrash' - whether this rm is a rmtrash operation done by admin user - * @param mixed $status_update_func It can be an string or array that represents the status update function (see http://us.php.net/manual/en/language.pseudo-types.php#language.types.callback), which can update status based on the server status update. Leave it blank or 'null' if there is no need to update the status. The function will be called with an assossive arry as parameter, supported fields are: - * - 'filesCnt' - finished number of files from previous update (normally 10 but not the last update) - * - 'lastObjPath' - last object that was processed. - * If this function returns 1, progress will be stopped. - */ - public function rmdir($dirpath, $recursive = true, $force = false, - $additional_flags = array(), $status_update_func = null) - { - $options = array(); - if ($force === true) { - $options["forceFlag"] = ""; - } - if ($recursive === true) { - $options["recursiveOpr"] = ""; - } - foreach ($additional_flags as $flagkey => $flagval) { - if (!empty($flagkey)) - $options[$flagkey] = $flagval; - } - $options_pk = new RP_KeyValPair(); - $options_pk->fromAssocArray($options); - - $collInp_pk = new RP_CollInp($dirpath, $options_pk); - $msg = new RODSMessage("RODS_API_REQ_T", $collInp_pk, - $GLOBALS['PRODS_API_NUMS']['RM_COLL_AN']); - fwrite($this->conn, $msg->pack()); // send it - $msg = new RODSMessage(); - $intInfo = (int)$msg->unpack($this->conn); - while ($msg->getBody() instanceof RP_CollOprStat) { - if (is_callable($status_update_func)) // call status update function if requested - { - $status = call_user_func($status_update_func, - array( - "filesCnt" => $msg->getBody()->filesCnt, - "lastObjPath" => $msg->getBody()->lastObjPath - ) - ); - if (false === $status) - throw new Exception("status_update_func failed!"); - else if (1 == $status) { - return; - } - } - - if ($intInfo == 0) //stop here if intinfo =0 (process completed) - break; - $this->replyStatusPacket(); - $msg = new RODSMessage(); - $intInfo = (int)$msg->unpack($this->conn); - } - - if ($intInfo < 0) { - if (RODSException::rodsErrCodeToAbbr($intInfo) == 'CAT_NO_ROWS_FOUND') { - return; - } - throw new RODSException("RODSConn::rmdir has got an error from the server", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - } - - // this is a temp work around for status packet reply. - // in status packet protocol, the server gives a status update packet: - // SYS_SVR_TO_CLI_COLL_STAT (99999996) - // and it expects an integer only SYS_CLI_TO_SVR_COLL_STAT_REPLY (99999997) - private function replyStatusPacket() - { - fwrite($this->conn, pack("N", 99999997)); - } - - /** - * Get children direcotories of input direcotory path string - * @param string $dir input direcotory path string - * @return an array of string, each string is the name of a child directory. This fuction return empty array, if there is no child direcotry found - */ - public function getChildDir($dir, $startingInx = 0, $maxresults = 500, - &$total_num_rows = -1) - { - $cond = array(new RODSQueryCondition("COL_COLL_PARENT_NAME", $dir)); - $que_result = $this->genQuery(array("COL_COLL_NAME"), $cond, array(), - $startingInx, $maxresults, true, array(), 0, $total_num_rows); - - if (false === $que_result) { - return array(); - } else { - if ($dir == "/") { - $result = array(); - foreach ($que_result["COL_COLL_NAME"] as $childdir) { - if ($childdir != "/") { - $result[] = $childdir; - } - } - return $result; - } - - return array_values($que_result["COL_COLL_NAME"]); - } - } - - /** - * Get children direcotories, with basic stats, of input direcotory path string - * @param string $dir input direcotory path string - * @param $orderby An associated array specifying how to sort the result by attributes. Each array key is the attribute, array val is 0 (assendent) or 1 (dessendent). The supported attributes are "name", "owner", "mtime". - * @return an array of RODSDirStats - */ - public function getChildDirWithStats($dir, $orderby = array(), $startingInx = 0, - $maxresults = 500, &$total_num_rows = -1) - { - // set selected value - $select_val = array("COL_COLL_NAME", "COL_COLL_ID", "COL_COLL_OWNER_NAME", - "COL_COLL_OWNER_ZONE", "COL_COLL_CREATE_TIME", "COL_COLL_MODIFY_TIME", - "COL_COLL_COMMENTS"); - $select_attr = array(); - - // set order by - if (!empty($orderby)) { - $select_attr = array_fill(0, count($select_val), 1); - foreach ($orderby as $key => $val) { - if ($key == "name") { - if ($val == 0) $select_attr[0] = ORDER_BY; - else $select_attr[0] = ORDER_BY_DESC; - } else - if ($key == "owner") { - if ($val == 0) $select_attr[2] = ORDER_BY; - else $select_attr[2] = ORDER_BY_DESC; - } else - if ($key == "mtime") { - if ($val == 0) $select_attr[5] = ORDER_BY; - else $select_attr[5] = ORDER_BY_DESC; - } - } - } - - $cond = array(new RODSQueryCondition("COL_COLL_PARENT_NAME", $dir)); - $continueInx = 0; - $que_result = $this->genQuery($select_val, $cond, - array(), $startingInx, $maxresults, true, - $select_attr, $continueInx, $total_num_rows); - - if (false === $que_result) { - return array(); - } else { - $ret_val = array(); - for ($i = 0; $i < count($que_result['COL_COLL_ID']); $i++) { - if ($que_result['COL_COLL_NAME'][$i] != "/") { - $ret_val[] = new RODSDirStats( - basename($que_result['COL_COLL_NAME'][$i]), - $que_result['COL_COLL_OWNER_NAME'][$i], - $que_result['COL_COLL_OWNER_ZONE'][$i], - $que_result['COL_COLL_MODIFY_TIME'][$i], - $que_result['COL_COLL_CREATE_TIME'][$i], - $que_result['COL_COLL_ID'][$i], - $que_result['COL_COLL_COMMENTS'][$i] - ); - } - } - return $ret_val; - } - } - - /** - * Get children file of input direcotory path string - * @param string $dir input direcotory path string - * @return an array of string, each string is the name of a child file. This fuction return empty array, if there is no child direcotry found. - */ - public function getChildFile($dir, $startingInx = 0, $maxresults = 500, - &$total_num_rows = -1) - { - $cond = array(new RODSQueryCondition("COL_COLL_NAME", $dir)); - $que_result = $this->genQuery(array("COL_DATA_NAME"), $cond, array(), - $startingInx, $maxresults, true, array(), 0, $total_num_rows); - - if (false === $que_result) { - return array(); - } else { - return array_values($que_result["COL_DATA_NAME"]); - } - } - - /** - * Get children file, with basic stats, of input direcotory path string - * The stats - * @param string $dir input direcotory path string - * @param $orderby An associated array specifying how to sort the result by attributes. Each array key is the attribute, array val is 0 (assendent) or 1 (dessendent). The supported attributes are "name", "size", "owner", "mtime". - * @return an array of RODSFileStats - */ - public function getChildFileWithStats($dir, array $orderby = array(), - $startingInx = 0, $maxresults = 500, &$total_num_rows = -1) - { - // set selected value - $select_val = array("COL_DATA_NAME", "COL_D_DATA_ID", "COL_DATA_TYPE_NAME", - "COL_D_RESC_NAME", "COL_DATA_SIZE", "COL_D_OWNER_NAME", - "COL_D_CREATE_TIME", "COL_D_MODIFY_TIME"); - $select_attr = array(); - - // set order by - if (!empty($orderby)) { - $select_attr = array_fill(0, count($select_val), 1); - foreach ($orderby as $key => $val) { - if ($key == "name") { - if ($val == 0) $select_attr[0] = ORDER_BY; - else $select_attr[0] = ORDER_BY_DESC; - } else - if ($key == "size") { - if ($val == 0) $select_attr[4] = ORDER_BY; - else $select_attr[4] = ORDER_BY_DESC; - } else - if ($key == "owner") { - if ($val == 0) $select_attr[5] = ORDER_BY; - else $select_attr[5] = ORDER_BY_DESC; - } else - if ($key == "mtime") { - if ($val == 0) $select_attr[7] = ORDER_BY; - else $select_attr[7] = ORDER_BY_DESC; - } - } - } - - $cond = array(new RODSQueryCondition("COL_COLL_NAME", $dir)); - $continueInx = 0; - $que_result = $this->genQuery($select_val, $cond, - array(), $startingInx, $maxresults, true, - $select_attr, $continueInx, $total_num_rows); - - - if (false === $que_result) { - return array(); - } else { - $ret_val = array(); - for ($i = 0; $i < count($que_result['COL_D_DATA_ID']); $i++) { - $ret_val[] = new RODSFileStats( - $que_result['COL_DATA_NAME'][$i], - $que_result['COL_DATA_SIZE'][$i], - $que_result['COL_D_OWNER_NAME'][$i], - $que_result['COL_D_MODIFY_TIME'][$i], - $que_result['COL_D_CREATE_TIME'][$i], - $que_result['COL_D_DATA_ID'][$i], - $que_result['COL_DATA_TYPE_NAME'][$i], - $que_result['COL_D_RESC_NAME'][$i] - ); - } - return $ret_val; - } - } - - /** - * Get basic stats, of input dir path string - * @param string $dirpath input dir path string - * @return RODSDirStats. If dir does not exists, return fales. - */ - public function getDirStats($dirpath) - { - $cond = array(new RODSQueryCondition("COL_COLL_NAME", $dirpath)); - - $que_result = $this->genQuery( - array("COL_COLL_NAME", "COL_COLL_ID", "COL_COLL_OWNER_NAME", - "COL_COLL_OWNER_ZONE", "COL_COLL_CREATE_TIME", "COL_COLL_MODIFY_TIME", - "COL_COLL_COMMENTS"), - $cond, array(), 0, 1, false); - if ($que_result === false) return false; - - $stats = new RODSDirStats( - basename($que_result['COL_COLL_NAME'][0]), - $que_result['COL_COLL_OWNER_NAME'][0], - $que_result['COL_COLL_OWNER_ZONE'][0], - $que_result['COL_COLL_MODIFY_TIME'][0], - $que_result['COL_COLL_CREATE_TIME'][0], - $que_result['COL_COLL_ID'][0], - $que_result['COL_COLL_COMMENTS'][0] - ); - return $stats; - } - - /** - * Get basic stats, of input file path string - * @param string $filepath input file path string - * @return RODSFileStats. If file does not exists, return fales. - */ - public function getFileStats($filepath) - { - $parent = dirname($filepath); - $filename = basename($filepath); - - $cond = array(new RODSQueryCondition("COL_COLL_NAME", $parent), - new RODSQueryCondition("COL_DATA_NAME", $filename)); - - $que_result = $this->genQuery( - array("COL_DATA_NAME", "COL_D_DATA_ID", "COL_DATA_TYPE_NAME", - "COL_D_RESC_NAME", "COL_DATA_SIZE", "COL_D_OWNER_NAME", "COL_D_OWNER_ZONE", - "COL_D_CREATE_TIME", - "COL_D_MODIFY_TIME", "COL_D_COMMENTS"), - $cond, array(), 0, 1, false); - if ($que_result === false) return false; - - $stats = new RODSFileStats( - $que_result['COL_DATA_NAME'][0], - $que_result['COL_DATA_SIZE'][0], - $que_result['COL_D_OWNER_NAME'][0], - $que_result['COL_D_OWNER_ZONE'][0], - $que_result['COL_D_MODIFY_TIME'][0], - $que_result['COL_D_CREATE_TIME'][0], - $que_result['COL_D_DATA_ID'][0], - $que_result['COL_DATA_TYPE_NAME'][0], - $que_result['COL_D_RESC_NAME'][0], - $que_result['COL_D_COMMENTS'][0]); - return $stats; - } - - /** - * Check whether a directory (in string) exists on RODS server. - * @return true/false - */ - public function dirExists($dir) - { - $cond = array(new RODSQueryCondition("COL_COLL_NAME", $dir)); - $que_result = $this->genQuery(array("COL_COLL_ID"), $cond); - - if ($que_result === false) - return false; - else - return true; - } - - /** - * Check whether a file (in string) exists on RODS server. - * @return true/false - */ - public function fileExists($filepath, $rescname = NULL) - { - $parent = dirname($filepath); - $filename = basename($filepath); - if (empty($rescname)) { - $cond = array(new RODSQueryCondition("COL_COLL_NAME", $parent), - new RODSQueryCondition("COL_DATA_NAME", $filename)); - $que_result = $this->genQuery(array("COL_D_DATA_ID"), $cond); - } else { - $cond = array(new RODSQueryCondition("COL_COLL_NAME", $parent), - new RODSQueryCondition("COL_DATA_NAME", $filename), - new RODSQueryCondition("COL_D_RESC_NAME", $rescname)); - $que_result = $this->genQuery(array("COL_D_DATA_ID"), $cond); - } - - if ($que_result === false) - return false; - else - return true; - } - - /** - * Replicate file to resources with options. - * @param string $path_src full path for the source file - * @param string $desc_resc destination resource - * @param array $options an assosive array of options: - * - 'all' (boolean): only meaningful if input resource is a resource group. Replicate to all the resources in the resource group. - * - 'backupMode' (boolean): if a good copy already exists in this resource, don't make another copy. - * - 'admin' (boolean): admin user uses this option to backup/replicate other users files - * - 'replNum' (integer): the replica to copy, typically not needed - * - 'srcResc' (string): specifies the source resource of the data object to be replicate, only copies stored in this resource will be replicated. Otherwise, one of the copy will be replicated - * These options are all 'optional', if omitted, the server will try to do it anyway - * @return number of bytes written if success, in case of faliure, throw an exception - */ - public function repl($path_src, $desc_resc, array $options = array()) - { - require_once(dirname(__FILE__) . "/RODSObjIOOpr.inc.php"); - require_once(dirname(__FILE__) . "/RodsGenQueryKeyWd.inc.php"); - - $optype = REPLICATE_OPR; - - $opt_arr = array(); - $opt_arr[$GLOBALS['PRODS_GENQUE_KEYWD']['DEST_RESC_NAME_KW']] = $desc_resc; - foreach ($options as $option_key => $option_val) { - switch ($option_key) { - case 'all': - if ($option_val === true) - $opt_arr[$GLOBALS['PRODS_GENQUE_KEYWD']['ALL_KW']] = ''; - break; - - case 'admin': - if ($option_val === true) - $opt_arr[$GLOBALS['PRODS_GENQUE_KEYWD']['IRODS_ADMIN_KW']] = ''; - break; - - case 'replNum': - $opt_arr[$GLOBALS['PRODS_GENQUE_KEYWD']['REPL_NUM_KW']] = $option_val; - break; - - case 'backupMode': - if ($option_val === true) - $opt_arr[$GLOBALS['PRODS_GENQUE_KEYWD'] - ['BACKUP_RESC_NAME_KW']] = $desc_resc; - break; - - default: - throw new RODSException("Option '$option_key'=>'$option_val' is not supported", - 'PERR_USER_INPUT_ERROR'); - } - } - - $keyvalpair = new RP_KeyValPair(); - $keyvalpair->fromAssocArray($opt_arr); - - $inp_pk = new RP_DataObjInp($path_src, 0, 0, 0, 0, 0, $optype, $keyvalpair); - - $msg = new RODSMessage("RODS_API_REQ_T", $inp_pk, - $GLOBALS['PRODS_API_NUMS']['DATA_OBJ_REPL_AN']); - fwrite($this->conn, $msg->pack()); // send it - $msg = new RODSMessage(); - $intInfo = (int)$msg->unpack($this->conn); - if ($intInfo < 0) { - throw new RODSException("RODSConn::repl has got an error from the server", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - - $retpk = $msg->getBody(); - return $retpk->bytesWritten; - } - - /** - * Rename path_src to path_dest. - * @param string $path_src - * @param string $path_dest - * @param integer $path_type if 0, then path type is file, if 1, then path type if directory - * @return true/false - */ - public function rename($path_src, $path_dest, $path_type) - { - require_once(dirname(__FILE__) . "/RODSObjIOOpr.inc.php"); - - if ($path_type === 0) { - $path_type_magic_num = RENAME_DATA_OBJ; - } else { - $path_type_magic_num = RENAME_COLL; - } - $src_pk = new RP_DataObjInp($path_src, 0, 0, 0, 0, 0, $path_type_magic_num); - $dest_pk = new RP_DataObjInp($path_dest, 0, 0, 0, 0, 0, $path_type_magic_num); - $inp_pk = new RP_DataObjCopyInp($src_pk, $dest_pk); - $msg = new RODSMessage("RODS_API_REQ_T", $inp_pk, - $GLOBALS['PRODS_API_NUMS']['DATA_OBJ_RENAME_AN']); - fwrite($this->conn, $msg->pack()); // send it - $msg = new RODSMessage(); - $intInfo = (int)$msg->unpack($this->conn); - if ($intInfo < 0) { - throw new RODSException("RODSConn::rename has got an error from the server", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - } - - /** - * Open a file path (string) exists on RODS server. - * - * @param string $path file path - * @param string $mode open mode. Supported modes are: - * 'r' Open for reading only; place the file pointer at the beginning of the file. - * 'r+' Open for reading and writing; place the file pointer at the beginning of the file. - * 'w' Open for writing only; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it. - * 'w+' Open for reading and writing; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it. - * 'a' Open for writing only; place the file pointer at the end of the file. If the file does not exist, attempt to create it. - * 'a+' Open for reading and writing; place the file pointer at the end of the file. If the file does not exist, attempt to create it. - * 'x' Create and open for writing only; place the file pointer at the beginning of the file. If the file already exists, the fopen() call will fail by returning FALSE and generating an error of level E_WARNING. If the file does not exist, attempt to create it. This is equivalent to specifying O_EXCL|O_CREAT flags for the underlying open(2) system call. - * 'x+' Create and open for reading and writing; place the file pointer at the beginning of the file. If the file already exists, the fopen() call will fail by returning FALSE and generating an error of level E_WARNING. If the file does not exist, attempt to create it. This is equivalent to specifying O_EXCL|O_CREAT flags for the underlying open(2) system call. - * @param postion updated position - * @param string $rescname. Note that this parameter is required only if the file does not exists (create mode). If the file already exists, and if file resource is unknown or unique or you-dont-care for that file, leave the field, or pass NULL. - * @param boolean $assum_file_exists. This parameter specifies whether file exists. If the value is false, this mothod will check with RODS server to make sure. If value is true, the check will NOT be done. Default value is false. - * @param string $filetype. This parameter only make sense when you want to specify the file type, if file does not exists (create mode). If not specified, it defaults to "generic" - * @param integer $cmode. This parameter is only used for "createmode". It specifies the file mode on physical storage system (RODS vault), in octal 4 digit format. For instance, 0644 is owner readable/writeable, and nothing else. 0777 is all readable, writable, and excutable. If not specified, and the open flag requirs create mode, it defaults to 0644. - * @return integer level 1 descriptor - */ - public function openFileDesc($path, $mode, &$position, $rescname = NULL, - $assum_file_exists = false, $filetype = 'generic', $cmode = 0644) - { - $create_if_not_exists = false; - $error_if_exists = false; - $seek_to_end_of_file = false; - $position = 0; - - switch ($mode) { - case 'r': - $open_flag = O_RDONLY; - break; - case 'r+': - $open_flag = O_RDWR; - break; - case 'w': - $open_flag = O_WRONLY|O_TRUNC; - $create_if_not_exists = true; - break; - case 'w+': - $open_flag = O_RDWR|O_TRUNC; - $create_if_not_exists = true; - break; - case 'a': - $open_flag = O_WRONLY; - $create_if_not_exists = true; - $seek_to_end_of_file = true; - break; - case 'a+': - $open_flag = O_RDWR; - $create_if_not_exists = true; - $seek_to_end_of_file = true; - break; - case 'x': - $open_flag = O_WRONLY; - $create_if_not_exists = true; - $error_if_exists = true; - break; - case 'x+': - $open_flag = O_RDWR; - $create_if_not_exists = true; - $error_if_exists = true; - break; - default: - throw new RODSException("RODSConn::openFileDesc() does not recognize input mode:'$mode' ", - "PERR_USER_INPUT_ERROR"); - } - - if ($assum_file_exists === true) - $file_exists = true; - else - $file_exists = $this->fileExists($path, $rescname); - - if (($error_if_exists) && ($file_exists === true)) { - throw new RODSException("RODSConn::openFileDesc() expect file '$path' dose not exists with mode '$mode', but the file does exists", - "PERR_USER_INPUT_ERROR"); - } - - - if (($create_if_not_exists) && ($file_exists === false)) // create new file - { - $keyValPair_pk = new RP_KeyValPair(2, array("rescName", "dataType"), - array("$rescname", "$filetype")); - $dataObjInp_pk = new RP_DataObjInp($path, $cmode, $open_flag, 0, -1, 0, 0, - $keyValPair_pk); - $api_num = $GLOBALS['PRODS_API_NUMS']['DATA_OBJ_CREATE_AN']; - } else // open existing file - { - // open the file and get descriptor - if (isset($rescname)) { - $keyValPair_pk = new RP_KeyValPair(1, array("rescName"), - array("$rescname")); - $dataObjInp_pk = new RP_DataObjInp - ($path, 0, $open_flag, 0, -1, 0, 0, $keyValPair_pk); - } else { - $dataObjInp_pk = new RP_DataObjInp - ($path, 0, $open_flag, 0, -1, 0, 0); - } - $api_num = $GLOBALS['PRODS_API_NUMS']['DATA_OBJ_OPEN_AN']; - } - - $msg = new RODSMessage("RODS_API_REQ_T", $dataObjInp_pk, $api_num); - fwrite($this->conn, $msg->pack()); // send it - // get value back - $msg = new RODSMessage(); - $intInfo = (int)$msg->unpack($this->conn); - if ($intInfo < 0) { - if (RODSException::rodsErrCodeToAbbr($intInfo) == 'CAT_NO_ROWS_FOUND') { - throw new RODSException("trying to open a file '$path' " . - "which does not exists with mode '$mode' ", - "PERR_USER_INPUT_ERROR"); - } - throw new RODSException("RODSConn::openFileDesc has got an error from the server", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - $l1desc = $intInfo; - - if ($seek_to_end_of_file === true) { - $position = $this->fileSeek($l1desc, 0, SEEK_END); - } - - return $l1desc; - } - - /** - * unlink the file on server - * @param string $path path of the file - * @param string $rescname resource name. Not required if there is no other replica. - * @param boolean $force flag (true or false) indicating whether force delete or not. - * - */ - public function fileUnlink($path, $rescname = NULL, $force = false) - { - $options = array(); - if (isset($rescname)) { - $options['rescName'] = $rescname; - } - if ($force == true) { - $options['forceFlag'] = ""; - } - - if (!empty($options)) { - $options_pk = new RP_KeyValPair(); - $options_pk->fromAssocArray($options); - $dataObjInp_pk = new RP_DataObjInp - ($path, 0, 0, 0, -1, 0, 0, $options_pk); - } else { - $dataObjInp_pk = new RP_DataObjInp - ($path, 0, 0, 0, -1, 0, 0); - } - - $msg = new RODSMessage("RODS_API_REQ_T", $dataObjInp_pk, - $GLOBALS['PRODS_API_NUMS']['DATA_OBJ_UNLINK_AN']); - fwrite($this->conn, $msg->pack()); // send it - // get value back - $msg = new RODSMessage(); - $intInfo = (int)$msg->unpack($this->conn); - if ($intInfo < 0) { - if (RODSException::rodsErrCodeToAbbr($intInfo) == 'CAT_NO_ROWS_FOUND') { - throw new RODSException("trying to unlink a file '$path' " . - "which does not exists", - "PERR_USER_INPUT_ERROR"); - } - throw new RODSException("RODSConn::fileUnlink has got an error from the server", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - } - - /** - * close the input file descriptor on RODS server. - * - * @param int $l1desc level 1 file descriptor - */ - public function closeFileDesc($l1desc) - { - try { - $dataObjCloseInp_pk = new RP_dataObjCloseInp($l1desc); - $msg = new RODSMessage("RODS_API_REQ_T", $dataObjCloseInp_pk, - $GLOBALS['PRODS_API_NUMS']['DATA_OBJ_CLOSE_AN']); - fwrite($this->conn, $msg->pack()); // send it - // get value back - $msg = new RODSMessage(); - $intInfo = (int)$msg->unpack($this->conn); - if ($intInfo < 0) { - trigger_error("Got an error from server:$intInfo", - E_USER_WARNING); - } - } catch (RODSException $e) { - trigger_error("Got an exception:$e", E_USER_WARNING); - } - } - - /** - * reads up to length bytes from the file pointer referenced by handle. Reading stops when up to length bytes have been read, EOF (end of file) is reached - * - * @param int $l1desc level 1 file descriptor - * @param int $length up to how many bytes to read. - * @return the read string. - */ - public function fileRead($l1desc, $length) - { - $dataObjReadInp_pk = new RP_dataObjReadInp($l1desc, $length); - $msg = new RODSMessage("RODS_API_REQ_T", $dataObjReadInp_pk, - $GLOBALS['PRODS_API_NUMS']['DATA_OBJ_READ_AN']); - fwrite($this->conn, $msg->pack()); // send it - $msg = new RODSMessage(); - $intInfo = (int)$msg->unpack($this->conn); - if ($intInfo < 0) { - throw new RODSException("RODSConn::fileRead has got an error from the server", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - return $msg->getBinstr(); - } - - /** - * writes up to length bytes from the file pointer referenced by handle. returns number of bytes writtne. - * - * @param int $l1desc level 1 file descriptor - * @param string $string contents (binary safe) to be written - * @param int $length up to how many bytes to read. - * @return the number of bytes written. - */ - public function fileWrite($l1desc, $string, $length = NULL) - { - if (!isset($length)) - $length = strlen($string); - - $dataObjWriteInp_pk = new RP_dataObjWriteInp($l1desc, $length); - $msg = new RODSMessage("RODS_API_REQ_T", $dataObjWriteInp_pk, - $GLOBALS['PRODS_API_NUMS']['DATA_OBJ_WRITE_AN'], $string); - fwrite($this->conn, $msg->pack()); // send header and body msg - fwrite($this->conn, $string); // send contents - $msg = new RODSMessage(); - $intInfo = (int)$msg->unpack($this->conn); - if ($intInfo < 0) { - throw new RODSException("RODSConn::fileWrite has got an error from the server", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - return $intInfo; - } - - /** - * Sets the file position indicator for the file referenced by l1desc (int descriptor). The new position, measured in bytes from the beginning of the file, is obtained by adding offset to the position specified by whence, whose values are defined as follows: - * SEEK_SET - Set position equal to offset bytes. - * SEEK_CUR - Set position to current location plus offset. - * SEEK_END - Set position to end-of-file plus offset. (To move to a position before the end-of-file, you need to pass a negative value in offset.) - * If whence is not specified, it is assumed to be SEEK_SET. - * @return int the current offset - */ - public function fileSeek($l1desc, $offset, $whence = SEEK_SET) - { - $dataObjReadInp_pk = new RP_fileLseekInp($l1desc, $offset, $whence); - $msg = new RODSMessage("RODS_API_REQ_T", $dataObjReadInp_pk, - $GLOBALS['PRODS_API_NUMS']['DATA_OBJ_LSEEK_AN']); - fwrite($this->conn, $msg->pack()); // send it - $msg = new RODSMessage(); - $intInfo = (int)$msg->unpack($this->conn); - if ($intInfo < 0) { - throw new RODSException("RODSConn::fileSeek has got an error from the server", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - $retpk = $msg->getBody(); - return $retpk->offset; - } - - /** - * Get metadata for a file, dir, resource or user - * @param char $pathtype 'd'=file, 'c'=dir, 'r'=resource, 'u'=user - * @param string $name name of the target object. in the case of file and dir, use its full path - * @return RODSMeta $meta meta data for the target. - */ - public function getMeta($pathtype, $name) - { - switch ($pathtype) { - case 'd': - $select = array("COL_META_DATA_ATTR_NAME", "COL_META_DATA_ATTR_VALUE", - "COL_META_DATA_ATTR_UNITS", 'COL_META_DATA_ATTR_ID'); - $condition = array( - new RODSQueryCondition("COL_COLL_NAME", dirname($name)), - new RODSQueryCondition("COL_DATA_NAME", basename($name)) - ); - break; - case 'c': - $select = array("COL_META_COLL_ATTR_NAME", "COL_META_COLL_ATTR_VALUE", - "COL_META_COLL_ATTR_UNITS", 'COL_META_COLL_ATTR_ID'); - $condition = array(new RODSQueryCondition("COL_COLL_NAME", $name)); - break; - case 'r': - $select = array("COL_META_RESC_ATTR_NAME", "COL_META_RESC_ATTR_VALUE", - "COL_META_RESC_ATTR_UNITS", 'COL_META_RESC_ATTR_ID'); - $condition = array(new RODSQueryCondition("COL_R_RESC_NAME", $name)); - break; - case 'u': - $select = array("COL_META_USER_ATTR_NAME", "COL_META_USER_ATTR_VALUE", - "COL_META_USER_ATTR_UNITS", 'COL_META_USER_ATTR_ID'); - $condition = array(new RODSQueryCondition("COL_USER_NAME", $name)); - break; - default: - throw new RODSException("RODSConn::getMeta pathtype '$pathtype' is not supported!", - 'PERR_USER_INPUT_ERROR'); - } - - $genque_result = $this->genQuery($select, $condition); - - if ($genque_result === false) { - return array(); - } - $ret_array = array(); - for ($i = 0; $i < count($genque_result[$select[0]]); $i++) { - $ret_array[$i] = new RODSMeta( - $genque_result[$select[0]][$i], - $genque_result[$select[1]][$i], - $genque_result[$select[2]][$i], - $genque_result[$select[3]][$i] - ); - - } - return $ret_array; - - } - - /** - * Add metadata to a file, dir, resource or user - * @param char $pathtype 'd'=file, 'c'=dir, 'r'=resource, 'u'=user - * @param string $name name of the target object. in the case of file and dir, use its full path - * @param RODSMeta $meta meta data to be added. - */ - public function addMeta($pathtype, $name, RODSMeta $meta) - { - $pkt = new RP_ModAVUMetadataInp("add", "-$pathtype", $name, $meta->name, - $meta->value, $meta->units); - $msg = new RODSMessage("RODS_API_REQ_T", $pkt, - $GLOBALS['PRODS_API_NUMS']['MOD_AVU_METADATA_AN']); - fwrite($this->conn, $msg->pack()); // send it - $msg = new RODSMessage(); - $intInfo = (int)$msg->unpack($this->conn); - if ($intInfo < 0) { - throw new RODSException("RODSConn::addMeta has got an error from the server", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - } - - /** - * remove metadata to a file, dir, resource or user - * @param char $pathtype 'd'=file, 'c'=dir, 'r'=resource, 'u'=user - * @param string $name name of the target object. in the case of file and dir, use its full path - * @param RODSMeta $meta meta data to be removed. - */ - public function rmMeta($pathtype, $name, RODSMeta $meta) - { - $pkt = new RP_ModAVUMetadataInp("rm", "-$pathtype", $name, $meta->name, - $meta->value, $meta->units); - $msg = new RODSMessage("RODS_API_REQ_T", $pkt, - $GLOBALS['PRODS_API_NUMS']['MOD_AVU_METADATA_AN']); - fwrite($this->conn, $msg->pack()); // send it - $msg = new RODSMessage(); - $intInfo = (int)$msg->unpack($this->conn); - if ($intInfo < 0) { - throw new RODSException("RODSConn::rmMeta has got an error from the server", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - } - - /** - * remove metadata to a file, dir, resource or user - * @param char $pathtype 'd'=file, 'c'=dir, 'r'=resource, 'u'=user - * @param string $name name of the target object. in the case of file and dir, use its full path - * @param integer $metaid id of the metadata to be removed. - */ - public function rmMetaByID($pathtype, $name, $metaid) - { - $pkt = new RP_ModAVUMetadataInp("rmi", "-$pathtype", $name, $metaid); - $msg = new RODSMessage("RODS_API_REQ_T", $pkt, - $GLOBALS['PRODS_API_NUMS']['MOD_AVU_METADATA_AN']); - fwrite($this->conn, $msg->pack()); // send it - $msg = new RODSMessage(); - $intInfo = (int)$msg->unpack($this->conn); - if ($intInfo < 0) { - if (RODSException::rodsErrCodeToAbbr($intInfo) != 'CAT_SUCCESS_BUT_WITH_NO_INFO') { - throw new RODSException("RODSConn::rmMetaByID has got an error from the server", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - } - } - - /** - * copy metadata between file, dir, resource or user - * @param char $pathtype_src source path type 'd'=file, 'c'=dir, 'r'=resource, 'u'=user - * @param char $pathtype_dest destination path type 'd'=file, 'c'=dir, 'r'=resource, 'u'=user - * @param string $name_src name of the source target object. in the case of file and dir, use its full path - * @param string $name_dest name of the destination target object. in the case of file and dir, use its full path - */ - public function cpMeta($pathtype_src, $pathtype_dest, $name_src, $name_dest) - { - $pkt = new RP_ModAVUMetadataInp("cp", "-$pathtype_src", - "-$pathtype_dest", $name_src, $name_dest); - $msg = new RODSMessage("RODS_API_REQ_T", $pkt, - $GLOBALS['PRODS_API_NUMS']['MOD_AVU_METADATA_AN']); - fwrite($this->conn, $msg->pack()); // send it - $msg = new RODSMessage(); - $intInfo = (int)$msg->unpack($this->conn); - if ($intInfo < 0) { - throw new RODSException("RODSConn::cpMeta has got an error from the server", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - } - - /** - * Excute a user defined rule - * @param string $rule_body body of the rule. Read this tutorial for details about rules: http://www.irods.org/index.php/Executing_user_defined_rules/workflow - * @param array $inp_params associative array defining input parameter for micro services used in this rule. only string and keyval pair are supported at this time. If the array value is a string, then type is string, if the array value is an RODSKeyValPair object, it will be treated a keyval pair - * @param array $out_params an array of names (strings) - * @param array $remotesvr if this rule need to run at remote server, this associative array should have the following keys: - * - 'host' remote host name or address - * - 'port' remote port - * - 'zone' remote zone - * if any of the value is empty, this option will be ignored. - * @param RODSKeyValPair $options an RODSKeyValPair specifying additional options, purpose of this is unknown at the developement time. Leave it alone if you are as clueless as me... - * @return an associative array. Each array key is the lable, and each array value's type will depend on the type of $out_param, at this moment, only string and RODSKeyValPair are supported - */ - public function execUserRule($rule_body, - array $inp_params = array(), array $out_params = array(), - array $remotesvr = array(), RODSKeyValPair $options = null) - { - $inp_params_packets = array(); - foreach ($inp_params as $inp_param_key => $inp_param_val) { - if (is_a($inp_param_val, 'RODSKeyValPair')) { - $inp_params_packets[] = new RP_MsParam($inp_param_key, - $inp_param_val->makePacket()); - } else // a string - { - $inp_params_packets[] = new RP_MsParam($inp_param_key, - new RP_STR($inp_param_val)); - } - } - $inp_param_arr_packet = new RP_MsParamArray($inp_params_packets); - - $out_params_desc = implode('%', $out_params); - - if ((isset($remotesvr['host'])) && (isset($remotesvr['port'])) && - (isset($remotesvr['zone'])) - ) { - $remotesvr_packet = new RP_RHostAddr($remotesvr['host'], - $remotesvr['zone'], $remotesvr['port']); - } else { - $remotesvr_packet = new RP_RHostAddr(); - } - - if (!isset($options)) - $options = new RODSKeyValPair(); - - $options_packet = $options->makePacket(); - - $pkt = new RP_ExecMyRuleInp($rule_body, $remotesvr_packet, - $options_packet, $out_params_desc, $inp_param_arr_packet); - $msg = new RODSMessage("RODS_API_REQ_T", $pkt, - $GLOBALS['PRODS_API_NUMS']['EXEC_MY_RULE_AN']); - fwrite($this->conn, $msg->pack()); // send it - $resv_msg = new RODSMessage(); - $intInfo = (int)$resv_msg->unpack($this->conn); - if ($intInfo < 0) { - throw new RODSException("RODSConn::execUserRule has got an error from the server", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - $retpk = $resv_msg->getBody(); - $param_array = $retpk->MsParam_PI; - $ret_arr = array(); - foreach ($param_array as $param) { - if ($param->type == 'STR_PI') { - $label = $param->label; - $ret_arr["$label"] = $param->STR_PI->myStr; - } else - if ($param->type == 'KeyValPair_PI') { - $label = $param->label; - $ret_arr["$label"] = RODSKeyValPair::fromPacket($param->KeyValPair_PI); - } else - if ($param->type == 'ExecCmdOut_PI') { - $label = $param->label; - $exec_ret_val = $param->ExecCmdOut_PI->buf; - $ret_arr["$label"] = $exec_ret_val; - } else { - throw new RODSException("RODSConn::execUserRule got. " . - "an unexpected output param with type: '$param->type' \n", - "PERR_UNEXPECTED_PACKET_FORMAT"); - } - } - return $ret_arr; - } - - /** - * This function is depreciated, and kept only for lagacy reasons! - * Makes a general query to RODS server. Think it as an SQL. "select foo from sometab where bar = '3'". In this example, foo is specified by "$select", bar and "= '3'" are speficed by condition. - * @param array $select the fields (names) to be returned/interested. There can not be more than 50 input fields. For example:"COL_COLL_NAME" means collection-name. - * @param array $condition Array of RODSQueryCondition. All fields are defined in RodsGenQueryNum.inc.php - * @param array $condition_kw Array of RODSQueryCondition. All fields are defined in RodsGenQueryKeyWd.inc.php - * @param integer $startingInx result start from which row. - * @param integer $maxresult up to how man rows should the result contain. - * @param boolean $getallrows whether to retreive all results - * @param boolean $select_attr attributes (array of int) of each select value. For instance, the attribute can be ORDER_BY (0x400) or ORDER_BY_DESC (0x800) to have the results sorted on the server. The default value is 1 for each attribute. Pass empty array or leave the option if you don't want anything fancy. - * @param integer $continueInx This index can be used to retrieve rest of results, when there is a overflow of the rows (> 500) - * @return an associated array, keys are the returning field names, each value is an array of the field values. Also, it returns false (boolean), if no rows are found. - * Note: This function is very low level. It's not recommended for beginners. - */ - public function genQuery(array $select, array $condition = array(), - array $condition_kw = array(), $startingInx = 0, $maxresults = 500, - $getallrows = true, array $select_attr = array(), &$continueInx = 0, - &$total_num_rows = -1) - { - if (count($select) > 50) { - trigger_error("genQuery(): Only upto 50 input are supported, rest ignored", - E_USER_WARNING); - $select = array_slice($select, 0, 50); - } - - $GenQueInp_options = 0; - if ($total_num_rows != -1) { - $GenQueInp_options = 1; - } - - require_once("RodsGenQueryNum.inc.php"); //load magic numbers - require_once("RodsGenQueryKeyWd.inc.php"); //load magic numbers - - // contruct select packet (RP_InxIvalPair $selectInp) - $select_pk = NULL; - if (count($select) > 0) { - if (empty($select_attr)) - $select_attr = array_fill(0, count($select), 1); - $idx = array(); - foreach ($select as $selval) { - if (isset($GLOBALS['PRODS_GENQUE_NUMS']["$selval"])) - $idx[] = $GLOBALS['PRODS_GENQUE_NUMS']["$selval"]; - else - trigger_error("genQuery(): select val '$selval' is not support, ignored", - E_USER_WARNING); - } - - $select_pk = new RP_InxIvalPair(count($select), $idx, $select_attr); - } else { - $select_pk = new RP_InxIvalPair(); - } - - foreach ($condition_kw as &$cond_kw) { - if (isset($GLOBALS['PRODS_GENQUE_KEYWD'][$cond_kw->name])) - $cond_kw->name = $GLOBALS['PRODS_GENQUE_KEYWD'][$cond_kw->name]; - } - - foreach ($condition as &$cond) { - if (isset($GLOBALS['PRODS_GENQUE_NUMS'][$cond->name])) - $cond->name = $GLOBALS['PRODS_GENQUE_NUMS'][$cond->name]; - } - - $condInput = new RP_KeyValPair(); - $condInput->fromRODSQueryConditionArray($condition_kw); - - $sqlCondInp = new RP_InxValPair(); - $sqlCondInp->fromRODSQueryConditionArray($condition); - - // construct RP_GenQueryInp packet - $genque_input_pk = new RP_GenQueryInp($maxresults, $continueInx, $condInput, - $select_pk, $sqlCondInp, $GenQueInp_options, $startingInx); - - // contruce a new API request message, with type GEN_QUERY_AN - $msg = new RODSMessage("RODS_API_REQ_T", $genque_input_pk, - $GLOBALS['PRODS_API_NUMS']['GEN_QUERY_AN']); - fwrite($this->conn, $msg->pack()); // send it - // get value back - $msg_resv = new RODSMessage(); - $intInfo = $msg_resv->unpack($this->conn); - if ($intInfo < 0) { - if (RODSException::rodsErrCodeToAbbr($intInfo) == 'CAT_NO_ROWS_FOUND') { - return false; - } - - throw new RODSException("RODSConn::genQuery has got an error from the server", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - $genque_result_pk = $msg_resv->getBody(); - - $result_arr = array(); - for ($i = 0; $i < $genque_result_pk->attriCnt; $i++) { - $sql_res_pk = $genque_result_pk->SqlResult_PI[$i]; - $attri_name = $GLOBALS['PRODS_GENQUE_NUMS_REV'][$sql_res_pk->attriInx]; - $result_arr["$attri_name"] = $sql_res_pk->value; - } - if ($total_num_rows != -1) - $total_num_rows = $genque_result_pk->totalRowCount; - - - $more_results = true; - // if there are more results to be fetched - while (($genque_result_pk->continueInx > 0) && ($more_results === true) - && ($getallrows === true)) { - $msg->getBody()->continueInx = $genque_result_pk->continueInx; - fwrite($this->conn, $msg->pack()); // re-send it with new continueInx - // get value back - $msg_resv = new RODSMessage(); - $intInfo = $msg_resv->unpack($this->conn); - if ($intInfo < 0) { - if (RODSException::rodsErrCodeToAbbr($intInfo) == 'CAT_NO_ROWS_FOUND') { - $more_results = false; - break; - } else - throw new RODSException("RODSConn::genQuery has got an error from the server", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - $genque_result_pk = $msg_resv->getBody(); - - for ($i = 0; $i < $genque_result_pk->attriCnt; $i++) { - $sql_res_pk = $genque_result_pk->SqlResult_PI[$i]; - $attri_name = $GLOBALS['PRODS_GENQUE_NUMS_REV'][$sql_res_pk->attriInx]; - $result_arr["$attri_name"] = - array_merge($result_arr["$attri_name"], $sql_res_pk->value); - } - } - - // Make sure and close the query if there are any results left. - if ($genque_result_pk->continueInx > 0) - { - $msg->getBody()->continueInx=$genque_result_pk->continueInx; - $msg->getBody()->maxRows=-1; // tells the server to close the query - fwrite($this->conn, $msg->pack()); - $msg_resv=new RODSMessage(); - $intInfo=$msg_resv->unpack($this->conn); - if ($intInfo<0) - { - throw new RODSException("RODSConn::genQuery has got an error from the server", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - } - - return $result_arr; - } - - /** - * Makes a general query to RODS server. Think it as an SQL. "select foo from sometab where bar = '3'". In this example, foo is specified by "$select", bar and "= '3'" are speficed by condition. - * @param RODSGenQueSelFlds $select the fields (names) to be returned/interested. There can not be more than 50 input fields. For example:"COL_COLL_NAME" means collection-name. - * @param RODSGenQueConds $condition All fields are defined in RodsGenQueryNum.inc.php and RodsGenQueryKeyWd.inc.php - * @param integer $start result start from which row. - * @param integer $limit up to how many rows should the result contain. If -1 is passed, all available rows will be returned - * @return RODSGenQueResults - * Note: This function is very low level. It's not recommended for beginners. - */ - public function query(RODSGenQueSelFlds $select, RODSGenQueConds $condition, - $start = 0, $limit = -1) - { - if (($select->getCount() < 1) || ($select->getCount() > 50)) { - throw new RODSException("Only 1-50 fields are supported", - 'PERR_USER_INPUT_ERROR'); - } - - // contruct select packet (RP_InxIvalPair $selectInp), and condition packets - $select_pk = $select->packetize(); - $cond_pk = $condition->packetize(); - $condkw_pk = $condition->packetizeKW(); - - // determin max number of results per query - if (($limit > 0) && ($limit < 500)) - $max_result_per_query = $limit; - else - $max_result_per_query = 500; - - $num_fetched_rows = 0; - $continueInx = 0; - $results = new RODSGenQueResults(); - do { - // construct RP_GenQueryInp packet - $options = 1 | $GLOBALS['PRODS_GENQUE_NUMS']['RETURN_TOTAL_ROW_COUNT']; - $genque_input_pk = new RP_GenQueryInp($max_result_per_query, - $continueInx, $condkw_pk, $select_pk, $cond_pk, $options, $start); - - // contruce a new API request message, with type GEN_QUERY_AN - $msg = new RODSMessage("RODS_API_REQ_T", $genque_input_pk, - $GLOBALS['PRODS_API_NUMS']['GEN_QUERY_AN']); - fwrite($this->conn, $msg->pack()); // send it - // get value back - $msg_resv = new RODSMessage(); - $intInfo = $msg_resv->unpack($this->conn); - if ($intInfo < 0) { - if (RODSException::rodsErrCodeToAbbr($intInfo) == 'CAT_NO_ROWS_FOUND') { - break; - } - - throw new RODSException("RODSConn::query has got an error from the server", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - $genque_result_pk = $msg_resv->getBody(); - $num_row_added = $results->addResults($genque_result_pk); - $continueInx = $genque_result_pk->continueInx; - $start = $start + $results->getNumRow(); - } while (($continueInx > 0) && - (($results->getNumRow() < $limit) || ($limit < 0))); - - - // Make sure and close the query if there are any results left. - if ($continueInx > 0) - { - $msg->getBody()->continueInx=$continueInx; - $msg->getBody()->maxRows=-1; // tells the server to close the query - fwrite($this->conn, $msg->pack()); - $msg_resv=new RODSMessage(); - $intInfo=$msg_resv->unpack($this->conn); - if ($intInfo<0) - { - throw new RODSException("RODSConn::query has got an error from the server", - $GLOBALS['PRODS_ERR_CODES_REV']["$intInfo"]); - } - } - - 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 deleted file mode 100644 index b3e8155da4d60a0927d1fca87da02e8168815826..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RODSConnManager.class.php +++ /dev/null @@ -1,79 +0,0 @@ -waiting_queue = array(); - $this->conn_map = array(); - } - - public static function getConn(RODSAccount $account) - { - $manager = $GLOBALS['RODSConnManager']; - - $conn = new RODSConn($account); - $conn_sig = $conn->getSignature(); - if (!isset($manager->conn_map[$conn_sig])) - $manager->conn_map[$conn_sig] = array(); - - //check if there is any opened connection idle - foreach ($manager->conn_map[$conn_sig] as &$opened_conn) { - if ($opened_conn->isIdle()) { - //$opened_conn->lock(); - $account = $opened_conn->getAccount(); //update account if needed... - return $opened_conn; - } - } - - //check if there is any more new connection allowed - if (count($manager->conn_map[$conn_sig]) < MAX_NUM_CONN_PER_USER_SERVER) { - $conn->connect(); - $id = count($manager->conn_map[$conn_sig]); - $manager->conn_map[$conn_sig][$id] = $conn; - $conn->setId($id); - //$conn->lock(); - $account = $conn->getAccount(); //update account if needed... - return $conn; - } - - //because PHP doesn't support multithread, if we run out of connections, - //there is probably something went wrong. - throw new RODSException("Unexpectedly ran out of connections. Maybe some connections are not released??? ", - "PERR_INTERNAL_ERR"); - - //if no connection are available, sleep for 100ms and retry - usleep(100); - echo "i am sleeping...
\n"; - return RODSConnManager::getConn($account); - } - - public static function releaseConn(RODSConn $conn) - { - $manager = $GLOBALS['RODSConnManager']; - $conn_sig = $conn->getSignature(); - - //echo "id:".$conn->getId()." ".implode(",",array_keys($manager->conn_map[$conn_sig]))."
\n"; - - if (isset($manager->conn_map[$conn_sig][$conn->getId()])) { - $manager->conn_map[$conn_sig][$conn->getId()]->unlock(); - } - } -} diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSDirStats.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSDirStats.class.php deleted file mode 100644 index 16d24584f4321801bec834419d96af577a7a8975..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RODSDirStats.class.php +++ /dev/null @@ -1,25 +0,0 @@ -name = $name; - $this->owner = $owner; - $this->ownerzone = $ownerzone; - $this->mtime = $mtime; - $this->ctime = $ctime; - $this->id = $id; - $this->comments = $comments; - } - -} - \ 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 deleted file mode 100644 index 97116a102c1ce5e2ae37235b6ce4d4c09de921be..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RODSException.class.php +++ /dev/null @@ -1,182 +0,0 @@ - - * @copyright Copyright © 2007, TBD - * @package Prods - */ - -$errtable_file = dirname(__FILE__) . "/RodsErrorTable.inc.php"; - -if (is_readable($errtable_file)) - require_once($errtable_file); -else - die("Could not read file $errtable_file
\n"); - -/** - * custom exception class for RODS - */ -class RODSException extends Exception -{ - private $code_abbr; - private $cause; - - /** - * Makes a new RODS excption - * @param string $message err/exception message - * @param string $code_abbr error code abbreviation - */ - public function __construct($message, $code_abbr = "UNKNOWN_PRODS_ERR", - Exception $cause = NULL) - { - $this->code_abbr = $code_abbr; - $this->cause = $cause; - - parent::__construct($message, $GLOBALS['PRODS_ERR_CODES'][$code_abbr]); - } - - public function getCause() - { - return $this->cause; - } - - public function getCodeAbbr() - { - return $this->code_abbr; - } - - public static function rodsErrCodeToAbbr($code) - { - if (isset($GLOBALS['PRODS_ERR_CODES_REV']["$code"])) - return $GLOBALS['PRODS_ERR_CODES_REV']["$code"]; - else - return null; - } - - public static function rodsErrAbbrToCode($codeabbr) - { - if (isset($GLOBALS['PRODS_ERR_CODES']["$codeabbr"])) - return $GLOBALS['PRODS_ERR_CODES']["$codeabbr"]; - else - return null; - } - - public function getStackTrace() - { - if ($this->cause !== null) { - $arr = array(); - $trace = $this->getTrace(); - array_push($arr, $trace[0]); - unset($trace); - if (get_class($this->cause) == "RODSException") { - foreach ($this->cause->getStackTrace() as $key => $trace) { - array_push($arr, $trace); - } - } else { - foreach ($this->cause->getTrace() as $key => $trace) { - array_push($arr, $trace); - } - } - return $arr; - } else { - return $this->getTrace(); - } - } - - public function showStackTrace() - { - $htmldoc = "

An exception was thrown :
"; - $htmldoc .= "Exception code : $this->code
"; - $htmldoc .= "Exception abbr : $this->code_abbr
"; - $htmldoc .= "Exception message : $this->message
"; - $htmldoc .= ""; - $i = 0; - foreach ($this->getStackTrace() as $key => $trace) { - $htmldoc .= $this->showTrace($trace, $i); - $i++; - } - $htmldoc .= "#$i {main}
"; - unset($i); - $htmldoc .= "

"; - return $htmldoc; - } - - private function showTrace($_trace, $_i) - { - $htmldoc = "#$_i "; - if (array_key_exists("file", $_trace)) { - $htmldoc .= $_trace["file"]; - } - if (array_key_exists("line", $_trace)) { - $htmldoc .= "(" . $_trace["line"] . "): "; - } - if (array_key_exists("class", $_trace) && array_key_exists("type", $_trace)) { - $htmldoc .= $_trace["class"] . $_trace["type"]; - } - if (array_key_exists("function", $_trace)) { - $htmldoc .= $_trace["function"] . "("; - if (array_key_exists("args", $_trace)) { - if (count($_trace["args"]) > 0) { - $args = $_trace["args"]; - $type = gettype($args[0]); - $value = $args[0]; - unset($args); - if ($type == "boolean") { - if ($value) { - $htmldoc .= "true"; - } else { - $htmldoc .= "false"; - } - } elseif ($type == "integer" || $type == "double") { - if (settype($value, "string")) { - if (strlen($value) <= 20) { - $htmldoc .= $value; - } else { - $htmldoc .= substr($value, 0, 17) . "..."; - } - } else { - if ($type == "integer") { - $htmldoc .= "? integer ?"; - } else { - $htmldoc .= "? double or float ?"; - } - } - } elseif ($type == "string") { - if (strlen($value) <= 18) { - $htmldoc .= "'$value'"; - } else { - $htmldoc .= "'" . substr($value, 0, 15) . "...'"; - } - } elseif ($type == "array") { - $htmldoc .= "Array"; - } elseif ($type == "object") { - $htmldoc .= "Object"; - } elseif ($type == "resource") { - $htmldoc .= "Resource"; - } elseif ($type == "NULL") { - $htmldoc .= "null"; - } elseif ($type == "unknown type") { - $htmldoc .= "? unknown type ?"; - } - unset($type); - unset($value); - } - if (count($_trace["args"]) > 1) { - $htmldoc .= ",..."; - } - } - $htmldoc .= ")
"; - } - return $htmldoc; - } - - /** - * Magic function to turn exception obj to a string - */ - public function __toString() - { - return __CLASS__ . ": [{$this->code} $this->code_abbr]: {$this->message}\n"; - //return $this->showStackTrace(); - } - -} diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSFileStats.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSFileStats.class.php deleted file mode 100644 index 6452c2b1e535d7ba97a75b9be7cb71dec9d89dec..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RODSFileStats.class.php +++ /dev/null @@ -1,34 +0,0 @@ -name = $name; - $this->size = $size; - $this->owner = $owner; - $this->ownerzone = $ownerzone; - $this->mtime = $mtime; - $this->ctime = $ctime; - $this->id = $id; - $this->typename = $typename; - $this->rescname = $rescname; - $this->comments = $comments; - $this->num_replica = $num_replica; - } - -} - \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueConds.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueConds.class.php deleted file mode 100644 index 4bc10cc549fc4b35e14ef0c385c17ad626e0193c..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueConds.class.php +++ /dev/null @@ -1,112 +0,0 @@ -=' and val='0', then the triplex means - * "foo >= 0" as one iRODS general query condition. - * @param array (of string) $names names of the field, which must be one defined in file 'RodsGenQueryNum.inc.php'. - * @param array (of string) $ops logical operator, such as '=' 'like' '>' - * @param array (of string) $vals value of the filed - */ - public function __construct(array $names = array(), array $ops = array(), - array $vals = array()) - { - require_once("RodsGenQueryNum.inc.php"); //load magic numbers - require_once("RodsGenQueryKeyWd.inc.php"); //load magic keywords - - $this->cond = array('names' => array(), 'sysnames' => array(), 'values' => array()); - $this->cond_kw = array('names' => array(), 'sysnames' => array(), 'values' => array()); - - for ($i = 0; $i < count($names); $i++) { - $name = $names[$i]; - $op = $ops[$i]; - $val = $vals[$i]; - if (isset($GLOBALS['PRODS_GENQUE_NUMS']["$name"])) { - $this->cond['names'][] = $name; - $this->cond['sysnames'][] = $GLOBALS['PRODS_GENQUE_NUMS']["$name"]; - $this->cond['values'][] = "$op '$val'"; - } else - if (isset($GLOBALS['PRODS_GENQUE_KEYWD']["$name"])) { - $this->cond_kw['names'][] = $name; - $this->cond_kw['sysnames'][] = $GLOBALS['PRODS_GENQUE_KEYWD']["$name"]; - $this->cond_kw['values'][] = "$op '$val'"; - } else { - throw new RODSException("General Query condition field name '$name' is not valid", - 'PERR_USER_INPUT_ERROR'); - } - } - } - - /** - * Add a single select field. - * @param string $name names of the field, which must be one defined in file 'RodsGenQueryNum.inc.php'. - * @param string $op logical operator, such as '=' 'like' '>' - * @param string $val value of the filed - * @param array an array of tuples of extra op's and val's, each tuple is an assosive array that has key 'op' and 'val'. These conditions will be 'OR' with the other conditions. - * for example add ('COL_D_DATA_ID','like', '/tempZone/home/rods/%', array(array('op'=>'=','val'=>'/tempZone/home/rods'"))) - * would select all file ids both in subdirectories under '/tempZone/home/rods' and directly under '/tempZone/home/rods' - */ - public function add($name, $op, $val, array $OR_ops_vals = array()) - { - require_once("RodsGenQueryNum.inc.php"); //load magic numbers - require_once("RodsGenQueryKeyWd.inc.php"); //load magic keywords - - if (isset($GLOBALS['PRODS_GENQUE_NUMS']["$name"])) { - $this->cond['names'][] = $name; - $this->cond['sysnames'][] = $GLOBALS['PRODS_GENQUE_NUMS']["$name"]; - $value = "$op '$val'"; - foreach ($OR_ops_vals as $op_val) { - $or_op = $op_val['op']; - $or_val = $op_val['val']; - if (empty($or_op) || empty($or_val)) - continue; - $value = $value . " || $or_op '$or_val'"; - } - $this->cond['values'][] = $value; - } else - if (isset($GLOBALS['PRODS_GENQUE_KEYWD']["$name"])) { - $this->cond_kw['names'][] = $name; - $this->cond_kw['sysnames'][] = $GLOBALS['PRODS_GENQUE_KEYWD']["$name"]; - $value = "$op '$val'"; - foreach ($OR_ops_vals as $op_val) { - $or_op = $op_val['op']; - $or_val = $op_val['val']; - if (empty($or_op) || empty($or_val)) - continue; - $value = $value . " || $or_op '$or_val'"; - } - $this->cond_kw['values'][] = $value; - } else { - throw new RODSException("General Query condition field name '$name' is not valid", - 'PERR_USER_INPUT_ERROR'); - } - } - - /** - * make a RP_InxValPair. - */ - public function packetize() - { - return (new RP_InxValPair(count($this->cond['names']), - $this->cond['sysnames'], $this->cond['values'])); - } - - /** - * make a RP_KeyValPair. - */ - public function packetizeKW() - { - return (new RP_KeyValPair(count($this->cond_kw['names']), - $this->cond_kw['sysnames'], $this->cond_kw['values'])); - } - - public function getCond() - { - return $this->cond; - } -} diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueResults.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueResults.class.php deleted file mode 100644 index 899b4f0e3b40a8d987572e90b378c629d3169a9f..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueResults.class.php +++ /dev/null @@ -1,97 +0,0 @@ -total_count = $total_count; - $this->values = $result_array; - $this->numcol = count($result_array); - if ($this->numcol > 0) - $this->numrow = count(current($result_array)); - else - $this->numrow = 0; - } - - /** - * Add general query result packet RP_GenQueryOut, directly from the protocol level query, into the result structure. - * @param RP_GenQueryOut $genque_result_pk result packet directly from the protocol level query. - * @return number of rows just added - */ - public function addResults(RP_GenQueryOut $genque_result_pk) - { - if ($genque_result_pk->totalRowCount > $this->total_count) - $this->total_count = $genque_result_pk->totalRowCount; - - require_once("RodsGenQueryNum.inc.php"); //load magic numbers - - $num_row_added = 0; - for ($i = 0; $i < $genque_result_pk->attriCnt; $i++) { - $sql_res_pk = $genque_result_pk->SqlResult_PI[$i]; - $attri_name = $GLOBALS['PRODS_GENQUE_NUMS_REV'][$sql_res_pk->attriInx]; - if (empty($this->values["$attri_name"])) - $this->values["$attri_name"] = $sql_res_pk->value; - else - array_splice($this->values["$attri_name"], - count($this->values["$attri_name"]), 0, $sql_res_pk->value); - if ($i == 0) { - $num_row_added = count($sql_res_pk->value); - if ($num_row_added != (int)$genque_result_pk->rowCnt) { - throw new RODSException("Gen Query result packet num row mismatch. Expect: $genque_result_pk->rowCnt, got: $num_row_added", - 'PERR_UNEXPECTED_PACKET_FORMAT'); - } - } - } - - $this->numcol = count($this->values); - if ($this->numcol > 0) - $this->numrow = count(current($this->values)); - else - $this->numrow = 0; - - return $num_row_added; - } - - /** - * get result values in (2-d) array, each array key is the name - * used RODSGenQueSelFlds, such as COL_COLL_NAME - */ - public function getValues() - { - return $this->values; - } - - /** - * get total result count, including all the potential results not returned. - */ - public function getTotalCount() - { - return $this->total_count; - } - - /** - * get number of columns/fields of the results. - */ - public function getNumCol() - { - return $this->numcol; - } - - /** - * get number of rows of the results. - */ - public function getNumRow() - { - return $this->numrow; - } -} diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueSelFlds.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueSelFlds.class.php deleted file mode 100644 index aa391613d07c1e4018b86051b3f85cdf63ae741d..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueSelFlds.class.php +++ /dev/null @@ -1,158 +0,0 @@ -names = $names; - $this->attrs = array(); - $this->indexes = array(); - - for ($i = 0; $i < count($names); $i++) { - $name = $names[$i]; - if (!isset($GLOBALS['PRODS_GENQUE_NUMS']["$name"])) { - throw new RODSException("General Query select field name '$name' is not valid", - 'PERR_USER_INPUT_ERROR'); - } - $this->indexes[] = $GLOBALS['PRODS_GENQUE_NUMS']["$name"]; - $this->attrs[] = RODSGenQueSelFlds::attr2GenQueNumber($attrs[$i]); - } - - } - - /** - * Add a single select field. - * - * @param string name name of the field, which must be one defined in file 'RodsGenQueryNum.inc.php'. - */ - public function add($name, $attr = NULL) - { - require_once("RodsGenQueryNum.inc.php"); //load magic numbers - if (!isset($GLOBALS['PRODS_GENQUE_NUMS']["$name"])) { - throw new RODSException("General Query select field name '$name' is not valid", - 'PERR_USER_INPUT_ERROR'); - } - $this->indexes[] = $GLOBALS['PRODS_GENQUE_NUMS']["$name"]; - $this->names[] = $name; - $this->attrs[] = RODSGenQueSelFlds::attr2GenQueNumber($attr); - } - - /** - * update a single select field's attr/value. Note that if the value already exists, - * it will OR the bits. This is used when you want more than one type of operation - * for a select field, such as select_max and sort. - */ - public function update($name, $attr) - { - require_once("RodsGenQueryNum.inc.php"); //load magic numbers - if (!isset($GLOBALS['PRODS_GENQUE_NUMS']["$name"])) { - throw new RODSException("General Query select field name '$name' is not valid", - 'PERR_USER_INPUT_ERROR'); - } - - $newattr = RODSGenQueSelFlds::attr2GenQueNumber($attr); - for ($i = 0; $i < count($this->names); $i++) { - if ($this->names[$i] == $name) { - if ($this->attrs[$i] == 1) - $this->attrs[$i] = $newattr; - else - $this->attrs[$i] = $newattr | $this->attrs[$i]; - return; - } - } - $this->add($name, $attr); - } - - /** - * Convert supported attribute to magic number, that iRODS protocol uses - * Following attributes are supported: - * - 'order_by_asc' order the result by this field, in ASCENDING order - * - 'order_by_desc' order the result by this field, in DESCENDING order - * - min minimum of the group - * - max maximum of the group - * - sum sum of the group - * - avg average of the group - * - count count of the group - */ - public static function attr2GenQueNumber($attr) - { - if (empty($attr)) return 1; - $retval = 1; - switch ($attr) { - case 'order_by_asc': - $retval = $GLOBALS['PRODS_GENQUE_NUMS']['ORDER_BY']; - break; - case 'order_by_desc': - $retval = $GLOBALS['PRODS_GENQUE_NUMS']['ORDER_BY_DESC']; - break; - case 'min': - $retval = $GLOBALS['PRODS_GENQUE_NUMS']['SELECT_MIN']; - break; - case 'max': - $retval = $GLOBALS['PRODS_GENQUE_NUMS']['SELECT_MAX']; - break; - case 'sum': - $retval = $GLOBALS['PRODS_GENQUE_NUMS']['SELECT_SUM']; - break; - case 'avg': - $retval = $GLOBALS['PRODS_GENQUE_NUMS']['SELECT_AVG']; - break; - case 'count': - $retval = $GLOBALS['PRODS_GENQUE_NUMS']['SELECT_COUNT']; - break; - default: - throw new RODSException("Unexpected attribute: '$attr'", - 'PERR_USER_INPUT_ERROR'); - } - return intval($retval); - } - - /** - * make a RP_InxIvalPair, a low level iRODS packet - */ - public function packetize() - { - return (new RP_InxIvalPair(count($this->names), $this->indexes, - $this->attrs)); - - } - - public function getIndexes() - { - return $this->indexes; - } - - public function getAttrs() - { - return $this->attrs; - } - - public function getCount() - { - return count($this->names); - } - - public function getNames() - { - return $this->names; - } - -} diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSKeyValPair.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSKeyValPair.class.php deleted file mode 100644 index f347f7c988af2fc7235184fe8548ef05f97a0102..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RODSKeyValPair.class.php +++ /dev/null @@ -1,48 +0,0 @@ - - * @copyright Copyright © 2007, TBD - * @package RODSConn - */ - - -require_once("autoload.inc.php"); - -class RODSKeyValPair -{ - private $keys; - private $vals; - - public function __construct(array $arr = array()) - { - $this->keys = array_keys($arr); - $this->vals = array_values($arr); - } - - public function addPair($key, $val) - { - $this->keys[] = $key; - $this->vals[] = $val; - } - - /** - * Make a RP_KeyValPair - * @return RP_KeyValPair a RP_KeyValPair object - */ - public function makePacket() - { - return new RP_KeyValPair(count($this->keys), $this->keys, $this->vals); - } - - /** - * make a RODSKeyValPair from a RP_KeyValPair - */ - public static function fromPacket(RP_KeyValPair $RP_KeyValPair) - { - $new_keyval = new RODSKeyValPair(); - $new_keyval->keys = $RP_KeyValPair->keyWord; - $new_keyval->vals = $RP_KeyValPair->svalue; - return $new_keyval; - } -} diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSMessage.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSMessage.class.php deleted file mode 100644 index 243903a42dfe7d3ca02f97e52cd4cf1a8d180cfb..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RODSMessage.class.php +++ /dev/null @@ -1,183 +0,0 @@ - "RODS_CONNECT", - "RODS_VERSION_T" => "RODS_VERSION", - "RODS_API_REQ_T" => "RODS_API_REQ", - "RODS_DISCONNECT_T" => "RODS_DISCONNECT", - "RODS_REAUTH_T" => "RODS_REAUTH", - "RODS_API_REPLY_T" => "RODS_API_REPLY" -); - -class RODSMessage -{ - private $type; // (String) message type, such as "RODS_CONNECT_T" - private $typestr; // (String) str representation of the type that RODS server understand - private $msg; // (RODSPacket) main message body - private $header; // (RODSPacket) a special packet, header for other packets - private $header_xml; // (string) packet header in XML - private $msg_xml; // (string) message in XML - private $binstr; // (string) binary string - private $errstr; // (string) error string - private $intinfo; // an additional integer info, for API, it is the - // apiReqNum - private $serialized; - - public function __construct($type = NULL, $_msg = NULL, $intinfo = 0, $binstr = "", $errstr = "") - { - if (!isset($type)) { - return; - } - - $this->type = $type; - $RODSMessage_types = $GLOBALS['RODSMessage_types']; - if (!isset($RODSMessage_types[$type])) { - throw new RODSException("RODSMessage::__construct failed.1! Unknown type '$type'", - "PERR_INTERNAL_ERR"); - } - $this->typestr = $RODSMessage_types[$type]; - - if (isset($_msg)) { - if (!($_msg instanceof RODSPacket)) { - throw new RODSException("RODSMessage::__construct failed.2!", - "PERR_INTERNAL_ERR"); - } - } - $this->msg = $_msg; - $this->intinfo = $intinfo; - $this->binstr = $binstr; - $this->errstr = $errstr; - } - - public function pack() - { - if (isset($this->msg)) - $this->msg_xml = $this->msg->toXML(); - - $this->header = new RP_MsgHeader($this->typestr, strlen($this->msg_xml), - strlen($this->errstr), strlen($this->binstr), $this->intinfo); - $header_xml = $this->header->toXML(); - $this->serialized = pack("N", strlen($header_xml)) . $header_xml . - $this->msg_xml; - return $this->serialized; - } - - - public function unpack($conn, &$bslen = NULL) - { - if (FALSE === ($chunk = stream_get_contents($conn, 4))) { - throw new RODSException("RODSMessage::unpack failed.0! ", - "SYS_PACK_INSTRUCT_FORMAT_ERR"); - } - - - $arr = unpack("Nlen", $chunk); - $header_len = $arr['len']; - if ((!is_int($header_len)) || ($header_len < 1) || ($header_len > 8192 - 4)) { - throw new RODSException("RODSMessage::unpack failed.1! The header length is unexpected: '$header_len'", - "SYS_PACK_INSTRUCT_FORMAT_ERR"); - } - - $this->header_xml = stream_get_contents($conn, $header_len); - $this->parseHeaderXML($this->header_xml); - $intInfo = $this->header->intInfo; - - // get main msg string - $msg_len = $this->header->msgLen; - $this->msg_xml = stream_get_contents($conn, $msg_len); - if ($msg_len != strlen($this->msg_xml)) { - throw new RODSException("RODSMessage::unpack failed.2! " . - "The body length is unexpected: " . strlen($this->msg_xml) . - " expecting: $msg_len", - "SYS_PACK_INSTRUCT_FORMAT_ERR"); - } - if ($msg_len > 0) { - $this->parseBodyXML($this->msg_xml); - } - - // get err string - $errlen = $this->header->errorLen; - $this->errstr = stream_get_contents($conn, $errlen); - if ($errlen != strlen($this->errstr)) { - throw new RODSException("RODSMessage::unpack failed.3! " . - "The err length is unexpected: " . strlen($this->errstr) . - " expecting: $errlen", - "SYS_PACK_INSTRUCT_FORMAT_ERR"); - } - - // get bin string - $bslen = $this->header->bsLen; - $this->binstr = stream_get_contents($conn, $bslen); - if ($bslen != strlen($this->binstr)) { - throw new RODSException("RODSMessage::unpack failed.4! " . - "The bin str length is unexpected: " . strlen($this->binstr) . - " expecting: $bslen", - "SYS_PACK_INSTRUCT_FORMAT_ERR"); - } - - return $this->header->intInfo; - } - - private function parseHeaderXML($xmlstr) - { - $xml = new SimpleXMLElement($xmlstr); - $name = $xml->getName(); - if ($name != "MsgHeader_PI") { - throw new RODSException("RODSMessage::parseHeaderXML failed! " . - "The XML header name is unexpected:$name " . - " expecting: MsgHeader_PI", - "SYS_PACK_INSTRUCT_FORMAT_ERR"); - } - $this->header = new RP_MsgHeader(); - $this->header->fromSXE($xml); - } - - private function parseBodyXML($xmlstr) - { - //try { - $xml = new SimpleXMLElement($xmlstr); - $name = $xml->getName(); - if (substr($name, -3, 3) != "_PI") { - throw new RODSException("RODSMessage::parseMainBodyXML failed! " . - "The XML node's name is unexpected:$name " . - " expecting some thing like xxx_PI", - "SYS_PACK_INSTRUCT_FORMAT_ERR"); - } - $rp_classname = "RP_" . substr($name, 0, strlen($name) - 3); - $this->msg = new $rp_classname(); - $this->msg->fromSXE($xml); - - /*} catch (Exception $e) { - throw new RODSException("RODSMessage::parseMainBodyXML failed! ". - "Mal formated XML in RODS message :". - $xmlstr, - "SYS_PACK_INSTRUCT_FORMAT_ERR",$e); - } - */ - } - - public function getBody() - { - return $this->msg; - } - - public function getBinstr() - { - return $this->binstr; - } - - public function getXML() - { - return $this->header_xml . "\n" . $this->msg_xml; - } - - public static function packConnectMsg($user, $zone, $relVersion = RODS_REL_VERSION, - $apiVersion = RODS_API_VERSION, $option = NULL) - { - $msgbody = new RP_StartupPack($user, $zone, $relVersion, $apiVersion . $option); - $rods_msg = new RODSMessage("RODS_CONNECT_T", $msgbody); - return $rods_msg->pack(); - } -} diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSMeta.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSMeta.class.php deleted file mode 100644 index 55d48af19d2622e7d2d821e56285905d774e5092..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RODSMeta.class.php +++ /dev/null @@ -1,21 +0,0 @@ -name = $name; - $this->value = $value; - $this->units = $units; - $this->id = $id; - $this->op = $op; - } - -} - \ 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 deleted file mode 100644 index 1d367e900bc955ded06eee80e2219c5f9e5bb151..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RODSObjIOOpr.inc.php +++ /dev/null @@ -1,19 +0,0 @@ -name = $name; - $this->value = $value; - $this->op = $op; - } - - public function __toString() - { - return "$this->name $this->op '$this->value'"; - } - -} - \ 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 deleted file mode 100644 index 258dfcab39d3a3cdc04c8d3197e47055584a3084..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RodsAPINum.inc.php +++ /dev/null @@ -1,216 +0,0 @@ - '500', - 'FILE_OPEN_AN' => '501', - 'FILE_WRITE_AN' => '502', - 'FILE_CLOSE_AN' => '503', - 'FILE_LSEEK_AN' => '504', - 'FILE_READ_AN' => '505', - 'FILE_UNLINK_AN' => '506', - 'FILE_MKDIR_AN' => '507', - 'FILE_CHMOD_AN' => '508', - 'FILE_RMDIR_AN' => '509', - 'FILE_STAT_AN' => '510', - 'FILE_FSTAT_AN' => '511', - 'FILE_FSYNC_AN' => '512', - 'FILE_STAGE_AN' => '513', - 'FILE_GET_FS_FREE_SPACE_AN' => '514', - 'FILE_OPENDIR_AN' => '515', - 'FILE_CLOSEDIR_AN' => '516', - 'FILE_READDIR_AN' => '517', - 'FILE_PUT_AN' => '518', - 'FILE_GET_AN' => '519', - 'FILE_CHKSUM_AN' => '520', - 'CHK_N_V_PATH_PERM_AN' => '521', - 'FILE_RENAME_AN' => '522', - 'FILE_TRUNCATE_AN' => '523', - 'DATA_OBJ_CREATE_AN' => '601', - 'DATA_OBJ_OPEN_AN' => '602', - 'DATA_OBJ_READ_AN' => '603', - 'DATA_OBJ_WRITE_AN' => '604', - 'DATA_OBJ_CLOSE_AN' => '605', - 'DATA_OBJ_PUT_AN' => '606', - 'DATA_PUT_AN' => '607', - 'DATA_OBJ_GET_AN' => '608', - 'DATA_GET_AN' => '609', - 'DATA_OBJ_REPL_AN' => '610', - 'DATA_COPY_AN' => '611', - 'DATA_OBJ_LSEEK_AN' => '612', - 'DATA_OBJ_COPY_AN' => '613', - 'SIMPLE_QUERY_AN' => '614', - 'DATA_OBJ_UNLINK_AN' => '615', - 'COLL_CREATE_AN' => '616', - 'RM_COLL_OLD_AN' => '617', - 'REG_COLL_AN' => '618', - 'REG_DATA_OBJ_AN' => '619', - 'UNREG_DATA_OBJ_AN' => '620', - 'REG_REPLICA_AN' => '621', - 'MOD_DATA_OBJ_META_AN' => '622', - 'RULE_EXEC_SUBMIT_AN' => '623', - 'RULE_EXEC_DEL_AN' => '624', - 'EXEC_MY_RULE_AN' => '625', - 'OPR_COMPLETE_AN' => '626', - 'DATA_OBJ_RENAME_AN' => '627', - 'DATA_OBJ_RSYNC_AN' => '628', - 'DATA_OBJ_CHKSUM_AN' => '629', - 'PHY_PATH_REG_AN' => '630', - 'DATA_OBJ_PHYMV_AN' => '631', - 'DATA_OBJ_TRIM_AN' => '632', - 'OBJ_STAT_AN' => '633', - 'EXEC_CMD_AN' => '634', - 'SUB_STRUCT_FILE_CREATE_AN' => '635', - 'SUB_STRUCT_FILE_OPEN_AN' => '636', - 'SUB_STRUCT_FILE_READ_AN' => '637', - 'SUB_STRUCT_FILE_WRITE_AN' => '638', - 'SUB_STRUCT_FILE_CLOSE_AN' => '639', - 'SUB_STRUCT_FILE_UNLINK_AN' => '640', - 'SUB_STRUCT_FILE_STAT_AN' => '641', - 'SUB_STRUCT_FILE_FSTAT_AN' => '642', - 'SUB_STRUCT_FILE_LSEEK_AN' => '643', - 'SUB_STRUCT_FILE_RENAME_AN' => '644', - 'QUERY_SPEC_COLL_AN' => '645', - 'MOD_COLL_AN' => '646', - 'SUB_STRUCT_FILE_MKDIR_AN' => '647', - 'SUB_STRUCT_FILE_RMDIR_AN' => '648', - 'SUB_STRUCT_FILE_OPENDIR_AN' => '649', - 'SUB_STRUCT_FILE_READDIR_AN' => '650', - 'SUB_STRUCT_FILE_CLOSEDIR_AN' => '651', - 'DATA_OBJ_TRUNCATE_AN' => '652', - 'SUB_STRUCT_FILE_TRUNCATE_AN' => '653', - 'GET_XMSG_TICKET_AN' => '654', - 'SEND_XMSG_AN' => '655', - 'RCV_XMSG_AN' => '656', - 'SUB_STRUCT_FILE_GET_AN' => '657', - 'SUB_STRUCT_FILE_PUT_AN' => '658', - 'SYNC_MOUNTED_COLL_AN' => '659', - 'STRUCT_FILE_SYNC_AN' => '660', - 'CLOSE_COLLECTION_AN' => '661', - 'COLL_REPL_AN' => '662', - 'RM_COLL_AN' => '663', - 'GET_MISC_SVR_INFO_AN' => '700', - 'GENERAL_ADMIN_AN' => '701', - 'GEN_QUERY_AN' => '702', - 'AUTH_REQUEST_AN' => '703', - 'AUTH_RESPONSE_AN' => '704', - 'AUTH_CHECK_AN' => '705', - 'MOD_AVU_METADATA_AN' => '706', - 'MOD_ACCESS_CONTROL_AN' => '707', - 'RULE_EXEC_MOD_AN' => '708', - 'GET_TEMP_PASSWORD_AN' => '709', - 'GENERAL_UPDATE_AN' => '710', - 'GSI_AUTH_REQUEST_AN' => '711', - 'OPEN_COLLECTION_AN' => '712', - 'READ_COLLECTION_AN' => '713', - 'PAM_AUTH_REQUEST_AN' => '725', - 'SSL_START_AN' => '1100', - 'SSL_END_AN' => '1101', -); -$GLOBALS['PRODS_API_NUMS_REV'] = array( - '500' => 'FILE_CREATE_AN', - '501' => 'FILE_OPEN_AN', - '502' => 'FILE_WRITE_AN', - '503' => 'FILE_CLOSE_AN', - '504' => 'FILE_LSEEK_AN', - '505' => 'FILE_READ_AN', - '506' => 'FILE_UNLINK_AN', - '507' => 'FILE_MKDIR_AN', - '508' => 'FILE_CHMOD_AN', - '509' => 'FILE_RMDIR_AN', - '510' => 'FILE_STAT_AN', - '511' => 'FILE_FSTAT_AN', - '512' => 'FILE_FSYNC_AN', - '513' => 'FILE_STAGE_AN', - '514' => 'FILE_GET_FS_FREE_SPACE_AN', - '515' => 'FILE_OPENDIR_AN', - '516' => 'FILE_CLOSEDIR_AN', - '517' => 'FILE_READDIR_AN', - '518' => 'FILE_PUT_AN', - '519' => 'FILE_GET_AN', - '520' => 'FILE_CHKSUM_AN', - '521' => 'CHK_N_V_PATH_PERM_AN', - '522' => 'FILE_RENAME_AN', - '523' => 'FILE_TRUNCATE_AN', - '601' => 'DATA_OBJ_CREATE_AN', - '602' => 'DATA_OBJ_OPEN_AN', - '603' => 'DATA_OBJ_READ_AN', - '604' => 'DATA_OBJ_WRITE_AN', - '605' => 'DATA_OBJ_CLOSE_AN', - '606' => 'DATA_OBJ_PUT_AN', - '607' => 'DATA_PUT_AN', - '608' => 'DATA_OBJ_GET_AN', - '609' => 'DATA_GET_AN', - '610' => 'DATA_OBJ_REPL_AN', - '611' => 'DATA_COPY_AN', - '612' => 'DATA_OBJ_LSEEK_AN', - '613' => 'DATA_OBJ_COPY_AN', - '614' => 'SIMPLE_QUERY_AN', - '615' => 'DATA_OBJ_UNLINK_AN', - '616' => 'COLL_CREATE_AN', - '617' => 'RM_COLL_OLD_AN', - '618' => 'REG_COLL_AN', - '619' => 'REG_DATA_OBJ_AN', - '620' => 'UNREG_DATA_OBJ_AN', - '621' => 'REG_REPLICA_AN', - '622' => 'MOD_DATA_OBJ_META_AN', - '623' => 'RULE_EXEC_SUBMIT_AN', - '624' => 'RULE_EXEC_DEL_AN', - '625' => 'EXEC_MY_RULE_AN', - '626' => 'OPR_COMPLETE_AN', - '627' => 'DATA_OBJ_RENAME_AN', - '628' => 'DATA_OBJ_RSYNC_AN', - '629' => 'DATA_OBJ_CHKSUM_AN', - '630' => 'PHY_PATH_REG_AN', - '631' => 'DATA_OBJ_PHYMV_AN', - '632' => 'DATA_OBJ_TRIM_AN', - '633' => 'OBJ_STAT_AN', - '634' => 'EXEC_CMD_AN', - '635' => 'SUB_STRUCT_FILE_CREATE_AN', - '636' => 'SUB_STRUCT_FILE_OPEN_AN', - '637' => 'SUB_STRUCT_FILE_READ_AN', - '638' => 'SUB_STRUCT_FILE_WRITE_AN', - '639' => 'SUB_STRUCT_FILE_CLOSE_AN', - '640' => 'SUB_STRUCT_FILE_UNLINK_AN', - '641' => 'SUB_STRUCT_FILE_STAT_AN', - '642' => 'SUB_STRUCT_FILE_FSTAT_AN', - '643' => 'SUB_STRUCT_FILE_LSEEK_AN', - '644' => 'SUB_STRUCT_FILE_RENAME_AN', - '645' => 'QUERY_SPEC_COLL_AN', - '646' => 'MOD_COLL_AN', - '647' => 'SUB_STRUCT_FILE_MKDIR_AN', - '648' => 'SUB_STRUCT_FILE_RMDIR_AN', - '649' => 'SUB_STRUCT_FILE_OPENDIR_AN', - '650' => 'SUB_STRUCT_FILE_READDIR_AN', - '651' => 'SUB_STRUCT_FILE_CLOSEDIR_AN', - '652' => 'DATA_OBJ_TRUNCATE_AN', - '653' => 'SUB_STRUCT_FILE_TRUNCATE_AN', - '654' => 'GET_XMSG_TICKET_AN', - '655' => 'SEND_XMSG_AN', - '656' => 'RCV_XMSG_AN', - '657' => 'SUB_STRUCT_FILE_GET_AN', - '658' => 'SUB_STRUCT_FILE_PUT_AN', - '659' => 'SYNC_MOUNTED_COLL_AN', - '660' => 'STRUCT_FILE_SYNC_AN', - '661' => 'CLOSE_COLLECTION_AN', - '662' => 'COLL_REPL_AN', - '663' => 'RM_COLL_AN', - '700' => 'GET_MISC_SVR_INFO_AN', - '701' => 'GENERAL_ADMIN_AN', - '702' => 'GEN_QUERY_AN', - '703' => 'AUTH_REQUEST_AN', - '704' => 'AUTH_RESPONSE_AN', - '705' => 'AUTH_CHECK_AN', - '706' => 'MOD_AVU_METADATA_AN', - '707' => 'MOD_ACCESS_CONTROL_AN', - '708' => 'RULE_EXEC_MOD_AN', - '709' => 'GET_TEMP_PASSWORD_AN', - '710' => 'GENERAL_UPDATE_AN', - '711' => 'GSI_AUTH_REQUEST_AN', - '712' => 'OPEN_COLLECTION_AN', - '713' => 'READ_COLLECTION_AN', - '725' => 'PAM_AUTH_REQUEST_AN', - '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 deleted file mode 100644 index ecc2f5c2593ddf3f2fbd89163e8bb5d296903284..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RodsConst.inc.php +++ /dev/null @@ -1,6 +0,0 @@ - '-1000', - 'SYS_SOCK_BIND_ERR' => '-2000', - 'SYS_SOCK_ACCEPT_ERR' => '-3000', - 'SYS_HEADER_READ_LEN_ERR' => '-4000', - 'SYS_HEADER_WRITE_LEN_ERR' => '-5000', - 'SYS_HEADER_TPYE_LEN_ERR' => '-6000', - 'SYS_CAUGHT_SIGNAL' => '-7000', - 'SYS_GETSTARTUP_PACK_ERR' => '-8000', - 'SYS_EXCEED_CONNECT_CNT' => '-9000', - 'SYS_USER_NOT_ALLOWED_TO_CONN' => '-10000', - 'SYS_READ_MSG_BODY_INPUT_ERR' => '-11000', - 'SYS_UNMATCHED_API_NUM' => '-12000', - 'SYS_NO_API_PRIV' => '-13000', - 'SYS_API_INPUT_ERR' => '-14000', - 'SYS_PACK_INSTRUCT_FORMAT_ERR' => '-15000', - 'SYS_MALLOC_ERR' => '-16000', - 'SYS_GET_HOSTNAME_ERR' => '-17000', - 'SYS_OUT_OF_FILE_DESC' => '-18000', - 'SYS_FILE_DESC_OUT_OF_RANGE' => '-19000', - 'SYS_UNRECOGNIZED_REMOTE_FLAG' => '-20000', - 'SYS_INVALID_SERVER_HOST' => '-21000', - 'SYS_SVR_TO_SVR_CONNECT_FAILED' => '-22000', - 'SYS_BAD_FILE_DESCRIPTOR' => '-23000', - 'SYS_INTERNAL_NULL_INPUT_ERR' => '-24000', - 'SYS_CONFIG_FILE_ERR' => '-25000', - 'SYS_INVALID_ZONE_NAME' => '-26000', - 'SYS_COPY_LEN_ERR' => '-27000', - 'SYS_PORT_COOKIE_ERR' => '-28000', - 'SYS_KEY_VAL_TABLE_ERR' => '-29000', - 'SYS_INVALID_RESC_TYPE' => '-30000', - 'SYS_INVALID_FILE_PATH' => '-31000', - 'SYS_INVALID_RESC_INPUT' => '-32000', - 'SYS_INVALID_PORTAL_OPR' => '-33000', - 'SYS_PARA_OPR_NO_SUPPORT' => '-34000', - 'SYS_INVALID_OPR_TYPE' => '-35000', - 'SYS_NO_PATH_PERMISSION' => '-36000', - 'SYS_NO_ICAT_SERVER_ERR' => '-37000', - 'SYS_AGENT_INIT_ERR' => '-38000', - 'SYS_PROXYUSER_NO_PRIV' => '-39000', - 'SYS_NO_DATA_OBJ_PERMISSION' => '-40000', - 'SYS_DELETE_DISALLOWED' => '-41000', - 'SYS_OPEN_REI_FILE_ERR' => '-42000', - 'SYS_NO_RCAT_SERVER_ERR' => '-43000', - 'SYS_UNMATCH_PACK_INSTRUCTI_NAME' => '-44000', - 'SYS_SVR_TO_CLI_MSI_NO_EXIST' => '-45000', - 'SYS_COPY_ALREADY_IN_RESC' => '-46000', - 'SYS_RECONN_OPR_MISMATCH' => '-47000', - 'SYS_INPUT_PERM_OUT_OF_RANGE' => '-48000', - 'SYS_FORK_ERROR' => '-49000', - 'SYS_PIPE_ERROR' => '-50000', - 'SYS_EXEC_CMD_STATUS_SZ_ERROR' => '-51000', - 'SYS_PATH_IS_NOT_A_FILE' => '-52000', - 'SYS_UNMATCHED_SPEC_COLL_TYPE' => '-53000', - 'SYS_TOO_MANY_QUERY_RESULT' => '-54000', - 'USER_AUTH_SCHEME_ERR' => '-300000', - 'USER_AUTH_STRING_EMPTY' => '-301000', - 'USER_RODS_HOST_EMPTY' => '-302000', - 'USER_RODS_HOSTNAME_ERR' => '-303000', - 'USER_SOCK_OPEN_ERR' => '-304000', - 'USER_SOCK_CONNECT_ERR' => '-305000', - 'USER_STRLEN_TOOLONG' => '-306000', - 'USER_API_INPUT_ERR' => '-307000', - 'USER_PACKSTRUCT_INPUT_ERR' => '-308000', - 'USER_NO_SUPPORT_ERR' => '-309000', - 'USER_FILE_DOES_NOT_EXIST' => '-310000', - 'USER_FILE_TOO_LARGE' => '-311000', - 'OVERWITE_WITHOUT_FORCE_FLAG' => '-312000', - 'UNMATCHED_KEY_OR_INDEX' => '-313000', - 'USER_CHKSUM_MISMATCH' => '-314000', - 'USER_BAD_KEYWORD_ERR' => '-315000', - 'USER__NULL_INPUT_ERR' => '-316000', - 'USER_INPUT_PATH_ERR' => '-317000', - 'USER_INPUT_OPTION_ERR' => '-318000', - 'USER_INVALID_USERNAME_FORMAT' => '-319000', - 'USER_DIRECT_RESC_INPUT_ERR' => '-320000', - 'USER_NO_RESC_INPUT_ERR' => '-321000', - 'USER_PARAM_LABEL_ERR' => '-322000', - 'USER_PARAM_TYPE_ERR' => '-323000', - 'BASE64_BUFFER_OVERFLOW' => '-324000', - 'BASE64_INVALID_PACKET' => '-325000', - 'USER_MSG_TYPE_NO_SUPPORT' => '-326000', - 'USER_RSYNC_NO_MODE_INPUT_ERR' => '-337000', - 'USER_OPTION_INPUT_ERR' => '-338000', - 'SAME_SRC_DEST_PATHS_ERR' => '-339000', - 'USER_RESTART_FILE_INPUT_ERR' => '-340000', - 'RESTART_OPR_FAILED' => '-341000', - 'BAD_EXEC_CMD_PATH' => '-342000', - 'EXEC_CMD_OUTPUT_TOO_LARGE' => '-343000', - 'EXEC_CMD_ERROR' => '-344000', - 'FILE_INDEX_LOOKUP_ERR' => '-500000', - 'UNIX_FILE_OPEN_ERR' => '-510000', - 'UNIX_FILE_OPEN_ERR_1' => '-510001', - 'UNIX_FILE_OPEN_ERR_2' => '-510002', - 'UNIX_FILE_CREATE_ERR' => '-511000', - 'UNIX_FILE_READ_ERR' => '-512000', - 'UNIX_FILE_WRITE_ERR' => '-513000', - 'UNIX_FILE_CLOSE_ERR' => '-514000', - 'UNIX_FILE_UNLINK_ERR' => '-515000', - 'UNIX_FILE_STAT_ERR' => '-516000', - 'UNIX_FILE_FSTAT_ERR' => '-517000', - 'UNIX_FILE_LSEEK_ERR' => '-518000', - 'UNIX_FILE_FSYNC_ERR' => '-519000', - 'UNIX_FILE_MKDIR_ERR' => '-520000', - 'UNIX_FILE_RMDIR_ERR' => '-521000', - 'UNIX_FILE_OPENDIR_ERR' => '-522000', - 'UNIX_FILE_CLOSEDIR_ERR' => '-523000', - 'UNIX_FILE_READDIR_ERR' => '-524000', - 'UNIX_FILE_STAGE_ERR' => '-525000', - 'UNIX_FILE_GET_FS_FREESPACE_ERR' => '-526000', - 'UNIX_FILE_CHMOD_ERR' => '-527000', - 'UNIX_FILE_RENAME_ERR' => '-528000', - 'CATALOG_NOT_CONNECTED' => '-801000', - 'CAT_ENV_ERR' => '-802000', - 'CAT_CONNECT_ERR' => '-803000', - 'CAT_DISCONNECT_ERR' => '-804000', - 'CAT_CLOSE_ENV_ERR' => '-805000', - 'CAT_SQL_ERR' => '-806000', - 'CAT_GET_ROW_ERR' => '-807000', - 'CAT_NO_ROWS_FOUND' => '-808000', - 'CATALOG_ALREADY_HAS_ITEM_BY_THAT_NAME' => '-809000', - 'CAT_INVALID_RESOURCE_TYPE' => '-810000', - 'CAT_INVALID_RESOURCE_CLASS' => '-811000', - 'CAT_INVALID_RESOURCE_NET_ADDR' => '-812000', - 'CAT_INVALID_RESOURCE_VAULT_PATH' => '-813000', - 'CAT_UNKNOWN_COLLECTION' => '-814000', - 'CAT_INVALID_DATA_TYPE' => '-815000', - 'CAT_INVALID_ARGUMENT' => '-816000', - 'CAT_UNKNOWN_FILE' => '-817000', - 'CAT_NO_ACCESS_PERMISSION' => '-818000', - 'CAT_SUCCESS_BUT_WITH_NO_INFO' => '-819000', - 'CAT_INVALID_USER_TYPE' => '-820000', - 'CAT_COLLECTION_NOT_EMPTY' => '-821000', - 'CAT_TOO_MANY_TABLES' => '-822000', - 'CAT_UNKNOWN_TABLE' => '-823000', - 'CAT_NOT_OPEN' => '-824000', - 'CAT_FAILED_TO_LINK_TABLES' => '-825000', - 'CAT_INVALID_AUTHENTICATION' => '-826000', - 'CAT_INVALID_USER' => '-827000', - 'CAT_INVALID_ZONE' => '-828000', - 'CAT_INVALID_GROUP' => '-829000', - 'CAT_INSUFFICIENT_PRIVILEGE_LEVEL' => '-830000', - 'CAT_INVALID_RESOURCE' => '-831000', - 'CAT_INVALID_CLIENT_USER' => '-832000', - 'CAT_NAME_EXISTS_AS_COLLECTION' => '-833000', - 'CAT_NAME_EXISTS_AS_DATAOBJ' => '-834000', - 'CAT_RESOURCE_NOT_EMPTY' => '-835000', - 'CAT_NOT_A_DATAOBJ_AND_NOT_A_COLLECTION' => '-836000', - 'CAT_RECURSIVE_MOVE' => '-837000', - 'CAT_LAST_REPLICA' => '-838000', - 'CAT_OCI_ERROR' => '-839000', - 'CAT_PASSWORD_EXPIRED' => '-840000', - 'FILE_OPEN_ERR' => '-900000', - 'FILE_READ_ERR' => '-901000', - 'FILE_WRITE_ERR' => '-902000', - 'PASSWORD_EXCEEDS_MAX_SIZE' => '-903000', - 'ENVIRONMENT_VAR_HOME_NOT_DEFINED' => '-904000', - 'UNABLE_TO_STAT_FILE' => '-905000', - 'AUTH_FILE_NOT_ENCRYPTED' => '-906000', - 'AUTH_FILE_DOES_NOT_EXIST' => '-907000', - 'UNLINK_FAILED' => '-908000', - 'NO_PASSWORD_ENTERED' => '-909000', - 'OBJPATH_EMPTY_IN_STRUCT_ERR' => '-1000000', - 'RESCNAME_EMPTY_IN_STRUCT_ERR' => '-1001000', - 'DATATYPE_EMPTY_IN_STRUCT_ERR' => '-1002000', - 'DATASIZE_EMPTY_IN_STRUCT_ERR' => '-1003000', - 'CHKSUM_EMPTY_IN_STRUCT_ERR' => '-1004000', - 'VERSION_EMPTY_IN_STRUCT_ERR' => '-1005000', - 'FILEPATH_EMPTY_IN_STRUCT_ERR' => '-1006000', - 'REPLNUM_EMPTY_IN_STRUCT_ERR' => '-1007000', - 'REPLSTATUS_EMPTY_IN_STRUCT_ERR' => '-1008000', - 'DATAOWNER_EMPTY_IN_STRUCT_ERR' => '-1009000', - 'DATAOWNERZONE_EMPTY_IN_STRUCT_ERR' => '-1010000', - 'DATAEXPIRY_EMPTY_IN_STRUCT_ERR' => '-1011000', - 'DATACOMMENTS_EMPTY_IN_STRUCT_ERR' => '-1012000', - 'DATACREATE_EMPTY_IN_STRUCT_ERR' => '-1013000', - 'DATAMODIFY_EMPTY_IN_STRUCT_ERR' => '-1014000', - 'DATAACCESS_EMPTY_IN_STRUCT_ERR' => '-1015000', - 'DATAACCESSINX_EMPTY_IN_STRUCT_ERR' => '-1016000', - 'NO_RULE_FOUND_ERR' => '-1017000', - 'NO_MORE_RULES_ERR' => '-1018000', - 'UNMATCHED_ACTION_ERR' => '-1019000', - 'RULES_FILE_READ_ERROR' => '-1020000', - 'ACTION_ARG_COUNT_MISMATCH' => '-1021000', - 'MAX_NUM_OF_ARGS_IN_ACTION_EXCEEDED' => '-1022000', - 'UNKNOWN_PARAM_IN_RULE_ERR' => '-1023000', - 'DESTRESCNAME_EMPTY_IN_STRUCT_ERR' => '-1024000', - 'BACKUPRESCNAME_EMPTY_IN_STRUCT_ERR' => '-1025000', - 'DATAID_EMPTY_IN_STRUCT_ERR' => '-1026000', - 'COLLID_EMPTY_IN_STRUCT_ERR' => '-1027000', - 'RESCGROUPNAME_EMPTY_IN_STRUCT_ERR' => '-1028000', - 'STATUSSTRING_EMPTY_IN_STRUCT_ERR' => '-1029000', - 'DATAMAPID_EMPTY_IN_STRUCT_ERR' => '-1030000', - 'USERNAMECLIENT_EMPTY_IN_STRUCT_ERR' => '-1031000', - 'RODSZONECLIENT_EMPTY_IN_STRUCT_ERR' => '-1032000', - 'USERTYPECLIENT_EMPTY_IN_STRUCT_ERR' => '-1033000', - 'HOSTCLIENT_EMPTY_IN_STRUCT_ERR' => '-1034000', - 'AUTHSTRCLIENT_EMPTY_IN_STRUCT_ERR' => '-1035000', - 'USERAUTHSCHEMECLIENT_EMPTY_IN_STRUCT_ERR' => '-1036000', - 'USERINFOCLIENT_EMPTY_IN_STRUCT_ERR' => '-1037000', - 'USERCOMMENTCLIENT_EMPTY_IN_STRUCT_ERR' => '-1038000', - 'USERCREATECLIENT_EMPTY_IN_STRUCT_ERR' => '-1039000', - 'USERMODIFYCLIENT_EMPTY_IN_STRUCT_ERR' => '-1040000', - 'USERNAMEPROXY_EMPTY_IN_STRUCT_ERR' => '-1041000', - 'RODSZONEPROXY_EMPTY_IN_STRUCT_ERR' => '-1042000', - 'USERTYPEPROXY_EMPTY_IN_STRUCT_ERR' => '-1043000', - 'HOSTPROXY_EMPTY_IN_STRUCT_ERR' => '-1044000', - 'AUTHSTRPROXY_EMPTY_IN_STRUCT_ERR' => '-1045000', - 'USERAUTHSCHEMEPROXY_EMPTY_IN_STRUCT_ERR' => '-1046000', - 'USERINFOPROXY_EMPTY_IN_STRUCT_ERR' => '-1047000', - 'USERCOMMENTPROXY_EMPTY_IN_STRUCT_ERR' => '-1048000', - 'USERCREATEPROXY_EMPTY_IN_STRUCT_ERR' => '-1049000', - 'USERMODIFYPROXY_EMPTY_IN_STRUCT_ERR' => '-1050000', - 'COLLNAME_EMPTY_IN_STRUCT_ERR' => '-1051000', - 'COLLPARENTNAME_EMPTY_IN_STRUCT_ERR' => '-1052000', - 'COLLOWNERNAME_EMPTY_IN_STRUCT_ERR' => '-1053000', - 'COLLOWNERZONE_EMPTY_IN_STRUCT_ERR' => '-1054000', - 'COLLEXPIRY_EMPTY_IN_STRUCT_ERR' => '-1055000', - 'COLLCOMMENTS_EMPTY_IN_STRUCT_ERR' => '-1056000', - 'COLLCREATE_EMPTY_IN_STRUCT_ERR' => '-1057000', - 'COLLMODIFY_EMPTY_IN_STRUCT_ERR' => '-1058000', - 'COLLACCESS_EMPTY_IN_STRUCT_ERR' => '-1059000', - 'COLLACCESSINX_EMPTY_IN_STRUCT_ERR' => '-1060000', - 'COLLMAPID_EMPTY_IN_STRUCT_ERR' => '-1062000', - 'COLLINHERITANCE_EMPTY_IN_STRUCT_ERR' => '-1063000', - 'RESCZONE_EMPTY_IN_STRUCT_ERR' => '-1065000', - 'RESCLOC_EMPTY_IN_STRUCT_ERR' => '-1066000', - 'RESCTYPE_EMPTY_IN_STRUCT_ERR' => '-1067000', - 'RESCTYPEINX_EMPTY_IN_STRUCT_ERR' => '-1068000', - 'RESCCLASS_EMPTY_IN_STRUCT_ERR' => '-1069000', - 'RESCCLASSINX_EMPTY_IN_STRUCT_ERR' => '-1070000', - 'RESCVAULTPATH_EMPTY_IN_STRUCT_ERR' => '-1071000', - 'NUMOPEN_ORTS_EMPTY_IN_STRUCT_ERR' => '-1072000', - 'PARAOPR_EMPTY_IN_STRUCT_ERR' => '-1073000', - 'RESCID_EMPTY_IN_STRUCT_ERR' => '-1074000', - 'GATEWAYADDR_EMPTY_IN_STRUCT_ERR' => '-1075000', - 'RESCMAX_BJSIZE_EMPTY_IN_STRUCT_ERR' => '-1076000', - 'FREESPACE_EMPTY_IN_STRUCT_ERR' => '-1077000', - 'FREESPACETIME_EMPTY_IN_STRUCT_ERR' => '-1078000', - 'FREESPACETIMESTAMP_EMPTY_IN_STRUCT_ERR' => '-1079000', - 'RESCINFO_EMPTY_IN_STRUCT_ERR' => '-1080000', - 'RESCCOMMENTS_EMPTY_IN_STRUCT_ERR' => '-1081000', - 'RESCCREATE_EMPTY_IN_STRUCT_ERR' => '-1082000', - 'RESCMODIFY_EMPTY_IN_STRUCT_ERR' => '-1083000', - 'INPUT_ARG_NOT_WELL_FORMED_ERR' => '-1084000', - 'INPUT_ARG_OUT_OF_ARGC_RANGE_ERR' => '-1085000', - 'INSUFFICIENT_INPUT_ARG_ERR' => '-1086000', - 'INPUT_ARG_DOES_NOT_MATCH_ERR' => '-1087000', - 'RETRY_WITHOUT_RECOVERY_ERR' => '-1088000', - 'CUT_ACTION_PROCESSED_ERR' => '-1089000', - 'ACTION_FAILED_ERR' => '-1090000', - 'FAIL_ACTION_ENCOUNTERED_ERR' => '-1091000', - 'VARIABLE_NAME_TOO_LONG_ERR' => '-1092000', - 'UNKNOWN_VARIABLE_MAP_ERR' => '-1093000', - 'UNDEFINED_VARIABLE_MAP_ERR' => '-1094000', - 'NULL_VALUE_ERR' => '-1095000', - 'DVARMAP_FILE_READ_ERROR' => '-1096000', - 'NO_RULE_OR_MSI_FUNCTION_FOUND_ERR' => '-1097000', - 'FILE_CREATE_ERROR' => '-1098000', - 'FMAP_FILE_READ_ERROR' => '-1099000', - 'DATE_FORMAT_ERR' => '-1100000', - 'RULE_FAILED_ERR' => '-1101000', - 'NO_MICROSERVICE_FOUND_ERR' => '-1102000', - 'INVALID_REGEXP' => '-1103000', - 'INVALID_OBJECT_NAME' => '-1104000', - 'INVALID_OBJECT_TYPE' => '-1105000', - 'NO_VALUES_FOUND' => '-1106000', - 'NO_COLUMN_NAME_FOUND' => '-1107000', - 'SYS_NULL_INPUT' => '-99999996', - 'SYS_HANDLER_DONE_WITH_ERROR' => '-99999997', - 'SYS_HANDLER_DONE_NO_ERROR' => '-99999998', - 'SYS_NO_HANDLER_REPLY_MSG' => '-99999999', - 'GENERAL_PRODS_ERR' => '-3000000', - 'PERR_INTERNAL_ERR' => '-3100000', - 'PERR_UNEXPECTED_PACKET_FORMAT' => '-3101000', - 'PERR_PATH_DOES_NOT_EXISTS' => '-3102000', - 'PERR_UNSUPPORTED_PROTOCOL_SCHEME' => '-3103000', - 'PERR_USER_INPUT_ERROR' => '-3104000', - 'PERR_USER_INPUT_PATH_ERROR' => '-3105000', - 'PERR_CONN_NOT_ACTIVE' => '-3106000', - 'SSL_NOT_BUILT_INTO_CLIENT' => '-2100000', - 'SSL_NOT_BUILT_INTO_SERVER' => '-2101000', - 'SSL_INIT_ERROR' => '-2102000', - 'SSL_HANDSHAKE_ERROR' => '-2103000', - 'SSL_SHUTDOWN_ERROR' => '-2104000', - 'SSL_CERT_ERROR' => '-2105000', - 'PAM_AUTH_NOT_BUILT_INTO_CLIENT' => '-991000', - 'PAM_AUTH_NOT_BUILT_INTO_SERVER' => '-992000', - 'PAM_AUTH_PASSWORD_FAILED' => '-993000', - 'PAM_AUTH_PASSWORD_INVALID_TTL' => '-994000', -); -$GLOBALS['PRODS_ERR_CODES_REV'] = array( - '-1000' => 'SYS_SOCK_OPEN_ERR', - '-2000' => 'SYS_SOCK_BIND_ERR', - '-3000' => 'SYS_SOCK_ACCEPT_ERR', - '-4000' => 'SYS_HEADER_READ_LEN_ERR', - '-5000' => 'SYS_HEADER_WRITE_LEN_ERR', - '-6000' => 'SYS_HEADER_TPYE_LEN_ERR', - '-7000' => 'SYS_CAUGHT_SIGNAL', - '-8000' => 'SYS_GETSTARTUP_PACK_ERR', - '-9000' => 'SYS_EXCEED_CONNECT_CNT', - '-10000' => 'SYS_USER_NOT_ALLOWED_TO_CONN', - '-11000' => 'SYS_READ_MSG_BODY_INPUT_ERR', - '-12000' => 'SYS_UNMATCHED_API_NUM', - '-13000' => 'SYS_NO_API_PRIV', - '-14000' => 'SYS_API_INPUT_ERR', - '-15000' => 'SYS_PACK_INSTRUCT_FORMAT_ERR', - '-16000' => 'SYS_MALLOC_ERR', - '-17000' => 'SYS_GET_HOSTNAME_ERR', - '-18000' => 'SYS_OUT_OF_FILE_DESC', - '-19000' => 'SYS_FILE_DESC_OUT_OF_RANGE', - '-20000' => 'SYS_UNRECOGNIZED_REMOTE_FLAG', - '-21000' => 'SYS_INVALID_SERVER_HOST', - '-22000' => 'SYS_SVR_TO_SVR_CONNECT_FAILED', - '-23000' => 'SYS_BAD_FILE_DESCRIPTOR', - '-24000' => 'SYS_INTERNAL_NULL_INPUT_ERR', - '-25000' => 'SYS_CONFIG_FILE_ERR', - '-26000' => 'SYS_INVALID_ZONE_NAME', - '-27000' => 'SYS_COPY_LEN_ERR', - '-28000' => 'SYS_PORT_COOKIE_ERR', - '-29000' => 'SYS_KEY_VAL_TABLE_ERR', - '-30000' => 'SYS_INVALID_RESC_TYPE', - '-31000' => 'SYS_INVALID_FILE_PATH', - '-32000' => 'SYS_INVALID_RESC_INPUT', - '-33000' => 'SYS_INVALID_PORTAL_OPR', - '-34000' => 'SYS_PARA_OPR_NO_SUPPORT', - '-35000' => 'SYS_INVALID_OPR_TYPE', - '-36000' => 'SYS_NO_PATH_PERMISSION', - '-37000' => 'SYS_NO_ICAT_SERVER_ERR', - '-38000' => 'SYS_AGENT_INIT_ERR', - '-39000' => 'SYS_PROXYUSER_NO_PRIV', - '-40000' => 'SYS_NO_DATA_OBJ_PERMISSION', - '-41000' => 'SYS_DELETE_DISALLOWED', - '-42000' => 'SYS_OPEN_REI_FILE_ERR', - '-43000' => 'SYS_NO_RCAT_SERVER_ERR', - '-44000' => 'SYS_UNMATCH_PACK_INSTRUCTI_NAME', - '-45000' => 'SYS_SVR_TO_CLI_MSI_NO_EXIST', - '-46000' => 'SYS_COPY_ALREADY_IN_RESC', - '-47000' => 'SYS_RECONN_OPR_MISMATCH', - '-48000' => 'SYS_INPUT_PERM_OUT_OF_RANGE', - '-49000' => 'SYS_FORK_ERROR', - '-50000' => 'SYS_PIPE_ERROR', - '-51000' => 'SYS_EXEC_CMD_STATUS_SZ_ERROR', - '-52000' => 'SYS_PATH_IS_NOT_A_FILE', - '-53000' => 'SYS_UNMATCHED_SPEC_COLL_TYPE', - '-54000' => 'SYS_TOO_MANY_QUERY_RESULT', - '-300000' => 'USER_AUTH_SCHEME_ERR', - '-301000' => 'USER_AUTH_STRING_EMPTY', - '-302000' => 'USER_RODS_HOST_EMPTY', - '-303000' => 'USER_RODS_HOSTNAME_ERR', - '-304000' => 'USER_SOCK_OPEN_ERR', - '-305000' => 'USER_SOCK_CONNECT_ERR', - '-306000' => 'USER_STRLEN_TOOLONG', - '-307000' => 'USER_API_INPUT_ERR', - '-308000' => 'USER_PACKSTRUCT_INPUT_ERR', - '-309000' => 'USER_NO_SUPPORT_ERR', - '-310000' => 'USER_FILE_DOES_NOT_EXIST', - '-311000' => 'USER_FILE_TOO_LARGE', - '-312000' => 'OVERWITE_WITHOUT_FORCE_FLAG', - '-313000' => 'UNMATCHED_KEY_OR_INDEX', - '-314000' => 'USER_CHKSUM_MISMATCH', - '-315000' => 'USER_BAD_KEYWORD_ERR', - '-316000' => 'USER__NULL_INPUT_ERR', - '-317000' => 'USER_INPUT_PATH_ERR', - '-318000' => 'USER_INPUT_OPTION_ERR', - '-319000' => 'USER_INVALID_USERNAME_FORMAT', - '-320000' => 'USER_DIRECT_RESC_INPUT_ERR', - '-321000' => 'USER_NO_RESC_INPUT_ERR', - '-322000' => 'USER_PARAM_LABEL_ERR', - '-323000' => 'USER_PARAM_TYPE_ERR', - '-324000' => 'BASE64_BUFFER_OVERFLOW', - '-325000' => 'BASE64_INVALID_PACKET', - '-326000' => 'USER_MSG_TYPE_NO_SUPPORT', - '-337000' => 'USER_RSYNC_NO_MODE_INPUT_ERR', - '-338000' => 'USER_OPTION_INPUT_ERR', - '-339000' => 'SAME_SRC_DEST_PATHS_ERR', - '-340000' => 'USER_RESTART_FILE_INPUT_ERR', - '-341000' => 'RESTART_OPR_FAILED', - '-342000' => 'BAD_EXEC_CMD_PATH', - '-343000' => 'EXEC_CMD_OUTPUT_TOO_LARGE', - '-344000' => 'EXEC_CMD_ERROR', - '-500000' => 'FILE_INDEX_LOOKUP_ERR', - '-510000' => 'UNIX_FILE_OPEN_ERR', - '-510001' => 'UNIX_FILE_OPEN_ERR_1', - '-510002' => 'UNIX_FILE_OPEN_ERR_2', - '-511000' => 'UNIX_FILE_CREATE_ERR', - '-512000' => 'UNIX_FILE_READ_ERR', - '-513000' => 'UNIX_FILE_WRITE_ERR', - '-514000' => 'UNIX_FILE_CLOSE_ERR', - '-515000' => 'UNIX_FILE_UNLINK_ERR', - '-516000' => 'UNIX_FILE_STAT_ERR', - '-517000' => 'UNIX_FILE_FSTAT_ERR', - '-518000' => 'UNIX_FILE_LSEEK_ERR', - '-519000' => 'UNIX_FILE_FSYNC_ERR', - '-520000' => 'UNIX_FILE_MKDIR_ERR', - '-521000' => 'UNIX_FILE_RMDIR_ERR', - '-522000' => 'UNIX_FILE_OPENDIR_ERR', - '-523000' => 'UNIX_FILE_CLOSEDIR_ERR', - '-524000' => 'UNIX_FILE_READDIR_ERR', - '-525000' => 'UNIX_FILE_STAGE_ERR', - '-526000' => 'UNIX_FILE_GET_FS_FREESPACE_ERR', - '-527000' => 'UNIX_FILE_CHMOD_ERR', - '-528000' => 'UNIX_FILE_RENAME_ERR', - '-801000' => 'CATALOG_NOT_CONNECTED', - '-802000' => 'CAT_ENV_ERR', - '-803000' => 'CAT_CONNECT_ERR', - '-804000' => 'CAT_DISCONNECT_ERR', - '-805000' => 'CAT_CLOSE_ENV_ERR', - '-806000' => 'CAT_SQL_ERR', - '-807000' => 'CAT_GET_ROW_ERR', - '-808000' => 'CAT_NO_ROWS_FOUND', - '-809000' => 'CATALOG_ALREADY_HAS_ITEM_BY_THAT_NAME', - '-810000' => 'CAT_INVALID_RESOURCE_TYPE', - '-811000' => 'CAT_INVALID_RESOURCE_CLASS', - '-812000' => 'CAT_INVALID_RESOURCE_NET_ADDR', - '-813000' => 'CAT_INVALID_RESOURCE_VAULT_PATH', - '-814000' => 'CAT_UNKNOWN_COLLECTION', - '-815000' => 'CAT_INVALID_DATA_TYPE', - '-816000' => 'CAT_INVALID_ARGUMENT', - '-817000' => 'CAT_UNKNOWN_FILE', - '-818000' => 'CAT_NO_ACCESS_PERMISSION', - '-819000' => 'CAT_SUCCESS_BUT_WITH_NO_INFO', - '-820000' => 'CAT_INVALID_USER_TYPE', - '-821000' => 'CAT_COLLECTION_NOT_EMPTY', - '-822000' => 'CAT_TOO_MANY_TABLES', - '-823000' => 'CAT_UNKNOWN_TABLE', - '-824000' => 'CAT_NOT_OPEN', - '-825000' => 'CAT_FAILED_TO_LINK_TABLES', - '-826000' => 'CAT_INVALID_AUTHENTICATION', - '-827000' => 'CAT_INVALID_USER', - '-828000' => 'CAT_INVALID_ZONE', - '-829000' => 'CAT_INVALID_GROUP', - '-830000' => 'CAT_INSUFFICIENT_PRIVILEGE_LEVEL', - '-831000' => 'CAT_INVALID_RESOURCE', - '-832000' => 'CAT_INVALID_CLIENT_USER', - '-833000' => 'CAT_NAME_EXISTS_AS_COLLECTION', - '-834000' => 'CAT_NAME_EXISTS_AS_DATAOBJ', - '-835000' => 'CAT_RESOURCE_NOT_EMPTY', - '-836000' => 'CAT_NOT_A_DATAOBJ_AND_NOT_A_COLLECTION', - '-837000' => 'CAT_RECURSIVE_MOVE', - '-838000' => 'CAT_LAST_REPLICA', - '-839000' => 'CAT_OCI_ERROR', - '-840000' => 'CAT_PASSWORD_EXPIRED', - '-900000' => 'FILE_OPEN_ERR', - '-901000' => 'FILE_READ_ERR', - '-902000' => 'FILE_WRITE_ERR', - '-903000' => 'PASSWORD_EXCEEDS_MAX_SIZE', - '-904000' => 'ENVIRONMENT_VAR_HOME_NOT_DEFINED', - '-905000' => 'UNABLE_TO_STAT_FILE', - '-906000' => 'AUTH_FILE_NOT_ENCRYPTED', - '-907000' => 'AUTH_FILE_DOES_NOT_EXIST', - '-908000' => 'UNLINK_FAILED', - '-909000' => 'NO_PASSWORD_ENTERED', - '-1000000' => 'OBJPATH_EMPTY_IN_STRUCT_ERR', - '-1001000' => 'RESCNAME_EMPTY_IN_STRUCT_ERR', - '-1002000' => 'DATATYPE_EMPTY_IN_STRUCT_ERR', - '-1003000' => 'DATASIZE_EMPTY_IN_STRUCT_ERR', - '-1004000' => 'CHKSUM_EMPTY_IN_STRUCT_ERR', - '-1005000' => 'VERSION_EMPTY_IN_STRUCT_ERR', - '-1006000' => 'FILEPATH_EMPTY_IN_STRUCT_ERR', - '-1007000' => 'REPLNUM_EMPTY_IN_STRUCT_ERR', - '-1008000' => 'REPLSTATUS_EMPTY_IN_STRUCT_ERR', - '-1009000' => 'DATAOWNER_EMPTY_IN_STRUCT_ERR', - '-1010000' => 'DATAOWNERZONE_EMPTY_IN_STRUCT_ERR', - '-1011000' => 'DATAEXPIRY_EMPTY_IN_STRUCT_ERR', - '-1012000' => 'DATACOMMENTS_EMPTY_IN_STRUCT_ERR', - '-1013000' => 'DATACREATE_EMPTY_IN_STRUCT_ERR', - '-1014000' => 'DATAMODIFY_EMPTY_IN_STRUCT_ERR', - '-1015000' => 'DATAACCESS_EMPTY_IN_STRUCT_ERR', - '-1016000' => 'DATAACCESSINX_EMPTY_IN_STRUCT_ERR', - '-1017000' => 'NO_RULE_FOUND_ERR', - '-1018000' => 'NO_MORE_RULES_ERR', - '-1019000' => 'UNMATCHED_ACTION_ERR', - '-1020000' => 'RULES_FILE_READ_ERROR', - '-1021000' => 'ACTION_ARG_COUNT_MISMATCH', - '-1022000' => 'MAX_NUM_OF_ARGS_IN_ACTION_EXCEEDED', - '-1023000' => 'UNKNOWN_PARAM_IN_RULE_ERR', - '-1024000' => 'DESTRESCNAME_EMPTY_IN_STRUCT_ERR', - '-1025000' => 'BACKUPRESCNAME_EMPTY_IN_STRUCT_ERR', - '-1026000' => 'DATAID_EMPTY_IN_STRUCT_ERR', - '-1027000' => 'COLLID_EMPTY_IN_STRUCT_ERR', - '-1028000' => 'RESCGROUPNAME_EMPTY_IN_STRUCT_ERR', - '-1029000' => 'STATUSSTRING_EMPTY_IN_STRUCT_ERR', - '-1030000' => 'DATAMAPID_EMPTY_IN_STRUCT_ERR', - '-1031000' => 'USERNAMECLIENT_EMPTY_IN_STRUCT_ERR', - '-1032000' => 'RODSZONECLIENT_EMPTY_IN_STRUCT_ERR', - '-1033000' => 'USERTYPECLIENT_EMPTY_IN_STRUCT_ERR', - '-1034000' => 'HOSTCLIENT_EMPTY_IN_STRUCT_ERR', - '-1035000' => 'AUTHSTRCLIENT_EMPTY_IN_STRUCT_ERR', - '-1036000' => 'USERAUTHSCHEMECLIENT_EMPTY_IN_STRUCT_ERR', - '-1037000' => 'USERINFOCLIENT_EMPTY_IN_STRUCT_ERR', - '-1038000' => 'USERCOMMENTCLIENT_EMPTY_IN_STRUCT_ERR', - '-1039000' => 'USERCREATECLIENT_EMPTY_IN_STRUCT_ERR', - '-1040000' => 'USERMODIFYCLIENT_EMPTY_IN_STRUCT_ERR', - '-1041000' => 'USERNAMEPROXY_EMPTY_IN_STRUCT_ERR', - '-1042000' => 'RODSZONEPROXY_EMPTY_IN_STRUCT_ERR', - '-1043000' => 'USERTYPEPROXY_EMPTY_IN_STRUCT_ERR', - '-1044000' => 'HOSTPROXY_EMPTY_IN_STRUCT_ERR', - '-1045000' => 'AUTHSTRPROXY_EMPTY_IN_STRUCT_ERR', - '-1046000' => 'USERAUTHSCHEMEPROXY_EMPTY_IN_STRUCT_ERR', - '-1047000' => 'USERINFOPROXY_EMPTY_IN_STRUCT_ERR', - '-1048000' => 'USERCOMMENTPROXY_EMPTY_IN_STRUCT_ERR', - '-1049000' => 'USERCREATEPROXY_EMPTY_IN_STRUCT_ERR', - '-1050000' => 'USERMODIFYPROXY_EMPTY_IN_STRUCT_ERR', - '-1051000' => 'COLLNAME_EMPTY_IN_STRUCT_ERR', - '-1052000' => 'COLLPARENTNAME_EMPTY_IN_STRUCT_ERR', - '-1053000' => 'COLLOWNERNAME_EMPTY_IN_STRUCT_ERR', - '-1054000' => 'COLLOWNERZONE_EMPTY_IN_STRUCT_ERR', - '-1055000' => 'COLLEXPIRY_EMPTY_IN_STRUCT_ERR', - '-1056000' => 'COLLCOMMENTS_EMPTY_IN_STRUCT_ERR', - '-1057000' => 'COLLCREATE_EMPTY_IN_STRUCT_ERR', - '-1058000' => 'COLLMODIFY_EMPTY_IN_STRUCT_ERR', - '-1059000' => 'COLLACCESS_EMPTY_IN_STRUCT_ERR', - '-1060000' => 'COLLACCESSINX_EMPTY_IN_STRUCT_ERR', - '-1062000' => 'COLLMAPID_EMPTY_IN_STRUCT_ERR', - '-1063000' => 'COLLINHERITANCE_EMPTY_IN_STRUCT_ERR', - '-1065000' => 'RESCZONE_EMPTY_IN_STRUCT_ERR', - '-1066000' => 'RESCLOC_EMPTY_IN_STRUCT_ERR', - '-1067000' => 'RESCTYPE_EMPTY_IN_STRUCT_ERR', - '-1068000' => 'RESCTYPEINX_EMPTY_IN_STRUCT_ERR', - '-1069000' => 'RESCCLASS_EMPTY_IN_STRUCT_ERR', - '-1070000' => 'RESCCLASSINX_EMPTY_IN_STRUCT_ERR', - '-1071000' => 'RESCVAULTPATH_EMPTY_IN_STRUCT_ERR', - '-1072000' => 'NUMOPEN_ORTS_EMPTY_IN_STRUCT_ERR', - '-1073000' => 'PARAOPR_EMPTY_IN_STRUCT_ERR', - '-1074000' => 'RESCID_EMPTY_IN_STRUCT_ERR', - '-1075000' => 'GATEWAYADDR_EMPTY_IN_STRUCT_ERR', - '-1076000' => 'RESCMAX_BJSIZE_EMPTY_IN_STRUCT_ERR', - '-1077000' => 'FREESPACE_EMPTY_IN_STRUCT_ERR', - '-1078000' => 'FREESPACETIME_EMPTY_IN_STRUCT_ERR', - '-1079000' => 'FREESPACETIMESTAMP_EMPTY_IN_STRUCT_ERR', - '-1080000' => 'RESCINFO_EMPTY_IN_STRUCT_ERR', - '-1081000' => 'RESCCOMMENTS_EMPTY_IN_STRUCT_ERR', - '-1082000' => 'RESCCREATE_EMPTY_IN_STRUCT_ERR', - '-1083000' => 'RESCMODIFY_EMPTY_IN_STRUCT_ERR', - '-1084000' => 'INPUT_ARG_NOT_WELL_FORMED_ERR', - '-1085000' => 'INPUT_ARG_OUT_OF_ARGC_RANGE_ERR', - '-1086000' => 'INSUFFICIENT_INPUT_ARG_ERR', - '-1087000' => 'INPUT_ARG_DOES_NOT_MATCH_ERR', - '-1088000' => 'RETRY_WITHOUT_RECOVERY_ERR', - '-1089000' => 'CUT_ACTION_PROCESSED_ERR', - '-1090000' => 'ACTION_FAILED_ERR', - '-1091000' => 'FAIL_ACTION_ENCOUNTERED_ERR', - '-1092000' => 'VARIABLE_NAME_TOO_LONG_ERR', - '-1093000' => 'UNKNOWN_VARIABLE_MAP_ERR', - '-1094000' => 'UNDEFINED_VARIABLE_MAP_ERR', - '-1095000' => 'NULL_VALUE_ERR', - '-1096000' => 'DVARMAP_FILE_READ_ERROR', - '-1097000' => 'NO_RULE_OR_MSI_FUNCTION_FOUND_ERR', - '-1098000' => 'FILE_CREATE_ERROR', - '-1099000' => 'FMAP_FILE_READ_ERROR', - '-1100000' => 'DATE_FORMAT_ERR', - '-1101000' => 'RULE_FAILED_ERR', - '-1102000' => 'NO_MICROSERVICE_FOUND_ERR', - '-1103000' => 'INVALID_REGEXP', - '-1104000' => 'INVALID_OBJECT_NAME', - '-1105000' => 'INVALID_OBJECT_TYPE', - '-1106000' => 'NO_VALUES_FOUND', - '-1107000' => 'NO_COLUMN_NAME_FOUND', - '-99999996' => 'SYS_NULL_INPUT', - '-99999997' => 'SYS_HANDLER_DONE_WITH_ERROR', - '-99999998' => 'SYS_HANDLER_DONE_NO_ERROR', - '-99999999' => 'SYS_NO_HANDLER_REPLY_MSG', - '-3000000' => 'GENERAL_PRODS_ERR', - '-3100000' => 'PERR_INTERNAL_ERR', - '-3101000' => 'PERR_UNEXPECTED_PACKET_FORMAT', - '-3102000' => 'PERR_PATH_DOES_NOT_EXISTS', - '-3103000' => 'PERR_UNSUPPORTED_PROTOCOL_SCHEME', - '-3104000' => 'PERR_USER_INPUT_ERROR', - '-3105000' => 'PERR_USER_INPUT_PATH_ERROR', - '-3106000' => 'PERR_CONN_NOT_ACTIVE', - '-2100000' => 'SSL_NOT_BUILT_INTO_CLIENT', - '-2101000' => 'SSL_NOT_BUILT_INTO_SERVER', - '-2102000' => 'SSL_INIT_ERROR', - '-2103000' => 'SSL_HANDSHAKE_ERROR', - '-2104000' => 'SSL_SHUTDOWN_ERROR', - '-2105000' => 'SSL_CERT_ERROR', - '-991000' => 'PAM_AUTH_NOT_BUILT_INTO_CLIENT', - '-992000' => 'PAM_AUTH_NOT_BUILT_INTO_SERVER', - '-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 deleted file mode 100644 index 55ad02e3b82a8e2a915990ab9836a5713ccd0cf3..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RodsGenQueryKeyWd.inc.php +++ /dev/null @@ -1,224 +0,0 @@ - "all", - 'COPIES_KW' => "copies", - 'EXEC_LOCALLY_KW' => "execLocally", - 'FORCE_FLAG_KW' => "forceFlag", - 'CLI_IN_SVR_FIREWALL_KW' => "cliInSvrFirewall", - 'REG_CHKSUM_KW' => "regChksum", - 'VERIFY_CHKSUM_KW' => "verifyChksum", - 'VERIFY_BY_SIZE_KW' => "verifyBySize", - 'OBJ_PATH_KW' => "objPath", - 'RESC_NAME_KW' => "rescName", - 'DEST_RESC_NAME_KW' => "destRescName", - 'BACKUP_RESC_NAME_KW' => "backupRescName", - 'DATA_TYPE_KW' => "dataType", - 'DATA_SIZE_KW' => "dataSize", - 'CHKSUM_KW' => "chksum", - 'VERSION_KW' => "version", - 'FILE_PATH_KW' => "filePath", - 'REPL_NUM_KW' => "replNum", - 'REPL_STATUS_KW' => "replStatus", - 'ALL_REPL_STATUS_KW' => "allReplStatus", - 'DATA_INCLUDED_KW' => "dataIncluded", - 'DATA_OWNER_KW' => "dataOwner", - 'DATA_OWNER_ZONE_KW' => "dataOwnerZone", - 'DATA_EXPIRY_KW' => "dataExpiry", - 'DATA_COMMENTS_KW' => "dataComments", - 'DATA_CREATE_KW' => "dataCreate", - 'DATA_MODIFY_KW' => "dataModify", - 'DATA_ACCESS_KW' => "dataAccess", - 'DATA_ACCESS_INX_KW' => "dataAccessInx", - 'NO_OPEN_FLAG_KW' => "noOpenFlag", - 'STREAMING_KW' => "streaming", - 'DATA_ID_KW' => "dataId", - 'COLL_ID_KW' => "collId", - 'RESC_GROUP_NAME_KW' => "rescGroupName", - 'STATUS_STRING_KW' => "statusString", - 'DATA_MAP_ID_KW' => "dataMapId", - 'NO_PARA_OP_KW' => "noParaOpr", - 'LOCAL_PATH_KW' => "localPath", - 'RSYNC_MODE_KW' => "rsyncMode", - 'RSYNC_DEST_PATH_KW' => "rsyncDestPath", - 'RSYNC_CHKSUM_KW' => "rsyncChksum", - 'CHKSUM_ALL_KW' => "ChksumAll", - 'FORCE_CHKSUM_KW' => "forceChksum", - 'COLLECTION_KW' => "collection", - 'IRODS_ADMIN_KW' => "irodsAdmin", - 'RESC_ZONE_KW' => "zoneName", - 'RESC_LOC_KW' => "rescLoc", - 'RESC_TYPE_KW' => "rescType", - 'RESC_CLASS_KW' => "rescClass", - 'RESC_VAULT_PATH_KW' => "rescVaultPath", - 'NUM_OPEN_PORTS_KW' => "numOpenPorts", - 'PARA_OPR_KW' => "paraOpr", - 'GATEWAY_ADDR_KW' => "gateWayAddr", - 'RESC_MAX_OBJ_SIZE_KW' => "rescMaxObjSize", - 'FREE_SPACE_KW' => "freeSpace", - 'FREE_SPACE_TIME_KW' => "freeSpaceTime", - 'FREE_SPACE_TIMESTAMP_KW' => "freeSpaceTimeStamp", - 'RESC_TYPE_INX_KW' => "rescTypeInx", - 'RESC_CLASS_INX_KW' => "rescClassInx", - 'RESC_ID_KW' => "rescId", - 'RESC_INFO_KW' => "rescInfo", - 'RESC_COMMENTS_KW' => "rescComments", - 'RESC_CREATE_KW' => "rescCreate", - 'RESC_MODIFY_KW' => "rescModify", - 'USER_NAME_CLIENT_KW' => "userNameClient", - 'RODS_ZONE_CLIENT_KW' => "rodsZoneClient", - 'HOST_CLIENT_KW' => "hostClient", - 'USER_TYPE_CLIENT_KW' => "userTypeClient", - 'AUTH_STR_CLIENT_KW' => "authStrClient", - 'USER_AUTH_SCHEME_CLIENT_KW' => "userAuthSchemeClient", - 'USER_INFO_CLIENT_KW' => "userInfoClient", - 'USER_COMMENT_CLIENT_KW' => "userCommentClient", - 'USER_CREATE_CLIENT_KW' => "userCreateClient", - 'USER_MODIFY_CLIENT_KW' => "userModifyClient", - 'USER_NAME_PROXY_KW' => "userNameProxy", - 'RODS_ZONE_PROXY_KW' => "rodsZoneProxy", - 'HOST_PROXY_KW' => "hostProxy", - 'USER_TYPE_PROXY_KW' => "userTypeProxy", - 'AUTH_STR_PROXY_KW' => "authStrProxy", - 'USER_AUTH_SCHEME_PROXY_KW' => "userAuthSchemeProxy", - 'USER_INFO_PROXY_KW' => "userInfoProxy", - 'USER_COMMENT_PROXY_KW' => "userCommentProxy", - 'USER_CREATE_PROXY_KW' => "userCreateProxy", - 'USER_MODIFY_PROXY_KW' => "userModifyProxy", - 'ACCESS_PERMISSION_KW' => "accessPermission", - 'COLL_NAME_KW' => "collName", - 'COLL_PARENT_NAME_KW' => "collParentName", - 'COLL_OWNER_NAME_KW' => "collOwnername", - 'COLL_OWNER_ZONE_KW' => "collOwnerZone", - 'COLL_MAP_ID_KW' => "collMapId", - 'COLL_INHERITANCE_KW' => "collInheritance", - 'COLL_COMMENTS_KW' => "collComments", - 'COLL_EXPIRY_KW' => "collExpiry", - 'COLL_CREATE_KW' => "collCreate", - 'COLL_MODIFY_KW' => "collModify", - 'COLL_ACCESS_KW' => "collAccess", - 'COLL_ACCESS_INX_KW' => "collAccessInx", - 'COLL_ID_KW' => "collId", - 'RULE_NAME_KW' => "ruleName", - 'RULE_REI_FILE_PATH_KW' => "reiFilePath", - 'RULE_USER_NAME_KW' => "userName", - 'RULE_EXE_ADDRESS_KW' => "exeAddress", - 'RULE_EXE_TIME_KW' => "exeTime", - 'RULE_EXE_FREQUENCY_KW' => "exeFrequency", - 'RULE_PRIORITY_KW' => "priority", - 'RULE_ESTIMATE_EXE_TIME_KW' => "estimateExeTime", - 'RULE_NOTIFICATION_ADDR_KW' => "notificationAddr", - 'RULE_LAST_EXE_TIME_KW' => "lastExeTime", - 'RULE_EXE_STATUS_KW' => "exeStatus", -); -$GLOBALS['PRODS_GENQUE_KEYWD_REV'] = array( - "all" => 'ALL_KW', - "copies" => 'COPIES_KW', - "execLocally" => 'EXEC_LOCALLY_KW', - "forceFlag" => 'FORCE_FLAG_KW', - "cliInSvrFirewall" => 'CLI_IN_SVR_FIREWALL_KW', - "regChksum" => 'REG_CHKSUM_KW', - "verifyChksum" => 'VERIFY_CHKSUM_KW', - "verifyBySize" => 'VERIFY_BY_SIZE_KW', - "objPath" => 'OBJ_PATH_KW', - "rescName" => 'RESC_NAME_KW', - "destRescName" => 'DEST_RESC_NAME_KW', - "backupRescName" => 'BACKUP_RESC_NAME_KW', - "dataType" => 'DATA_TYPE_KW', - "dataSize" => 'DATA_SIZE_KW', - "chksum" => 'CHKSUM_KW', - "version" => 'VERSION_KW', - "filePath" => 'FILE_PATH_KW', - "replNum" => 'REPL_NUM_KW', - "replStatus" => 'REPL_STATUS_KW', - "allReplStatus" => 'ALL_REPL_STATUS_KW', - "dataIncluded" => 'DATA_INCLUDED_KW', - "dataOwner" => 'DATA_OWNER_KW', - "dataOwnerZone" => 'DATA_OWNER_ZONE_KW', - "dataExpiry" => 'DATA_EXPIRY_KW', - "dataComments" => 'DATA_COMMENTS_KW', - "dataCreate" => 'DATA_CREATE_KW', - "dataModify" => 'DATA_MODIFY_KW', - "dataAccess" => 'DATA_ACCESS_KW', - "dataAccessInx" => 'DATA_ACCESS_INX_KW', - "noOpenFlag" => 'NO_OPEN_FLAG_KW', - "streaming" => 'STREAMING_KW', - "dataId" => 'DATA_ID_KW', - "collId" => 'COLL_ID_KW', - "rescGroupName" => 'RESC_GROUP_NAME_KW', - "statusString" => 'STATUS_STRING_KW', - "dataMapId" => 'DATA_MAP_ID_KW', - "noParaOpr" => 'NO_PARA_OP_KW', - "localPath" => 'LOCAL_PATH_KW', - "rsyncMode" => 'RSYNC_MODE_KW', - "rsyncDestPath" => 'RSYNC_DEST_PATH_KW', - "rsyncChksum" => 'RSYNC_CHKSUM_KW', - "ChksumAll" => 'CHKSUM_ALL_KW', - "forceChksum" => 'FORCE_CHKSUM_KW', - "collection" => 'COLLECTION_KW', - "irodsAdmin" => 'IRODS_ADMIN_KW', - "zoneName" => 'RESC_ZONE_KW', - "rescLoc" => 'RESC_LOC_KW', - "rescType" => 'RESC_TYPE_KW', - "rescClass" => 'RESC_CLASS_KW', - "rescVaultPath" => 'RESC_VAULT_PATH_KW', - "numOpenPorts" => 'NUM_OPEN_PORTS_KW', - "paraOpr" => 'PARA_OPR_KW', - "gateWayAddr" => 'GATEWAY_ADDR_KW', - "rescMaxObjSize" => 'RESC_MAX_OBJ_SIZE_KW', - "freeSpace" => 'FREE_SPACE_KW', - "freeSpaceTime" => 'FREE_SPACE_TIME_KW', - "freeSpaceTimeStamp" => 'FREE_SPACE_TIMESTAMP_KW', - "rescTypeInx" => 'RESC_TYPE_INX_KW', - "rescClassInx" => 'RESC_CLASS_INX_KW', - "rescId" => 'RESC_ID_KW', - "rescInfo" => 'RESC_INFO_KW', - "rescComments" => 'RESC_COMMENTS_KW', - "rescCreate" => 'RESC_CREATE_KW', - "rescModify" => 'RESC_MODIFY_KW', - "userNameClient" => 'USER_NAME_CLIENT_KW', - "rodsZoneClient" => 'RODS_ZONE_CLIENT_KW', - "hostClient" => 'HOST_CLIENT_KW', - "userTypeClient" => 'USER_TYPE_CLIENT_KW', - "authStrClient" => 'AUTH_STR_CLIENT_KW', - "userAuthSchemeClient" => 'USER_AUTH_SCHEME_CLIENT_KW', - "userInfoClient" => 'USER_INFO_CLIENT_KW', - "userCommentClient" => 'USER_COMMENT_CLIENT_KW', - "userCreateClient" => 'USER_CREATE_CLIENT_KW', - "userModifyClient" => 'USER_MODIFY_CLIENT_KW', - "userNameProxy" => 'USER_NAME_PROXY_KW', - "rodsZoneProxy" => 'RODS_ZONE_PROXY_KW', - "hostProxy" => 'HOST_PROXY_KW', - "userTypeProxy" => 'USER_TYPE_PROXY_KW', - "authStrProxy" => 'AUTH_STR_PROXY_KW', - "userAuthSchemeProxy" => 'USER_AUTH_SCHEME_PROXY_KW', - "userInfoProxy" => 'USER_INFO_PROXY_KW', - "userCommentProxy" => 'USER_COMMENT_PROXY_KW', - "userCreateProxy" => 'USER_CREATE_PROXY_KW', - "userModifyProxy" => 'USER_MODIFY_PROXY_KW', - "accessPermission" => 'ACCESS_PERMISSION_KW', - "collName" => 'COLL_NAME_KW', - "collParentName" => 'COLL_PARENT_NAME_KW', - "collOwnername" => 'COLL_OWNER_NAME_KW', - "collOwnerZone" => 'COLL_OWNER_ZONE_KW', - "collMapId" => 'COLL_MAP_ID_KW', - "collInheritance" => 'COLL_INHERITANCE_KW', - "collComments" => 'COLL_COMMENTS_KW', - "collExpiry" => 'COLL_EXPIRY_KW', - "collCreate" => 'COLL_CREATE_KW', - "collModify" => 'COLL_MODIFY_KW', - "collAccess" => 'COLL_ACCESS_KW', - "collAccessInx" => 'COLL_ACCESS_INX_KW', - "collId" => 'COLL_ID_KW', - "ruleName" => 'RULE_NAME_KW', - "reiFilePath" => 'RULE_REI_FILE_PATH_KW', - "userName" => 'RULE_USER_NAME_KW', - "exeAddress" => 'RULE_EXE_ADDRESS_KW', - "exeTime" => 'RULE_EXE_TIME_KW', - "exeFrequency" => 'RULE_EXE_FREQUENCY_KW', - "priority" => 'RULE_PRIORITY_KW', - "estimateExeTime" => 'RULE_ESTIMATE_EXE_TIME_KW', - "notificationAddr" => 'RULE_NOTIFICATION_ADDR_KW', - "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 deleted file mode 100644 index a65823ec8778569b0e6b3924e44a769fd8425a54..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/RodsGenQueryNum.inc.php +++ /dev/null @@ -1,234 +0,0 @@ - '50', - 'MAX_SQL_ROWS' => '500', - 'ORDER_BY' => '1024', - 'ORDER_BY_DESC' => '2048', - 'RETURN_TOTAL_ROW_COUNT' => '32', - 'SELECT_MIN' => '2', - 'SELECT_MAX' => '3', - 'SELECT_SUM' => '4', - 'SELECT_AVG' => '5', - 'SELECT_COUNT' => '6', - 'COL_ZONE_ID' => '101', - 'COL_ZONE_NAME' => '102', - 'COL_USER_ID' => '201', - 'COL_USER_NAME' => '202', - 'COL_USER_TYPE' => '203', - 'COL_USER_ZONE' => '204', - 'COL_USER_DN' => '205', - 'COL_USER_INFO' => '206', - 'COL_USER_COMMENT' => '207', - 'COL_USER_CREATE_TIME' => '208', - 'COL_USER_MODIFY_TIME' => '209', - 'COL_R_RESC_ID' => '301', - 'COL_R_RESC_NAME' => '302', - 'COL_R_ZONE_NAME' => '303', - 'COL_R_TYPE_NAME' => '304', - 'COL_R_CLASS_NAME' => '305', - 'COL_R_LOC' => '306', - 'COL_R_VAULT_PATH' => '307', - 'COL_R_FREE_SPACE' => '308', - 'COL_R_RESC_INFO' => '309', - 'COL_R_RESC_COMMENT' => '310', - 'COL_R_CREATE_TIME' => '311', - 'COL_R_MODIFY_TIME' => '312', - 'COL_D_DATA_ID' => '401', - 'COL_D_COLL_ID' => '402', - 'COL_DATA_NAME' => '403', - 'COL_DATA_REPL_NUM' => '404', - 'COL_DATA_VERSION' => '405', - 'COL_DATA_TYPE_NAME' => '406', - 'COL_DATA_SIZE' => '407', - 'COL_D_RESC_GROUP_NAME' => '408', - 'COL_D_RESC_NAME' => '409', - 'COL_D_DATA_PATH' => '410', - 'COL_D_OWNER_NAME' => '411', - 'COL_D_OWNER_ZONE' => '412', - 'COL_D_REPL_STATUS' => '413', - 'COL_D_DATA_STATUS' => '414', - 'COL_D_DATA_CHECKSUM' => '415', - 'COL_D_EXPIRY' => '416', - 'COL_D_MAP_ID' => '417', - 'COL_D_COMMENTS' => '418', - 'COL_D_CREATE_TIME' => '419', - 'COL_D_MODIFY_TIME' => '420', - 'COL_COLL_ID' => '500', - 'COL_COLL_NAME' => '501', - 'COL_COLL_PARENT_NAME' => '502', - 'COL_COLL_OWNER_NAME' => '503', - 'COL_COLL_OWNER_ZONE' => '504', - 'COL_COLL_MAP_ID' => '505', - 'COL_COLL_INHERITANCE' => '506', - 'COL_COLL_COMMENTS' => '507', - 'COL_COLL_CREATE_TIME' => '508', - 'COL_COLL_MODIFY_TIME' => '509', - 'COL_COLL_TYPE' => '510', - 'COL_COLL_INFO1' => '511', - 'COL_COLL_INFO2' => '512', - 'COL_META_DATA_ATTR_NAME' => '600', - 'COL_META_DATA_ATTR_VALUE' => '601', - 'COL_META_DATA_ATTR_UNITS' => '602', - 'COL_META_DATA_ATTR_ID' => '603', - 'COL_META_COLL_ATTR_NAME' => '610', - 'COL_META_COLL_ATTR_VALUE' => '611', - 'COL_META_COLL_ATTR_UNITS' => '612', - 'COL_META_COLL_ATTR_ID' => '613', - 'COL_META_NAMESPACE_COLL' => '620', - 'COL_META_NAMESPACE_DATA' => '621', - 'COL_META_NAMESPACE_RESC' => '622', - 'COL_META_NAMESPACE_USER' => '623', - 'COL_META_RESC_ATTR_NAME' => '630', - 'COL_META_RESC_ATTR_VALUE' => '631', - 'COL_META_RESC_ATTR_UNITS' => '632', - 'COL_META_RESC_ATTR_ID' => '633', - 'COL_META_USER_ATTR_NAME' => '640', - 'COL_META_USER_ATTR_VALUE' => '641', - 'COL_META_USER_ATTR_UNITS' => '642', - 'COL_META_USER_ATTR_ID' => '643', - 'COL_DATA_ACCESS_TYPE' => '700', - 'COL_DATA_ACCESS_NAME' => '701', - 'COL_DATA_TOKEN_NAMESPACE' => '702', - 'COL_DATA_ACCESS_USER_ID' => '703', - 'COL_DATA_ACCESS_DATA_ID' => '704', - 'COL_RESC_GROUP_RESC_ID' => '800', - 'COL_RESC_GROUP_NAME' => '801', - 'COL_USER_GROUP_ID' => '900', - 'COL_USER_GROUP_NAME' => '901', - 'COL_RULE_EXEC_ID' => '1000', - 'COL_RULE_EXEC_NAME' => '1001', - 'COL_RULE_EXEC_REI_FILE_PATH' => '1002', - 'COL_RULE_EXEC_USER_NAME' => '1003', - 'COL_RULE_EXEC_ADDRESS' => '1004', - 'COL_RULE_EXEC_TIME' => '1005', - 'COL_RULE_EXEC_FREQUENCY' => '1006', - 'COL_RULE_EXEC_PRIORITY' => '1007', - 'COL_RULE_EXEC_ESTIMATED_EXE_TIME' => '1008', - 'COL_RULE_EXEC_NOTIFICATION_ADDR' => '1009', - 'COL_RULE_EXEC_LAST_EXE_TIME' => '1010', - 'COL_RULE_EXEC_STATUS' => '1011', - 'COL_TOKEN_NAMESPACE' => '1100', - 'COL_TOKEN_ID' => '1101', - 'COL_TOKEN_NAME' => '1102', - 'COL_TOKEN_VALUE' => '1103', - 'COL_TOKEN_VALUE2' => '1104', - 'COL_TOKEN_VALUE3' => '1105', - 'COL_TOKEN_COMMENT' => '1106', -); -$GLOBALS['PRODS_GENQUE_NUMS_REV'] = array( - '50' => 'MAX_SQL_ATTR', - '500' => 'MAX_SQL_ROWS', - '1024' => 'ORDER_BY', - '2048' => 'ORDER_BY_DESC', - '32' => 'RETURN_TOTAL_ROW_COUNT', - '2' => 'SELECT_MIN', - '3' => 'SELECT_MAX', - '4' => 'SELECT_SUM', - '5' => 'SELECT_AVG', - '6' => 'SELECT_COUNT', - '101' => 'COL_ZONE_ID', - '102' => 'COL_ZONE_NAME', - '201' => 'COL_USER_ID', - '202' => 'COL_USER_NAME', - '203' => 'COL_USER_TYPE', - '204' => 'COL_USER_ZONE', - '205' => 'COL_USER_DN', - '206' => 'COL_USER_INFO', - '207' => 'COL_USER_COMMENT', - '208' => 'COL_USER_CREATE_TIME', - '209' => 'COL_USER_MODIFY_TIME', - '301' => 'COL_R_RESC_ID', - '302' => 'COL_R_RESC_NAME', - '303' => 'COL_R_ZONE_NAME', - '304' => 'COL_R_TYPE_NAME', - '305' => 'COL_R_CLASS_NAME', - '306' => 'COL_R_LOC', - '307' => 'COL_R_VAULT_PATH', - '308' => 'COL_R_FREE_SPACE', - '309' => 'COL_R_RESC_INFO', - '310' => 'COL_R_RESC_COMMENT', - '311' => 'COL_R_CREATE_TIME', - '312' => 'COL_R_MODIFY_TIME', - '401' => 'COL_D_DATA_ID', - '402' => 'COL_D_COLL_ID', - '403' => 'COL_DATA_NAME', - '404' => 'COL_DATA_REPL_NUM', - '405' => 'COL_DATA_VERSION', - '406' => 'COL_DATA_TYPE_NAME', - '407' => 'COL_DATA_SIZE', - '408' => 'COL_D_RESC_GROUP_NAME', - '409' => 'COL_D_RESC_NAME', - '410' => 'COL_D_DATA_PATH', - '411' => 'COL_D_OWNER_NAME', - '412' => 'COL_D_OWNER_ZONE', - '413' => 'COL_D_REPL_STATUS', - '414' => 'COL_D_DATA_STATUS', - '415' => 'COL_D_DATA_CHECKSUM', - '416' => 'COL_D_EXPIRY', - '417' => 'COL_D_MAP_ID', - '418' => 'COL_D_COMMENTS', - '419' => 'COL_D_CREATE_TIME', - '420' => 'COL_D_MODIFY_TIME', - '500' => 'COL_COLL_ID', - '501' => 'COL_COLL_NAME', - '502' => 'COL_COLL_PARENT_NAME', - '503' => 'COL_COLL_OWNER_NAME', - '504' => 'COL_COLL_OWNER_ZONE', - '505' => 'COL_COLL_MAP_ID', - '506' => 'COL_COLL_INHERITANCE', - '507' => 'COL_COLL_COMMENTS', - '508' => 'COL_COLL_CREATE_TIME', - '509' => 'COL_COLL_MODIFY_TIME', - '510' => 'COL_COLL_TYPE', - '511' => 'COL_COLL_INFO1', - '512' => 'COL_COLL_INFO2', - '600' => 'COL_META_DATA_ATTR_NAME', - '601' => 'COL_META_DATA_ATTR_VALUE', - '602' => 'COL_META_DATA_ATTR_UNITS', - '603' => 'COL_META_DATA_ATTR_ID', - '610' => 'COL_META_COLL_ATTR_NAME', - '611' => 'COL_META_COLL_ATTR_VALUE', - '612' => 'COL_META_COLL_ATTR_UNITS', - '613' => 'COL_META_COLL_ATTR_ID', - '620' => 'COL_META_NAMESPACE_COLL', - '621' => 'COL_META_NAMESPACE_DATA', - '622' => 'COL_META_NAMESPACE_RESC', - '623' => 'COL_META_NAMESPACE_USER', - '630' => 'COL_META_RESC_ATTR_NAME', - '631' => 'COL_META_RESC_ATTR_VALUE', - '632' => 'COL_META_RESC_ATTR_UNITS', - '633' => 'COL_META_RESC_ATTR_ID', - '640' => 'COL_META_USER_ATTR_NAME', - '641' => 'COL_META_USER_ATTR_VALUE', - '642' => 'COL_META_USER_ATTR_UNITS', - '643' => 'COL_META_USER_ATTR_ID', - '700' => 'COL_DATA_ACCESS_TYPE', - '701' => 'COL_DATA_ACCESS_NAME', - '702' => 'COL_DATA_TOKEN_NAMESPACE', - '703' => 'COL_DATA_ACCESS_USER_ID', - '704' => 'COL_DATA_ACCESS_DATA_ID', - '800' => 'COL_RESC_GROUP_RESC_ID', - '801' => 'COL_RESC_GROUP_NAME', - '900' => 'COL_USER_GROUP_ID', - '901' => 'COL_USER_GROUP_NAME', - '1000' => 'COL_RULE_EXEC_ID', - '1001' => 'COL_RULE_EXEC_NAME', - '1002' => 'COL_RULE_EXEC_REI_FILE_PATH', - '1003' => 'COL_RULE_EXEC_USER_NAME', - '1004' => 'COL_RULE_EXEC_ADDRESS', - '1005' => 'COL_RULE_EXEC_TIME', - '1006' => 'COL_RULE_EXEC_FREQUENCY', - '1007' => 'COL_RULE_EXEC_PRIORITY', - '1008' => 'COL_RULE_EXEC_ESTIMATED_EXE_TIME', - '1009' => 'COL_RULE_EXEC_NOTIFICATION_ADDR', - '1010' => 'COL_RULE_EXEC_LAST_EXE_TIME', - '1011' => 'COL_RULE_EXEC_STATUS', - '1100' => 'COL_TOKEN_NAMESPACE', - '1101' => 'COL_TOKEN_ID', - '1102' => 'COL_TOKEN_NAME', - '1103' => 'COL_TOKEN_VALUE', - '1104' => 'COL_TOKEN_VALUE2', - '1105' => 'COL_TOKEN_VALUE3', - '1106' => 'COL_TOKEN_COMMENT', -); diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/autoload.inc.php b/apps/files_external/3rdparty/irodsphp/prods/src/autoload.inc.php deleted file mode 100644 index 593b901959e21993c1775a97132dfba68a46c1f3..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/autoload.inc.php +++ /dev/null @@ -1,47 +0,0 @@ -read())) { - if ($folder != "." && $folder != "..") { - if (is_dir(CLASS_DIR . $sub . $folder)) { - $subFolder = classFolder($className, $sub . $folder . "/"); - - if ($subFolder) - return $subFolder; - } - } - } - $dir->close(); - return false; -} - -spl_autoload_register('__autoload'); 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 deleted file mode 100644 index e5cff1f60e3adfbf38eaad58db61126b8890207a..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RODSPacket.class.php +++ /dev/null @@ -1,248 +0,0 @@ - array ("type" => NULL, "msgLen" => 0, - "errorLen" => 0, "bsLen" => 0, "intInfo" => 0), - "StartupPack_PI" => array ("irodsProt" => 1, "connectCnt" => 0, - "proxyUser" => NULL, "proxyRcatZone" => NULL, "clientUser" => NULL, - "clientRcatZone" => NULL, "relVersion" => NULL, - "apiVersion" => NULL, "option" => NULL ), - "Version_PI" => array ("status"=>0,"relVersion"=>NULL,"apiVersion"=>NULL), - "authResponseInp_PI" => array("response" => NULL, "username" => NULL), - "authRequestOut_PI" => array("challenge" => NULL) -); -*/ - -class RODSPacket -{ - protected $type; // type of packet - protected $packlets; // (array of mixed) main message body - - public function __construct($type = NULL, array $arr = NULL) - { - if (!isset($type)) - return; - - $this->type = $type; - $this->packlets = $arr; - } - - public function toXML() - { - if (empty($this->type)) - return NULL; - - $doc = new DOMDocument(); - $root = $this->toDOMElement($doc); - $doc->appendChild($root); - return ($doc->saveXML($root, LIBXML_NOEMPTYTAG)); - } - - /* - public function fromXML($str) - { - try { - $xml = new SimpleXMLElement($str); - } catch (Exception $e) { - throw new RODSException("RODSPacket::fromXML failed. ". - "Mal-formated XML: '$str'\n", - PERR_INTERNAL_ERR); - } - - if (isset($this->type)&&($this->type!=$xml->getName())) - { - throw new RODSException("RODSPacket::fromXML failed. ". - "Possible type mismatch! expected type:".$this->type." but got: ". - $xml->getName()." \n", - PERR_INTERNAL_ERR); - } - - $this->type=$xml->getName(); - - foreach($xml as $key => $val) - { - if (!array_key_exists($key,$this->msg)) - { - throw new RODSException("RODSPacket::fromXML failed. ". - "Possible type mismatch! expected key '$key' doesn't exists\n", - PERR_INTERNAL_ERR); - } - $this->msg[$key]=(string)$val; - } - } - */ - - public static function parseXML($xmlstr) - { - if (false == ($doc = DOMDocument::loadXML($xmlstr))) { - throw new RODSException("RODSPacket::parseXML failed. " . - "Failed to loadXML(). The xmlstr is: $xmlstr\n", - PERR_UNEXPECTED_PACKET_FORMAT); - } - - $rp_classname = "RP_" . substr($doc->tagName, 0, strlen($doc->tagName) - 3); - $packet = new $rp_classname(); - $packet->fromDOM($doc); - } - - /* - public function fromDOM(DOMNode $domnode) - { - if (!isset($this->packlets)) - return; - - $i=0; - $domnode_children=$domnode->childNodes; - - foreach($this->packlets as $packlet_key => &$packlet_val) - { - $domnode_child=$domnode_children->item($i++); - - // check if the tag names are expected - if ($domnode_child->tagName!=$packlet_key) - { - throw new RODSException("RODSPacket::fromDOM failed. ". - "Expecting packlet:$packlet_key, but got:".$domnode_child->tagName." \n", - PERR_UNEXPECTED_PACKET_FORMAT); - } - - if (is_a($packlet_val, "RODSPacket")) //if expecting sub packet - { - $packlet_val->fromDOM($domnode_child); - } - else //if expecting an string - { - - } - } - } - - */ - - public function fromSXE(SimpleXMLElement $sxe) - { - if (!isset($this->packlets)) - return; - - foreach ($this->packlets as $packlet_key => &$packlet_val) { - if ($packlet_val instanceof RODSPacket) //if expecting sub packet - { - if (!isset($sxe->$packlet_key)) { - throw new RODSException("RODSPacket(" . get_class($this) . ")::fromSXE failed. " . - "Failed to find expected packlet: '$packlet_key' \n", - "PERR_UNEXPECTED_PACKET_FORMAT"); - } - $packlet_val->fromSXE($sxe->$packlet_key); - } else - if (is_array($packlet_val)) //if expecting array - { - if (isset($sxe->$packlet_key)) { - $packlet_val = array(); - foreach ($sxe->$packlet_key as $sxe_val) { - if ((!empty($this->array_rp_type)) && - (!empty($this->array_rp_type["$packlet_key"])) - ) // if it's an array of packets - { - $class_name = $this->array_rp_type[$packlet_key]; - $sub_array_packet = new $class_name(); - $sub_array_packet->fromSXE($sxe_val); - $packlet_val[] = $sub_array_packet; - } else { - $packlet_val[] = (string)$sxe_val; - } - } - } - - } else { - if (isset($sxe->$packlet_key)) { - $packlet_val = (string)$sxe->$packlet_key; - } - } - } - /* - foreach($sxe->children() as $child) - { - $tagname=$child->getName(); - if(substr($tagname,-3,3)=="_PI") - { - $rp_classname="RP_".substr($name,0,strlen($name)-3); - $child_rp=new $rp_classname(); - $child_rp->fromSXE($child); - } - else - { - $this->packlets[$child->getName()]=(string)$child; - } - } - */ - } - - public function toDOMElement(DOMDocument $doc) - { - if (empty($this->type)) - return NULL; - - $node = $doc->createElement($this->type); - - foreach ($this->packlets as $name => $packlet) { - if ($packlet instanceof RODSPacket) //if node is a packet - { - $child_node = $packlet->toDOMElement($doc); - if (isset($child_node)) - $node->appendChild($packlet->toDOMElement($doc)); - } else - if (is_array($packlet)) //if node is an array - { - if (isset($packlet)) { - foreach ($packlet as $sub_packlet) { - if ($sub_packlet instanceof RODSPacket) //if sub_node is a packet - { - $child_node = $sub_packlet->toDOMElement($doc); - if (isset($child_node)) - $node->appendChild($sub_packlet->toDOMElement($doc)); - } else { - //echo "sub_packlet = $sub_packlet
\n"; - $node->appendChild($doc->createElement($name, htmlspecialchars($sub_packlet))); - } - } - } - } else //if node holds a string - { //echo "packlet = $packlet
\n"; - $node->appendChild($doc->createElement($name, htmlspecialchars($packlet))); - } - } - - return $node; - } - - public function __get($name) - { - if (array_key_exists($name, $this->packlets)) - return $this->packlets[$name]; - else { - debug_print_backtrace(); - throw new RODSException("RODSPacket::__get() failed. Trying to access field '$name' that doesn't exist!", - "PERR_INTERNAL_ERR"); - } - } - - public function __set($name, $val) - { - if (array_key_exists($name, $this->packlets)) - $this->packlets[$name] = $val; - else - throw new RODSException("RODSPacket::__set() failed. Trying to access field '$name' that doesn't exist!", - "PERR_INTERNAL_ERR"); - } - - /* - public static function makeStartupPack($user,$zone) - { - $msg=array(1,0,$user,$zone,$user,$zone,'rods0.5','a',NULL); - return (new RODSPacket("StartupPack_PI",$msg)); - } - */ -} 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 deleted file mode 100644 index a7598bb7e62938e27ba12f877710c00c39ed3cee..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_BinBytesBuf.class.php +++ /dev/null @@ -1,12 +0,0 @@ - $buflen, "buf" => $buf); - parent::__construct("BinBytesBuf_PI", $packlets); - } - -} 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 deleted file mode 100644 index 05c51cf56c0caaf9e2b3b0ee99e96cc55c6cc1e9..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_CollInp.class.php +++ /dev/null @@ -1,17 +0,0 @@ - $collName, - 'KeyValPair_PI' => $KeyValPair_PI); - parent::__construct("CollInp_PI", $packlets); - } - -} 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 deleted file mode 100644 index a9140050bc7be3c8c1839a19b218878f1cdc4c7f..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_CollOprStat.class.php +++ /dev/null @@ -1,15 +0,0 @@ - $filesCnt, "totalFileCnt" => $totalFileCnt, - 'bytesWritten' => $bytesWritten, 'lastObjPath' => $lastObjPath); - parent::__construct("CollOprStat_PI", $packlets); - } - -} 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 deleted file mode 100644 index 481ff34a22ab172f55bcfcb49fc6522bb3159c5c..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_DataObjCopyInp.class.php +++ /dev/null @@ -1,17 +0,0 @@ - $src, 'dest' => $dest); - parent::__construct("DataObjCopyInp_PI", $packlets); - } - -} 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 deleted file mode 100644 index f6200d1761c6948aa91832e0bc41548d17246a5f..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_DataObjInp.class.php +++ /dev/null @@ -1,20 +0,0 @@ - $objPath, 'createMode' => $createMode, - 'openFlags' => $openFlags, 'offset' => $offset, "dataSize" => $dataSize, - "numThreads" => $numThreads, "oprType" => $oprType, - 'KeyValPair_PI' => $KeyValPair_PI); - parent::__construct("DataObjInp_PI", $packlets); - } - -} 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 deleted file mode 100644 index a7559e3c2566045233826f56e00e657f7c1b44e9..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ExecCmdOut.class.php +++ /dev/null @@ -1,54 +0,0 @@ - $buf); - parent::__construct("ExecCmdOut_PI", $packlets); - } - - public function fromSXE(SimpleXMLElement $sxe) - { - $binbytes = "BinBytesBuf_PI"; - $name = "buf"; - - if (!isset($this->packlets)) - return; - - $packlet_value = ""; - try { - foreach ($sxe->$binbytes as $binpacket) { - if (strlen($binpacket->$name) > 0) { - $decoded_value = base64_decode($binpacket->$name); - $packlet_value .= $decoded_value; - } - } - - // can't find a better way yet to get rid of the garbage on the end of the string ... - $len = strlen($packlet_value); - $cleaned_value = ""; - for ($i = 0; $i < $len; $i++) { - if (ord($packlet_value{$i}) <= 0) break; - $cleaned_value .= $packlet_value{$i}; - } - - $this->packlets[$name] = $cleaned_value; - $this->packlets["buflen"] = $i; - } catch (Exception $ex) { - $this->packlets[$name] = ""; - } - } -} 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 deleted file mode 100644 index 2eb5dbd6ff95c461a29f3f12a007030b7818599b..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ExecMyRuleInp.class.php +++ /dev/null @@ -1,20 +0,0 @@ - $myRule, "RHostAddr_PI" => $RHostAddr_PI, - "KeyValPair_PI" => $KeyValPair_PI, "outParamDesc" => $outParamDesc, - "MsParamArray_PI" => $MsParamArray_PI); - parent::__construct("ExecMyRuleInp_PI", $packlets); - } - -} 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 deleted file mode 100644 index cf4bf3406067408a6ef6738589ea6e17e781b76c..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_GenQueryInp.class.php +++ /dev/null @@ -1,23 +0,0 @@ - $maxRows, 'continueInx' => $continueInx, - 'partialStartIndex' => $partialStartIndex, 'options' => $options, - 'KeyValPair_PI' => $KeyValPair_PI, 'InxIvalPair_PI' => $InxIvalPair_PI, - 'InxValPair_PI' => $InxValPair_PI); - parent::__construct("GenQueryInp_PI", $packlets); - } - -} 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 deleted file mode 100644 index afec88c45b16ab4440782601a2f292508164cb73..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_GenQueryOut.class.php +++ /dev/null @@ -1,20 +0,0 @@ -array_rp_type = array("SqlResult_PI" => "RP_SqlResult"); - - $packlets = array("rowCnt" => $rowCnt, 'attriCnt' => $attriCnt, - 'continueInx' => $continueInx, 'totalRowCount' => $totalRowCount, - 'SqlResult_PI' => $SqlResult_PI); - parent::__construct("GenQueryOut_PI", $packlets); - } - -} 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 deleted file mode 100644 index e8af5c9fc5c8f2e4350e390621e1f5087730acfd..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_InxIvalPair.class.php +++ /dev/null @@ -1,25 +0,0 @@ - $iiLen, 'inx' => $inx, 'ivalue' => $ivalue); - parent::__construct("InxIvalPair_PI", $packlets); - } - - public function fromAssocArray($array) - { - if (!empty($array)) { - $this->packlets["iiLen"] = count($array); - $this->packlets["inx"] = array_keys($array); - $this->packlets["ivalue"] = array_values($array); - } else { - $this->packlets["iiLen"] = 0; - $this->packlets["inx"] = array(); - $this->packlets["ivalue"] = array(); - } - } - -} 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 deleted file mode 100644 index 4a08780f4a3415afca1b3909194f6be10ea86b26..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_InxValPair.class.php +++ /dev/null @@ -1,42 +0,0 @@ - $isLen, 'inx' => $inx, 'svalue' => $svalue); - parent::__construct("InxValPair_PI", $packlets); - } - - public function fromAssocArray($array) - { - if (!empty($array)) { - $this->packlets["isLen"] = count($array); - $this->packlets["inx"] = array_keys($array); - $this->packlets["svalue"] = array_values($array); - } else { - $this->packlets["isLen"] = 0; - $this->packlets["inx"] = array(); - $this->packlets["svalue"] = array(); - } - } - - public function fromRODSQueryConditionArray($array) - { - $this->packlets["isLen"] = 0; - $this->packlets["inx"] = array(); - $this->packlets["svalue"] = array(); - - if (!isset($array)) return; - - $this->packlets["isLen"] = count($array); - foreach ($array as $cond) { - $this->packlets["inx"][] = $cond->name; - $this->packlets["svalue"][] = "$cond->op '$cond->value'"; - //echo "
 $cond->op '$cond->value' 
"; - } - } -} 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 deleted file mode 100644 index 905d88bc8a2191000c4b7adebe782c49c19ab1ac..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_KeyValPair.class.php +++ /dev/null @@ -1,45 +0,0 @@ - $ssLen, 'keyWord' => $keyWord, - 'svalue' => $svalue); - parent::__construct("KeyValPair_PI", $packlets); - } - - public function fromAssocArray(array $array) - { - if (!empty($array)) { - $this->packlets["ssLen"] = count($array); - $this->packlets["keyWord"] = array_keys($array); - $this->packlets["svalue"] = array_values($array); - } else { - $this->packlets["ssLen"] = 0; - $this->packlets["keyWord"] = array(); - $this->packlets["svalue"] = array(); - } - } - - public function fromRODSQueryConditionArray($array) - { - $this->packlets["ssLen"] = 0; - $this->packlets["keyWord"] = array(); - $this->packlets["svalue"] = array(); - - if (!isset($array)) return; - - $this->packlets["ssLen"] = count($array); - foreach ($array as $cond) { - $this->packlets["keyWord"][] = $cond->name; - $this->packlets["svalue"][] = "$cond->op '$cond->value'"; - } - } -} 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 deleted file mode 100644 index 4f54c9c4e76ded758adbc8ce73284dd81234eb27..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MiscSvrInfo.class.php +++ /dev/null @@ -1,15 +0,0 @@ - $serverType, 'relVersion' => $relVersion, - 'apiVersion' => $apiVersion, 'rodsZone' => $rodsZone); - parent::__construct("MiscSvrInfo_PI", $packlets); - } - -} 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 deleted file mode 100644 index 467541734dfd2ff1deaf41421223f3df2d80895e..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ModAVUMetadataInp.class.php +++ /dev/null @@ -1,16 +0,0 @@ - $arg0, "arg1" => $arg1, "arg2" => $arg2, - "arg3" => $arg3, "arg4" => $arg4, "arg5" => $arg5, - "arg6" => $arg6, "arg7" => $arg7, "arg8" => $arg8, "arg9" => $arg9); - parent::__construct("ModAVUMetadataInp_PI", $packlets); - } - -} 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 deleted file mode 100644 index fa5d4fcc3dc690d36cf405f7ebd58445b1cb00c0..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MsParam.class.php +++ /dev/null @@ -1,43 +0,0 @@ - $label, "type" => $inOutStruct->type, - $inOutStruct->type => $inOutStruct, "BinBytesBuf_PI" => $BinBytesBuf_PI); - parent::__construct("MsParam_PI", $packlets); - } - - // need to overwrite it's parent function here, since $inOutStruct->type - // can be undefined, when it's parent packet class was defined. - public function fromSXE(SimpleXMLElement $sxe) - { - if (!isset($this->packlets)) - return; - - $this->packlets["label"] = (string)$sxe->label; - $this->packlets["type"] = (string)$sxe->type; - - $typename = $this->packlets["type"]; //type of the expected packet - if (substr($typename, -3, 3) != "_PI") { - throw new RODSException("RP_MsParam::fromSXE " . - "The XML node's type is unexpected: '$typename' " . - " expecting some thing like xxx_PI", - "SYS_PACK_INSTRUCT_FORMAT_ERR"); - } - $rp_classname = "RP_" . substr($typename, 0, strlen($typename) - 3); - $inOutStruct = new $rp_classname(); - $inOutStruct->fromSXE($sxe->$typename); - $this->packlets["$typename"] = $inOutStruct; - - $this->packlets['BinBytesBuf_PI'] = new RP_BinBytesBuf(); - $this->packlets['BinBytesBuf_PI']->fromSXE($sxe->BinBytesBuf_PI); - } - -} 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 deleted file mode 100644 index b664abe62bc69da99855c2fbd1b946f8e4ed2a86..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MsParamArray.class.php +++ /dev/null @@ -1,19 +0,0 @@ -array_rp_type = array("MsParam_PI" => "RP_MsParam"); - - $packlets = array("paramLen" => count($MsParam_PI), - "oprType" => $oprType, "MsParam_PI" => $MsParam_PI); - parent::__construct("MsParamArray_PI", $packlets); - } - -} 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 deleted file mode 100644 index f1b03f779d13b0703f8a60e73011ece66747d161..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MsgHeader.class.php +++ /dev/null @@ -1,14 +0,0 @@ - $type, "msgLen" => $msgLen, - "errorLen" => $errorLen, "bsLen" => $bsLen, "intInfo" => $intInfo); - parent::__construct("MsgHeader_PI", $packlets); - } - -} 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 deleted file mode 100644 index 2ac70dc22cceb6ec611f31047791d7decf2bc31b..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_RHostAddr.class.php +++ /dev/null @@ -1,13 +0,0 @@ - $hostAddr, "rodsZone" => $rodsZone, - "port" => $port); - parent::__construct("RHostAddr_PI", $packlets); - } - -} 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 deleted file mode 100644 index 96f427a2de5a2dc2d59be26cfc4eb256ee0fe4bc..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_RodsObjStat.class.php +++ /dev/null @@ -1,18 +0,0 @@ - $objSize, 'objType' => $objType, - 'numCopies' => $numCopies, 'dataId' => $dataId, "chksum" => $chksum, - "ownerName" => $ownerName, "ownerZone" => $ownerZone, - 'createTime' => $createTime, 'modifyTime' => $modifyTime); - parent::__construct("RodsObjStat_PI", $packlets); - } - -} 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 deleted file mode 100644 index af7739988d4f22164452bd2b7bae6fff9cf510b5..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_STR.class.php +++ /dev/null @@ -1,12 +0,0 @@ - $myStr); - parent::__construct("STR_PI", $packlets); - } - -} 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 deleted file mode 100644 index e6ee1c3adbb6eb0fc81f3ad506e96dac41e6aab1..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_SqlResult.class.php +++ /dev/null @@ -1,13 +0,0 @@ - $attriInx, 'reslen' => $reslen, 'value' => $value); - parent::__construct("SqlResult_PI", $packlets); - } - - -} 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 deleted file mode 100644 index 700fbd34428c03f26c9066a4d065907c121ee16d..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_StartupPack.class.php +++ /dev/null @@ -1,16 +0,0 @@ - 1, "connectCnt" => 0, - "proxyUser" => $user, "proxyRcatZone" => $zone, "clientUser" => $user, - "clientRcatZone" => $zone, "relVersion" => $relVersion, - "apiVersion" => $apiVersion, "option" => $option); - parent::__construct("StartupPack_PI", $packlets); - } - -} 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 deleted file mode 100644 index 5c962649df0f627efc1949b15fa9be7f709e70bd..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_TransStat.class.php +++ /dev/null @@ -1,14 +0,0 @@ - $numThreads, - 'bytesWritten' => $bytesWritten); - parent::__construct("TransStat_PI", $packlets); - } - -} 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 deleted file mode 100644 index 9fa9b7d1c3517b7b5d75f99e7c21867a0b2321d0..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_Version.class.php +++ /dev/null @@ -1,14 +0,0 @@ - $status, "relVersion" => $relVersion, - "apiVersion" => $apiVersion); - parent::__construct("Version_PI", $packlets); - } - -} 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 deleted file mode 100644 index a702650c0eb4259a7d6a221c63e1483db7c05274..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_authRequestOut.class.php +++ /dev/null @@ -1,12 +0,0 @@ - $challenge); - parent::__construct("authRequestOut_PI", $packlets); - } - -} 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 deleted file mode 100644 index 3f9cbc618f7e5087ffdfa2a9fa7a1df97923a2bc..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_authResponseInp.class.php +++ /dev/null @@ -1,12 +0,0 @@ - $response, "username" => $username); - parent::__construct("authResponseInp_PI", $packlets); - } - -} 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 deleted file mode 100644 index d37afe23c9539065240b09b0fb9c466eb1d4e9ad..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_dataObjCloseInp.class.php +++ /dev/null @@ -1,14 +0,0 @@ - $l1descInx, - 'bytesWritten' => $bytesWritten); - parent::__construct("dataObjCloseInp_PI", $packlets); - } - -} 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 deleted file mode 100644 index 31b12354714e90907ae2f61a424584c635f7afb8..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_dataObjReadInp.class.php +++ /dev/null @@ -1,14 +0,0 @@ - $l1descInx, - 'len' => $len); - parent::__construct("dataObjReadInp_PI", $packlets); - } - -} 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 deleted file mode 100644 index 175b7e834029c6d9260fe14e946d80f8479eb528..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_dataObjWriteInp.class.php +++ /dev/null @@ -1,14 +0,0 @@ - $dataObjInx, - 'len' => $len); - parent::__construct("dataObjWriteInp_PI", $packlets); - } - -} 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 deleted file mode 100644 index 83b77f4704fce5d802c57e0ab7e8ad8abc987436..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_fileLseekInp.class.php +++ /dev/null @@ -1,14 +0,0 @@ - $fileInx, "offset" => $offset, - 'whence' => $whence); - parent::__construct("fileLseekInp_PI", $packlets); - } - -} 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 deleted file mode 100644 index 45811e7ca68e8c2ef1e39ddfd25682ef5ed419b2..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_fileLseekOut.class.php +++ /dev/null @@ -1,13 +0,0 @@ - $offset); - parent::__construct("fileLseekOut_PI", $packlets); - } - -} 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 deleted file mode 100644 index 29c1001df68c27dbd47ec7117602f63a8be1cc69..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_getTempPasswordOut.class.php +++ /dev/null @@ -1,12 +0,0 @@ - $stringToHashWith); - parent::__construct("getTempPasswordOut_PI", $packlets); - } - -} 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 deleted file mode 100644 index e42ac918d459d44b1b529cc33cb019c2c8696125..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_pamAuthRequestInp.class.php +++ /dev/null @@ -1,12 +0,0 @@ - $pamUser, "pamPassword" => $pamPassword, "timeToLive" => $timeToLive); - parent::__construct("pamAuthRequestInp_PI",$packlets); - } - -} 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 deleted file mode 100644 index b3ec13065569a48d9cfaacf29a08952257fb70ee..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_pamAuthRequestOut.class.php +++ /dev/null @@ -1,12 +0,0 @@ - $irodsPamPassword); - parent::__construct("pamAuthRequestOut_PI",$packlets); - } - -} 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 deleted file mode 100644 index 26470378a7df6052921bcde2e5e7c279c2594ad7..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_sslEndInp.class.php +++ /dev/null @@ -1,12 +0,0 @@ - $arg0); - parent::__construct("sslEndInp_PI",$packlets); - } - -} 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 deleted file mode 100644 index a23756e78601cdee8eba1b51aaede158b5443f1b..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_sslStartInp.class.php +++ /dev/null @@ -1,12 +0,0 @@ - $arg0); - parent::__construct("sslStartInp_PI",$packlets); - } - -} diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ticketAdminInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ticketAdminInp.class.php deleted file mode 100644 index ec849b68dbebc8b16daa753966b24acc862edbe9..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ticketAdminInp.class.php +++ /dev/null @@ -1,30 +0,0 @@ - to use it, create -> to... create!, - $arg2 = '', // the actual ticket - $arg3 = '', // "read" or "write" -> in case of "create" above - $arg4 = '', // full path to the resource, e.g.: /tempZone/home/rods/as - $arg5 = '', - $arg6 = '') - { - - $packlets = array( 'arg1' => $arg1, - 'arg2' => $arg2, - 'arg3' => $arg3, - 'arg4' => $arg4, - 'arg5' => $arg5, - 'arg6' => $arg6, - ); - parent::__construct('ticketAdminInp_PI', $packlets); - } - -} \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/prods.ini b/apps/files_external/3rdparty/irodsphp/prods/src/prods.ini deleted file mode 100644 index 5c81a71de73d45c7a08b3e37231513f56c5f181c..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/prods.ini +++ /dev/null @@ -1,15 +0,0 @@ -; Configuration file for the Prods API - -[ssl] -; Require verification of SSL certificate used. Default "false". -;verify_peer = "true" -; Allow self-signed certificates. Requires verify_peer. Default "false". -;allow_self_signed = "true" -; Location of Certificate Authority file on local filesystem which -; should be used with verify_peer equal "true" to authenticate -; the identity of the remote peer. -;cafile = "/path/to/cert.pem" -; If cafile is not specified or if the certificate is not found there, -; the directory pointed to by capath is searched for a suitable -; certificate. capath must be a correctly hashed certificate directory. -;capath = "/path/to/certfiles" diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/release_notes.txt b/apps/files_external/3rdparty/irodsphp/prods/src/release_notes.txt deleted file mode 100644 index 7d892eedb6ea4df9096c84c79dda9b6deb39f38a..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/release_notes.txt +++ /dev/null @@ -1,31 +0,0 @@ - -*'''Project''': iRODS PHP Library PRODS and PRODS Web Browser -*'''Date''': 11/26/2012 -*'''Release Version''': 3.2.0 Release -*'''git tag''': 3.2.0 - -==News== - -This is the consolidated and updated release of the PRODS PHP library for iRODS. This library provides a pure-PHP interface to the iRODS system. This library is suitable for simple and quick interfaces to the iRODS data grid, and will be maintained for stability and compatibility. If advanced or higher-performance interfaces are desired, the Jargon Java API should be considered. Note that PHP, Jython, JRuby, Groovy, and other JVM dynamic languages can be used with Jarogn. - -The PRODS PHP Web Browser is also included in this project, and remains supported. Note that the PHP Web Browser functionality has been subsumed by the idrop-web browser and idrop-swing client. - -Please go to [[https://code.renci.org/gf/project/irodsphp/] for the latest news and info. - -Note that the git repository is now the canonical version of the PHP code. The code in the iRODS SVN server is deprecated and will be taken down at the 3.0.0 release point. There may be other versions in Google Code and other places, but these should be considered obsolete. - - -==Requirements== - -==Libraries== - -==Features== - -*[#1076] irods 3.2 release activities -**Added a LICENSE.txt file at the top project level - - -==Bug Fixes== - -*[#1071] php uses self-closing tags for empty HTML tags -**Added patch suggested by community Changing line 41 in RODSPacket.class.php (in PRods) from return ($doc->saveXML($root)); to return ($doc->saveXML($root, LIBXML_NOEMPTYTAG)); \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/setRodsAPINum.php b/apps/files_external/3rdparty/irodsphp/prods/src/setRodsAPINum.php deleted file mode 100644 index 98c1f6cabdfcb18f41a10684dad686d9b11dca7a..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/setRodsAPINum.php +++ /dev/null @@ -1,68 +0,0 @@ - 1) { - if (empty($val1)) $val1 = trim($token); - else $val2 = trim($token); - } - } - if ((!empty($val1)) && (!empty($val2))) { - array_push($value_pairs, array($val1, $val2)); - } - } -} -var_dump($value_pairs); -foreach ($new_api_nums as $new_code_pair) { - if ((!is_array($new_code_pair)) || (count($new_code_pair) != 2)) - die("unexpected new_code_pair:$new_code_pair\n"); - array_push($value_pairs, $new_code_pair); -} - -$outputstr = " '$val2',\n"; -} -$outputstr = $outputstr . ");\n"; - -$outputstr = $outputstr . '$GLOBALS[\'PRODS_API_NUMS_REV\']=array(' . "\n"; -foreach ($value_pairs as $value_pair) { - $val1 = $value_pair[0]; - $val2 = $value_pair[1]; - $outputstr = $outputstr . " '$val2' => '$val1',\n"; -} -$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 deleted file mode 100644 index 142b4af57020e47f50661ef4890523ed880a4f2f..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/setRodsErrorCodes.php +++ /dev/null @@ -1,73 +0,0 @@ - 3) { - if (empty($val1)) $val1 = trim($token); - else $val2 = trim($token); - } - } - if ((!empty($val1)) && (!empty($val2))) { - array_push($value_pairs, array($val1, $val2)); - } - } -} - -foreach ($new_error_codes as $new_code_pair) { - if ((!is_array($new_code_pair)) || (count($new_code_pair) != 2)) - die("unexpected new_code_pair:$new_code_pair\n"); - array_push($value_pairs, $new_code_pair); -} - -$outputstr = " '$val2',\n"; -} -$outputstr = $outputstr . ");\n"; - -$outputstr = $outputstr . '$GLOBALS[\'PRODS_ERR_CODES_REV\']=array(' . "\n"; -foreach ($value_pairs as $value_pair) { - $val1 = $value_pair[0]; - $val2 = $value_pair[1]; - $outputstr = $outputstr . " '$val2' => '$val1',\n"; -} -$outputstr = $outputstr . ");\n"; - -$outputstr = $outputstr . "?>\n"; -file_put_contents($prods_error_table_file, $outputstr); diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/setRodsGenQueryKeyWd.php b/apps/files_external/3rdparty/irodsphp/prods/src/setRodsGenQueryKeyWd.php deleted file mode 100644 index 5a5968d25af99bd62a510b71876c575badd46dfa..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/setRodsGenQueryKeyWd.php +++ /dev/null @@ -1,71 +0,0 @@ - 1) { - if (empty($val1)) $val1 = trim($token); - else { - - if (($token{0} == '"') /*&&($token{strlen($token)-1}=='"')*/) { - if (empty($val2)) - $val2 = trim($token); - } - } - } - } - if ((!empty($val1)) && (!empty($val2))) { - array_push($value_pairs, array($val1, $val2)); - } - } -} -foreach ($new_genque_keywds as $new_code_pair) { - if ((!is_array($new_code_pair)) || (count($new_code_pair) != 2)) - die("unexpected new_code_pair:$new_code_pair\n"); - array_push($value_pairs, $new_code_pair); -} - -$outputstr = " $val2,\n"; -} -$outputstr = $outputstr . ");\n"; - -$outputstr = $outputstr . '$GLOBALS[\'PRODS_GENQUE_KEYWD_REV\']=array(' . "\n"; -foreach ($value_pairs as $value_pair) { - $val1 = $value_pair[0]; - $val2 = $value_pair[1]; - $outputstr = $outputstr . " $val2 => '$val1',\n"; -} -$outputstr = $outputstr . ");\n"; - -$outputstr = $outputstr . "?>\n"; -file_put_contents($prods_genque_keywd_file, $outputstr); diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/setRodsGenQueryNum.php b/apps/files_external/3rdparty/irodsphp/prods/src/setRodsGenQueryNum.php deleted file mode 100644 index 0be297826e642dfa234e0c654e20fd57696963f5..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/src/setRodsGenQueryNum.php +++ /dev/null @@ -1,61 +0,0 @@ - '$val2',\n"; -} -$outputstr = $outputstr . ");\n"; - -$outputstr = $outputstr . '$GLOBALS[\'PRODS_GENQUE_NUMS_REV\']=array(' . "\n"; -foreach ($value_pairs as $value_pair) { - $val1 = $value_pair[0]; - $val2 = $value_pair[1]; - $outputstr = $outputstr . " '$val2' => '$val1',\n"; -} -$outputstr = $outputstr . ");\n"; - -$outputstr = $outputstr . "?>\n"; -file_put_contents($prods_genque_num_file, $outputstr); diff --git a/apps/files_external/3rdparty/irodsphp/prods/utilities/exif2meta.php b/apps/files_external/3rdparty/irodsphp/prods/utilities/exif2meta.php deleted file mode 100644 index 9ee9495f1023bab5e77d75c0f4445b7d25bc40b8..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/prods/utilities/exif2meta.php +++ /dev/null @@ -1,145 +0,0 @@ -getMeta(); - $metaalreadyset = false; - foreach ($metas as $meta) { - if ($meta->name == 'EXIF.ExifVersion') { - $metaalreadyset = true; - break; - } - } - - if ($metaalreadyset === true) { - $time = '[' . date('c') . ']'; - echo "$time 0: metadata already set for '$target_file'\n"; - exit(0); - } - - // download file from irods to tmp - $localfile = '/tmp/' . basename($target_file); - if (file_exists($localfile)) - unlink($localfile); - $irodsfile->open("r"); - $str = ''; - while ((($buffer = $irodsfile->read(1024 * 1024)) != NULL) && - (connection_status() == 0)) { - $str = $str . $buffer; - } - $irodsfile->close(); - file_put_contents($localfile, $str); - - extactExif($localfile, $irodsfile); - - if (file_exists($localfile)) - unlink($localfile); - - $time = '[' . date('c') . ']'; - echo "$time 0: '$target_file' processed!\n"; - exit(0); - -} catch (Exception $e) { - - if (file_exists($localfile)) - unlink($localfile); - - $time = '[' . date('c') . ']'; - echo "$time " . $e->getCode() . ": " . "$e"; - exit(-1); -} - - -function extactExif($localfile, $remoteRODSfile) -{ - $exif = exif_read_data($localfile, 'EXIF'); - if ($exif === false) return; - - foreach ($exif as $name => $val) { - - // replace ascii char that can't be displayed, which causes problem in irods - if ((!is_array($val)) && (is_string($val)) && - ((ord($val[0]) < 32) || (ord($val[0]) > 126)) && - ($name != 'UserComment') - ) { - $val = '__undefined__'; - } - - if ($name == 'THUMBNAIL') { - foreach ($val as $tname => $tval) - $remoteRODSfile->addMeta(new RODSMeta( - 'EXIF.THUMBNAIL.' . $tname, $tval, '')); - } else - if ($name == 'COMPUTED') { - foreach ($val as $cname => $cval) { - if ($cname == 'html') { - //skip html tag, because there is a irods server bug that corrupting string with - //double quotes: 'COMPUTED.html: width="3264" height="2448"' - } else - $remoteRODSfile->addMeta(new RODSMeta( - 'EXIF.COMPUTED.' . $cname, $cval, '')); - } - } else - if ($name == 'MakerNote') { - //skip makernote - } else - if ($name == 'ComponentsConfiguration') { - //skip ComponentsConfiguration, because there is a irods server bug that corrupting string with - - } else - if ($name == 'UserComment') { - if (($start = strpos($val, 'GCM_TAG')) !== false) { - $str = substr($val, $start + strlen('GCM_TAG')); - $gcm_tokens = explode(chr(0), $str); - $gcm_counter = 0; - foreach ($gcm_tokens as $gcm_tag) { - if ((strlen($gcm_tag) > 0) && (preg_match('/^[' . chr(32) . '-' . chr(126) . ']+$/', $gcm_tag))) { - $remoteRODSfile->addMeta(new RODSMeta( - 'EXIF.UserComment' . $gcm_counter++, $gcm_tag, '')); - } - } - } else { - if (strlen($val) < 1) - $str = ' '; - //replace no displable char - $str = preg_replace('/[^' . chr(32) . '-' . chr(126) . ']+/', ' ', $val); - $remoteRODSfile->addMeta(new RODSMeta( - 'EXIF.UserComment', $str, '')); - } - } else - if (is_array($val)) { - foreach ($val as $cname => $cval) { - $remoteRODSfile->addMeta(new RODSMeta( - "EXIF.$name." . $cname, $cval, '')); - } - } else - $remoteRODSfile->addMeta(new RODSMeta( - 'EXIF.' . $name, $val, '')); - } -} - -?> diff --git a/apps/files_external/3rdparty/irodsphp/release_notes.txt b/apps/files_external/3rdparty/irodsphp/release_notes.txt deleted file mode 100644 index 9d109faf8438516cd5deae30ae24fcda750ca778..0000000000000000000000000000000000000000 --- a/apps/files_external/3rdparty/irodsphp/release_notes.txt +++ /dev/null @@ -1,14 +0,0 @@ -*'''Project''': iRODS PHP Library PRODS and PRODS Web Browser -*'''Date''': 06/04/2013 -*'''Release Version''': 3.3.0-beta1 -*'''git tag''': 3.3.0-beta1 - -==News== - -The PRODS PHP Web Browser is also included in this project, and remains supported. Note that the PHP Web Browser functionality has been subsumed by the idrop-web browser and idrop-swing client. - -Please go to [[https://code.renci.org/gf/project/irodsphp/] for the latest news and info. - -Note that the git repository is now the canonical version of the PHP code. The code in the iRODS SVN server is deprecated and will be taken down at the 3.0.0 release point. There may be other versions in Google Code and other places, but these should be considered obsolete. - -Please review release notes in sub projects for details diff --git a/apps/files_external/appinfo/app.php b/apps/files_external/appinfo/app.php index 0017b22caaddfe55e4830c2e7d0670f370004d37..e8ed8950c3a987930a55bb7c5713a3caf7621985 100644 --- a/apps/files_external/appinfo/app.php +++ b/apps/files_external/appinfo/app.php @@ -6,6 +6,7 @@ * later. * See the COPYING-README file. */ +$l = \OC_L10N::get('files_external'); OC::$CLASSPATH['OC\Files\Storage\StreamWrapper'] = 'files_external/lib/streamwrapper.php'; OC::$CLASSPATH['OC\Files\Storage\FTP'] = 'files_external/lib/ftp.php'; @@ -18,7 +19,6 @@ OC::$CLASSPATH['OC\Files\Storage\SMB_OC'] = 'files_external/lib/smb_oc.php'; OC::$CLASSPATH['OC\Files\Storage\AmazonS3'] = 'files_external/lib/amazons3.php'; OC::$CLASSPATH['OC\Files\Storage\Dropbox'] = 'files_external/lib/dropbox.php'; OC::$CLASSPATH['OC\Files\Storage\SFTP'] = 'files_external/lib/sftp.php'; -OC::$CLASSPATH['OC\Files\Storage\iRODS'] = 'files_external/lib/irods.php'; OC::$CLASSPATH['OC_Mount_Config'] = 'files_external/lib/config.php'; OCP\App::registerAdmin('files_external', 'settings'); @@ -28,41 +28,40 @@ if (OCP\Config::getAppValue('files_external', 'allow_user_mounting', 'yes') == ' // connecting hooks OCP\Util::connectHook('OC_Filesystem', 'post_initMountPoints', '\OC_Mount_Config', 'initMountPointsHook'); -OCP\Util::connectHook('OC_User', 'post_login', 'OC\Files\Storage\iRODS', 'login'); OCP\Util::connectHook('OC_User', 'post_login', 'OC\Files\Storage\SMB_OC', 'login'); OC_Mount_Config::registerBackend('\OC\Files\Storage\Local', array( - 'backend' => 'Local', + 'backend' => (string)$l->t('Local'), 'configuration' => array( - 'datadir' => 'Location'))); + 'datadir' => (string)$l->t('Location')))); OC_Mount_Config::registerBackend('\OC\Files\Storage\AmazonS3', array( - 'backend' => 'Amazon S3', + 'backend' => (string)$l->t('Amazon S3'), 'configuration' => array( - 'key' => 'Key', - 'secret' => '*Secret', - 'bucket' => 'Bucket'), + 'key' => (string)$l->t('Key'), + 'secret' => '*'.$l->t('Secret'), + 'bucket' => (string)$l->t('Bucket')), 'has_dependencies' => true)); OC_Mount_Config::registerBackend('\OC\Files\Storage\AmazonS3', array( - 'backend' => 'Amazon S3 and compliant', + 'backend' => (string)$l->t('Amazon S3 and compliant'), 'configuration' => array( - 'key' => 'Access Key', - 'secret' => '*Secret Key', - 'bucket' => 'Bucket', - 'hostname' => '&Hostname (optional)', - 'port' => '&Port (optional)', - 'region' => '&Region (optional)', - 'use_ssl' => '!Enable SSL', - 'use_path_style' => '!Enable Path Style'), + 'key' => (string)$l->t('Access Key'), + 'secret' => '*'.$l->t('Secret Key'), + 'bucket' => (string)$l->t('Bucket'), + 'hostname' => '&'.$l->t('Hostname (optional)'), + 'port' => '&'.$l->t('Port (optional)'), + 'region' => '&'.$l->t('Region (optional)'), + 'use_ssl' => '!'.$l->t('Enable SSL'), + 'use_path_style' => '!'.$l->t('Enable Path Style')), 'has_dependencies' => true)); OC_Mount_Config::registerBackend('\OC\Files\Storage\Dropbox', array( 'backend' => 'Dropbox', 'configuration' => array( 'configured' => '#configured', - 'app_key' => 'App key', - 'app_secret' => '*App secret', + 'app_key' => (string)$l->t('App key'), + 'app_secret' => '*'.$l->t('App secret'), 'token' => '#token', 'token_secret' => '#token_secret'), 'custom' => 'dropbox', @@ -71,36 +70,36 @@ OC_Mount_Config::registerBackend('\OC\Files\Storage\Dropbox', array( OC_Mount_Config::registerBackend('\OC\Files\Storage\FTP', array( 'backend' => 'FTP', 'configuration' => array( - 'host' => 'URL', - 'user' => 'Username', - 'password' => '*Password', - 'root' => '&Root', - 'secure' => '!Secure ftps://'), + 'host' => (string)$l->t('Host'), + 'user' => (string)$l->t('Username'), + 'password' => '*'.$l->t('Password'), + 'root' => '&'.$l->t('Root'), + 'secure' => '!'.$l->t('Secure ftps://')), 'has_dependencies' => true)); OC_Mount_Config::registerBackend('\OC\Files\Storage\Google', array( 'backend' => 'Google Drive', 'configuration' => array( 'configured' => '#configured', - 'client_id' => 'Client ID', - 'client_secret' => '*Client secret', + 'client_id' => (string)$l->t('Client ID'), + 'client_secret' => '*'.$l->t('Client secret'), 'token' => '#token'), 'custom' => 'google', 'has_dependencies' => true)); OC_Mount_Config::registerBackend('\OC\Files\Storage\Swift', array( - 'backend' => 'OpenStack Object Storage', + 'backend' => (string)$l->t('OpenStack Object Storage'), 'configuration' => array( - 'user' => 'Username (required)', - 'bucket' => 'Bucket (required)', - 'region' => '&Region (optional for OpenStack Object Storage)', - 'key' => '*API Key (required for Rackspace Cloud Files)', - 'tenant' => '&Tenantname (required for OpenStack Object Storage)', - 'password' => '*Password (required for OpenStack Object Storage)', - 'service_name' => '&Service Name (required for OpenStack Object Storage)', - 'url' => '&URL of identity endpoint (required for OpenStack Object Storage)', - 'timeout' => '&Timeout of HTTP requests in seconds (optional)', + 'user' => (string)$l->t('Username (required)'), + 'bucket' => (string)$l->t('Bucket (required)'), + 'region' => '&'.$l->t('Region (optional for OpenStack Object Storage)'), + 'key' => '*'.$l->t('API Key (required for Rackspace Cloud Files)'), + 'tenant' => '&'.$l->t('Tenantname (required for OpenStack Object Storage)'), + 'password' => '*'.$l->t('Password (required for OpenStack Object Storage)'), + 'service_name' => '&'.$l->t('Service Name (required for OpenStack Object Storage)'), + 'url' => '&'.$l->t('URL of identity endpoint (required for OpenStack Object Storage)'), + 'timeout' => '&'.$l->t('Timeout of HTTP requests in seconds (optional)'), ), 'has_dependencies' => true)); @@ -109,58 +108,47 @@ if (!OC_Util::runningOnWindows()) { OC_Mount_Config::registerBackend('\OC\Files\Storage\SMB', array( 'backend' => 'SMB / CIFS', 'configuration' => array( - 'host' => 'URL', - 'user' => 'Username', - 'password' => '*Password', - 'share' => 'Share', - 'root' => '&Root'), + 'host' => (string)$l->t('Host'), + 'user' => (string)$l->t('Username'), + 'password' => '*'.$l->t('Password'), + 'share' => (string)$l->t('Share'), + 'root' => '&'.$l->t('Root')), 'has_dependencies' => true)); OC_Mount_Config::registerBackend('\OC\Files\Storage\SMB_OC', array( - 'backend' => 'SMB / CIFS using OC login', + 'backend' => (string)$l->t('SMB / CIFS using OC login'), 'configuration' => array( - 'host' => 'URL', - 'username_as_share' => '!Username as share', - 'share' => '&Share', - 'root' => '&Root'), + 'host' => (string)$l->t('Host'), + 'username_as_share' => '!'.$l->t('Username as share'), + 'share' => '&'.$l->t('Share'), + 'root' => '&'.$l->t('Root')), 'has_dependencies' => true)); } OC_Mount_Config::registerBackend('\OC\Files\Storage\DAV', array( 'backend' => 'WebDAV', 'configuration' => array( - 'host' => 'URL', - 'user' => 'Username', - 'password' => '*Password', - 'root' => '&Root', - 'secure' => '!Secure https://'), + 'host' => (string)$l->t('URL'), + 'user' => (string)$l->t('Username'), + 'password' => '*'.$l->t('Password'), + 'root' => '&'.$l->t('Root'), + 'secure' => '!'.$l->t('Secure https://')), 'has_dependencies' => true)); OC_Mount_Config::registerBackend('\OC\Files\Storage\OwnCloud', array( 'backend' => 'ownCloud', 'configuration' => array( - 'host' => 'URL', - 'user' => 'Username', - 'password' => '*Password', - 'root' => '&Remote subfolder', - 'secure' => '!Secure https://'))); + 'host' => (string)$l->t('URL'), + 'user' => (string)$l->t('Username'), + 'password' => '*'.$l->t('Password'), + 'root' => '&'.$l->t('Remote subfolder'), + 'secure' => '!'.$l->t('Secure https://')))); OC_Mount_Config::registerBackend('\OC\Files\Storage\SFTP', array( 'backend' => 'SFTP', 'configuration' => array( - 'host' => 'URL', - 'user' => 'Username', - 'password' => '*Password', - 'root' => '&Root'))); - -OC_Mount_Config::registerBackend('\OC\Files\Storage\iRODS', array( - 'backend' => 'iRODS', - 'configuration' => array( - 'host' => 'Host', - 'port' => 'Port', - 'use_logon_credentials' => '!Use ownCloud login', - 'user' => 'Username', - 'password' => '*Password', - 'auth_mode' => 'Authentication Mode', - 'zone' => 'Zone'))); + 'host' => (string)$l->t('Host'), + 'user' => (string)$l->t('Username'), + 'password' => '*'.$l->t('Password'), + 'root' => '&'.$l->t('Root')))); diff --git a/apps/files_external/l10n/af_ZA.php b/apps/files_external/l10n/af_ZA.php index 261c44310fddc54f7343ae77dcf3614c25f299bb..f0c9c5211b19572b07a86a83b4af0663305adeca 100644 --- a/apps/files_external/l10n/af_ZA.php +++ b/apps/files_external/l10n/af_ZA.php @@ -1,5 +1,8 @@ "Gebruikersnaam", +"Password" => "Wagwoord", +"Share" => "Deel", "Users" => "Gebruikers" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_external/l10n/ar.php b/apps/files_external/l10n/ar.php index 5fd4e4c398cc4a788f369d754759cd499da5c43b..eb1150eb95ecfdc319362d21e1ba928a8aba9656 100644 --- a/apps/files_external/l10n/ar.php +++ b/apps/files_external/l10n/ar.php @@ -1,5 +1,11 @@ "المكان", +"Host" => "المضيف", +"Username" => "إسم المستخدم", +"Password" => "كلمة السر", +"Share" => "شارك", +"URL" => "عنوان الموقع", "Saved" => "حفظ", "Folder name" => "اسم المجلد", "Options" => "خيارات", diff --git a/apps/files_external/l10n/ast.php b/apps/files_external/l10n/ast.php index e2c02408f39849331324d641378c02d6d3e37ab6..faf0388dd91799c8ef82cab61f15be78c2c19410 100644 --- a/apps/files_external/l10n/ast.php +++ b/apps/files_external/l10n/ast.php @@ -1,10 +1,70 @@ "Llocal", +"Location" => "Llocalización", +"Amazon S3" => "Amazon S3", +"Key" => "Clave", +"Secret" => "Secretu", +"Bucket" => "Depósitu", +"Amazon S3 and compliant" => "Amazon S3 y compatibilidá", +"Access Key" => "Clave d'accesu", +"Secret Key" => "Clave Secreta", +"Hostname (optional)" => "Nome d'equipu (opcional)", +"Port (optional)" => "Puertu (opcional)", +"Region (optional)" => "Rexón (opcional)", +"Enable SSL" => "Habilitar SSL", +"Enable Path Style" => "Habilitar Estilu de ruta", +"App key" => "App principal", +"App secret" => "App secreta", +"Host" => "Sirvidor", +"Username" => "Nome d'usuariu", +"Password" => "Contraseña", +"Root" => "Raíz", +"Secure ftps://" => "Secure ftps://", +"Client ID" => "ID de veceru", +"Client secret" => "Veceru secretu", +"OpenStack Object Storage" => "OpenStack Object Storage", +"Username (required)" => "Nome d'usuariu (necesariu)", +"Bucket (required)" => "Depósitu (necesariu)", +"Region (optional for OpenStack Object Storage)" => "Rexón (opcional pa OpenStack Object Storage)", +"API Key (required for Rackspace Cloud Files)" => "Clave API (necesaria pa Rackspace Cloud Files)", +"Tenantname (required for OpenStack Object Storage)" => "Nome d'inquilín (necesariu pa OpenStack Object Storage)", +"Password (required for OpenStack Object Storage)" => "Contraseña (necesaria pa OpenStack Object Storage)", +"Service Name (required for OpenStack Object Storage)" => "Nome de Serviciu (necesariu pa OpenStack Object Storage)", +"URL of identity endpoint (required for OpenStack Object Storage)" => "URL d'identidá de puntu final (necesariu pa OpenStack Object Storage)", +"Timeout of HTTP requests in seconds (optional)" => "Tiempu d'espera de peticiones HTTP en segundos (opcional)", +"Share" => "Compartir", +"SMB / CIFS using OC login" => "SMB / CIFS usando accesu OC", +"Username as share" => "Nome d'usuariu como Compartición", +"URL" => "URL", +"Secure https://" => "Secure https://", +"Remote subfolder" => "Subcarpeta remota", +"Access granted" => "Accesu concedíu", +"Error configuring Dropbox storage" => "Fallu configurando l'almacenamientu de Dropbox", +"Grant access" => "Conceder accesu", +"Please provide a valid Dropbox app key and secret." => "Por favor, proporciona una clave válida de l'app Dropbox y una clave secreta.", +"Error configuring Google Drive storage" => "Fallu configurando l'almacenamientu de Google Drive", +"Saved" => "Guardáu", +"Note: " => "Nota: ", +" and " => "y", +"Note: The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." => "Nota: El soporte de cURL en PHP nun ta activáu o instaláu. Nun pue montase %s. Pídi-y al alministrador de sistema que lu instale.", +"Note: The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." => "Nota: El soporte de FTP en PHP nun ta activáu o instaláu. Nun pue montase %s. Pídi-y al alministrador de sistema que lu instale.", +"Note: \"%s\" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it." => "Nota: \"%s\" nun ta instaláu. Nun pue montase %s. Pídi-y al alministrador de sistema que lu instale.", +"External Storage" => "Almacenamientu esternu", "Folder name" => "Nome de la carpeta", +"External storage" => "Almacenamientu esternu", "Configuration" => "Configuración", "Options" => "Opciones", +"Available for" => "Disponible pa", +"Add storage" => "Amestar almacenamientu", +"No user or group" => "Nengún usuariu o grupu", +"All Users" => "Tolos usuarios", "Groups" => "Grupos", "Users" => "Usuarios", -"Delete" => "Desaniciar" +"Delete" => "Desaniciar", +"Enable User External Storage" => "Habilitar almacenamientu esterno d'usuariu", +"Allow users to mount the following external storage" => "Permitir a los usuarios montar el siguiente almacenamientu esternu", +"SSL root certificates" => "Certificaos raíz SSL", +"Import Root Certificate" => "Importar certificáu raíz" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_external/l10n/bg_BG.php b/apps/files_external/l10n/bg_BG.php index 118da27f74a4cf4772cc86d45a71e56fdce178cd..13e43314bda18ba584d5ad0d781f7f9a1f8df78c 100644 --- a/apps/files_external/l10n/bg_BG.php +++ b/apps/files_external/l10n/bg_BG.php @@ -1,5 +1,10 @@ "Място", +"Username" => "Потребител", +"Password" => "Парола", +"Share" => "Споделяне", +"URL" => "Уеб адрес", "Access granted" => "Достъпът е даден", "Grant access" => "Даване на достъп", "External Storage" => "Външно хранилище", diff --git a/apps/files_external/l10n/bn_BD.php b/apps/files_external/l10n/bn_BD.php index 6c8f57779583d2898305f95cdf2ed45452ae34ea..f1ada4b476d29753493f14347015915c371e277f 100644 --- a/apps/files_external/l10n/bn_BD.php +++ b/apps/files_external/l10n/bn_BD.php @@ -1,5 +1,11 @@ "াবস্থান", +"Host" => "হোস্ট", +"Username" => "ব্যবহারকারী", +"Password" => "কূটশব্দ", +"Share" => "ভাগাভাগি কর", +"URL" => "URL", "Access granted" => "অধিগমনের অনুমতি প্রদান করা হলো", "Error configuring Dropbox storage" => "Dropbox সংরক্ষণাগার নির্ধারণ করতে সমস্যা ", "Grant access" => "অধিগমনের অনুমতি প্রদান কর", diff --git a/apps/files_external/l10n/bs.php b/apps/files_external/l10n/bs.php new file mode 100644 index 0000000000000000000000000000000000000000..304b2225e713ae0cb6a2105e44bb5440cc596000 --- /dev/null +++ b/apps/files_external/l10n/bs.php @@ -0,0 +1,5 @@ + "Podijeli" +); +$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_external/l10n/ca.php b/apps/files_external/l10n/ca.php index 8411d79306f098c061e364f96a0137c39a7e4aee..e349dfe45ef71da1839a990474171590831068f4 100644 --- a/apps/files_external/l10n/ca.php +++ b/apps/files_external/l10n/ca.php @@ -1,5 +1,12 @@ "Local", +"Location" => "Ubicació", +"Host" => "Equip remot", +"Username" => "Nom d'usuari", +"Password" => "Contrasenya", +"Share" => "Comparteix", +"URL" => "URL", "Access granted" => "S'ha concedit l'accés", "Error configuring Dropbox storage" => "Error en configurar l'emmagatzemament Dropbox", "Grant access" => "Concedeix accés", diff --git a/apps/files_external/l10n/cs_CZ.php b/apps/files_external/l10n/cs_CZ.php index 90d64529b1c93f81437598b97f2931366332682f..2d1116ed0f66fbd3949049be2cc8545ddacd73fe 100644 --- a/apps/files_external/l10n/cs_CZ.php +++ b/apps/files_external/l10n/cs_CZ.php @@ -1,5 +1,33 @@ "Místní", +"Location" => "Umístění", +"Amazon S3" => "Amazon S3", +"Key" => "Klíč", +"Secret" => "Tajemství", +"Access Key" => "Přístupový klíč", +"Secret Key" => "Tajný klíč", +"Hostname (optional)" => "Hostname (nepovinný)", +"Port (optional)" => "Port (nepovinný)", +"Region (optional)" => "Region (nepovinný)", +"Enable SSL" => "Povolit SSL", +"App key" => "Klíč aplikace", +"App secret" => "Tajemství aplikace", +"Host" => "Počítač", +"Username" => "Uživatelské jméno", +"Password" => "Heslo", +"Root" => "Root", +"Secure ftps://" => "Zabezpečené ftps://", +"Username (required)" => "Uživatelské jméno (nutné)", +"Region (optional for OpenStack Object Storage)" => "Region (nepovinný pro OpenStack Object Storage)", +"Password (required for OpenStack Object Storage)" => "Heslo (vyžadováno pro OpenStack Object Storage)", +"Timeout of HTTP requests in seconds (optional)" => "Vypršení HTTP požadavků v sekundách (nepovinné)", +"Share" => "Sdílet", +"SMB / CIFS using OC login" => "SMB / CIFS za použití OC loginu", +"Username as share" => "Uživatelské jméno jako sdílený adresář", +"URL" => "URL", +"Secure https://" => "Zabezpečené https://", +"Remote subfolder" => "Vzdálený podadresář", "Access granted" => "Přístup povolen", "Error configuring Dropbox storage" => "Chyba při nastavení úložiště Dropbox", "Grant access" => "Povolit přístup", @@ -18,7 +46,7 @@ $TRANSLATIONS = array( "Options" => "Možnosti", "Available for" => "Dostupné pro", "Add storage" => "Přidat úložiště", -"No user or group" => "Žádný uživatel nebo skupina.", +"No user or group" => "Žádný uživatel nebo skupina", "All Users" => "Všichni uživatelé", "Groups" => "Skupiny", "Users" => "Uživatelé", diff --git a/apps/files_external/l10n/cy_GB.php b/apps/files_external/l10n/cy_GB.php index 33992789cb3b8cb4b508e4eb125b5829806352ed..39822fcd3834062f638f928fdc49f50d07d0cea2 100644 --- a/apps/files_external/l10n/cy_GB.php +++ b/apps/files_external/l10n/cy_GB.php @@ -1,5 +1,10 @@ "Lleoliad", +"Username" => "Enw defnyddiwr", +"Password" => "Cyfrinair", +"Share" => "Rhannu", +"URL" => "URL", "Groups" => "Grwpiau", "Users" => "Defnyddwyr", "Delete" => "Dileu" diff --git a/apps/files_external/l10n/da.php b/apps/files_external/l10n/da.php index e0dea75303e0780a771e9fb812de7a647f3ca8b1..2d235747ad9584d2a2ccfdc96dc7c0cbdd8ab77f 100644 --- a/apps/files_external/l10n/da.php +++ b/apps/files_external/l10n/da.php @@ -1,17 +1,38 @@ "Lokal", +"Location" => "Placering", +"Amazon S3" => "Amazon S3", +"Key" => "Nøgle", +"Secret" => "Hemmelighed", +"Secret Key" => "Hemmelig Nøgle ", +"Host" => "Host", +"Username" => "Brugernavn", +"Password" => "Kodeord", +"Root" => "Root", +"Secure ftps://" => "Sikker ftps://", +"Client ID" => "Klient ID", +"Client secret" => "Klient hemmelighed", +"OpenStack Object Storage" => "OpenStack Object Storage", +"Share" => "Del", +"URL" => "URL", +"Secure https://" => "Sikker https://", "Access granted" => "Adgang godkendt", "Error configuring Dropbox storage" => "Fejl ved konfiguration af Dropbox plads", "Grant access" => "Godkend adgang", "Please provide a valid Dropbox app key and secret." => "Angiv venligst en valid Dropbox app nøgle og hemmelighed", "Error configuring Google Drive storage" => "Fejl ved konfiguration af Google Drive plads", "Saved" => "Gemt", +"Note: " => "Note: ", +" and " => "og", "External Storage" => "Ekstern opbevaring", "Folder name" => "Mappenavn", "External storage" => "Eksternt lager", "Configuration" => "Opsætning", "Options" => "Valgmuligheder", +"Available for" => "Tilgængelig for", "Add storage" => "Tilføj lager", +"No user or group" => "Ingen bruger eller gruppe", "All Users" => "Alle brugere", "Groups" => "Grupper", "Users" => "Brugere", diff --git a/apps/files_external/l10n/de.php b/apps/files_external/l10n/de.php index 25c7ffb3af185b5b2529ddf4c94837248b6c7bac..03f6f05abb98ab71cc78892fbee99179e2360d7e 100644 --- a/apps/files_external/l10n/de.php +++ b/apps/files_external/l10n/de.php @@ -1,5 +1,44 @@ "Lokal", +"Location" => "Ort", +"Amazon S3" => "Amazon S3", +"Key" => "Schlüssel", +"Secret" => "Geheime Zeichenkette", +"Bucket" => "Bucket", +"Amazon S3 and compliant" => "Amazon S3 und Kompatible", +"Access Key" => "Zugriffsschlüssel", +"Secret Key" => "Sicherheitssschlüssel", +"Hostname (optional)" => "Host-Name (Optional)", +"Port (optional)" => "Port (Optional)", +"Region (optional)" => "Region (Optional)", +"Enable SSL" => "SSL aktivieren", +"Enable Path Style" => "Pfad-Stil aktivieren", +"App key" => "App-Schlüssel", +"App secret" => "Geheime Zeichenkette der App", +"Host" => "Host", +"Username" => "Benutzername", +"Password" => "Passwort", +"Root" => "Root", +"Secure ftps://" => "Sicherer FTPS://", +"Client ID" => "Client-ID", +"Client secret" => "Geheime Zeichenkette des Client", +"OpenStack Object Storage" => "Openstack-Objektspeicher", +"Username (required)" => "Benutzername (Erforderlich)", +"Bucket (required)" => "Bucket (Erforderlich)", +"Region (optional for OpenStack Object Storage)" => "Region (Optional für Openstack-Objektspeicher)", +"API Key (required for Rackspace Cloud Files)" => "API-Schlüssel (Erforderlich für Rackspace Cloud-Dateien)", +"Tenantname (required for OpenStack Object Storage)" => "Mietername (Erforderlich für Openstack-Objektspeicher)", +"Password (required for OpenStack Object Storage)" => "Passwort (Erforderlich für Openstack-Objektspeicher)", +"Service Name (required for OpenStack Object Storage)" => "Name der Dienstleistung (Erforderlich für Openstack-Objektspeicher)", +"URL of identity endpoint (required for OpenStack Object Storage)" => "URL des Identitätsendpunktes (Erforderlich für Openstack-Objektspeicher)", +"Timeout of HTTP requests in seconds (optional)" => "Zeitüberschreitung von HTTP-Anfragen in Sekunden (Optional)", +"Share" => "Teilen", +"SMB / CIFS using OC login" => "´", +"Username as share" => "Benutzername als Freigabe", +"URL" => "URL", +"Secure https://" => "Sicherer HTTPS://", +"Remote subfolder" => "Remote-Unterordner:", "Access granted" => "Zugriff gestattet", "Error configuring Dropbox storage" => "Fehler beim Einrichten von Dropbox", "Grant access" => "Zugriff gestatten", diff --git a/apps/files_external/l10n/de_AT.php b/apps/files_external/l10n/de_AT.php index afa3eff001c3509d2db3c55f382cad6964fb7a7e..21004505e5779eaef4e70b642676b2e4f8a25b2e 100644 --- a/apps/files_external/l10n/de_AT.php +++ b/apps/files_external/l10n/de_AT.php @@ -1,5 +1,8 @@ "Ort", +"Password" => "Passwort", +"Share" => "Freigeben", "Delete" => "Löschen" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_external/l10n/de_CH.php b/apps/files_external/l10n/de_CH.php index 554fca8de545287af4c6128931508a4e32fde8b3..4e0ac1f3a090795d2b16a69dd0a3e67b5f4666a6 100644 --- a/apps/files_external/l10n/de_CH.php +++ b/apps/files_external/l10n/de_CH.php @@ -1,5 +1,11 @@ "Ort", +"Host" => "Host", +"Username" => "Benutzername", +"Password" => "Passwort", +"Share" => "Freigeben", +"URL" => "URL", "Access granted" => "Zugriff gestattet", "Error configuring Dropbox storage" => "Fehler beim Einrichten von Dropbox", "Grant access" => "Zugriff gestatten", diff --git a/apps/files_external/l10n/de_DE.php b/apps/files_external/l10n/de_DE.php index 186aa5a299a568397542140d462aeadcb073cf50..286250f86899a5bf47a48029e75ef1b4010a4077 100644 --- a/apps/files_external/l10n/de_DE.php +++ b/apps/files_external/l10n/de_DE.php @@ -1,5 +1,44 @@ "Lokal", +"Location" => "Ort", +"Amazon S3" => "Amazon S3", +"Key" => "Schlüssel", +"Secret" => "Geheime Zeichenkette", +"Bucket" => "Bucket", +"Amazon S3 and compliant" => "Amazon S3 und Kompatible", +"Access Key" => "Zugriffsschlüssel", +"Secret Key" => "Sicherheitsschlüssel", +"Hostname (optional)" => "Host-Name (Optional)", +"Port (optional)" => "Port (Optional)", +"Region (optional)" => "Region (Optional)", +"Enable SSL" => "SSL aktivieren", +"Enable Path Style" => "Pfad-Stil aktivieren", +"App key" => "App-Schlüssel", +"App secret" => "Geheime Zeichenkette der App", +"Host" => "Host", +"Username" => "Benutzername", +"Password" => "Passwort", +"Root" => "Root", +"Secure ftps://" => "Sicherer FTPS://", +"Client ID" => "Client-ID", +"Client secret" => "Geheime Zeichenkette des Client", +"OpenStack Object Storage" => "Openstack-Objektspeicher", +"Username (required)" => "Benutzername (Erforderlich)", +"Bucket (required)" => "Bucket (Erforderlich)", +"Region (optional for OpenStack Object Storage)" => "Region (Optional für Openstack-Objektspeicher)", +"API Key (required for Rackspace Cloud Files)" => "API-Schlüssel (Erforderlich für Rackspace Cloud-Dateien)", +"Tenantname (required for OpenStack Object Storage)" => "Mietername (Erforderlich für Openstack-Objektspeicher)", +"Password (required for OpenStack Object Storage)" => "Passwort (Erforderlich für Openstack-Objektspeicher)", +"Service Name (required for OpenStack Object Storage)" => "Name der Dienstleistung (Erforderlich für Openstack-Objektspeicher)", +"URL of identity endpoint (required for OpenStack Object Storage)" => "URL des Identitätsendpunktes (Erforderlich für Openstack-Objektspeicher)", +"Timeout of HTTP requests in seconds (optional)" => "Zeitüberschreitung von HTTP-Anfragen in Sekunden (Optional)", +"Share" => "Teilen", +"SMB / CIFS using OC login" => "Zeitüberschreitung von HTTP-Anfragen in Sekunden (Optional)", +"Username as share" => "Benutzername als Freigabe", +"URL" => "URL", +"Secure https://" => "Sicherer HTTPS://", +"Remote subfolder" => "Remote-Unterordner:", "Access granted" => "Zugriff gestattet", "Error configuring Dropbox storage" => "Fehler beim Einrichten von Dropbox", "Grant access" => "Zugriff gestatten", diff --git a/apps/files_external/l10n/el.php b/apps/files_external/l10n/el.php index 16b837e24c5bd8f8373ca7974a9508aab9546c44..09d39a9e3cd902a415acdf3bc9d25d2014795877 100644 --- a/apps/files_external/l10n/el.php +++ b/apps/files_external/l10n/el.php @@ -1,17 +1,56 @@ "Τοπικός", +"Location" => "Τοποθεσία", +"Key" => "Κλειδί", +"Secret" => "Μυστικό", +"Access Key" => "Κλειδί πρόσβασης", +"Secret Key" => "Μυστικό κλειδί", +"Hostname (optional)" => "Όνομα μηχανήματος (προαιρετικά)", +"Port (optional)" => "Πόρτα (προαιρετικά)", +"Region (optional)" => "Περιοχή (προαιρετικά)", +"Enable SSL" => "Ενεργοποίηση SSL", +"Enable Path Style" => "Ενεργοποίηση μορφής διαδρομής", +"App key" => "Κλειδί εφαρμογής", +"Host" => "Διακομιστής", +"Username" => "Όνομα χρήστη", +"Password" => "Κωδικός πρόσβασης", +"Root" => "Root", +"Secure ftps://" => "Ασφαλής ftps://", +"Client ID" => "ID πελάτη", +"Client secret" => "Μυστικό πελάτη", +"OpenStack Object Storage" => "Αποθήκη αντικειμένων OpenStack", +"Username (required)" => "Όνομα χρήστη (απαιτείται)", +"Region (optional for OpenStack Object Storage)" => "Περιοχή (προαιρετικά για την αποθήκευση αντικειμένων OpenStack)", +"API Key (required for Rackspace Cloud Files)" => "Κλειδί API (απαιτείται για αρχεία Rackspace Cloud)", +"Password (required for OpenStack Object Storage)" => "Μυστικός κωδικός (απαιτείται για την αποθήκευση αντικειμένων OpenStack)", +"Service Name (required for OpenStack Object Storage)" => "Όνομα υπηρεσίας (απαιτείται για την αποθήκευση αντικειμένων OpenStack)", +"URL of identity endpoint (required for OpenStack Object Storage)" => "Διεύθυνση URL της ταυτότητας τελικού σημείου (απαιτείται για την αποθήκευση αντικειμένων OpenStack)", +"Timeout of HTTP requests in seconds (optional)" => "Χρονικό όριο των αιτήσεων HTTP σε δευτερόλεπτα (προαιρετικά)", +"Share" => "Διαμοιράστε", +"SMB / CIFS using OC login" => "SMB / CIFS χρησιμοποιώντας λογαριασμό OC", +"URL" => "URL", +"Secure https://" => "Ασφαλής σύνδεση https://", +"Remote subfolder" => "Απομακρυσμένος υποφάκελος", "Access granted" => "Προσβαση παρασχέθηκε", "Error configuring Dropbox storage" => "Σφάλμα ρυθμίζωντας αποθήκευση Dropbox ", "Grant access" => "Παροχή πρόσβασης", "Please provide a valid Dropbox app key and secret." => "Παρακαλούμε δώστε έγκυρο κλειδί Dropbox και μυστικό.", "Error configuring Google Drive storage" => "Σφάλμα ρυθμίζωντας αποθήκευση Google Drive ", "Saved" => "Αποθηκεύτηκαν", +"Note: " => "Σημείωση: ", +" and " => "και", +"Note: The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." => "Σημείωση: Η υποστήριξη cURL στην PHP δεν είναι ενεργοποιημένη ή εγκατεστημένη. Η προσάρτηση του %s δεν είναι δυνατή. Παρακαλώ ζητήστε από τον διαχειριστή συστημάτων σας να την εγκαταστήσει.", +"Note: The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." => "Σημείωση: Η υποστήριξη FTP στην PHP δεν είναι ενεργοποιημένη ή εγκατεστημένη. Δεν είναι δυνατή η προσάρτηση του %s. Παρακαλώ ζητήστε από τον διαχειριστή συστημάτων σας να την εγκαταστήσει.", +"Note: \"%s\" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it." => "Σημείωση: Η επέκταση \"%s\" δεν είναι εγκατεστημένη. Δεν είναι δυνατή η προσάρτηση %s. Παρακαλώ ζητήστε από τον διαχειριστή συστημάτων σας να την εγκαταστήσει.", "External Storage" => "Εξωτερικό Αποθηκευτικό Μέσο", "Folder name" => "Όνομα φακέλου", "External storage" => "Εξωτερική αποθήκευση", "Configuration" => "Ρυθμίσεις", "Options" => "Επιλογές", +"Available for" => "Διαθέσιμο για", "Add storage" => "Προσθηκη αποθηκευσης", +"No user or group" => "Μη διαθέσιμος χρήστης ή ομάδα", "All Users" => "Όλοι οι Χρήστες", "Groups" => "Ομάδες", "Users" => "Χρήστες", diff --git a/apps/files_external/l10n/en@pirate.php b/apps/files_external/l10n/en@pirate.php new file mode 100644 index 0000000000000000000000000000000000000000..ab628e1717ea7db8f3603b601d313df628d22c87 --- /dev/null +++ b/apps/files_external/l10n/en@pirate.php @@ -0,0 +1,5 @@ + "Secret Code" +); +$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 index 4bd3f9daf2a8fc4fbdc8f53d17c51be60a9ddf90..d4229c607ef895008b6f3c0642df42e487867b16 100644 --- a/apps/files_external/l10n/en_GB.php +++ b/apps/files_external/l10n/en_GB.php @@ -1,5 +1,44 @@ "Local", +"Location" => "Location", +"Amazon S3" => "Amazon S3", +"Key" => "Key", +"Secret" => "Secret", +"Bucket" => "Bucket", +"Amazon S3 and compliant" => "Amazon S3 and compliant", +"Access Key" => "Access Key", +"Secret Key" => "Secret Key", +"Hostname (optional)" => "Hostname (optional)", +"Port (optional)" => "Port (optional)", +"Region (optional)" => "Region (optional)", +"Enable SSL" => "Enable SSL", +"Enable Path Style" => "Enable Path Style", +"App key" => "App key", +"App secret" => "App secret", +"Host" => "Host", +"Username" => "Username", +"Password" => "Password", +"Root" => "Root", +"Secure ftps://" => "Secure ftps://", +"Client ID" => "Client ID", +"Client secret" => "Client secret", +"OpenStack Object Storage" => "OpenStack Object Storage", +"Username (required)" => "Username (required)", +"Bucket (required)" => "Bucket (required)", +"Region (optional for OpenStack Object Storage)" => "Region (optional for OpenStack Object Storage)", +"API Key (required for Rackspace Cloud Files)" => "API Key (required for Rackspace Cloud Files)", +"Tenantname (required for OpenStack Object Storage)" => "Tenantname (required for OpenStack Object Storage)", +"Password (required for OpenStack Object Storage)" => "Password (required for OpenStack Object Storage)", +"Service Name (required for OpenStack Object Storage)" => "Service Name (required for OpenStack Object Storage)", +"URL of identity endpoint (required for OpenStack Object Storage)" => "URL of identity endpoint (required for OpenStack Object Storage)", +"Timeout of HTTP requests in seconds (optional)" => "Timeout of HTTP requests in seconds (optional)", +"Share" => "Share", +"SMB / CIFS using OC login" => "SMB / CIFS using OC login", +"Username as share" => "Username as share", +"URL" => "URL", +"Secure https://" => "Secure https://", +"Remote subfolder" => "Remote subfolder", "Access granted" => "Access granted", "Error configuring Dropbox storage" => "Error configuring Dropbox storage", "Grant access" => "Grant access", diff --git a/apps/files_external/l10n/eo.php b/apps/files_external/l10n/eo.php index 5312872c07a544c56aa2612d8642821e5b292d51..d3ca5a5addf18e342335f05393ddabafec07c1d4 100644 --- a/apps/files_external/l10n/eo.php +++ b/apps/files_external/l10n/eo.php @@ -1,5 +1,11 @@ "Loko", +"Host" => "Gastigo", +"Username" => "Uzantonomo", +"Password" => "Pasvorto", +"Share" => "Kunhavigi", +"URL" => "URL", "Access granted" => "Alirpermeso donita", "Error configuring Dropbox storage" => "Eraro dum agordado de la memorservo Dropbox", "Grant access" => "Doni alirpermeson", diff --git a/apps/files_external/l10n/es.php b/apps/files_external/l10n/es.php index bfe542c6e7123fc4519cc1e15ae297abad07e067..bbbe0a8c6130e5925bb785678ded2f2064d0df22 100644 --- a/apps/files_external/l10n/es.php +++ b/apps/files_external/l10n/es.php @@ -1,5 +1,44 @@ "Local", +"Location" => "Ubicación", +"Amazon S3" => "Amazon S3", +"Key" => "Clave", +"Secret" => "Secreto", +"Bucket" => "Depósito", +"Amazon S3 and compliant" => "Amazon S3 y compatibilidad", +"Access Key" => "Clave de Acceso", +"Secret Key" => "Clave Secreta", +"Hostname (optional)" => "Nombre de Equipo (opcional)", +"Port (optional)" => "Puerto (opcional)", +"Region (optional)" => "Región (opcional)", +"Enable SSL" => "Habilitar SSL", +"Enable Path Style" => "Habilitar Estilo de Ruta", +"App key" => "App principal", +"App secret" => "App secreta", +"Host" => "Servidor", +"Username" => "Nombre de usuario", +"Password" => "Contraseña", +"Root" => "Raíz", +"Secure ftps://" => "Secure ftps://", +"Client ID" => "ID de Cliente", +"Client secret" => "Cliente secreto", +"OpenStack Object Storage" => "OpenStack Object Storage", +"Username (required)" => "Nombre de Usuario (requerido)", +"Bucket (required)" => "Depósito (requerido)", +"Region (optional for OpenStack Object Storage)" => "Región (opcional para OpenStack Object Storage)", +"API Key (required for Rackspace Cloud Files)" => "Clave API (requerida para Rackspace Cloud Files)", +"Tenantname (required for OpenStack Object Storage)" => "Nombre de Inquilino (requerido para OpenStack Object Storage)", +"Password (required for OpenStack Object Storage)" => "Contraseña (requerida para OpenStack Object Storage)", +"Service Name (required for OpenStack Object Storage)" => "Nombre de Servicio (requerido para OpenStack Object Storage)", +"URL of identity endpoint (required for OpenStack Object Storage)" => "URL de identidad de punto final (requerido para OpenStack Object Storage)", +"Timeout of HTTP requests in seconds (optional)" => "Tiempo de espera de peticiones HTTP en segundos (opcional)", +"Share" => "Compartir", +"SMB / CIFS using OC login" => "SMB / CIFS usando acceso OC", +"Username as share" => "Nombre de Usuario como compartir", +"URL" => "URL", +"Secure https://" => "Secure https://", +"Remote subfolder" => "Subcarpeta remota", "Access granted" => "Acceso concedido", "Error configuring Dropbox storage" => "Error configurando el almacenamiento de Dropbox", "Grant access" => "Conceder acceso", diff --git a/apps/files_external/l10n/es_AR.php b/apps/files_external/l10n/es_AR.php index 9bcff39f018007b60d5af62b6e99644db20ae9d5..dfb53d9a78485dba9add5506ec5ba4e7fad447a0 100644 --- a/apps/files_external/l10n/es_AR.php +++ b/apps/files_external/l10n/es_AR.php @@ -1,5 +1,11 @@ "Ubicación", +"Host" => "Servidor", +"Username" => "Nombre de usuario", +"Password" => "Contraseña", +"Share" => "Compartir", +"URL" => "URL", "Access granted" => "Acceso permitido", "Error configuring Dropbox storage" => "Error al configurar el almacenamiento de Dropbox", "Grant access" => "Permitir acceso", diff --git a/apps/files_external/l10n/es_CL.php b/apps/files_external/l10n/es_CL.php index f52482cad463852c246e9e025b3b1bd44052f796..2bc6da9a59eb9a4cbad0bc3df65d83099b4f3b35 100644 --- a/apps/files_external/l10n/es_CL.php +++ b/apps/files_external/l10n/es_CL.php @@ -1,5 +1,8 @@ "Usuario", +"Password" => "Clave", +"Share" => "Compartir", "Folder name" => "Nombre del directorio" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_external/l10n/es_MX.php b/apps/files_external/l10n/es_MX.php index dc0aef45c4f83ef7bda072aad6fb17203d9c950f..7e28798f58ad85ae7f2be8fafa35975aa86fcf07 100644 --- a/apps/files_external/l10n/es_MX.php +++ b/apps/files_external/l10n/es_MX.php @@ -1,5 +1,11 @@ "Ubicación", +"Host" => "Servidor", +"Username" => "Nombre de usuario", +"Password" => "Contraseña", +"Share" => "Compartir", +"URL" => "URL", "Access granted" => "Acceso concedido", "Error configuring Dropbox storage" => "Error configurando el almacenamiento de Dropbox", "Grant access" => "Conceder acceso", diff --git a/apps/files_external/l10n/et_EE.php b/apps/files_external/l10n/et_EE.php index 4da749b155b2f7f6cdaf21241fd52e67bf519522..73444411979b61c18c14d4d142103befd74c89fc 100644 --- a/apps/files_external/l10n/et_EE.php +++ b/apps/files_external/l10n/et_EE.php @@ -1,5 +1,12 @@ "Kohalik", +"Location" => "Asukoht", +"Host" => "Host", +"Username" => "Kasutajanimi", +"Password" => "Parool", +"Share" => "Jaga", +"URL" => "URL", "Access granted" => "Ligipääs on antud", "Error configuring Dropbox storage" => "Viga Dropboxi salvestusruumi seadistamisel", "Grant access" => "Anna ligipääs", diff --git a/apps/files_external/l10n/eu.php b/apps/files_external/l10n/eu.php index c2111a1f73630f03b69965a0d4de1d4a3f5e4032..ef29ba0484835ca9536f63b27d3af816badee6ef 100644 --- a/apps/files_external/l10n/eu.php +++ b/apps/files_external/l10n/eu.php @@ -1,21 +1,36 @@ "Bertakoa", +"Location" => "Kokapena", +"Amazon S3" => "Amazon S3", +"Port (optional)" => "Portua (hautazkoa)", +"Enable SSL" => "Gaitu SSL", +"Host" => "Hostalaria", +"Username" => "Erabiltzaile izena", +"Password" => "Pasahitza", +"Share" => "Partekatu", +"URL" => "URL", "Access granted" => "Sarrera baimendua", "Error configuring Dropbox storage" => "Errore bat egon da Dropbox biltegiratzea konfiguratzean", "Grant access" => "Baimendu sarrera", "Please provide a valid Dropbox app key and secret." => "Mesedez eman baliozkoa den Dropbox app giltza eta sekretua", "Error configuring Google Drive storage" => "Errore bat egon da Google Drive biltegiratzea konfiguratzean", +"Saved" => "Gordeta", +"Note: " => "Oharra:", +" and " => "eta", "External Storage" => "Kanpoko Biltegiratzea", "Folder name" => "Karpetaren izena", "External storage" => "Kanpoko biltegiratzea", "Configuration" => "Konfigurazioa", "Options" => "Aukerak", "Add storage" => "Gehitu biltegiratzea", +"No user or group" => "Talde edo erabiltzailerik ez", "All Users" => "Erabiltzaile guztiak", "Groups" => "Taldeak", "Users" => "Erabiltzaileak", "Delete" => "Ezabatu", "Enable User External Storage" => "Gaitu erabiltzaileentzako Kanpo Biltegiratzea", +"Allow users to mount the following external storage" => "Baimendu erabiltzaileak hurrengo kanpo biltegiratzeak muntatzen", "SSL root certificates" => "SSL erro ziurtagiriak", "Import Root Certificate" => "Inportatu Erro Ziurtagiria" ); diff --git a/apps/files_external/l10n/eu_ES.php b/apps/files_external/l10n/eu_ES.php index 8612c8609bb7c070570702ce4dc0210c398a479a..9b95b9d01a4cbbaf2f2de6605c142d4e1c976371 100644 --- a/apps/files_external/l10n/eu_ES.php +++ b/apps/files_external/l10n/eu_ES.php @@ -1,5 +1,6 @@ "kokapena", "Delete" => "Ezabatu" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_external/l10n/fa.php b/apps/files_external/l10n/fa.php index 74472c54bf53d3ebda236bb5ae53e7896817eac0..674a72873323ec636dd04ee02683b831bfe7797b 100644 --- a/apps/files_external/l10n/fa.php +++ b/apps/files_external/l10n/fa.php @@ -1,5 +1,11 @@ "محل", +"Host" => "میزبانی", +"Username" => "نام کاربری", +"Password" => "گذرواژه", +"Share" => "اشتراک‌گذاری", +"URL" => "آدرس", "Access granted" => "مجوز دسترسی صادر شد", "Error configuring Dropbox storage" => "خطا به هنگام تنظیم فضای دراپ باکس", "Grant access" => " مجوز اعطا دسترسی", diff --git a/apps/files_external/l10n/fi_FI.php b/apps/files_external/l10n/fi_FI.php index 677425d8a6a945cc5a29972718fe4c454ed7ee69..aa7fb394d4ed1c89c67c1395b88e589a3b23d5b5 100644 --- a/apps/files_external/l10n/fi_FI.php +++ b/apps/files_external/l10n/fi_FI.php @@ -1,5 +1,18 @@ "Paikallinen", +"Location" => "Sijainti", +"Amazon S3" => "Amazon S3", +"Port (optional)" => "Portti (valinnainen)", +"Region (optional)" => "Alue (valinnainen)", +"Enable SSL" => "Käytä SSL:ää", +"Host" => "Isäntä", +"Username" => "Käyttäjätunnus", +"Password" => "Salasana", +"Username (required)" => "Käyttäjätunnus (vaaditaan)", +"Share" => "Jaa", +"URL" => "Verkko-osoite", +"Secure https://" => "Salattu https://", "Access granted" => "Pääsy sallittu", "Error configuring Dropbox storage" => "Virhe Dropbox levyn asetuksia tehtäessä", "Grant access" => "Salli pääsy", diff --git a/apps/files_external/l10n/fr.php b/apps/files_external/l10n/fr.php index 8ff1969718217b2a403d718e88fabe2e4a4b1fdd..df2f63ec2e7bda293f973aca59ee75ae74f7b764 100644 --- a/apps/files_external/l10n/fr.php +++ b/apps/files_external/l10n/fr.php @@ -1,5 +1,26 @@ "Local", +"Location" => "Emplacement", +"Amazon S3" => "Amazon S3", +"Key" => "Clé", +"Secret" => "Secret", +"Access Key" => "Clé d'accès", +"Secret Key" => "Clé secrète", +"Hostname (optional)" => "Nom machine (optionnel)", +"Port (optional)" => "Port (optionnel)", +"Enable SSL" => "Activer SSL", +"App key" => "Clé App", +"Host" => "Hôte", +"Username" => "Nom d'utilisateur", +"Password" => "Mot de passe", +"Root" => "Root", +"Client ID" => "ID Client", +"Username (required)" => "Nom d'utilisation (requis)", +"API Key (required for Rackspace Cloud Files)" => "Clé API (requis pour Rackspace Cloud Files)", +"Password (required for OpenStack Object Storage)" => "Mot de passe (requis pour OpenStack Object Storage)", +"Share" => "Partager", +"URL" => "URL", "Access granted" => "Accès autorisé", "Error configuring Dropbox storage" => "Erreur lors de la configuration du support de stockage Dropbox", "Grant access" => "Autoriser l'accès", diff --git a/apps/files_external/l10n/gl.php b/apps/files_external/l10n/gl.php index 5efa6ce6028b77766231917e4c4a8d4dd355bae9..248afb5f6a7a8723629ecfe1bee5929160be25ff 100644 --- a/apps/files_external/l10n/gl.php +++ b/apps/files_external/l10n/gl.php @@ -1,5 +1,44 @@ "Local", +"Location" => "Localización", +"Amazon S3" => "Amazon S3", +"Key" => "Clave", +"Secret" => "Secreto", +"Bucket" => "Bucket", +"Amazon S3 and compliant" => "Amazon S3 e compatíbeis", +"Access Key" => "Clave de acceso", +"Secret Key" => "Clave secreta", +"Hostname (optional)" => "Nome de máquina (opcional)", +"Port (optional)" => "Porto (opcional)", +"Region (optional)" => "Rexión (opcional)", +"Enable SSL" => "Activar SSL", +"Enable Path Style" => "Activar o estilo de ruta", +"App key" => "Clave da API", +"App secret" => "Secreto do aplicativo", +"Host" => "Servidor", +"Username" => "Nome de usuario", +"Password" => "Contrasinal", +"Root" => "Root (raíz)", +"Secure ftps://" => "ftps:// seguro", +"Client ID" => "ID do cliente", +"Client secret" => "Secreto do cliente", +"OpenStack Object Storage" => "OpenStack Object Storage", +"Username (required)" => "Nome de usuario (obrigatorio)", +"Bucket (required)" => "Bucket (obrigatorio)", +"Region (optional for OpenStack Object Storage)" => "Rexión (opcional para OpenStack Object Storage)", +"API Key (required for Rackspace Cloud Files)" => "Clave da API (obrigatoria para Rackspace Cloud Files)", +"Tenantname (required for OpenStack Object Storage)" => "Nome do inquilino (obrigatorio para OpenStack Object Storage)", +"Password (required for OpenStack Object Storage)" => "Contrasinal (obrigatorio para OpenStack Object Storage)", +"Service Name (required for OpenStack Object Storage)" => "Nome do servizo (obrigatorio para OpenStack Object Storage)", +"URL of identity endpoint (required for OpenStack Object Storage)" => "URL do punto final da identidade (obrigatorio para OpenStack Object Storage)", +"Timeout of HTTP requests in seconds (optional)" => "Tempo de espera de peticións HTTP en segundos (opcional)", +"Share" => "Compartir", +"SMB / CIFS using OC login" => "SMB / CIFS usando acceso OC", +"Username as share" => "Nome de usuario como compartición", +"URL" => "URL", +"Secure https://" => "https:// seguro", +"Remote subfolder" => "Subcartafol remoto", "Access granted" => "Concedeuse acceso", "Error configuring Dropbox storage" => "Produciuse un erro ao configurar o almacenamento en Dropbox", "Grant access" => "Permitir o acceso", diff --git a/apps/files_external/l10n/he.php b/apps/files_external/l10n/he.php index e433f4fc3068ced6f106380697fcc68f23333ab5..f55a35fcadecf2857692f7d5a986073efc6be56f 100644 --- a/apps/files_external/l10n/he.php +++ b/apps/files_external/l10n/he.php @@ -1,5 +1,11 @@ "מיקום", +"Host" => "מארח", +"Username" => "שם משתמש", +"Password" => "סיסמא", +"Share" => "שיתוף", +"URL" => "כתובת", "Access granted" => "הוענקה גישה", "Error configuring Dropbox storage" => "אירעה שגיאה בעת הגדרת אחסון ב־Dropbox", "Grant access" => "הענקת גישה", diff --git a/apps/files_external/l10n/hi.php b/apps/files_external/l10n/hi.php index 7df96572596a7781b219b9c5745591a935119d1a..fdea5e76258065ec13ce027956fde7580142c99e 100644 --- a/apps/files_external/l10n/hi.php +++ b/apps/files_external/l10n/hi.php @@ -1,5 +1,8 @@ "प्रयोक्ता का नाम", +"Password" => "पासवर्ड", +"Share" => "साझा करें", "Users" => "उपयोगकर्ता" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_external/l10n/hr.php b/apps/files_external/l10n/hr.php index 91536e0b873ec0ee03fbc19a35e4a5146b8912de..954a484b794689e27c472a9f5b2a279f8e22a465 100644 --- a/apps/files_external/l10n/hr.php +++ b/apps/files_external/l10n/hr.php @@ -1,5 +1,9 @@ "Lokacija", +"Username" => "Korisničko ime", +"Password" => "Lozinka", +"Share" => "Podijeli", "Groups" => "Grupe", "Users" => "Korisnici", "Delete" => "Obriši" diff --git a/apps/files_external/l10n/hu_HU.php b/apps/files_external/l10n/hu_HU.php index 39d185d5f0b53fdbc5f2941cc457aad1099461f8..d9c570d68c9354847b221a608eb1a1742e330c9a 100644 --- a/apps/files_external/l10n/hu_HU.php +++ b/apps/files_external/l10n/hu_HU.php @@ -1,10 +1,17 @@ "Hely", +"Host" => "Kiszolgáló", +"Username" => "Felhasználónév", +"Password" => "Jelszó", +"Share" => "Megosztás", +"URL" => "URL", "Access granted" => "Érvényes hozzáférés", "Error configuring Dropbox storage" => "A Dropbox tárolót nem sikerült beállítani", "Grant access" => "Megadom a hozzáférést", "Please provide a valid Dropbox app key and secret." => "Adjon meg egy érvényes Dropbox app key-t és secretet!", "Error configuring Google Drive storage" => "A Google Drive tárolót nem sikerült beállítani", +"Saved" => "Elmentve", "External Storage" => "Külső tárolási szolgáltatások becsatolása", "Folder name" => "Mappanév", "External storage" => "Külső tárolók", diff --git a/apps/files_external/l10n/ia.php b/apps/files_external/l10n/ia.php index 1873f4ad6fe040fa8c64de6a36c03b0a01289a17..978003e20cb1aa98ebd1f2c2dbf3d08e84439fed 100644 --- a/apps/files_external/l10n/ia.php +++ b/apps/files_external/l10n/ia.php @@ -1,5 +1,10 @@ "Loco", +"Username" => "Nomine de usator", +"Password" => "Contrasigno", +"Share" => "Compartir", +"URL" => "URL", "Folder name" => "Nomine de dossier", "Groups" => "Gruppos", "Users" => "Usatores", diff --git a/apps/files_external/l10n/id.php b/apps/files_external/l10n/id.php index 8ab5069539fcd809a282bd204549f24b83d0a69f..a21ea7aef7b84ffb6b72477e8df46be22c031d61 100644 --- a/apps/files_external/l10n/id.php +++ b/apps/files_external/l10n/id.php @@ -1,21 +1,44 @@ "Lokal", +"Location" => "lokasi", +"Amazon S3" => "Amazon S3", +"Hostname (optional)" => "Hostname (tambahan)", +"Port (optional)" => "Port (tambahan)", +"Region (optional)" => "Wilayah (tambahan)", +"Enable SSL" => "Aktifkan SSL", +"Host" => "Host", +"Username" => "Nama Pengguna", +"Password" => "Sandi", +"Root" => "Root", +"Username (required)" => "Nama pengguna (dibutuhkan)", +"Share" => "Bagikan", +"URL" => "tautan", "Access granted" => "Akses diberikan", "Error configuring Dropbox storage" => "Kesalahan dalam mengonfigurasi penyimpanan Dropbox", "Grant access" => "Berikan hak akses", "Please provide a valid Dropbox app key and secret." => "Masukkan kunci dan sandi aplikasi Dropbox yang benar.", "Error configuring Google Drive storage" => "Kesalahan dalam mengkonfigurasi penyimpanan Google Drive", +"Saved" => "Disimpan", +"Note: " => "Catatan: ", +" and " => "dan", +"Note: The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." => "Catatan: Dukungan cURL di PHP tidak diaktifkan atau belum diinstal. Mengaitkan %s tidak dimungkinkan. Silakan tanyakan ke administrator sistem Anda untuk menginstalnya.", +"Note: The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." => "Catatan: Dukungan FTP di PHP tidak diaktifkan atau belum diinstal. Mengaitkan %s tidak dimungkinkan. Silakan tanyakan ke administrator sistem Anda untuk menginstalnya.", +"Note: \"%s\" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it." => "Catatan: \"%s\" belum diinstal. Mengaitkan %s tidak dimungkinkan. Silakan tanyakan ke administrator sistem Anda untuk menginstalnya.", "External Storage" => "Penyimpanan Eksternal", "Folder name" => "Nama folder", "External storage" => "Penyimpanan eksternal", "Configuration" => "Konfigurasi", "Options" => "Opsi", +"Available for" => "Tersedia untuk", "Add storage" => "Tambahkan penyimpanan", +"No user or group" => "Tidak ada pengguna dan grup", "All Users" => "Semua Pengguna", "Groups" => "Grup", "Users" => "Pengguna", "Delete" => "Hapus", "Enable User External Storage" => "Aktifkan Penyimpanan Eksternal Pengguna", +"Allow users to mount the following external storage" => "Izinkan pengguna untuk mengaitkan penyimpanan eksternal berikut", "SSL root certificates" => "Sertifikat root SSL", "Import Root Certificate" => "Impor Sertifikat Root" ); diff --git a/apps/files_external/l10n/is.php b/apps/files_external/l10n/is.php index 21a215807abcbb68e2b7d1a3bd6de6cab1834838..daf9c4cb4417742e0af73cf1ef8effc5afa42ecd 100644 --- a/apps/files_external/l10n/is.php +++ b/apps/files_external/l10n/is.php @@ -1,5 +1,11 @@ "Staðsetning", +"Host" => "Netþjónn", +"Username" => "Notendanafn", +"Password" => "Lykilorð", +"Share" => "Deila", +"URL" => "URL", "Access granted" => "Aðgengi veitt", "Error configuring Dropbox storage" => "Villa við að setja upp Dropbox gagnasvæði", "Grant access" => "Veita aðgengi", diff --git a/apps/files_external/l10n/it.php b/apps/files_external/l10n/it.php index f3a6f9af12936dc23fd7d868c4e6eef988e1747b..c6428a27ba196821b915cd239792805424521213 100644 --- a/apps/files_external/l10n/it.php +++ b/apps/files_external/l10n/it.php @@ -1,5 +1,44 @@ "Locale", +"Location" => "Posizione", +"Amazon S3" => "Amazon S3", +"Key" => "Chiave", +"Secret" => "Segreto", +"Bucket" => "Bucket", +"Amazon S3 and compliant" => "Amazon S3 e conformi", +"Access Key" => "Chiave di accesso", +"Secret Key" => "Chiave segreta", +"Hostname (optional)" => "Nome host (opzionale)", +"Port (optional)" => "Porta (opzionale)", +"Region (optional)" => "Regione (opzionale)", +"Enable SSL" => "Abilita SSL", +"Enable Path Style" => "Abilita stile percorsi", +"App key" => "Chiave applicazione", +"App secret" => "Segreto applicazione", +"Host" => "Host", +"Username" => "Nome utente", +"Password" => "Password", +"Root" => "Radice", +"Secure ftps://" => "Sicuro ftps://", +"Client ID" => "ID client", +"Client secret" => "Segreto del client", +"OpenStack Object Storage" => "OpenStack Object Storage", +"Username (required)" => "Nome utente (richiesto)", +"Bucket (required)" => "Bucket (richiesto)", +"Region (optional for OpenStack Object Storage)" => "Regione (facoltativa per OpenStack Object Storage)", +"API Key (required for Rackspace Cloud Files)" => "Chiave API (richiesta per Rackspace Cloud Files)", +"Tenantname (required for OpenStack Object Storage)" => "Nome tenant (richiesto per OpenStack Object Storage)", +"Password (required for OpenStack Object Storage)" => "Password (richiesta per OpenStack Object Storage)", +"Service Name (required for OpenStack Object Storage)" => "Nome servizio (richiesta per OpenStack Object Storage)", +"URL of identity endpoint (required for OpenStack Object Storage)" => "URL del servizio di identità (richiesto per OpenStack Object Storage)", +"Timeout of HTTP requests in seconds (optional)" => "Tempo massimo in secondi delle richieste HTTP (opzionale)", +"Share" => "Condividi", +"SMB / CIFS using OC login" => "SMB / CIFS utilizzando le credenziali di OC", +"Username as share" => "Nome utente come condivisione", +"URL" => "URL", +"Secure https://" => "Sicuro https://", +"Remote subfolder" => "Sottocartella remota", "Access granted" => "Accesso consentito", "Error configuring Dropbox storage" => "Errore durante la configurazione dell'archivio Dropbox", "Grant access" => "Concedi l'accesso", diff --git a/apps/files_external/l10n/ja.php b/apps/files_external/l10n/ja.php index 52d66043e1947d4f948c13fd44daceb6dff868ef..b70dd2a09a45678ad49260caeab20ab87fa79a2e 100644 --- a/apps/files_external/l10n/ja.php +++ b/apps/files_external/l10n/ja.php @@ -1,16 +1,61 @@ "ローカル", +"Location" => "位置", +"Amazon S3" => "Amazon S3", +"Key" => "キー", +"Secret" => "シークレットキー", +"Bucket" => "バケット名", +"Amazon S3 and compliant" => "Amazon S3 と互換ストレージ", +"Access Key" => "アクセスキー", +"Secret Key" => "シークレットキー", +"Hostname (optional)" => "ホスト名 (オプション)", +"Port (optional)" => "ポート (オプション)", +"Region (optional)" => "リージョン (オプション)", +"Enable SSL" => "SSLを有効", +"Enable Path Style" => "パス形式を有効", +"App key" => "アプリキー", +"App secret" => "アプリシークレット", +"Host" => "ホスト", +"Username" => "ユーザー名", +"Password" => "パスワード", +"Root" => "ルート", +"Secure ftps://" => "Secure ftps://", +"Client ID" => "クライアントID", +"Client secret" => "クライアント秘密キー", +"OpenStack Object Storage" => "OpenStack Object Storage", +"Username (required)" => "ユーザー名 (必須)", +"Bucket (required)" => "バケット (必須)", +"Region (optional for OpenStack Object Storage)" => "リージョン (OpenStack Object Storage用のオプション)", +"API Key (required for Rackspace Cloud Files)" => "APIキー (Rackspace Cloud Filesに必須)", +"Tenantname (required for OpenStack Object Storage)" => "テナント名 (OpenStack Object Storage用に必要)", +"Password (required for OpenStack Object Storage)" => "パスワード (OpenStack Object Storage用に必要)", +"Service Name (required for OpenStack Object Storage)" => "サービス名 (OpenStack Object Storage用に必要)", +"URL of identity endpoint (required for OpenStack Object Storage)" => "識別用エンドポイントURL (OpenStack Object Storage用に必要)", +"Timeout of HTTP requests in seconds (optional)" => "HTTPリクエストのタイムアウト秒数 (オプション)", +"Share" => "共有", +"SMB / CIFS using OC login" => "owncloudログインで SMB/CIFSを使用", +"Username as share" => "共有名", +"URL" => "URL", +"Secure https://" => "セキュア https://", +"Remote subfolder" => "リモートサブフォルダ", "Access granted" => "アクセスは許可されました", "Error configuring Dropbox storage" => "Dropboxストレージの設定エラー", "Grant access" => "アクセスを許可", "Please provide a valid Dropbox app key and secret." => "有効なDropboxアプリのキーとパスワードを入力してください。", "Error configuring Google Drive storage" => "Googleドライブストレージの設定エラー", "Saved" => "保存されました", +"Note: " => "注意: ", +" and " => "と", +"Note: The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." => "注意: PHPにcURLのエクステンションが入っていないか、有効ではありません。%s をマウントすることができません。このシステムの管理者にインストールをお願いしてください。", +"Note: The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." => "注意: PHPにFTPのエクステンションが入っていないか、有効ではありません。%s をマウントすることができません。このシステムの管理者にインストールをお願いしてください。", +"Note: \"%s\" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it." => "注意: \"%s\" がインストールされていません。%sをマウントできません。このシステムの管理者にインストールをお願いしてください。", "External Storage" => "外部ストレージ", "Folder name" => "フォルダー名", "External storage" => "外部ストレージ", "Configuration" => "設定", "Options" => "オプション", +"Available for" => "以下が利用可能", "Add storage" => "ストレージを追加", "No user or group" => "ユーザーもしくはグループがありません", "All Users" => "すべてのユーザー", diff --git a/apps/files_external/l10n/jv.php b/apps/files_external/l10n/jv.php new file mode 100644 index 0000000000000000000000000000000000000000..acff46664ccbefbd6988207e831b9195ea2d34c2 --- /dev/null +++ b/apps/files_external/l10n/jv.php @@ -0,0 +1,5 @@ + "Papan panggonan" +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_external/l10n/ka_GE.php b/apps/files_external/l10n/ka_GE.php index d68dae88c029aa437fe274f05a1df2a3d0dbc752..a87c8b4879ad9a8d07b3646bbb84e37ca2905d9c 100644 --- a/apps/files_external/l10n/ka_GE.php +++ b/apps/files_external/l10n/ka_GE.php @@ -1,5 +1,11 @@ "ადგილმდებარეობა", +"Host" => "ჰოსტი", +"Username" => "მომხმარებლის სახელი", +"Password" => "პაროლი", +"Share" => "გაზიარება", +"URL" => "URL", "Access granted" => "დაშვება მინიჭებულია", "Error configuring Dropbox storage" => "შეცდომა Dropbox საცავის კონფიგურირების დროს", "Grant access" => "დაშვების მინიჭება", diff --git a/apps/files_external/l10n/km.php b/apps/files_external/l10n/km.php index 75879f2300e1652263d539dce01556afd4958d56..da17fac1bffdf4dd55a303920ceb3ea7a3226688 100644 --- a/apps/files_external/l10n/km.php +++ b/apps/files_external/l10n/km.php @@ -1,7 +1,22 @@ "ទីតាំង", +"Host" => "ម៉ាស៊ីន​ផ្ទុក", +"Username" => "ឈ្មោះ​អ្នកប្រើ", +"Password" => "ពាក្យសម្ងាត់", +"Share" => "ចែក​រំលែក", +"URL" => "URL", +"Access granted" => "បាន​ទទួល​សិទ្ធិ​ចូល", +"Error configuring Dropbox storage" => "កំហុស​ការ​កំណត់​សណ្ឋាន​នៃ​ឃ្លាំងផ្ទុក Dropbox", +"Grant access" => "ទទួល​សិទ្ធិ​ចូល", +"Saved" => "បាន​រក្សាទុក", +"External Storage" => "ឃ្លាំងផ្ទុក​ខាងក្រៅ", "Folder name" => "ឈ្មោះ​ថត", +"External storage" => "ឃ្លាំងផ្ទុក​ខាងក្រៅ", +"Configuration" => "ការ​កំណត់​សណ្ឋាន", "Options" => "ជម្រើស", +"Add storage" => "បន្ថែម​ឃ្លាំងផ្ទុក", +"All Users" => "អ្នក​ប្រើ​ទាំងអស់", "Groups" => "ក្រុ", "Users" => "អ្នកប្រើ", "Delete" => "លុប" diff --git a/apps/files_external/l10n/ko.php b/apps/files_external/l10n/ko.php index 371cba3e12d89cff2e45d6c596664b1cc32838f3..631f95bc7b956cbfb4ae1687e71b572f1606f64c 100644 --- a/apps/files_external/l10n/ko.php +++ b/apps/files_external/l10n/ko.php @@ -1,10 +1,18 @@ "장소", +"Amazon S3" => "Amazon S3", +"Host" => "호스트", +"Username" => "사용자 이름", +"Password" => "암호", +"Share" => "공유", +"URL" => "URL", "Access granted" => "접근 허가됨", "Error configuring Dropbox storage" => "Dropbox 저장소 설정 오류", "Grant access" => "접근 권한 부여", "Please provide a valid Dropbox app key and secret." => "올바른 Dropbox 앱 키와 암호를 입력하십시오.", "Error configuring Google Drive storage" => "Google 드라이브 저장소 설정 오류", +"Saved" => "저장됨", "External Storage" => "외부 저장소", "Folder name" => "폴더 이름", "External storage" => "외부 저장소", diff --git a/apps/files_external/l10n/ku_IQ.php b/apps/files_external/l10n/ku_IQ.php index 39778bce07238a15a01a931bba6b46475a73ce42..3d5a3dd0d3263a0311f67c3d58b7f78819bb8507 100644 --- a/apps/files_external/l10n/ku_IQ.php +++ b/apps/files_external/l10n/ku_IQ.php @@ -1,5 +1,10 @@ "شوێن", +"Username" => "ناوی به‌کارهێنه‌ر", +"Password" => "وشەی تێپەربو", +"Share" => "هاوبەشی کردن", +"URL" => "ناونیشانی به‌سته‌ر", "Folder name" => "ناوی بوخچه", "Users" => "به‌كارهێنه‌ر" ); diff --git a/apps/files_external/l10n/lb.php b/apps/files_external/l10n/lb.php index 13233bf36262761dffc5eb70baa1fc379d9c65d1..233b3f810511e3cdffcd340abab0c78011bffd57 100644 --- a/apps/files_external/l10n/lb.php +++ b/apps/files_external/l10n/lb.php @@ -1,5 +1,11 @@ "Uert", +"Host" => "Host", +"Username" => "Benotzernumm", +"Password" => "Passwuert", +"Share" => "Deelen", +"URL" => "URL", "Folder name" => "Dossiers Numm:", "Groups" => "Gruppen", "Users" => "Benotzer", diff --git a/apps/files_external/l10n/lt_LT.php b/apps/files_external/l10n/lt_LT.php index fdf1ee70136b75994f0856134adb6e2c84b9b4c3..908abcc74885a5b9acda50200df029406009d3ca 100644 --- a/apps/files_external/l10n/lt_LT.php +++ b/apps/files_external/l10n/lt_LT.php @@ -1,5 +1,11 @@ "Vieta", +"Host" => "Mazgas", +"Username" => "Prisijungimo vardas", +"Password" => "Slaptažodis", +"Share" => "Dalintis", +"URL" => "URL", "Access granted" => "Priėjimas suteiktas", "Error configuring Dropbox storage" => "Klaida nustatinėjant Dropbox talpyklą", "Grant access" => "Suteikti priėjimą", diff --git a/apps/files_external/l10n/lv.php b/apps/files_external/l10n/lv.php index e1037b503286f85687ea235cc30f18441e237cc7..5234bda7dce11d56a4f9d82674e0064c43531a2f 100644 --- a/apps/files_external/l10n/lv.php +++ b/apps/files_external/l10n/lv.php @@ -1,5 +1,11 @@ "Vieta", +"Host" => "Resursdators", +"Username" => "Lietotājvārds", +"Password" => "Parole", +"Share" => "Dalīties", +"URL" => "URL", "Access granted" => "Piešķirta pieeja", "Error configuring Dropbox storage" => "Kļūda, konfigurējot Dropbox krātuvi", "Grant access" => "Piešķirt pieeju", diff --git a/apps/files_external/l10n/mk.php b/apps/files_external/l10n/mk.php index 507c0a745593baffcf86f77088d6692f1b7fc89b..e1bf57d5b93f48711984d569c2b8447cc759dcdb 100644 --- a/apps/files_external/l10n/mk.php +++ b/apps/files_external/l10n/mk.php @@ -1,5 +1,11 @@ "Локација", +"Host" => "Домаќин", +"Username" => "Корисничко име", +"Password" => "Лозинка", +"Share" => "Сподели", +"URL" => "Адреса", "Access granted" => "Пристапот е дозволен", "Error configuring Dropbox storage" => "Грешка при конфигурација на Dropbox", "Grant access" => "Дозволи пристап", diff --git a/apps/files_external/l10n/ms_MY.php b/apps/files_external/l10n/ms_MY.php index 4e33263a8631b252528a3f09ab5f1bc1df76aa6f..e19ec499780ded8746877df7172bc0bdf7d5013b 100644 --- a/apps/files_external/l10n/ms_MY.php +++ b/apps/files_external/l10n/ms_MY.php @@ -1,5 +1,10 @@ "Lokasi", +"Username" => "Nama pengguna", +"Password" => "Kata laluan", +"Share" => "Kongsi", +"URL" => "URL", "Groups" => "Kumpulan", "Users" => "Pengguna", "Delete" => "Padam" diff --git a/apps/files_external/l10n/my_MM.php b/apps/files_external/l10n/my_MM.php index 1cbe5f0fe52b691a7f0bde497b1c5fb043ba05a0..775fa4d9885102a2d03dabb55985e63f075c93a3 100644 --- a/apps/files_external/l10n/my_MM.php +++ b/apps/files_external/l10n/my_MM.php @@ -1,5 +1,8 @@ "တည်နေရာ", +"Username" => "သုံးစွဲသူအမည်", +"Password" => "စကားဝှက်", "Users" => "သုံးစွဲသူ" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_external/l10n/nb_NO.php b/apps/files_external/l10n/nb_NO.php index 95c9b47f412c12e69f0a6b3fcd602736f4f0dca2..7897f4b3f8d812026e059510757720818d26c5eb 100644 --- a/apps/files_external/l10n/nb_NO.php +++ b/apps/files_external/l10n/nb_NO.php @@ -1,22 +1,37 @@ "Lokal", +"Location" => "Sted", +"Amazon S3" => "Amazon S3", +"Host" => "Tjener", +"Username" => "Brukernavn", +"Password" => "Passord", +"Share" => "Del", +"URL" => "URL", "Access granted" => "Tilgang innvilget", "Error configuring Dropbox storage" => "Feil ved konfigurering av Dropbox-lagring", "Grant access" => "Gi tilgang", "Please provide a valid Dropbox app key and secret." => "Vær vennlig å oppgi gyldig Dropbox appnøkkel og hemmelighet.", "Error configuring Google Drive storage" => "Feil med konfigurering av Google Drive", "Saved" => "Lagret", +"Note: " => "Notat: ", +" and " => "og", +"Note: The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." => "Merk: Støtte for cURL i PHP er ikke aktivert eller installert. Montering av %s er ikke mulig. Be systemadministratoren om å installere det.", +"Note: The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." => "Merk: FTP støtte i PHP er ikke slått på eller innstallert. Kan ikke montere %s. Ta kontakt med din systemadministrator for å installere det.", "External Storage" => "Ekstern lagring", "Folder name" => "Mappenavn", "External storage" => "Ekstern lagringsplass", "Configuration" => "Konfigurasjon", "Options" => "Innstillinger", +"Available for" => "Tilgjengelig for", "Add storage" => "Legg til lagringsplass", +"No user or group" => "Ingen bruker eller gruppe", "All Users" => "Alle brukere", "Groups" => "Grupper", "Users" => "Brukere", "Delete" => "Slett", "Enable User External Storage" => "Aktiver ekstern lagring for bruker", +"Allow users to mount the following external storage" => "Tillat brukere å montere følgende eksterne lagring", "SSL root certificates" => "SSL root-sertifikater", "Import Root Certificate" => "Importer root-sertifikat" ); diff --git a/apps/files_external/l10n/nl.php b/apps/files_external/l10n/nl.php index c055be50f8786758713dfe0965787de6231dd8a2..2bdc047e96d8c936a16fa9654c7996d84e47a67a 100644 --- a/apps/files_external/l10n/nl.php +++ b/apps/files_external/l10n/nl.php @@ -1,5 +1,44 @@ "Lokaal", +"Location" => "Locatie", +"Amazon S3" => "Amazon S3", +"Key" => "Sleutel", +"Secret" => "Geheim", +"Bucket" => "Bucket", +"Amazon S3 and compliant" => "Amazon S3 en overeenkomstig", +"Access Key" => "Access Key", +"Secret Key" => "Secret Key", +"Hostname (optional)" => "Hostname (optioneel)", +"Port (optional)" => "Poort (optioneel)", +"Region (optional)" => "Regio (optioneel)", +"Enable SSL" => "Activeren SSL", +"Enable Path Style" => "Activeren pad stijl", +"App key" => "App key", +"App secret" => "App secret", +"Host" => "Host", +"Username" => "Gebruikersnaam", +"Password" => "Wachtwoord", +"Root" => "Root", +"Secure ftps://" => "Secure ftps://", +"Client ID" => "Client ID", +"Client secret" => "Client secret", +"OpenStack Object Storage" => "OpenStack Object Storage", +"Username (required)" => "Gebruikersnaam (verplicht)", +"Bucket (required)" => "Bucket (verplicht)", +"Region (optional for OpenStack Object Storage)" => "Regio (optioneel voor OpenStack Object Storage)", +"API Key (required for Rackspace Cloud Files)" => "API Key (verplicht voor Rackspace Cloud Files)", +"Tenantname (required for OpenStack Object Storage)" => "Tenantname (Verplicht voor OpenStack Object Storage)", +"Password (required for OpenStack Object Storage)" => "Wachtwoord (verplicht voor OpenStack Object Storage)", +"Service Name (required for OpenStack Object Storage)" => "Service Name (verplicht voor OpenStack Object Storage)", +"URL of identity endpoint (required for OpenStack Object Storage)" => "URL van identity endpoint (verplicht voor OpenStack Object Storage)", +"Timeout of HTTP requests in seconds (optional)" => "Time-out van HTTP aanvragen in seconden (optioneel)", +"Share" => "Share", +"SMB / CIFS using OC login" => "SMB / CIFS via OC inlog", +"Username as share" => "Gebruikersnaam als share", +"URL" => "URL", +"Secure https://" => "Secure https://", +"Remote subfolder" => "Externe submap", "Access granted" => "Toegang toegestaan", "Error configuring Dropbox storage" => "Fout tijdens het configureren van Dropbox opslag", "Grant access" => "Sta toegang toe", diff --git a/apps/files_external/l10n/nn_NO.php b/apps/files_external/l10n/nn_NO.php index 7bb38f14cee42a817458068331022b1fef4d2af3..0ee80369eec4417ae7ffd3ab791c5f280a667f52 100644 --- a/apps/files_external/l10n/nn_NO.php +++ b/apps/files_external/l10n/nn_NO.php @@ -1,5 +1,12 @@ "Stad", +"Host" => "Tenar", +"Username" => "Brukarnamn", +"Password" => "Passord", +"Share" => "Del", +"URL" => "Nettstad", +"Folder name" => "Mappenamn", "Configuration" => "Innstillingar", "Groups" => "Grupper", "Users" => "Brukarar", diff --git a/apps/files_external/l10n/oc.php b/apps/files_external/l10n/oc.php index 99f2fd507d2b86388c61f60e17c95878940b082a..bd5c98ca0513858026a9705d16abab385707654c 100644 --- a/apps/files_external/l10n/oc.php +++ b/apps/files_external/l10n/oc.php @@ -1,5 +1,10 @@ "Plaça", +"Username" => "Non d'usancièr", +"Password" => "Senhal", +"Share" => "Parteja", +"URL" => "URL", "Groups" => "Grops", "Users" => "Usancièrs", "Delete" => "Escafa" diff --git a/apps/files_external/l10n/pa.php b/apps/files_external/l10n/pa.php index d633784f5ce17303420e1d208da83d4746395e0c..0bdcf0b7f6775ebf85e135a38f08768713d0220b 100644 --- a/apps/files_external/l10n/pa.php +++ b/apps/files_external/l10n/pa.php @@ -1,5 +1,8 @@ "ਯੂਜ਼ਰ-ਨਾਂ", +"Password" => "ਪਾਸਵਰ", +"Share" => "ਸਾਂਝਾ ਕਰੋ", "Groups" => "ਗਰੁੱਪ", "Delete" => "ਹਟਾਓ" ); diff --git a/apps/files_external/l10n/pl.php b/apps/files_external/l10n/pl.php index 246e12b6ac8f209ef596d4527e23b128ece6aa45..74d9347b606717aa837a1e0ad936f9113fb42c07 100644 --- a/apps/files_external/l10n/pl.php +++ b/apps/files_external/l10n/pl.php @@ -1,5 +1,44 @@ "Lokalny", +"Location" => "Lokalizacja", +"Amazon S3" => "Amazon S3", +"Key" => "Klucz", +"Secret" => "Hasło", +"Bucket" => "Kosz", +"Amazon S3 and compliant" => "Amazon S3 i zgodne", +"Access Key" => "Klucz dostępu", +"Secret Key" => "Klucz hasła", +"Hostname (optional)" => "Nazwa hosta (opcjonalnie)", +"Port (optional)" => "Port (opcjonalnie)", +"Region (optional)" => "Region (opcjonalnie)", +"Enable SSL" => "Włącz SSL", +"Enable Path Style" => "Włącz styl ścieżki", +"App key" => "Klucz aplikacji", +"App secret" => "Hasło aplikacji", +"Host" => "Host", +"Username" => "Nazwa użytkownika", +"Password" => "Hasło", +"Root" => "Root", +"Secure ftps://" => "Bezpieczny ftps://", +"Client ID" => "ID klienta", +"Client secret" => "Hasło klienta", +"OpenStack Object Storage" => "Magazyn obiektów OpenStack", +"Username (required)" => "Użytkownik (wymagany)", +"Bucket (required)" => "Kosz (wymagany)", +"Region (optional for OpenStack Object Storage)" => "Region (opcjonalny dla magazynu obiektów OpenStack)", +"API Key (required for Rackspace Cloud Files)" => "Klucz API (wymagany dla plików Rackspace Cloud)", +"Tenantname (required for OpenStack Object Storage)" => "Nazwa najemcy (wymagana dla magazynu obiektów OpenStack)", +"Password (required for OpenStack Object Storage)" => "Hasło (wymagane dla magazynu obiektów OpenStack)", +"Service Name (required for OpenStack Object Storage)" => "Nazwa usługi (wymagana dla magazynu obiektów OpenStack)", +"URL of identity endpoint (required for OpenStack Object Storage)" => "URL lub zakończenie jednostki (wymagane dla magazynu obiektów OpenStack)", +"Timeout of HTTP requests in seconds (optional)" => "Czas wygaśnięcia żądań HTTP w sekundach (opcjonalne)", +"Share" => "Udostępnij", +"SMB / CIFS using OC login" => "SMB / CIFS przy użyciu loginu OC", +"Username as share" => "Użytkownik jako zasób", +"URL" => "URL", +"Secure https://" => "Bezpieczny https://", +"Remote subfolder" => "Zdalny podfolder", "Access granted" => "Dostęp do", "Error configuring Dropbox storage" => "Wystąpił błąd podczas konfigurowania zasobu Dropbox", "Grant access" => "Udziel dostępu", diff --git a/apps/files_external/l10n/pt_BR.php b/apps/files_external/l10n/pt_BR.php index 9a5a39f2358595e58fe65703a3df80b49259cf3c..b027a92e50e3e170b122d566e0918f04a91eb21c 100644 --- a/apps/files_external/l10n/pt_BR.php +++ b/apps/files_external/l10n/pt_BR.php @@ -1,5 +1,44 @@ "Local", +"Location" => "Local", +"Amazon S3" => "Amazon S3", +"Key" => "Chave", +"Secret" => "Secreta", +"Bucket" => "Cesta", +"Amazon S3 and compliant" => "Amazon S3 e compatível", +"Access Key" => "Chave de Acesso", +"Secret Key" => "Chave Secreta", +"Hostname (optional)" => "Nome do Host (opcional)", +"Port (optional)" => "Porta (opcional)", +"Region (optional)" => "Região (opcional)", +"Enable SSL" => "Habilitar SSL", +"Enable Path Style" => "Habilitar Estilo do Caminho", +"App key" => "Chave do Aplicativo", +"App secret" => "Segredo da Aplicação", +"Host" => "Servidor", +"Username" => "Nome de Usuário", +"Password" => "Senha", +"Root" => "Raiz", +"Secure ftps://" => "Seguro ftps://", +"Client ID" => "ID do Cliente", +"Client secret" => "Segredo do cliente", +"OpenStack Object Storage" => "Armazenamento de Objetos OpenStack", +"Username (required)" => "Nome do Usuário (requerido)", +"Bucket (required)" => "Cesta (requerido)", +"Region (optional for OpenStack Object Storage)" => "Região (opcional para armazenamento de objetos OpenStack)", +"API Key (required for Rackspace Cloud Files)" => "Chave API (necessário para Rackspace Cloud File)", +"Tenantname (required for OpenStack Object Storage)" => "Nome Tenant (necessário para armazenamento de objetos OpenStack)", +"Password (required for OpenStack Object Storage)" => "Senha (necessário para armazenamento de objetos OpenStack)", +"Service Name (required for OpenStack Object Storage)" => "Nome do Serviço (necessário para armazenamento de objetos OpenStack)", +"URL of identity endpoint (required for OpenStack Object Storage)" => "Ponto final de identidade da URL (obrigatório para armazenamento de objetos OpenStack)", +"Timeout of HTTP requests in seconds (optional)" => "Tempo limite de solicitações HTTP em segundos (opcional)", +"Share" => "Compartilhar", +"SMB / CIFS using OC login" => "SMB / CIFS usando OC logon", +"Username as share" => "Nome de usuário como compartilhado", +"URL" => "URL", +"Secure https://" => "https:// segura", +"Remote subfolder" => "Subpasta remota", "Access granted" => "Acesso concedido", "Error configuring Dropbox storage" => "Erro ao configurar armazenamento do Dropbox", "Grant access" => "Permitir acesso", diff --git a/apps/files_external/l10n/pt_PT.php b/apps/files_external/l10n/pt_PT.php index d0b70006ea1a0d1b85c5ea891432e9b1daccd13b..2daa72715bad405d5fcbb2983ee607bc61dd0a01 100644 --- a/apps/files_external/l10n/pt_PT.php +++ b/apps/files_external/l10n/pt_PT.php @@ -1,17 +1,46 @@ "Local", +"Location" => "Local", +"Amazon S3" => "Amazon S3", +"Key" => "Chave", +"Secret" => "Secreto", +"Access Key" => "Chave de acesso", +"Secret Key" => "Chave Secreta", +"Port (optional)" => "Porta (opcional)", +"Region (optional)" => "Região (opcional)", +"Enable SSL" => "Activar SSL", +"App key" => "Chave da aplicação", +"App secret" => "Chave secreta da aplicação", +"Host" => "Endereço", +"Username" => "Nome de utilizador", +"Password" => "Palavra-passe", +"Root" => "Raiz", +"Client ID" => "ID Cliente", +"Client secret" => "Segredo do cliente", +"Username (required)" => "Utilizador (requerido)", +"Share" => "Partilhar", +"URL" => "URL", +"Remote subfolder" => "Sub-pasta remota ", "Access granted" => "Acesso autorizado", "Error configuring Dropbox storage" => "Erro ao configurar o armazenamento do Dropbox", "Grant access" => "Conceder acesso", "Please provide a valid Dropbox app key and secret." => "Por favor forneça uma \"app key\" e \"secret\" do Dropbox válidas.", "Error configuring Google Drive storage" => "Erro ao configurar o armazenamento do Google Drive", "Saved" => "Guardado", +"Note: " => "Aviso: ", +" and " => "e", +"Note: The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." => "Aviso: O suporte cURL no PHP não está activo ou instalado. Não é possível montar %s. Peça ao seu administrador para instalar.", +"Note: The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." => "Aviso: O suporte FTP no PHP não está activo ou instalado. Não é possível montar %s. Peça ao seu administrador para instalar.", +"Note: \"%s\" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it." => "Aviso: O cliente\"%s\" não está instalado. Não é possível montar \"%s\" . Peça ao seu administrador para instalar.", "External Storage" => "Armazenamento Externo", "Folder name" => "Nome da pasta", "External storage" => "Armazenamento Externo", "Configuration" => "Configuração", "Options" => "Opções", +"Available for" => "Disponível para ", "Add storage" => "Adicionar armazenamento", +"No user or group" => "Sem utilizador nem grupo", "All Users" => "Todos os utilizadores", "Groups" => "Grupos", "Users" => "Utilizadores", diff --git a/apps/files_external/l10n/ro.php b/apps/files_external/l10n/ro.php index 3fc56c67d333fffbbd9dc8af7c649baa22119dc5..d5e1e90c54aeb1c9d829ce31e21c3d9030d1e2aa 100644 --- a/apps/files_external/l10n/ro.php +++ b/apps/files_external/l10n/ro.php @@ -1,5 +1,11 @@ "Locație", +"Host" => "Gazdă", +"Username" => "Nume utilizator", +"Password" => "Parolă", +"Share" => "Partajează", +"URL" => "URL", "Access granted" => "Acces permis", "Error configuring Dropbox storage" => "Eroare la configurarea mediului de stocare Dropbox", "Grant access" => "Permite accesul", diff --git a/apps/files_external/l10n/ru.php b/apps/files_external/l10n/ru.php index f282f3969e5654e26e84c97c030944d5affe0eac..6aded8e9a31d2ac1c57cbcf67cc6e7c086d4a1f0 100644 --- a/apps/files_external/l10n/ru.php +++ b/apps/files_external/l10n/ru.php @@ -1,5 +1,12 @@ "Локально", +"Location" => "Местоположение", +"Host" => "Сервер", +"Username" => "Имя пользователя", +"Password" => "Пароль", +"Share" => "Открыть доступ", +"URL" => "Ссылка", "Access granted" => "Доступ предоставлен", "Error configuring Dropbox storage" => "Ошибка при настройке хранилища Dropbox", "Grant access" => "Предоставление доступа", diff --git a/apps/files_external/l10n/si_LK.php b/apps/files_external/l10n/si_LK.php index a9f39a3bbc959d7b1dbe48d3cff9a7f50fdbe374..960ededaa6378032c2dbd3c4772c321590658a73 100644 --- a/apps/files_external/l10n/si_LK.php +++ b/apps/files_external/l10n/si_LK.php @@ -1,5 +1,11 @@ "ස්ථානය", +"Host" => "සත්කාරකය", +"Username" => "පරිශීලක නම", +"Password" => "මුර පදය", +"Share" => "බෙදා හදා ගන්න", +"URL" => "URL", "Access granted" => "පිවිසීමට හැක", "Error configuring Dropbox storage" => "Dropbox ගබඩාව වින්‍යාස කිරීමේ දෝශයක් ඇත", "Grant access" => "පිවිසුම ලබාදෙන්න", diff --git a/apps/files_external/l10n/sk.php b/apps/files_external/l10n/sk.php index 3129cf5c411c867008748908c2c8c614f32d5a4c..03dcc93e7c3aa0b3712138dd3bbf90e515cbca9e 100644 --- a/apps/files_external/l10n/sk.php +++ b/apps/files_external/l10n/sk.php @@ -1,5 +1,7 @@ "Poloha", +"Share" => "Zdieľať", "Delete" => "Odstrániť" ); $PLURAL_FORMS = "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"; diff --git a/apps/files_external/l10n/sk_SK.php b/apps/files_external/l10n/sk_SK.php index 96f6241e5fb693e4cb878358e7589d6c26c156eb..f576d92cdac60b2d00d5dd94eaf079e1f738f627 100644 --- a/apps/files_external/l10n/sk_SK.php +++ b/apps/files_external/l10n/sk_SK.php @@ -1,5 +1,12 @@ "Lokálny", +"Location" => "Umiestnenie", +"Host" => "Hostiteľ", +"Username" => "Používateľské meno", +"Password" => "Heslo", +"Share" => "Zdieľať", +"URL" => "URL", "Access granted" => "Prístup povolený", "Error configuring Dropbox storage" => "Chyba pri konfigurácii úložiska Dropbox", "Grant access" => "Povoliť prístup", diff --git a/apps/files_external/l10n/sl.php b/apps/files_external/l10n/sl.php index baab272d1d2d9888b74cf1981d0b62c300d26b68..c47e962b6e864c33771f62e4d0854caea94a0ba5 100644 --- a/apps/files_external/l10n/sl.php +++ b/apps/files_external/l10n/sl.php @@ -1,5 +1,34 @@ "Krajevno", +"Location" => "Mesto", +"Amazon S3" => "Amazon S3", +"Key" => "Ključ", +"Secret" => "Skrivni ključ", +"Amazon S3 and compliant" => "Amazon S3 in podobno", +"Access Key" => "Ključ za dostop", +"Secret Key" => "Skrivni ključ", +"Hostname (optional)" => "Ime gostitelja (izbirno)", +"Port (optional)" => "Vrata (izbirno)", +"Region (optional)" => "Območje (izbirno)", +"Enable SSL" => "Omogoči SSL", +"Enable Path Style" => "Omogoči slog poti", +"App key" => "Programski ključ", +"App secret" => "Skrivni programski ključ", +"Host" => "Gostitelj", +"Username" => "Uporabniško ime", +"Password" => "Geslo", +"Root" => "Koren", +"Secure ftps://" => "Varni način ftps://", +"Client ID" => "ID odjemalca", +"Client secret" => "Skrivni ključ odjemalca", +"Username (required)" => "Uporabniško ime (zahtevano)", +"Share" => "Souporaba", +"SMB / CIFS using OC login" => "SMB / CIFS z uporabo prijave OC", +"Username as share" => "Uporabniško ime za souporabo", +"URL" => "Naslov URL", +"Secure https://" => "Varni način https://", +"Remote subfolder" => "Oddaljena podrejena mapa", "Access granted" => "Dostop je odobren", "Error configuring Dropbox storage" => "Napaka nastavljanja shrambe Dropbox", "Grant access" => "Odobri dostop", diff --git a/apps/files_external/l10n/sq.php b/apps/files_external/l10n/sq.php index 328822dcde862be05de0b79dbc08b02413d2b043..1904514fdc4791e70bef38a1e834ec200f6198c2 100644 --- a/apps/files_external/l10n/sq.php +++ b/apps/files_external/l10n/sq.php @@ -1,5 +1,11 @@ "Vendndodhja", +"Host" => "Pritësi", +"Username" => "Përdoruesi", +"Password" => "fjalëkalim", +"Share" => "Ndaj", +"URL" => "URL-i", "Groups" => "Grupet", "Users" => "Përdoruesit", "Delete" => "Elimino" diff --git a/apps/files_external/l10n/sr.php b/apps/files_external/l10n/sr.php index c456daa004db0dcd52418dd33b016015a99698cf..bf150f5b5b0fb4472a9e9c67ed5bbae1f833f4ee 100644 --- a/apps/files_external/l10n/sr.php +++ b/apps/files_external/l10n/sr.php @@ -1,5 +1,10 @@ "Локација", +"Host" => "Домаћин", +"Username" => "Корисничко име", +"Password" => "Лозинка", +"Share" => "Дели", "Groups" => "Групе", "Users" => "Корисници", "Delete" => "Обриши" diff --git a/apps/files_external/l10n/sr@latin.php b/apps/files_external/l10n/sr@latin.php index a2489bbc64b7db27bb2e2644bc785bc5ace4630a..2f17617c116f2b92b6c5045c1d4899c1d6130059 100644 --- a/apps/files_external/l10n/sr@latin.php +++ b/apps/files_external/l10n/sr@latin.php @@ -1,5 +1,9 @@ "Lokacija", +"Username" => "Korisničko ime", +"Password" => "Lozinka", +"Share" => "Podeli", "Groups" => "Grupe", "Users" => "Korisnici", "Delete" => "Obriši" diff --git a/apps/files_external/l10n/sv.php b/apps/files_external/l10n/sv.php index 761e8f880c1c121dd745ac3f9ae23c3b1f8d3f35..a1c2a7cabead9ed168b9b8516be4905323f1ef69 100644 --- a/apps/files_external/l10n/sv.php +++ b/apps/files_external/l10n/sv.php @@ -1,5 +1,19 @@ "Lokal", +"Location" => "Plats", +"Amazon S3" => "Amazon S3", +"Key" => "Nyckel", +"Secret" => "Hemlig", +"Enable SSL" => "Aktivera SSL", +"Host" => "Server", +"Username" => "Användarnamn", +"Password" => "Lösenord", +"Root" => "Root", +"Secure ftps://" => "Säker ftps://", +"Share" => "Dela", +"URL" => "URL", +"Secure https://" => "Säker https://", "Access granted" => "Åtkomst beviljad", "Error configuring Dropbox storage" => "Fel vid konfigurering av Dropbox", "Grant access" => "Bevilja åtkomst", diff --git a/apps/files_external/l10n/ta_LK.php b/apps/files_external/l10n/ta_LK.php index fe5d2a8bc87df467d046e9604e0d7b840fe368f3..a94b7417ff5ea1cff26aa138edc6a1a930622a57 100644 --- a/apps/files_external/l10n/ta_LK.php +++ b/apps/files_external/l10n/ta_LK.php @@ -1,5 +1,11 @@ "இடம்", +"Host" => "ஓம்புனர்", +"Username" => "பயனாளர் பெயர்", +"Password" => "கடவுச்சொல்", +"Share" => "பகிர்வு", +"URL" => "URL", "Access granted" => "அனுமதி வழங்கப்பட்டது", "Error configuring Dropbox storage" => "Dropbox சேமிப்பை தகவமைப்பதில் வழு", "Grant access" => "அனுமதியை வழங்கல்", diff --git a/apps/files_external/l10n/te.php b/apps/files_external/l10n/te.php index 7f8d893d46382d80d7c621bcd1ae161d70e65cc7..ee902788a307bfe6e92cf9769dd15424689b1544 100644 --- a/apps/files_external/l10n/te.php +++ b/apps/files_external/l10n/te.php @@ -1,5 +1,7 @@ "వాడుకరి పేరు", +"Password" => "సంకేతపదం", "Folder name" => "సంచయం పేరు", "Users" => "వాడుకరులు", "Delete" => "తొలగించు" diff --git a/apps/files_external/l10n/th_TH.php b/apps/files_external/l10n/th_TH.php index e3653eb41f7acdd3c47f24e0de136f43133e16c8..9f393a2546f46dd9878d1fe55433a9c9f4801735 100644 --- a/apps/files_external/l10n/th_TH.php +++ b/apps/files_external/l10n/th_TH.php @@ -1,5 +1,11 @@ "ตำแหน่งที่อยู่", +"Host" => "โฮสต์", +"Username" => "ชื่อผู้ใช้งาน", +"Password" => "รหัสผ่าน", +"Share" => "แชร์", +"URL" => "URL", "Access granted" => "การเข้าถึงได้รับอนุญาตแล้ว", "Error configuring Dropbox storage" => "เกิดข้อผิดพลาดในการกำหนดค่าพื้นที่จัดเก็บข้อมูล Dropbox", "Grant access" => "อนุญาตให้เข้าถึงได้", diff --git a/apps/files_external/l10n/tr.php b/apps/files_external/l10n/tr.php index 3646a47605d5ea0c371e30c8ebdc1bcd45d15c13..5af8813e675ddd432a73e48bc0133c97a99d1385 100644 --- a/apps/files_external/l10n/tr.php +++ b/apps/files_external/l10n/tr.php @@ -1,5 +1,44 @@ "Yerel", +"Location" => "Konum", +"Amazon S3" => "Amazon S3", +"Key" => "Anahtar", +"Secret" => "Parola", +"Bucket" => "Bucket", +"Amazon S3 and compliant" => "Amazon S3 ve uyumlu olanlar", +"Access Key" => "Erişim Anahtarı", +"Secret Key" => "Gizli Anahtar", +"Hostname (optional)" => "Makine Adı (isteğe bağlı)", +"Port (optional)" => "Bağl. Nok. (isteğe bağlı)", +"Region (optional)" => "Bölge (isteğe bağlı)", +"Enable SSL" => "SSL'yi Etkinleştir", +"Enable Path Style" => "Yol Biçemini Etkinleştir", +"App key" => "Uyg. anahtarı", +"App secret" => "Uyg. parolası", +"Host" => "Sunucu", +"Username" => "Kullanıcı Adı:", +"Password" => "Parola:", +"Root" => "Kök", +"Secure ftps://" => "Güvenli ftps://", +"Client ID" => "İstemci Kimliğ", +"Client secret" => "İstemci parolası", +"OpenStack Object Storage" => "OpenStack Nesne Depolama", +"Username (required)" => "Kullanıcı adı (gerekli)", +"Bucket (required)" => "Bucket (gerekli)", +"Region (optional for OpenStack Object Storage)" => "Bölge (OpenStack Nesne Depolaması için isteğe bağlı)", +"API Key (required for Rackspace Cloud Files)" => "API Anahtarı (Rackspace Bulut Dosyaları için gerekli)", +"Tenantname (required for OpenStack Object Storage)" => "Kiracı Adı (OpenStack Nesne Depolaması için gerekli)", +"Password (required for OpenStack Object Storage)" => "Parola (OpenStack Nesne Depolaması için gerekli)", +"Service Name (required for OpenStack Object Storage)" => "Hizmet Adı (OpenStack Nesne Depolaması için gerekli)", +"URL of identity endpoint (required for OpenStack Object Storage)" => "Kimlik uç nokta adresi (OpenStack Nesne Depolaması için gerekli)", +"Timeout of HTTP requests in seconds (optional)" => "Saniye cinsinden HTTP istek zaman aşımı (isteğe bağlı)", +"Share" => "Paylaş", +"SMB / CIFS using OC login" => "OC oturumu kullanarak SMB / CIFS", +"Username as share" => "Paylaşım olarak kullanıcı adı", +"URL" => "URL", +"Secure https://" => "Güvenli https://", +"Remote subfolder" => "Uzak alt klasör", "Access granted" => "Giriş kabul edildi", "Error configuring Dropbox storage" => "Dropbox depo yapılandırma hatası", "Grant access" => "Erişim sağlandı", diff --git a/apps/files_external/l10n/ug.php b/apps/files_external/l10n/ug.php index ae20f7424da7e96e56d7547f07d1aec42e948b16..701a5457ae2e762cfcd946841903f63dcbd2e755 100644 --- a/apps/files_external/l10n/ug.php +++ b/apps/files_external/l10n/ug.php @@ -1,5 +1,11 @@ "ئورنى", +"Host" => "باش ئاپپارات", +"Username" => "ئىشلەتكۈچى ئاتى", +"Password" => "ئىم", +"Share" => "ھەمبەھىر", +"URL" => "URL", "Folder name" => "قىسقۇچ ئاتى", "External storage" => "سىرتقى ساقلىغۇچ", "Configuration" => "سەپلىمە", diff --git a/apps/files_external/l10n/uk.php b/apps/files_external/l10n/uk.php index 533eba07eb1ccc449406af431ef92d6b81ba97c1..aea352a6863ee2f9df79a1c9bff96bc834b77393 100644 --- a/apps/files_external/l10n/uk.php +++ b/apps/files_external/l10n/uk.php @@ -1,5 +1,11 @@ "Місце", +"Host" => "Хост", +"Username" => "Ім'я користувача", +"Password" => "Пароль", +"Share" => "Поділитися", +"URL" => "URL", "Access granted" => "Доступ дозволено", "Error configuring Dropbox storage" => "Помилка при налаштуванні сховища Dropbox", "Grant access" => "Дозволити доступ", diff --git a/apps/files_external/l10n/ur_PK.php b/apps/files_external/l10n/ur_PK.php index 56df17991bcf1d655b943a3906474043e1ba1047..5d4695b5115839d356d3c4d51d123b6abeb5a098 100644 --- a/apps/files_external/l10n/ur_PK.php +++ b/apps/files_external/l10n/ur_PK.php @@ -1,5 +1,11 @@ "یوزرز" +"Location" => "مقام", +"Username" => "یوزر نیم", +"Password" => "پاسورڈ", +"Share" => "تقسیم", +"URL" => "یو ار ایل", +"Users" => "یوزرز", +"Delete" => "حذف کریں" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_external/l10n/vi.php b/apps/files_external/l10n/vi.php index 787fc82832e7fa33c3a1e065914792b7b94cdb36..03d50bc1433c740fff815b158be6abdc9cb0104b 100644 --- a/apps/files_external/l10n/vi.php +++ b/apps/files_external/l10n/vi.php @@ -1,5 +1,11 @@ "Vị trí", +"Host" => "Máy chủ", +"Username" => "Tên đăng nhập", +"Password" => "Mật khẩu", +"Share" => "Chia sẻ", +"URL" => "URL", "Access granted" => "Đã cấp quyền truy cập", "Error configuring Dropbox storage" => "Lỗi cấu hình lưu trữ Dropbox ", "Grant access" => "Cấp quyền truy cập", diff --git a/apps/files_external/l10n/zh_CN.php b/apps/files_external/l10n/zh_CN.php index 40d5158bf5c9a0436cb6106d4f468fab08ebfaa5..95e9c0e643eb6885bf81ced9f8063825154fe57d 100644 --- a/apps/files_external/l10n/zh_CN.php +++ b/apps/files_external/l10n/zh_CN.php @@ -1,21 +1,45 @@ "本地", +"Location" => "地点", +"Amazon S3" => "Amazon S3", +"Access Key" => "访问密钥", +"Hostname (optional)" => "域名 (可选)", +"Port (optional)" => "端口 (可选)", +"Region (optional)" => "区域 (optional)", +"Enable SSL" => "启用 SSL", +"Host" => "主机", +"Username" => "用户名", +"Password" => "密码", +"Root" => "根路径", +"Secure ftps://" => "安全 ftps://", +"Share" => "共享", +"SMB / CIFS using OC login" => "SMB / CIFS 使用 OC 登录信息", +"URL" => "URL", +"Secure https://" => "安全 https://", +"Remote subfolder" => "远程子文件夹", "Access granted" => "权限已授予。", "Error configuring Dropbox storage" => "配置Dropbox存储时出错", "Grant access" => "授权", "Please provide a valid Dropbox app key and secret." => "请提供有效的Dropbox应用key和secret", "Error configuring Google Drive storage" => "配置Google Drive存储时出错", +"Saved" => "已保存", +"Note: " => "注意:", +" and " => "和", "External Storage" => "外部存储", "Folder name" => "目录名称", "External storage" => "外部存储", "Configuration" => "配置", "Options" => "选项", +"Available for" => "可用于", "Add storage" => "添加存储", +"No user or group" => "无用户或组", "All Users" => "所有用户", "Groups" => "组", "Users" => "用户", "Delete" => "删除", "Enable User External Storage" => "启用用户外部存储", +"Allow users to mount the following external storage" => "允许用户挂载以下外部存储", "SSL root certificates" => "SSL根证书", "Import Root Certificate" => "导入根证书" ); diff --git a/apps/files_external/l10n/zh_HK.php b/apps/files_external/l10n/zh_HK.php index 7a6c4765f96f6eaf655e8676952cec44840dd67f..5a1544694872fd48c9006289b4b47a7910acf7fe 100644 --- a/apps/files_external/l10n/zh_HK.php +++ b/apps/files_external/l10n/zh_HK.php @@ -1,5 +1,9 @@ "用戶名稱", +"Password" => "密碼", +"Share" => "分享", +"URL" => "網址", "Folder name" => "資料夾名稱", "Groups" => "群組", "Users" => "用戶", diff --git a/apps/files_external/l10n/zh_TW.php b/apps/files_external/l10n/zh_TW.php index 9a99a12aaaf67df747e146665a7ec4de0e6eef8e..154009f7a18306c4ab6fa65baa975898364c86ad 100644 --- a/apps/files_external/l10n/zh_TW.php +++ b/apps/files_external/l10n/zh_TW.php @@ -1,5 +1,12 @@ "本地", +"Location" => "地點", +"Host" => "主機", +"Username" => "使用者名稱:", +"Password" => "密碼", +"Share" => "分享", +"URL" => "URL", "Access granted" => "允許存取", "Error configuring Dropbox storage" => "設定 Dropbox 儲存時發生錯誤", "Grant access" => "允許存取", diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php index 2093fb7e58cf7aadf249db84cc9614fb904d4cb8..7ff17f0e98a3f371d7a0d823f931966fe54af6bb 100644 --- a/apps/files_external/lib/amazons3.php +++ b/apps/files_external/lib/amazons3.php @@ -25,7 +25,7 @@ namespace OC\Files\Storage; set_include_path(get_include_path() . PATH_SEPARATOR . - \OC_App::getAppPath('files_external') . '/3rdparty/aws-sdk-php'); + \OC_App::getAppPath('files_external') . '/3rdparty/aws-sdk-php'); require 'aws-autoloader.php'; use Aws\S3\S3Client; diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index 99eca2f38cfc8a0a8868a6434eadb4c28b8d5b4d..7a651239cb48ae2609dba0b72b4a0718bdd50800 100755 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -132,7 +132,7 @@ class OC_Mount_Config { } // Load system mount points - $mountConfig = self::readData(false); + $mountConfig = self::readData(); if (isset($mountConfig[self::MOUNT_TYPE_GLOBAL])) { foreach ($mountConfig[self::MOUNT_TYPE_GLOBAL] as $mountPoint => $options) { $options['options'] = self::decryptPasswords($options['options']); @@ -169,7 +169,7 @@ class OC_Mount_Config { } // Load personal mount points - $mountConfig = self::readData(true); + $mountConfig = self::readData($user); if (isset($mountConfig[self::MOUNT_TYPE_USER][$user])) { foreach ($mountConfig[self::MOUNT_TYPE_USER][$user] as $mountPoint => $options) { $options['options'] = self::decryptPasswords($options['options']); @@ -233,7 +233,7 @@ class OC_Mount_Config { * @return array */ public static function getSystemMountPoints() { - $mountPoints = self::readData(false); + $mountPoints = self::readData(); $backends = self::getBackends(); $system = array(); if (isset($mountPoints[self::MOUNT_TYPE_GROUP])) { @@ -306,7 +306,7 @@ class OC_Mount_Config { * @return array */ public static function getPersonalMountPoints() { - $mountPoints = self::readData(true); + $mountPoints = self::readData(OCP\User::getUser()); $backEnds = self::getBackends(); $uid = OCP\User::getUser(); $personal = array(); @@ -359,10 +359,10 @@ class OC_Mount_Config { * Add a mount point to the filesystem * @param string $mountPoint Mount point * @param string $class Backend class - * @param array Backend parameters for the class + * @param array $classOptions Backend parameters for the class * @param string $mountType MOUNT_TYPE_GROUP | MOUNT_TYPE_USER * @param string $applicable User or group to apply mount to - * @param bool Personal or system mount point i.e. is this being called from the personal or admin page + * @param bool $isPersonal Personal or system mount point i.e. is this being called from the personal or admin page * @return boolean */ public static function addMountPoint($mountPoint, @@ -400,28 +400,20 @@ class OC_Mount_Config { 'options' => self::encryptPasswords($classOptions)) ) ); - $mountPoints = self::readData($isPersonal); - // Merge the new mount point into the current mount points - if (isset($mountPoints[$mountType])) { - if (isset($mountPoints[$mountType][$applicable])) { - $mountPoints[$mountType][$applicable] - = array_merge($mountPoints[$mountType][$applicable], $mount[$applicable]); - } else { - $mountPoints[$mountType] = array_merge($mountPoints[$mountType], $mount); - } - } else { - $mountPoints[$mountType] = $mount; - } - self::writeData($isPersonal, $mountPoints); + + $mountPoints = self::readData($isPersonal ? OCP\User::getUser() : NULL); + $mountPoints = self::mergeMountPoints($mountPoints, $mount, $mountType); + self::writeData($isPersonal ? OCP\User::getUser() : NULL, $mountPoints); + return self::getBackendStatus($class, $classOptions, $isPersonal); } /** * - * @param string Mount point - * @param string MOUNT_TYPE_GROUP | MOUNT_TYPE_USER - * @param string User or group to remove mount from - * @param bool Personal or system mount point + * @param string $mountPoint Mount point + * @param string $mountType MOUNT_TYPE_GROUP | MOUNT_TYPE_USER + * @param string $applicable User or group to remove mount from + * @param bool $isPersonal Personal or system mount point * @return bool */ public static function removeMountPoint($mountPoint, $mountType, $applicable, $isPersonal = false) { @@ -434,7 +426,7 @@ class OC_Mount_Config { } else { $mountPoint = '/$user/files/'.ltrim($mountPoint, '/'); } - $mountPoints = self::readData($isPersonal); + $mountPoints = self::readData($isPersonal ? OCP\User::getUser() : NULL); // Remove mount point unset($mountPoints[$mountType][$applicable][$mountPoint]); // Unset parent arrays if empty @@ -444,20 +436,20 @@ class OC_Mount_Config { unset($mountPoints[$mountType]); } } - self::writeData($isPersonal, $mountPoints); + self::writeData($isPersonal ? OCP\User::getUser() : NULL, $mountPoints); return true; } /** * Read the mount points in the config file into an array - * @param boolean $isPersonal Personal or system config file + * @param string|null $user If not null, personal for $user, otherwise system * @return array */ - private static function readData($isPersonal) { + private static function readData($user = NULL) { $parser = new \OC\ArrayParser(); - if ($isPersonal) { - $phpFile = OC_User::getHome(OCP\User::getUser()).'/mount.php'; - $jsonFile = OC_User::getHome(OCP\User::getUser()).'/mount.json'; + if (isset($user)) { + $phpFile = OC_User::getHome($user).'/mount.php'; + $jsonFile = OC_User::getHome($user).'/mount.json'; } else { $phpFile = OC::$SERVERROOT.'/config/mount.php'; $datadir = \OC_Config::getValue('datadirectory', \OC::$SERVERROOT . '/data/'); @@ -479,13 +471,12 @@ class OC_Mount_Config { /** * Write the mount points to the config file - * @param bool Personal or system config file - * @param array Mount points - * @param boolean $isPersonal + * @param string|null $user If not null, personal for $user, otherwise system + * @param array $data Mount points */ - private static function writeData($isPersonal, $data) { - if ($isPersonal) { - $file = OC_User::getHome(OCP\User::getUser()).'/mount.json'; + private static function writeData($user, $data) { + if (isset($user)) { + $file = OC_User::getHome($user).'/mount.json'; } else { $datadir = \OC_Config::getValue('datadirectory', \OC::$SERVERROOT . '/data/'); $file = \OC_Config::getValue('mount_file', $datadir . '/mount.json'); @@ -619,9 +610,9 @@ class OC_Mount_Config { /** * Returns a dependency missing message - * @param $l OC_L10N - * @param $module string - * @param $backend string + * @param OC_L10N $l + * @param string $module + * @param string $backend * @return string */ private static function getSingleDependencyMessage($l, $module, $backend) { @@ -667,7 +658,7 @@ class OC_Mount_Config { /** * Encrypt a single password * @param string $password plain text password - * @return encrypted password + * @return string encrypted password */ private static function encryptPassword($password) { $cipher = self::getCipher(); @@ -679,7 +670,7 @@ class OC_Mount_Config { /** * Decrypts a single password * @param string $encryptedPassword encrypted password - * @return plain text password + * @return string plain text password */ private static function decryptPassword($encryptedPassword) { $cipher = self::getCipher(); @@ -690,6 +681,28 @@ class OC_Mount_Config { return $cipher->decrypt($binaryPassword); } + /** + * Merges mount points + * @param array $data Existing mount points + * @param array $mountPoint New mount point + * @param string $mountType + * @return array + */ + private static function mergeMountPoints($data, $mountPoint, $mountType) { + $applicable = key($mountPoint); + if (isset($data[$mountType])) { + if (isset($data[$mountType][$applicable])) { + $data[$mountType][$applicable] + = array_merge($data[$mountType][$applicable], $mountPoint[$applicable]); + } else { + $data[$mountType] = array_merge($data[$mountType], $mountPoint); + } + } else { + $data[$mountType] = $mountPoint; + } + return $data; + } + /** * Returns the encryption cipher */ diff --git a/apps/files_external/lib/dropbox.php b/apps/files_external/lib/dropbox.php index 38de3360f2b40c348427e5c15a04774ebd67a33f..0b624b27176959937d5b6023ca453ecdc71118fe 100755 --- a/apps/files_external/lib/dropbox.php +++ b/apps/files_external/lib/dropbox.php @@ -63,10 +63,10 @@ class Dropbox extends \OC\Files\Storage\Common { } /** - * @brief Returns the path's metadata + * Returns the path's metadata * @param string $path path for which to return the metadata - * @param $list if true, also return the directory's contents - * @return directory contents if $list is true, file metadata if $list is + * @param bool $list if true, also return the directory's contents + * @return mixed directory contents if $list is true, file metadata if $list is * false, null if the file doesn't exist or "false" if the operation failed */ private function getMetaData($path, $list = false) { diff --git a/apps/files_external/lib/ftp.php b/apps/files_external/lib/ftp.php index b3f8b1444ae5d599de0ba504f8d2689adde0ca81..2650a94f85ef33656f7ae68f59a9609ff65954b9 100644 --- a/apps/files_external/lib/ftp.php +++ b/apps/files_external/lib/ftp.php @@ -64,7 +64,7 @@ class FTP extends \OC\Files\Storage\StreamWrapper{ /** * Unlinks file or directory - * @param string @path + * @param string $path */ public function unlink($path) { if ($this->is_dir($path)) { diff --git a/apps/files_external/lib/irods.php b/apps/files_external/lib/irods.php deleted file mode 100644 index 7a7e900fbf0dd43f453540e0fd4041fb154ce219..0000000000000000000000000000000000000000 --- a/apps/files_external/lib/irods.php +++ /dev/null @@ -1,155 +0,0 @@ - - * This file is licensed under the Affero General Public License version 3 or - * later. - * See the COPYING-README file. - */ - -namespace OC\Files\Storage; - -set_include_path(get_include_path() . PATH_SEPARATOR . - \OC_App::getAppPath('files_external') . '/3rdparty/irodsphp/prods/src'); - -ob_start(); -require_once 'ProdsConfig.inc.php'; -require_once 'ProdsStreamer.class.php'; -ob_end_clean(); - -class iRODS extends \OC\Files\Storage\StreamWrapper{ - private $password; - private $user; - private $host; - private $port; - private $zone; - private $root; - private $use_logon_credentials; - private $auth_mode; - - public function __construct($params) { - if (isset($params['host'])) { - $this->host = $params['host']; - $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'] : ''; - - $this->root = isset($params['root']) ? $params['root'] : '/'; - if ( ! $this->root || $this->root[0] !== '/') { - $this->root='/'.$this->root; - } - - // take user and password from the session - if ($this->use_logon_credentials && \OC::$session->exists('irods-credentials')) - { - $params = \OC::$session->get('irods-credentials'); - $this->user = $params['uid']; - $this->password = $params['password']; - } - - //create the root folder if necessary - if ( ! $this->is_dir('')) { - $this->mkdir(''); - } - } else { - throw new \Exception(); - } - - } - - public static function login( $params ) { - \OC::$session->set('irods-credentials', $params); - } - - public function getId(){ - return 'irods::' . $this->user . '@' . $this->host . '/' . $this->root; - } - - /** - * construct the rods url - * @param string $path - * @return string - */ - public function constructUrl($path) { - $path = rtrim($path,'/'); - if ( $path === '' || $path[0] !== '/') { - $path = '/'.$path; - } - - // adding auth method - $userWithZone = $this->user.'.'.$this->zone; - if ($this->auth_mode !== '') { - $userWithZone .= '.'.$this->auth_mode; - } - - // url wrapper schema is named rods - return 'rods://'.$userWithZone.':'.$this->password.'@'.$this->host.':'.$this->port.$this->root.$path; - } - - public function filetype($path) { - return @filetype($this->constructUrl($path)); - } - - public function mkdir($path) { - return @mkdir($this->constructUrl($path)); - } - - public function touch($path, $mtime=null) { - - // we cannot set a time - if ($mtime != null) { - return false; - } - - $path = $this->constructUrl($path); - - // if the file doesn't exist we create it - if (!file_exists($path)) { - file_put_contents($path, ''); - return true; - } - - // mtime updates are not supported - return false; - } - - /** - * check if a file or folder has been updated since $time - * @param string $path - * @param int $time - * @return bool - */ - public function hasUpdated($path,$time) { - // this it a work around for folder mtimes -> we loop it's content - if ( $this->is_dir($path)) { - $actualTime=$this->collectionMTime($path); - return $actualTime>$time; - } - - $actualTime=$this->filemtime($path); - return $actualTime>$time; - } - - /** - * get the best guess for the modification time of an iRODS collection - * @param string $path - */ - private function collectionMTime($path) { - $dh = $this->opendir($path); - $lastCTime = $this->filemtime($path); - if(is_resource($dh)) { - while (($file = readdir($dh)) !== false) { - if ($file != '.' and $file != '..') { - $time = $this->filemtime($file); - if ($time > $lastCTime) { - $lastCTime = $time; - } - } - } - } - return $lastCTime; - } - -} diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php index b1d355323d9a078df9948f94367c0dc91ad6abb0..6e53c4a99310c9805ac8b5e76b886cb3a91bf4a8 100644 --- a/apps/files_external/lib/smb.php +++ b/apps/files_external/lib/smb.php @@ -83,7 +83,7 @@ class SMB extends \OC\Files\Storage\StreamWrapper{ /** * Unlinks file or directory - * @param string @path + * @param string $path */ public function unlink($path) { if ($this->is_dir($path)) { diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php index a202d3843cb212925b5ba82b5cea18064b653857..03364867b0c69829d4980d6270fbe5dcb425ca05 100644 --- a/apps/files_external/lib/swift.php +++ b/apps/files_external/lib/swift.php @@ -23,7 +23,7 @@ namespace OC\Files\Storage; set_include_path(get_include_path() . PATH_SEPARATOR . - \OC_App::getAppPath('files_external') . '/3rdparty/php-opencloud/lib'); + \OC_App::getAppPath('files_external') . '/3rdparty/php-opencloud/lib'); require_once 'openstack.php'; use \OpenCloud; @@ -31,25 +31,25 @@ use \OpenCloud\Common\Exceptions; class Swift extends \OC\Files\Storage\Common { - /** - * @var \OpenCloud\ObjectStore - */ + /** + * @var \OpenCloud\ObjectStore + */ private $connection; - /** - * @var \OpenCloud\ObjectStore\Container - */ + /** + * @var \OpenCloud\ObjectStore\Container + */ private $container; - /** - * @var \OpenCloud\OpenStack - */ + /** + * @var \OpenCloud\OpenStack + */ private $anchor; - /** - * @var string - */ + /** + * @var string + */ private $bucket; - /** - * @var array - */ + /** + * @var array + */ private static $tmpFiles = array(); /** diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php index 0d04e35e7fef4a38d9c2bdf4a6ca64c9c1da86ee..df80ed109931a8ee0f344561f578586bda9cf0dd 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -27,7 +27,7 @@ placeholder="t('Folder name')); ?>" /> - '> $backend): ?> diff --git a/apps/files_external/tests/config.php b/apps/files_external/tests/config.php index 767c0adf58e17bbeabd4ce724b9226392b470258..62aff4d1bc1eed6f0d805d9e7f0d5a03dc8a3271 100644 --- a/apps/files_external/tests/config.php +++ b/apps/files_external/tests/config.php @@ -28,7 +28,7 @@ return array( 'wait'=> 0 ), 'owncloud'=>array( - 'run'=>true, + 'run'=>false, 'host'=>'localhost/owncloud', 'user'=>'test', 'password'=>'test', diff --git a/apps/files_external/tests/dynamicmountconfig.php b/apps/files_external/tests/dynamicmountconfig.php index 81a31e14c6071363adfbae60c5da722874613c34..650299075e65f9c5db17121c7d2f59376b5eb36c 100644 --- a/apps/files_external/tests/dynamicmountconfig.php +++ b/apps/files_external/tests/dynamicmountconfig.php @@ -22,8 +22,6 @@ require_once __DIR__ . '/../../../lib/base.php'; -require __DIR__ . '/../lib/config.php'; - /** * Class Test_Mount_Config_Dummy_Backend */ diff --git a/apps/files_external/tests/irods.php b/apps/files_external/tests/irods.php deleted file mode 100644 index 6aa9d3a3b0f1272a6b3b25c387e7331d4ea2e07f..0000000000000000000000000000000000000000 --- a/apps/files_external/tests/irods.php +++ /dev/null @@ -1,32 +0,0 @@ - - * This file is licensed under the Affero General Public License version 3 or - * later. - * See the COPYING-README file. - */ - -namespace Test\Files\Storage; - -class iRODS extends Storage { - - protected $backupGlobals = FALSE; - - private $config; - - public function setUp() { - $id = uniqid(); - $this->config = include('files_external/tests/config.php'); - if ( ! is_array($this->config) or ! isset($this->config['irods']) or ! $this->config['irods']['run']) { - $this->markTestSkipped('irods backend not configured'); - } - $this->config['irods']['root'] .= $id; //make sure we have an new empty folder to work in - $this->instance = new \OC\Files\Storage\iRODS($this->config['irods']); - } - - public function tearDown() { - if ($this->instance) { - \OCP\Files::rmdirr($this->instance->constructUrl('')); - } - } -} diff --git a/apps/files_external/tests/mountconfig.php b/apps/files_external/tests/mountconfig.php index 1921ec76af35e53759c57d66b5eb4b965de3c07f..14fe1d90b7aac32679ee174778fdde5273b32d43 100644 --- a/apps/files_external/tests/mountconfig.php +++ b/apps/files_external/tests/mountconfig.php @@ -22,8 +22,6 @@ require_once __DIR__ . '/../../../lib/base.php'; -require __DIR__ . '/../lib/config.php'; - class Test_Mount_Config_Dummy_Storage { public function test() { return true; diff --git a/apps/files_sharing/ajax/list.php b/apps/files_sharing/ajax/list.php index 4b645496253f704567b31e5895289e82dac105b0..82bacb3d38de4a41f141fbf8d62d2992097a757e 100644 --- a/apps/files_sharing/ajax/list.php +++ b/apps/files_sharing/ajax/list.php @@ -20,11 +20,6 @@ * */ -// only need filesystem apps -$RUNTIME_APPTYPES=array('filesystem'); - -// Init owncloud - if(!\OC_App::isEnabled('files_sharing')){ exit; } @@ -47,6 +42,9 @@ if (isset($_GET['dir'])) { $relativePath = $_GET['dir']; } +$sortAttribute = isset( $_GET['sort'] ) ? $_GET['sort'] : 'name'; +$sortDirection = isset( $_GET['sortdirection'] ) ? ($_GET['sortdirection'] === 'desc') : false; + $data = \OCA\Files_Sharing\Helper::setupFromToken($token, $relativePath, $password); $linkItem = $data['linkItem']; @@ -64,7 +62,7 @@ $data = array(); $baseUrl = OCP\Util::linkTo('files_sharing', 'index.php') . '?t=' . urlencode($token) . '&dir='; // make filelist -$files = \OCA\Files\Helper::getFiles($dir); +$files = \OCA\Files\Helper::getFiles($dir, $sortAttribute, $sortDirection); $formattedFiles = array(); foreach ($files as $file) { diff --git a/apps/files_sharing/ajax/publicpreview.php b/apps/files_sharing/ajax/publicpreview.php index d12d212a2e64f089f68bccb13ee3da426bc93839..d8c892f1b7f952d2fae55e8e029475e8b4c50e7a 100644 --- a/apps/files_sharing/ajax/publicpreview.php +++ b/apps/files_sharing/ajax/publicpreview.php @@ -16,6 +16,7 @@ $maxX = array_key_exists('x', $_GET) ? (int) $_GET['x'] : '36'; $maxY = array_key_exists('y', $_GET) ? (int) $_GET['y'] : '36'; $scalingUp = array_key_exists('scalingup', $_GET) ? (bool) $_GET['scalingup'] : true; $token = array_key_exists('t', $_GET) ? (string) $_GET['t'] : ''; +$keepAspect = array_key_exists('a', $_GET) ? true : false; if($token === ''){ \OC_Response::setStatus(400); //400 Bad Request @@ -70,6 +71,10 @@ if(substr($path, 0, 1) === '/') { $path = substr($path, 1); } +if ($keepAspect === true) { + $maxY = $maxX; +} + if($maxX === 0 || $maxY === 0) { \OC_Response::setStatus(400); //400 Bad Request \OC_Log::write('core-preview', 'x and/or y set to 0', \OC_Log::DEBUG); @@ -84,8 +89,9 @@ try{ $preview->setMaxX($maxX); $preview->setMaxY($maxY); $preview->setScalingUp($scalingUp); + $preview->setKeepAspect($keepAspect); - $preview->show(); + $preview->showPreview(); } catch (\Exception $e) { \OC_Response::setStatus(500); \OC_Log::write('core', $e->getmessage(), \OC_Log::DEBUG); diff --git a/apps/files_sharing/appinfo/info.xml b/apps/files_sharing/appinfo/info.xml index 9a199281a76f0eb072f372c9fe057a4e09aa6e13..9b42c1e17b5a8ff757517a2f79e845f2e841aff3 100644 --- a/apps/files_sharing/appinfo/info.xml +++ b/apps/files_sharing/appinfo/info.xml @@ -13,6 +13,6 @@ public.php - public.php + publicwebdav.php diff --git a/apps/files_sharing/appinfo/routes.php b/apps/files_sharing/appinfo/routes.php index 06e454b7d779d65c3045c495ace73a0350a7ec38..7c2834dc9c2b008f02fef4ea6c2e4876699fbac7 100644 --- a/apps/files_sharing/appinfo/routes.php +++ b/apps/files_sharing/appinfo/routes.php @@ -1,9 +1,9 @@ create('core_ajax_public_preview', '/publicpreview.png')->action( -function() { - require_once __DIR__ . '/../ajax/publicpreview.php'; -}); +$this->create('core_ajax_public_preview', '/publicpreview')->action( + function() { + require_once __DIR__ . '/../ajax/publicpreview.php'; + }); // OCS API diff --git a/apps/files_sharing/appinfo/version b/apps/files_sharing/appinfo/version index bd73f47072b1fe4b9914ec14a7f6d47fcc8f816a..267577d47e497a0630bc454b3f74c4fd9a10ced4 100644 --- a/apps/files_sharing/appinfo/version +++ b/apps/files_sharing/appinfo/version @@ -1 +1 @@ -0.4 +0.4.1 diff --git a/apps/files_sharing/css/public.css b/apps/files_sharing/css/public.css index efd8d4950d83492aef439e09f8afbbc999be74ac..70897af9eb9785991c202e7d179ed8e82afbaa07 100644 --- a/apps/files_sharing/css/public.css +++ b/apps/files_sharing/css/public.css @@ -1,7 +1,3 @@ -#controls { - left: 0; -} - #preview { background: #fff; text-align: center; @@ -86,9 +82,6 @@ thead { margin-left: auto; margin-right: auto; } -.directDownload .button img { - vertical-align: text-bottom; -} .directLink label { font-weight: normal; diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index ae2412f6a3b6fd027cfdc840efa8405705a5a717..d3d4479215efa77e93c2726a7f9e34d7142b1cf1 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -8,77 +8,164 @@ * */ -/* global OC, FileActions, FileList, Files */ +/* global FileActions, Files */ +/* global dragOptions, folderDropOptions */ +OCA.Sharing = {}; +if (!OCA.Files) { + OCA.Files = {}; +} +OCA.Sharing.PublicApp = { + _initialized: false, -$(document).ready(function() { + initialize: function($el) { + if (this._initialized) { + return; + } + this._initialized = true; + // file list mode ? + if ($el.find('#filestable')) { + this.fileList = new OCA.Files.FileList( + $el, + { + scrollContainer: $(window), + dragOptions: dragOptions, + folderDropOptions: folderDropOptions + } + ); + this.files = OCA.Files.Files; + this.files.initialize(); + } - 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' && $('.publicpreview').length === 0) { - // Trigger default action if not download TODO - var action = FileActions.getDefault(mimetype, 'file', OC.PERMISSION_READ); - if (typeof action !== 'undefined') { - action($('#filename').val()); + + if (typeof FileActions !== 'undefined') { + // Show file preview if previewer is available, images are already handled by the template + 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') { + action($('#filename').val()); + } } } - } - // override since the format is different - Files.getDownloadUrl = function(filename, dir) { - if ($.isArray(filename)) { - filename = JSON.stringify(filename); + // dynamically load image previews + if (mimetype.substr(0, mimetype.indexOf('/')) === 'image' ) { + + var params = { + x: $(document).width() * window.devicePixelRatio, + a: 'true', + file: encodeURIComponent($('#dir').val() + $('#filename').val()), + t: $('#sharingToken').val() + }; + + var img = $(''); + img.attr('src', OC.filePath('files_sharing', 'ajax', 'publicpreview.php') + '?' + OC.buildQueryString(params)); + img.appendTo('#imgframe'); } - var path = dir || FileList.getCurrentDirectory(); - var params = { - service: 'files', - t: $('#sharingToken').val(), - path: path, - files: filename, - download: null - }; - return OC.filePath('', '', 'public.php') + '?' + OC.buildQueryString(params); - }; - Files.getAjaxUrl = function(action, params) { - params = params || {}; - params.t = $('#sharingToken').val(); - return OC.filePath('files_sharing', 'ajax', action + '.php') + '?' + OC.buildQueryString(params); - }; + if (this.fileList) { + // TODO: move this to a separate PublicFileList class that extends OCA.Files.FileList (+ unit tests) + this.fileList.getDownloadUrl = function(filename, dir) { + if ($.isArray(filename)) { + filename = JSON.stringify(filename); + } + var path = dir || FileList.getCurrentDirectory(); + var params = { + service: 'files', + t: $('#sharingToken').val(), + path: path, + files: filename, + download: null + }; + return OC.filePath('', '', 'public.php') + '?' + OC.buildQueryString(params); + }; - FileList.linkTo = function(dir) { - var params = { - service: 'files', - t: $('#sharingToken').val(), - dir: dir - }; - return OC.filePath('', '', 'public.php') + '?' + OC.buildQueryString(params); - }; + this.fileList.getAjaxUrl = function(action, params) { + params = params || {}; + params.t = $('#sharingToken').val(); + return OC.filePath('files_sharing', 'ajax', action + '.php') + '?' + OC.buildQueryString(params); + }; - Files.generatePreviewUrl = function(urlSpec) { - urlSpec.t = $('#dirToken').val(); - return OC.generateUrl('/apps/files_sharing/ajax/publicpreview.php?') + $.param(urlSpec); - }; + this.fileList.linkTo = function(dir) { + var params = { + service: 'files', + t: $('#sharingToken').val(), + dir: dir + }; + return OC.filePath('', '', 'public.php') + '?' + OC.buildQueryString(params); + }; - var file_upload_start = $('#file_upload_start'); - file_upload_start.on('fileuploadadd', function(e, data) { - var fileDirectory = ''; - if(typeof data.files[0].relativePath !== 'undefined') { - fileDirectory = data.files[0].relativePath; + this.fileList.generatePreviewUrl = function(urlSpec) { + urlSpec.t = $('#dirToken').val(); + return OC.generateUrl('/apps/files_sharing/ajax/publicpreview.php?') + $.param(urlSpec); + }; + + var file_upload_start = $('#file_upload_start'); + file_upload_start.on('fileuploadadd', function(e, data) { + var fileDirectory = ''; + if(typeof data.files[0].relativePath !== 'undefined') { + fileDirectory = data.files[0].relativePath; + } + + // Add custom data to the upload handler + data.formData = { + requesttoken: $('#publicUploadRequestToken').val(), + dirToken: $('#dirToken').val(), + subdir: $('input#dir').val(), + file_directory: fileDirectory + }; + }); + + this.fileActions = _.extend({}, OCA.Files.FileActions); + this.fileActions.registerDefaultActions(this.fileList); + delete this.fileActions.actions.all.Share; + this.fileList.setFileActions(this.fileActions); + + this.fileList.changeDirectory($('#dir').val() || '/', false, true); + + // URL history handling + this.fileList.$el.on('changeDirectory', _.bind(this._onDirectoryChanged, this)); + OC.Util.History.addOnPopStateHandler(_.bind(this._onUrlChanged, this)); } - // Add custom data to the upload handler - data.formData = { - requesttoken: $('#publicUploadRequestToken').val(), - dirToken: $('#dirToken').val(), - subdir: $('input#dir').val(), - file_directory: fileDirectory - }; - }); + $(document).on('click', '#directLink', function() { + $(this).focus(); + $(this).select(); + }); + + // legacy + window.FileList = this.fileList; + }, - $(document).on('click', '#directLink', function() { - $(this).focus(); - $(this).select(); - }); + _onDirectoryChanged: function(e) { + OC.Util.History.pushState({ + service: 'files', + t: $('#sharingToken').val(), + // arghhhh, why is this not called "dir" !? + path: e.dir + }); + }, + _onUrlChanged: function(params) { + this.fileList.changeDirectory(params.path || params.dir, false, true); + } +}; + +$(document).ready(function() { + var App = OCA.Sharing.PublicApp; + App.initialize($('#preview')); + + // HACK: for oc-dialogs previews that depends on Files: + Files.lazyLoadPreview = function(path, mime, ready, width, height, etag) { + return App.fileList.lazyLoadPreview({ + path: path, + mime: mime, + callback: ready, + width: width, + height: height, + etag: etag + }); + }; }); + diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index 3c7c9239a6cbf3f870a3a253936ffeb27983210d..973c63c5d7e332e1c13559f7402111ddb7a29476 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -8,15 +8,15 @@ * */ -/* global OC, t, FileList, FileActions */ +/* global FileList, FileActions */ $(document).ready(function() { - var disableSharing = $('#disableSharing').data('status'), - sharesLoaded = false; + var sharesLoaded = false; - if (typeof OC.Share !== 'undefined' && typeof FileActions !== 'undefined' && !disableSharing) { - var oldCreateRow = FileList._createRow; - FileList._createRow = function(fileData) { + if (typeof OC.Share !== 'undefined' && typeof FileActions !== 'undefined') { + // TODO: make a separate class for this or a hook or jQuery event ? + var oldCreateRow = OCA.Files.FileList.prototype._createRow; + OCA.Files.FileList.prototype._createRow = function(fileData) { var tr = oldCreateRow.apply(this, arguments); if (fileData.shareOwner) { tr.attr('data-share-owner', fileData.shareOwner); @@ -25,14 +25,16 @@ $(document).ready(function() { }; $('#fileList').on('fileActionsReady',function(){ - - var allShared = $('#fileList').find('[data-share-owner] [data-Action="Share"]'); + var $fileList = $(this); + var allShared = $fileList.find('[data-share-owner] [data-Action="Share"]'); allShared.addClass('permanent'); allShared.find('span').text(function(){ var $owner = $(this).closest('tr').attr('data-share-owner'); return ' ' + t('files_sharing', 'Shared by {owner}', {owner: $owner}); }); + // FIXME: these calls are also working on hard-coded + // list selectors... if (!sharesLoaded){ OC.Share.loadIcons('file'); // assume that we got all shares, so switching directories diff --git a/apps/files_sharing/l10n/ar.php b/apps/files_sharing/l10n/ar.php index f796f7ec59da5197b9b8cad76830c4327004593c..3f8b49913f260247ddb27f9f04c960e3caab7dc8 100644 --- a/apps/files_sharing/l10n/ar.php +++ b/apps/files_sharing/l10n/ar.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "the link expired" => "انتهت صلاحية الرابط", "sharing is disabled" => "المشاركة غير مفعلة", "For more info, please ask the person who sent this link." => "لمزيد من المعلومات، يرجى سؤال الشخص الذي أرسل هذا الرابط", -"shared by %s" => "مشاركة من قبل %s", +"Download" => "تحميل", "Download %s" => "تحميل %s", "Direct link" => "رابط مباشر" ); diff --git a/apps/files_sharing/l10n/ast.php b/apps/files_sharing/l10n/ast.php index 02a2f6fb628975c2da861acebd11ba5b1c84a7a9..fa3704ea6ba952ee11c55a72fd1e19f66d9237a2 100644 --- a/apps/files_sharing/l10n/ast.php +++ b/apps/files_sharing/l10n/ast.php @@ -1,6 +1,17 @@ "Compartíu por {owner}", -"Password" => "Contraseña" +"This share is password-protected" => "Esta compartición tien contraseña protexida", +"The password is wrong. Try again." => "La contraseña ye incorreuta. Inténtalo otra vegada.", +"Password" => "Contraseña", +"Sorry, this link doesn’t seem to work anymore." => "Sentímoslo, esti enllaz paez que yá nun furrula.", +"Reasons might be:" => "Les razones pueden ser: ", +"the item was removed" => "desanicióse l'elementu", +"the link expired" => "l'enllaz caducó", +"sharing is disabled" => "compartir ta desactiváu", +"For more info, please ask the person who sent this link." => "Pa más información, entrúga-y a la persona qu'unvió esti enllaz", +"Download" => "Baxar", +"Download %s" => "Descargar %s", +"Direct link" => "Enllaz direutu" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/bg_BG.php b/apps/files_sharing/l10n/bg_BG.php index 37e2ca33370639c2592f8fd55944050054706bbf..80bc1176873b34f0a66bf9684af31c6515bf04d7 100644 --- a/apps/files_sharing/l10n/bg_BG.php +++ b/apps/files_sharing/l10n/bg_BG.php @@ -1,6 +1,6 @@ "Парола", -"shared by %s" => "споделено от %s" +"Download" => "Изтегляне" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/bn_BD.php b/apps/files_sharing/l10n/bn_BD.php index 1d737247d8a80e2baea57c697a1eb94c87ac1769..6c5809f5a0bf57cb26bfba6c3d62e96782acb149 100644 --- a/apps/files_sharing/l10n/bn_BD.php +++ b/apps/files_sharing/l10n/bn_BD.php @@ -1,5 +1,6 @@ "কূটশব্দ" +"Password" => "কূটশব্দ", +"Download" => "ডাউনলোড" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/ca.php b/apps/files_sharing/l10n/ca.php index 6432219650bb36312d5de110a9cf333430d96c40..8b23af69640b132227c8c82138c2495040f49a48 100644 --- a/apps/files_sharing/l10n/ca.php +++ b/apps/files_sharing/l10n/ca.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "the link expired" => "l'enllaç ha vençut", "sharing is disabled" => "s'ha desactivat la compartició", "For more info, please ask the person who sent this link." => "Per més informació contacteu amb qui us ha enviat l'enllaç.", -"shared by %s" => "compartit per %s", +"Download" => "Baixa", "Download %s" => "Baixa %s", "Direct link" => "Enllaç directe" ); diff --git a/apps/files_sharing/l10n/cs_CZ.php b/apps/files_sharing/l10n/cs_CZ.php index e7a8b16f000a62aa733b79a9629290499d43e6c8..d77cc7949400a10ae19cf0897f02b65e691becf0 100644 --- a/apps/files_sharing/l10n/cs_CZ.php +++ b/apps/files_sharing/l10n/cs_CZ.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "the link expired" => "platnost odkazu vypršela", "sharing is disabled" => "sdílení je zakázané", "For more info, please ask the person who sent this link." => "Pro více informací kontaktujte osobu, která vám zaslala tento odkaz.", -"shared by %s" => "sdílí %s", +"Download" => "Stáhnout", "Download %s" => "Stáhnout %s", "Direct link" => "Přímý odkaz" ); diff --git a/apps/files_sharing/l10n/cy_GB.php b/apps/files_sharing/l10n/cy_GB.php index bf05f890a949c24dda3e0326b28e6b3f44fe713e..0012a9fa7f1752be6af17a234c7cfb06b42cdc1a 100644 --- a/apps/files_sharing/l10n/cy_GB.php +++ b/apps/files_sharing/l10n/cy_GB.php @@ -1,5 +1,6 @@ "Cyfrinair" +"Password" => "Cyfrinair", +"Download" => "Llwytho i lawr" ); $PLURAL_FORMS = "nplurals=4; plural=(n==1) ? 0 : (n==2) ? 1 : (n != 8 && n != 11) ? 2 : 3;"; diff --git a/apps/files_sharing/l10n/da.php b/apps/files_sharing/l10n/da.php index 6c6a39c2954f407d2aac360b9dc14aebcb415cb6..07fc5392a8b2cfccb8e374c358bce0c604b59f84 100644 --- a/apps/files_sharing/l10n/da.php +++ b/apps/files_sharing/l10n/da.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "the link expired" => "linket udløb", "sharing is disabled" => "deling er deaktiveret", "For more info, please ask the person who sent this link." => "For yderligere information, kontakt venligst personen der sendte linket. ", -"shared by %s" => "delt af %s", +"Download" => "Download", "Download %s" => "Download %s", "Direct link" => "Direkte link" ); diff --git a/apps/files_sharing/l10n/de.php b/apps/files_sharing/l10n/de.php index a92488184445ae659076038dbd7c834b902cdcec..2ca1a006a93b7ded7cfba4902d0cda2729ea07c4 100644 --- a/apps/files_sharing/l10n/de.php +++ b/apps/files_sharing/l10n/de.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "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, frage bitte die Person, die Dir diesen Link geschickt hat.", -"shared by %s" => "Freigegeben von %s", +"Download" => "Herunterladen", "Download %s" => "Download %s", "Direct link" => "Direkter Link" ); diff --git a/apps/files_sharing/l10n/de_AT.php b/apps/files_sharing/l10n/de_AT.php index 142892bc9a9678cdd7dd7f7a50d4f6aae11ddb1a..08ef4d9245e9cfbec674ce66064c080d6bee6620 100644 --- a/apps/files_sharing/l10n/de_AT.php +++ b/apps/files_sharing/l10n/de_AT.php @@ -1,5 +1,6 @@ "Passwort" +"Password" => "Passwort", +"Download" => "Herunterladen" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/de_CH.php b/apps/files_sharing/l10n/de_CH.php index 6ea0a4654c6dc0864a45d18263442f24d2af4187..8d3c5f6ed74969d6d2fda729ae6b0c951203bee2 100644 --- a/apps/files_sharing/l10n/de_CH.php +++ b/apps/files_sharing/l10n/de_CH.php @@ -8,6 +8,7 @@ $TRANSLATIONS = array( "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." +"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.", +"Download" => "Herunterladen" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/de_DE.php b/apps/files_sharing/l10n/de_DE.php index e7bd75a2e0ae7a36eafbad39b97bac39610843f6..021ec041aa056c8dbe2a2585217e6fc3dbc14003 100644 --- a/apps/files_sharing/l10n/de_DE.php +++ b/apps/files_sharing/l10n/de_DE.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "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.", -"shared by %s" => "Geteilt von %s", +"Download" => "Herunterladen", "Download %s" => "Download %s", "Direct link" => "Direkte Verlinkung" ); diff --git a/apps/files_sharing/l10n/el.php b/apps/files_sharing/l10n/el.php index 10ff594c98dcc93994f5bb94fe874de4952bd478..eb559a682d96bc47f591eb6173fdb8ea79561772 100644 --- a/apps/files_sharing/l10n/el.php +++ b/apps/files_sharing/l10n/el.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "the link expired" => "ο σύνδεσμος έληξε", "sharing is disabled" => "ο διαμοιρασμός απενεργοποιήθηκε", "For more info, please ask the person who sent this link." => "Για περισσότερες πληροφορίες, παρακαλώ ρωτήστε το άτομο που σας έστειλε αυτόν τον σύνδεσμο.", -"shared by %s" => "διαμοιράστηκε από %s", +"Download" => "Λήψη", "Download %s" => "Λήψη %s", "Direct link" => "Άμεσος σύνδεσμος" ); diff --git a/apps/files_sharing/l10n/en@pirate.php b/apps/files_sharing/l10n/en@pirate.php index ab628e1717ea7db8f3603b601d313df628d22c87..a92711090026493ca38b83b2c5dbafd35d6b20f6 100644 --- a/apps/files_sharing/l10n/en@pirate.php +++ b/apps/files_sharing/l10n/en@pirate.php @@ -1,5 +1,6 @@ "Secret Code" +"Password" => "Secret Code", +"Download" => "Download" ); $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 index 02663f96b8e18270504e9ae1d1c1d032efe0e313..e263f3cf6df54e336b0775eacb621e03ba9eccdd 100644 --- a/apps/files_sharing/l10n/en_GB.php +++ b/apps/files_sharing/l10n/en_GB.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "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.", -"shared by %s" => "shared by %s", +"Download" => "Download", "Download %s" => "Download %s", "Direct link" => "Direct link" ); diff --git a/apps/files_sharing/l10n/eo.php b/apps/files_sharing/l10n/eo.php index 1148d516972559c8d60291deec37803bd70c1609..127ac02206e2dc578dbf0e197634f9818038a107 100644 --- a/apps/files_sharing/l10n/eo.php +++ b/apps/files_sharing/l10n/eo.php @@ -9,6 +9,7 @@ $TRANSLATIONS = array( "the link expired" => "la ligilo eksvalidiĝis", "sharing is disabled" => "kunhavigo malkapablas", "For more info, please ask the person who sent this link." => "Por plia informo, bonvolu peti al la persono, kiu sendis ĉi tiun ligilon.", +"Download" => "Elŝuti", "Direct link" => "Direkta ligilo" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/es.php b/apps/files_sharing/l10n/es.php index 2e3f3b85003f80867be039eb880cd7d80ced3023..6978c7ce72c472fa0d9769a77d718f94ea648a32 100644 --- a/apps/files_sharing/l10n/es.php +++ b/apps/files_sharing/l10n/es.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "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, contacte a la persona que le envió el enlace.", -"shared by %s" => "Compartido por %s", +"Download" => "Descargar", "Download %s" => "Descargar %s", "Direct link" => "Enlace directo" ); diff --git a/apps/files_sharing/l10n/es_AR.php b/apps/files_sharing/l10n/es_AR.php index 95cfadc1db6ffa435a152a95b3bdfb142e51e6aa..9a9db79493864c91202239425528b336912e1b19 100644 --- a/apps/files_sharing/l10n/es_AR.php +++ b/apps/files_sharing/l10n/es_AR.php @@ -10,6 +10,7 @@ $TRANSLATIONS = array( "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.", +"Download" => "Descargar", "Direct link" => "Vínculo directo" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/es_CL.php b/apps/files_sharing/l10n/es_CL.php index 42a2f066c6e01c50d3094c52eec3948fea5a9348..083bc4d4e2a33608b47bcb70ed10b542dca37976 100644 --- a/apps/files_sharing/l10n/es_CL.php +++ b/apps/files_sharing/l10n/es_CL.php @@ -1,5 +1,6 @@ "Clave" +"Password" => "Clave", +"Download" => "Descargar" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/es_MX.php b/apps/files_sharing/l10n/es_MX.php index 9168e25308d61cf733727a5017ed58b6a36020a8..1a1ebe4b4c6df99e02b8f2f6be7199f6ebd177b4 100644 --- a/apps/files_sharing/l10n/es_MX.php +++ b/apps/files_sharing/l10n/es_MX.php @@ -10,6 +10,7 @@ $TRANSLATIONS = array( "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, contacte a la persona que le envió el enlace.", +"Download" => "Descargar", "Direct link" => "Enlace directo" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/et_EE.php b/apps/files_sharing/l10n/et_EE.php index 7150f05da227ffa4b1c820a82c760075ea3fbdb1..e95e6271957c2c7b5e721aa8d8033df5b9c80e36 100644 --- a/apps/files_sharing/l10n/et_EE.php +++ b/apps/files_sharing/l10n/et_EE.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "the link expired" => "link on aegunud", "sharing is disabled" => "jagamine on peatatud", "For more info, please ask the person who sent this link." => "Täpsema info saamiseks palun pöördu lingi saatnud isiku poole.", -"shared by %s" => "jagas %s", +"Download" => "Lae alla", "Download %s" => "Laadi alla %s", "Direct link" => "Otsene link" ); diff --git a/apps/files_sharing/l10n/eu.php b/apps/files_sharing/l10n/eu.php index 5f13a73e1ff31ceddf381f26a1fa71b3f6236544..8be7bcb2a4bc36becae0106a03ca2331e7220508 100644 --- a/apps/files_sharing/l10n/eu.php +++ b/apps/files_sharing/l10n/eu.php @@ -10,7 +10,8 @@ $TRANSLATIONS = array( "the link expired" => "lotura iraungi da", "sharing is disabled" => "elkarbanatzea ez dago gaituta", "For more info, please ask the person who sent this link." => "Informazio gehiagorako, mesedez eskatu lotura hau bidali zuen pertsonari", -"shared by %s" => "%sk partekatuta", +"Download" => "Deskargatu", +"Download %s" => "Deskargatu %s", "Direct link" => "Lotura zuzena" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/eu_ES.php b/apps/files_sharing/l10n/eu_ES.php new file mode 100644 index 0000000000000000000000000000000000000000..e6e5bc7cbf9feaa99117545263e9b410111114d9 --- /dev/null +++ b/apps/files_sharing/l10n/eu_ES.php @@ -0,0 +1,5 @@ + "Deskargatu" +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/fa.php b/apps/files_sharing/l10n/fa.php index 9b0a1dbc9d5ea69d2e9bc6231e63cca8f1e17dad..fb6a4bc87098af7d1306b5e36ee1cfa366dfffb2 100644 --- a/apps/files_sharing/l10n/fa.php +++ b/apps/files_sharing/l10n/fa.php @@ -1,7 +1,17 @@ "اشتراک گذارنده {owner}", +"This share is password-protected" => "این اشتراک توسط رمز عبور محافظت می شود", "The password is wrong. Try again." => "رمزعبور اشتباه می باشد. دوباره امتحان کنید.", -"Password" => "گذرواژه" +"Password" => "گذرواژه", +"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." => "برای اطلاعات بیشتر، لطفا از شخصی که این پیوند را ارسال کرده سوال بفرمایید.", +"Download" => "دانلود", +"Download %s" => "دانلود %s", +"Direct link" => "پیوند مستقیم" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_sharing/l10n/fi_FI.php b/apps/files_sharing/l10n/fi_FI.php index e8ca368c717c85cc346220b020e40270b4070028..851463c4b83a1faa9bd107063531f4b3ddee8a23 100644 --- a/apps/files_sharing/l10n/fi_FI.php +++ b/apps/files_sharing/l10n/fi_FI.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "the link expired" => "linkki vanheni", "sharing is disabled" => "jakaminen on poistettu käytöstä", "For more info, please ask the person who sent this link." => "Kysy lisätietoja henkilöltä, jolta sait linkin.", -"shared by %s" => "jakanut %s", +"Download" => "Lataa", "Download %s" => "Lataa %s", "Direct link" => "Suora linkki" ); diff --git a/apps/files_sharing/l10n/fr.php b/apps/files_sharing/l10n/fr.php index 8e083f4ca0e9f42184118bd658a310bf1a3e97c4..a5b75e412f7160f0d111f8ab09e632eea0f3c3da 100644 --- a/apps/files_sharing/l10n/fr.php +++ b/apps/files_sharing/l10n/fr.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "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.", -"shared by %s" => "partagé par %s", +"Download" => "Télécharger", "Download %s" => "Télécharger %s", "Direct link" => "Lien direct" ); diff --git a/apps/files_sharing/l10n/gl.php b/apps/files_sharing/l10n/gl.php index a04e82342301f658481b8437bf0305a76bffe39b..f5e1c6645f6ca6ca2c63d6e2201b400e4b45feab 100644 --- a/apps/files_sharing/l10n/gl.php +++ b/apps/files_sharing/l10n/gl.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "the link expired" => "a ligazón caducou", "sharing is disabled" => "foi desactivada a compartición", "For more info, please ask the person who sent this link." => "Para obter máis información, pregúntelle á persoa que lle enviou a ligazón.", -"shared by %s" => "compartido por %s", +"Download" => "Descargar", "Download %s" => "Descargar %s", "Direct link" => "Ligazón directa" ); diff --git a/apps/files_sharing/l10n/he.php b/apps/files_sharing/l10n/he.php index 9ba86d077223bc2e6649c6cafea120b1d9744260..e56fdb2c8010fb3fda74a5c842ad1a948f6c1219 100644 --- a/apps/files_sharing/l10n/he.php +++ b/apps/files_sharing/l10n/he.php @@ -1,6 +1,7 @@ "שותף בידי {owner}", -"Password" => "סיסמא" +"Password" => "סיסמא", +"Download" => "הורדה" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/hr.php b/apps/files_sharing/l10n/hr.php index 60c01d30b5ece751be0f1dd80a52363c0469b4a7..16776cdba2736d915e34ffb8b48d11a910e5bc52 100644 --- a/apps/files_sharing/l10n/hr.php +++ b/apps/files_sharing/l10n/hr.php @@ -1,5 +1,6 @@ "Lozinka" +"Password" => "Lozinka", +"Download" => "Preuzimanje" ); $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_sharing/l10n/hu_HU.php b/apps/files_sharing/l10n/hu_HU.php index 787a22fe6c039fb01bc58578dd21346525de93ae..822101161003bc7d7f6b2d703a45b0512cec4bb6 100644 --- a/apps/files_sharing/l10n/hu_HU.php +++ b/apps/files_sharing/l10n/hu_HU.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "the link expired" => "lejárt a link érvényességi ideje", "sharing is disabled" => "letiltásra került a megosztás", "For more info, please ask the person who sent this link." => "További információért forduljon ahhoz, aki ezt a linket küldte Önnek!", -"shared by %s" => "Megosztotta: %s", +"Download" => "Letöltés", "Direct link" => "Közvetlen link" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/ia.php b/apps/files_sharing/l10n/ia.php index 9ec82f20dfa584d2828eb34ecf2ab7d67e76a1fb..03e2deb431a350fb8f6332da7df37115100b73dd 100644 --- a/apps/files_sharing/l10n/ia.php +++ b/apps/files_sharing/l10n/ia.php @@ -1,5 +1,6 @@ "Contrasigno" +"Password" => "Contrasigno", +"Download" => "Discargar" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/id.php b/apps/files_sharing/l10n/id.php index e4668a7fb549e4a111e777cf780442207cfc5b9d..72670c23b3946f86abedb3d5d647cd978793c166 100644 --- a/apps/files_sharing/l10n/id.php +++ b/apps/files_sharing/l10n/id.php @@ -10,6 +10,7 @@ $TRANSLATIONS = array( "the link expired" => "tautan telah kadaluarsa", "sharing is disabled" => "berbagi dinonaktifkan", "For more info, please ask the person who sent this link." => "Untuk info lebih lanjut, silakan tanyakan orang yang mengirim tautan ini.", +"Download" => "Unduh", "Direct link" => "Tautan langsung" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_sharing/l10n/is.php b/apps/files_sharing/l10n/is.php index c4a1c58940113df23bd11caf662867a7709eee00..795dfeb6bfec3eb9d206fa661807b2bddc5ef6b9 100644 --- a/apps/files_sharing/l10n/is.php +++ b/apps/files_sharing/l10n/is.php @@ -1,5 +1,6 @@ "Lykilorð" +"Password" => "Lykilorð", +"Download" => "Niðurhal" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/it.php b/apps/files_sharing/l10n/it.php index 7efa4584606dd88ef37ffb189e9b1d0ba4e1a60e..94c2a66808cd91e3916752a676e4ebfa3c203812 100644 --- a/apps/files_sharing/l10n/it.php +++ b/apps/files_sharing/l10n/it.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "the link expired" => "il collegamento è scaduto", "sharing is disabled" => "la condivisione è disabilitata", "For more info, please ask the person who sent this link." => "Per ulteriori informazioni, chiedi alla persona che ti ha inviato il collegamento.", -"shared by %s" => "condiviso da %s", +"Download" => "Scarica", "Download %s" => "Scarica %s", "Direct link" => "Collegamento diretto" ); diff --git a/apps/files_sharing/l10n/ja.php b/apps/files_sharing/l10n/ja.php index 7e6461c60813fb4a4eaf6c2ac0cd7c4f6bad3083..a45da97dcad4ada73de4d573cd24f94b491f4057 100644 --- a/apps/files_sharing/l10n/ja.php +++ b/apps/files_sharing/l10n/ja.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "the link expired" => "リンクの期限が切れています", "sharing is disabled" => "共有が無効になっています", "For more info, please ask the person who sent this link." => "不明な点は、こちらのリンクの提供者に確認をお願いします。", -"shared by %s" => "%s で共有中", +"Download" => "ダウンロード", "Download %s" => "%s をダウンロード", "Direct link" => "リンク" ); diff --git a/apps/files_sharing/l10n/jv.php b/apps/files_sharing/l10n/jv.php new file mode 100644 index 0000000000000000000000000000000000000000..690632bdba02f02aa1d936feb666acda97002e8e --- /dev/null +++ b/apps/files_sharing/l10n/jv.php @@ -0,0 +1,5 @@ + "Njipuk" +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/ka_GE.php b/apps/files_sharing/l10n/ka_GE.php index 5fc48c9fd949f020a322a6b24321818b85327761..132bcb274c82b3dd8611febad421434392c12d2b 100644 --- a/apps/files_sharing/l10n/ka_GE.php +++ b/apps/files_sharing/l10n/ka_GE.php @@ -1,6 +1,7 @@ "გაზიარდა {owner} –ის მიერ", -"Password" => "პაროლი" +"Password" => "პაროლი", +"Download" => "ჩამოტვირთვა" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_sharing/l10n/km.php b/apps/files_sharing/l10n/km.php index 99b97c914e8a0e19a6b0c668e386c7d6d17e6dfc..75f5679d97a37016b9ecd20212a7ad05a83393e8 100644 --- a/apps/files_sharing/l10n/km.php +++ b/apps/files_sharing/l10n/km.php @@ -1,6 +1,17 @@ "{owner} បាន​ចែក​រំលែក", +"This share is password-protected" => "ការ​ចែករំលែក​នេះ​ត្រូវ​បាន​ការពារ​ដោយ​ពាក្យ​សម្ងាត់", +"The password is wrong. Try again." => "ពាក្យ​សម្ងាត់​ខុស​ហើយ។ ព្យាយាម​ម្ដង​ទៀត។", "Password" => "ពាក្យសម្ងាត់", -"shared by %s" => "បាន​ចែក​រំលែក​ដោយ %s" +"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." => "សម្រាប់​ព័ត៌មាន​បន្ថែម សូម​សួរ​អ្នក​ដែល​ផ្ញើ​តំណ​នេះ។", +"Download" => "ទាញយក", +"Download %s" => "ទាញយក %s", +"Direct link" => "តំណ​ផ្ទាល់" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_sharing/l10n/ko.php b/apps/files_sharing/l10n/ko.php index a4593fbd6cb2d5831351465a2edfbf979aa36d16..00818abf4a473523aa50ce010c84adc33aff9d51 100644 --- a/apps/files_sharing/l10n/ko.php +++ b/apps/files_sharing/l10n/ko.php @@ -10,6 +10,7 @@ $TRANSLATIONS = array( "the link expired" => "링크가 만료됨", "sharing is disabled" => "공유가 비활성화됨", "For more info, please ask the person who sent this link." => "자세한 정보는 링크를 보낸 사람에게 문의하십시오.", +"Download" => "다운로드", "Direct link" => "직접 링크" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_sharing/l10n/ku_IQ.php b/apps/files_sharing/l10n/ku_IQ.php index d433885e6721d78d50fd82a21981b8d589266199..b16e87d81c399324c425b1210d70e32993f85e25 100644 --- a/apps/files_sharing/l10n/ku_IQ.php +++ b/apps/files_sharing/l10n/ku_IQ.php @@ -1,5 +1,6 @@ "وشەی تێپەربو" +"Password" => "وشەی تێپەربو", +"Download" => "داگرتن" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/lb.php b/apps/files_sharing/l10n/lb.php index b253e795dfeb05897c17691810792d4c525e402f..a3e98138225bc70d2e37e5064514ca602f9e91eb 100644 --- a/apps/files_sharing/l10n/lb.php +++ b/apps/files_sharing/l10n/lb.php @@ -1,6 +1,7 @@ "Den Passwuert ass incorrect. Probeier ed nach eng keier.", -"Password" => "Passwuert" +"Password" => "Passwuert", +"Download" => "Download" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/lt_LT.php b/apps/files_sharing/l10n/lt_LT.php index 5db5ae275e28280fcce1c1c228138083a2ee55d4..4c05e9217a268bb8cc47cb57c8df585766aa22b4 100644 --- a/apps/files_sharing/l10n/lt_LT.php +++ b/apps/files_sharing/l10n/lt_LT.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "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ą.", -"shared by %s" => "pasidalino %s", +"Download" => "Atsisiųsti", "Direct link" => "Tiesioginė nuoroda" ); $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_sharing/l10n/lv.php b/apps/files_sharing/l10n/lv.php index 834d7c17211a042456b26efc03bbb3a309fa6d66..693f91d3b5c92e50ab117722f7ece033f41ddeef 100644 --- a/apps/files_sharing/l10n/lv.php +++ b/apps/files_sharing/l10n/lv.php @@ -1,6 +1,7 @@ "Dalījās {owner}", -"Password" => "Parole" +"Password" => "Parole", +"Download" => "Lejupielādēt" ); $PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);"; diff --git a/apps/files_sharing/l10n/mk.php b/apps/files_sharing/l10n/mk.php index 6afa5fc6846584c00a4214d6db35a47c14b59a91..b7281825a83bcb80209e2cfc7d7e8af97ffc9686 100644 --- a/apps/files_sharing/l10n/mk.php +++ b/apps/files_sharing/l10n/mk.php @@ -1,6 +1,7 @@ "Споделени од {owner}", -"Password" => "Лозинка" +"Password" => "Лозинка", +"Download" => "Преземи" ); $PLURAL_FORMS = "nplurals=2; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : 1;"; diff --git a/apps/files_sharing/l10n/ms_MY.php b/apps/files_sharing/l10n/ms_MY.php index 89d11f49fd79e23f794a252e0c048a3a4dc0ba85..43ea0b2d8805ea8c0d19f2a426edbafd24630251 100644 --- a/apps/files_sharing/l10n/ms_MY.php +++ b/apps/files_sharing/l10n/ms_MY.php @@ -1,5 +1,6 @@ "Kata laluan" +"Password" => "Kata laluan", +"Download" => "Muat turun" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_sharing/l10n/my_MM.php b/apps/files_sharing/l10n/my_MM.php index 475d6427436ee8ce2bd4b59b728e04b17fc06369..ff92e898ed44929ee8779f3356dd72bc55cb9abb 100644 --- a/apps/files_sharing/l10n/my_MM.php +++ b/apps/files_sharing/l10n/my_MM.php @@ -1,5 +1,6 @@ "စကားဝှက်" +"Password" => "စကားဝှက်", +"Download" => "ဒေါင်းလုတ်" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_sharing/l10n/nb_NO.php b/apps/files_sharing/l10n/nb_NO.php index 6427d716703e192d3ef3aa8101e5d9a425302b34..193ee7165ece8ec44d06bcee19a35a0805667937 100644 --- a/apps/files_sharing/l10n/nb_NO.php +++ b/apps/files_sharing/l10n/nb_NO.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "the link expired" => "lenken er utløpt", "sharing is disabled" => "deling er deaktivert", "For more info, please ask the person who sent this link." => "For mer informasjon, spør personen som sendte lenken.", -"shared by %s" => "delt av %s", +"Download" => "Last ned", "Direct link" => "Direkte lenke" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/nl.php b/apps/files_sharing/l10n/nl.php index 6151733f54a8f51fede1775a0b1beef506d30d5e..e35898862cf71f5e011bf83438b4b4a8d7574b58 100644 --- a/apps/files_sharing/l10n/nl.php +++ b/apps/files_sharing/l10n/nl.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "the link expired" => "de link is verlopen", "sharing is disabled" => "delen is uitgeschakeld", "For more info, please ask the person who sent this link." => "Voor meer informatie, neem contact op met de persoon die u deze link heeft gestuurd.", -"shared by %s" => "gedeeld door %s", +"Download" => "Downloaden", "Download %s" => "Download %s", "Direct link" => "Directe link" ); diff --git a/apps/files_sharing/l10n/nn_NO.php b/apps/files_sharing/l10n/nn_NO.php index 6f7968e199a83f775407df739cba04a0daa601b3..e85c019d5c72a2028c95e57a51040fd9c752899d 100644 --- a/apps/files_sharing/l10n/nn_NO.php +++ b/apps/files_sharing/l10n/nn_NO.php @@ -8,6 +8,7 @@ $TRANSLATIONS = array( "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." +"For more info, please ask the person who sent this link." => "Spør den som sende deg lenkje om du vil ha meir informasjon.", +"Download" => "Last ned" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/oc.php b/apps/files_sharing/l10n/oc.php index c67cdf272f7ba123fe586ccf15506ef5699c6e35..15ef1720ad2a8e594ba25a70aa3baf39dfaf93e7 100644 --- a/apps/files_sharing/l10n/oc.php +++ b/apps/files_sharing/l10n/oc.php @@ -1,5 +1,6 @@ "Senhal" +"Password" => "Senhal", +"Download" => "Avalcarga" ); $PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/apps/files_sharing/l10n/pa.php b/apps/files_sharing/l10n/pa.php index 6fee1e95f00541999d254482fe3f7c3bdc92633b..43632737a29ed5bb330903d595f8575fe6a59189 100644 --- a/apps/files_sharing/l10n/pa.php +++ b/apps/files_sharing/l10n/pa.php @@ -1,5 +1,6 @@ "ਪਾਸਵਰ" +"Password" => "ਪਾਸਵਰ", +"Download" => "ਡਾਊਨਲੋਡ" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/pl.php b/apps/files_sharing/l10n/pl.php index 4ecdced1a1d36ec319cf18fce36e66f72ac34b1b..bf62ead10766af368cbe6b3625bdbc479f132e72 100644 --- a/apps/files_sharing/l10n/pl.php +++ b/apps/files_sharing/l10n/pl.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "the link expired" => "link wygasł", "sharing is disabled" => "Udostępnianie jest wyłączone", "For more info, please ask the person who sent this link." => "Aby uzyskać więcej informacji proszę poprosić osobę, która wysłał ten link.", -"shared by %s" => "udostępniony przez %s", +"Download" => "Pobierz", "Download %s" => "Pobierz %s", "Direct link" => "Bezpośredni link" ); diff --git a/apps/files_sharing/l10n/pt_BR.php b/apps/files_sharing/l10n/pt_BR.php index 4cd95b09dc382a03cac12c86c2a3482bada5cb94..7167f99c2d24a914623ed3ed7bccb9cc298c650e 100644 --- a/apps/files_sharing/l10n/pt_BR.php +++ b/apps/files_sharing/l10n/pt_BR.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "the link expired" => "o link expirou", "sharing is disabled" => "compartilhamento está desativada", "For more info, please ask the person who sent this link." => "Para mais informações, por favor, pergunte a pessoa que enviou este link.", -"shared by %s" => "compartilhado por %s", +"Download" => "Baixar", "Download %s" => "Baixar %s", "Direct link" => "Link direto" ); diff --git a/apps/files_sharing/l10n/pt_PT.php b/apps/files_sharing/l10n/pt_PT.php index fdcc498fc2032e0be7cadb959db0ae34fc3dad52..b28e2b188dc3bedaed14fcd4fa341102c457732e 100644 --- a/apps/files_sharing/l10n/pt_PT.php +++ b/apps/files_sharing/l10n/pt_PT.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "the link expired" => "O link expirou", "sharing is disabled" => "A partilha está desativada", "For more info, please ask the person who sent this link." => "Para mais informações, por favor questione a pessoa que lhe enviou este link", -"shared by %s" => "partilhada por %s", +"Download" => "Transferir", "Download %s" => "Download %s", "Direct link" => "Link direto" ); diff --git a/apps/files_sharing/l10n/ro.php b/apps/files_sharing/l10n/ro.php index ca0d5e077b0514c07494fb91c15b16c2aca8bf77..024011bf29c40a7082eceade7c88f776015ffc5c 100644 --- a/apps/files_sharing/l10n/ro.php +++ b/apps/files_sharing/l10n/ro.php @@ -1,6 +1,7 @@ "Parola este incorectă. Încercaţi din nou.", -"Password" => "Parolă" +"Password" => "Parolă", +"Download" => "Descarcă" ); $PLURAL_FORMS = "nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));"; diff --git a/apps/files_sharing/l10n/ru.php b/apps/files_sharing/l10n/ru.php index 2b44e29a34586995f34e216e64c4b949df51b676..5920d79d9e5b10a8706cbab66135badb3f69fcca 100644 --- a/apps/files_sharing/l10n/ru.php +++ b/apps/files_sharing/l10n/ru.php @@ -10,7 +10,8 @@ $TRANSLATIONS = array( "the link expired" => "срок ссылки истёк", "sharing is disabled" => "общий доступ отключён", "For more info, please ask the person who sent this link." => "Пожалуйста, обратитесь к отправителю данной ссылки.", -"shared by %s" => "Поделиться с %s", +"Download" => "Скачать", +"Download %s" => "Скачать %s", "Direct link" => "Прямая ссылка" ); $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_sharing/l10n/si_LK.php b/apps/files_sharing/l10n/si_LK.php index 5d3c0d0bed1385da05076c20b0b930442bfa6f43..da0390033af1911438bcbb72f23226b1d3c2bab0 100644 --- a/apps/files_sharing/l10n/si_LK.php +++ b/apps/files_sharing/l10n/si_LK.php @@ -1,5 +1,6 @@ "මුර පදය" +"Password" => "මුර පදය", +"Download" => "බාන්න" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/sk_SK.php b/apps/files_sharing/l10n/sk_SK.php index 6856c0591f401cafe0a715c674e50c48e6ca1ea4..48054b6c7aff6eaca15885db2e3b345039a7a8db 100644 --- a/apps/files_sharing/l10n/sk_SK.php +++ b/apps/files_sharing/l10n/sk_SK.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "the link expired" => "linke vypršala platnosť", "sharing is disabled" => "zdieľanie je zakázané", "For more info, please ask the person who sent this link." => "Pre viac informácií kontaktujte osobu, ktorá vám poslala tento odkaz.", -"shared by %s" => "Zdieľa %s", +"Download" => "Sťahovanie", "Download %s" => "Stiahnuť %s", "Direct link" => "Priama linka" ); diff --git a/apps/files_sharing/l10n/sl.php b/apps/files_sharing/l10n/sl.php index 7c1014b0ef03b9450926c15328ec7fbe86c91f47..361f2f1b04fadadce8411e92376925259752711f 100644 --- a/apps/files_sharing/l10n/sl.php +++ b/apps/files_sharing/l10n/sl.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "the link expired" => "povezava je pretekla,", "sharing is disabled" => "souporaba je onemogočena.", "For more info, please ask the person who sent this link." => "Za več podrobnosti stopite v stik s pošiljateljem te povezave.", -"shared by %s" => "souporabp omogoča %s", +"Download" => "Prejmi", "Download %s" => "Prejmi %s", "Direct link" => "Neposredna povezava" ); diff --git a/apps/files_sharing/l10n/sq.php b/apps/files_sharing/l10n/sq.php index b1db4d5c5467bf7e2a2740d5dd97449ca73c7460..f6729dafc3ee1da9d4fc1e998c6af350f498ce36 100644 --- a/apps/files_sharing/l10n/sq.php +++ b/apps/files_sharing/l10n/sq.php @@ -9,6 +9,7 @@ $TRANSLATIONS = array( "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.", +"Download" => "Shkarko", "Direct link" => "Lidhje direkte" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/sr.php b/apps/files_sharing/l10n/sr.php index bc963ac87b8a53ec824f5d31a3e395fb49b462cb..947e57551ac760e59e74e985c5833ce733a854b7 100644 --- a/apps/files_sharing/l10n/sr.php +++ b/apps/files_sharing/l10n/sr.php @@ -1,5 +1,6 @@ "Лозинка" +"Password" => "Лозинка", +"Download" => "Преузми" ); $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_sharing/l10n/sr@latin.php b/apps/files_sharing/l10n/sr@latin.php index 7d5ba12c6e7dce84aa6ffe79df9204c01f319139..f44821fc0d8b954f5854c9d266b12b70ef999b8e 100644 --- a/apps/files_sharing/l10n/sr@latin.php +++ b/apps/files_sharing/l10n/sr@latin.php @@ -1,5 +1,6 @@ "Lozinka" +"Password" => "Lozinka", +"Download" => "Preuzmi" ); $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_sharing/l10n/sv.php b/apps/files_sharing/l10n/sv.php index 94b7edf6977f80d3267cf32a1d3f58e14374b48a..a1951401d75158529cda41311ec7af889abdd535 100644 --- a/apps/files_sharing/l10n/sv.php +++ b/apps/files_sharing/l10n/sv.php @@ -10,7 +10,7 @@ $TRANSLATIONS = array( "the link expired" => "giltighet för länken har gått ut", "sharing is disabled" => "delning är inaktiverat", "For more info, please ask the person who sent this link." => "För mer information, kontakta den person som skickade den här länken.", -"shared by %s" => "delad av %s", +"Download" => "Ladda ner", "Download %s" => "Ladda ner %s", "Direct link" => "Direkt länk" ); diff --git a/apps/files_sharing/l10n/ta_LK.php b/apps/files_sharing/l10n/ta_LK.php index 3b944d42e64b518ebad2e58e594d6a65504a893d..05443e0522c2ca0d7897265a74cf81248512072a 100644 --- a/apps/files_sharing/l10n/ta_LK.php +++ b/apps/files_sharing/l10n/ta_LK.php @@ -1,6 +1,7 @@ "பகிரப்பட்டது {சொந்தகாரர்}", -"Password" => "கடவுச்சொல்" +"Password" => "கடவுச்சொல்", +"Download" => "பதிவிறக்குக" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/th_TH.php b/apps/files_sharing/l10n/th_TH.php index 706d0a561edff2db3e151adc4ac72e4d92ad6851..f2f90088da76e3390dfacbfeeaaea73f09a9aacd 100644 --- a/apps/files_sharing/l10n/th_TH.php +++ b/apps/files_sharing/l10n/th_TH.php @@ -1,6 +1,7 @@ "ถูกแชร์โดย {owner}", -"Password" => "รหัสผ่าน" +"Password" => "รหัสผ่าน", +"Download" => "ดาวน์โหลด" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_sharing/l10n/tr.php b/apps/files_sharing/l10n/tr.php index 4177221e108883155db716eafe2e23c8946dab0b..ac3cb526562dcb1ed13da6a52824d5ca256ebd9d 100644 --- a/apps/files_sharing/l10n/tr.php +++ b/apps/files_sharing/l10n/tr.php @@ -4,13 +4,13 @@ $TRANSLATIONS = array( "This share is password-protected" => "Bu paylaşım parola korumalı", "The password is wrong. Try again." => "Parola hatalı. Yeniden deneyin.", "Password" => "Parola", -"Sorry, this link doesn’t seem to work anymore." => "Üzgünüz, bu bağlantı artık çalışıyor gibi görünmüyor", +"Sorry, this link doesn’t seem to work anymore." => "Üzgünüz, bu bağlantı artık çalışıyor gibi görünmüyor.", "Reasons might be:" => "Sebepleri şunlar olabilir:", "the item was removed" => "öge kaldırılmış", "the link expired" => "bağlantı süresi dolmuş", "sharing is disabled" => "paylaşım devre dışı", "For more info, please ask the person who sent this link." => "Daha fazla bilgi için bu bağlantıyı aldığınız kişi ile iletişime geçin.", -"shared by %s" => "paylaşan: %s", +"Download" => "İndir", "Download %s" => "İndir: %s", "Direct link" => "Doğrudan bağlantı" ); diff --git a/apps/files_sharing/l10n/ug.php b/apps/files_sharing/l10n/ug.php index 9de41786913e35daaeef22e48da5d339ea61a7ec..fd6a1c71c9b85f020d93f24713b692cf6a37cc88 100644 --- a/apps/files_sharing/l10n/ug.php +++ b/apps/files_sharing/l10n/ug.php @@ -1,5 +1,6 @@ "ئىم" +"Password" => "ئىم", +"Download" => "چۈشۈر" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_sharing/l10n/uk.php b/apps/files_sharing/l10n/uk.php index 204b8e174a0a535f159b63ac6eeada6fa807feda..7b0acb661b63bd7db5e6747eec91d0b9c2638f1c 100644 --- a/apps/files_sharing/l10n/uk.php +++ b/apps/files_sharing/l10n/uk.php @@ -10,6 +10,7 @@ $TRANSLATIONS = array( "the link expired" => "посилання застаріло", "sharing is disabled" => "обмін заборонений", "For more info, please ask the person who sent this link." => "Для отримання додаткової інформації, будь ласка, зверніться до особи, яка надіслала це посилання.", +"Download" => "Завантажити", "Direct link" => "Пряме посилання" ); $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_sharing/l10n/vi.php b/apps/files_sharing/l10n/vi.php index e1a65f27515f5ed511f606f44391f811cc8a3408..1db740c0234147a45cdfeb43a570e7efffc4af64 100644 --- a/apps/files_sharing/l10n/vi.php +++ b/apps/files_sharing/l10n/vi.php @@ -2,6 +2,6 @@ $TRANSLATIONS = array( "Shared by {owner}" => "Được chia sẽ bởi {owner}", "Password" => "Mật khẩu", -"shared by %s" => " Được chia sẻ bởi %s" +"Download" => "Tải về" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_sharing/l10n/zh_CN.php b/apps/files_sharing/l10n/zh_CN.php index 8946741a30dd4d6a209733e6cf354a34bf99c0a2..5cc95b71af70204b59858c9a2e39cce8c74a27f4 100644 --- a/apps/files_sharing/l10n/zh_CN.php +++ b/apps/files_sharing/l10n/zh_CN.php @@ -10,7 +10,8 @@ $TRANSLATIONS = array( "the link expired" => "链接过期", "sharing is disabled" => "共享已禁用", "For more info, please ask the person who sent this link." => "欲知详情,请联系发给你链接的人。", -"shared by %s" => "由 %s 共享", +"Download" => "下载", +"Download %s" => "下载 %s", "Direct link" => "直接链接" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_sharing/l10n/zh_HK.php b/apps/files_sharing/l10n/zh_HK.php index 59043097490357a02a5e278fd26b47c56f512605..3c561acce43c829ec13abc59fa7cafc18fab805c 100644 --- a/apps/files_sharing/l10n/zh_HK.php +++ b/apps/files_sharing/l10n/zh_HK.php @@ -1,5 +1,6 @@ "密碼" +"Password" => "密碼", +"Download" => "下載" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_sharing/l10n/zh_TW.php b/apps/files_sharing/l10n/zh_TW.php index eb591fa35979005ad4e7c2b2c0828536340bc690..07abcb6999d301e4d3bf9bc854cba823b027d099 100644 --- a/apps/files_sharing/l10n/zh_TW.php +++ b/apps/files_sharing/l10n/zh_TW.php @@ -9,6 +9,7 @@ $TRANSLATIONS = array( "the item was removed" => "項目已經移除", "the link expired" => "連結過期", "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." => "請詢問告訴您此連結的人以瞭解更多", +"Download" => "下載" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_sharing/lib/api.php b/apps/files_sharing/lib/api.php index 438d3cc4ba3702e23cc698b201b2a64275ff2866..21fd5d00a4ce227c1c79f2093323e1824d610e6a 100644 --- a/apps/files_sharing/lib/api.php +++ b/apps/files_sharing/lib/api.php @@ -25,7 +25,7 @@ namespace OCA\Files\Share; class Api { /** - * @brief get all shares + * get all shares * * @param array $params option 'file' to limit the result to a specific file/folder * @return \OC_OCS_Result share information @@ -60,7 +60,7 @@ class Api { } /** - * @brief get share information for a given share + * get share information for a given share * * @param array $params which contains a 'id' * @return \OC_OCS_Result share information @@ -76,7 +76,7 @@ class Api { } /** - * @brief collect all share information, either of a specific share or all + * collect all share information, either of a specific share or all * shares for a given path * @param array $params * @return \OC_OCS_Result @@ -130,7 +130,7 @@ class Api { } /** - * @brief add reshares to a array of shares + * add reshares to a array of shares * @param array $shares array of shares * @param int $itemSource item source ID * @return array new shares array which includes reshares @@ -161,7 +161,7 @@ class Api { } /** - * @brief get share from all files in a given folder (non-recursive) + * get share from all files in a given folder (non-recursive) * @param array $params contains 'path' to the folder * @return \OC_OCS_Result */ @@ -196,7 +196,7 @@ class Api { } /** - * @breif create a new share + * create a new share * @param array $params * @return \OC_OCS_Result */ @@ -313,7 +313,7 @@ class Api { } /** - * @brief update permissions for a share + * update permissions for a share * @param array $share information about the share * @param array $params contains 'permissions' * @return \OC_OCS_Result @@ -358,7 +358,7 @@ class Api { } /** - * @brief enable/disable public upload + * enable/disable public upload * @param array $share information about the share * @param array $params contains 'publicUpload' which can be 'yes' or 'no' * @return \OC_OCS_Result @@ -384,9 +384,9 @@ class Api { } /** - * @brief update password for public link share + * update password for public link share * @param array $share information about the share - * @param type $params 'password' + * @param array $params 'password' * @return \OC_OCS_Result */ private static function updatePassword($share, $params) { @@ -418,13 +418,18 @@ class Api { return new \OC_OCS_Result(null, 404, "share doesn't exists, can't change password"); } - $result = \OCP\Share::shareItem( - $itemType, - $itemSource, - \OCP\Share::SHARE_TYPE_LINK, - $shareWith, - $permissions - ); + try { + $result = \OCP\Share::shareItem( + $itemType, + $itemSource, + \OCP\Share::SHARE_TYPE_LINK, + $shareWith, + $permissions + ); + } catch (\Exception $e) { + return new \OC_OCS_Result(null, 403, $e->getMessage()); + } + if($result) { return new \OC_OCS_Result(); } @@ -433,7 +438,7 @@ class Api { } /** - * @brief unshare a file/folder + * unshare a file/folder * @param array $params contains the shareID 'id' which should be unshared * @return \OC_OCS_Result */ @@ -473,7 +478,7 @@ class Api { } /** - * @brief get file ID from a given path + * get file ID from a given path * @param string $path * @return string fileID or null */ @@ -490,7 +495,7 @@ class Api { } /** - * @brief get itemType + * get itemType * @param string $path * @return string type 'file', 'folder' or null of file/folder doesn't exists */ @@ -508,7 +513,7 @@ class Api { } /** - * @brief get some information from a given share + * get some information from a given share * @param int $shareID * @return array with: item_source, share_type, share_with, item_type, permissions */ diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php index 8c680e9c9774516202a75f78c5d619923cf4793b..9d83ed13b87a2be161611303e97a1a918d68ac4d 100644 --- a/apps/files_sharing/lib/cache.php +++ b/apps/files_sharing/lib/cache.php @@ -42,7 +42,7 @@ class Shared_Cache extends Cache { } /** - * @brief Get the source cache of a shared file or folder + * Get the source cache of a shared file or folder * @param string $target Shared target file path * @return \OC\Files\Cache\Cache */ @@ -54,7 +54,7 @@ class Shared_Cache extends Cache { if (isset($source['path']) && isset($source['fileOwner'])) { \OC\Files\Filesystem::initMountPoints($source['fileOwner']); $mounts = \OC\Files\Filesystem::getMountByNumericId($source['storage']); - if (is_array($mounts) and count($mounts)) { + if (is_array($mounts) and !empty($mounts)) { $fullPath = $mounts[0]->getMountPoint() . $source['path']; list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($fullPath); if ($storage) { @@ -80,12 +80,13 @@ class Shared_Cache extends Cache { /** * get the stored metadata of a file or folder * - * @param string /int $file + * @param string|int $file * @return array */ public function get($file) { if (is_string($file)) { - if ($cache = $this->getSourceCache($file)) { + $cache = $this->getSourceCache($file); + if ($cache) { $data = $cache->get($this->files[$file]); $data['displayname_owner'] = \OC_User::getDisplayName($this->storage->getSharedFrom()); $data['path'] = $file; @@ -96,16 +97,17 @@ class Shared_Cache extends Cache { return $data; } } else { + $sourceId = $file; // if we are at the root of the mount point we want to return the // cache information for the source item - if (!is_int($file) || $file === 0) { - $file = $this->storage->getSourceId(); + if (!is_int($sourceId) || $sourceId === 0) { + $sourceId = $this->storage->getSourceId(); } $query = \OC_DB::prepare( 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`,' . ' `size`, `mtime`, `encrypted`, `unencrypted_size`, `storage_mtime`, `etag`' . ' FROM `*PREFIX*filecache` WHERE `fileid` = ?'); - $result = $query->execute(array($file)); + $result = $query->execute(array($sourceId)); $data = $result->fetchRow(); $data['fileid'] = (int)$data['fileid']; $data['mtime'] = (int)$data['mtime']; @@ -124,6 +126,7 @@ class Shared_Cache extends Cache { } if (!is_int($file) || $file === 0) { $data['path'] = ''; + $data['name'] = basename($this->storage->getMountPoint()); $data['is_share_mount_point'] = true; } return $data; @@ -421,7 +424,7 @@ class Shared_Cache extends Cache { * * @param int $id * @param string $pathEnd (optional) used internally for recursive calls - * @return string | null + * @return string|null */ public function getPathById($id, $pathEnd = '') { // direct shares are easy @@ -439,6 +442,9 @@ class Shared_Cache extends Cache { } } + /** + * @param integer $id + */ private function getShareById($id) { $item = \OCP\Share::getItemSharedWithBySource('file', $id); if ($item) { @@ -451,6 +457,9 @@ class Shared_Cache extends Cache { return null; } + /** + * @param integer $id + */ private function getParentInfo($id) { $sql = 'SELECT `parent`, `name` FROM `*PREFIX*filecache` WHERE `fileid` = ?'; $query = \OC_DB::prepare($sql); diff --git a/apps/files_sharing/lib/connector/publicauth.php b/apps/files_sharing/lib/connector/publicauth.php new file mode 100644 index 0000000000000000000000000000000000000000..0831129ce79a2b85a8e009f6671d313c86d6611e --- /dev/null +++ b/apps/files_sharing/lib/connector/publicauth.php @@ -0,0 +1,71 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OCA\Files_Sharing\Connector; + +class PublicAuth extends \Sabre_DAV_Auth_Backend_AbstractBasic { + + /** + * @var \OCP\IConfig + */ + private $config; + + private $share; + + /** + * @param \OCP\IConfig $config + */ + public function __construct($config) { + $this->config = $config; + } + + /** + * Validates a username and password + * + * This method should return true or false depending on if login + * succeeded. + * + * @param string $username + * @param string $password + * + * @return bool + */ + protected function validateUserPass($username, $password) { + $linkItem = \OCP\Share::getShareByToken($username, false); + $this->share = $linkItem; + if (!$linkItem) { + return false; + } + + // check if the share is password protected + if (isset($linkItem['share_with'])) { + if ($linkItem['share_type'] == \OCP\Share::SHARE_TYPE_LINK) { + // Check Password + $forcePortable = (CRYPT_BLOWFISH != 1); + $hasher = new \PasswordHash(8, $forcePortable); + if (!$hasher->CheckPassword($password . $this->config->getSystemValue('passwordsalt', ''), $linkItem['share_with'])) { + return false; + } else { + return true; + } + } else { + return false; + } + } else { + return true; + } + } + + /** + * @return array + */ + public function getShare() { + return $this->share; + } +} diff --git a/apps/files_sharing/lib/helper.php b/apps/files_sharing/lib/helper.php index cc1f7d9ffdf5bd1d55b48d65ee74f98f337b6270..71b496ab944dd069aaa101a52426aa435b45bdb1 100644 --- a/apps/files_sharing/lib/helper.php +++ b/apps/files_sharing/lib/helper.php @@ -79,7 +79,7 @@ class Helper { * @param array $linkItem link item array * @param string $password optional password * - * @return true if authorized, false otherwise + * @return boolean true if authorized, false otherwise */ public static function authenticate($linkItem, $password) { if ($password !== null) { @@ -125,9 +125,13 @@ class Helper { $ids = array(); - while ($path !== '' && $path !== '.' && $path !== '/') { + while ($path !== dirname($path)) { $info = $ownerView->getFileInfo($path); - $ids[] = $info['fileid']; + if ($info instanceof \OC\Files\FileInfo) { + $ids[] = $info['fileid']; + } else { + \OCP\Util::writeLog('sharing', 'No fileinfo available for: ' . $path, \OCP\Util::WARN); + } $path = dirname($path); } @@ -158,7 +162,7 @@ class Helper { } /** - * @brief Format a path to be relative to the /user/files/ directory + * Format a path to be relative to the /user/files/ directory * @param string $path the absolute path * @return string e.g. turns '/admin/files/test.txt' into 'test.txt' */ diff --git a/apps/files_sharing/lib/maintainer.php b/apps/files_sharing/lib/maintainer.php index bbb3268410e641a9309edf7e0f828b2ceb530976..f07c09e5aee48b85f1b079623d785f07d3d6cd6e 100644 --- a/apps/files_sharing/lib/maintainer.php +++ b/apps/files_sharing/lib/maintainer.php @@ -33,7 +33,7 @@ class Maintainer { * Keeps track of the "allow links" config setting * and removes all link shares if the config option is set to "no" * - * @param array with app, key, value as named values + * @param array $params array with app, key, value as named values */ static public function configChangeHook($params) { if($params['app'] === 'core' && $params['key'] === 'shareapi_allow_links' && $params['value'] === 'no') { diff --git a/apps/files_sharing/lib/share/file.php b/apps/files_sharing/lib/share/file.php index c0c9e0c107eda3fd543af9cf3a1ba41a65c042ee..af71786b10466538cf91a91b8f556519f8a0ef1e 100644 --- a/apps/files_sharing/lib/share/file.php +++ b/apps/files_sharing/lib/share/file.php @@ -33,10 +33,12 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent { private $path; public function isValidSource($itemSource, $uidOwner) { - $query = \OC_DB::prepare('SELECT `name` FROM `*PREFIX*filecache` WHERE `fileid` = ?'); - $result = $query->execute(array($itemSource)); - if ($row = $result->fetchRow()) { - $this->path = $row['name']; + $path = \OC\Files\Filesystem::getPath($itemSource); + if ($path) { + // FIXME: attributes should not be set here, + // keeping this pattern for now to avoid unexpected + // regressions + $this->path = basename($path); return true; } return false; @@ -52,7 +54,7 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent { } /** - * @brief create unique target + * create unique target * @param string $filePath * @param string $shareWith * @param string $exclude @@ -152,7 +154,7 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent { } /** - * @brief resolve reshares to return the correct source item + * resolve reshares to return the correct source item * @param array $source * @return array source item */ @@ -181,8 +183,13 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent { return $source; } + /** + * @param string $target + * @param string $mountPoint + * @param string $itemType + * @return array|false source item + */ public static function getSource($target, $mountPoint, $itemType) { - if ($itemType === 'folder') { $source = \OCP\Share::getItemSharedWith('folder', $mountPoint, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE); if ($source && $target !== '') { diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php index 5e478d5ead8557435df085bcb7632c887a3d4df4..4b69276d05a2e9daf45fabda71ee4b369d301567 100644 --- a/apps/files_sharing/lib/sharedstorage.php +++ b/apps/files_sharing/lib/sharedstorage.php @@ -36,7 +36,7 @@ class Shared extends \OC\Files\Storage\Common { } /** - * @breif get id of the mount point + * get id of the mount point * @return string */ public function getId() { @@ -44,7 +44,7 @@ class Shared extends \OC\Files\Storage\Common { } /** - * @breif get file cache of the shared item source + * get file cache of the shared item source * @return string */ public function getSourceId() { @@ -52,9 +52,8 @@ class Shared extends \OC\Files\Storage\Common { } /** - * @brief Get the source file path, permissions, and owner for a shared file - * @param string Shared target file path - * @param string $target + * Get the source file path, permissions, and owner for a shared file + * @param string $target Shared target file path * @return Returns array with the keys path, permissions, and owner or false if not found */ public function getFile($target) { @@ -76,9 +75,8 @@ class Shared extends \OC\Files\Storage\Common { } /** - * @brief Get the source file path for a shared file - * @param string Shared target file path - * @param string $target + * Get the source file path for a shared file + * @param string $target Shared target file path * @return string source file path or false if not found */ public function getSourcePath($target) { @@ -87,10 +85,11 @@ class Shared extends \OC\Files\Storage\Common { if (!isset($source['fullPath'])) { \OC\Files\Filesystem::initMountPoints($source['fileOwner']); $mount = \OC\Files\Filesystem::getMountByNumericId($source['storage']); - if (is_array($mount)) { + if (is_array($mount) && !empty($mount)) { $this->files[$target]['fullPath'] = $mount[key($mount)]->getMountPoint() . $source['path']; } else { $this->files[$target]['fullPath'] = false; + \OCP\Util::writeLog('files_sharing', "Unable to get mount for shared storage '" . $source['storage'] . "' user '" . $source['fileOwner'] . "'", \OCP\Util::ERROR); } } return $this->files[$target]['fullPath']; @@ -99,16 +98,17 @@ class Shared extends \OC\Files\Storage\Common { } /** - * @brief Get the permissions granted for a shared file - * @param string Shared target file path - * @return int CRUDS permissions granted or false if not found + * Get the permissions granted for a shared file + * @param string $target Shared target file path + * @return int CRUDS permissions granted */ public function getPermissions($target) { - $source = $this->getFile($target); - if ($source) { - return $source['permissions']; + $permissions = $this->share['permissions']; + // part file are always have delete permissions + if (pathinfo($target, PATHINFO_EXTENSION) === 'part') { + $permissions |= \OCP\PERMISSION_DELETE; } - return false; + return $permissions; } public function mkdir($path) { @@ -182,9 +182,6 @@ class Shared extends \OC\Files\Storage\Common { } public function isCreatable($path) { - if ($path == '') { - $path = $this->getMountPoint(); - } return ($this->getPermissions($path) & \OCP\PERMISSION_CREATE); } @@ -193,23 +190,14 @@ class Shared extends \OC\Files\Storage\Common { } public function isUpdatable($path) { - if ($path == '') { - $path = $this->getMountPoint(); - } return ($this->getPermissions($path) & \OCP\PERMISSION_UPDATE); } public function isDeletable($path) { - if ($path == '') { - $path = $this->getMountPoint(); - } return ($this->getPermissions($path) & \OCP\PERMISSION_DELETE); } public function isSharable($path) { - if ($path == '') { - $path = $this->getMountPoint(); - } return ($this->getPermissions($path) & \OCP\PERMISSION_SHARE); } @@ -275,7 +263,7 @@ class Shared extends \OC\Files\Storage\Common { } /** - * @brief Format a path to be relative to the /user/files/ directory + * Format a path to be relative to the /user/files/ directory * @param string $path the absolute path * @return string e.g. turns '/admin/files/test.txt' into '/test.txt' */ @@ -299,7 +287,7 @@ class Shared extends \OC\Files\Storage\Common { } /** - * @brief rename a shared folder/file + * rename a shared folder/file * @param string $sourcePath * @param string $targetPath * @return bool @@ -378,7 +366,15 @@ class Shared extends \OC\Files\Storage\Common { // otherwise DELETE and CREATE permissions required ($this->isDeletable($path1) && $this->isCreatable(dirname($path2)))) { - list($user1, $path1) = \OCA\Files_Sharing\Helper::getUidAndFilename($relPath1); + $pathinfo = pathinfo($relPath1); + // for part files we need to ask for the owner and path from the parent directory because + // the file cache doesn't return any results for part files + if ($pathinfo['extension'] === 'part') { + list($user1, $path1) = \OCA\Files_Sharing\Helper::getUidAndFilename($pathinfo['dirname']); + $path1 = $path1 . '/' . $pathinfo['basename']; + } else { + list($user1, $path1) = \OCA\Files_Sharing\Helper::getUidAndFilename($relPath1); + } $targetFilename = basename($relPath2); list($user2, $path2) = \OCA\Files_Sharing\Helper::getUidAndFilename(dirname($relPath2)); $rootView = new \OC\Files\View(''); @@ -445,9 +441,6 @@ class Shared extends \OC\Files\Storage\Common { } public function free_space($path) { - if ($path == '') { - $path = $this->getMountPoint(); - } $source = $this->getSourcePath($path); if ($source) { list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($source); @@ -488,7 +481,7 @@ class Shared extends \OC\Files\Storage\Common { } /** - * @brief return mount point of share, relative to data/user/files + * return mount point of share, relative to data/user/files * @return string */ public function getMountPoint() { @@ -496,7 +489,7 @@ class Shared extends \OC\Files\Storage\Common { } /** - * @brief get share type + * get share type * @return integer can be single user share (0) group share (1), unique group share name (2) */ private function getShareType() { @@ -508,7 +501,7 @@ class Shared extends \OC\Files\Storage\Common { } /** - * @brief does the group share already has a user specific unique name + * does the group share already has a user specific unique name * @return bool */ private function uniqueNameSet() { @@ -516,14 +509,14 @@ class Shared extends \OC\Files\Storage\Common { } /** - * @brief the share now uses a unique name of this user + * the share now uses a unique name of this user */ private function setUniqueName() { $this->share['unique_name'] = true; } /** - * @brief get share ID + * get share ID * @return integer unique share ID */ private function getShareId() { @@ -531,7 +524,7 @@ class Shared extends \OC\Files\Storage\Common { } /** - * @brief get the user who shared the file + * get the user who shared the file * @return string */ public function getSharedFrom() { @@ -539,7 +532,7 @@ class Shared extends \OC\Files\Storage\Common { } /** - * @brief return share type, can be "file" or "folder" + * return share type, can be "file" or "folder" * @return string */ public function getItemType() { diff --git a/apps/files_sharing/lib/updater.php b/apps/files_sharing/lib/updater.php index f7c0a75aeeb200e5c1ce17218958fa1699c989bd..21d67caad9d016838f82346f88f9430624623c8a 100644 --- a/apps/files_sharing/lib/updater.php +++ b/apps/files_sharing/lib/updater.php @@ -27,7 +27,7 @@ class Shared_Updater { static private $toRemove = array(); /** - * @brief walk up the users file tree and update the etags + * walk up the users file tree and update the etags * @param string $user * @param string $path */ @@ -38,14 +38,13 @@ class Shared_Updater { \OC\Files\Filesystem::initMountPoints($user); $view = new \OC\Files\View('/' . $user); if ($view->file_exists($path)) { - while ($path !== '/') { + while ($path !== dirname($path)) { $etag = $view->getETag($path); $view->putFileInfo($path, array('etag' => $etag)); $path = dirname($path); } } else { - error_log("error!" . 'can not update etags on ' . $path . ' for user ' . $user); - \OCP\Util::writeLog('files_sharing', 'can not update etags on ' . $path . ' for user ' . $user, \OCP\Util::ERROR); + \OCP\Util::writeLog('files_sharing', 'can not update etags on ' . $path . ' for user ' . $user . '. Path does not exists', \OCP\Util::DEBUG); } } @@ -55,6 +54,12 @@ class Shared_Updater { * @param string $target */ static public function correctFolders($target) { + + // ignore part files + if (pathinfo($target, PATHINFO_EXTENSION) === 'part') { + return false; + } + // Correct Shared folders of other users shared with $shares = \OCA\Files_Sharing\Helper::getSharesFromItem($target); @@ -73,7 +78,7 @@ class Shared_Updater { } /** - * @brief remove all shares for a given file if the file was deleted + * remove all shares for a given file if the file was deleted * * @param string $path */ diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php index ce51eca6ddb8928bfbfbbec9f99cd1abe291d131..8a86cb3806a6f2c29ca3017ca93ae9fc6e621bea 100644 --- a/apps/files_sharing/public.php +++ b/apps/files_sharing/public.php @@ -138,6 +138,7 @@ if (isset($path)) { OCP\Util::addStyle('files', 'files'); OCP\Util::addStyle('files', 'upload'); + OCP\Util::addScript('files', 'filesummary'); OCP\Util::addScript('files', 'breadcrumb'); OCP\Util::addScript('files', 'files'); OCP\Util::addScript('files', 'filelist'); @@ -148,11 +149,11 @@ if (isset($path)) { $freeSpace=OCP\Util::freeSpace($path); $uploadLimit=OCP\Util::uploadLimit(); - $folder = new OCP\Template('files', 'index', ''); + $folder = new OCP\Template('files', 'list', ''); $folder->assign('dir', $getPath); $folder->assign('dirToken', $linkItem['token']); $folder->assign('permissions', OCP\PERMISSION_READ); - $folder->assign('isPublic',true); + $folder->assign('isPublic', true); $folder->assign('publicUploadEnabled', 'no'); $folder->assign('files', $files); $folder->assign('uploadMaxFilesize', $maxUploadFilesize); @@ -161,15 +162,15 @@ if (isset($path)) { $folder->assign('uploadLimit', $uploadLimit); // PHP upload limit $folder->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true))); $folder->assign('usedSpacePercent', 0); - $folder->assign('disableSharing', true); $folder->assign('trash', false); $tmpl->assign('folder', $folder->fetchPage()); - $maxInputFileSize = OCP\Config::getSystemValue('maxZipInputSize', OCP\Util::computerFileSize('800 MB')); $allowZip = OCP\Config::getSystemValue('allowZipDownload', true); $tmpl->assign('allowZipDownload', intval($allowZip)); + $tmpl->assign('showDownloadButton', intval($allowZip)); $tmpl->assign('downloadURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=' . urlencode($getPath)); } else { + $tmpl->assign('showDownloadButton', true); $tmpl->assign('dir', $dir); // Show file preview if viewer is available diff --git a/apps/files_sharing/publicwebdav.php b/apps/files_sharing/publicwebdav.php new file mode 100644 index 0000000000000000000000000000000000000000..954c3a3144d2dbe6bcfb0a66184e84cb05c0c4e2 --- /dev/null +++ b/apps/files_sharing/publicwebdav.php @@ -0,0 +1,58 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +// load needed apps +$RUNTIME_APPTYPES = array('filesystem', 'authentication', 'logging'); + +OC_App::loadApps($RUNTIME_APPTYPES); + +OC_Util::obEnd(); + +// Backends +$authBackend = new OCA\Files_Sharing\Connector\PublicAuth(\OC::$server->getConfig()); +$lockBackend = new OC_Connector_Sabre_Locks(); +$requestBackend = new OC_Connector_Sabre_Request(); + +// Fire up server +$objectTree = new \OC\Connector\Sabre\ObjectTree(); +$server = new OC_Connector_Sabre_Server($objectTree); +$server->httpRequest = $requestBackend; +$server->setBaseUri($baseuri); + +// Load plugins +$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_FilesPlugin()); +$server->addPlugin(new OC_Connector_Sabre_MaintenancePlugin()); +$server->addPlugin(new OC_Connector_Sabre_ExceptionLoggerPlugin('webdav')); + +// wait with registering these until auth is handled and the filesystem is setup +$server->subscribeEvent('beforeMethod', function () use ($server, $objectTree, $authBackend) { + $share = $authBackend->getShare(); + $owner = $share['uid_owner']; + $fileId = $share['file_source']; + OC_Util::setupFS($owner); + $ownerView = \OC\Files\Filesystem::getView(); + $path = $ownerView->getPath($fileId); + + + $view = new \OC\Files\View($ownerView->getAbsolutePath($path)); + $rootInfo = $view->getFileInfo(''); + + // Create ownCloud Dir + $rootDir = new OC_Connector_Sabre_Directory($view, $rootInfo); + $objectTree->init($rootDir, $view); + + $server->addPlugin(new OC_Connector_Sabre_AbortedUploadDetectionPlugin($view)); + $server->addPlugin(new OC_Connector_Sabre_QuotaPlugin($view)); +}, 30); // priority 30: after auth (10) and acl(20), before lock(50) and handling the request + +// And off we go! +$server->exec(); diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index fc8d59e1e892a82f02686c22248ee7a11098fd33..9471752b6b5d493bc9d2e58c0978a5d68353ee2b 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -1,3 +1,4 @@ +
@@ -14,7 +15,12 @@ src="" alt="getName()); ?>" />
- t('shared by %s', array($_['displayName']))) ?> + + + "/> + t('Download'))?> + +
@@ -24,7 +30,6 @@
-
@@ -35,7 +40,10 @@
- +
diff --git a/apps/files_sharing/tests/api.php b/apps/files_sharing/tests/api.php index b2f05d10ac6e5e22cbe548b73fb1e10bb7ab1d27..dc07c6fc6201a7b0b825ec235c6152d637199b15 100644 --- a/apps/files_sharing/tests/api.php +++ b/apps/files_sharing/tests/api.php @@ -29,10 +29,14 @@ use OCA\Files\Share; */ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base { + const TEST_FOLDER_NAME = '/folder_share_api_test'; + + private static $tempStorage; + function setUp() { parent::setUp(); - $this->folder = '/folder_share_api_test'; + $this->folder = self::TEST_FOLDER_NAME; $this->subfolder = '/subfolder_share_api_test'; $this->subsubfolder = '/subsubfolder_share_api_test'; @@ -51,6 +55,8 @@ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base { $this->view->unlink($this->filename); $this->view->deleteAll($this->folder); + self::$tempStorage = null; + parent::tearDown(); } @@ -107,11 +113,65 @@ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base { $fileinfo = $this->view->getFileInfo($this->folder); \OCP\Share::unshare('folder', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_LINK, null); + } + + function testEnfoceLinkPassword() { + + $appConfig = \OC::$server->getAppConfig(); + $appConfig->setValue('core', 'shareapi_enforce_links_password', 'yes'); + + // don't allow to share link without a password + $_POST['path'] = $this->folder; + $_POST['shareType'] = \OCP\Share::SHARE_TYPE_LINK; + + + $result = Share\Api::createShare(array()); + $this->assertFalse($result->succeeded()); + + + // don't allow to share link without a empty password + $_POST['path'] = $this->folder; + $_POST['shareType'] = \OCP\Share::SHARE_TYPE_LINK; + $_POST['password'] = ''; + + $result = Share\Api::createShare(array()); + $this->assertFalse($result->succeeded()); + + // share with password should succeed + $_POST['path'] = $this->folder; + $_POST['shareType'] = \OCP\Share::SHARE_TYPE_LINK; + $_POST['password'] = 'foo'; + $result = Share\Api::createShare(array()); + $this->assertTrue($result->succeeded()); + + $data = $result->getData(); + // setting new password should succeed + $params = array(); + $params['id'] = $data['id']; + $params['_put'] = array(); + $params['_put']['password'] = 'bar'; + $result = Share\Api::updateShare($params); + $this->assertTrue($result->succeeded()); + + // removing password should fail + $params = array(); + $params['id'] = $data['id']; + $params['_put'] = array(); + $params['_put']['password'] = ''; + + $result = Share\Api::updateShare($params); + $this->assertFalse($result->succeeded()); + + // cleanup + $fileinfo = $this->view->getFileInfo($this->folder); + \OCP\Share::unshare('folder', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_LINK, null); + $appConfig->setValue('core', 'shareapi_enforce_links_password', 'no'); } + /** * @medium * @depends testCreateShare @@ -127,7 +187,7 @@ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base { $this->assertTrue($result->succeeded()); - // test should return two shares created from testCreateShare() + // test should return two shares created from testCreateShare() $this->assertTrue(count($result->getData()) === 1); \OCP\Share::unshare('file', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_USER, @@ -154,7 +214,7 @@ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base { $this->assertTrue($result->succeeded()); - // test should return one share created from testCreateShare() + // test should return one share created from testCreateShare() $this->assertTrue(count($result->getData()) === 2); \OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, @@ -281,7 +341,7 @@ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base { $this->assertTrue($result->succeeded()); - // test should return one share within $this->folder + // test should return one share within $this->folder $this->assertTrue(count($result->getData()) === 1); \OCP\Share::unshare('file', $fileInfo1['fileid'], \OCP\Share::SHARE_TYPE_USER, @@ -292,7 +352,7 @@ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base { } /** - * @brief share a folder, than reshare a file within the shared folder and check if we construct the correct path + * share a folder, than reshare a file within the shared folder and check if we construct the correct path * @medium */ function testGetShareFromFolderReshares() { @@ -357,7 +417,7 @@ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base { } /** - * @brief reshare a sub folder and check if we get the correct path + * reshare a sub folder and check if we get the correct path * @medium */ function testGetShareFromSubFolderReShares() { @@ -410,7 +470,7 @@ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base { } /** - * @brief test re-re-share of folder if the path gets constructed correctly + * test re-re-share of folder if the path gets constructed correctly * @medium */ function testGetShareFromFolderReReShares() { @@ -478,7 +538,7 @@ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base { } /** - * @brief test multiple shared folder if the path gets constructed correctly + * test multiple shared folder if the path gets constructed correctly * @medium */ function testGetShareMultipleSharedFolder() { @@ -561,7 +621,7 @@ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base { } /** - * @brief test re-re-share of folder if the path gets constructed correctly + * test re-re-share of folder if the path gets constructed correctly * @medium */ function testGetShareFromFileReReShares() { @@ -638,7 +698,7 @@ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base { $result = Share\Api::getShare($params); $this->assertEquals(404, $result->getStatusCode()); - $meta = $result->getMeta(); + $meta = $result->getMeta(); $this->assertEquals('share doesn\'t exist', $meta['message']); } @@ -695,7 +755,7 @@ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base { $result = Share\Api::updateShare($params); - $meta = $result->getMeta(); + $meta = $result->getMeta(); $this->assertTrue($result->succeeded(), $meta['message']); $items = \OCP\Share::getItemShared('file', $userShare['file_source']); @@ -835,7 +895,7 @@ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base { } /** - * @brief test unshare of a reshared file + * test unshare of a reshared file */ function testDeleteReshare() { @@ -879,7 +939,7 @@ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base { } /** - * @brief share a folder which contains a share mount point, should be forbidden + * share a folder which contains a share mount point, should be forbidden */ public function testShareFolderWithAMountPoint() { // user 1 shares a folder with user2 @@ -928,6 +988,54 @@ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base { \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2); } + /** + * Post init mount points hook for mounting simulated ext storage + */ + public static function initTestMountPointsHook($data) { + if ($data['user'] === \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER1) { + \OC\Files\Filesystem::mount(self::$tempStorage, array(), '/' . \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER1 . '/files' . self::TEST_FOLDER_NAME); + } + } + + /** + * Tests mounting a folder that is an external storage mount point. + */ + public function testShareStorageMountPoint() { + self::$tempStorage = new \OC\Files\Storage\Temporary(array()); + self::$tempStorage->file_put_contents('test.txt', 'abcdef'); + self::$tempStorage->getScanner()->scan(''); + + // needed because the sharing code sometimes switches the user internally and mounts the user's + // storages. In our case the temp storage isn't mounted automatically, so doing it in the post hook + // (similar to how ext storage works) + OCP\Util::connectHook('OC_Filesystem', 'post_initMountPoints', '\Test_Files_Sharing_Api', 'initTestMountPointsHook'); + + // logging in will auto-mount the temp storage for user1 as well + \Test_Files_Sharing_Api::loginHelper(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER1); + + $fileInfo = $this->view->getFileInfo($this->folder); + + // user 1 shares the mount point folder with user2 + $result = \OCP\Share::shareItem('folder', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, + \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2, 31); + + $this->assertTrue($result); + + // user2: check that mount point name appears correctly + \Test_Files_Sharing_Api::loginHelper(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2); + + $view = new \OC\Files\View('/' . \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2 . '/files'); + + $this->assertTrue($view->file_exists($this->folder)); + $this->assertTrue($view->file_exists($this->folder . '/test.txt')); + + \Test_Files_Sharing_Api::loginHelper(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER1); + + \OCP\Share::unshare('folder', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, + \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2); + + \OC_Hook::clear('OC_Filesystem', 'post_initMountPoints', '\Test_Files_Sharing_Api', 'initTestMountPointsHook'); + } /** * @expectedException \Exception */ @@ -951,4 +1059,57 @@ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base { \OCP\Share::shareItem('file', $info->getId(), \OCP\Share::SHARE_TYPE_LINK, \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2, 31); } + public function testDefaultExpireDate() { + \Test_Files_Sharing_Api::loginHelper(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER1); + \OC_Appconfig::setValue('core', 'shareapi_default_expire_date', 'yes'); + \OC_Appconfig::setValue('core', 'shareapi_enforce_expire_date', 'yes'); + \OC_Appconfig::setValue('core', 'shareapi_expire_after_n_days', '2'); + + // default expire date is set to 2 days + // the time when the share was created is set to 3 days in the past + // user defined expire date is set to +2 days from now on + // -> link should be already expired by the default expire date but the user + // share should still exists. + $now = time(); + $dateFormat = 'Y-m-d H:i:s'; + $shareCreated = $now - 3 * 24 * 60 * 60; + $expireDate = date($dateFormat, $now + 2 * 24 * 60 * 60); + + $info = OC\Files\Filesystem::getFileInfo($this->filename); + $this->assertTrue($info instanceof \OC\Files\FileInfo); + + $result = \OCP\Share::shareItem('file', $info->getId(), \OCP\Share::SHARE_TYPE_LINK, null, \OCP\PERMISSION_READ); + $this->assertTrue(is_string($result)); + + $result = \OCP\Share::shareItem('file', $info->getId(), \OCP\Share::SHARE_TYPE_USER, \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2, 31); + $this->assertTrue($result); + + $result = \OCP\Share::setExpirationDate('file', $info->getId() , $expireDate); + $this->assertTrue($result); + + //manipulate stime so that both shares are older then the default expire date + $statement = "UPDATE `*PREFIX*share` SET `stime` = ? WHERE `share_type` = ?"; + $query = \OCP\DB::prepare($statement); + $result = $query->execute(array($shareCreated, \OCP\Share::SHARE_TYPE_LINK)); + $this->assertSame(1, $result); + $statement = "UPDATE `*PREFIX*share` SET `stime` = ? WHERE `share_type` = ?"; + $query = \OCP\DB::prepare($statement); + $result = $query->execute(array($shareCreated, \OCP\Share::SHARE_TYPE_USER)); + $this->assertSame(1, $result); + + // now the link share should expire because of enforced default expire date + // the user share should still exist + $result = \OCP\Share::getItemShared('file', $info->getId()); + $this->assertTrue(is_array($result)); + $this->assertSame(1, count($result)); + $share = reset($result); + $this->assertSame(\OCP\Share::SHARE_TYPE_USER, $share['share_type']); + + //cleanup + $result = \OCP\Share::unshare('file', $info->getId(), \OCP\Share::SHARE_TYPE_USER, \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2); + $this->assertTrue($result); + \OC_Appconfig::setValue('core', 'shareapi_default_expire_date', 'no'); + \OC_Appconfig::setValue('core', 'shareapi_enforce_expire_date', 'no'); + + } } diff --git a/apps/files_sharing/tests/base.php b/apps/files_sharing/tests/base.php index 495dca072c72759af0ce50a5a5630065031e4366..7cd36b9d419833cef23c36719a63c09019b3c9dc 100644 --- a/apps/files_sharing/tests/base.php +++ b/apps/files_sharing/tests/base.php @@ -39,7 +39,7 @@ abstract class Test_Files_Sharing_Base extends \PHPUnit_Framework_TestCase { public $filename; public $data; /** - * @var OC_FilesystemView + * @var OC\Files\View */ public $view; public $folder; @@ -68,7 +68,7 @@ abstract class Test_Files_Sharing_Base extends \PHPUnit_Framework_TestCase { self::loginHelper(self::TEST_FILES_SHARING_API_USER1); $this->data = 'foobar'; - $this->view = new \OC_FilesystemView('/' . self::TEST_FILES_SHARING_API_USER1 . '/files'); + $this->view = new \OC\Files\View('/' . self::TEST_FILES_SHARING_API_USER1 . '/files'); // remember files_encryption state $this->stateFilesEncryption = \OC_App::isEnabled('files_encryption'); @@ -97,7 +97,7 @@ abstract class Test_Files_Sharing_Base extends \PHPUnit_Framework_TestCase { } /** - * @param $user + * @param string $user * @param bool $create * @param bool $password */ @@ -119,7 +119,7 @@ abstract class Test_Files_Sharing_Base extends \PHPUnit_Framework_TestCase { } /** - * @brief get some information from a given share + * get some information from a given share * @param int $shareID * @return array with: item_source, share_type, share_with, item_type, permissions */ diff --git a/apps/files_sharing/tests/cache.php b/apps/files_sharing/tests/cache.php index 1af73c558d553c476f0386a536c5b18ee244141b..c5408ba55e7ceccb13fbd40505c960587cf71d1b 100644 --- a/apps/files_sharing/tests/cache.php +++ b/apps/files_sharing/tests/cache.php @@ -25,7 +25,7 @@ require_once __DIR__ . '/base.php'; class Test_Files_Sharing_Cache extends Test_Files_Sharing_Base { /** - * @var OC_FilesystemView + * @var OC\Files\View */ public $user2View; @@ -230,7 +230,7 @@ class Test_Files_Sharing_Cache extends Test_Files_Sharing_Base { } /** - * @brief verify if each value from the result matches the expected result + * verify if each value from the result matches the expected result * @param array $example array with the expected results * @param array $result array with the results */ diff --git a/apps/files_sharing/tests/sharedstorage.php b/apps/files_sharing/tests/sharedstorage.php new file mode 100644 index 0000000000000000000000000000000000000000..66518a2633fb87bf48582de292456a3c72a2237f --- /dev/null +++ b/apps/files_sharing/tests/sharedstorage.php @@ -0,0 +1,83 @@ + + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library 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 AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this library. If not, see . + * + */ + +require_once __DIR__ . '/base.php'; + +use OCA\Files\Share; + +/** + * Class Test_Files_Sharing_Api + */ +class Test_Files_Sharing_Storage extends Test_Files_Sharing_Base { + + function setUp() { + parent::setUp(); + + $this->folder = '/folder_share_storage_test'; + + $this->filename = '/share-api-storage.txt'; + + // save file with content + $this->view->mkdir($this->folder); + } + + function tearDown() { + $this->view->deleteAll($this->folder); + + parent::tearDown(); + } + + /** + * @medium + */ + function testRenamePartFile() { + + // share to user + $fileinfo = $this->view->getFileInfo($this->folder); + $result = \OCP\Share::shareItem('folder', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_USER, + self::TEST_FILES_SHARING_API_USER2, 31); + + $this->assertTrue($result); + + self::loginHelper(self::TEST_FILES_SHARING_API_USER2); + $user2View = new \OC\Files\View('/' . self::TEST_FILES_SHARING_API_USER2 . '/files'); + + $this->assertTrue($user2View->file_exists($this->folder)); + + // create part file + $result = $user2View->file_put_contents($this->folder. '/foo.txt.part', 'some test data'); + + $this->assertTrue(is_int($result)); + // rename part file to real file + $result = $user2View->rename($this->folder. '/foo.txt.part', $this->folder. '/foo.txt'); + + $this->assertTrue($result); + + // check if the new file really exists + $this->assertTrue($user2View->file_exists( $this->folder. '/foo.txt')); + + // check if the rename also affected the owner + self::loginHelper(self::TEST_FILES_SHARING_API_USER1); + + $this->assertTrue($this->view->file_exists( $this->folder. '/foo.txt')); + } +} diff --git a/apps/files_trashbin/ajax/list.php b/apps/files_trashbin/ajax/list.php index 89a5511452449ccb416cbac15ca2952c723c19a7..e1f52e814bb2f206299721e0bf8eac591ce1eee4 100644 --- a/apps/files_trashbin/ajax/list.php +++ b/apps/files_trashbin/ajax/list.php @@ -4,11 +4,13 @@ OCP\JSON::checkLoggedIn(); // Load the files $dir = isset( $_GET['dir'] ) ? $_GET['dir'] : ''; +$sortAttribute = isset( $_GET['sort'] ) ? $_GET['sort'] : 'name'; +$sortDirection = isset( $_GET['sortdirection'] ) ? ($_GET['sortdirection'] === 'desc') : false; $data = array(); // make filelist try { - $files = \OCA\Files_Trashbin\Helper::getTrashFiles($dir); + $files = \OCA\Files_Trashbin\Helper::getTrashFiles($dir, $sortAttribute, $sortDirection); } catch (Exception $e) { header("HTTP/1.0 404 Not Found"); exit(); diff --git a/apps/files_trashbin/appinfo/app.php b/apps/files_trashbin/appinfo/app.php index d30a601ef564c0282fdbed5715cf62f394cd114d..b8900ee0de3a48cb781ae5dd4e630dcb57f04316 100644 --- a/apps/files_trashbin/appinfo/app.php +++ b/apps/files_trashbin/appinfo/app.php @@ -1,7 +1,15 @@ add( +array( + "id" => 'trashbin', + "appname" => 'files_trashbin', + "script" => 'list.php', + "order" => 1, + "name" => $l->t('Deleted files') +) +); diff --git a/apps/files_trashbin/appinfo/routes.php b/apps/files_trashbin/appinfo/routes.php index b1c3f02741edde288e37139dad7a59d9dba63969..42398a06c8b38c7c48f01b01a4c4c2cc98ab9aaa 100644 --- a/apps/files_trashbin/appinfo/routes.php +++ b/apps/files_trashbin/appinfo/routes.php @@ -1,5 +1,6 @@ create('core_ajax_trashbin_preview', '/preview.png')->action( +/** @var $this \OCP\Route\IRouter */ +$this->create('core_ajax_trashbin_preview', '/preview')->action( function() { require_once __DIR__ . '/../ajax/preview.php'; -}); \ No newline at end of file +}); diff --git a/apps/files_trashbin/css/trash.css b/apps/files_trashbin/css/trash.css index 7ca3e355fc211bf02aabb20bb036710279d52a6e..04b4a175c83354dfcbc0507f6d0156ee0c819066 100644 --- a/apps/files_trashbin/css/trash.css +++ b/apps/files_trashbin/css/trash.css @@ -1,4 +1,13 @@ -#fileList tr[data-type="file"] td a.name, -#fileList tr[data-type="file"] td a.name span { +/* + * Copyright (c) 2014 + * + * This file is licensed under the Affero General Public License version 3 + * or later. + * + * See the COPYING-README file. + * + */ +#app-content-trashbin tbody tr[data-type="file"] td a.name, +#app-content-trashbin tbody tr[data-type="file"] td a.name span { cursor: default; } diff --git a/apps/files_trashbin/index.php b/apps/files_trashbin/index.php deleted file mode 100644 index e63fe1e4188e46e2052818e53b3873d5b6b8d1a0..0000000000000000000000000000000000000000 --- a/apps/files_trashbin/index.php +++ /dev/null @@ -1,41 +0,0 @@ - 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_trashbin', 'index.php') . '#?dir=' . \OCP\Util::encodePath($dir)); - exit(); -} - -$tmpl->assign('dir', $dir); -$tmpl->assign('disableSharing', true); - -$tmpl->printPage(); diff --git a/apps/files_trashbin/js/app.js b/apps/files_trashbin/js/app.js new file mode 100644 index 0000000000000000000000000000000000000000..aa499ae1791b61660b4ea36b272bf419b5b9d830 --- /dev/null +++ b/apps/files_trashbin/js/app.js @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2014 + * + * This file is licensed under the Affero General Public License version 3 + * or later. + * + * See the COPYING-README file. + * + */ + +OCA.Trashbin = {}; +OCA.Trashbin.App = { + _initialized: false, + + initialize: function($el) { + if (this._initialized) { + return; + } + this._initialized = true; + this.fileList = new OCA.Trashbin.FileList( + $('#app-content-trashbin'), { + scrollContainer: $('#app-content') + } + ); + this.registerFileActions(this.fileList); + }, + + registerFileActions: function(fileList) { + var self = this; + var fileActions = _.extend({}, OCA.Files.FileActions); + fileActions.clear(); + fileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename) { + var dir = fileList.getCurrentDirectory(); + if (dir !== '/') { + dir = dir + '/'; + } + fileList.changeDirectory(dir + filename); + }); + + fileActions.setDefault('dir', 'Open'); + + fileActions.register('all', 'Restore', OC.PERMISSION_READ, OC.imagePath('core', 'actions/history'), function(filename) { + var tr = fileList.findFileEl(filename); + var deleteAction = tr.children("td.date").children(".action.delete"); + deleteAction.removeClass('delete-icon').addClass('progress-icon'); + fileList.disableActions(); + $.post(OC.filePath('files_trashbin', 'ajax', 'undelete.php'), { + files: JSON.stringify([filename]), + dir: fileList.getCurrentDirectory() + }, + _.bind(fileList._removeCallback, fileList) + ); + }, t('files_trashbin', 'Restore')); + + fileActions.register('all', 'Delete', OC.PERMISSION_READ, function() { + return OC.imagePath('core', 'actions/delete'); + }, function(filename) { + $('.tipsy').remove(); + var tr = fileList.findFileEl(filename); + var deleteAction = tr.children("td.date").children(".action.delete"); + deleteAction.removeClass('delete-icon').addClass('progress-icon'); + fileList.disableActions(); + $.post(OC.filePath('files_trashbin', 'ajax', 'delete.php'), { + files: JSON.stringify([filename]), + dir: fileList.getCurrentDirectory() + }, + _.bind(fileList._removeCallback, fileList) + ); + }); + fileList.setFileActions(fileActions); + } +}; + +$(document).ready(function() { + $('#app-content-trashbin').one('show', function() { + var App = OCA.Trashbin.App; + App.initialize($('#app-content-trashbin')); + // force breadcrumb init + // App.fileList.changeDirectory(App.fileList.getCurrentDirectory(), false, true); + }); +}); + diff --git a/apps/files_trashbin/js/disableDefaultActions.js b/apps/files_trashbin/js/disableDefaultActions.js deleted file mode 100644 index 50ceaf4696fe1aa041dfea3c29d02b8e513dc6da..0000000000000000000000000000000000000000 --- a/apps/files_trashbin/js/disableDefaultActions.js +++ /dev/null @@ -1,3 +0,0 @@ -/* disable download and sharing actions */ -var disableDownloadActions = true; -var trashBinApp = true; diff --git a/apps/files_trashbin/js/filelist.js b/apps/files_trashbin/js/filelist.js index 7795daf2775bbc609c82c7dfcac868d565cccc48..205f879f335f944631013b10bb272f3fc6e972f9 100644 --- a/apps/files_trashbin/js/filelist.js +++ b/apps/files_trashbin/js/filelist.js @@ -1,8 +1,14 @@ -/* global OC, t, FileList */ +/* + * Copyright (c) 2014 + * + * This file is licensed under the Affero General Public License version 3 + * or later. + * + * See the COPYING-README file. + * + */ (function() { - FileList.appName = t('files_trashbin', 'Deleted files'); - - FileList._deletedRegExp = new RegExp(/^(.+)\.d[0-9]+$/); + var DELETED_REGEXP = new RegExp(/^(.+)\.d[0-9]+$/); /** * Convert a file name in the format filename.d12345 to the real file name. @@ -11,68 +17,248 @@ * @param name file name * @return converted file name */ - FileList.getDeletedFileName = function(name) { + function getDeletedFileName(name) { name = OC.basename(name); - var match = FileList._deletedRegExp.exec(name); + var match = DELETED_REGEXP.exec(name); if (match && match.length > 1) { name = match[1]; } return name; + } + + var FileList = function($el) { + this.initialize($el); }; + FileList.prototype = _.extend({}, OCA.Files.FileList.prototype, { + id: 'trashbin', + appName: t('files_trashbin', 'Deleted files'), - var oldSetCurrentDir = FileList._setCurrentDir; - FileList._setCurrentDir = function(targetDir) { - oldSetCurrentDir.apply(this, arguments); + initialize: function() { + var result = OCA.Files.FileList.prototype.initialize.apply(this, arguments); + this.$el.find('.undelete').click('click', _.bind(this._onClickRestoreSelected, this)); - var baseDir = OC.basename(targetDir); - if (baseDir !== '') { - FileList.setPageTitle(FileList.getDeletedFileName(baseDir)); - } - }; + this.setSort('mtime', 'desc'); + /** + * Override crumb making to add "Deleted Files" entry + * and convert files with ".d" extensions to a more + * user friendly name. + */ + this.breadcrumb._makeCrumbs = function() { + var parts = OCA.Files.BreadCrumb.prototype._makeCrumbs.apply(this, arguments); + for (var i = 1; i < parts.length; i++) { + parts[i].name = getDeletedFileName(parts[i].name); + } + return parts; + }; - var oldCreateRow = FileList._createRow; - FileList._createRow = function() { - // FIXME: MEGAHACK until we find a better solution - var tr = oldCreateRow.apply(this, arguments); - tr.find('td.filesize').remove(); - return tr; - }; + return result; + }, - FileList._onClickBreadCrumb = function(e) { - var $el = $(e.target).closest('.crumb'), - index = $el.index(), - $targetDir = $el.data('dir'); - // first one is home, let the link makes it default action - if (index !== 0) { - e.preventDefault(); - FileList.changeDirectory($targetDir); - } - }; + /** + * Override to only return read permissions + */ + getDirectoryPermissions: function() { + return OC.PERMISSION_READ | OC.PERMISSION_DELETE; + }, - var oldAdd = FileList.add; - FileList.add = function(fileData, options) { - options = options || {}; - var dir = FileList.getCurrentDirectory(); - var dirListing = dir !== '' && dir !== '/'; - // show deleted time as mtime - if (fileData.mtime) { - fileData.mtime = parseInt(fileData.mtime, 10); - } - if (!dirListing) { - fileData.displayName = fileData.name; - fileData.name = fileData.name + '.d' + Math.floor(fileData.mtime / 1000); + _setCurrentDir: function(targetDir) { + OCA.Files.FileList.prototype._setCurrentDir.apply(this, arguments); + + var baseDir = OC.basename(targetDir); + if (baseDir !== '') { + this.setPageTitle(getDeletedFileName(baseDir)); + } + }, + + _createRow: function() { + // FIXME: MEGAHACK until we find a better solution + var tr = OCA.Files.FileList.prototype._createRow.apply(this, arguments); + tr.find('td.filesize').remove(); + return tr; + }, + + _renderRow: function(fileData, options) { + options = options || {}; + var dir = this.getCurrentDirectory(); + var dirListing = dir !== '' && dir !== '/'; + // show deleted time as mtime + if (fileData.mtime) { + fileData.mtime = parseInt(fileData.mtime, 10); + } + if (!dirListing) { + fileData.displayName = fileData.name; + fileData.name = fileData.name + '.d' + Math.floor(fileData.mtime / 1000); + } + return OCA.Files.FileList.prototype._renderRow.call(this, fileData, options); + }, + + getAjaxUrl: function(action, params) { + var q = ''; + if (params) { + q = '?' + OC.buildQueryString(params); + } + return OC.filePath('files_trashbin', 'ajax', action + '.php') + q; + }, + + setupUploadEvents: function() { + // override and do nothing + }, + + linkTo: function(dir){ + return OC.linkTo('files', 'index.php')+"?view=trashbin&dir="+ encodeURIComponent(dir).replace(/%2F/g, '/'); + }, + + updateEmptyContent: function(){ + var exists = this.$fileList.find('tr:first').exists(); + this.$el.find('#emptycontent').toggleClass('hidden', exists); + this.$el.find('#filestable th').toggleClass('hidden', !exists); + }, + + _removeCallback: function(result) { + if (result.status !== 'success') { + OC.dialogs.alert(result.data.message, t('files_trashbin', 'Error')); + } + + var files = result.data.success; + var $el; + for (var i = 0; i < files.length; i++) { + $el = this.remove(OC.basename(files[i].filename), {updateSummary: false}); + this.fileSummary.remove({type: $el.attr('data-type'), size: $el.attr('data-size')}); + } + this.fileSummary.update(); + this.updateEmptyContent(); + this.enableActions(); + }, + + _onClickRestoreSelected: function(event) { + event.preventDefault(); + var self = this; + var allFiles = this.$el.find('.select-all').is(':checked'); + var files = []; + var params = {}; + this.disableActions(); + if (allFiles) { + this.showMask(); + params = { + allfiles: true, + dir: this.getCurrentDirectory() + }; + } + else { + files = _.pluck(this.getSelectedFiles(), 'name'); + for (var i = 0; i < files.length; i++) { + var deleteAction = this.findFileEl(files[i]).children("td.date").children(".action.delete"); + deleteAction.removeClass('delete-icon').addClass('progress-icon'); + } + params = { + files: JSON.stringify(files), + dir: this.getCurrentDirectory() + }; + } + + $.post(OC.filePath('files_trashbin', 'ajax', 'undelete.php'), + params, + function(result) { + if (allFiles) { + if (result.status !== 'success') { + OC.dialogs.alert(result.data.message, t('files_trashbin', 'Error')); + } + self.hideMask(); + // simply remove all files + self.setFiles([]); + self.enableActions(); + } + else { + self._removeCallback(result); + } + } + ); + }, + + _onClickDeleteSelected: function(event) { + event.preventDefault(); + var self = this; + var allFiles = this.$el.find('.select-all').is(':checked'); + var files = []; + var params = {}; + if (allFiles) { + params = { + allfiles: true, + dir: this.getCurrentDirectory() + }; + } + else { + files = _.pluck(this.getSelectedFiles(), 'name'); + params = { + files: JSON.stringify(files), + dir: this.getCurrentDirectory() + }; + } + + this.disableActions(); + if (allFiles) { + this.showMask(); + } + else { + for (var i = 0; i < files.length; i++) { + var deleteAction = this.findFileEl(files[i]).children("td.date").children(".action.delete"); + deleteAction.removeClass('delete-icon').addClass('progress-icon'); + } + } + + $.post(OC.filePath('files_trashbin', 'ajax', 'delete.php'), + params, + function(result) { + if (allFiles) { + if (result.status !== 'success') { + OC.dialogs.alert(result.data.message, t('files_trashbin', 'Error')); + } + self.hideMask(); + // simply remove all files + self.setFiles([]); + self.enableActions(); + } + else { + self._removeCallback(result); + } + } + ); + }, + + _onClickFile: function(event) { + var mime = $(this).parent().parent().data('mime'); + if (mime !== 'httpd/unix-directory') { + event.preventDefault(); + } + return OCA.Files.FileList.prototype._onClickFile.apply(this, arguments); + }, + + generatePreviewUrl: function(urlSpec) { + return OC.generateUrl('/apps/files_trashbin/ajax/preview.php?') + $.param(urlSpec); + }, + + getDownloadUrl: function() { + // no downloads + return '#'; + }, + + enableActions: function() { + this.$el.find('.action').css('display', 'inline'); + this.$el.find(':input:checkbox').css('display', 'inline'); + }, + + disableActions: function() { + this.$el.find('.action').css('display', 'none'); + this.$el.find(':input:checkbox').css('display', 'none'); + }, + + updateStorageStatistics: function() { + // no op because the trashbin doesn't have + // storage info like free space / used space } - return oldAdd.call(this, fileData, options); - }; - FileList.linkTo = function(dir){ - return OC.linkTo('files_trashbin', 'index.php')+"?dir="+ encodeURIComponent(dir).replace(/%2F/g, '/'); - }; + }); - FileList.updateEmptyContent = function(){ - var $fileList = $('#fileList'); - var exists = $fileList.find('tr:first').exists(); - $('#emptycontent').toggleClass('hidden', exists); - $('#filestable th').toggleClass('hidden', !exists); - }; + OCA.Trashbin.FileList = FileList; })(); + diff --git a/apps/files_trashbin/js/trash.js b/apps/files_trashbin/js/trash.js deleted file mode 100644 index f7724d07d2b86ee20c119216ebef49abfb4d5191..0000000000000000000000000000000000000000 --- a/apps/files_trashbin/js/trash.js +++ /dev/null @@ -1,287 +0,0 @@ -/* - * Copyright (c) 2014 - * - * This file is licensed under the Affero General Public License version 3 - * or later. - * - * See the COPYING-README file. - * - */ - -/* global OC, t, BreadCrumb, FileActions, FileList, Files */ -$(document).ready(function() { - var deletedRegExp = new RegExp(/^(.+)\.d[0-9]+$/); - - /** - * Convert a file name in the format filename.d12345 to the real file name. - * This will use basename. - * The name will not be changed if it has no ".d12345" suffix. - * @param name file name - * @return converted file name - */ - function getDeletedFileName(name) { - name = OC.basename(name); - var match = deletedRegExp.exec(name); - if (match && match.length > 1) { - name = match[1]; - } - return name; - } - - function removeCallback(result) { - if (result.status !== 'success') { - OC.dialogs.alert(result.data.message, t('files_trashbin', 'Error')); - } - - var files = result.data.success; - for (var i = 0; i < files.length; i++) { - FileList.remove(OC.basename(files[i].filename), {updateSummary: false}); - } - FileList.updateFileSummary(); - FileList.updateEmptyContent(); - enableActions(); - } - - Files.updateStorageStatistics = function() { - // no op because the trashbin doesn't have - // storage info like free space / used space - }; - - if (typeof FileActions !== 'undefined') { - FileActions.register('all', 'Restore', OC.PERMISSION_READ, OC.imagePath('core', 'actions/history'), function(filename) { - var tr = FileList.findFileEl(filename); - var deleteAction = tr.children("td.date").children(".action.delete"); - deleteAction.removeClass('delete-icon').addClass('progress-icon'); - disableActions(); - $.post(OC.filePath('files_trashbin', 'ajax', 'undelete.php'), { - files: JSON.stringify([filename]), - dir: FileList.getCurrentDirectory() - }, - removeCallback - ); - }, t('files_trashbin', 'Restore')); - }; - - FileActions.register('all', 'Delete', OC.PERMISSION_READ, function() { - return OC.imagePath('core', 'actions/delete'); - }, function(filename) { - $('.tipsy').remove(); - var tr = FileList.findFileEl(filename); - var deleteAction = tr.children("td.date").children(".action.delete"); - deleteAction.removeClass('delete-icon').addClass('progress-icon'); - disableActions(); - $.post(OC.filePath('files_trashbin', 'ajax', 'delete.php'), { - files: JSON.stringify([filename]), - dir: FileList.getCurrentDirectory() - }, - removeCallback - ); - }); - - // Sets the select_all checkbox behaviour : - $('#select_all').click(function() { - if ($(this).attr('checked')) { - // Check all - $('td.filename input:checkbox').attr('checked', true); - $('td.filename input:checkbox').parent().parent().addClass('selected'); - } else { - // Uncheck all - $('td.filename input:checkbox').attr('checked', false); - $('td.filename input:checkbox').parent().parent().removeClass('selected'); - } - procesSelection(); - }); - $('.undelete').click('click', function(event) { - event.preventDefault(); - var allFiles = $('#select_all').is(':checked'); - var files = []; - var params = {}; - disableActions(); - if (allFiles) { - FileList.showMask(); - params = { - allfiles: true, - dir: FileList.getCurrentDirectory() - }; - } - else { - files = Files.getSelectedFiles('name'); - for (var i = 0; i < files.length; i++) { - var deleteAction = FileList.findFileEl(files[i]).children("td.date").children(".action.delete"); - deleteAction.removeClass('delete-icon').addClass('progress-icon'); - } - params = { - files: JSON.stringify(files), - dir: FileList.getCurrentDirectory() - }; - } - - $.post(OC.filePath('files_trashbin', 'ajax', 'undelete.php'), - params, - function(result) { - if (allFiles) { - if (result.status !== 'success') { - OC.dialogs.alert(result.data.message, t('files_trashbin', 'Error')); - } - FileList.hideMask(); - // simply remove all files - FileList.update(''); - enableActions(); - } - else { - removeCallback(result); - } - } - ); - }); - - $('.delete').click('click', function(event) { - event.preventDefault(); - var allFiles = $('#select_all').is(':checked'); - var files = []; - var params = {}; - if (allFiles) { - params = { - allfiles: true, - dir: FileList.getCurrentDirectory() - }; - } - else { - files = Files.getSelectedFiles('name'); - params = { - files: JSON.stringify(files), - dir: FileList.getCurrentDirectory() - }; - } - - disableActions(); - if (allFiles) { - FileList.showMask(); - } - else { - for (var i = 0; i < files.length; i++) { - var deleteAction = FileList.findFileEl(files[i]).children("td.date").children(".action.delete"); - deleteAction.removeClass('delete-icon').addClass('progress-icon'); - } - } - - $.post(OC.filePath('files_trashbin', 'ajax', 'delete.php'), - params, - function(result) { - if (allFiles) { - if (result.status !== 'success') { - OC.dialogs.alert(result.data.message, t('files_trashbin', 'Error')); - } - FileList.hideMask(); - // simply remove all files - FileList.setFiles([]); - enableActions(); - } - else { - removeCallback(result); - } - } - ); - - }); - - $('#fileList').on('click', 'td.filename input', function() { - var checkbox = $(this).parent().children('input:checkbox'); - $(checkbox).parent().parent().toggleClass('selected'); - if ($(checkbox).is(':checked')) { - var selectedCount = $('td.filename input:checkbox:checked').length; - if (selectedCount === $('td.filename input:checkbox').length) { - $('#select_all').prop('checked', true); - } - } else { - $('#select_all').prop('checked',false); - } - procesSelection(); - }); - - $('#fileList').on('click', 'td.filename a', function(event) { - var mime = $(this).parent().parent().data('mime'); - if (mime !== 'httpd/unix-directory') { - event.preventDefault(); - } - var filename = $(this).parent().parent().attr('data-file'); - var tr = FileList.findFileEl(filename); - var renaming = tr.data('renaming'); - if(!renaming){ - if(mime.substr(0, 5) === 'text/'){ //no texteditor for now - return; - } - var type = $(this).parent().parent().data('type'); - var permissions = $(this).parent().parent().data('permissions'); - var action = FileActions.getDefault(mime, type, permissions); - if(action){ - event.preventDefault(); - action(filename); - } - } - }); - - /** - * Override crumb URL maker (hacky!) - */ - FileList.breadcrumb.getCrumbUrl = function(part, index) { - if (index === 0) { - return OC.linkTo('files', 'index.php'); - } - return OC.linkTo('files_trashbin', 'index.php')+"?dir=" + encodeURIComponent(part.dir); - }; - - Files.generatePreviewUrl = function(urlSpec) { - return OC.generateUrl('/apps/files_trashbin/ajax/preview.php?') + $.param(urlSpec); - }; - - Files.getDownloadUrl = function(action, params) { - // no downloads - return '#'; - }; - - Files.getAjaxUrl = function(action, params) { - var q = ''; - if (params) { - q = '?' + OC.buildQueryString(params); - } - return OC.filePath('files_trashbin', 'ajax', action + '.php') + q; - }; - - - /** - * Override crumb making to add "Deleted Files" entry - * and convert files with ".d" extensions to a more - * user friendly name. - */ - var oldMakeCrumbs = BreadCrumb.prototype._makeCrumbs; - BreadCrumb.prototype._makeCrumbs = function() { - var parts = oldMakeCrumbs.apply(this, arguments); - // duplicate first part - parts.unshift(parts[0]); - parts[1] = { - dir: '/', - name: t('files_trashbin', 'Deleted Files') - }; - for (var i = 2; i < parts.length; i++) { - parts[i].name = getDeletedFileName(parts[i].name); - } - return parts; - }; - - FileActions.actions.dir = { - // only keep 'Open' action for navigation - 'Open': FileActions.actions.dir.Open - }; -}); - -function enableActions() { - $(".action").css("display", "inline"); - $(":input:checkbox").css("display", "inline"); -} - -function disableActions() { - $(".action").css("display", "none"); - $(":input:checkbox").css("display", "none"); -} - diff --git a/apps/files_trashbin/l10n/ar.php b/apps/files_trashbin/l10n/ar.php index b3abc7df86ef2aff85f4edd6f3f56d7e76701daf..5a6105bda6f7413d5797c98ec24c2c21bed58b34 100644 --- a/apps/files_trashbin/l10n/ar.php +++ b/apps/files_trashbin/l10n/ar.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "تعذّر حذف%s بشكل دائم", "Couldn't restore %s" => "تعذّر استرجاع %s ", "Deleted files" => "حذف الملفات", +"Restore" => "استعيد", "Error" => "خطأ", -"Deleted Files" => "الملفات المحذوفه", "restored" => "تمت الاستعادة", "Nothing in here. Your trash bin is empty!" => "لا يوجد شيء هنا. سلة المهملات خاليه.", "Name" => "اسم", -"Restore" => "استعيد", "Deleted" => "تم الحذف", "Delete" => "إلغاء" ); diff --git a/apps/files_trashbin/l10n/ast.php b/apps/files_trashbin/l10n/ast.php index 688e1ce3d8fa6735dfd93009d2bea9c1d2aeebd0..3240d6751c1101ce393b1c3d28cf4025d797ea5a 100644 --- a/apps/files_trashbin/l10n/ast.php +++ b/apps/files_trashbin/l10n/ast.php @@ -2,11 +2,12 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Nun pudo desaniciase %s dafechu", "Couldn't restore %s" => "Nun pudo restaurase %s", +"Deleted files" => "Ficheros desaniciaos", +"Restore" => "Restaurar", "Error" => "Fallu", -"Deleted Files" => "Ficheros desaniciaos", +"restored" => "recuperóse", "Nothing in here. Your trash bin is empty!" => "Nun hai un res equí. La papelera ta balera!", "Name" => "Nome", -"Restore" => "Restaurar", "Deleted" => "Desaniciáu", "Delete" => "Desaniciar" ); diff --git a/apps/files_trashbin/l10n/bg_BG.php b/apps/files_trashbin/l10n/bg_BG.php index 8c9e658068c440a7e14880551e5d789dddb4c17a..62057538ce4312b451a23dd45e79fd4472fcaa81 100644 --- a/apps/files_trashbin/l10n/bg_BG.php +++ b/apps/files_trashbin/l10n/bg_BG.php @@ -2,11 +2,10 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Невъзможно перманентното изтриване на %s", "Couldn't restore %s" => "Невъзможно възтановяване на %s", +"Restore" => "Възтановяване", "Error" => "Грешка", -"Deleted Files" => "Изтрити файлове", "Nothing in here. Your trash bin is empty!" => "Няма нищо. Кофата е празна!", "Name" => "Име", -"Restore" => "Възтановяване", "Deleted" => "Изтрито", "Delete" => "Изтриване" ); diff --git a/apps/files_trashbin/l10n/ca.php b/apps/files_trashbin/l10n/ca.php index 196d6ac00a4a3a7ad7823846096e44f51f776fd8..59b42797cf90e164bd48813cd1f859980c753512 100644 --- a/apps/files_trashbin/l10n/ca.php +++ b/apps/files_trashbin/l10n/ca.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "No s'ha pogut esborrar permanentment %s", "Couldn't restore %s" => "No s'ha pogut restaurar %s", "Deleted files" => "Fitxers esborrats", +"Restore" => "Recupera", "Error" => "Error", -"Deleted Files" => "Fitxers eliminats", "restored" => "restaurat", "Nothing in here. Your trash bin is empty!" => "La paperera està buida!", "Name" => "Nom", -"Restore" => "Recupera", "Deleted" => "Eliminat", "Delete" => "Esborra" ); diff --git a/apps/files_trashbin/l10n/cs_CZ.php b/apps/files_trashbin/l10n/cs_CZ.php index ed795582e43012534173a7d411866bc8d57bde83..3e4f9e0e15a77516009f06ad77bf7c0a86c06797 100644 --- a/apps/files_trashbin/l10n/cs_CZ.php +++ b/apps/files_trashbin/l10n/cs_CZ.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Nelze trvale odstranit %s", "Couldn't restore %s" => "Nelze obnovit %s", "Deleted files" => "Odstraněné soubory", +"Restore" => "Obnovit", "Error" => "Chyba", -"Deleted Files" => "Smazané soubory", "restored" => "obnoveno", "Nothing in here. Your trash bin is empty!" => "Žádný obsah. Váš koš je prázdný.", "Name" => "Název", -"Restore" => "Obnovit", "Deleted" => "Smazáno", "Delete" => "Smazat" ); diff --git a/apps/files_trashbin/l10n/cy_GB.php b/apps/files_trashbin/l10n/cy_GB.php index 7b1405777dda4bc6e266d41e6e8166b07156894f..4e76a6d25ab9cbd631ea4a9b2fde29175abd9824 100644 --- a/apps/files_trashbin/l10n/cy_GB.php +++ b/apps/files_trashbin/l10n/cy_GB.php @@ -3,11 +3,10 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Methwyd dileu %s yn barhaol", "Couldn't restore %s" => "Methwyd adfer %s", "Deleted files" => "Ffeiliau ddilewyd", +"Restore" => "Adfer", "Error" => "Gwall", -"Deleted Files" => "Ffeiliau Ddilewyd", "Nothing in here. Your trash bin is empty!" => "Does dim byd yma. Mae eich bin sbwriel yn wag!", "Name" => "Enw", -"Restore" => "Adfer", "Deleted" => "Wedi dileu", "Delete" => "Dileu" ); diff --git a/apps/files_trashbin/l10n/da.php b/apps/files_trashbin/l10n/da.php index 7f7b65bca2ce764837bb547fe0886765b4645c05..b651d81d1bdf7fd0fa316e925b310165a60ccd34 100644 --- a/apps/files_trashbin/l10n/da.php +++ b/apps/files_trashbin/l10n/da.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Kunne ikke slette %s permanent", "Couldn't restore %s" => "Kunne ikke gendanne %s", "Deleted files" => "Slettede filer", +"Restore" => "Gendan", "Error" => "Fejl", -"Deleted Files" => "Slettede filer", "restored" => "Gendannet", "Nothing in here. Your trash bin is empty!" => "Intet at se her. Din papirkurv er tom!", "Name" => "Navn", -"Restore" => "Gendan", "Deleted" => "Slettet", "Delete" => "Slet" ); diff --git a/apps/files_trashbin/l10n/de.php b/apps/files_trashbin/l10n/de.php index 4778e159e1d9cae73a9143d7fdc41efb9bf7538b..56b7ccfc7bd6b7ae49cb87d35ee55cf09d42b52d 100644 --- a/apps/files_trashbin/l10n/de.php +++ b/apps/files_trashbin/l10n/de.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Konnte %s nicht dauerhaft löschen", "Couldn't restore %s" => "Konnte %s nicht wiederherstellen", "Deleted files" => "Gelöschte Dateien", +"Restore" => "Wiederherstellen", "Error" => "Fehler", -"Deleted Files" => "Gelöschte Dateien", "restored" => "Wiederhergestellt", "Nothing in here. Your trash bin is empty!" => "Nichts zu löschen, der Papierkorb ist leer!", "Name" => "Name", -"Restore" => "Wiederherstellen", "Deleted" => "gelöscht", "Delete" => "Löschen" ); diff --git a/apps/files_trashbin/l10n/de_CH.php b/apps/files_trashbin/l10n/de_CH.php index 603d82f5c7afbeb4de27624dd6d3456f876dbd23..be54e57d3f3a09851d51141a8e98b79bd7398dbe 100644 --- a/apps/files_trashbin/l10n/de_CH.php +++ b/apps/files_trashbin/l10n/de_CH.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Konnte %s nicht dauerhaft löschen", "Couldn't restore %s" => "Konnte %s nicht wiederherstellen", "Deleted files" => "Gelöschte Dateien", +"Restore" => "Wiederherstellen", "Error" => "Fehler", -"Deleted Files" => "Gelöschte Dateien", "restored" => "Wiederhergestellt", "Nothing in here. Your trash bin is empty!" => "Nichts zu löschen, Ihr Papierkorb ist leer!", "Name" => "Name", -"Restore" => "Wiederherstellen", "Deleted" => "Gelöscht", "Delete" => "Löschen" ); diff --git a/apps/files_trashbin/l10n/de_DE.php b/apps/files_trashbin/l10n/de_DE.php index 603d82f5c7afbeb4de27624dd6d3456f876dbd23..be54e57d3f3a09851d51141a8e98b79bd7398dbe 100644 --- a/apps/files_trashbin/l10n/de_DE.php +++ b/apps/files_trashbin/l10n/de_DE.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Konnte %s nicht dauerhaft löschen", "Couldn't restore %s" => "Konnte %s nicht wiederherstellen", "Deleted files" => "Gelöschte Dateien", +"Restore" => "Wiederherstellen", "Error" => "Fehler", -"Deleted Files" => "Gelöschte Dateien", "restored" => "Wiederhergestellt", "Nothing in here. Your trash bin is empty!" => "Nichts zu löschen, Ihr Papierkorb ist leer!", "Name" => "Name", -"Restore" => "Wiederherstellen", "Deleted" => "Gelöscht", "Delete" => "Löschen" ); diff --git a/apps/files_trashbin/l10n/el.php b/apps/files_trashbin/l10n/el.php index 23b23ed93a68e4d34e1c832a3981504bcfedb5be..c77bfb7fa16bfa3872ef271dd4da3f6542893607 100644 --- a/apps/files_trashbin/l10n/el.php +++ b/apps/files_trashbin/l10n/el.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Αδύνατη η μόνιμη διαγραφή του %s", "Couldn't restore %s" => "Αδυναμία επαναφοράς %s", "Deleted files" => "Διαγραμμένα αρχεία", +"Restore" => "Επαναφορά", "Error" => "Σφάλμα", -"Deleted Files" => "Διαγραμμένα Αρχεία", "restored" => "επαναφέρθηκαν", "Nothing in here. Your trash bin is empty!" => "Δεν υπάρχει τίποτα εδώ. Ο κάδος σας είναι άδειος!", "Name" => "Όνομα", -"Restore" => "Επαναφορά", "Deleted" => "Διαγραμμένα", "Delete" => "Διαγραφή" ); diff --git a/apps/files_trashbin/l10n/en_GB.php b/apps/files_trashbin/l10n/en_GB.php index a660b4b1ca1776a26ed70c1937ae486aaf1f3ff8..b2715dfceb77bac74e27b5d71a965e207c920447 100644 --- a/apps/files_trashbin/l10n/en_GB.php +++ b/apps/files_trashbin/l10n/en_GB.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Couldn't delete %s permanently", "Couldn't restore %s" => "Couldn't restore %s", "Deleted files" => "Deleted files", +"Restore" => "Restore", "Error" => "Error", -"Deleted Files" => "Deleted Files", "restored" => "restored", "Nothing in here. Your trash bin is empty!" => "Nothing in here. Your recycle bin is empty!", "Name" => "Name", -"Restore" => "Restore", "Deleted" => "Deleted", "Delete" => "Delete" ); diff --git a/apps/files_trashbin/l10n/eo.php b/apps/files_trashbin/l10n/eo.php index d644f0f6420b768e25e1387176220c9c6cc734fe..67617f448d09e69e1a0778a32eb50038a393284b 100644 --- a/apps/files_trashbin/l10n/eo.php +++ b/apps/files_trashbin/l10n/eo.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Ne povis foriĝi %s por ĉiam", "Couldn't restore %s" => "Ne povis restaŭriĝi %s", "Deleted files" => "Forigitaj dosieroj", +"Restore" => "Restaŭri", "Error" => "Eraro", -"Deleted Files" => "Forigitaj dosieroj", "restored" => "restaŭrita", "Nothing in here. Your trash bin is empty!" => "Nenio estas ĉi tie. Via rubujo malplenas!", "Name" => "Nomo", -"Restore" => "Restaŭri", "Deleted" => "Forigita", "Delete" => "Forigi" ); diff --git a/apps/files_trashbin/l10n/es.php b/apps/files_trashbin/l10n/es.php index c0dc6bb45c29e375dacf88b377b7efc611ba9a21..c3db7765154ae4b27f4c5451a7c4a132e33c0945 100644 --- a/apps/files_trashbin/l10n/es.php +++ b/apps/files_trashbin/l10n/es.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "No se puede eliminar %s permanentemente", "Couldn't restore %s" => "No se puede restaurar %s", "Deleted files" => "Archivos eliminados", +"Restore" => "Recuperar", "Error" => "Error", -"Deleted Files" => "Archivos Eliminados", "restored" => "recuperado", "Nothing in here. Your trash bin is empty!" => "No hay nada aquí. ¡Tu papelera esta vacía!", "Name" => "Nombre", -"Restore" => "Recuperar", "Deleted" => "Eliminado", "Delete" => "Eliminar" ); diff --git a/apps/files_trashbin/l10n/es_AR.php b/apps/files_trashbin/l10n/es_AR.php index b354dd656b1c287ac1a6fed572bcf8607a5fcf5e..2991ea507b00880aa9a049337ed5367108e110ee 100644 --- a/apps/files_trashbin/l10n/es_AR.php +++ b/apps/files_trashbin/l10n/es_AR.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "No fue posible borrar %s de manera permanente", "Couldn't restore %s" => "No se pudo restaurar %s", "Deleted files" => "Archivos borrados", +"Restore" => "Recuperar", "Error" => "Error", -"Deleted Files" => "Archivos eliminados", "restored" => "recuperado", "Nothing in here. Your trash bin is empty!" => "No hay nada acá. ¡La papelera está vacía!", "Name" => "Nombre", -"Restore" => "Recuperar", "Deleted" => "Borrado", "Delete" => "Borrar" ); diff --git a/apps/files_trashbin/l10n/es_MX.php b/apps/files_trashbin/l10n/es_MX.php index c0dc6bb45c29e375dacf88b377b7efc611ba9a21..c3db7765154ae4b27f4c5451a7c4a132e33c0945 100644 --- a/apps/files_trashbin/l10n/es_MX.php +++ b/apps/files_trashbin/l10n/es_MX.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "No se puede eliminar %s permanentemente", "Couldn't restore %s" => "No se puede restaurar %s", "Deleted files" => "Archivos eliminados", +"Restore" => "Recuperar", "Error" => "Error", -"Deleted Files" => "Archivos Eliminados", "restored" => "recuperado", "Nothing in here. Your trash bin is empty!" => "No hay nada aquí. ¡Tu papelera esta vacía!", "Name" => "Nombre", -"Restore" => "Recuperar", "Deleted" => "Eliminado", "Delete" => "Eliminar" ); diff --git a/apps/files_trashbin/l10n/et_EE.php b/apps/files_trashbin/l10n/et_EE.php index 69d20cb195ff7a35b1e40bf3d283288ff3d018ba..c1c9ea66c4f56a0e21ac900dc0617b7864102628 100644 --- a/apps/files_trashbin/l10n/et_EE.php +++ b/apps/files_trashbin/l10n/et_EE.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "%s jäädavalt kustutamine ebaõnnestus", "Couldn't restore %s" => "%s ei saa taastada", "Deleted files" => "Kustutatud failid", +"Restore" => "Taasta", "Error" => "Viga", -"Deleted Files" => "Kustutatud failid", "restored" => "taastatud", "Nothing in here. Your trash bin is empty!" => "Siin pole midagi. Sinu prügikast on tühi!", "Name" => "Nimi", -"Restore" => "Taasta", "Deleted" => "Kustutatud", "Delete" => "Kustuta" ); diff --git a/apps/files_trashbin/l10n/eu.php b/apps/files_trashbin/l10n/eu.php index 42476bccfe4d05388999124e2e4e6c63f3a25b90..63c1245da061fcc762edff372f0ddfdeb850f779 100644 --- a/apps/files_trashbin/l10n/eu.php +++ b/apps/files_trashbin/l10n/eu.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Ezin izan da %s betirako ezabatu", "Couldn't restore %s" => "Ezin izan da %s berreskuratu", "Deleted files" => "Ezabatutako fitxategiak", +"Restore" => "Berrezarri", "Error" => "Errorea", -"Deleted Files" => "Ezabatutako Fitxategiak", "restored" => "Berrezarrita", "Nothing in here. Your trash bin is empty!" => "Ez dago ezer ez. Zure zakarrontzia hutsik dago!", "Name" => "Izena", -"Restore" => "Berrezarri", "Deleted" => "Ezabatuta", "Delete" => "Ezabatu" ); diff --git a/apps/files_trashbin/l10n/fa.php b/apps/files_trashbin/l10n/fa.php index 407524eb62050960823df51fd14e65f5985e274f..0823e98ea1c758c0a54daa78e7e4472db5ca0573 100644 --- a/apps/files_trashbin/l10n/fa.php +++ b/apps/files_trashbin/l10n/fa.php @@ -3,11 +3,10 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "%s را نمی توان برای همیشه حذف کرد", "Couldn't restore %s" => "%s را نمی توان بازگرداند", "Deleted files" => "فایل های حذف شده", +"Restore" => "بازیابی", "Error" => "خطا", -"Deleted Files" => "فایلهای حذف شده", "Nothing in here. Your trash bin is empty!" => "هیچ چیزی اینجا نیست. سطل زباله ی شما خالی است.", "Name" => "نام", -"Restore" => "بازیابی", "Deleted" => "حذف شده", "Delete" => "حذف" ); diff --git a/apps/files_trashbin/l10n/fi_FI.php b/apps/files_trashbin/l10n/fi_FI.php index da56baf0bd7fa08b48f19bb2e37ddb830d456615..158fc7dac55c88ae772fdfbdea59298aa8bd03aa 100644 --- a/apps/files_trashbin/l10n/fi_FI.php +++ b/apps/files_trashbin/l10n/fi_FI.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Kohdetta %s ei voitu poistaa pysyvästi", "Couldn't restore %s" => "Kohteen %s palautus epäonnistui", "Deleted files" => "Poistetut tiedostot", +"Restore" => "Palauta", "Error" => "Virhe", -"Deleted Files" => "Poistetut tiedostot", "restored" => "palautettu", "Nothing in here. Your trash bin is empty!" => "Tyhjää täynnä! Roskakorissa ei ole mitään.", "Name" => "Nimi", -"Restore" => "Palauta", "Deleted" => "Poistettu", "Delete" => "Poista" ); diff --git a/apps/files_trashbin/l10n/fr.php b/apps/files_trashbin/l10n/fr.php index b71fbea96ad09bc657905a869ee1a9d5b773d31f..0e6330bb2d0f915b7a4560f315b712ae7f811afa 100644 --- a/apps/files_trashbin/l10n/fr.php +++ b/apps/files_trashbin/l10n/fr.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Impossible d'effacer %s de façon permanente", "Couldn't restore %s" => "Impossible de restaurer %s", "Deleted files" => "Fichiers supprimés", +"Restore" => "Restaurer", "Error" => "Erreur", -"Deleted Files" => "Fichiers effacés", "restored" => "restauré", "Nothing in here. Your trash bin is empty!" => "Il n'y a rien ici. Votre corbeille est vide !", "Name" => "Nom", -"Restore" => "Restaurer", "Deleted" => "Effacé", "Delete" => "Supprimer" ); diff --git a/apps/files_trashbin/l10n/gl.php b/apps/files_trashbin/l10n/gl.php index fe74ab34a02d5655ae03155958a787797dc4df5b..143cf0e6df564d3fff90c8d72124e38ffb53882e 100644 --- a/apps/files_trashbin/l10n/gl.php +++ b/apps/files_trashbin/l10n/gl.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Non foi posíbel eliminar %s permanente", "Couldn't restore %s" => "Non foi posíbel restaurar %s", "Deleted files" => "Ficheiros eliminados", +"Restore" => "Restablecer", "Error" => "Erro", -"Deleted Files" => "Ficheiros eliminados", "restored" => "restaurado", "Nothing in here. Your trash bin is empty!" => "Aquí non hai nada. O cesto do lixo está baleiro!", "Name" => "Nome", -"Restore" => "Restablecer", "Deleted" => "Eliminado", "Delete" => "Eliminar" ); diff --git a/apps/files_trashbin/l10n/he.php b/apps/files_trashbin/l10n/he.php index 6cdc5c05c9d0985fd52a13c0dcef7914c4cdaf90..90b3fd11ab52a65f39a6980fb226f2b92831e59c 100644 --- a/apps/files_trashbin/l10n/he.php +++ b/apps/files_trashbin/l10n/he.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "לא ניתן למחוק את %s לצמיתות", "Couldn't restore %s" => "לא ניתן לשחזר את %s", "Deleted files" => "קבצים שנמחקו", +"Restore" => "שחזור", "Error" => "שגיאה", -"Deleted Files" => "קבצים שנמחקו", "restored" => "שוחזר", "Nothing in here. Your trash bin is empty!" => "אין כאן שום דבר. סל המיחזור שלך ריק!", "Name" => "שם", -"Restore" => "שחזור", "Deleted" => "נמחק", "Delete" => "מחיקה" ); diff --git a/apps/files_trashbin/l10n/hu_HU.php b/apps/files_trashbin/l10n/hu_HU.php index 2912821d96f97c32c4f7d3af58589b0f7d92592f..60f3ebad8569938d6120dd16fc964affe1a2cb56 100644 --- a/apps/files_trashbin/l10n/hu_HU.php +++ b/apps/files_trashbin/l10n/hu_HU.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Nem sikerült %s végleges törlése", "Couldn't restore %s" => "Nem sikerült %s visszaállítása", "Deleted files" => "Törölt fájlok", +"Restore" => "Visszaállítás", "Error" => "Hiba", -"Deleted Files" => "Törölt fájlok", "restored" => "visszaállítva", "Nothing in here. Your trash bin is empty!" => "Itt nincs semmi. Az Ön szemetes mappája üres!", "Name" => "Név", -"Restore" => "Visszaállítás", "Deleted" => "Törölve", "Delete" => "Törlés" ); diff --git a/apps/files_trashbin/l10n/id.php b/apps/files_trashbin/l10n/id.php index 166b9aa811a2441f4099c091c1fbee3a4c6336dd..bba9e329eebcc0890ed7b63658c8da099fe74876 100644 --- a/apps/files_trashbin/l10n/id.php +++ b/apps/files_trashbin/l10n/id.php @@ -3,11 +3,10 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Tidak dapat menghapus permanen %s", "Couldn't restore %s" => "Tidak dapat memulihkan %s", "Deleted files" => "Berkas yang dihapus", +"Restore" => "Pulihkan", "Error" => "Galat", -"Deleted Files" => "Berkas yang Dihapus", "Nothing in here. Your trash bin is empty!" => "Tempat sampah anda kosong!", "Name" => "Nama", -"Restore" => "Pulihkan", "Deleted" => "Dihapus", "Delete" => "Hapus" ); diff --git a/apps/files_trashbin/l10n/it.php b/apps/files_trashbin/l10n/it.php index 057305ac517e6b09be9904d7890a0976d271ea54..905384b82bb96c72d99ca6cc01c82dbe1bb130fc 100644 --- a/apps/files_trashbin/l10n/it.php +++ b/apps/files_trashbin/l10n/it.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Impossibile eliminare %s definitivamente", "Couldn't restore %s" => "Impossibile ripristinare %s", "Deleted files" => "File eliminati", +"Restore" => "Ripristina", "Error" => "Errore", -"Deleted Files" => "File eliminati", "restored" => "ripristinati", "Nothing in here. Your trash bin is empty!" => "Qui non c'è niente. Il tuo cestino è vuoto.", "Name" => "Nome", -"Restore" => "Ripristina", "Deleted" => "Eliminati", "Delete" => "Elimina" ); diff --git a/apps/files_trashbin/l10n/ja.php b/apps/files_trashbin/l10n/ja.php index 13ca95e6fb4e38fa70d66d1259c59e2b02825faf..b24e40aa23d5b0e76e4c2ec8d31034e6703b7961 100644 --- a/apps/files_trashbin/l10n/ja.php +++ b/apps/files_trashbin/l10n/ja.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "%s を完全に削除できませんでした", "Couldn't restore %s" => "%s を復元できませんでした", "Deleted files" => "ゴミ箱", +"Restore" => "復元", "Error" => "エラー", -"Deleted Files" => "ゴミ箱", "restored" => "復元済", "Nothing in here. Your trash bin is empty!" => "ここには何もありません。ゴミ箱は空です!", "Name" => "名前", -"Restore" => "復元", "Deleted" => "削除済み", "Delete" => "削除" ); diff --git a/apps/files_trashbin/l10n/ka_GE.php b/apps/files_trashbin/l10n/ka_GE.php index 4e3ad4260e3ab9e15e520342dc960b7cd1275f11..16e147bd416f72648391987de5d744f536c73512 100644 --- a/apps/files_trashbin/l10n/ka_GE.php +++ b/apps/files_trashbin/l10n/ka_GE.php @@ -3,11 +3,10 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "ფაილი %s–ის სრულად წაშლა ვერ მოხერხდა", "Couldn't restore %s" => "%s–ის აღდგენა ვერ მოხერხდა", "Deleted files" => "წაშლილი ფაილები", +"Restore" => "აღდგენა", "Error" => "შეცდომა", -"Deleted Files" => "წაშლილი ფაილები", "Nothing in here. Your trash bin is empty!" => "აქ არაფერი არ არის. სანაგვე ყუთი ცარიელია!", "Name" => "სახელი", -"Restore" => "აღდგენა", "Deleted" => "წაშლილი", "Delete" => "წაშლა" ); diff --git a/apps/files_trashbin/l10n/km.php b/apps/files_trashbin/l10n/km.php index 1df805de2d607d18271e3561686eab3f08410362..40119afc8781a9a4d75ec68fd6c1b3545c75da2d 100644 --- a/apps/files_trashbin/l10n/km.php +++ b/apps/files_trashbin/l10n/km.php @@ -1,8 +1,14 @@ "មិន​អាច​លុប %s ចោល​ជា​អចិន្ត្រៃយ៍​ទេ", +"Couldn't restore %s" => "មិន​អាច​ស្ដារ %s ឡើង​វិញ​បាន​ទេ", +"Deleted files" => "ឯកសារ​ដែល​បាន​លុប", +"Restore" => "ស្ដារ​មក​វិញ", "Error" => "កំហុស", +"restored" => "បាន​ស្ដារ​វិញ", +"Nothing in here. Your trash bin is empty!" => "គ្មាន​អ្វី​នៅ​ទីនេះ​ទេ។ ធុង​សំរាម​របស់​អ្នក​គឺ​ទទេ!", "Name" => "ឈ្មោះ", -"Restore" => "ស្ដារ​មក​វិញ", +"Deleted" => "បាន​លុប", "Delete" => "លុប" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_trashbin/l10n/ko.php b/apps/files_trashbin/l10n/ko.php index d9d870708047b562deee62c9e193e70f71d0e048..98800fd2e583911c42792d30271ef9f596bf6012 100644 --- a/apps/files_trashbin/l10n/ko.php +++ b/apps/files_trashbin/l10n/ko.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "%s을(를_ 영구적으로 삭제할 수 없습니다", "Couldn't restore %s" => "%s을(를) 복원할 수 없습니다", "Deleted files" => "삭제된 파일", +"Restore" => "복원", "Error" => "오류", -"Deleted Files" => "삭제된 파일", "restored" => "복원됨", "Nothing in here. Your trash bin is empty!" => "휴지통이 비어 있습니다!", "Name" => "이름", -"Restore" => "복원", "Deleted" => "삭제됨", "Delete" => "삭제" ); diff --git a/apps/files_trashbin/l10n/lt_LT.php b/apps/files_trashbin/l10n/lt_LT.php index 2bf545483f6ec1e30efdb95908b8288084cb31d3..fa65d7eabac0b32e756c3b9347ae764f0c1116af 100644 --- a/apps/files_trashbin/l10n/lt_LT.php +++ b/apps/files_trashbin/l10n/lt_LT.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Nepavyko negrįžtamai ištrinti %s", "Couldn't restore %s" => "Nepavyko atkurti %s", "Deleted files" => "Ištrinti failai", +"Restore" => "Atstatyti", "Error" => "Klaida", -"Deleted Files" => "Ištrinti failai", "restored" => "atstatyta", "Nothing in here. Your trash bin is empty!" => "Nieko nėra. Jūsų šiukšliadėžė tuščia!", "Name" => "Pavadinimas", -"Restore" => "Atstatyti", "Deleted" => "Ištrinti", "Delete" => "Ištrinti" ); diff --git a/apps/files_trashbin/l10n/lv.php b/apps/files_trashbin/l10n/lv.php index c173d0501477774111301adfd2f5d28dc21acc18..3432f9ac75eff98a8a347ee0c8d75e1f8d38f32f 100644 --- a/apps/files_trashbin/l10n/lv.php +++ b/apps/files_trashbin/l10n/lv.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Nevarēja pilnībā izdzēst %s", "Couldn't restore %s" => "Nevarēja atjaunot %s", "Deleted files" => "Dzēstās datnes", +"Restore" => "Atjaunot", "Error" => "Kļūda", -"Deleted Files" => "Dzēstās datnes", "restored" => "atjaunots", "Nothing in here. Your trash bin is empty!" => "Šeit nekā nav. Jūsu miskaste ir tukša!", "Name" => "Nosaukums", -"Restore" => "Atjaunot", "Deleted" => "Dzēsts", "Delete" => "Dzēst" ); diff --git a/apps/files_trashbin/l10n/mk.php b/apps/files_trashbin/l10n/mk.php index 910b11e21e603de847d78ea8742285a8e687940f..66c2d0a2961b6e83758c02426c7619749f8e8f87 100644 --- a/apps/files_trashbin/l10n/mk.php +++ b/apps/files_trashbin/l10n/mk.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Не можеше трајно да се избрише %s", "Couldn't restore %s" => "Не можеше да се поврати %s", "Deleted files" => "Избришани датотеки", +"Restore" => "Поврати", "Error" => "Грешка", -"Deleted Files" => "Избришани датотеки", "restored" => "повратени", "Nothing in here. Your trash bin is empty!" => "Тука нема ништо. Вашата корпа за отпадоци е празна!", "Name" => "Име", -"Restore" => "Поврати", "Deleted" => "Избришан", "Delete" => "Избриши" ); diff --git a/apps/files_trashbin/l10n/ms_MY.php b/apps/files_trashbin/l10n/ms_MY.php index f084f58465dca8e4afa59f44c3dca3e0a92db11f..fdfd922438c5105723ee6509969129111dac85a7 100644 --- a/apps/files_trashbin/l10n/ms_MY.php +++ b/apps/files_trashbin/l10n/ms_MY.php @@ -2,12 +2,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Tidak dapat menghapuskan %s secara kekal", "Couldn't restore %s" => "Tidak dapat memulihkan %s", +"Restore" => "Pulihkan", "Error" => "Ralat", -"Deleted Files" => "Fail Dihapus", "restored" => "dipulihkan", "Nothing in here. Your trash bin is empty!" => "Tiada apa disini. Tong sampah anda kosong!", "Name" => "Nama", -"Restore" => "Pulihkan", "Deleted" => "Dihapuskan", "Delete" => "Padam" ); diff --git a/apps/files_trashbin/l10n/nb_NO.php b/apps/files_trashbin/l10n/nb_NO.php index 2293e5a4e7b3265459fc282f34957fe06523a193..519b4e5aa24b2b142cfcb986944a9931ea14afc3 100644 --- a/apps/files_trashbin/l10n/nb_NO.php +++ b/apps/files_trashbin/l10n/nb_NO.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Kunne ikke slette %s fullstendig", "Couldn't restore %s" => "Kunne ikke gjenopprette %s", "Deleted files" => "Slettede filer", +"Restore" => "Gjenopprett", "Error" => "Feil", -"Deleted Files" => "Slettede filer", "restored" => "gjenopprettet", "Nothing in here. Your trash bin is empty!" => "Ingenting her. Søppelkassen din er tom!", "Name" => "Navn", -"Restore" => "Gjenopprett", "Deleted" => "Slettet", "Delete" => "Slett" ); diff --git a/apps/files_trashbin/l10n/nl.php b/apps/files_trashbin/l10n/nl.php index c8fb12885387f371d23cbf296e7cdc6f313bb99a..41dfa86b7a705d238c248d0473c635ff2121ecec 100644 --- a/apps/files_trashbin/l10n/nl.php +++ b/apps/files_trashbin/l10n/nl.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Kon %s niet permanent verwijderen", "Couldn't restore %s" => "Kon %s niet herstellen", "Deleted files" => "Verwijderde bestanden", +"Restore" => "Herstellen", "Error" => "Fout", -"Deleted Files" => "Verwijderde bestanden", "restored" => "hersteld", "Nothing in here. Your trash bin is empty!" => "Niets te vinden. Uw prullenbak is leeg!", "Name" => "Naam", -"Restore" => "Herstellen", "Deleted" => "Verwijderd", "Delete" => "Verwijder" ); diff --git a/apps/files_trashbin/l10n/nn_NO.php b/apps/files_trashbin/l10n/nn_NO.php index 38bc64e6ce505bcca607a141660fb2c0869ffd94..aa18927b1fd34eb516c11bd6aa3386d7fdc90777 100644 --- a/apps/files_trashbin/l10n/nn_NO.php +++ b/apps/files_trashbin/l10n/nn_NO.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Klarte ikkje sletta %s for godt", "Couldn't restore %s" => "Klarte ikkje gjenoppretta %s", "Deleted files" => "Sletta filer", +"Restore" => "Gjenopprett", "Error" => "Feil", -"Deleted Files" => "Sletta filer", "restored" => "gjenoppretta", "Nothing in here. Your trash bin is empty!" => "Ingenting her. Papirkorga di er tom!", "Name" => "Namn", -"Restore" => "Gjenopprett", "Deleted" => "Sletta", "Delete" => "Slett" ); diff --git a/apps/files_trashbin/l10n/pl.php b/apps/files_trashbin/l10n/pl.php index b961efd7daeee7dcbefb2d6d0ab3dfe0e032f5be..16bb9dbfa2fd8373219396c0ae254f8337ab1651 100644 --- a/apps/files_trashbin/l10n/pl.php +++ b/apps/files_trashbin/l10n/pl.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Nie można trwale usunąć %s", "Couldn't restore %s" => "Nie można przywrócić %s", "Deleted files" => "Pliki usunięte", +"Restore" => "Przywróć", "Error" => "Błąd", -"Deleted Files" => "Usunięte pliki", "restored" => "przywrócony", "Nothing in here. Your trash bin is empty!" => "Nic tu nie ma. Twój kosz jest pusty!", "Name" => "Nazwa", -"Restore" => "Przywróć", "Deleted" => "Usunięte", "Delete" => "Usuń" ); diff --git a/apps/files_trashbin/l10n/pt_BR.php b/apps/files_trashbin/l10n/pt_BR.php index d524d8879e23f3040215e6a1fc58dbf941fbe16c..b7dd346b40a061128e8caf014cbe9c393cd3eeb5 100644 --- a/apps/files_trashbin/l10n/pt_BR.php +++ b/apps/files_trashbin/l10n/pt_BR.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Não foi possível excluir %s permanentemente", "Couldn't restore %s" => "Não foi possível restaurar %s", "Deleted files" => "Arquivos apagados", +"Restore" => "Restaurar", "Error" => "Erro", -"Deleted Files" => "Arquivos Apagados", "restored" => "restaurado", "Nothing in here. Your trash bin is empty!" => "Nada aqui. Sua lixeira está vazia!", "Name" => "Nome", -"Restore" => "Restaurar", "Deleted" => "Excluído", "Delete" => "Excluir" ); diff --git a/apps/files_trashbin/l10n/pt_PT.php b/apps/files_trashbin/l10n/pt_PT.php index 94dd0eb707a99af065bdd2557b876b94a2a17a1e..8a18d842c937d2843a3e63ec17b28d08bbd816a0 100644 --- a/apps/files_trashbin/l10n/pt_PT.php +++ b/apps/files_trashbin/l10n/pt_PT.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Não foi possível eliminar %s de forma permanente", "Couldn't restore %s" => "Não foi possível restaurar %s", "Deleted files" => "Ficheiros eliminados", +"Restore" => "Restaurar", "Error" => "Erro", -"Deleted Files" => "Ficheiros Apagados", "restored" => "Restaurado", "Nothing in here. Your trash bin is empty!" => "Não hà ficheiros. O lixo está vazio!", "Name" => "Nome", -"Restore" => "Restaurar", "Deleted" => "Apagado", "Delete" => "Eliminar" ); diff --git a/apps/files_trashbin/l10n/ru.php b/apps/files_trashbin/l10n/ru.php index d10369b9ca1eee47448d45af38857729d8aa73ea..8d00e0824183e00b5c6094296f2fe8dac59e53f5 100644 --- a/apps/files_trashbin/l10n/ru.php +++ b/apps/files_trashbin/l10n/ru.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "%s не может быть удалён навсегда", "Couldn't restore %s" => "%s не может быть восстановлен", "Deleted files" => "Удалённые файлы", +"Restore" => "Восстановить", "Error" => "Ошибка", -"Deleted Files" => "Удаленные файлы", "restored" => "восстановлен", "Nothing in here. Your trash bin is empty!" => "Здесь ничего нет. Ваша корзина пуста!", "Name" => "Имя", -"Restore" => "Восстановить", "Deleted" => "Удалён", "Delete" => "Удалить" ); diff --git a/apps/files_trashbin/l10n/sk_SK.php b/apps/files_trashbin/l10n/sk_SK.php index 3badd3a423bd1798ff3f024ad424a8644265bdc8..7588b555d96f4d35281e42616df9c5e63d9a2a00 100644 --- a/apps/files_trashbin/l10n/sk_SK.php +++ b/apps/files_trashbin/l10n/sk_SK.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Nemožno zmazať %s navždy", "Couldn't restore %s" => "Nemožno obnoviť %s", "Deleted files" => "Zmazané súbory", +"Restore" => "Obnoviť", "Error" => "Chyba", -"Deleted Files" => "Zmazané súbory", "restored" => "obnovené", "Nothing in here. Your trash bin is empty!" => "Žiadny obsah. Kôš je prázdny!", "Name" => "Názov", -"Restore" => "Obnoviť", "Deleted" => "Zmazané", "Delete" => "Zmazať" ); diff --git a/apps/files_trashbin/l10n/sl.php b/apps/files_trashbin/l10n/sl.php index 08da9b1c6e90c8c4b78ca6ef2c16838559a1a66f..f9dc5112ac30850c8480ffcc3d6402a13ed0af4e 100644 --- a/apps/files_trashbin/l10n/sl.php +++ b/apps/files_trashbin/l10n/sl.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Datoteke %s ni mogoče trajno izbrisati.", "Couldn't restore %s" => "Ni mogoče obnoviti %s", "Deleted files" => "Izbrisane datoteke", +"Restore" => "Obnovi", "Error" => "Napaka", -"Deleted Files" => "Izbrisane datoteke", "restored" => "obnovljeno", "Nothing in here. Your trash bin is empty!" => "Mapa smeti je prazna.", "Name" => "Ime", -"Restore" => "Obnovi", "Deleted" => "Izbrisano", "Delete" => "Izbriši" ); diff --git a/apps/files_trashbin/l10n/sq.php b/apps/files_trashbin/l10n/sq.php index 60d16f9b913a397525b35c81a6c8071ff7b8ade0..9e16b7a7bfd97a499f4699dc3aa8bbb35817374e 100644 --- a/apps/files_trashbin/l10n/sq.php +++ b/apps/files_trashbin/l10n/sq.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Nuk munda ta eliminoj përfundimisht %s", "Couldn't restore %s" => "Nuk munda ta rivendos %s", "Deleted files" => "Skedarë të fshirë ", +"Restore" => "Rivendos", "Error" => "Veprim i gabuar", -"Deleted Files" => "Skedarë të eliminuar", "restored" => "rivendosur", "Nothing in here. Your trash bin is empty!" => "Këtu nuk ka asgjë. Koshi juaj është bosh!", "Name" => "Emri", -"Restore" => "Rivendos", "Deleted" => "Eliminuar", "Delete" => "Elimino" ); diff --git a/apps/files_trashbin/l10n/sr.php b/apps/files_trashbin/l10n/sr.php index 7fb4c85ab634ce64caa93d62813b49a7467b6948..d4abc908c911220bd0ee14f12238e5575fbdf3e5 100644 --- a/apps/files_trashbin/l10n/sr.php +++ b/apps/files_trashbin/l10n/sr.php @@ -1,10 +1,10 @@ "Обрисане датотеке", +"Restore" => "Врати", "Error" => "Грешка", "Nothing in here. Your trash bin is empty!" => "Овде нема ништа. Корпа за отпатке је празна.", "Name" => "Име", -"Restore" => "Врати", "Deleted" => "Обрисано", "Delete" => "Обриши" ); diff --git a/apps/files_trashbin/l10n/sv.php b/apps/files_trashbin/l10n/sv.php index fd9ca8653f3e58856f0058b315846756d7d2118f..330bcc3482174482ce88a9d3fd23aebd28d93203 100644 --- a/apps/files_trashbin/l10n/sv.php +++ b/apps/files_trashbin/l10n/sv.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Kunde inte radera %s permanent", "Couldn't restore %s" => "Kunde inte återställa %s", "Deleted files" => "Raderade filer", +"Restore" => "Återskapa", "Error" => "Fel", -"Deleted Files" => "Raderade filer", "restored" => "återställd", "Nothing in here. Your trash bin is empty!" => "Ingenting här. Din papperskorg är tom!", "Name" => "Namn", -"Restore" => "Återskapa", "Deleted" => "Raderad", "Delete" => "Radera" ); diff --git a/apps/files_trashbin/l10n/th_TH.php b/apps/files_trashbin/l10n/th_TH.php index 857737c59e86a873b3a88493b7e93887194f1848..47c3450d2eaa33455775000e404a64c34ee05898 100644 --- a/apps/files_trashbin/l10n/th_TH.php +++ b/apps/files_trashbin/l10n/th_TH.php @@ -1,10 +1,9 @@ "คืนค่า", "Error" => "ข้อผิดพลาด", -"Deleted Files" => "ไฟล์ที่ลบทิ้ง", "Nothing in here. Your trash bin is empty!" => "ไม่มีอะไรอยู่ในนี้ ถังขยะของคุณยังว่างอยู่", "Name" => "ชื่อ", -"Restore" => "คืนค่า", "Deleted" => "ลบแล้ว", "Delete" => "ลบ" ); diff --git a/apps/files_trashbin/l10n/tr.php b/apps/files_trashbin/l10n/tr.php index ff4227e38c74a8d2c99b423b7e63e760a0237209..ab7441b822907fc2fbcb23e2d78c4923e56f838b 100644 --- a/apps/files_trashbin/l10n/tr.php +++ b/apps/files_trashbin/l10n/tr.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "%s alıcı olarak silinemedi", "Couldn't restore %s" => "%s geri yüklenemedi", "Deleted files" => "Silinmiş dosyalar", +"Restore" => "Geri yükle", "Error" => "Hata", -"Deleted Files" => "Silinen Dosyalar", "restored" => "geri yüklendi", "Nothing in here. Your trash bin is empty!" => "Burada hiçbir şey yok. Çöp kutunuz tamamen boş!", "Name" => "İsim", -"Restore" => "Geri yükle", "Deleted" => "Silindi", "Delete" => "Sil" ); diff --git a/apps/files_trashbin/l10n/uk.php b/apps/files_trashbin/l10n/uk.php index fa523fa3218685fbff12f8678c441d5699f12a89..328e8da5e02cc0633f5c32420a9b93b413f96b86 100644 --- a/apps/files_trashbin/l10n/uk.php +++ b/apps/files_trashbin/l10n/uk.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Неможливо видалити %s назавжди", "Couldn't restore %s" => "Неможливо відновити %s", "Deleted files" => "Видалено файлів", +"Restore" => "Відновити", "Error" => "Помилка", -"Deleted Files" => "Видалено Файлів", "restored" => "відновлено", "Nothing in here. Your trash bin is empty!" => "Нічого немає. Ваший кошик для сміття пустий!", "Name" => "Ім'я", -"Restore" => "Відновити", "Deleted" => "Видалено", "Delete" => "Видалити" ); diff --git a/apps/files_trashbin/l10n/ur_PK.php b/apps/files_trashbin/l10n/ur_PK.php index 49c82f53872c84830aff3465f8f713e57363bded..fc71b528ced8dec79cecac7b2277b8b9f9fa1393 100644 --- a/apps/files_trashbin/l10n/ur_PK.php +++ b/apps/files_trashbin/l10n/ur_PK.php @@ -1,5 +1,14 @@ "ایرر" +"Couldn't delete %s permanently" => "حذف نہیں ہو سکتا %s مستقل طور پر", +"Couldn't restore %s" => "بحال نہيں کيا جا سکتا %s", +"Deleted files" => "حذف شدہ فائليں", +"Restore" => "بحال", +"Error" => "ایرر", +"restored" => "بحال شدہ", +"Nothing in here. Your trash bin is empty!" => " یہاں کچھ بھی نہیں .آپکی ردی کی ٹوکری خالی ہے.", +"Name" => "اسم", +"Deleted" => "حذف شدہ ", +"Delete" => "حذف کریں" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_trashbin/l10n/vi.php b/apps/files_trashbin/l10n/vi.php index 57c82cea5f75d99f206278464948e2c40d745b46..d374effcabb36165dd97c4bc45baac23740c0212 100644 --- a/apps/files_trashbin/l10n/vi.php +++ b/apps/files_trashbin/l10n/vi.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "Không thể xóa %s vĩnh viễn", "Couldn't restore %s" => "Không thể khôi phục %s", "Deleted files" => "File đã bị xóa", +"Restore" => "Khôi phục", "Error" => "Lỗi", -"Deleted Files" => "File đã xóa", "restored" => "khôi phục", "Nothing in here. Your trash bin is empty!" => "Không có gì ở đây. Thùng rác của bạn rỗng!", "Name" => "Tên", -"Restore" => "Khôi phục", "Deleted" => "Đã xóa", "Delete" => "Xóa" ); diff --git a/apps/files_trashbin/l10n/zh_CN.php b/apps/files_trashbin/l10n/zh_CN.php index ef6a63b29593e72ddd96e05c06cdc842a607de08..49cd412299e7d85cff296e4d4268b371485af624 100644 --- a/apps/files_trashbin/l10n/zh_CN.php +++ b/apps/files_trashbin/l10n/zh_CN.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "无法彻底删除文件%s", "Couldn't restore %s" => "无法恢复%s", "Deleted files" => "已删除文件", +"Restore" => "恢复", "Error" => "错误", -"Deleted Files" => "已删除文件", "restored" => "已恢复", "Nothing in here. Your trash bin is empty!" => "这里没有东西. 你的回收站是空的!", "Name" => "名称", -"Restore" => "恢复", "Deleted" => "已删除", "Delete" => "删除" ); diff --git a/apps/files_trashbin/l10n/zh_TW.php b/apps/files_trashbin/l10n/zh_TW.php index c42d70790e92e3f2e5cf5a060288a668f00f0d7b..014527083e3d082c2eff0a9de96a18c022b48783 100644 --- a/apps/files_trashbin/l10n/zh_TW.php +++ b/apps/files_trashbin/l10n/zh_TW.php @@ -3,12 +3,11 @@ $TRANSLATIONS = array( "Couldn't delete %s permanently" => "無法永久刪除 %s", "Couldn't restore %s" => "無法還原 %s", "Deleted files" => "回收桶", +"Restore" => "還原", "Error" => "錯誤", -"Deleted Files" => "已刪除的檔案", "restored" => "已還原", "Nothing in here. Your trash bin is empty!" => "您的回收桶是空的!", "Name" => "名稱", -"Restore" => "還原", "Deleted" => "已刪除", "Delete" => "刪除" ); diff --git a/apps/files_trashbin/lib/helper.php b/apps/files_trashbin/lib/helper.php index e6ca73520a6fe5bb747d7ff06e3c4ea5152e7afe..ebedce31abe107c6af6126d819a01c5fdc589b35 100644 --- a/apps/files_trashbin/lib/helper.php +++ b/apps/files_trashbin/lib/helper.php @@ -8,16 +8,19 @@ class Helper { /** * Retrieves the contents of a trash bin directory. + * * @param string $dir path to the directory inside the trashbin * or empty to retrieve the root of the trashbin + * @param string $sortAttribute attribute to sort on or empty to disable sorting + * @param bool $sortDescending true for descending sort, false otherwise * @return \OCP\Files\FileInfo[] */ - public static function getTrashFiles($dir){ + public static function getTrashFiles($dir, $sortAttribute = '', $sortDescending = false){ $result = array(); $timestamp = null; $user = \OCP\User::getUser(); - $view = new \OC_Filesystemview('/' . $user . '/files_trashbin/files'); + $view = new \OC\Files\View('/' . $user . '/files_trashbin/files'); if (ltrim($dir, '/') !== '' && !$view->is_dir($dir)) { throw new \Exception('Directory does not exists'); @@ -57,8 +60,9 @@ class Helper closedir($dirContent); } - usort($result, array('\OCA\Files\Helper', 'fileCmp')); - + if ($sortAttribute !== '') { + return \OCA\Files\Helper::sortFiles($result, $sortAttribute, $sortDescending); + } return $result; } diff --git a/apps/files_trashbin/lib/hooks.php b/apps/files_trashbin/lib/hooks.php index b2c6bc1df50988c960f5dfb54a96ab29f4aad8a2..b6f0fb7e547882bb2bccd80945b5298070a5b1e0 100644 --- a/apps/files_trashbin/lib/hooks.php +++ b/apps/files_trashbin/lib/hooks.php @@ -29,8 +29,8 @@ namespace OCA\Files_Trashbin; class Hooks { /** - * @brief Copy files to trash bin - * @param array + * Copy files to trash bin + * @param array $params * * This function is connected to the delete signal of OC_Filesystem * to copy the file to the trash bin @@ -44,8 +44,8 @@ class Hooks { } /** - * @brief clean up user specific settings if user gets deleted - * @param array with uid + * clean up user specific settings if user gets deleted + * @param array $params array with uid * * This function is connected to the pre_deleteUser signal of OC_Users * to remove the used space for the trash bin stored in the database @@ -56,7 +56,7 @@ class Hooks { Trashbin::deleteUser($uid); } } - + public static function post_write_hook($params) { Trashbin::resizeTrash(\OCP\User::getUser()); } diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php index 9b931333b7f729542c2c87bd539ea45a410d6588..e95f1b13c37fbfb98dc9226530188860740bb4f2 100644 --- a/apps/files_trashbin/lib/trashbin.php +++ b/apps/files_trashbin/lib/trashbin.php @@ -62,7 +62,7 @@ class Trashbin { /** - * @brief copy file to owners trash + * copy file to owners trash * @param string $sourcePath * @param string $owner * @param string $ownerPath @@ -96,7 +96,7 @@ class Trashbin { /** * move file to the trash bin * - * @param $file_path path to the deleted file/directory relative to the files root directory + * @param string $file_path path to the deleted file/directory relative to the files root directory */ public static function move2trash($file_path) { $user = \OCP\User::getUser(); @@ -155,11 +155,11 @@ class Trashbin { /** * Move file versions to trash so that they can be restored later * - * @param $file_path path to original file - * @param $filename of deleted file + * @param string $file_path path to original file + * @param string $filename of deleted file * @param integer $timestamp when the file was deleted * - * @return size of stored versions + * @return int size of stored versions */ private static function retainVersions($file_path, $filename, $timestamp) { $size = 0; @@ -200,11 +200,11 @@ class Trashbin { /** * Move encryption keys to trash so that they can be restored later * - * @param $file_path path to original file - * @param $filename of deleted file + * @param string $file_path path to original file + * @param string $filename of deleted file * @param integer $timestamp when the file was deleted * - * @return size of encryption keys + * @return int size of encryption keys */ private static function retainEncryptionKeys($file_path, $filename, $timestamp) { $size = 0; @@ -216,7 +216,7 @@ class Trashbin { list($owner, $ownerPath) = self::getUidAndFilename($file_path); - $util = new \OCA\Encryption\Util(new \OC_FilesystemView('/'), $user); + $util = new \OCA\Encryption\Util(new \OC\Files\View('/'), $user); // disable proxy to prevent recursive calls $proxyStatus = \OC_FileProxy::$enabled; @@ -299,9 +299,9 @@ class Trashbin { /** * restore files from trash bin * - * @param $file path to the deleted file - * @param $filename name of the file - * @param $timestamp time when the file was deleted + * @param string $file path to the deleted file + * @param string $filename name of the file + * @param int $timestamp time when the file was deleted * * @return bool */ @@ -373,14 +373,14 @@ class Trashbin { } /** - * @brief restore versions from trash bin + * restore versions from trash bin * * @param \OC\Files\View $view file view - * @param $file complete path to file - * @param $filename name of file once it was deleted + * @param string $file complete path to file + * @param string $filename name of file once it was deleted * @param string $uniqueFilename new file name to restore the file without overwriting existing files - * @param $location location if file - * @param $timestamp deleteion time + * @param string $location location if file + * @param int $timestamp deleteion time * */ private static function restoreVersions($view, $file, $filename, $uniqueFilename, $location, $timestamp) { @@ -421,14 +421,14 @@ class Trashbin { } /** - * @brief restore encryption keys from trash bin + * restore encryption keys from trash bin * * @param \OC\Files\View $view - * @param $file complete path to file - * @param $filename name of file + * @param string $file complete path to file + * @param string $filename name of file * @param string $uniqueFilename new file name to restore the file without overwriting existing files - * @param $location location of file - * @param $timestamp deleteion time + * @param string $location location of file + * @param int $timestamp deleteion time * */ private static function restoreEncryptionKeys($view, $file, $filename, $uniqueFilename, $location, $timestamp) { @@ -441,7 +441,7 @@ class Trashbin { list($owner, $ownerPath) = self::getUidAndFilename($target); - $util = new \OCA\Encryption\Util(new \OC_FilesystemView('/'), $user); + $util = new \OCA\Encryption\Util(new \OC\Files\View('/'), $user); if ($util->isSystemWideMountPoint($ownerPath)) { $baseDir = '/files_encryption/'; @@ -498,7 +498,7 @@ class Trashbin { $rootView->rename($ownerShareKey, $baseDir . '/share-keys/' . $ownerPath . '.' . $user . '.shareKey'); // try to re-share if file is shared - $filesystemView = new \OC_FilesystemView('/'); + $filesystemView = new \OC\Files\View('/'); $session = new \OCA\Encryption\Session($filesystemView); $util = new \OCA\Encryption\Util($filesystemView, $user); @@ -523,7 +523,7 @@ class Trashbin { } /** - * @brief delete all files from the trash + * delete all files from the trash */ public static function deleteAll() { $user = \OCP\User::getUser(); @@ -537,12 +537,12 @@ class Trashbin { /** - * @brief delete file from trash bin permanently + * delete file from trash bin permanently * - * @param $filename path to the file - * @param $timestamp of deletion time + * @param string $filename path to the file + * @param int $timestamp of deletion time * - * @return size of deleted files + * @return int size of deleted files */ public static function delete($filename, $timestamp = null) { $user = \OCP\User::getUser(); @@ -634,9 +634,9 @@ class Trashbin { /** * check to see whether a file exists in trashbin * - * @param $filename path to the file - * @param $timestamp of deletion time - * @return true if file exists, otherwise false + * @param string $filename path to the file + * @param int $timestamp of deletion time + * @return bool true if file exists, otherwise false */ public static function file_exists($filename, $timestamp = null) { $user = \OCP\User::getUser(); @@ -653,10 +653,10 @@ class Trashbin { } /** - * @brief deletes used space for trash bin in db if user was deleted + * deletes used space for trash bin in db if user was deleted * * @param type $uid id of deleted user - * @return result of db delete operation + * @return bool result of db delete operation */ public static function deleteUser($uid) { $query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_trash` WHERE `user`=?'); @@ -672,7 +672,7 @@ class Trashbin { * calculate remaining free space for trash bin * * @param integer $trashbinSize current size of the trash bin - * @return available free space for trash bin + * @return int available free space for trash bin */ private static function calculateFreeSpace($trashbinSize) { $softQuota = true; @@ -707,7 +707,7 @@ class Trashbin { } /** - * @brief resize trash bin if necessary after a new file was added to ownCloud + * resize trash bin if necessary after a new file was added to ownCloud * @param string $user user id */ public static function resizeTrash($user) { @@ -808,8 +808,8 @@ class Trashbin { /** * find all versions which belong to the file we want to restore * - * @param $filename name of the file which should be restored - * @param $timestamp timestamp when the file was deleted + * @param string $filename name of the file which should be restored + * @param int $timestamp timestamp when the file was deleted */ private static function getVersionsFromTrash($filename, $timestamp) { $view = new \OC\Files\View('/' . \OCP\User::getUser() . '/files_trashbin/versions'); @@ -841,8 +841,8 @@ class Trashbin { /** * find unique extension for restored file if a file with the same name already exists * - * @param $location where the file should be restored - * @param $filename name of the file + * @param string $location where the file should be restored + * @param string $filename name of the file * @param \OC\Files\View $view filesystem view relative to users root directory * @return string with unique extension */ @@ -871,7 +871,7 @@ class Trashbin { } /** - * @brief get the size from a given root folder + * get the size from a given root folder * @param \OC\Files\View $view file view on the root folder * @return integer size of the folder */ @@ -883,11 +883,19 @@ class Trashbin { $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($root), \RecursiveIteratorIterator::CHILD_FIRST); $size = 0; - foreach ($iterator as $path) { + /** + * RecursiveDirectoryIterator on an NFS path isn't iterable with foreach + * This bug is fixed in PHP 5.5.9 or before + * See #8376 + */ + $iterator->rewind(); + while ($iterator->valid()) { + $path = $iterator->current(); $relpath = substr($path, strlen($root) - 1); if (!$view->is_dir($relpath)) { $size += $view->filesize($relpath); } + $iterator->next(); } return $size; } @@ -895,7 +903,7 @@ class Trashbin { /** * get current size of trash bin from a given user * - * @param $user user who owns the trash bin + * @param string $user user who owns the trash bin * @return mixed trash bin size or false if no trash bin size is stored */ private static function getTrashbinSize($user) { @@ -917,7 +925,7 @@ class Trashbin { } /** - * @brief check if trash bin is empty for a given user + * check if trash bin is empty for a given user * @param string $user */ public static function isEmpty($user) { diff --git a/apps/files_trashbin/list.php b/apps/files_trashbin/list.php new file mode 100644 index 0000000000000000000000000000000000000000..b4047b82ef9b6681c6ef59610dabac60ee4925ae --- /dev/null +++ b/apps/files_trashbin/list.php @@ -0,0 +1,11 @@ +printPage(); diff --git a/apps/files_trashbin/templates/index.php b/apps/files_trashbin/templates/index.php index b6c61c9b1c3ea136b2727fda463d8e385a505668..fc18e88c41e02d2c28746ec1b6cb3ed592e632e6 100644 --- a/apps/files_trashbin/templates/index.php +++ b/apps/files_trashbin/templates/index.php @@ -1,3 +1,4 @@ +
@@ -5,31 +6,29 @@ - - - + - - + +
+ - t( 'Deleted' )); ?> +
diff --git a/apps/files_trashbin/tests/js/appSpec.js b/apps/files_trashbin/tests/js/appSpec.js new file mode 100644 index 0000000000000000000000000000000000000000..ca7d71831f8a33df82e2bfc3423070365b1c6fd3 --- /dev/null +++ b/apps/files_trashbin/tests/js/appSpec.js @@ -0,0 +1,69 @@ +/** +* ownCloud +* +* @author Vincent Petry +* @copyright 2014 Vincent Petry +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library 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 AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Affero General Public +* License along with this library. If not, see . +* +*/ + +describe('OCA.Trashbin.App tests', function() { + var App = OCA.Trashbin.App; + + beforeEach(function() { + $('#testArea').append( + '
' + + '
' + + '
' + + '' + + '' + + '
' + + '
' + ); + App.initialize($('#app-content-trashbin')); + }); + afterEach(function() { + App._initialized = false; + App.fileList = null; + }); + + describe('initialization', function() { + it('creates a custom filelist instance', function() { + App.initialize(); + expect(App.fileList).toBeDefined(); + expect(App.fileList.$el.is('#app-content-trashbin')).toEqual(true); + }); + + it('registers custom file actions', function() { + var fileActions; + App.initialize(); + + fileActions = App.fileList.fileActions; + + expect(fileActions.actions.all).toBeDefined(); + expect(fileActions.actions.all.Restore).toBeDefined(); + expect(fileActions.actions.all.Delete).toBeDefined(); + + expect(fileActions.actions.all.Rename).not.toBeDefined(); + expect(fileActions.actions.all.Download).not.toBeDefined(); + + expect(fileActions.defaults.dir).toEqual('Open'); + }); + }); +}); diff --git a/apps/files_trashbin/tests/js/filelistSpec.js b/apps/files_trashbin/tests/js/filelistSpec.js new file mode 100644 index 0000000000000000000000000000000000000000..d41c24c3cc9be9f74beb87189ea919c24daee292 --- /dev/null +++ b/apps/files_trashbin/tests/js/filelistSpec.js @@ -0,0 +1,309 @@ +/** +* ownCloud +* +* @author Vincent Petry +* @copyright 2014 Vincent Petry +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library 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 AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Affero General Public +* License along with this library. If not, see . +* +*/ + +describe('OCA.Trashbin.FileList tests', function() { + var testFiles, alertStub, notificationStub, fileList; + var FileActions = OCA.Files.FileActions; + + beforeEach(function() { + alertStub = sinon.stub(OC.dialogs, 'alert'); + notificationStub = sinon.stub(OC.Notification, 'show'); + + // init parameters and test table elements + $('#testArea').append( + '
' + + // init horrible parameters + '' + + // set this but it shouldn't be used (could be the one from the + // files app) + '' + + // dummy controls + '
' + + '
' + + '
' + + '
' + + // dummy table + // TODO: at some point this will be rendered by the fileList class itself! + '' + + '' + + '' + + '' + + '
' + + '
Empty content message
' + + '
' + ); + + testFiles = [{ + id: 1, + type: 'file', + name: 'One.txt', + mtime: 11111000, + mimetype: 'text/plain', + etag: 'abc' + }, { + id: 2, + type: 'file', + name: 'Two.jpg', + mtime: 22222000, + mimetype: 'image/jpeg', + etag: 'def', + }, { + id: 3, + type: 'file', + name: 'Three.pdf', + mtime: 33333000, + mimetype: 'application/pdf', + etag: '123', + }, { + id: 4, + type: 'dir', + mtime: 99999000, + name: 'somedir', + mimetype: 'httpd/unix-directory', + etag: '456' + }]; + + fileList = new OCA.Trashbin.FileList($('#app-content-trashbin')); + OCA.Trashbin.App.registerFileActions(fileList); + }); + afterEach(function() { + testFiles = undefined; + fileList = undefined; + + FileActions.clear(); + $('#dir').remove(); + notificationStub.restore(); + alertStub.restore(); + }); + describe('Initialization', function() { + it('Sorts by mtime by default', function() { + expect(fileList._sort).toEqual('mtime'); + expect(fileList._sortDirection).toEqual('desc'); + }); + it('Always returns read and delete permission', function() { + expect(fileList.getDirectoryPermissions()).toEqual(OC.PERMISSION_READ | OC.PERMISSION_DELETE); + }); + }); + describe('Breadcrumbs', function() { + beforeEach(function() { + var data = { + status: 'success', + data: { + files: testFiles, + permissions: 1 + } + }; + fakeServer.respondWith(/\/index\.php\/apps\/files_trashbin\/ajax\/list.php\?dir=%2Fsubdir/, [ + 200, { + "Content-Type": "application/json" + }, + JSON.stringify(data) + ]); + }); + it('links the breadcrumb to the trashbin view', function() { + fileList.changeDirectory('/subdir', false, true); + fakeServer.respond(); + var $crumbs = fileList.$el.find('#controls .crumb'); + expect($crumbs.length).toEqual(2); + expect($crumbs.eq(0).find('a').text()).toEqual(''); + expect($crumbs.eq(0).find('a').attr('href')) + .toEqual(OC.webroot + '/index.php/apps/files?view=trashbin&dir=/'); + expect($crumbs.eq(1).find('a').text()).toEqual('subdir'); + expect($crumbs.eq(1).find('a').attr('href')) + .toEqual(OC.webroot + '/index.php/apps/files?view=trashbin&dir=/subdir'); + }); + }); + describe('Rendering rows', function() { + it('renders rows with the correct data when in root', function() { + // dir listing is false when in root + $('#dir').val('/'); + fileList.setFiles(testFiles); + var $rows = fileList.$el.find('tbody tr'); + var $tr = $rows.eq(0); + expect($rows.length).toEqual(4); + expect($tr.attr('data-id')).toEqual('1'); + expect($tr.attr('data-type')).toEqual('file'); + expect($tr.attr('data-file')).toEqual('One.txt.d11111'); + expect($tr.attr('data-size')).not.toBeDefined(); + expect($tr.attr('data-etag')).toEqual('abc'); + expect($tr.attr('data-permissions')).toEqual('9'); // read and delete + expect($tr.attr('data-mime')).toEqual('text/plain'); + expect($tr.attr('data-mtime')).toEqual('11111000'); + expect($tr.find('a.name').attr('href')).toEqual('#'); + + expect($tr.find('.nametext').text().trim()).toEqual('One.txt'); + + expect(fileList.findFileEl('One.txt.d11111')[0]).toEqual($tr[0]); + }); + it('renders rows with the correct data when in subdirectory', function() { + // dir listing is true when in a subdir + $('#dir').val('/subdir'); + + fileList.setFiles(testFiles); + var $rows = fileList.$el.find('tbody tr'); + var $tr = $rows.eq(0); + expect($rows.length).toEqual(4); + expect($tr.attr('data-id')).toEqual('1'); + expect($tr.attr('data-type')).toEqual('file'); + expect($tr.attr('data-file')).toEqual('One.txt'); + expect($tr.attr('data-size')).not.toBeDefined(); + expect($tr.attr('data-etag')).toEqual('abc'); + expect($tr.attr('data-permissions')).toEqual('9'); // read and delete + expect($tr.attr('data-mime')).toEqual('text/plain'); + expect($tr.attr('data-mtime')).toEqual('11111000'); + expect($tr.find('a.name').attr('href')).toEqual('#'); + + expect($tr.find('.nametext').text().trim()).toEqual('One.txt'); + + expect(fileList.findFileEl('One.txt')[0]).toEqual($tr[0]); + }); + it('does not render a size column', function() { + expect(fileList.$el.find('tbody tr .filesize').length).toEqual(0); + }); + }); + describe('File actions', function() { + describe('Deleting single files', function() { + // TODO: checks ajax call + // TODO: checks spinner + // TODO: remove item after delete + // TODO: bring back item if delete failed + }); + describe('Restoring single files', function() { + // TODO: checks ajax call + // TODO: checks spinner + // TODO: remove item after restore + // TODO: bring back item if restore failed + }); + }); + describe('file previews', function() { + // TODO: check that preview URL is going through files_trashbin + }); + describe('loading file list', function() { + // TODO: check that ajax URL is going through files_trashbin + }); + describe('breadcrumbs', function() { + // TODO: test label + URL + }); + describe('Global Actions', function() { + beforeEach(function() { + fileList.setFiles(testFiles); + fileList.findFileEl('One.txt.d11111').find('input:checkbox').click(); + fileList.findFileEl('Three.pdf.d33333').find('input:checkbox').click(); + fileList.findFileEl('somedir.d99999').find('input:checkbox').click(); + }); + describe('Delete', function() { + it('Deletes selected files when "Delete" clicked', function() { + var request; + $('.selectedActions .delete-selected').click(); + expect(fakeServer.requests.length).toEqual(1); + request = fakeServer.requests[0]; + expect(request.url).toEqual(OC.webroot + '/index.php/apps/files_trashbin/ajax/delete.php'); + expect(OC.parseQueryString(request.requestBody)) + .toEqual({'dir': '/', files: '["One.txt.d11111","Three.pdf.d33333","somedir.d99999"]'}); + fakeServer.requests[0].respond( + 200, + { 'Content-Type': 'application/json' }, + JSON.stringify({ + status: 'success', + data: { + success: [ + {filename: 'One.txt.d11111'}, + {filename: 'Three.pdf.d33333'}, + {filename: 'somedir.d99999'} + ] + } + }) + ); + expect(fileList.findFileEl('One.txt.d11111').length).toEqual(0); + expect(fileList.findFileEl('Three.pdf.d33333').length).toEqual(0); + expect(fileList.findFileEl('somedir.d99999').length).toEqual(0); + expect(fileList.findFileEl('Two.jpg.d22222').length).toEqual(1); + }); + it('Deletes all files when all selected when "Delete" clicked', function() { + var request; + $('.select-all').click(); + $('.selectedActions .delete-selected').click(); + expect(fakeServer.requests.length).toEqual(1); + request = fakeServer.requests[0]; + expect(request.url).toEqual(OC.webroot + '/index.php/apps/files_trashbin/ajax/delete.php'); + expect(OC.parseQueryString(request.requestBody)) + .toEqual({'dir': '/', allfiles: 'true'}); + fakeServer.requests[0].respond( + 200, + { 'Content-Type': 'application/json' }, + JSON.stringify({status: 'success'}) + ); + expect(fileList.isEmpty).toEqual(true); + }); + }); + describe('Restore', function() { + it('Restores selected files when "Restore" clicked', function() { + var request; + $('.selectedActions .undelete').click(); + expect(fakeServer.requests.length).toEqual(1); + request = fakeServer.requests[0]; + expect(request.url).toEqual(OC.webroot + '/index.php/apps/files_trashbin/ajax/undelete.php'); + expect(OC.parseQueryString(request.requestBody)) + .toEqual({'dir': '/', files: '["One.txt.d11111","Three.pdf.d33333","somedir.d99999"]'}); + fakeServer.requests[0].respond( + 200, + { 'Content-Type': 'application/json' }, + JSON.stringify({ + status: 'success', + data: { + success: [ + {filename: 'One.txt.d11111'}, + {filename: 'Three.pdf.d33333'}, + {filename: 'somedir.d99999'} + ] + } + }) + ); + expect(fileList.findFileEl('One.txt.d11111').length).toEqual(0); + expect(fileList.findFileEl('Three.pdf.d33333').length).toEqual(0); + expect(fileList.findFileEl('somedir.d99999').length).toEqual(0); + expect(fileList.findFileEl('Two.jpg.d22222').length).toEqual(1); + }); + it('Restores all files when all selected when "Restore" clicked', function() { + var request; + $('.select-all').click(); + $('.selectedActions .undelete').click(); + expect(fakeServer.requests.length).toEqual(1); + request = fakeServer.requests[0]; + expect(request.url).toEqual(OC.webroot + '/index.php/apps/files_trashbin/ajax/undelete.php'); + expect(OC.parseQueryString(request.requestBody)) + .toEqual({'dir': '/', allfiles: 'true'}); + fakeServer.requests[0].respond( + 200, + { 'Content-Type': 'application/json' }, + JSON.stringify({status: 'success'}) + ); + expect(fileList.isEmpty).toEqual(true); + }); + }); + }); +}); diff --git a/apps/files_versions/appinfo/routes.php b/apps/files_versions/appinfo/routes.php index 8d2abaa89e5ed80cc8a5585e41394a6774d62f9b..80fe0e5d617e5921a970f9b66768f2c0c616d945 100644 --- a/apps/files_versions/appinfo/routes.php +++ b/apps/files_versions/appinfo/routes.php @@ -8,7 +8,8 @@ // Register with the capabilities API OC_API::register('get', '/cloud/capabilities', array('OCA\Files_Versions\Capabilities', 'getCapabilities'), 'files_versions', OC_API::USER_AUTH); -$this->create('core_ajax_versions_preview', '/preview.png')->action( +/** @var $this \OCP\Route\IRouter */ +$this->create('core_ajax_versions_preview', '/preview')->action( function() { require_once __DIR__ . '/../ajax/preview.php'; }); diff --git a/apps/files_versions/l10n/ur_PK.php b/apps/files_versions/l10n/ur_PK.php new file mode 100644 index 0000000000000000000000000000000000000000..bbf2391a93e4c1d03343dcf010e4312d663b2f39 --- /dev/null +++ b/apps/files_versions/l10n/ur_PK.php @@ -0,0 +1,5 @@ + "بحال" +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/lib/hooks.php b/apps/files_versions/lib/hooks.php index 5d3882cc3e3cca1ee4c303e48b2e5c94395d1662..2de4001affd05822a2672d7f2a0806bd63e16834 100644 --- a/apps/files_versions/lib/hooks.php +++ b/apps/files_versions/lib/hooks.php @@ -29,8 +29,8 @@ class Hooks { /** - * @brief Erase versions of deleted file - * @param array + * Erase versions of deleted file + * @param array $params * * This function is connected to the delete signal of OC_Filesystem * cleanup the versions directory if the actual file gets deleted @@ -46,7 +46,7 @@ class Hooks { } /** - * @brief mark file as "deleted" so that we can clean up the versions if the file is gone + * mark file as "deleted" so that we can clean up the versions if the file is gone * @param array $params */ public static function pre_remove_hook($params) { @@ -57,8 +57,8 @@ class Hooks { } /** - * @brief rename/move versions of renamed/moved files - * @param array with oldpath and newpath + * rename/move versions of renamed/moved files + * @param array $params array with oldpath and newpath * * This function is connected to the rename signal of OC_Filesystem and adjust the name and location * of the stored versions along the actual file @@ -75,8 +75,8 @@ class Hooks { } /** - * @brief clean up user specific settings if user gets deleted - * @param array with uid + * clean up user specific settings if user gets deleted + * @param array $params array with uid * * This function is connected to the pre_deleteUser signal of OC_Users * to remove the used space for versions stored in the database diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php index 290264a90cc9a51bd6f779c41bd3b085b2d8d89a..56e1dfc2e2416cb7fd8ad49e48ef2a608288cb34 100644 --- a/apps/files_versions/lib/versions.php +++ b/apps/files_versions/lib/versions.php @@ -53,7 +53,7 @@ class Storage { /** * get current size of all versions from a given user * - * @param $user user who owns the versions + * @param string $user user who owns the versions * @return mixed versions size or false if no versions size is stored */ private static function getVersionsSize($user) { @@ -69,8 +69,8 @@ class Storage { /** * write to the database how much space is in use for versions * - * @param $user owner of the versions - * @param $size size of the versions + * @param string $user owner of the versions + * @param int $size size of the versions */ private static function setVersionsSize($user, $size) { if ( self::getVersionsSize($user) === false) { @@ -147,7 +147,7 @@ class Storage { /** - * @brief mark file as deleted so that we can remove the versions if the file is gone + * mark file as deleted so that we can remove the versions if the file is gone * @param string $path */ public static function markDeletedFile($path) { @@ -261,11 +261,11 @@ class Storage { /** - * @brief get a list of all available versions of a file in descending chronological order + * get a list of all available versions of a file in descending chronological order * @param string $uid user id from the owner of the file * @param string $filename file to find versions of, relative to the user files dir * @param string $userFullPath - * @returns array versions newest version first + * @return array versions newest version first */ public static function getVersions($uid, $filename, $userFullPath = '') { $versions = array(); @@ -307,7 +307,7 @@ class Storage { } /** - * @brief translate a timestamp into a string like "5 days ago" + * translate a timestamp into a string like "5 days ago" * @param int $timestamp * @return string for example "5 days ago" */ @@ -334,9 +334,9 @@ class Storage { } /** - * @brief deletes used space for files versions in db if user was deleted + * deletes used space for files versions in db if user was deleted * - * @param type $uid id of deleted user + * @param string $uid id of deleted user * @return \OC_DB_StatementWrapper of db delete operation */ public static function deleteUser($uid) { @@ -345,9 +345,9 @@ class Storage { } /** - * @brief get the size of all stored versions from a given user - * @param $uid id from the user - * @return size of vesions + * get the size of all stored versions from a given user + * @param string $uid id from the user + * @return int size of versions */ private static function calculateSize($uid) { if (\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED) == 'true') { @@ -372,7 +372,7 @@ class Storage { } /** - * @brief returns all stored file versions from a given user + * returns all stored file versions from a given user * @param string $uid id of the user * @return array with contains two arrays 'all' which contains all versions sorted by age and 'by_file' which contains all versions sorted by filename */ @@ -420,7 +420,7 @@ class Storage { } /** - * @brief get list of files we want to expire + * get list of files we want to expire * @param array $versions list of versions * @param integer $time * @return array containing the list of to deleted versions and the size of them @@ -477,7 +477,7 @@ class Storage { } /** - * @brief Erase a file's versions which exceed the set quota + * Erase a file's versions which exceed the set quota */ private static function expire($filename, $versionsSize = null, $offset = 0) { if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { @@ -574,12 +574,12 @@ class Storage { } /** - * @brief create recursively missing directories + * create recursively missing directories * @param string $filename $path to a file * @param \OC\Files\View $view view on data/user/ */ private static function createMissingDirectories($filename, $view) { - $dirname = \OC_Filesystem::normalizePath(dirname($filename)); + $dirname = \OC\Files\Filesystem::normalizePath(dirname($filename)); $dirParts = explode('/', $dirname); $dir = "/files_versions"; foreach ($dirParts as $part) { diff --git a/apps/files_versions/tests/versions.php b/apps/files_versions/tests/versions.php index 9f15b86d981452e167f83ee475087b9b35173f48..aa66faffcbfe0a19a304b4f0aef5f4fc751140db 100644 --- a/apps/files_versions/tests/versions.php +++ b/apps/files_versions/tests/versions.php @@ -24,14 +24,14 @@ require_once __DIR__ . '/../lib/versions.php'; /** * Class Test_Files_versions - * @brief this class provide basic files versions test + * this class provide basic files versions test */ class Test_Files_Versioning extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test expire logic + * test expire logic * @dataProvider versionsProvider */ function testGetExpireList($versions, $sizeOfAllDeletedFiles) { diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php index 3b5f377e1085f2431b9e9ab42d2996c62c335b3f..4051b1d8cae2ad062c309630efcb6d08cf42df2b 100644 --- a/apps/user_ldap/group_ldap.php +++ b/apps/user_ldap/group_ldap.php @@ -39,10 +39,10 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { } /** - * @brief is user in group? - * @param $uid uid of the user - * @param $gid gid of the group - * @returns true/false + * is user in group? + * @param string $uid uid of the user + * @param string $gid gid of the group + * @return bool * * Checks whether the user is member of a group or not. */ @@ -126,9 +126,9 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { } /** - * @brief Get all groups a user belongs to - * @param $uid Name of the user - * @returns array with group names + * Get all groups a user belongs to + * @param string $uid Name of the user + * @return array with group names * * This function fetches all groups a user belongs to. It does not check * if the user exists at all. @@ -177,8 +177,8 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { } $allGroups = array(); if (array_key_exists($dn, $seen)) { - // avoid loops - return array(); + // avoid loops + return array(); } $seen[$dn] = true; $filter = $this->access->combineFilterWithAnd(array( @@ -204,8 +204,8 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { } /** - * @brief get a list of all users in a group - * @returns array with user ids + * get a list of all users in a group + * @return array with user ids */ public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) { if(!$this->enabled) { @@ -285,10 +285,10 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { } /** - * @brief returns the number of users in a group, who match the search term - * @param string the internal group name - * @param string optional, a search string - * @returns int | bool + * returns the number of users in a group, who match the search term + * @param string $gid the internal group name + * @param string $search optional, a search string + * @return int|bool */ public function countUsersInGroup($gid, $search = '') { $cachekey = 'countUsersInGroup-'.$gid.'-'.$search; @@ -363,27 +363,8 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { } /** - * @brief get a list of all display names in a group - * @returns array with display names (value) and user ids(key) - */ - public function displayNamesInGroup($gid, $search, $limit, $offset) { - if(!$this->enabled) { - return array(); - } - if(!$this->groupExists($gid)) { - return array(); - } - $users = $this->usersInGroup($gid, $search, $limit, $offset); - $displayNames = array(); - foreach($users as $user) { - $displayNames[$user] = \OC_User::getDisplayName($user); - } - return $displayNames; - } - - /** - * @brief get a list of all groups - * @returns array with group names + * get a list of all groups + * @return array with group names * * Returns a list with all groups (used by getGroups) */ @@ -421,8 +402,8 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { } /** - * @brief get a list of all groups using a paged search - * @returns array with group names + * get a list of all groups using a paged search + * @return array with group names * * Returns a list with all groups * Uses a paged search if available to override a @@ -499,17 +480,14 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { } /** - * @brief Check if backend implements actions - * @param $actions bitwise-or'ed actions - * @returns boolean + * Check if backend implements actions + * @param int $actions bitwise-or'ed actions + * @return boolean * * Returns the supported actions as int to be * compared with OC_USER_BACKEND_CREATE_USER etc. */ public function implementsActions($actions) { - return (bool)(( - OC_GROUP_BACKEND_GET_DISPLAYNAME - | OC_GROUP_BACKEND_COUNT_USERS - ) & $actions); + return (bool)(OC_GROUP_BACKEND_COUNT_USERS & $actions); } } diff --git a/apps/user_ldap/group_proxy.php b/apps/user_ldap/group_proxy.php index c00097362399bec634a33d4bb2dd4e723ba0d1ce..1a36953676bad82e065c63a9b2045a0117ae2e71 100644 --- a/apps/user_ldap/group_proxy.php +++ b/apps/user_ldap/group_proxy.php @@ -30,13 +30,13 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { private $refBackend = null; /** - * @brief Constructor - * @param $serverConfigPrefixes array containing the config Prefixes + * Constructor + * @param string[] $serverConfigPrefixes array containing the config Prefixes */ public function __construct($serverConfigPrefixes, ILDAPWrapper $ldap) { parent::__construct($ldap); foreach($serverConfigPrefixes as $configPrefix) { - $this->backends[$configPrefix] = + $this->backends[$configPrefix] = new \OCA\user_ldap\GROUP_LDAP($this->getAccess($configPrefix)); if(is_null($this->refBackend)) { $this->refBackend = &$this->backends[$configPrefix]; @@ -45,29 +45,29 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { } /** - * @brief Tries the backends one after the other until a positive result is returned from the specified method - * @param $gid string, the gid connected to the request - * @param $method string, the method of the group backend that shall be called - * @param $parameters an array of parameters to be passed + * Tries the backends one after the other until a positive result is returned from the specified method + * @param string $gid the gid connected to the request + * @param string $method the method of the group backend that shall be called + * @param array $parameters an array of parameters to be passed * @return mixed, the result of the method or false */ protected function walkBackends($gid, $method, $parameters) { $cacheKey = $this->getGroupCacheKey($gid); foreach($this->backends as $configPrefix => $backend) { - if($result = call_user_func_array(array($backend, $method), $parameters)) { + if($result = call_user_func_array(array($backend, $method), $parameters)) { $this->writeToCache($cacheKey, $configPrefix); return $result; - } + } } return false; } /** - * @brief Asks the backend connected to the server that supposely takes care of the gid from the request. - * @param $gid string, the gid connected to the request - * @param $method string, the method of the group backend that shall be called - * @param $parameters an array of parameters to be passed - * @param $passOnWhen the result matches this variable + * Asks the backend connected to the server that supposely takes care of the gid from the request. + * @param string $gid the gid connected to the request + * @param string $method the method of the group backend that shall be called + * @param array $parameters an array of parameters to be passed + * @param mixed $passOnWhen the result matches this variable * @return mixed, the result of the method or false */ protected function callOnLastSeenOn($gid, $method, $parameters, $passOnWhen) { @@ -95,10 +95,10 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { } /** - * @brief is user in group? - * @param $uid uid of the user - * @param $gid gid of the group - * @returns true/false + * is user in group? + * @param string $uid uid of the user + * @param string $gid gid of the group + * @return bool * * Checks whether the user is member of a group or not. */ @@ -107,9 +107,9 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { } /** - * @brief Get all groups a user belongs to - * @param $uid Name of the user - * @returns array with group names + * Get all groups a user belongs to + * @param string $uid Name of the user + * @return string[] with group names * * This function fetches all groups a user belongs to. It does not check * if the user exists at all. @@ -118,7 +118,7 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { $groups = array(); foreach($this->backends as $backend) { - $backendGroups = $backend->getUserGroups($uid); + $backendGroups = $backend->getUserGroups($uid); if (is_array($backendGroups)) { $groups = array_merge($groups, $backendGroups); } @@ -128,14 +128,14 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { } /** - * @brief get a list of all users in a group - * @returns array with user ids + * get a list of all users in a group + * @return string[] with user ids */ public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) { $users = array(); foreach($this->backends as $backend) { - $backendUsers = $backend->usersInGroup($gid, $search, $limit, $offset); + $backendUsers = $backend->usersInGroup($gid, $search, $limit, $offset); if (is_array($backendUsers)) { $users = array_merge($users, $backendUsers); } @@ -145,10 +145,10 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { } /** - * @brief returns the number of users in a group, who match the search term - * @param string the internal group name - * @param string optional, a search string - * @returns int | bool + * returns the number of users in a group, who match the search term + * @param string $gid the internal group name + * @param string $search optional, a search string + * @return int|bool */ public function countUsersInGroup($gid, $search = '') { return $this->handleRequest( @@ -156,24 +156,8 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { } /** - * @brief get a list of all display names in a group - * @returns array with display names (value) and user ids(key) - */ - public function displayNamesInGroup($gid, $search, $limit, $offset) { - $displayNames = array(); - - foreach($this->backends as $backend) { - $backendUsers = $backend->displayNamesInGroup($gid, $search, $limit, $offset); - if (is_array($backendUsers)) { - $displayNames = array_merge($displayNames, $backendUsers); - } - } - return $displayNames; - } - - /** - * @brief get a list of all groups - * @returns array with group names + * get a list of all groups + * @return string[] with group names * * Returns a list with all groups */ @@ -181,7 +165,7 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { $groups = array(); foreach($this->backends as $backend) { - $backendGroups = $backend->getGroups($search, $limit, $offset); + $backendGroups = $backend->getGroups($search, $limit, $offset); if (is_array($backendGroups)) { $groups = array_merge($groups, $backendGroups); } @@ -200,9 +184,9 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { } /** - * @brief Check if backend implements actions - * @param $actions bitwise-or'ed actions - * @returns boolean + * Check if backend implements actions + * @param int $actions bitwise-or'ed actions + * @return boolean * * Returns the supported actions as int to be * compared with OC_USER_BACKEND_CREATE_USER etc. diff --git a/apps/user_ldap/l10n/ast.php b/apps/user_ldap/l10n/ast.php index 032de8aedbcd77be3b4572351c0fdfa5ee697a5e..f793847b2318c4d66002cd06a8082a05631abd2b 100644 --- a/apps/user_ldap/l10n/ast.php +++ b/apps/user_ldap/l10n/ast.php @@ -1,5 +1,8 @@ "Fallu al desaniciar la configuración del sevidor", +"The configuration is valid and the connection could be established!" => "¡La configuración ye válida y pudo afitase la conexón!", +"The configuration is valid, but the Bind failed. Please check the server settings and credentials." => "La configuración ye válida, pero falló'l vínculu. Por favor, comprueba la configuración y les credenciales nel servidor.", "The configuration is invalid. Please have a look at the logs for further details." => "La configuración nun ye válida. Por favor, écha-y un güeyu a los rexistros pa más detalles.", "No action specified" => "Nun s'especificó l'aición", "No configuration specified" => "Nun s'especificó la configuración", @@ -14,10 +17,13 @@ $TRANSLATIONS = array( "Configuration incomplete" => "Configuración incompleta", "Select groups" => "Esbillar grupos", "Select attributes" => "Esbillar atributos", +"Connection test succeeded" => "Test de conexón esitosu", +"Connection test failed" => "Falló'l test de conexón", "_%s group found_::_%s groups found_" => array("%s grupu alcontráu","%s grupos alcontraos"), "_%s user found_::_%s users found_" => array("%s usuariu alcontráu","%s usuarios alcontraos"), "Could not find the desired feature" => "Nun pudo alcontrase la carauterística deseyada", "Save" => "Guardar", +"Help" => "Ayuda", "groups found" => "grupos alcontraos", "Users login with this attribute:" => "Aniciu de sesión d'usuarios con esti atributu:", "LDAP Username:" => "Nome d'usuariu LDAP", diff --git a/apps/user_ldap/l10n/el.php b/apps/user_ldap/l10n/el.php index cfc5286a4084bbe498f91376d62aa2a0db1ba06b..b52e2a652d391d6ef3837b13047dff5b5ce3f7b4 100644 --- a/apps/user_ldap/l10n/el.php +++ b/apps/user_ldap/l10n/el.php @@ -70,6 +70,7 @@ $TRANSLATIONS = array( "Backup (Replica) Port" => "Δημιουργία αντιγράφων ασφαλείας (Replica) Υποδοχη", "Disable Main Server" => "Απενεργοποιηση του κεντρικου διακομιστη", "Only connect to the replica server." => "Σύνδεση μόνο με το διακομιστή-αντίγραφο.", +"Case insensitive 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." => "Δεν προτείνεται, χρησιμοποιείστε το μόνο για δοκιμές! Εάν η σύνδεση λειτουργεί μόνο με αυτή την επιλογή, εισάγετε το πιστοποιητικό SSL του διακομιστή LDAP στο %s διακομιστή σας.", "Cache Time-To-Live" => "Cache Time-To-Live", @@ -88,6 +89,8 @@ $TRANSLATIONS = array( "Group Search Attributes" => "Ομάδα Χαρακτηριστικων Αναζήτηση", "Group-Member association" => "Group-Member association", "Nested Groups" => "Φωλιασμένες ομάδες", +"Paging chunksize" => "Μέγεθος σελιδοποίησης", +"Chunksize used for paged LDAP searches that may return bulky results like user or group enumeration. (Setting it 0 disables paged LDAP searches in those situations.)" => "Μέγεθος τμήματος που χρησιμοποιείται για την σελιδοποίηση αναζητήσεων LDAP που μπορεί να επιστρέψουν πολλά δεδομένα, όπως απαρίθμηση χρηστών ή ομάδων. (Η τιμή 0 απενεργοποιεί την σελιδοποίηση των αναζητήσεων LDAP σε αυτές τις περιπτώσεις.)", "Special Attributes" => "Ειδικά Χαρακτηριστικά ", "Quota Field" => "Ποσοσταση πεδιου", "Quota Default" => "Προκαθισμενο πεδιο", diff --git a/apps/user_ldap/l10n/en_NZ.php b/apps/user_ldap/l10n/en_NZ.php new file mode 100644 index 0000000000000000000000000000000000000000..3a1e002311cd9c1851bda1b96f71bc4d3e3e047b --- /dev/null +++ b/apps/user_ldap/l10n/en_NZ.php @@ -0,0 +1,6 @@ + array("",""), +"_%s user found_::_%s users found_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/user_ldap/l10n/es_BO.php b/apps/user_ldap/l10n/es_BO.php new file mode 100644 index 0000000000000000000000000000000000000000..3a1e002311cd9c1851bda1b96f71bc4d3e3e047b --- /dev/null +++ b/apps/user_ldap/l10n/es_BO.php @@ -0,0 +1,6 @@ + array("",""), +"_%s user found_::_%s users found_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/user_ldap/l10n/es_CO.php b/apps/user_ldap/l10n/es_CO.php new file mode 100644 index 0000000000000000000000000000000000000000..3a1e002311cd9c1851bda1b96f71bc4d3e3e047b --- /dev/null +++ b/apps/user_ldap/l10n/es_CO.php @@ -0,0 +1,6 @@ + array("",""), +"_%s user found_::_%s users found_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/user_ldap/l10n/es_EC.php b/apps/user_ldap/l10n/es_EC.php new file mode 100644 index 0000000000000000000000000000000000000000..3a1e002311cd9c1851bda1b96f71bc4d3e3e047b --- /dev/null +++ b/apps/user_ldap/l10n/es_EC.php @@ -0,0 +1,6 @@ + array("",""), +"_%s user found_::_%s users found_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/user_ldap/l10n/es_PE.php b/apps/user_ldap/l10n/es_PE.php new file mode 100644 index 0000000000000000000000000000000000000000..3a1e002311cd9c1851bda1b96f71bc4d3e3e047b --- /dev/null +++ b/apps/user_ldap/l10n/es_PE.php @@ -0,0 +1,6 @@ + array("",""), +"_%s user found_::_%s users found_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/user_ldap/l10n/es_UY.php b/apps/user_ldap/l10n/es_UY.php new file mode 100644 index 0000000000000000000000000000000000000000..3a1e002311cd9c1851bda1b96f71bc4d3e3e047b --- /dev/null +++ b/apps/user_ldap/l10n/es_UY.php @@ -0,0 +1,6 @@ + array("",""), +"_%s user found_::_%s users found_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/user_ldap/l10n/fa.php b/apps/user_ldap/l10n/fa.php index 62a949f88bd58211b6e82b3a6146bf1b3eb3747a..daf3765fc061c62391edfc6563595320b5a23f5b 100644 --- a/apps/user_ldap/l10n/fa.php +++ b/apps/user_ldap/l10n/fa.php @@ -28,6 +28,7 @@ $TRANSLATIONS = array( "One Base DN per line" => "یک پایه DN در هر خط", "You can specify Base DN for users and groups in the Advanced tab" => "شما می توانید پایه DN را برای کاربران و گروه ها در زبانه Advanced مشخص کنید.", "Back" => "بازگشت", +"Continue" => "ادامه", "Connection Settings" => "تنظیمات اتصال", "Configuration Active" => "پیکربندی فعال", "When unchecked, this configuration will be skipped." => "زمانیکه انتخاب نشود، این پیکربندی نادیده گرفته خواهد شد.", diff --git a/apps/user_ldap/l10n/hi_IN.php b/apps/user_ldap/l10n/hi_IN.php new file mode 100644 index 0000000000000000000000000000000000000000..3a1e002311cd9c1851bda1b96f71bc4d3e3e047b --- /dev/null +++ b/apps/user_ldap/l10n/hi_IN.php @@ -0,0 +1,6 @@ + array("",""), +"_%s user found_::_%s users found_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/user_ldap/l10n/hu_HU.php b/apps/user_ldap/l10n/hu_HU.php index 34daa25ce6867f462c7f129c89c6465787b6609a..5e05eefd1d716e9991d2f6424bd1890e270f2009 100644 --- a/apps/user_ldap/l10n/hu_HU.php +++ b/apps/user_ldap/l10n/hu_HU.php @@ -84,6 +84,7 @@ $TRANSLATIONS = array( "One Group Base DN per line" => "Soronként egy csoportfa gyökerét adhatjuk meg", "Group Search Attributes" => "A csoportok lekérdezett attribútumai", "Group-Member association" => "A csoporttagság attribútuma", +"Nested Groups" => "Egymásba ágyazott csoportok", "Special Attributes" => "Különleges attribútumok", "Quota Field" => "Kvóta mező", "Quota Default" => "Alapértelmezett kvóta", diff --git a/apps/user_ldap/l10n/ja.php b/apps/user_ldap/l10n/ja.php index e7e4706c46a4d43e959f030f8ed02e08e9ba14d1..3b479350478f24c4cffdd36000dccb5b6410d7dd 100644 --- a/apps/user_ldap/l10n/ja.php +++ b/apps/user_ldap/l10n/ja.php @@ -70,6 +70,7 @@ $TRANSLATIONS = array( "Backup (Replica) Port" => "バックアップ(レプリカ)ポート", "Disable Main Server" => "メインサーバーを無効にする", "Only connect to the replica server." => "レプリカサーバーにのみ接続します。", +"Case insensitive 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." => "推奨されません、テストにおいてのみ使用してください!このオプションでのみ接続が動作する場合は、LDAP サーバーのSSL証明書を %s サーバーにインポートしてください。", "Cache Time-To-Live" => "キャッシュのTTL", @@ -89,6 +90,8 @@ $TRANSLATIONS = array( "Group-Member association" => "グループとメンバーの関連付け", "Nested Groups" => "ネスト化ブロック", "When switched on, groups that contain groups are supported. (Only works if the group member attribute contains DNs.)" => "オンに切り替えたら、グループを含むグループがサポートされます。(グループメンバーの属性がDNを含む場合のみ有効です。)", +"Paging chunksize" => "ページ分割サイズ", +"Chunksize used for paged LDAP searches that may return bulky results like user or group enumeration. (Setting it 0 disables paged LDAP searches in those situations.)" => "ページ分割サイズは、LDAP検索時にユーザーやグループのリスト一覧データを一括で返すデータ量を指定します。(設定が0の場合には、LDAP検索の分割転送は無効)", "Special Attributes" => "特殊属性", "Quota Field" => "クォータフィールド", "Quota Default" => "クォータのデフォルト", diff --git a/apps/user_ldap/l10n/km.php b/apps/user_ldap/l10n/km.php index ad3cc4882c12239e1393bf68d980c164c1e4f684..65691c1f5257b6346642443efc8476b19d5d51ec 100644 --- a/apps/user_ldap/l10n/km.php +++ b/apps/user_ldap/l10n/km.php @@ -15,6 +15,8 @@ $TRANSLATIONS = array( "Help" => "ជំនួយ", "Add Server Configuration" => "បន្ថែម​ការ​កំណត់​រចនាសម្ព័ន្ធ​ម៉ាស៊ីន​បម្រើ", "Host" => "ម៉ាស៊ីន​ផ្ទុក", -"Password" => "ពាក្យសម្ងាត់" +"Port" => "ច្រក", +"Password" => "ពាក្យសម្ងាត់", +"Continue" => "បន្ត" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/user_ldap/l10n/pt_PT.php b/apps/user_ldap/l10n/pt_PT.php index e2754785c650518c8ff240abedf77012e69e640e..21065b656791aeb03443036472d51e64d2f307d9 100644 --- a/apps/user_ldap/l10n/pt_PT.php +++ b/apps/user_ldap/l10n/pt_PT.php @@ -4,6 +4,7 @@ $TRANSLATIONS = array( "Failed to delete the server configuration" => "Erro ao eliminar a configuração do servidor", "The configuration is valid and the connection could be established!" => "A configuração está correcta e foi possível estabelecer a ligação!", "The configuration is valid, but the Bind failed. Please check the server settings and credentials." => "A configuração está correcta, mas não foi possível estabelecer o \"laço\", por favor, verifique as configurações do servidor e as credenciais.", +"The configuration is invalid. Please have a look at the logs for further details." => "A configuração é inválida. Por favor, veja o log do ownCloud para mais detalhes.", "No action specified" => "Nenhuma acção especificada", "No configuration specified" => "Nenhuma configuração especificada", "No data specified" => "Nenhuma data especificada", @@ -52,6 +53,7 @@ $TRANSLATIONS = array( "For anonymous access, leave DN and Password empty." => "Para acesso anónimo, deixe DN e a Palavra-passe vazios.", "One Base DN per line" => "Uma base DN por linho", "You can specify Base DN for users and groups in the Advanced tab" => "Pode especificar o ND Base para utilizadores e grupos no separador Avançado", +"Limit %s access to users meeting these criteria:" => "Limitar o acesso a %s de utilizadores com estes critérios:", "users found" => "utilizadores encontrados", "Back" => "Voltar", "Continue" => "Continuar", @@ -92,9 +94,11 @@ $TRANSLATIONS = array( "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 padrão o nome de utilizador interno vai ser criado através do atributo UUID. Desta forma é assegurado que o nome é único e os caracteres não necessitam de serem convertidos. O nome interno tem a restrição de que apenas estes caracteres são permitidos: [ a-zA-Z0-9_.@- ]. Outros caracteres são substituídos pela sua correspondência ASCII ou simplesmente omitidos. Mesmo assim, quando for detetado uma colisão irá ser acrescentado um número. O nome interno é usado para identificar o utilizador internamente. É também o nome utilizado para a pasta inicial no ownCloud. É também parte de URLs remotos, como por exemplo os serviços *DAV. Com esta definição, o comportamento padrão é pode ser sobreposto. Para obter o mesmo comportamento antes do ownCloud 5 introduza o atributo do nome no campo seguinte. Deixe vazio para obter o comportamento padrão. As alterações apenas serão feitas para utilizadores mapeados (adicionados) LDAP.", "Internal Username Attribute:" => "Atributo do nome de utilizador interno", "Override UUID detection" => "Passar a detecção do 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 defeito, o ownCloud detecta automaticamente o atributo UUID. Este atributo é usado para identificar inequivocamente grupos e utilizadores LDAP. Igualmente, o nome de utilizador interno é criado com base no UUID, se o contrário não for especificado. Pode sobrepor esta definição colocando um atributo à sua escolha. Tenha em atenção que esse atributo deve ser válido tanto para grupos como para utilizadores, e que é único. Deixe em branco para optar pelo comportamento por defeito. Estas alteração apenas terão efeito em novos utilizadores e grupos mapeados (adicionados).", "UUID Attribute for Users:" => "Atributo UUID para utilizadores:", "UUID Attribute for Groups:" => "Atributo UUID para grupos:", "Username-LDAP User Mapping" => "Mapeamento do utilizador 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." => "O ownCloud usa nomes de utilizadores para guardar e atribuir (meta) dados. Para identificar com precisão os utilizadores, cada utilizador de LDAP tem um nome de utilizador interno. Isto requer um mapeamento entre o utilizador LDAP e o utilizador ownCloud. Adicionalmente, o DN é colocado em cache para reduzir a interação com LDAP, porém não é usado para identificação. Se o DN muda, essas alterações serão vistas pelo ownCloud. O nome interno do ownCloud é usado em todo o lado, no ownCloud. Limpar os mapeamentos deixará vestígios em todo o lado. A limpeza dos mapeamentos não é sensível à configuração, pois afeta todas as configurações de LDAP! Nunca limpe os mapeamentos num ambiente de produção, apenas o faça numa fase de testes ou experimental.", "Clear Username-LDAP User Mapping" => "Limpar mapeamento do utilizador-LDAP", "Clear Groupname-LDAP Group Mapping" => "Limpar o mapeamento do nome de grupo LDAP" ); diff --git a/apps/user_ldap/l10n/ro.php b/apps/user_ldap/l10n/ro.php index 26394db0f85d320b08780ce8df5055770047a5f3..0a91abe29c614a29ee916574802ab8c3b2ba557d 100644 --- a/apps/user_ldap/l10n/ro.php +++ b/apps/user_ldap/l10n/ro.php @@ -1,12 +1,29 @@ "Configuraţia este valida şi s-a stabilit conectarea", +"No action specified" => "Nu este specificata nici o acţiune ", +"No configuration specified" => "Nu este specificata nici o configurare ", "Deletion failed" => "Ștergerea a eșuat", +"Keep settings?" => "Păstraţi setările ?", +"Cannot add server configuration" => "Nu se poate adăuga configuraţia serverului ", "Success" => "Succes", "Error" => "Eroare", +"Configuration OK" => "Configuraţie valida", +"Configuration incorrect" => "Configuraţie incorecta ", +"Configuration incomplete" => "Configuraţie incompleta ", +"Select groups" => "Selectaţi grupuri ", +"Select attributes" => "Selectaţi caracteristici", +"Connection test succeeded" => "Testul de conectare a reuşit ", +"Connection test failed" => "Testul de conectare a eşuat ", +"Do you really want to delete the current Server Configuration?" => "Sunteţi sigur ca vreţi sa ştergeţi configuraţia actuala a serverului ?", +"Confirm Deletion" => "Confirmaţi Ştergerea ", "_%s group found_::_%s groups found_" => array("","",""), "_%s user found_::_%s users found_" => array("","",""), "Save" => "Salvează", +"Test Configuration" => "Configurare test", "Help" => "Ajutor", +"Other Attributes:" => "Alte caracteristici :", +"Add Server Configuration" => "Adăugaţi Configuraţia Serverului", "Host" => "Gazdă", "You can omit the protocol, except you require SSL. Then start with ldaps://" => "Puteți omite protocolul, decât dacă folosiți SSL. Atunci se începe cu ldaps://", "Port" => "Portul", @@ -16,11 +33,16 @@ $TRANSLATIONS = array( "For anonymous access, leave DN and Password empty." => "Pentru acces anonim, lăsați DN și Parolă libere.", "One Base DN per line" => "Un Base DN pe linie", "You can specify Base DN for users and groups in the Advanced tab" => "Puteți să specificați DN de bază pentru utilizatori și grupuri în fila Avansat", +"users found" => "Utilizatori găsiţi ", "Back" => "Înapoi", "Continue" => "Continuă", "Warning: The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." => "Atenție Modulul PHP LDAP nu este instalat, infrastructura nu va funcționa. Contactează administratorul sistemului pentru al instala.", +"Connection Settings" => "Setările de conexiune", +"Configuration Active" => "Configuraţie activa ", +"Disable Main Server" => "Dezactivaţi serverul principal", "Turn off SSL certificate validation." => "Oprește validarea certificatelor SSL ", "in seconds. A change empties the cache." => "în secunde. O schimbare curăță memoria tampon.", +"Directory Settings" => "Setările directorului", "User Display Name Field" => "Câmpul cu numele vizibil al utilizatorului", "Base User Tree" => "Arborele de bază al Utilizatorilor", "One User Base DN per line" => "Un User Base DN pe linie", @@ -28,7 +50,9 @@ $TRANSLATIONS = array( "Base Group Tree" => "Arborele de bază al Grupurilor", "One Group Base DN per line" => "Un Group Base DN pe linie", "Group-Member association" => "Asocierea Grup-Membru", +"Special Attributes" => "Caracteristici speciale ", "in bytes" => "în octeți", -"Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." => "Lăsați gol pentru numele de utilizator (implicit). În caz contrar, specificați un atribut LDAP / AD." +"Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." => "Lăsați gol pentru numele de utilizator (implicit). În caz contrar, specificați un atribut LDAP / AD.", +"Internal Username" => "Nume utilizator intern" ); $PLURAL_FORMS = "nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));"; diff --git a/apps/user_ldap/l10n/ru.php b/apps/user_ldap/l10n/ru.php index e719f01c370789067d16e8bc09ec5c5c8df92d37..cb94d0e16a5dd85dfd23aca8e0f8e47a27d4c8db 100644 --- a/apps/user_ldap/l10n/ru.php +++ b/apps/user_ldap/l10n/ru.php @@ -33,12 +33,14 @@ $TRANSLATIONS = array( "Save" => "Сохранить", "Test Configuration" => "Проверить конфигурацию", "Help" => "Помощь", +"Groups meeting these criteria are available in %s:" => "Группы, отвечающие этим критериям доступны в %s:", "only those object classes:" => "только эти объектные классы", "only from those groups:" => "только из этих групп", "Edit raw filter instead" => "Редактировать исходный фильтр", "Raw LDAP filter" => "Исходный LDAP фильтр", "The filter specifies which LDAP groups shall have access to the %s instance." => "Этот фильтр определяет, какие LDAP группы должны иметь доступ к %s.", "groups found" => "групп найдено", +"Users login with this attribute:" => "Пользователи пользуются этим атрибутом для входа:", "LDAP Username:" => "Имя пользователя LDAP", "LDAP Email Address:" => "LDAP адрес электронной почты:", "Other Attributes:" => "Другие атрибуты:", @@ -86,6 +88,10 @@ $TRANSLATIONS = array( "One Group Base DN per line" => "По одной базовому DN групп в строке.", "Group Search Attributes" => "Атрибуты поиска для группы", "Group-Member association" => "Ассоциация Группа-Участник", +"Nested Groups" => "Вложенные группы", +"When switched on, groups that contain groups are supported. (Only works if the group member attribute contains DNs.)" => "При включении, активируется поддержка групп, содержащих другие группы. (Работает только если атрибут член группы содержит DN.)", +"Paging chunksize" => "Постраничный chunksize", +"Chunksize used for paged LDAP searches that may return bulky results like user or group enumeration. (Setting it 0 disables paged LDAP searches in those situations.)" => "ChunkSize используется в страничных поисках LDAP которые могут возвращать громоздкие результаты, как например списки пользователей или групп. (Настройка его в \"0\" отключает страничный поиск LDAP для таких ситуаций.)", "Special Attributes" => "Специальные атрибуты", "Quota Field" => "Поле квоты", "Quota Default" => "Квота по умолчанию", diff --git a/apps/user_ldap/l10n/sk_SK.php b/apps/user_ldap/l10n/sk_SK.php index 3c6b51824f4511437218da9fb7443e69f3c414a5..fdcb4ea81b144f56ade71709efc0741c433ae4e3 100644 --- a/apps/user_ldap/l10n/sk_SK.php +++ b/apps/user_ldap/l10n/sk_SK.php @@ -89,6 +89,7 @@ $TRANSLATIONS = array( "Group Search Attributes" => "Atribúty vyhľadávania skupín", "Group-Member association" => "Priradenie člena skupiny", "Nested Groups" => "Vnorené skupiny", +"When switched on, groups that contain groups are supported. (Only works if the group member attribute contains DNs.)" => "Ak je zapnuté, tak je možné používať skupiny, ktoré obsahujú iné skupiny. (Funguje, len ak atribút člena skupiny obsahuje DN.)", "Special Attributes" => "Špeciálne atribúty", "Quota Field" => "Pole kvóty", "Quota Default" => "Predvolená kvóta", diff --git a/apps/user_ldap/l10n/ta_IN.php b/apps/user_ldap/l10n/ta_IN.php new file mode 100644 index 0000000000000000000000000000000000000000..3a1e002311cd9c1851bda1b96f71bc4d3e3e047b --- /dev/null +++ b/apps/user_ldap/l10n/ta_IN.php @@ -0,0 +1,6 @@ + array("",""), +"_%s user found_::_%s users found_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/user_ldap/l10n/ur_PK.php b/apps/user_ldap/l10n/ur_PK.php index 9fbd174bd1f7d2b540cc83dfe1c6a0ea8c77d7be..0f7c45fe62d79c86b22666b965ed991bff50ecee 100644 --- a/apps/user_ldap/l10n/ur_PK.php +++ b/apps/user_ldap/l10n/ur_PK.php @@ -3,7 +3,9 @@ $TRANSLATIONS = array( "Error" => "ایرر", "_%s group found_::_%s groups found_" => array("",""), "_%s user found_::_%s users found_" => array("",""), +"Save" => "حفظ", "Help" => "مدد", -"Password" => "پاسورڈ" +"Password" => "پاسورڈ", +"Continue" => "جاری" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php index 712407505fb9bcac85e102e118ca22493c484ff7..78de14f4ee9848c133d5ee610e5de2d6e444b70f 100644 --- a/apps/user_ldap/lib/access.php +++ b/apps/user_ldap/lib/access.php @@ -23,6 +23,10 @@ namespace OCA\user_ldap\lib; +/** + * Class Access + * @package OCA\user_ldap\lib + */ class Access extends LDAPUtility { public $connection; //never ever check this var directly, always use getPagedSearchResultState @@ -30,24 +34,30 @@ class Access extends LDAPUtility { protected $cookies = array(); + /** + * @param Connection $connection + * @param ILDAPWrapper $ldap + */ public function __construct(Connection $connection, ILDAPWrapper $ldap) { parent::__construct($ldap); $this->connection = $connection; } + /** + * @return bool + */ private function checkConnection() { return ($this->connection instanceof Connection); } /** - * @brief reads a given attribute for an LDAP record identified by a DN - * @param $dn the record in question - * @param $attr the attribute that shall be retrieved + * reads a given attribute for an LDAP record identified by a DN + * @param string $dn the record in question + * @param string $attr the attribute that shall be retrieved * if empty, just check the record's existence - * @returns an array of values on success or an empty + * @param string $filter + * @return array|false an array of values on success or an empty * array if $attr is empty, false otherwise - * - * Reads an attribute from an LDAP entry or check if entry exists */ public function readAttribute($dn, $attr, $filter = 'objectClass=*') { if(!$this->checkConnection()) { @@ -105,7 +115,7 @@ class Access extends LDAPUtility { } /** - * @brief checks wether the given attribute`s valua is probably a DN + * checks whether the given attributes value is probably a DN * @param string $attr the attribute in question * @return boolean if so true, otherwise false */ @@ -119,16 +129,16 @@ class Access extends LDAPUtility { } /** - * @brief sanitizes a DN received from the LDAP server - * @param $dn the DN in question - * @return the sanitized DN + * sanitizes a DN received from the LDAP server + * @param array $dn the DN in question + * @return array the sanitized DN */ private function sanitizeDN($dn) { //treating multiple base DNs if(is_array($dn)) { $result = array(); foreach($dn as $singleDN) { - $result[] = $this->sanitizeDN($singleDN); + $result[] = $this->sanitizeDN($singleDN); } return $result; } @@ -163,7 +173,8 @@ class Access extends LDAPUtility { /** * gives back the database table for the query - * @param boolean $isUser + * @param bool $isUser + * @return string */ private function getMapTable($isUser) { if($isUser) { @@ -174,11 +185,9 @@ class Access extends LDAPUtility { } /** - * @brief returns the LDAP DN for the given internal ownCloud name of the group - * @param string $name the ownCloud name in question - * @returns string with the LDAP DN on success, otherwise false - * * returns the LDAP DN for the given internal ownCloud name of the group + * @param string $name the ownCloud name in question + * @return string with the LDAP DN on success, otherwise false */ public function groupname2dn($name) { $dn = $this->ocname2dn($name, false); @@ -191,11 +200,9 @@ class Access extends LDAPUtility { } /** - * @brief returns the LDAP DN for the given internal ownCloud name of the user - * @param $name the ownCloud name in question - * @returns string with the LDAP DN on success, otherwise false - * * returns the LDAP DN for the given internal ownCloud name of the user + * @param string $name the ownCloud name in question + * @return string with the LDAP DN on success, otherwise false */ public function username2dn($name) { $dn = $this->ocname2dn($name, true); @@ -209,12 +216,10 @@ class Access extends LDAPUtility { } /** - * @brief returns the LDAP DN for the given internal ownCloud name - * @param $name the ownCloud name in question - * @param boolean $isUser is it a user? otherwise group - * @returns string with the LDAP DN on success, otherwise false - * * returns the LDAP DN for the given internal ownCloud name + * @param string $name the ownCloud name in question + * @param boolean $isUser is it a user? otherwise group + * @return string with the LDAP DN on success, otherwise false */ private function ocname2dn($name, $isUser) { $table = $this->getMapTable($isUser); @@ -230,15 +235,12 @@ class Access extends LDAPUtility { } /** - * @brief returns the internal ownCloud name for the given LDAP DN of the group - * @param $dn the dn of the group object - * @param $ldapname optional, the display name of the object - * @returns string with with the name to use in ownCloud, false on DN outside of search DN - * - * returns the internal ownCloud name for the given LDAP DN of the - * group, false on DN outside of search DN or failure + * returns the internal ownCloud name for the given LDAP DN of the group, false on DN outside of search DN or failure + * @param string $dn the dn of the group object + * @param string $ldapName optional, the display name of the object + * @return string with the name to use in ownCloud, false on DN outside of search DN */ - public function dn2groupname($dn, $ldapname = null) { + public function dn2groupname($dn, $ldapName = null) { //To avoid bypassing the base DN settings under certain circumstances //with the group support, check whether the provided DN matches one of //the given Bases @@ -246,18 +248,16 @@ class Access extends LDAPUtility { return false; } - return $this->dn2ocname($dn, $ldapname, false); + return $this->dn2ocname($dn, $ldapName, false); } /** - * @brief returns the internal ownCloud name for the given LDAP DN of the user - * @param $dn the dn of the user object - * @param $ldapname optional, the display name of the object - * @returns string with with the name to use in ownCloud - * * returns the internal ownCloud name for the given LDAP DN of the user, false on DN outside of search DN or failure + * @param string $dn the dn of the user object + * @param string $ldapName optional, the display name of the object + * @return string with with the name to use in ownCloud */ - public function dn2username($dn, $ldapname = null) { + public function dn2username($dn, $ldapName = null) { //To avoid bypassing the base DN settings under certain circumstances //with the group support, check whether the provided DN matches one of //the given Bases @@ -265,19 +265,17 @@ class Access extends LDAPUtility { return false; } - return $this->dn2ocname($dn, $ldapname, true); + return $this->dn2ocname($dn, $ldapName, true); } /** - * @brief returns an internal ownCloud name for the given LDAP DN - * @param $dn the dn of the user object - * @param $ldapname optional, the display name of the object - * @param $isUser optional, wether it is a user object (otherwise group assumed) - * @returns string with with the name to use in ownCloud - * - * returns the internal ownCloud name for the given LDAP DN of the user, false on DN outside of search DN + * returns an internal ownCloud name for the given LDAP DN, false on DN outside of search DN + * @param string $dn the dn of the user object + * @param string $ldapName optional, the display name of the object + * @param bool $isUser optional, whether it is a user object (otherwise group assumed) + * @return string with with the name to use in ownCloud */ - public function dn2ocname($dn, $ldapname = null, $isUser = true) { + public function dn2ocname($dn, $ldapName = null, $isUser = true) { $table = $this->getMapTable($isUser); if($isUser) { $fncFindMappedName = 'findMappedUser'; @@ -288,9 +286,9 @@ class Access extends LDAPUtility { } //let's try to retrieve the ownCloud name from the mappings table - $ocname = $this->$fncFindMappedName($dn); - if($ocname) { - return $ocname; + $ocName = $this->$fncFindMappedName($dn); + if($ocName) { + return $ocName; } //second try: get the UUID and check if it is known. Then, update the DN and return the name. @@ -317,13 +315,13 @@ class Access extends LDAPUtility { return false; } - if(is_null($ldapname)) { - $ldapname = $this->readAttribute($dn, $nameAttribute); - if(!isset($ldapname[0]) && empty($ldapname[0])) { + if(is_null($ldapName)) { + $ldapName = $this->readAttribute($dn, $nameAttribute); + if(!isset($ldapName[0]) && empty($ldapName[0])) { \OCP\Util::writeLog('user_ldap', 'No or empty name for '.$dn.'.', \OCP\Util::INFO); return false; } - $ldapname = $ldapname[0]; + $ldapName = $ldapName[0]; } if($isUser) { @@ -334,27 +332,27 @@ class Access extends LDAPUtility { } else { $username = $uuid; } - $intname = $this->sanitizeUsername($username); + $intName = $this->sanitizeUsername($username); } else { - $intname = $ldapname; + $intName = $ldapName; } //a new user/group! Add it only if it doesn't conflict with other backend's users or existing groups //disabling Cache is required to avoid that the new user is cached as not-existing in fooExists check $originalTTL = $this->connection->ldapCacheTTL; $this->connection->setConfiguration(array('ldapCacheTTL' => 0)); - if(($isUser && !\OCP\User::userExists($intname)) - || (!$isUser && !\OC_Group::groupExists($intname))) { - if($this->mapComponent($dn, $intname, $isUser)) { + if(($isUser && !\OCP\User::userExists($intName)) + || (!$isUser && !\OC_Group::groupExists($intName))) { + if($this->mapComponent($dn, $intName, $isUser)) { $this->connection->setConfiguration(array('ldapCacheTTL' => $originalTTL)); - return $intname; + return $intName; } } $this->connection->setConfiguration(array('ldapCacheTTL' => $originalTTL)); - $altname = $this->createAltInternalOwnCloudName($intname, $isUser); - if($this->mapComponent($dn, $altname, $isUser)) { - return $altname; + $altName = $this->createAltInternalOwnCloudName($intName, $isUser); + if($this->mapComponent($dn, $altName, $isUser)) { + return $altName; } //if everything else did not help.. @@ -363,9 +361,9 @@ class Access extends LDAPUtility { } /** - * @brief gives back the user names as they are used ownClod internally - * @param $ldapGroups an array with the ldap Users result in style of array ( array ('dn' => foo, 'uid' => bar), ... ) - * @returns an array with the user names to use in ownCloud + * gives back the user names as they are used ownClod internally + * @param array $ldapUsers an array with the ldap Users result in style of array ( array ('dn' => foo, 'uid' => bar), ... ) + * @return array an array with the user names to use in ownCloud * * gives back the user names as they are used ownClod internally */ @@ -374,9 +372,9 @@ class Access extends LDAPUtility { } /** - * @brief gives back the group names as they are used ownClod internally - * @param $ldapGroups an array with the ldap Groups result in style of array ( array ('dn' => foo, 'cn' => bar), ... ) - * @returns an array with the group names to use in ownCloud + * gives back the group names as they are used ownClod internally + * @param array $ldapGroups an array with the ldap Groups result in style of array ( array ('dn' => foo, 'cn' => bar), ... ) + * @return array an array with the group names to use in ownCloud * * gives back the group names as they are used ownClod internally */ @@ -384,6 +382,10 @@ class Access extends LDAPUtility { return $this->ldap2ownCloudNames($ldapGroups, false); } + /** + * @param string $dn + * @return bool|string + */ private function findMappedUser($dn) { static $query = null; if(is_null($query)) { @@ -400,6 +402,10 @@ class Access extends LDAPUtility { return false; } + /** + * @param string $dn + * @return bool|string + */ private function findMappedGroup($dn) { static $query = null; if(is_null($query)) { @@ -416,9 +422,10 @@ class Access extends LDAPUtility { return false; } - /** - * @param boolean $isUsers + * @param array $ldapObjects + * @param bool $isUsers + * @return array */ private function ldap2ownCloudNames($ldapObjects, $isUsers) { if($isUsers) { @@ -430,13 +437,13 @@ class Access extends LDAPUtility { foreach($ldapObjects as $ldapObject) { $nameByLDAP = isset($ldapObject[$nameAttribute]) ? $ldapObject[$nameAttribute] : null; - $ocname = $this->dn2ocname($ldapObject['dn'], $nameByLDAP, $isUsers); - if($ocname) { - $ownCloudNames[] = $ocname; + $ocName = $this->dn2ocname($ldapObject['dn'], $nameByLDAP, $isUsers); + if($ocName) { + $ownCloudNames[] = $ocName; if($isUsers) { //cache the user names so it does not need to be retrieved //again later (e.g. sharing dialogue). - $this->cacheUserDisplayName($ocname, $nameByLDAP); + $this->cacheUserDisplayName($ocName, $nameByLDAP); } } continue; @@ -445,19 +452,19 @@ class Access extends LDAPUtility { } /** - * @brief caches the user display name - * @param string the internal owncloud username - * @param string the display name + * caches the user display name + * @param string $ocName the internal ownCloud username + * @param string $displayName the display name */ - public function cacheUserDisplayName($ocname, $displayName) { + public function cacheUserDisplayName($ocName, $displayName) { $cacheKeyTrunk = 'getDisplayName'; - $this->connection->writeToCache($cacheKeyTrunk.$ocname, $displayName); + $this->connection->writeToCache($cacheKeyTrunk.$ocName, $displayName); } /** - * @brief creates a unique name for internal ownCloud use for users. Don't call it directly. - * @param $name the display name of the object - * @returns string with with the name to use in ownCloud or false if unsuccessful + * creates a unique name for internal ownCloud use for users. Don't call it directly. + * @param string $name the display name of the object + * @return string with with the name to use in ownCloud or false if unsuccessful * * Instead of using this method directly, call * createAltInternalOwnCloudName($name, true) @@ -477,9 +484,9 @@ class Access extends LDAPUtility { } /** - * @brief creates a unique name for internal ownCloud use for groups. Don't call it directly. - * @param $name the display name of the object - * @returns string with with the name to use in ownCloud or false if unsuccessful. + * creates a unique name for internal ownCloud use for groups. Don't call it directly. + * @param string $name the display name of the object + * @return string with with the name to use in ownCloud or false if unsuccessful. * * Instead of using this method directly, call * createAltInternalOwnCloudName($name, false) @@ -504,17 +511,17 @@ class Access extends LDAPUtility { $lastNo = 1; //will become name_2 } else { natsort($usedNames); - $lastname = array_pop($usedNames); - $lastNo = intval(substr($lastname, strrpos($lastname, '_') + 1)); + $lastName = array_pop($usedNames); + $lastNo = intval(substr($lastName, strrpos($lastName, '_') + 1)); } $altName = $name.'_'.strval($lastNo+1); unset($usedNames); $attempts = 1; while($attempts < 21){ - //Pro forma check to be really sure it is unique - //while loop is just a precaution. If a name is not generated within - //20 attempts, something else is very wrong. Avoids infinite loop. + // Check to be really sure it is unique + // while loop is just a precaution. If a name is not generated within + // 20 attempts, something else is very wrong. Avoids infinite loop. if(!\OC_Group::groupExists($altName)) { return $altName; } @@ -525,10 +532,10 @@ class Access extends LDAPUtility { } /** - * @brief creates a unique name for internal ownCloud use. - * @param $name the display name of the object + * creates a unique name for internal ownCloud use. + * @param string $name the display name of the object * @param boolean $isUser whether name should be created for a user (true) or a group (false) - * @returns string with with the name to use in ownCloud or false if unsuccessful + * @return string with with the name to use in ownCloud or false if unsuccessful */ private function createAltInternalOwnCloudName($name, $isUser) { $originalTTL = $this->connection->ldapCacheTTL; @@ -544,8 +551,8 @@ class Access extends LDAPUtility { } /** - * @brief retrieves all known groups from the mappings table - * @returns array with the results + * retrieves all known groups from the mappings table + * @return array with the results * * retrieves all known groups from the mappings table */ @@ -554,8 +561,8 @@ class Access extends LDAPUtility { } /** - * @brief retrieves all known users from the mappings table - * @returns array with the results + * retrieves all known users from the mappings table + * @return array with the results * * retrieves all known users from the mappings table */ @@ -578,20 +585,20 @@ class Access extends LDAPUtility { } /** - * @brief inserts a new user or group into the mappings table - * @param $dn the record in question - * @param $ocname the name to use in ownCloud - * @param $isUser is it a user or a group? - * @returns true on success, false otherwise + * inserts a new user or group into the mappings table + * @param string $dn the record in question + * @param string $ocName the name to use in ownCloud + * @param bool $isUser is it a user or a group? + * @return bool true on success, false otherwise * * inserts a new user or group into the mappings table */ - private function mapComponent($dn, $ocname, $isUser = true) { + private function mapComponent($dn, $ocName, $isUser = true) { $table = $this->getMapTable($isUser); $sqlAdjustment = ''; - $dbtype = \OCP\Config::getSystemValue('dbtype'); - if($dbtype === 'mysql') { + $dbType = \OCP\Config::getSystemValue('dbtype'); + if($dbType === 'mysql') { $sqlAdjustment = 'FROM DUAL'; } @@ -607,9 +614,9 @@ class Access extends LDAPUtility { '); //feed the DB - $insRows = $insert->execute(array($dn, $ocname, + $insRows = $insert->execute(array($dn, $ocName, $this->getUUID($dn, $isUser), $dn, - $ocname)); + $ocName)); if(\OCP\DB::isError($insRows)) { return false; @@ -623,8 +630,11 @@ class Access extends LDAPUtility { } /** - * @param integer $limit - * @param integer $offset + * @param string $filter + * @param string|string[] $attr + * @param int $limit + * @param int $offset + * @return array */ public function fetchListOfUsers($filter, $attr, $limit = null, $offset = null) { return $this->fetchList($this->searchUsers($filter, $attr, $limit, $offset), (count($attr) > 1)); @@ -632,15 +642,19 @@ class Access extends LDAPUtility { /** * @param string $filter - * @param integer $limit - * @param integer $offset + * @param string|string[] $attr + * @param int $limit + * @param int $offset + * @return array */ public function fetchListOfGroups($filter, $attr, $limit = null, $offset = null) { return $this->fetchList($this->searchGroups($filter, $attr, $limit, $offset), (count($attr) > 1)); } /** - * @param boolean $manyAttributes + * @param array $list + * @param bool $manyAttributes + * @return array */ private function fetchList($list, $manyAttributes) { if(is_array($list)) { @@ -656,12 +670,12 @@ class Access extends LDAPUtility { } /** - * @brief executes an LDAP search, optimized for Users - * @param $filter the LDAP filter for the search - * @param $attr optional, when a certain attribute shall be filtered out + * executes an LDAP search, optimized for Users + * @param string $filter the LDAP filter for the search + * @param string|string[] $attr optional, when a certain attribute shall be filtered out * @param integer $limit * @param integer $offset - * @returns array with the search result + * @return array with the search result * * Executes an LDAP search */ @@ -671,18 +685,22 @@ class Access extends LDAPUtility { /** * @param string $filter + * @param string|string[] $attr + * @param int $limit + * @param int $offset + * @return false|int */ public function countUsers($filter, $attr = array('dn'), $limit = null, $offset = null) { return $this->count($filter, $this->connection->ldapBaseUsers, $attr, $limit, $offset); } /** - * @brief executes an LDAP search, optimized for Groups + * executes an LDAP search, optimized for Groups * @param string $filter the LDAP filter for the search - * @param $attr optional, when a certain attribute shall be filtered out + * @param string|string[] $attr optional, when a certain attribute shall be filtered out * @param integer $limit * @param integer $offset - * @returns array with the search result + * @return array with the search result * * Executes an LDAP search */ @@ -691,14 +709,14 @@ class Access extends LDAPUtility { } /** - * @brief prepares and executes an LDAP search operation - * @param $filter the LDAP filter for the search - * @param $base an array containing the LDAP subtree(s) that shall be searched - * @param $attr optional, array, one or more attributes that shall be + * prepares and executes an LDAP search operation + * @param string $filter the LDAP filter for the search + * @param array $base an array containing the LDAP subtree(s) that shall be searched + * @param string|string[] $attr optional, array, one or more attributes that shall be * retrieved. Results will according to the order in the array. - * @param $limit optional, maximum results to be counted - * @param $offset optional, a starting point - * @returns array with the search result as first value and pagedSearchOK as + * @param int $limit optional, maximum results to be counted + * @param int $offset optional, a starting point + * @return array|false array with the search result as first value and pagedSearchOK as * second | false if not successful */ private function executeSearch($filter, $base, &$attr = null, $limit = null, $offset = null) { @@ -715,7 +733,7 @@ class Access extends LDAPUtility { return false; } - //check wether paged search should be attempted + //check whether paged search should be attempted $pagedSearchOK = $this->initPagedSearch($filter, $base, $attr, $limit, $offset); $linkResources = array_pad(array(), count($base), $cr); @@ -737,17 +755,17 @@ class Access extends LDAPUtility { } /** - * @brief processes an LDAP paged search operation - * @param $sr the array containing the LDAP search resources - * @param $filter the LDAP filter for the search - * @param $base an array containing the LDAP subtree(s) that shall be searched - * @param $iFoundItems number of results in the search operation - * @param $limit maximum results to be counted - * @param $offset a starting point - * @param $pagedSearchOK whether a paged search has been executed - * @param boolean $skipHandling required for paged search when cookies to + * processes an LDAP paged search operation + * @param array $sr the array containing the LDAP search resources + * @param string $filter the LDAP filter for the search + * @param array $base an array containing the LDAP subtree(s) that shall be searched + * @param int $iFoundItems number of results in the search operation + * @param int $limit maximum results to be counted + * @param int $offset a starting point + * @param bool $pagedSearchOK whether a paged search has been executed + * @param bool $skipHandling required for paged search when cookies to * prior results need to be gained - * @returns array with the search result as first value and pagedSearchOK as + * @return array|false array with the search result as first value and pagedSearchOK as * second | false if not successful */ private function processPagedSearchStatus($sr, $filter, $base, $iFoundItems, $limit, $offset, $pagedSearchOK, $skipHandling) { @@ -778,16 +796,16 @@ class Access extends LDAPUtility { } /** - * @brief executes an LDAP search, but counts the results only + * executes an LDAP search, but counts the results only * @param string $filter the LDAP filter for the search - * @param $base an array containing the LDAP subtree(s) that shall be searched - * @param $attr optional, array, one or more attributes that shall be + * @param array $base an array containing the LDAP subtree(s) that shall be searched + * @param string|string[] $attr optional, array, one or more attributes that shall be * retrieved. Results will according to the order in the array. - * @param $limit optional, maximum results to be counted - * @param $offset optional, a starting point - * @param $skipHandling indicates whether the pages search operation is + * @param int $limit optional, maximum results to be counted + * @param int $offset optional, a starting point + * @param bool $skipHandling indicates whether the pages search operation is * completed - * @returns int | false if the search could not be initialized + * @return int|false Integer or false if the search could not be initialized * */ private function count($filter, $base, $attr = null, $limit = null, $offset = null, $skipHandling = false) { @@ -799,7 +817,7 @@ class Access extends LDAPUtility { $counter = 0; $count = null; - $cr = $this->connection->getConnectionResource(); + $this->connection->getConnectionResource(); do { $continue = false; @@ -821,10 +839,15 @@ class Access extends LDAPUtility { return $counter; } - private function countEntriesInSearchResults($searchResults, $limit, - &$hasHitLimit) { + /** + * @param array $searchResults + * @param int $limit + * @param bool $hasHitLimit + * @return int + */ + private function countEntriesInSearchResults($searchResults, $limit, &$hasHitLimit) { $cr = $this->connection->getConnectionResource(); - $count = 0; + $counter = 0; foreach($searchResults as $res) { $count = intval($this->ldap->countEntries($cr, $res)); @@ -838,14 +861,14 @@ class Access extends LDAPUtility { } /** - * @brief executes an LDAP search - * @param $filter the LDAP filter for the search - * @param $base an array containing the LDAP subtree(s) that shall be searched - * @param $attr optional, array, one or more attributes that shall be - * retrieved. Results will according to the order in the array. - * @returns array with the search result - * * Executes an LDAP search + * @param string $filter the LDAP filter for the search + * @param array $base an array containing the LDAP subtree(s) that shall be searched + * @param string|string[] $attr optional, array, one or more attributes that shall be + * @param int $limit + * @param int $offset + * @param bool $skipHandling + * @return array with the search result */ private function search($filter, $base, $attr = null, $limit = null, $offset = null, $skipHandling = false) { $search = $this->executeSearch($filter, $base, $attr, $limit, $offset); @@ -873,8 +896,8 @@ class Access extends LDAPUtility { } $findings = array(); - foreach($sr as $key => $res) { - $findings = array_merge($findings, $this->ldap->getEntries($cr , $res )); + foreach($sr as $res) { + $findings = array_merge($findings, $this->ldap->getEntries($cr , $res )); } $this->processPagedSearchStatus($sr, $filter, $base, $findings['count'], @@ -889,9 +912,9 @@ class Access extends LDAPUtility { if(!is_null($attr)) { $selection = array(); - $multiarray = false; + $multiArray = false; if(count($attr) > 1) { - $multiarray = true; + $multiArray = true; $i = 0; } foreach($findings as $item) { @@ -900,7 +923,7 @@ class Access extends LDAPUtility { } $item = \OCP\Util::mb_array_change_key_case($item, MB_CASE_LOWER, 'UTF-8'); - if($multiarray) { + if($multiArray) { foreach($attr as $key) { $key = mb_strtolower($key, 'UTF-8'); if(isset($item[$key])) { @@ -931,7 +954,7 @@ class Access extends LDAPUtility { $findings = $selection; } //we slice the findings, when - //a) paged search insuccessful, though attempted + //a) paged search unsuccessful, though attempted //b) no paged search, but limit set if((!$this->getPagedSearchResultState() && $pagedSearchOK) @@ -945,28 +968,32 @@ class Access extends LDAPUtility { return $findings; } + /** + * @param string $name + * @return bool|mixed|string + */ public function sanitizeUsername($name) { if($this->connection->ldapIgnoreNamingRules) { return $name; } - // Translitaration - //latin characters to ASCII + // Transliteration + // latin characters to ASCII $name = iconv('UTF-8', 'ASCII//TRANSLIT', $name); - //REPLACEMENTS + // Replacements $name = \OCP\Util::mb_str_replace(' ', '_', $name, 'UTF-8'); - //every remaining unallowed characters will be removed + // Every remaining disallowed characters will be removed $name = preg_replace('/[^a-zA-Z0-9_.@-]/u', '', $name); return $name; } /** - * @brief escapes (user provided) parts for LDAP filter + * escapes (user provided) parts for LDAP filter * @param string $input, the provided value - * @return the escaped string + * @return string the escaped string */ public function escapeFilterPart($input) { $search = array('*', '\\', '(', ')'); @@ -975,49 +1002,43 @@ class Access extends LDAPUtility { } /** - * @brief combines the input filters with AND - * @param $filters array, the filters to connect - * @returns the combined filter - * - * Combines Filter arguments with AND + * combines the input filters with AND + * @param string[] $filters the filters to connect + * @return string the combined filter */ public function combineFilterWithAnd($filters) { return $this->combineFilter($filters, '&'); } /** - * @brief combines the input filters with AND - * @param $filters array, the filters to connect - * @returns the combined filter - * - * Combines Filter arguments with AND + * combines the input filters with AND + * @param string[] $filters the filters to connect + * @return string the combined filter */ public function combineFilterWithOr($filters) { return $this->combineFilter($filters, '|'); } /** - * @brief combines the input filters with given operator - * @param $filters array, the filters to connect + * combines the input filters with given operator + * @param string[] $filters the filters to connect * @param string $operator either & or | - * @returns the combined filter - * - * Combines Filter arguments with AND + * @return string the combined filter */ private function combineFilter($filters, $operator) { $combinedFilter = '('.$operator; foreach($filters as $filter) { - if(!empty($filter) && $filter[0] !== '(') { + if(!empty($filter) && $filter[0] !== '(') { $filter = '('.$filter.')'; - } - $combinedFilter.=$filter; + } + $combinedFilter.=$filter; } $combinedFilter.=')'; return $combinedFilter; } /** - * @brief creates a filter part for to perfrom search for users + * creates a filter part for to perform search for users * @param string $search the search term * @return string the final filter part to use in LDAP searches */ @@ -1028,7 +1049,7 @@ class Access extends LDAPUtility { } /** - * @brief creates a filter part for to perfrom search for groups + * creates a filter part for to perform search for groups * @param string $search the search term * @return string the final filter part to use in LDAP searches */ @@ -1039,11 +1060,12 @@ class Access extends LDAPUtility { } /** - * @brief creates a filter part for searches + * creates a filter part for searches * @param string $search the search term + * @param string[]|null $searchAttributes * @param string $fallbackAttribute a fallback attribute in case the user * did not define search attributes. Typically the display name attribute. - * @returns string the final filter part to use in LDAP searches + * @return string the final filter part to use in LDAP searches */ private function getFilterPartForSearch($search, $searchAttributes, $fallbackAttribute) { $filter = array(); @@ -1065,7 +1087,9 @@ class Access extends LDAPUtility { } /** + * @param string $name * @param string $password + * @return bool */ public function areCredentialsValid($name, $password) { $name = $this->DNasBaseParameter($name); @@ -1083,10 +1107,11 @@ class Access extends LDAPUtility { } /** - * @brief auto-detects the directory's UUID attribute - * @param $dn a known DN used to check against - * @param $force the detection should be run, even if it is not set to auto - * @returns true on success, false otherwise + * auto-detects the directory's UUID attribute + * @param string $dn a known DN used to check against + * @param bool $isUser + * @param bool $force the detection should be run, even if it is not set to auto + * @return bool true on success, false otherwise */ private function detectUuidAttribute($dn, $isUser = true, $force = false) { if($isUser) { @@ -1106,7 +1131,7 @@ class Access extends LDAPUtility { return true; } - //for now, supported attributes are entryUUID, nsuniqueid, objectGUID, ipaUniqueID + // for now, supported attributes are entryUUID, nsuniqueid, objectGUID, ipaUniqueID $testAttributes = array('entryuuid', 'nsuniqueid', 'objectguid', 'guid', 'ipauniqueid'); foreach($testAttributes as $attribute) { @@ -1126,6 +1151,11 @@ class Access extends LDAPUtility { return false; } + /** + * @param string $dn + * @param bool $isUser + * @return array|bool|false + */ public function getUUID($dn, $isUser = true) { if($isUser) { $uuidAttr = 'ldapUuidUserAttribute'; @@ -1153,12 +1183,10 @@ class Access extends LDAPUtility { } /** - * @brief converts a binary ObjectGUID into a string representation - * @param $oguid the ObjectGUID in it's binary form as retrieved from AD - * @returns String - * * converts a binary ObjectGUID into a string representation - * http://www.php.net/manual/en/function.ldap-get-values-len.php#73198 + * @param string $oguid the ObjectGUID in it's binary form as retrieved from AD + * @return string + * @link http://www.php.net/manual/en/function.ldap-get-values-len.php#73198 */ private function convertObjectGUID2Str($oguid) { $hex_guid = bin2hex($oguid); @@ -1181,25 +1209,24 @@ class Access extends LDAPUtility { } /** - * @brief converts a stored DN so it can be used as base parameter for LDAP queries - * @param $dn the DN - * @returns String - * - * converts a stored DN so it can be used as base parameter for LDAP queries - * internally we store them for usage in LDAP filters + * converts a stored DN so it can be used as base parameter for LDAP queries, internally we store them for usage in LDAP filters + * @param string $dn the DN + * @return string */ private function DNasBaseParameter($dn) { return str_ireplace('\\5c', '\\', $dn); } /** - * @brief checks if the given DN is part of the given base DN(s) - * @param $dn the DN - * @param $bases array containing the allowed base DN or DNs - * @returns Boolean + * checks if the given DN is part of the given base DN(s) + * @param string $dn the DN + * @param string[] $bases array containing the allowed base DN or DNs + * @return bool */ private function isDNPartOfBase($dn, $bases) { + $belongsToBase = false; $bases = $this->sanitizeDN($bases); + foreach($bases as $base) { $belongsToBase = true; if(mb_strripos($dn, $base, 0, 'UTF-8') !== (mb_strlen($dn, 'UTF-8')-mb_strlen($base, 'UTF-8'))) { @@ -1213,12 +1240,12 @@ class Access extends LDAPUtility { } /** - * @brief get a cookie for the next LDAP paged search - * @param $base a string with the base DN for the search - * @param $filter the search filter to identify the correct search - * @param $limit the limit (or 'pageSize'), to identify the correct search well - * @param $offset the offset for the new search to identify the correct search really good - * @returns string containing the key or empty if none is cached + * get a cookie for the next LDAP paged search + * @param string $base a string with the base DN for the search + * @param string $filter the search filter to identify the correct search + * @param int $limit the limit (or 'pageSize'), to identify the correct search well + * @param int $offset the offset for the new search to identify the correct search really good + * @return string containing the key or empty if none is cached */ private function getPagedResultCookie($base, $filter, $limit, $offset) { if($offset === 0) { @@ -1226,10 +1253,10 @@ class Access extends LDAPUtility { } $offset -= $limit; //we work with cache here - $cachekey = 'lc' . crc32($base) . '-' . crc32($filter) . '-' . intval($limit) . '-' . intval($offset); + $cacheKey = 'lc' . crc32($base) . '-' . crc32($filter) . '-' . intval($limit) . '-' . intval($offset); $cookie = ''; - if(isset($this->cookies[$cachekey])) { - $cookie = $this->cookies[$cachekey]; + if(isset($this->cookies[$cacheKey])) { + $cookie = $this->cookies[$cacheKey]; if(is_null($cookie)) { $cookie = ''; } @@ -1238,23 +1265,23 @@ class Access extends LDAPUtility { } /** - * @brief set a cookie for LDAP paged search run - * @param $base a string with the base DN for the search - * @param $filter the search filter to identify the correct search - * @param $limit the limit (or 'pageSize'), to identify the correct search well - * @param $offset the offset for the run search to identify the correct search really good - * @param $cookie string containing the cookie returned by ldap_control_paged_result_response + * set a cookie for LDAP paged search run + * @param string $base a string with the base DN for the search + * @param string $filter the search filter to identify the correct search + * @param int $limit the limit (or 'pageSize'), to identify the correct search well + * @param int $offset the offset for the run search to identify the correct search really good + * @param string $cookie string containing the cookie returned by ldap_control_paged_result_response * @return void */ private function setPagedResultCookie($base, $filter, $limit, $offset, $cookie) { if(!empty($cookie)) { - $cachekey = 'lc' . crc32($base) . '-' . crc32($filter) . '-' .intval($limit) . '-' . intval($offset); - $this->cookies[$cachekey] = $cookie; + $cacheKey = 'lc' . crc32($base) . '-' . crc32($filter) . '-' .intval($limit) . '-' . intval($offset); + $this->cookies[$cacheKey] = $cookie; } } /** - * @brief check wether the most recent paged search was successful. It flushed the state var. Use it always after a possible paged search. + * Check whether the most recent paged search was successful. It flushed the state var. Use it always after a possible paged search. * @return boolean|null true on success, null or false otherwise */ public function getPagedSearchResultState() { @@ -1263,15 +1290,14 @@ class Access extends LDAPUtility { return $result; } - /** - * @brief prepares a paged search, if possible - * @param $filter the LDAP filter for the search - * @param $bases an array containing the LDAP subtree(s) that shall be searched - * @param $attr optional, when a certain attribute shall be filtered outside - * @param $limit - * @param $offset - * + * Prepares a paged search, if possible + * @param string $filter the LDAP filter for the search + * @param string[] $bases an array containing the LDAP subtree(s) that shall be searched + * @param string[] $attr optional, when a certain attribute shall be filtered outside + * @param int $limit + * @param int $offset + * @return bool|true */ private function initPagedSearch($filter, $bases, $attr, $limit, $offset) { $pagedSearchOK = false; @@ -1287,8 +1313,9 @@ class Access extends LDAPUtility { $cookie = $this->getPagedResultCookie($base, $filter, $limit, $offset); if(empty($cookie) && ($offset > 0)) { // no cookie known, although the offset is not 0. Maybe cache run out. We need - // to start all over *sigh* (btw, Dear Reader, did you need LDAP paged + // to start all over *sigh* (btw, Dear Reader, did you know LDAP paged // searching was designed by MSFT?) + // Lukas: No, but thanks to reading that source I finally know! $reOffset = ($offset - $limit) < 0 ? 0 : $offset - $limit; //a bit recursive, $offset of 0 is the exit \OCP\Util::writeLog('user_ldap', 'Looking for cookie L/O '.$limit.'/'.$reOffset, \OCP\Util::INFO); diff --git a/apps/user_ldap/lib/backendutility.php b/apps/user_ldap/lib/backendutility.php index 815757a1a11682bb360bbb923348fe7331662d45..c94366ce0192431f6c50eedce6c7c175417b6a63 100644 --- a/apps/user_ldap/lib/backendutility.php +++ b/apps/user_ldap/lib/backendutility.php @@ -29,8 +29,8 @@ abstract class BackendUtility { protected $access; /** - * @brief constructor, make sure the subclasses call this one! - * @param $access an instance of Access for LDAP interaction + * constructor, make sure the subclasses call this one! + * @param Access $access an instance of Access for LDAP interaction */ public function __construct(Access $access) { $this->access = $access; diff --git a/apps/user_ldap/lib/configuration.php b/apps/user_ldap/lib/configuration.php index c9ed1e648a230c07429737da0e9260167c50c3a8..9c455929b4a1784b88f895e5f14ee25672a3e082 100644 --- a/apps/user_ldap/lib/configuration.php +++ b/apps/user_ldap/lib/configuration.php @@ -82,35 +82,47 @@ class Configuration { /** * @param string $configPrefix + * @param bool $autoRead */ - public function __construct($configPrefix, $autoread = true) { + public function __construct($configPrefix, $autoRead = true) { $this->configPrefix = $configPrefix; - if($autoread) { + if($autoRead) { $this->readConfiguration(); } } + /** + * @param string $name + * @return mixed|void + */ public function __get($name) { if(isset($this->config[$name])) { return $this->config[$name]; } } + /** + * @param string $name + * @param mixed $value + */ public function __set($name, $value) { $this->setConfiguration(array($name => $value)); } + /** + * @return array + */ public function getConfiguration() { return $this->config; } /** - * @brief set LDAP configuration with values delivered by an array, not read + * set LDAP configuration with values delivered by an array, not read * from configuration. It does not save the configuration! To do so, you * must call saveConfiguration afterwards. - * @param $config array that holds the config parameters in an associated + * @param array $config array that holds the config parameters in an associated * array - * @param &$applied optional; array where the set fields will be given to + * @param array &$applied optional; array where the set fields will be given to * @return false|null */ public function setConfiguration($config, &$applied = null) { @@ -119,11 +131,11 @@ class Configuration { } $cta = $this->getConfigTranslationArray(); - foreach($config as $inputkey => $val) { - if(strpos($inputkey, '_') !== false && array_key_exists($inputkey, $cta)) { - $key = $cta[$inputkey]; - } elseif(array_key_exists($inputkey, $this->config)) { - $key = $inputkey; + foreach($config as $inputKey => $val) { + if(strpos($inputKey, '_') !== false && array_key_exists($inputKey, $cta)) { + $key = $cta[$inputKey]; + } elseif(array_key_exists($inputKey, $this->config)) { + $key = $inputKey; } else { continue; } @@ -150,7 +162,7 @@ class Configuration { } $this->$setMethod($key, $val); if(is_array($applied)) { - $applied[] = $inputkey; + $applied[] = $inputKey; } } @@ -164,7 +176,7 @@ class Configuration { //some are determined continue; } - $dbkey = $cta[$key]; + $dbKey = $cta[$key]; switch($key) { case 'ldapBase': case 'ldapBaseUsers': @@ -180,7 +192,7 @@ class Configuration { break; case 'ldapIgnoreNamingRules': $readMethod = 'getSystemValue'; - $dbkey = $key; + $dbKey = $key; break; case 'ldapAgentPassword': $readMethod = 'getPwd'; @@ -193,14 +205,14 @@ class Configuration { $readMethod = 'getValue'; break; } - $this->config[$key] = $this->$readMethod($dbkey); + $this->config[$key] = $this->$readMethod($dbKey); } $this->configRead = true; } } /** - * @brief saves the current Configuration in the database + * saves the current Configuration in the database */ public function saveConfiguration() { $cta = array_flip($this->getConfigTranslationArray()); @@ -237,8 +249,12 @@ class Configuration { } } - protected function getMultiLine($varname) { - $value = $this->getValue($varname); + /** + * @param string $varName + * @return array|string + */ + protected function getMultiLine($varName) { + $value = $this->getValue($varName); if(empty($value)) { $value = ''; } else { @@ -248,7 +264,11 @@ class Configuration { return $value; } - protected function setMultiLine($varname, $value) { + /** + * @param string $varName + * @param array|string $value + */ + protected function setMultiLine($varName, $value) { if(empty($value)) { $value = ''; } else if (!is_array($value)) { @@ -258,44 +278,69 @@ class Configuration { } } - $this->setValue($varname, $value); + $this->setValue($varName, $value); } - protected function getPwd($varname) { - return base64_decode($this->getValue($varname)); + /** + * @param string $varName + * @return string + */ + protected function getPwd($varName) { + return base64_decode($this->getValue($varName)); } - protected function getLcValue($varname) { - return mb_strtolower($this->getValue($varname), 'UTF-8'); + /** + * @param string $varName + * @return string + */ + protected function getLcValue($varName) { + return mb_strtolower($this->getValue($varName), 'UTF-8'); } - protected function getSystemValue($varname) { + /** + * @param string $varName + * @return string + */ + protected function getSystemValue($varName) { //FIXME: if another system value is added, softcode the default value - return \OCP\Config::getSystemValue($varname, false); + return \OCP\Config::getSystemValue($varName, false); } - protected function getValue($varname) { + /** + * @param string $varName + * @return string + */ + protected function getValue($varName) { static $defaults; if(is_null($defaults)) { $defaults = $this->getDefaults(); } return \OCP\Config::getAppValue('user_ldap', - $this->configPrefix.$varname, - $defaults[$varname]); + $this->configPrefix.$varName, + $defaults[$varName]); } - protected function setValue($varname, $value) { - $this->config[$varname] = $value; + /** + * @param string $varName + * @param mixed $value + */ + protected function setValue($varName, $value) { + $this->config[$varName] = $value; } - protected function saveValue($varname, $value) { + /** + * @param string $varName + * @param string $value + * @return bool + */ + protected function saveValue($varName, $value) { return \OCP\Config::setAppValue('user_ldap', - $this->configPrefix.$varname, + $this->configPrefix.$varName, $value); } /** - * @returns an associative array with the default values. Keys are correspond + * @return array an associative array with the default values. Keys are correspond * to config-value entries in the database table */ public function getDefaults() { @@ -350,7 +395,7 @@ class Configuration { } /** - * @return returns an array that maps internal variable names to database fields + * @return array that maps internal variable names to database fields */ public function getConfigTranslationArray() { //TODO: merge them into one representation @@ -403,4 +448,4 @@ class Configuration { return $array; } -} \ No newline at end of file +} diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php index 173c4ebcc2347008227b8a3ae6835da060304425..52f6c5ceb10387de497bd4fcdcb4326153169655 100644 --- a/apps/user_ldap/lib/connection.php +++ b/apps/user_ldap/lib/connection.php @@ -42,9 +42,10 @@ class Connection extends LDAPUtility { protected $doNotValidate = false; /** - * @brief Constructor - * @param $configPrefix a string with the prefix for the configkey column (appconfig table) - * @param $configID a string with the value for the appid column (appconfig table) or null for on-the-fly connections + * Constructor + * @param ILDAPWrapper $ldap + * @param string $configPrefix a string with the prefix for the configkey column (appconfig table) + * @param string $configID a string with the value for the appid column (appconfig table) or null for on-the-fly connections */ public function __construct(ILDAPWrapper $ldap, $configPrefix = '', $configID = 'user_ldap') { parent::__construct($ldap); @@ -56,7 +57,7 @@ class Connection extends LDAPUtility { if($memcache->isAvailable()) { $this->cache = $memcache->create(); } else { - $this->cache = \OC_Cache::getGlobalCache(); + $this->cache = \OC\Cache::getGlobalCache(); } $this->hasPagedResultSupport = $this->ldap->hasPagedResultSupport(); @@ -72,7 +73,7 @@ class Connection extends LDAPUtility { } /** - * @brief defines behaviour when the instance is cloned + * defines behaviour when the instance is cloned */ public function __clone() { //a cloned instance inherits the connection resource. It may use it, @@ -82,6 +83,10 @@ class Connection extends LDAPUtility { !is_null($this->configID)); } + /** + * @param string $name + * @return bool|mixed|void + */ public function __get($name) { if(!$this->configured) { $this->readConfiguration(); @@ -94,6 +99,10 @@ class Connection extends LDAPUtility { return $this->configuration->$name; } + /** + * @param string $name + * @param mixed $value + */ public function __set($name, $value) { $this->doNotValidate = false; $before = $this->configuration->$name; @@ -108,10 +117,8 @@ class Connection extends LDAPUtility { } /** - * @brief initializes the LDAP backend - * @param $force read the config settings no matter what - * * initializes the LDAP backend + * @param bool $force read the config settings no matter what */ public function init($force = false) { $this->readConfiguration($force); @@ -136,6 +143,7 @@ class Connection extends LDAPUtility { /** * @param string|null $key + * @return string */ private function getCacheKey($key) { $prefix = 'LDAP-'.$this->configID.'-'.$this->configPrefix.'-'; @@ -147,6 +155,7 @@ class Connection extends LDAPUtility { /** * @param string $key + * @return mixed|null */ public function getFromCache($key) { if(!$this->configured) { @@ -166,6 +175,7 @@ class Connection extends LDAPUtility { /** * @param string $key + * @return bool */ public function isCached($key) { if(!$this->configured) { @@ -180,6 +190,7 @@ class Connection extends LDAPUtility { /** * @param string $key + * @param mixed $value */ public function writeToCache($key, $value) { if(!$this->configured) { @@ -199,8 +210,8 @@ class Connection extends LDAPUtility { } /** - * @brief Caches the general LDAP configuration. - * @param $force optional. true, if the re-read should be forced. defaults + * Caches the general LDAP configuration. + * @param bool $force optional. true, if the re-read should be forced. defaults * to false. * @return null */ @@ -212,9 +223,9 @@ class Connection extends LDAPUtility { } /** - * @brief set LDAP configuration with values delivered by an array, not read from configuration - * @param $config array that holds the config parameters in an associated array - * @param &$setParameters optional; array where the set fields will be given to + * set LDAP configuration with values delivered by an array, not read from configuration + * @param array $config array that holds the config parameters in an associated array + * @param array &$setParameters optional; array where the set fields will be given to * @return boolean true if config validates, false otherwise. Check with $setParameters for detailed success on single parameters */ public function setConfiguration($config, &$setParameters = null) { @@ -232,7 +243,7 @@ class Connection extends LDAPUtility { } /** - * @brief saves the current Configuration in the database and empties the + * saves the current Configuration in the database and empties the * cache * @return null */ @@ -242,7 +253,7 @@ class Connection extends LDAPUtility { } /** - * @brief get the current LDAP configuration + * get the current LDAP configuration * @return array */ public function getConfiguration() { @@ -278,7 +289,7 @@ class Connection extends LDAPUtility { private function doSoftValidation() { //if User or Group Base are not set, take over Base DN setting foreach(array('ldapBaseUsers', 'ldapBaseGroups') as $keyBase) { - $val = $this->configuration->$keyBase; + $val = $this->configuration->$keyBase; if(empty($val)) { $obj = strpos('Users', $keyBase) !== false ? 'Users' : 'Groups'; \OCP\Util::writeLog('user_ldap', @@ -326,9 +337,9 @@ class Connection extends LDAPUtility { } //make sure empty search attributes are saved as simple, empty array - $sakeys = array('ldapAttributesForUserSearch', + $saKeys = array('ldapAttributesForUserSearch', 'ldapAttributesForGroupSearch'); - foreach($sakeys as $key) { + foreach($saKeys as $key) { $val = $this->configuration->$key; if(is_array($val) && count($val) === 1 && empty($val[0])) { $this->configuration->$key = array(); @@ -345,6 +356,9 @@ class Connection extends LDAPUtility { } } + /** + * @return bool + */ private function doCriticalValidation() { $configurationOK = true; $errorStr = 'Configuration Error (prefix '. @@ -419,8 +433,8 @@ class Connection extends LDAPUtility { } /** - * @brief Validates the user specified configuration - * @returns true if configuration seems OK, false otherwise + * Validates the user specified configuration + * @return bool true if configuration seems OK, false otherwise */ private function validateConfiguration() { @@ -435,8 +449,8 @@ class Connection extends LDAPUtility { // necessary, but advisable. If left empty, give an info message $this->doSoftValidation(); - //second step: critical checks. If left empty or filled wrong, set as - //unconfigured and give a warning. + //second step: critical checks. If left empty or filled wrong, mark as + //not configured and give a warning. return $this->doCriticalValidation(); } @@ -508,12 +522,17 @@ class Connection extends LDAPUtility { } } + /** + * @param string $host + * @param string $port + * @return false|void + */ private function doConnect($host, $port) { if(empty($host)) { return false; } if(strpos($host, '://') !== false) { - //ldap_connect ignores port paramater when URLs are passed + //ldap_connect ignores port parameter when URLs are passed $host .= ':' . $port; } $this->ldapConnectionRes = $this->ldap->connect($host, $port); diff --git a/apps/user_ldap/lib/helper.php b/apps/user_ldap/lib/helper.php index b5955cb2abba15e4cfcfbb6e47e16e2f28df40f4..37caedc6251f089b3498bb5b33fde582c86ab432 100644 --- a/apps/user_ldap/lib/helper.php +++ b/apps/user_ldap/lib/helper.php @@ -26,8 +26,8 @@ namespace OCA\user_ldap\lib; class Helper { /** - * @brief returns prefixes for each saved LDAP/AD server configuration. - * @param bool optional, whether only active configuration shall be + * returns prefixes for each saved LDAP/AD server configuration. + * @param bool $activeConfigurations optional, whether only active configuration shall be * retrieved, defaults to false * @return array with a list of the available prefixes * @@ -79,8 +79,8 @@ class Helper { /** * - * @brief determines the host for every configured connection - * @return an array with configprefix as keys + * determines the host for every configured connection + * @return array an array with configprefix as keys * */ static public function getServerConfigurationHosts() { @@ -106,8 +106,8 @@ class Helper { } /** - * @brief deletes a given saved LDAP/AD server configuration. - * @param string the configuration prefix of the config to delete + * deletes a given saved LDAP/AD server configuration. + * @param string $prefix the configuration prefix of the config to delete * @return bool true on success, false otherwise */ static public function deleteServerConfiguration($prefix) { @@ -148,7 +148,7 @@ class Helper { * Truncate's the given mapping table * * @param string $mapping either 'user' or 'group' - * @return boolean true on success, false otherwise + * @return bool true on success, false otherwise */ static public function clearMapping($mapping) { if($mapping === 'user') { @@ -176,9 +176,9 @@ class Helper { } /** - * @brief extractsthe domain from a given URL - * @param $url the URL - * @return mixed, domain as string on success, false otherwise + * extractsthe domain from a given URL + * @param string $url the URL + * @return string|false domain as string on success, false otherwise */ static public function getDomainFromURL($url) { $uinfo = parse_url($url); diff --git a/apps/user_ldap/lib/ildapwrapper.php b/apps/user_ldap/lib/ildapwrapper.php index 017d5549690c7c2db5aae998b14f8a859f7e9b39..97ae08101163d8ffb1b64424d487b8c99d6f8083 100644 --- a/apps/user_ldap/lib/ildapwrapper.php +++ b/apps/user_ldap/lib/ildapwrapper.php @@ -28,178 +28,178 @@ interface ILDAPWrapper { //LDAP functions in use /** - * @brief Bind to LDAP directory + * Bind to LDAP directory * @param resource $link LDAP link resource - * @param $dn an RDN to log in with - * @param $password the password - * @return true on success, false otherwise + * @param string $dn an RDN to log in with + * @param string $password the password + * @return bool true on success, false otherwise * * with $dn and $password as null a anonymous bind is attempted. */ public function bind($link, $dn, $password); /** - * @brief connect to an LDAP server - * @param $host The host to connect to - * @param $port The port to connect to - * @return a link resource on success, otherwise false + * connect to an LDAP server + * @param string $host The host to connect to + * @param string $port The port to connect to + * @return mixed a link resource on success, otherwise false */ public function connect($host, $port); /** - * @brief Send LDAP pagination control - * @param $link LDAP link resource - * @param $pagesize number of results per page - * @param boolean $isCritical Indicates whether the pagination is critical of not. - * @param $cookie structure sent by LDAP server - * @return true on success, false otherwise + * Send LDAP pagination control + * @param resource $link LDAP link resource + * @param int $pageSize number of results per page + * @param bool $isCritical Indicates whether the pagination is critical of not. + * @param array $cookie structure sent by LDAP server + * @return bool true on success, false otherwise */ - public function controlPagedResult($link, $pagesize, $isCritical, $cookie); + public function controlPagedResult($link, $pageSize, $isCritical, $cookie); /** - * @brief Retrieve the LDAP pagination cookie - * @param $link LDAP link resource - * @param $result LDAP result resource - * @param $cookie structure sent by LDAP server - * @return boolean on success, false otherwise + * Retrieve the LDAP pagination cookie + * @param resource $link LDAP link resource + * @param resource $result LDAP result resource + * @param string $cookie structure sent by LDAP server + * @return bool true on success, false otherwise * * Corresponds to ldap_control_paged_result_response */ public function controlPagedResultResponse($link, $result, &$cookie); /** - * @brief Count the number of entries in a search - * @param $link LDAP link resource - * @param $result LDAP result resource - * @return mixed, number of results on success, false otherwise + * Count the number of entries in a search + * @param resource $link LDAP link resource + * @param resource $result LDAP result resource + * @return int|false number of results on success, false otherwise */ public function countEntries($link, $result); /** - * @brief Return the LDAP error number of the last LDAP command - * @param $link LDAP link resource - * @return error message as string + * Return the LDAP error number of the last LDAP command + * @param resource $link LDAP link resource + * @return string error message as string */ public function errno($link); /** - * @brief Return the LDAP error message of the last LDAP command - * @param $link LDAP link resource - * @return error code as integer + * Return the LDAP error message of the last LDAP command + * @param resource $link LDAP link resource + * @return int error code as integer */ public function error($link); /** - * @brief Return first result id - * @param $link LDAP link resource - * @param $result LDAP result resource - * @return an LDAP search result resource + * Return first result id + * @param resource $link LDAP link resource + * @param resource $result LDAP result resource + * @return Resource an LDAP search result resource * */ public function firstEntry($link, $result); /** - * @brief Get attributes from a search result entry - * @param $link LDAP link resource - * @param $result LDAP result resource + * Get attributes from a search result entry + * @param resource $link LDAP link resource + * @param resource $result LDAP result resource * @return array containing the results, false on error * */ public function getAttributes($link, $result); /** - * @brief Get the DN of a result entry - * @param $link LDAP link resource - * @param $result LDAP result resource + * Get the DN of a result entry + * @param resource $link LDAP link resource + * @param resource $result LDAP result resource * @return string containing the DN, false on error */ public function getDN($link, $result); /** - * @brief Get all result entries - * @param $link LDAP link resource - * @param $result LDAP result resource + * Get all result entries + * @param resource $link LDAP link resource + * @param resource $result LDAP result resource * @return array containing the results, false on error */ public function getEntries($link, $result); /** - * @brief Return next result id - * @param $link LDAP link resource + * Return next result id + * @param resource $link LDAP link resource * @param resource $result LDAP entry result resource - * @return an LDAP search result resource + * @return resource an LDAP search result resource * */ public function nextEntry($link, $result); /** - * @brief Read an entry - * @param $link LDAP link resource - * @param $baseDN The DN of the entry to read from - * @param $filter An LDAP filter - * @param $attr array of the attributes to read - * @return an LDAP search result resource + * Read an entry + * @param resource $link LDAP link resource + * @param array $baseDN The DN of the entry to read from + * @param string $filter An LDAP filter + * @param array $attr array of the attributes to read + * @return resource an LDAP search result resource */ public function read($link, $baseDN, $filter, $attr); /** - * @brief Search LDAP tree - * @param $link LDAP link resource - * @param $baseDN The DN of the entry to read from - * @param $filter An LDAP filter - * @param $attr array of the attributes to read - * @param $attrsonly optional, 1 if only attribute types shall be returned - * @param $limit optional, limits the result entries - * @return an LDAP search result resource, false on error + * Search LDAP tree + * @param resource $link LDAP link resource + * @param string $baseDN The DN of the entry to read from + * @param string $filter An LDAP filter + * @param array $attr array of the attributes to read + * @param int $attrsOnly optional, 1 if only attribute types shall be returned + * @param int $limit optional, limits the result entries + * @return resource|false an LDAP search result resource, false on error */ - public function search($link, $baseDN, $filter, $attr, $attrsonly = 0, $limit = 0); + public function search($link, $baseDN, $filter, $attr, $attrsOnly = 0, $limit = 0); /** - * @brief Sets the value of the specified option to be $value - * @param $link LDAP link resource - * @param $option a defined LDAP Server option - * @param integer $value the new value for the option - * @return true on success, false otherwise + * Sets the value of the specified option to be $value + * @param resource $link LDAP link resource + * @param string $option a defined LDAP Server option + * @param int $value the new value for the option + * @return bool true on success, false otherwise */ public function setOption($link, $option, $value); /** - * @brief establish Start TLS - * @param $link LDAP link resource - * @return true on success, false otherwise + * establish Start TLS + * @param resource $link LDAP link resource + * @return bool true on success, false otherwise */ public function startTls($link); /** - * @brief Sort the result of a LDAP search - * @param $link LDAP link resource - * @param $result LDAP result resource - * @param $sortfilter attribute to use a key in sort + * Sort the result of a LDAP search + * @param resource $link LDAP link resource + * @param resource $result LDAP result resource + * @param string $sortFilter attribute to use a key in sort */ - public function sort($link, $result, $sortfilter); + public function sort($link, $result, $sortFilter); /** - * @brief Unbind from LDAP directory + * Unbind from LDAP directory * @param resource $link LDAP link resource - * @return true on success, false otherwise + * @return bool true on success, false otherwise */ public function unbind($link); - //additional required methods in owncloud + //additional required methods in ownCloud /** - * @brief Checks whether the server supports LDAP - * @return boolean if it the case, false otherwise + * Checks whether the server supports LDAP + * @return bool true if it the case, false otherwise * */ public function areLDAPFunctionsAvailable(); /** - * @brief Checks whether PHP supports LDAP Paged Results - * @return boolean if it the case, false otherwise + * Checks whether PHP supports LDAP Paged Results + * @return bool true if it the case, false otherwise * */ public function hasPagedResultSupport(); /** - * @brief Checks whether the submitted parameter is a resource - * @param $resource the resource variable to check - * @return boolean if it is a resource, false otherwise + * Checks whether the submitted parameter is a resource + * @param resource $resource the resource variable to check + * @return bool true if it is a resource, false otherwise */ public function isResource($resource); diff --git a/apps/user_ldap/lib/jobs.php b/apps/user_ldap/lib/jobs.php index 9b108da63310e3167a2db642fa295f6b3730ed18..19c041e4db40d1affe4de037cf471d7f8bf8af6d 100644 --- a/apps/user_ldap/lib/jobs.php +++ b/apps/user_ldap/lib/jobs.php @@ -33,6 +33,9 @@ class Jobs extends \OC\BackgroundJob\TimedJob { $this->interval = self::getRefreshInterval(); } + /** + * @param mixed $argument + */ public function run($argument){ Jobs::updateGroups(); } @@ -57,11 +60,17 @@ class Jobs extends \OC\BackgroundJob\TimedJob { \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – Finished.', \OCP\Util::DEBUG); } + /** + * @return int + */ static private function getRefreshInterval() { //defaults to every hour return \OCP\Config::getAppValue('user_ldap', 'bgjRefreshInterval', 3600); } + /** + * @param string[] $groups + */ static private function handleKnownGroups($groups) { \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – Dealing with known Groups.', \OCP\Util::DEBUG); $query = \OCP\DB::prepare(' @@ -71,32 +80,35 @@ class Jobs extends \OC\BackgroundJob\TimedJob { '); foreach($groups as $group) { //we assume, that self::$groupsFromDB has been retrieved already - $knownUsers = unserialize(self::$groupsFromDB[$group]['owncloudusers']); - $actualUsers = self::getGroupBE()->usersInGroup($group); - $hasChanged = false; - foreach(array_diff($knownUsers, $actualUsers) as $removedUser) { - \OCP\Util::emitHook('OC_User', 'post_removeFromGroup', array('uid' => $removedUser, 'gid' => $group)); - \OCP\Util::writeLog('user_ldap', + $knownUsers = unserialize(self::$groupsFromDB[$group]['owncloudusers']); + $actualUsers = self::getGroupBE()->usersInGroup($group); + $hasChanged = false; + foreach(array_diff($knownUsers, $actualUsers) as $removedUser) { + \OCP\Util::emitHook('OC_User', 'post_removeFromGroup', array('uid' => $removedUser, 'gid' => $group)); + \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – "'.$removedUser.'" removed from "'.$group.'".', \OCP\Util::INFO); - $hasChanged = true; - } - foreach(array_diff($actualUsers, $knownUsers) as $addedUser) { - \OCP\Util::emitHook('OC_User', 'post_addToGroup', array('uid' => $addedUser, 'gid' => $group)); - \OCP\Util::writeLog('user_ldap', + $hasChanged = true; + } + foreach(array_diff($actualUsers, $knownUsers) as $addedUser) { + \OCP\Util::emitHook('OC_User', 'post_addToGroup', array('uid' => $addedUser, 'gid' => $group)); + \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – "'.$addedUser.'" added to "'.$group.'".', \OCP\Util::INFO); - $hasChanged = true; - } - if($hasChanged) { + $hasChanged = true; + } + if($hasChanged) { $query->execute(array(serialize($actualUsers), $group)); - } + } } \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – FINISHED dealing with known Groups.', \OCP\Util::DEBUG); } + /** + * @param string[] $createdGroups + */ static private function handleCreatedGroups($createdGroups) { \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – dealing with created Groups.', \OCP\Util::DEBUG); $query = \OCP\DB::prepare(' @@ -109,13 +121,16 @@ class Jobs extends \OC\BackgroundJob\TimedJob { 'bgJ "updateGroups" – new group "'.$createdGroup.'" found.', \OCP\Util::INFO); $users = serialize(self::getGroupBE()->usersInGroup($createdGroup)); - $query->execute(array($createdGroup, $users)); + $query->execute(array($createdGroup, $users)); } \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – FINISHED dealing with created Groups.', \OCP\Util::DEBUG); } + /** + * @param string[] $removedGroups + */ static private function handleRemovedGroups($removedGroups) { \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – dealing with removed groups.', \OCP\Util::DEBUG); $query = \OCP\DB::prepare(' @@ -127,13 +142,16 @@ class Jobs extends \OC\BackgroundJob\TimedJob { \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – group "'.$removedGroup.'" was removed.', \OCP\Util::INFO); - $query->execute(array($removedGroup)); + $query->execute(array($removedGroup)); } \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – FINISHED dealing with removed groups.', \OCP\Util::DEBUG); } + /** + * @return \OCA\user_ldap\GROUP_LDAP|\OCA\user_ldap\Group_Proxy + */ static private function getGroupBE() { if(!is_null(self::$groupBE)) { return self::$groupBE; @@ -152,6 +170,9 @@ class Jobs extends \OC\BackgroundJob\TimedJob { return self::$groupBE; } + /** + * @return array + */ static private function getKnownGroups() { if(is_array(self::$groupsFromDB)) { return self::$groupsFromDB; @@ -163,7 +184,7 @@ class Jobs extends \OC\BackgroundJob\TimedJob { $result = $query->execute()->fetchAll(); self::$groupsFromDB = array(); foreach($result as $dataset) { - self::$groupsFromDB[$dataset['owncloudname']] = $dataset; + self::$groupsFromDB[$dataset['owncloudname']] = $dataset; } return self::$groupsFromDB; diff --git a/apps/user_ldap/lib/ldap.php b/apps/user_ldap/lib/ldap.php index d1ca91045b2de06a7185d2b2296203f3d7f8ebf5..2b20b2ab7386c2bda3e6904f17cdd6689f8f1bb7 100644 --- a/apps/user_ldap/lib/ldap.php +++ b/apps/user_ldap/lib/ldap.php @@ -27,14 +27,31 @@ class LDAP implements ILDAPWrapper { protected $curFunc = ''; protected $curArgs = array(); + /** + * @param resource $link + * @param string $dn + * @param string $password + * @return bool|mixed + */ public function bind($link, $dn, $password) { return $this->invokeLDAPMethod('bind', $link, $dn, $password); } + /** + * @param string $host + * @param string $port + * @return mixed + */ public function connect($host, $port) { return $this->invokeLDAPMethod('connect', $host, $port); } + /** + * @param LDAP $link + * @param LDAP $result + * @param string $cookie + * @return bool|LDAP + */ public function controlPagedResultResponse($link, $result, &$cookie) { $this->preFunctionCall('ldap_control_paged_result_response', array($link, $result, $cookie)); @@ -44,70 +61,150 @@ class LDAP implements ILDAPWrapper { return $result; } - public function controlPagedResult($link, $pagesize, $isCritical, $cookie) { - return $this->invokeLDAPMethod('control_paged_result', $link, $pagesize, + /** + * @param LDAP $link + * @param int $pageSize + * @param bool $isCritical + * @param string $cookie + * @return mixed|true + */ + public function controlPagedResult($link, $pageSize, $isCritical, $cookie) { + return $this->invokeLDAPMethod('control_paged_result', $link, $pageSize, $isCritical, $cookie); } + /** + * @param LDAP $link + * @param LDAP $result + * @return mixed + */ public function countEntries($link, $result) { return $this->invokeLDAPMethod('count_entries', $link, $result); } + /** + * @param LDAP $link + * @return mixed|string + */ public function errno($link) { return $this->invokeLDAPMethod('errno', $link); } + /** + * @param LDAP $link + * @return int|mixed + */ public function error($link) { return $this->invokeLDAPMethod('error', $link); } + /** + * @param LDAP $link + * @param LDAP $result + * @return mixed + */ public function firstEntry($link, $result) { return $this->invokeLDAPMethod('first_entry', $link, $result); } + /** + * @param LDAP $link + * @param LDAP $result + * @return array|mixed + */ public function getAttributes($link, $result) { return $this->invokeLDAPMethod('get_attributes', $link, $result); } + /** + * @param LDAP $link + * @param LDAP $result + * @return mixed|string + */ public function getDN($link, $result) { return $this->invokeLDAPMethod('get_dn', $link, $result); } + /** + * @param LDAP $link + * @param LDAP $result + * @return array|mixed + */ public function getEntries($link, $result) { return $this->invokeLDAPMethod('get_entries', $link, $result); } + /** + * @param LDAP $link + * @param resource $result + * @return mixed|an + */ public function nextEntry($link, $result) { return $this->invokeLDAPMethod('next_entry', $link, $result); } + /** + * @param LDAP $link + * @param string $baseDN + * @param string $filter + * @param array $attr + * @return mixed + */ public function read($link, $baseDN, $filter, $attr) { return $this->invokeLDAPMethod('read', $link, $baseDN, $filter, $attr); } - public function search($link, $baseDN, $filter, $attr, $attrsonly = 0, $limit = 0) { - return $this->invokeLDAPMethod('search', $link, $baseDN, $filter, - $attr, $attrsonly, $limit); + /** + * @param LDAP $link + * @param string $baseDN + * @param string $filter + * @param array $attr + * @param int $attrsOnly + * @param int $limit + * @return mixed + */ + public function search($link, $baseDN, $filter, $attr, $attrsOnly = 0, $limit = 0) { + return $this->invokeLDAPMethod('search', $link, $baseDN, $filter, $attr, $attrsOnly, $limit); } + /** + * @param LDAP $link + * @param string $option + * @param int $value + * @return bool|mixed + */ public function setOption($link, $option, $value) { return $this->invokeLDAPMethod('set_option', $link, $option, $value); } - public function sort($link, $result, $sortfilter) { - return $this->invokeLDAPMethod('sort', $link, $result, $sortfilter); + /** + * @param LDAP $link + * @param LDAP $result + * @param string $sortFilter + * @return mixed + */ + public function sort($link, $result, $sortFilter) { + return $this->invokeLDAPMethod('sort', $link, $result, $sortFilter); } + /** + * @param LDAP $link + * @return mixed|true + */ public function startTls($link) { return $this->invokeLDAPMethod('start_tls', $link); } + /** + * @param resource $link + * @return bool|mixed + */ public function unbind($link) { return $this->invokeLDAPMethod('unbind', $link); } /** - * @brief Checks whether the server supports LDAP + * Checks whether the server supports LDAP * @return boolean if it the case, false otherwise * */ public function areLDAPFunctionsAvailable() { @@ -115,7 +212,7 @@ class LDAP implements ILDAPWrapper { } /** - * @brief Checks whether PHP supports LDAP Paged Results + * Checks whether PHP supports LDAP Paged Results * @return boolean if it the case, false otherwise * */ public function hasPagedResultSupport() { @@ -125,14 +222,17 @@ class LDAP implements ILDAPWrapper { } /** - * @brief Checks whether the submitted parameter is a resource - * @param $resource the resource variable to check - * @return boolean if it is a resource, false otherwise + * Checks whether the submitted parameter is a resource + * @param Resource $resource the resource variable to check + * @return bool true if it is a resource, false otherwise */ public function isResource($resource) { return is_resource($resource); } + /** + * @return mixed + */ private function invokeLDAPMethod() { $arguments = func_get_args(); $func = 'ldap_' . array_shift($arguments); @@ -148,6 +248,7 @@ class LDAP implements ILDAPWrapper { /** * @param string $functionName + * @param array $args */ private function preFunctionCall($functionName, $args) { $this->curFunc = $functionName; @@ -181,4 +282,4 @@ class LDAP implements ILDAPWrapper { $this->curFunc = ''; $this->curArgs = array(); } -} \ No newline at end of file +} diff --git a/apps/user_ldap/lib/ldaputility.php b/apps/user_ldap/lib/ldaputility.php index 7fffd9c88d18c1efe5cdd97624738594b830bceb..aa1e75e928b2c192c4cd9d633e8d080e23c09024 100644 --- a/apps/user_ldap/lib/ldaputility.php +++ b/apps/user_ldap/lib/ldaputility.php @@ -27,8 +27,8 @@ abstract class LDAPUtility { protected $ldap; /** - * @brief constructor, make sure the subclasses call this one! - * @param $ldapWrapper an instance of an ILDAPWrapper + * constructor, make sure the subclasses call this one! + * @param ILDAPWrapper $ldapWrapper an instance of an ILDAPWrapper */ public function __construct(ILDAPWrapper $ldapWrapper) { $this->ldap = $ldapWrapper; diff --git a/apps/user_ldap/lib/proxy.php b/apps/user_ldap/lib/proxy.php index 0eb294eb7a0d36350c8956490d4b16712d276638..d15d1ae861630197424d2bc47e42805093e80b99 100644 --- a/apps/user_ldap/lib/proxy.php +++ b/apps/user_ldap/lib/proxy.php @@ -29,16 +29,26 @@ abstract class Proxy { static private $accesses = array(); private $ldap = null; + /** + * @param ILDAPWrapper $ldap + */ public function __construct(ILDAPWrapper $ldap) { $this->ldap = $ldap; - $this->cache = \OC_Cache::getGlobalCache(); + $this->cache = \OC\Cache::getGlobalCache(); } + /** + * @param string $configPrefix + */ private function addAccess($configPrefix) { $connector = new Connection($this->ldap, $configPrefix); self::$accesses[$configPrefix] = new Access($connector, $this->ldap); } + /** + * @param string $configPrefix + * @return mixed + */ protected function getAccess($configPrefix) { if(!isset(self::$accesses[$configPrefix])) { $this->addAccess($configPrefix); @@ -46,30 +56,45 @@ abstract class Proxy { return self::$accesses[$configPrefix]; } + /** + * @param string $uid + * @return string + */ protected function getUserCacheKey($uid) { return 'user-'.$uid.'-lastSeenOn'; } + /** + * @param string $gid + * @return string + */ protected function getGroupCacheKey($gid) { return 'group-'.$gid.'-lastSeenOn'; } /** - * @param boolean $passOnWhen + * @param string $id * @param string $method + * @param array $parameters + * @param bool $passOnWhen + * @return mixed */ abstract protected function callOnLastSeenOn($id, $method, $parameters, $passOnWhen); /** + * @param string $id * @param string $method + * @param array $parameters + * @return mixed */ abstract protected function walkBackends($id, $method, $parameters); /** - * @brief Takes care of the request to the User backend - * @param $uid string, the uid connected to the request + * Takes care of the request to the User backend + * @param string $id * @param string $method string, the method of the user backend that shall be called - * @param $parameters an array of parameters to be passed + * @param array $parameters an array of parameters to be passed + * @param bool $passOnWhen * @return mixed, the result of the specified method */ protected function handleRequest($id, $method, $parameters, $passOnWhen = false) { @@ -82,6 +107,7 @@ abstract class Proxy { /** * @param string|null $key + * @return string */ private function getCacheKey($key) { $prefix = 'LDAP-Proxy-'; @@ -93,6 +119,7 @@ abstract class Proxy { /** * @param string $key + * @return mixed|null */ public function getFromCache($key) { if(!$this->isCached($key)) { @@ -105,6 +132,7 @@ abstract class Proxy { /** * @param string $key + * @return bool */ public function isCached($key) { $key = $this->getCacheKey($key); @@ -113,6 +141,7 @@ abstract class Proxy { /** * @param string $key + * @param mixed $value */ public function writeToCache($key, $value) { $key = $this->getCacheKey($key); diff --git a/apps/user_ldap/lib/wizard.php b/apps/user_ldap/lib/wizard.php index 8406b2d42a594e72e8e4bf6e43f496491c585e27..b8a0e5ad799f2307c9c8a3c03272dece6e183990 100644 --- a/apps/user_ldap/lib/wizard.php +++ b/apps/user_ldap/lib/wizard.php @@ -44,9 +44,9 @@ class Wizard extends LDAPUtility { const LDAP_NW_TIMEOUT = 4; /** - * @brief Constructor - * @param $configuration an instance of Configuration - * @param $ldap an instance of ILDAPWrapper + * Constructor + * @param Configuration $configuration an instance of Configuration + * @param ILDAPWrapper $ldap an instance of ILDAPWrapper */ public function __construct(Configuration $configuration, ILDAPWrapper $ldap) { parent::__construct($ldap); @@ -63,6 +63,10 @@ class Wizard extends LDAPUtility { } } + /** + * @return WizardResult + * @throws \Exception + */ public function countGroups() { if(!$this->checkRequirements(array('ldapHost', 'ldapPort', @@ -96,6 +100,10 @@ class Wizard extends LDAPUtility { return $this->result; } + /** + * @return WizardResult + * @throws \Exception + */ public function countUsers() { if(!$this->checkRequirements(array('ldapHost', 'ldapPort', @@ -125,7 +133,10 @@ class Wizard extends LDAPUtility { return $this->result; } - + /** + * @return WizardResult + * @throws \Exception + */ public function determineAttributes() { if(!$this->checkRequirements(array('ldapHost', 'ldapPort', @@ -151,7 +162,8 @@ class Wizard extends LDAPUtility { } /** - * @brief return the state of the Group Filter Mode + * return the state of the Group Filter Mode + * @return WizardResult */ public function getGroupFilterMode() { $this->getFilterMode('ldapGroupFilterMode'); @@ -159,7 +171,8 @@ class Wizard extends LDAPUtility { } /** - * @brief return the state of the Login Filter Mode + * return the state of the Login Filter Mode + * @return WizardResult */ public function getLoginFilterMode() { $this->getFilterMode('ldapLoginFilterMode'); @@ -167,7 +180,8 @@ class Wizard extends LDAPUtility { } /** - * @brief return the state of the User Filter Mode + * return the state of the User Filter Mode + * @return WizardResult */ public function getUserFilterMode() { $this->getFilterMode('ldapUserFilterMode'); @@ -175,20 +189,21 @@ class Wizard extends LDAPUtility { } /** - * @brief return the state of the mode of the specified filter - * @param string $confkey string, contains the access key of the Configuration + * return the state of the mode of the specified filter + * @param string $confKey contains the access key of the Configuration */ - private function getFilterMode($confkey) { - $mode = $this->configuration->$confkey; + private function getFilterMode($confKey) { + $mode = $this->configuration->$confKey; if(is_null($mode)) { $mode = $this->LFILTER_MODE_ASSISTED; } - $this->result->addChange($confkey, $mode); + $this->result->addChange($confKey, $mode); } /** - * @brief detects the available LDAP attributes - * @returns the instance's WizardResult instance + * detects the available LDAP attributes + * @return array The instance's WizardResult instance + * @throws \Exception */ private function getUserAttributes() { if(!$this->checkRequirements(array('ldapHost', @@ -220,8 +235,8 @@ class Wizard extends LDAPUtility { } /** - * @brief detects the available LDAP groups - * @returns the instance's WizardResult instance + * detects the available LDAP groups + * @return WizardResult the instance's WizardResult instance */ public function determineGroupsForGroups() { return $this->determineGroups('ldap_groupfilter_groups', @@ -230,8 +245,8 @@ class Wizard extends LDAPUtility { } /** - * @brief detects the available LDAP groups - * @returns the instance's WizardResult instance + * detects the available LDAP groups + * @return WizardResult the instance's WizardResult instance */ public function determineGroupsForUsers() { return $this->determineGroups('ldap_userfilter_groups', @@ -239,12 +254,14 @@ class Wizard extends LDAPUtility { } /** - * @brief detects the available LDAP groups - * @param string $dbkey - * @param string $confkey - * @returns the instance's WizardResult instance + * detects the available LDAP groups + * @param string $dbKey + * @param string $confKey + * @param bool $testMemberOf + * @return WizardResult the instance's WizardResult instance + * @throws \Exception */ - private function determineGroups($dbkey, $confkey, $testMemberOf = true) { + private function determineGroups($dbKey, $confKey, $testMemberOf = true) { if(!$this->checkRequirements(array('ldapHost', 'ldapPort', 'ldapBase', @@ -256,8 +273,8 @@ class Wizard extends LDAPUtility { throw new \Exception('Could not connect to LDAP'); } - $obclasses = array('posixGroup', 'group', 'zimbraDistributionList', '*'); - $this->determineFeature($obclasses, 'cn', $dbkey, $confkey); + $obClasses = array('posixGroup', 'group', 'zimbraDistributionList', '*'); + $this->determineFeature($obClasses, 'cn', $dbKey, $confKey); if($testMemberOf) { $this->configuration->hasMemberOfFilterSupport = $this->testMemberOf(); @@ -270,6 +287,10 @@ class Wizard extends LDAPUtility { return $this->result; } + /** + * @return bool|WizardResult + * @throws \Exception + */ public function determineGroupMemberAssoc() { if(!$this->checkRequirements(array('ldapHost', 'ldapPort', @@ -289,8 +310,9 @@ class Wizard extends LDAPUtility { } /** - * @brief detects the available object classes - * @returns the instance's WizardResult instance + * Detects the available object classes + * @return WizardResult the instance's WizardResult instance + * @throws \Exception */ public function determineGroupObjectClasses() { if(!$this->checkRequirements(array('ldapHost', @@ -315,8 +337,9 @@ class Wizard extends LDAPUtility { } /** - * @brief detects the available object classes - * @returns the instance's WizardResult instance + * detects the available object classes + * @return WizardResult + * @throws \Exception */ public function determineUserObjectClasses() { if(!$this->checkRequirements(array('ldapHost', @@ -344,6 +367,10 @@ class Wizard extends LDAPUtility { return $this->result; } + /** + * @return WizardResult + * @throws \Exception + */ public function getGroupFilter() { if(!$this->checkRequirements(array('ldapHost', 'ldapPort', @@ -364,6 +391,10 @@ class Wizard extends LDAPUtility { return $this->result; } + /** + * @return WizardResult + * @throws \Exception + */ public function getUserListFilter() { if(!$this->checkRequirements(array('ldapHost', 'ldapPort', @@ -386,6 +417,10 @@ class Wizard extends LDAPUtility { return $this->result; } + /** + * @return bool|WizardResult + * @throws \Exception + */ public function getUserLoginFilter() { if(!$this->checkRequirements(array('ldapHost', 'ldapPort', @@ -406,7 +441,8 @@ class Wizard extends LDAPUtility { /** * Tries to determine the port, requires given Host, User DN and Password - * @returns mixed WizardResult on success, false otherwise + * @return WizardResult|false WizardResult on success, false otherwise + * @throws \Exception */ public function guessPortAndTLS() { if(!$this->checkRequirements(array('ldapHost', @@ -443,8 +479,8 @@ class Wizard extends LDAPUtility { } /** - * @brief tries to determine a base dn from User DN or LDAP Host - * @returns mixed WizardResult on success, false otherwise + * tries to determine a base dn from User DN or LDAP Host + * @return WizardResult|false WizardResult on success, false otherwise */ public function guessBaseDN() { if(!$this->checkRequirements(array('ldapHost', @@ -483,11 +519,10 @@ class Wizard extends LDAPUtility { } /** - * @brief sets the found value for the configuration key in the WizardResult + * sets the found value for the configuration key in the WizardResult * as well as in the Configuration instance * @param string $key the configuration key - * @param $value the (detected) value - * @return null + * @param string $value the (detected) value * */ private function applyFind($key, $value) { @@ -496,7 +531,7 @@ class Wizard extends LDAPUtility { } /** - * @brief Checks, whether a port was entered in the Host configuration + * Checks, whether a port was entered in the Host configuration * field. In this case the port will be stripped off, but also stored as * setting. */ @@ -514,9 +549,10 @@ class Wizard extends LDAPUtility { } /** - * @brief tries to detect the group member association attribute which is + * tries to detect the group member association attribute which is * one of 'uniqueMember', 'memberUid', 'member' - * @return mixed, string with the attribute name, false on error + * @return string|false, string with the attribute name, false on error + * @throws \Exception */ private function detectGroupMemberAssoc() { $possibleAttrs = array('uniqueMember', 'memberUid', 'member', 'unfugasdfasdfdfa'); @@ -535,7 +571,7 @@ class Wizard extends LDAPUtility { } $er = $this->ldap->firstEntry($cr, $rr); while(is_resource($er)) { - $dn = $this->ldap->getDN($cr, $er); + $this->ldap->getDN($cr, $er); $attrs = $this->ldap->getAttributes($cr, $er); $result = array(); for($i = 0; $i < count($possibleAttrs); $i++) { @@ -555,9 +591,10 @@ class Wizard extends LDAPUtility { } /** - * @brief Checks whether for a given BaseDN results will be returned + * Checks whether for a given BaseDN results will be returned * @param string $base the BaseDN to test * @return bool true on success, false otherwise + * @throws \Exception */ private function testBaseDN($base) { $cr = $this->getConnection(); @@ -580,10 +617,11 @@ class Wizard extends LDAPUtility { } /** - * @brief Checks whether the server supports memberOf in LDAP Filter. + * Checks whether the server supports memberOf in LDAP Filter. * Requires that groups are determined, thus internally called from within * determineGroups() - * @return bool, true if it does, false otherwise + * @return bool true if it does, false otherwise + * @throws \Exception */ private function testMemberOf() { $cr = $this->getConnection(); @@ -603,7 +641,7 @@ class Wizard extends LDAPUtility { //assuming only groups have their cn cached :) continue; } - $filter = strtolower($filterPrefix . $dn . $filterSuffix); + $filter = strtolower($filterPrefix . $dn . $filterSuffix); $rr = $this->ldap->search($cr, $base, $filter, array('dn')); if(!$this->ldap->isResource($rr)) { continue; @@ -620,11 +658,12 @@ class Wizard extends LDAPUtility { } /** - * @brief creates an LDAP Filter from given configuration + * creates an LDAP Filter from given configuration * @param integer $filterType int, for which use case the filter shall be created * can be any of self::LFILTER_USER_LIST, self::LFILTER_LOGIN or * self::LFILTER_GROUP_LIST - * @return mixed, string with the filter on success, false otherwise + * @return string|false string with the filter on success, false otherwise + * @throws \Exception */ private function composeLdapFilter($filterType) { $filter = ''; @@ -737,7 +776,7 @@ class Wizard extends LDAPUtility { if(is_array($attrsToFilter) && count($attrsToFilter) > 0) { $filterAttributes = '(|'; foreach($attrsToFilter as $attribute) { - $filterAttributes .= '(' . $attribute . $loginpart . ')'; + $filterAttributes .= '(' . $attribute . $loginpart . ')'; } $filterAttributes .= ')'; $parts++; @@ -765,9 +804,11 @@ class Wizard extends LDAPUtility { /** * Connects and Binds to an LDAP Server - * @param $port the port to connect with - * @param $tls whether startTLS is to be used - * @return + * @param int $port the port to connect with + * @param bool $tls whether startTLS is to be used + * @param bool $ncc + * @return bool + * @throws \Exception */ private function connectAndBind($port = 389, $tls = false, $ncc = false) { if($ncc) { @@ -819,27 +860,26 @@ class Wizard extends LDAPUtility { if($ncc) { throw new \Exception('Certificate cannot be validated.'); } - \OCP\Util::writeLog('user_ldap', 'Wiz: Bind successfull to Port '. $port . ' TLS ' . intval($tls), \OCP\Util::DEBUG); + \OCP\Util::writeLog('user_ldap', 'Wiz: Bind successful to Port '. $port . ' TLS ' . intval($tls), \OCP\Util::DEBUG); return true; } - $errno = $this->ldap->errno($cr); + $errNo = $this->ldap->errno($cr); $error = ldap_error($cr); $this->ldap->unbind($cr); - if($errno === -1 || ($errno === 2 && $ncc)) { + if($errNo === -1 || ($errNo === 2 && $ncc)) { //host, port or TLS wrong return false; - } else if ($errno === 2) { + } else if ($errNo === 2) { return $this->connectAndBind($port, $tls, true); } throw new \Exception($error); } /** - * @brief checks whether a valid combination of agent and password has been + * checks whether a valid combination of agent and password has been * provided (either two values or nothing for anonymous connect) - * @return boolean, true if everything is fine, false otherwise - * + * @return bool, true if everything is fine, false otherwise */ private function checkAgentRequirements() { $agent = $this->configuration->ldapAgentName; @@ -850,7 +890,8 @@ class Wizard extends LDAPUtility { } /** - * @param string[] $reqs + * @param array $reqs + * @return bool */ private function checkRequirements($reqs) { $this->checkAgentRequirements(); @@ -864,18 +905,17 @@ class Wizard extends LDAPUtility { } /** - * @brief does a cumulativeSearch on LDAP to get different values of a + * does a cumulativeSearch on LDAP to get different values of a * specified attribute * @param string[] $filters array, the filters that shall be used in the search * @param string $attr the attribute of which a list of values shall be returned - * @param $lfw bool, whether the last filter is a wildcard which shall not + * @param bool $lfw whether the last filter is a wildcard which shall not * be processed if there were already findings, defaults to true * @param int $dnReadLimit the amount of how many DNs should be analyzed. * The lower, the faster * @param string $maxF string. if not null, this variable will have the filter that * yields most result entries - * @return mixed, an array with the values on success, false otherwise - * + * @return array|false an array with the values on success, false otherwise */ public function cumulativeSearchOnAttribute($filters, $attr, $lfw = true, $dnReadLimit = 3, &$maxF = null) { $dnRead = array(); @@ -941,15 +981,16 @@ class Wizard extends LDAPUtility { } /** - * @brief determines if and which $attr are available on the LDAP server + * determines if and which $attr are available on the LDAP server * @param string[] $objectclasses the objectclasses to use as search filter * @param string $attr the attribute to look for * @param string $dbkey the dbkey of the setting the feature is connected to * @param string $confkey the confkey counterpart for the $dbkey as used in the * Configuration class - * @param $po boolean, whether the objectClass with most result entries + * @param bool $po whether the objectClass with most result entries * shall be pre-selected via the result - * @returns array, list of found items. + * @return array, list of found items. + * @throws \Exception */ private function determineFeature($objectclasses, $attr, $dbkey, $confkey, $po = false) { $cr = $this->getConnection(); @@ -999,10 +1040,10 @@ class Wizard extends LDAPUtility { } /** - * @brief appends a list of values fr - * @param $result resource, the return value from ldap_get_attributes + * appends a list of values fr + * @param resource $result the return value from ldap_get_attributes * @param string $attribute the attribute values to look for - * @param &$known array, new values will be appended here + * @param array &$known new values will be appended here * @return int, state on of the class constants LRESULT_PROCESSED_OK, * LRESULT_PROCESSED_INVALID or LRESULT_PROCESSED_SKIP */ @@ -1013,7 +1054,7 @@ class Wizard extends LDAPUtility { return self::LRESULT_PROCESSED_INVALID; } - //strtolower on all keys for proper comparison + // strtolower on all keys for proper comparison $result = \OCP\Util::mb_array_change_key_case($result); $attribute = strtolower($attribute); if(isset($result[$attribute])) { @@ -1031,6 +1072,9 @@ class Wizard extends LDAPUtility { } } + /** + * @return bool|mixed + */ private function getConnection() { if(!is_null($this->cr)) { return $this->cr; @@ -1057,6 +1101,9 @@ class Wizard extends LDAPUtility { return false; } + /** + * @return array + */ private function getDefaultLdapPortSettings() { static $settings = array( array('port' => 7636, 'tls' => false), @@ -1069,6 +1116,9 @@ class Wizard extends LDAPUtility { return $settings; } + /** + * @return array + */ private function getPortSettingsToTry() { //389 ← LDAP / Unencrypted or StartTLS //636 ← LDAPS / SSL @@ -1096,4 +1146,4 @@ class Wizard extends LDAPUtility { } -} \ No newline at end of file +} diff --git a/apps/user_ldap/lib/wizardresult.php b/apps/user_ldap/lib/wizardresult.php index 9e0936faa69d182e2d88d99119084c5b6ac88af7..42b0bc046549a7dfb7380af8decd5003632c291e 100644 --- a/apps/user_ldap/lib/wizardresult.php +++ b/apps/user_ldap/lib/wizardresult.php @@ -28,10 +28,17 @@ class WizardResult { protected $options = array(); protected $markedChange = false; + /** + * @param string $key + * @param mixed $value + */ public function addChange($key, $value) { $this->changes[$key] = $value; } + /** + * + */ public function markChange() { $this->markedChange = true; } @@ -47,10 +54,16 @@ class WizardResult { $this->options[$key] = $values; } + /** + * @return bool + */ public function hasChanges() { return (count($this->changes) > 0 || $this->markedChange); } + /** + * @return array + */ public function getResultArray() { $result = array(); $result['changes'] = $this->changes; @@ -59,4 +72,4 @@ class WizardResult { } return $result; } -} \ No newline at end of file +} diff --git a/apps/user_ldap/settings.php b/apps/user_ldap/settings.php index 6b7d8e6f53e5e4409225a8c155849980011a054f..7acc997e288e3668c49d2e7562f8734c0b1ee96e 100644 --- a/apps/user_ldap/settings.php +++ b/apps/user_ldap/settings.php @@ -71,7 +71,7 @@ $tmpl->assign('settingControls', $sControls); $config = new \OCA\user_ldap\lib\Configuration('', false); $defaults = $config->getDefaults(); foreach($defaults as $key => $default) { - $tmpl->assign($key.'_default', $default); + $tmpl->assign($key.'_default', $default); } return $tmpl->fetchPage(); diff --git a/apps/user_ldap/tests/user_ldap.php b/apps/user_ldap/tests/user_ldap.php index 8c8d85b3c334fc156e31873f15d0dd88eb0e6a33..2535c34bcf5fa2604ae555daf78ee61da5dbeefa 100644 --- a/apps/user_ldap/tests/user_ldap.php +++ b/apps/user_ldap/tests/user_ldap.php @@ -71,15 +71,15 @@ class Test_User_Ldap_Direct extends \PHPUnit_Framework_TestCase { case 'ladyofshadows': return 'dnOfLadyOfShadows'; break; - defautl: + default: return false; } })); } /** - * @brief Prepares the Access mock for checkPassword tests - * @param $access mock of \OCA\user_ldap\lib\Access + * Prepares the Access mock for checkPassword tests + * @param \OCA\user_ldap\lib\Access $access mock * @return void */ private function prepareAccessForCheckPassword(&$access) { @@ -186,8 +186,8 @@ class Test_User_Ldap_Direct extends \PHPUnit_Framework_TestCase { } /** - * @brief Prepares the Access mock for getUsers tests - * @param $access mock of \OCA\user_ldap\lib\Access + * Prepares the Access mock for getUsers tests + * @param \OCA\user_ldap\lib\Access $access mock * @return void */ private function prepareAccessForGetUsers(&$access) { @@ -557,4 +557,4 @@ class Test_User_Ldap_Direct extends \PHPUnit_Framework_TestCase { $result = $backend->countUsers(); $this->assertFalse($result); } -} \ No newline at end of file +} diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php index 757de6b60f4cedbd57162294f6ace9961c4b8d8c..aece2ee9aa2bfca9c33f9213a925f4f7a440a53c 100644 --- a/apps/user_ldap/user_ldap.php +++ b/apps/user_ldap/user_ldap.php @@ -69,9 +69,9 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { } /** - * @brief reads jpegPhoto and set is as avatar if available - * @param $uid string ownCloud user name - * @param $dn string the user's LDAP DN + * reads jpegPhoto and set is as avatar if available + * @param string $uid ownCloud user name + * @param string $dn the user's LDAP DN * @return void */ private function updateAvatar($uid, $dn) { @@ -117,8 +117,8 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { } /** - * @brief checks whether the user is allowed to change his avatar in ownCloud - * @param $uid string the ownCloud user name + * checks whether the user is allowed to change his avatar in ownCloud + * @param string $uid the ownCloud user name * @return boolean either the user can or cannot */ public function canChangeAvatar($uid) { @@ -135,9 +135,9 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { } /** - * @brief reads the image from LDAP that shall be used as Avatar - * @param $uid string, the ownCloud user name - * @param $dn string, the user DN + * reads the image from LDAP that shall be used as Avatar + * @param string $uid the ownCloud user name + * @param string $dn the user DN * @return string data (provided by LDAP) | false */ private function getAvatarImage($uid, $dn) { @@ -155,7 +155,7 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { } /** - * @brief Check if the password is correct + * Check if the password is correct * @param string $uid The username * @param string $password The password * @return boolean @@ -199,8 +199,8 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { } /** - * @brief Get a list of all users - * @returns array with all uids + * Get a list of all users + * @return string[] with all uids * * Get a list of all users. */ @@ -240,7 +240,7 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { } /** - * @brief check if a user exists + * check if a user exists * @param string $uid the username * @return boolean */ @@ -271,9 +271,9 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { } /** - * @brief delete a user - * @param $uid The username of the user to delete - * @returns true/false + * delete a user + * @param string $uid The username of the user to delete + * @return bool * * Deletes a user */ @@ -282,7 +282,7 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { } /** - * @brief get the user's home directory + * get the user's home directory * @param string $uid the username * @return boolean */ @@ -325,9 +325,9 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { } /** - * @brief get display name of the user - * @param $uid user ID of the user - * @return display name + * get display name of the user + * @param string $uid user ID of the user + * @return string display name */ public function getDisplayName($uid) { if(!$this->userExists($uid)) { @@ -352,8 +352,8 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { } /** - * @brief Get a list of all display names - * @returns array with all displayNames (value) and the correspondig uids (key) + * Get a list of all display names + * @return array with all displayNames (value) and the correspondig uids (key) * * Get a list of all display names and user ids. */ @@ -372,10 +372,10 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { return $displayNames; } - /** - * @brief Check if backend implements actions - * @param $actions bitwise-or'ed actions - * @returns boolean + /** + * Check if backend implements actions + * @param int $actions bitwise-or'ed actions + * @return boolean * * Returns the supported actions as int to be * compared with OC_USER_BACKEND_CREATE_USER etc. @@ -399,7 +399,7 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { /** * counts the users in LDAP * - * @return int | bool + * @return int|bool */ public function countUsers() { $filter = \OCP\Util::mb_str_replace( diff --git a/apps/user_ldap/user_proxy.php b/apps/user_ldap/user_proxy.php index 2cb3dfb2c60f60b5154406adb02f593cca32d1d1..fa4d69393038da73be5eb7ffb08b5059f5191947 100644 --- a/apps/user_ldap/user_proxy.php +++ b/apps/user_ldap/user_proxy.php @@ -30,13 +30,13 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { private $refBackend = null; /** - * @brief Constructor - * @param $serverConfigPrefixes array containing the config Prefixes + * Constructor + * @param array $serverConfigPrefixes array containing the config Prefixes */ public function __construct($serverConfigPrefixes, ILDAPWrapper $ldap) { parent::__construct($ldap); foreach($serverConfigPrefixes as $configPrefix) { - $this->backends[$configPrefix] = + $this->backends[$configPrefix] = new \OCA\user_ldap\USER_LDAP($this->getAccess($configPrefix)); if(is_null($this->refBackend)) { $this->refBackend = &$this->backends[$configPrefix]; @@ -45,13 +45,13 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { } /** - * @brief Tries the backends one after the other until a positive result is returned from the specified method - * @param $uid string, the uid connected to the request - * @param $method string, the method of the user backend that shall be called - * @param $parameters an array of parameters to be passed - * @return mixed, the result of the method or false + * Tries the backends one after the other until a positive result is returned from the specified method + * @param string $uid the uid connected to the request + * @param string $method the method of the user backend that shall be called + * @param array $parameters an array of parameters to be passed + * @return mixed the result of the method or false */ - protected function walkBackends($uid, $method, $parameters) { + protected function walkBackends($uid, $method, $parameters) { $cacheKey = $this->getUserCacheKey($uid); foreach($this->backends as $configPrefix => $backend) { $instance = $backend; @@ -68,14 +68,14 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { } /** - * @brief Asks the backend connected to the server that supposely takes care of the uid from the request. - * @param $uid string, the uid connected to the request - * @param $method string, the method of the user backend that shall be called - * @param $parameters an array of parameters to be passed - * @param $passOnWhen the result matches this variable - * @return mixed, the result of the method or false + * Asks the backend connected to the server that supposely takes care of the uid from the request. + * @param string $uid the uid connected to the request + * @param string $method the method of the user backend that shall be called + * @param array $parameters an array of parameters to be passed + * @param mixed $passOnWhen the result matches this variable + * @return mixed the result of the method or false */ - protected function callOnLastSeenOn($uid, $method, $parameters, $passOnWhen) { + protected function callOnLastSeenOn($uid, $method, $parameters, $passOnWhen) { $cacheKey = $this->getUserCacheKey($uid); $prefix = $this->getFromCache($cacheKey); //in case the uid has been found in the past, try this stored connection first @@ -105,9 +105,9 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { } /** - * @brief Check if backend implements actions - * @param $actions bitwise-or'ed actions - * @returns boolean + * Check if backend implements actions + * @param int $actions bitwise-or'ed actions + * @return boolean * * Returns the supported actions as int to be * compared with OC_USER_BACKEND_CREATE_USER etc. @@ -118,8 +118,8 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { } /** - * @brief Get a list of all users - * @returns array with all uids + * Get a list of all users + * @return string[] with all uids * * Get a list of all users. */ @@ -136,7 +136,7 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { } /** - * @brief check if a user exists + * check if a user exists * @param string $uid the username * @return boolean */ @@ -145,10 +145,10 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { } /** - * @brief Check if the password is correct - * @param $uid The username - * @param $password The password - * @returns true/false + * Check if the password is correct + * @param string $uid The username + * @param string $password The password + * @return bool * * Check if the password is correct without logging in the user */ @@ -157,7 +157,7 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { } /** - * @brief get the user's home directory + * get the user's home directory * @param string $uid the username * @return boolean */ @@ -166,17 +166,17 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { } /** - * @brief get display name of the user - * @param $uid user ID of the user - * @return display name + * get display name of the user + * @param string $uid user ID of the user + * @return string display name */ public function getDisplayName($uid) { return $this->handleRequest($uid, 'getDisplayName', array($uid)); } /** - * @brief checks whether the user is allowed to change his avatar in ownCloud - * @param $uid string the ownCloud user name + * checks whether the user is allowed to change his avatar in ownCloud + * @param string $uid the ownCloud user name * @return boolean either the user can or cannot */ public function canChangeAvatar($uid) { @@ -184,8 +184,8 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { } /** - * @brief Get a list of all display names - * @returns array with all displayNames (value) and the corresponding uids (key) + * Get a list of all display names + * @return array with all displayNames (value) and the corresponding uids (key) * * Get a list of all display names and user ids. */ @@ -202,9 +202,9 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { } /** - * @brief delete a user - * @param $uid The username of the user to delete - * @returns true/false + * delete a user + * @param string $uid The username of the user to delete + * @return bool * * Deletes a user */ @@ -220,8 +220,8 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { } /** - * @brief Count the number of users - * @returns int | bool + * Count the number of users + * @return int|bool */ public function countUsers() { $users = false; diff --git a/apps/user_webdavauth/l10n/ro.php b/apps/user_webdavauth/l10n/ro.php index 5780805a884d086ff57329daa9245751679508be..24e3c9f917c1542585dde53f42df9ac21dc1d2e4 100644 --- a/apps/user_webdavauth/l10n/ro.php +++ b/apps/user_webdavauth/l10n/ro.php @@ -1,5 +1,6 @@ "Autentificare WebDAV" +"WebDAV Authentication" => "Autentificare WebDAV", +"Address: " => "Adresa :" ); $PLURAL_FORMS = "nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));"; diff --git a/build/build.xml b/build/build.xml index 0f9d3605da1fff084a3da8b87de2331c9b58a73d..265beb4bccfbac929e1ff778a32bd4aa3c18a1fd 100644 --- a/build/build.xml +++ b/build/build.xml @@ -40,6 +40,26 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/config/config.sample.php b/config/config.sample.php index adcc175e2fae886746d80100523c33db232d115f..708e8367023011dfef041e976424e5822bfdf58a 100755 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -54,7 +54,7 @@ $CONFIG = array( "proxyuserpwd" => "", /* List of trusted domains, to prevent host header poisoning ownCloud is only using these Host headers */ -'trusted_domains' => array('demo.owncloud.org'), +'trusted_domains' => array('demo.owncloud.org', 'otherdomain.owncloud.org:8080'), /* Theme to use for ownCloud */ "theme" => "", @@ -142,7 +142,7 @@ $CONFIG = array( 'allow_user_to_change_display_name' => true, /* Check 3rdparty apps for malicious code fragments */ -"appcodechecker" => "", +"appcodechecker" => true, /* Check if ownCloud is up to date */ "updatechecker" => true, @@ -181,9 +181,6 @@ $CONFIG = array( /* Whether ownCloud should log the last successfull cron exec */ "cron_log" => true, -/* Whether http-basic username must equal username to login */ -"basic_auth" => true, - /* * 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 diff --git a/core/ajax/preview.php b/core/ajax/preview.php index 526719e8a1b067e0f15cf50b1b75f06c063d200a..d38043707ac7086c4673946223f58300c1aa5705 100644 --- a/core/ajax/preview.php +++ b/core/ajax/preview.php @@ -11,6 +11,7 @@ $file = array_key_exists('file', $_GET) ? (string)$_GET['file'] : ''; $maxX = array_key_exists('x', $_GET) ? (int)$_GET['x'] : '36'; $maxY = array_key_exists('y', $_GET) ? (int)$_GET['y'] : '36'; $scalingUp = array_key_exists('scalingup', $_GET) ? (bool)$_GET['scalingup'] : true; +$keepAspect = array_key_exists('a', $_GET) ? true : false; $always = array_key_exists('forceIcon', $_GET) ? (bool)$_GET['forceIcon'] : true; if ($file === '') { @@ -20,6 +21,10 @@ if ($file === '') { exit; } +if ($keepAspect === true) { + $maxY = $maxX; +} + if ($maxX === 0 || $maxY === 0) { //400 Bad Request \OC_Response::setStatus(400); @@ -36,9 +41,10 @@ try { $preview->setMaxX($maxX); $preview->setMaxY($maxY); $preview->setScalingUp($scalingUp); + $preview->setKeepAspect($keepAspect); } - $preview->show(); + $preview->showPreview(); } catch (\Exception $e) { \OC_Response::setStatus(500); \OC_Log::write('core', $e->getmessage(), \OC_Log::DEBUG); diff --git a/core/ajax/share.php b/core/ajax/share.php index 2b41bd8a5da17fb8693f50c658d3e6dd77db546b..75b749a5b0718bac6218ba53dd56eafa22e90e30 100644 --- a/core/ajax/share.php +++ b/core/ajax/share.php @@ -41,7 +41,8 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo $shareType, $shareWith, $_POST['permissions'], - $_POST['itemSourceName'] + $_POST['itemSourceName'], + (!empty($_POST['expirationDate']) ? new \DateTime($_POST['expirationDate']) : null) ); if (is_string($token)) { diff --git a/core/avatar/controller.php b/core/avatar/controller.php index 22693824461d70fe87d8c1c0ee13db9bbce0621e..06efbec3f3ca2e658cf287d7a44fcd98a63e5aa1 100644 --- a/core/avatar/controller.php +++ b/core/avatar/controller.php @@ -71,7 +71,7 @@ class Controller { $image = new \OC_Image($newAvatar); if ($image->valid()) { - \OC_Cache::set('tmpavatar', $image->data(), 7200); + \OC\Cache::set('tmpavatar', $image->data(), 7200); \OC_JSON::error(array("data" => "notsquare")); } else { $l = new \OC_L10n('core'); @@ -109,7 +109,7 @@ class Controller { \OC_JSON::checkLoggedIn(); \OC_JSON::callCheck(); - $tmpavatar = \OC_Cache::get('tmpavatar'); + $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")) )); @@ -136,7 +136,7 @@ class Controller { return; } - $tmpavatar = \OC_Cache::get('tmpavatar'); + $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")) )); @@ -149,7 +149,7 @@ class Controller { $avatar = new \OC_Avatar($user); $avatar->set($image->data()); // Clean up - \OC_Cache::remove('tmpavatar'); + \OC\Cache::remove('tmpavatar'); \OC_JSON::success(); } catch (\Exception $e) { \OC_JSON::error(array("data" => array("message" => $e->getMessage()) )); diff --git a/core/command/db/converttype.php b/core/command/db/converttype.php new file mode 100644 index 0000000000000000000000000000000000000000..39e87853d607dc37a5e4eb3b754f85bdeb995fb6 --- /dev/null +++ b/core/command/db/converttype.php @@ -0,0 +1,295 @@ + + * Copyright (c) 2014 Andreas Fischer + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + * + */ + +namespace OC\Core\Command\Db; + +use OC\Config; +use OC\DB\Connection; +use OC\DB\ConnectionFactory; + +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 ConvertType extends Command { + /** + * @var \OC\Config + */ + protected $config; + + /** + * @var \OC\DB\ConnectionFactory + */ + protected $connectionFactory; + + /** + * @param \OC\Config $config + * @param \OC\DB\ConnectionFactory $connectionFactory + */ + public function __construct(Config $config, ConnectionFactory $connectionFactory) { + $this->config = $config; + $this->connectionFactory = $connectionFactory; + parent::__construct(); + } + + protected function configure() { + $this + ->setName('db:convert-type') + ->setDescription('Convert the ownCloud database to the newly configured one') + ->addArgument( + 'type', + InputArgument::REQUIRED, + 'the type of the database to convert to' + ) + ->addArgument( + 'username', + InputArgument::REQUIRED, + 'the username of the database to convert to' + ) + ->addArgument( + 'hostname', + InputArgument::REQUIRED, + 'the hostname of the database to convert to' + ) + ->addArgument( + 'database', + InputArgument::REQUIRED, + 'the name of the database to convert to' + ) + ->addOption( + 'port', + null, + InputOption::VALUE_REQUIRED, + 'the port of the database to convert to' + ) + ->addOption( + 'password', + null, + InputOption::VALUE_REQUIRED, + 'the password of the database to convert to. Will be asked when not specified. Can also be passed via stdin.' + ) + ->addOption( + 'clear-schema', + null, + InputOption::VALUE_NONE, + 'remove all tables from the destination database' + ) + ->addOption( + 'all-apps', + null, + InputOption::VALUE_NONE, + 'whether to create schema for all apps instead of only installed apps' + ) + ; + } + + protected function validateInput(InputInterface $input, OutputInterface $output) { + $type = $this->connectionFactory->normalizeType($input->getArgument('type')); + if ($type === 'sqlite3') { + throw new \InvalidArgumentException( + 'Converting to SQLite (sqlite3) is currently not supported.' + ); + } + if ($type === 'mssql') { + throw new \InvalidArgumentException( + 'Converting to Microsoft SQL Server (mssql) is currently not supported.' + ); + } + if ($type === $this->config->getValue('dbtype', '')) { + throw new \InvalidArgumentException(sprintf( + 'Can not convert from %1$s to %1$s.', + $type + )); + } + if ($type === 'oci' && $input->getOption('clear-schema')) { + // Doctrine unconditionally tries (at least in version 2.3) + // to drop sequence triggers when dropping a table, even though + // such triggers may not exist. This results in errors like + // "ORA-04080: trigger 'OC_STORAGES_AI_PK' does not exist". + throw new \InvalidArgumentException( + 'The --clear-schema option is not supported when converting to Oracle (oci).' + ); + } + } + + protected function readPassword(InputInterface $input, OutputInterface $output) { + // Explicitly specified password + if ($input->getOption('password')) { + return; + } + + // Read from stdin. stream_set_blocking is used to prevent blocking + // when nothing is passed via stdin. + stream_set_blocking(STDIN, 0); + $password = file_get_contents('php://stdin'); + stream_set_blocking(STDIN, 1); + if (trim($password) !== '') { + $input->setOption('password', $password); + return; + } + + // Read password by interacting + if ($input->isInteractive()) { + /** @var $dialog \Symfony\Component\Console\Helper\DialogHelper */ + $dialog = $this->getHelperSet()->get('dialog'); + $password = $dialog->askHiddenResponse( + $output, + 'What is the database password?', + false + ); + $input->setOption('password', $password); + return; + } + } + + protected function execute(InputInterface $input, OutputInterface $output) { + $this->validateInput($input, $output); + $this->readPassword($input, $output); + + $fromDB = \OC_DB::getConnection(); + $toDB = $this->getToDBConnection($input, $output); + + if ($input->getOption('clear-schema')) { + $this->clearSchema($toDB, $input, $output); + } + + $this->createSchema($toDB, $input, $output); + + $toTables = $this->getTables($toDB); + $fromTables = $this->getTables($fromDB); + + // warn/fail if there are more tables in 'from' database + $extraFromTables = array_diff($fromTables, $toTables); + if (!empty($extraFromTables)) { + $output->writeln('The following tables will not be converted:'); + $output->writeln($extraFromTables); + if (!$input->getOption('all-apps')) { + $output->writeln('Please note that tables belonging to available but currently not installed apps'); + $output->writeln('can be included by specifying the --all-apps option.'); + } + /** @var $dialog \Symfony\Component\Console\Helper\DialogHelper */ + $dialog = $this->getHelperSet()->get('dialog'); + if (!$dialog->askConfirmation( + $output, + 'Continue with the conversion?', + false + )) { + return; + } + } + $intersectingTables = array_intersect($toTables, $fromTables); + $this->convertDB($fromDB, $toDB, $intersectingTables, $input, $output); + } + + protected function createSchema(Connection $toDB, InputInterface $input, OutputInterface $output) { + $output->writeln('Creating schema in new database'); + $schemaManager = new \OC\DB\MDB2SchemaManager($toDB); + $schemaManager->createDbFromStructure(\OC::$SERVERROOT.'/db_structure.xml'); + $apps = $input->getOption('all-apps') ? \OC_App::getAllApps() : \OC_App::getEnabledApps(); + foreach($apps as $app) { + if (file_exists(\OC_App::getAppPath($app).'/appinfo/database.xml')) { + $schemaManager->createDbFromStructure(\OC_App::getAppPath($app).'/appinfo/database.xml'); + } + } + } + + protected function getToDBConnection(InputInterface $input, OutputInterface $output) { + $type = $input->getArgument('type'); + $connectionParams = array( + 'host' => $input->getArgument('hostname'), + 'user' => $input->getArgument('username'), + 'password' => $input->getOption('password'), + 'dbname' => $input->getArgument('database'), + 'tablePrefix' => $this->config->getValue('dbtableprefix', 'oc_'), + ); + if ($input->getOption('port')) { + $connectionParams['port'] = $input->getOption('port'); + } + return $this->connectionFactory->getConnection($type, $connectionParams); + } + + protected function clearSchema(Connection $db, InputInterface $input, OutputInterface $output) { + $toTables = $this->getTables($db); + if (!empty($toTables)) { + $output->writeln('Clearing schema in new database'); + } + foreach($toTables as $table) { + $db->getSchemaManager()->dropTable($table); + } + } + + protected function getTables(Connection $db) { + return $db->getSchemaManager()->listTableNames(); + } + + protected function copyTable(Connection $fromDB, Connection $toDB, $table, InputInterface $input, OutputInterface $output) { + /** @var $progress \Symfony\Component\Console\Helper\ProgressHelper */ + $progress = $this->getHelperSet()->get('progress'); + $query = 'SELECT COUNT(*) FROM '.$table; + $count = $fromDB->fetchColumn($query); + $query = 'SELECT * FROM '.$table; + $statement = $fromDB->executeQuery($query); + $progress->start($output, $count); + $progress->setRedrawFrequency($count > 100 ? 5 : 1); + while($row = $statement->fetch()) { + $progress->advance(); + if ($input->getArgument('type') === 'oci') { + $data = $row; + } else { + $data = array(); + foreach ($row as $columnName => $value) { + $data[$toDB->quoteIdentifier($columnName)] = $value; + } + } + $toDB->insert($table, $data); + } + $progress->finish(); + } + + protected function convertDB(Connection $fromDB, Connection $toDB, array $tables, InputInterface $input, OutputInterface $output) { + $this->config->setValue('maintenance', true); + try { + // copy table rows + foreach($tables as $table) { + $output->writeln($table); + $this->copyTable($fromDB, $toDB, $table, $input, $output); + } + if ($input->getArgument('type') === 'pgsql') { + $tools = new \OC\DB\PgSqlTools; + $tools->resynchronizeDatabaseSequences($toDB); + } + // save new database config + $this->saveDBInfo($input); + } catch(\Exception $e) { + $this->config->setValue('maintenance', false); + throw $e; + } + $this->config->setValue('maintenance', false); + } + + protected function saveDBInfo(InputInterface $input) { + $type = $input->getArgument('type'); + $username = $input->getArgument('username'); + $dbhost = $input->getArgument('hostname'); + $dbname = $input->getArgument('database'); + $password = $input->getOption('password'); + if ($input->getOption('port')) { + $dbhost .= ':'.$input->getOption('port'); + } + + $this->config->setValue('dbtype', $type); + $this->config->setValue('dbname', $dbname); + $this->config->setValue('dbhost', $dbhost); + $this->config->setValue('dbuser', $username); + $this->config->setValue('dbpassword', $password); + } +} diff --git a/core/css/apps.css b/core/css/apps.css index a8dfc5b7ed12881a795c1a1e144cb715cb66e5dc..377878467c0be2f8c84abe06d8f108bfb83e8162 100644 --- a/core/css/apps.css +++ b/core/css/apps.css @@ -178,6 +178,9 @@ bottom: 0; border-top: 1px solid #ccc; } +#app-settings.opened #app-settings-content { + display: block; +} #app-settings-header { background-color: #eee; } @@ -243,7 +246,6 @@ button.loading { padding-right: 30px; } - /* general styles for the content area */ .section { display: block; @@ -264,3 +266,14 @@ button.loading { vertical-align: -2px; margin-right: 4px; } +.appear { + opacity: 1; + transition: opacity 500ms ease 0s; + -moz-transition: opacity 500ms ease 0s; + -ms-transition: opacity 500ms ease 0s; + -o-transition: opacity 500ms ease 0s; + -webkit-transition: opacity 500ms ease 0s; +} +.appear.transparent { + opacity: 0; +} diff --git a/core/css/fixes.css b/core/css/fixes.css index a33afd5cf77f945c9c007057d99ee097e6cba78e..156359507463e5059fd16681e28cc727521dfb23 100644 --- a/core/css/fixes.css +++ b/core/css/fixes.css @@ -10,6 +10,21 @@ background-image: url('../img/actions/delete-hover.png'); } +.lte9 .icon-triangle-e { + background-image: url('../img/actions/triangle-e.png'); +} +.lte9 .icon-triangle-n { + background-image: url('../img/actions/triangle-n.png'); +} +.lte9 .icon-triangle-s { + background-image: url('../img/actions/triangle-s.png'); +} +.lte9 .icon-settings, +.lte9 .settings-button { + background-image: url('../img/actions/settings.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 */ diff --git a/core/css/mobile.css b/core/css/mobile.css index fd0628d7e28150169d8b6211cb9dd8b84a088739..018526130622419bdc67792ea88fc95c665d76b2 100644 --- a/core/css/mobile.css +++ b/core/css/mobile.css @@ -1,5 +1,26 @@ @media only screen and (max-width: 768px) { +#body-login #header { + padding-top: 10px; +} + +#body-login .wrapper { + display: -webkit-box; + -webkit-box-orient: horizontal; + -webkit-box-pack: center; + -webkit-box-align: center; + + display: -moz-box; + -moz-box-orient: horizontal; + -moz-box-pack: center; + -moz-box-align: center; + + display: box; + box-orient: horizontal; + box-pack: center; + box-align: center; +} + /* show caret indicator next to logo to make clear it is tappable */ #owncloud.menutoggle { background-image: url('../img/actions/caret.svg'); diff --git a/core/css/multiselect.css b/core/css/multiselect.css index 8d949e7cdb7fd4b6e17fa22c09714921df80234a..b3393c450d481ad0af261897d0d692f42cd92485 100644 --- a/core/css/multiselect.css +++ b/core/css/multiselect.css @@ -50,7 +50,7 @@ ul.multiselectoptions > li input[type='checkbox']:checked+label { div.multiselect, select.multiselect { display: inline-block; - max-width: 400px; + max-width: 200px; min-width: 150px; padding-right: 10px; min-height: 20px; diff --git a/core/css/share.css b/core/css/share.css index 4ae3b77757e68fdd5ccfd6bee88728cb54760f7e..1527a3a0c0fdf07def2bb9295bac976e05ea506d 100644 --- a/core/css/share.css +++ b/core/css/share.css @@ -11,7 +11,7 @@ margin-right:112px; position:absolute; right:0; - width:320px; + width:420px; z-index:500; padding:16px; } diff --git a/core/css/styles.css b/core/css/styles.css index c26c556825ad36b3a9669492ed1effc38e20b2ec..d21e6bc69073bdcbe5365c08745f94ac4c1abcaa 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -62,22 +62,12 @@ body { .header-right { position: absolute; right: 0; - padding-right: 10px; + padding: 7px 5px; color: #fff; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; - filter: alpha(opacity=50); - opacity: .5; height: 100%; max-width: 40%; white-space: nowrap; } -.header-right #details { - display: inline-block; - margin-top: 6px; - width: 100%; - text-overflow: ellipsis; - overflow: hidden; -} /* Profile picture in header */ #header .avatardiv { @@ -202,6 +192,12 @@ input[type="time"] { height: 31px; -moz-box-sizing: border-box; box-sizing: border-box; } + +/* correctly align images inside of buttons */ +input img, button img, .button img { + vertical-align: text-bottom; +} + #quota { cursor: default; margin: 30px; @@ -338,21 +334,6 @@ input[type="submit"].enabled { position:absolute; height:100%; width:100%; padding-left:80px; padding-top: 45px; -moz-box-sizing:border-box; box-sizing:border-box; } -#leftcontent, .leftcontent { - position:relative; overflow:auto; width:256px; height:100%; - background:#f8f8f8; border-right:1px solid #ddd; - -moz-box-sizing:border-box; box-sizing:border-box; -} -#leftcontent li, .leftcontent li { background:#f8f8f8; padding:.5em .8em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; -webkit-transition:background-color 200ms; -moz-transition:background-color 200ms; -o-transition:background-color 200ms; transition:background-color 200ms; } -#leftcontent li:hover, #leftcontent li:active, #leftcontent li.active, .leftcontent li:hover, .leftcontent li:active, .leftcontent li.active { background:#eee; } -#leftcontent li.active, .leftcontent li.active { font-weight:bold; } -#leftcontent li:hover, .leftcontent li:hover { color:#333; background:#ddd; } -#leftcontent a { height:100%; display:block; margin:0; padding:0 1em 0 0; float:left; } -#rightcontent, .rightcontent { position:fixed; top:89px; left: 336px; overflow:auto } - -#controls + .leftcontent{ - top: 44px; -} #emptycontent { font-size: 1.5em; @@ -371,9 +352,9 @@ input[type="submit"].enabled { #body-login #header { padding-top: 100px; } -/* Fix background gradient */ #body-login { - background-attachment: fixed; + background-attachment: fixed; /* fix background gradient */ + height: 100%; /* fix sticky footer */ } /* Dark subtle label text */ @@ -538,8 +519,6 @@ label.infield { cursor:text !important; top:1.05em; left:.85em; } } #body-login #showAdvanced > img { - height: 16px; - width: 16px; padding: 4px; box-sizing: border-box; } diff --git a/core/img/places/folder.svg b/core/img/places/folder.svg index edc9e7e208a10d0a8266cadf5a14eccc9aa4dec5..7ac5d6ddf5dcc571cb42d8384b9a07cc73dac350 100644 --- a/core/img/places/folder.svg +++ b/core/img/places/folder.svg @@ -1,18 +1,17 @@ - + - + - - + - + diff --git a/core/js/config.php b/core/js/config.php index 7e23f3e2e41bf686aa94c174047bff2b6424786f..33665b8401c8988fedee483dffbf499f5cae55bf 100644 --- a/core/js/config.php +++ b/core/js/config.php @@ -25,6 +25,13 @@ foreach(OC_App::getEnabledApps() as $app) { $apps_paths[$app] = OC_App::getAppWebPath($app); } +$defaultExpireDateEnabled = \OCP\Config::getAppValue('core', 'shareapi_default_expire_date', 'no'); +$defaultExpireDate = $enforceDefaultExpireDate = null; +if ($defaultExpireDateEnabled === 'yes') { + $defaultExpireDate = \OCP\Config::getAppValue('core', 'shareapi_expire_after_n_days', '7'); + $enforceDefaultExpireDate = \OCP\Config::getAppValue('core', 'shareapi_enforce_expire_date', 'no'); +} + $array = array( "oc_debug" => (defined('DEBUG') && DEBUG) ? 'true' : 'false', "oc_isadmin" => OC_User::isAdminUser(OC_User::getUser()) ? 'true' : 'false', @@ -67,6 +74,15 @@ $array = array( 'versionstring' => OC_Util::getVersionString(), ) ), + "oc_appconfig" => json_encode( + array("core" => array( + 'defaultExpireDateEnabled' => $defaultExpireDateEnabled, + 'defaultExpireDate' => $defaultExpireDate, + 'defaultExpireDateEnforced' => $enforceDefaultExpireDate, + 'enforcePasswordForPublicLink' => \OCP\Util::isPublicLinkPasswordRequired(), + ) + ) + ), "oc_defaults" => json_encode( array( 'entity' => $defaults->getEntity(), diff --git a/core/js/core.json b/core/js/core.json index 05c2a17a679839dbb7e57fb7de2c322c18ef56de..f1e0ba883d0f0d9378cabacab46303c2307edaa1 100644 --- a/core/js/core.json +++ b/core/js/core.json @@ -14,6 +14,7 @@ "jquery.ocdialog.js", "oc-dialogs.js", "js.js", + "share.js", "octemplate.js", "eventsource.js", "config.js", diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js index 02cd6ac146635895de58127b0f38a03b0d1a88eb..e2433f5f9804a41518f621379456ff346606df8f 100644 --- a/core/js/jquery.ocdialog.js +++ b/core/js/jquery.ocdialog.js @@ -67,8 +67,8 @@ self.parent = self.$dialog.parent().length > 0 ? self.$dialog.parent() : $('body'); var pos = self.parent.position(); self.$dialog.css({ - left: pos.left + (self.parent.width() - self.$dialog.outerWidth())/2, - top: pos.top + (self.parent.height() - self.$dialog.outerHeight())/2 + left: pos.left + ($(window).innerWidth() - self.$dialog.outerWidth())/2, + top: pos.top + ($(window).innerHeight() - self.$dialog.outerHeight())/2 }); }); @@ -160,10 +160,16 @@ } this.parent = this.$dialog.parent().length > 0 ? this.$dialog.parent() : $('body'); content_height = Math.min(content_height, this.parent.height()-20); - this.element.css({ - height: content_height + 'px', - width: this.$dialog.innerWidth()-20 + 'px' - }); + if (content_height> 0) { + this.element.css({ + height: content_height + 'px', + width: this.$dialog.innerWidth()-20 + 'px' + }); + } else { + this.element.css({ + width : this.$dialog.innerWidth() - 20 + 'px' + }); + } }, _createOverlay: function() { if(!this.options.modal) { diff --git a/core/js/js.js b/core/js/js.js index 0aa8d12b3d67bf90e4408e2f47ca1356ca3363a6..38b97590430d26fe27154693387a9164738e40f7 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -1250,9 +1250,12 @@ function relative_modified_date(timestamp) { } /** - * @todo Write documentation + * Utility functions */ OC.Util = { + // TODO: remove original functions from global namespace + humanFileSize: humanFileSize, + formatDate: formatDate, /** * Returns whether the browser supports SVG * @return {boolean} true if the browser supports SVG, false otherwise @@ -1315,6 +1318,114 @@ OC.Util = { } }; +/** + * Utility class for the history API, + * includes fallback to using the URL hash when + * the browser doesn't support the history API. + */ +OC.Util.History = { + _handlers: [], + + /** + * Push the current URL parameters to the history stack + * and change the visible URL. + * Note: this includes a workaround for IE8/IE9 that uses + * the hash part instead of the search part. + * + * @param params to append to the URL, can be either a string + * or a map + */ + pushState: function(params) { + var strParams; + if (typeof(params) === 'string') { + strParams = params; + } + else { + strParams = OC.buildQueryString(params); + } + if (window.history.pushState) { + var url = location.pathname + '?' + strParams; + window.history.pushState(params, '', url); + } + // use URL hash for IE8 + else { + window.location.hash = '?' + strParams; + // inhibit next onhashchange that just added itself + // to the event queue + this._cancelPop = true; + } + }, + + /** + * Add a popstate handler + * + * @param handler function + */ + addOnPopStateHandler: function(handler) { + this._handlers.push(handler); + }, + + /** + * Parse a query string from the hash part of the URL. + * (workaround for IE8 / IE9) + */ + _parseHashQuery: function() { + var hash = window.location.hash, + pos = hash.indexOf('?'); + if (pos >= 0) { + return hash.substr(pos + 1); + } + return ''; + }, + + _decodeQuery: function(query) { + return query.replace(/\+/g, ' '); + }, + + /** + * Parse the query/search part of the URL. + * Also try and parse it from the URL hash (for IE8) + * + * @return map of parameters + */ + parseUrlQuery: function() { + var query = this._parseHashQuery(), + params; + // try and parse from URL hash first + if (query) { + params = OC.parseQueryString(this._decodeQuery(query)); + } + // else read from query attributes + if (!params) { + params = OC.parseQueryString(this._decodeQuery(location.search)); + } + return params || {}; + }, + + _onPopState: function(e) { + if (this._cancelPop) { + this._cancelPop = false; + return; + } + var params; + if (!this._handlers.length) { + return; + } + params = (e && e.state) || this.parseUrlQuery() || {}; + for (var i = 0; i < this._handlers.length; i++) { + this._handlers[i](params); + } + } +}; + +// fallback to hashchange when no history support +if (window.history.pushState) { + window.onpopstate = _.bind(OC.Util.History._onPopState, OC.Util.History); +} +else { + $(window).on('hashchange', _.bind(OC.Util.History._onPopState, OC.Util.History)); +} + /** * Get a variable by name * @param {string} name @@ -1364,6 +1475,11 @@ OC.set=function(name, value) { } })(); +/** + * Namespace for apps + */ +window.OCA = {}; + /** * select a range in an input field * @link http://stackoverflow.com/questions/499126/jquery-set-cursor-position-in-text-area diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index 11833f12e2d108118533aa5fbf88c6edfda475a2..f6c17122d7dbdd9d94f8ba6d9dfc66663150e96a 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -19,7 +19,7 @@ * */ -/* global OC, t, alert */ +/* global OC, t, alert, $ */ /** * this class to ease the usage of jquery dialogs @@ -61,6 +61,65 @@ var OCdialogs = { confirm:function(text, title, callback, modal) { this.message(text, title, 'notice', OCdialogs.YES_NO_BUTTONS, callback, modal); }, + /** + * displays prompt dialog + * @param text content of dialog + * @param title dialog title + * @param callback which will be triggered when user presses YES or NO + * (true or false would be passed to callback respectively) + * @param modal make the dialog modal + * @param name name of the input field + * @param password whether the input should be a password input + */ + prompt: function (text, title, callback, modal, name, password) { + $.when(this._getMessageTemplate()).then(function ($tmpl) { + var dialogName = 'oc-dialog-' + OCdialogs.dialogsCounter + '-content'; + var dialogId = '#' + dialogName; + var $dlg = $tmpl.octemplate({ + dialog_name: dialogName, + title : title, + message : text, + type : 'notice' + }); + var input = $(''); + input.attr('type', password ? 'password' : 'text').attr('id', dialogName + '-input'); + var label = $('').attr('for', dialogName + '-input').text(name + ': '); + $dlg.append(label); + $dlg.append(input); + if (modal === undefined) { + modal = false; + } + $('body').append($dlg); + var buttonlist = [ + { + text : t('core', 'Yes'), + click : function () { + if (callback !== undefined) { + callback(true, input.val()); + } + $(dialogId).ocdialog('close'); + }, + defaultButton: true + }, + { + text : t('core', 'No'), + click: function () { + if (callback !== undefined) { + callback(false, input.val()); + } + $(dialogId).ocdialog('close'); + } + } + ]; + + $(dialogId).ocdialog({ + closeOnEscape: true, + modal : modal, + buttons : buttonlist + }); + OCdialogs.dialogsCounter++; + }); + }, /** * show a file picker to pick a file from * @param title dialog title diff --git a/core/js/share.js b/core/js/share.js index 2813570f718d91bbce3a8bcc9def35fd18d4ffe6..583f92dd39d024fedb1ef0d890dc5ac076223e51 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -136,7 +136,21 @@ OC.Share={ return data; }, - share:function(itemType, itemSource, shareType, shareWith, permissions, itemSourceName, callback) { + share:function(itemType, itemSource, shareType, shareWith, permissions, itemSourceName, expirationDate, callback) { + // Add a fallback for old share() calls without expirationDate. + // We should remove this in a later version, + // after the Apps have been updated. + if (typeof callback === 'undefined' && + typeof expirationDate === 'function') { + callback = expirationDate; + expirationDate = ''; + console.warn( + "Call to 'OC.Share.share()' with too few arguments. " + + "'expirationDate' was assumed to be 'callback'. " + + "Please revisit the call and fix the list of arguments." + ); + } + $.post(OC.filePath('core', 'ajax', 'share.php'), { action: 'share', @@ -145,7 +159,8 @@ OC.Share={ shareType: shareType, shareWith: shareWith, permissions: permissions, - itemSourceName: itemSourceName + itemSourceName: itemSourceName, + expirationDate: expirationDate }, function (result) { if (result && result.status === 'success') { if (callback) { @@ -219,11 +234,22 @@ OC.Share={ html += '