summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-03-19 11:44:21 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2014-03-19 11:44:21 +0100
commitc216c4777be147a04ab27c6af9e25e8b2fc9677d (patch)
treed6cb262ac0a1d697ea9a3edc413e43a3e95b57bc /apps/files
parenteffea790c7200d1a9e5605407dcefc8ab71146b8 (diff)
parentb9fc240b838439444061824cb191ce22c4c4c052 (diff)
downloadnextcloud-server-c216c4777be147a04ab27c6af9e25e8b2fc9677d.tar.gz
nextcloud-server-c216c4777be147a04ab27c6af9e25e8b2fc9677d.zip
Merge branch 'master' into close-session-faster-master
Conflicts: apps/files/ajax/upgrade.php
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/ajax/upgrade.php44
-rw-r--r--apps/files/index.php135
-rw-r--r--apps/files/js/upgrade.js28
-rw-r--r--apps/files/l10n/ca.php5
-rw-r--r--apps/files/l10n/cs_CZ.php5
-rw-r--r--apps/files/templates/upgrade.php4
6 files changed, 72 insertions, 149 deletions
diff --git a/apps/files/ajax/upgrade.php b/apps/files/ajax/upgrade.php
deleted file mode 100644
index a3383a8863f..00000000000
--- a/apps/files/ajax/upgrade.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-set_time_limit(0); //scanning can take ages
-\OC::$session->close();
-
-$user = OC_User::getUser();
-$eventSource = new OC_EventSource();
-$listener = new UpgradeListener($eventSource);
-$legacy = new \OC\Files\Cache\Legacy($user);
-
-if ($legacy->hasItems()) {
- OC_Hook::connect('\OC\Files\Cache\Upgrade', 'migrate_path', $listener, 'upgradePath');
-
- OC_DB::beginTransaction();
- $upgrade = new \OC\Files\Cache\Upgrade($legacy);
- $count = $legacy->getCount();
- $eventSource->send('total', $count);
- $upgrade->upgradePath('/' . $user . '/files');
- OC_DB::commit();
-}
-\OC\Files\Cache\Upgrade::upgradeDone($user);
-$eventSource->send('done', true);
-$eventSource->close();
-
-class UpgradeListener {
- /**
- * @var OC_EventSource $eventSource
- */
- private $eventSource;
-
- private $count = 0;
- private $lastSend = 0;
-
- public function __construct($eventSource) {
- $this->eventSource = $eventSource;
- }
-
- public function upgradePath($path) {
- $this->count++;
- if ($this->count > ($this->lastSend + 5)) {
- $this->lastSend = $this->count;
- $this->eventSource->send('count', $this->count);
- }
- }
-}
diff --git a/apps/files/index.php b/apps/files/index.php
index ad7a2e210ed..c66cd40fb56 100644
--- a/apps/files/index.php
+++ b/apps/files/index.php
@@ -62,22 +62,17 @@ if ($isIE8 && isset($_GET['dir'])){
$ajaxLoad = false;
$files = array();
$user = OC_User::getUser();
-if (\OC\Files\Cache\Upgrade::needUpgrade($user)) { //dont load anything if we need to upgrade the cache
- $needUpgrade = true;
-} else {
- if ($isIE8){
- // after the redirect above, the URL will have a format
- // like "files#?dir=path" which means that no path was given
- // (dir is not set). In that specific case, we don't return any
- // files because the client will take care of switching the dir
- // to the one from the hash, then ajax-load the initial file list
- $files = array();
- $ajaxLoad = true;
- }
- else{
- $files = \OCA\Files\Helper::getFiles($dir);
- }
- $needUpgrade = false;
+if ($isIE8){
+ // after the redirect above, the URL will have a format
+ // like "files#?dir=path" which means that no path was given
+ // (dir is not set). In that specific case, we don't return any
+ // files because the client will take care of switching the dir
+ // to the one from the hash, then ajax-load the initial file list
+ $files = array();
+ $ajaxLoad = true;
+}
+else{
+ $files = \OCA\Files\Helper::getFiles($dir);
}
$config = \OC::$server->getConfig();
@@ -97,62 +92,56 @@ $breadcrumbNav->assign('baseURL', OCP\Util::linkTo('files', 'index.php') . '?dir
$permissions = $dirInfo->getPermissions();
-if ($needUpgrade) {
- OCP\Util::addscript('files', 'upgrade');
- $tmpl = new OCP\Template('files', 'upgrade', 'user');
- $tmpl->printPage();
-} else {
- // information about storage capacities
- $storageInfo=OC_Helper::getStorageInfo($dir);
- $freeSpace=$storageInfo['free'];
- $uploadLimit=OCP\Util::uploadLimit();
- $maxUploadFilesize=OCP\Util::maxUploadFilesize($dir);
- $publicUploadEnabled = $config->getAppValue('core', 'shareapi_allow_public_upload', 'yes');
- // 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();
- }
-
- $trashEnabled = \OCP\App::isEnabled('files_trashbin');
- $trashEmpty = true;
- if ($trashEnabled) {
- $trashEmpty = \OCA\Files_Trashbin\Trashbin::isEmpty($user);
- }
+// information about storage capacities
+$storageInfo=OC_Helper::getStorageInfo($dir);
+$freeSpace=$storageInfo['free'];
+$uploadLimit=OCP\Util::uploadLimit();
+$maxUploadFilesize=OCP\Util::maxUploadFilesize($dir);
+$publicUploadEnabled = $config->getAppValue('core', 'shareapi_allow_public_upload', 'yes');
+// 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();
+}
- $isCreatable = \OC\Files\Filesystem::isCreatable($dir . '/');
- $fileHeader = (!isset($files) or count($files) > 0);
- $emptyContent = ($isCreatable and !$fileHeader) or $ajaxLoad;
-
- OCP\Util::addscript('files', 'fileactions');
- OCP\Util::addscript('files', 'files');
- OCP\Util::addscript('files', 'keyboardshortcuts');
- $tmpl = new OCP\Template('files', 'index', 'user');
- $tmpl->assign('fileList', $list->fetchPage());
- $tmpl->assign('breadcrumb', $breadcrumbNav->fetchPage());
- $tmpl->assign('dir', $dir);
- $tmpl->assign('isCreatable', $isCreatable);
- $tmpl->assign('permissions', $permissions);
- $tmpl->assign('files', $files);
- $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('ajaxLoad', $ajaxLoad);
- $tmpl->assign('emptyContent', $emptyContent);
- $tmpl->assign('fileHeader', $fileHeader);
-
- $tmpl->printPage();
+$trashEnabled = \OCP\App::isEnabled('files_trashbin');
+$trashEmpty = true;
+if ($trashEnabled) {
+ $trashEmpty = \OCA\Files_Trashbin\Trashbin::isEmpty($user);
}
+
+$isCreatable = \OC\Files\Filesystem::isCreatable($dir . '/');
+$fileHeader = (!isset($files) or count($files) > 0);
+$emptyContent = ($isCreatable and !$fileHeader) or $ajaxLoad;
+
+OCP\Util::addscript('files', 'fileactions');
+OCP\Util::addscript('files', 'files');
+OCP\Util::addscript('files', 'keyboardshortcuts');
+$tmpl = new OCP\Template('files', 'index', 'user');
+$tmpl->assign('fileList', $list->fetchPage());
+$tmpl->assign('breadcrumb', $breadcrumbNav->fetchPage());
+$tmpl->assign('dir', $dir);
+$tmpl->assign('isCreatable', $isCreatable);
+$tmpl->assign('permissions', $permissions);
+$tmpl->assign('files', $files);
+$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('ajaxLoad', $ajaxLoad);
+$tmpl->assign('emptyContent', $emptyContent);
+$tmpl->assign('fileHeader', $fileHeader);
+
+$tmpl->printPage();
diff --git a/apps/files/js/upgrade.js b/apps/files/js/upgrade.js
deleted file mode 100644
index 714adf824a1..00000000000
--- a/apps/files/js/upgrade.js
+++ /dev/null
@@ -1,28 +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 */
-$(document).ready(function () {
- var eventSource, total, bar = $('#progressbar');
- console.log('start');
- bar.progressbar({value: 0});
- eventSource = new OC.EventSource(OC.filePath('files', 'ajax', 'upgrade.php'));
- eventSource.listen('total', function (count) {
- total = count;
- console.log(count + ' files needed to be migrated');
- });
- eventSource.listen('count', function (count) {
- bar.progressbar({value: (count / total) * 100});
- console.log(count);
- });
- eventSource.listen('done', function () {
- document.location.reload();
- });
-});
diff --git a/apps/files/l10n/ca.php b/apps/files/l10n/ca.php
index f63f65162a8..e1c7decdbbd 100644
--- a/apps/files/l10n/ca.php
+++ b/apps/files/l10n/ca.php
@@ -3,7 +3,9 @@ $TRANSLATIONS = array(
"Could not move %s - File with this name already exists" => "No s'ha pogut moure %s - Ja hi ha un fitxer amb aquest nom",
"Could not move %s" => " No s'ha pogut moure %s",
"File name cannot be empty." => "El nom del fitxer no pot ser buit.",
+"\"%s\" is an invalid file name." => "\"%s\" no es un fitxer vàlid.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "El nóm no és vàlid, '\\', '/', '<', '>', ':', '\"', '|', '?' i '*' no estan permesos.",
+"The target folder has been moved or deleted." => "La carpeta de destí s'ha mogut o eliminat.",
"The name %s is already used in the folder %s. Please choose a different name." => "El nom %s ja s'usa en la carpeta %s. Indiqueu un nom diferent.",
"Not a valid source" => "No és un origen vàlid",
"Server is not allowed to open URLs, please check the server configuration" => "El servidor no té autorització per obrir URLs, comproveu la configuració del servidor",
@@ -27,6 +29,8 @@ $TRANSLATIONS = array(
"Invalid directory." => "Directori no vàlid.",
"Files" => "Fitxers",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "No es pot pujar {filename} perquè és una carpeta o té 0 bytes",
+"Total file size {size1} exceeds upload limit {size2}" => "Mida total del fitxer {size1} excedeix el límit de pujada {size2}",
+"Not enough free space, you are uploading {size1} but only {size2} is left" => "No hi ha prou espai lliure, està carregant {size1} però només pot {size2}",
"Upload cancelled." => "La pujada s'ha cancel·lat.",
"Could not get result from server." => "No hi ha resposta del servidor.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Hi ha una pujada en curs. Si abandoneu la pàgina la pujada es cancel·larà.",
@@ -48,6 +52,7 @@ $TRANSLATIONS = array(
"_%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!",
"Your storage is almost full ({usedSpacePercent}%)" => "El vostre espai d'emmagatzemament és gairebé ple ({usedSpacePercent}%)",
"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.",
diff --git a/apps/files/l10n/cs_CZ.php b/apps/files/l10n/cs_CZ.php
index 02ab6e15250..3fac6f15c08 100644
--- a/apps/files/l10n/cs_CZ.php
+++ b/apps/files/l10n/cs_CZ.php
@@ -3,7 +3,9 @@ $TRANSLATIONS = array(
"Could not move %s - File with this name already exists" => "Nelze přesunout %s - již existuje soubor se stejným názvem",
"Could not move %s" => "Nelze přesunout %s",
"File name cannot be empty." => "Název souboru nemůže být prázdný řetězec.",
+"\"%s\" is an invalid file name." => "\"%s\" je neplatným názvem souboru.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Neplatný název, znaky '\\', '/', '<', '>', ':', '\"', '|', '?' a '*' nejsou povoleny.",
+"The target folder has been moved or deleted." => "Cílová složka byla přesunuta nebo smazána.",
"The name %s is already used in the folder %s. Please choose a different name." => "Název %s ve složce %s již existuje. Vyberte prosím jiné jméno.",
"Not a valid source" => "Neplatný zdroj",
"Server is not allowed to open URLs, please check the server configuration" => "Server není oprávněn otevírat adresy URL. Ověřte, prosím, konfiguraci serveru.",
@@ -27,6 +29,8 @@ $TRANSLATIONS = array(
"Invalid directory." => "Neplatný adresář",
"Files" => "Soubory",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Nelze nahrát soubor {filename}, protože je to buď adresář nebo má velikost 0 bytů",
+"Total file size {size1} exceeds upload limit {size2}" => "Celková velikost souboru {size1} překračuje povolenou velikost pro nahrávání {size2}",
+"Not enough free space, you are uploading {size1} but only {size2} is left" => "Není dostatek místa pro uložení, velikost souboru je {size1}, zbývá pouze {size2}",
"Upload cancelled." => "Odesílání zrušeno.",
"Could not get result from server." => "Nepodařilo se získat výsledek ze serveru.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Probíhá odesílání souboru. Opuštění stránky způsobí zrušení nahrávání.",
@@ -48,6 +52,7 @@ $TRANSLATIONS = array(
"_%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.",
"Your storage is almost full ({usedSpacePercent}%)" => "Vaše úložiště je téměř plné ({usedSpacePercent}%)",
"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",
diff --git a/apps/files/templates/upgrade.php b/apps/files/templates/upgrade.php
deleted file mode 100644
index e03f086e47d..00000000000
--- a/apps/files/templates/upgrade.php
+++ /dev/null
@@ -1,4 +0,0 @@
-<div id="upgrade">
- <?php p($l->t('Upgrading filesystem cache...'));?>
- <div id="progressbar" />
-</div>