diff options
50 files changed, 340 insertions, 437 deletions
diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c5d6c9655ff..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -language: php -php: - - 5.3 - - 5.4 - - 5.5 - - 5.6 - - hhvm - -matrix: - include: - - php: 5.4 - env: DB=oracle - - php: 5.4 - env: DB=pgsql - - php: 5.4 - env: DB=mysql - - php: 5.4 - env: DB=mysql EXTERNAL=true - allow_failures: - - php: hhvm - fast_finish: true - -env: - global: - - EXTERNAL=false - matrix: - - DB=sqlite - -before_script: - # setup databases - - wget https://raw.githubusercontent.com/owncloud/administration/master/travis-ci/setup_databases.sh - - bash ./setup_databases.sh $DB - - # Additional PHP config - - if [[ $HHVM == false ]] ; then phpenv config-add build/travis.php.ini ; fi - - # fetch Ocular (for test coverage upload) - - wget https://scrutinizer-ci.com/ocular.phar - - # call setup for tests - - build/prepareTests.sh $DB - - # Enable/disable files_external to control it's unit test execution - - php occ --list - - if [[ $EXTERNAL == true ]] ; then php occ app:enable files_external ; fi - - if [[ $EXTERNAL == false ]] ; then php occ app:disable files_external ; fi - -script: - - phpunit --version - # Run PHP lint for each PHP version - - if [[ $DB == 'sqlite' ]] ; then ant -f build/build.xml -Dbasedir=. prepare lint ; fi - - # Run tests - - phpunit --configuration tests/phpunit-autotest.xml --coverage-clover tests/autotest-clover-$DB.xml --verbose --debug - - # Run JS tests just once (see test matrix - mysql is just run once) - - if [[ $DB == 'mysql' ]] ; then ./autotest-js.sh ; fi - - # Upload coverage report - - php ocular.phar code-coverage:upload --format=php-clover tests/autotest-clover-$DB.xml - -branches: - only: - - master - - stable5 - - stable6 - - stable7 diff --git a/apps/files/l10n/pt_PT.php b/apps/files/l10n/pt_PT.php index 372b412fc00..d44a5bd01b2 100644 --- a/apps/files/l10n/pt_PT.php +++ b/apps/files/l10n/pt_PT.php @@ -5,6 +5,7 @@ $TRANSLATIONS = array( "Unknown error" => "Erro Desconhecido", "Could not move %s - File with this name already exists" => "Não foi possível mover %s - Já existe um ficheiro com este nome", "Could not move %s" => "Não foi possível mover %s", +"Permission denied" => "Permissão negada", "File name cannot be empty." => "O nome do ficheiro não pode estar em branco.", "\"%s\" is an invalid file name." => "\"%s\" é um nome de ficheiro inválido.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nome Inválido, Não são permitidos os carateres '\\', '/', '<', '>', ':', '\"', '|', '?' e '*'.", diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php index ccea51f91f7..8eda8ef0881 100644 --- a/apps/files_encryption/hooks/hooks.php +++ b/apps/files_encryption/hooks/hooks.php @@ -191,13 +191,12 @@ class Hooks { if (Crypt::mode() === 'server') {
$view = new \OC\Files\View('/');
+ $session = new \OCA\Encryption\Session($view);
- if ($params['uid'] === \OCP\User::getUser()) {
+ // Get existing decrypted private key
+ $privateKey = $session->getPrivateKey();
- $session = new \OCA\Encryption\Session($view);
-
- // Get existing decrypted private key
- $privateKey = $session->getPrivateKey();
+ if ($params['uid'] === \OCP\User::getUser() && $privateKey) {
// Encrypt private key with new user pwd as passphrase
$encryptedPrivateKey = Crypt::symmetricEncryptFileContent($privateKey, $params['password'], Helper::getCipher());
@@ -487,6 +486,7 @@ class Hooks { unset(self::$renamedFiles[$params['oldpath']]);
} else {
\OCP\Util::writeLog('Encryption library', "can't get path and owner from the file before it was renamed", \OCP\Util::DEBUG);
+ \OC_FileProxy::$enabled = $proxyStatus;
return false;
}
diff --git a/apps/files_encryption/l10n/bn_BD.php b/apps/files_encryption/l10n/bn_BD.php index 8d034c83a15..3d4c848d6ef 100644 --- a/apps/files_encryption/l10n/bn_BD.php +++ b/apps/files_encryption/l10n/bn_BD.php @@ -9,6 +9,7 @@ $TRANSLATIONS = array( "Initial encryption running... Please try again later." => "প্রাথমিক এনক্রিপসন চলছে.... দয়া করে পরে আবার চেষ্টা করুন।", "Go directly to your %spersonal settings%s." => "সরাসরি আপনার %spersonal settings%s এ যান।", "Encryption" => "সংকেতায়ন", +"Repeat Recovery key password" => "পূণরূদ্ধার কি এর কুটশব্দ পূণরায় দিন", "Enabled" => "কার্যকর", "Disabled" => "অকার্যকর", "Change recovery key password:" => "পূণরূদ্ধার কি এর কুটশব্দ পরিবর্তন করুন:", diff --git a/apps/files_sharing/l10n/bn_BD.php b/apps/files_sharing/l10n/bn_BD.php index 5411b5b2785..fdd3f5233bf 100644 --- a/apps/files_sharing/l10n/bn_BD.php +++ b/apps/files_sharing/l10n/bn_BD.php @@ -15,6 +15,7 @@ $TRANSLATIONS = array( "Password" => "কূটশব্দ", "Name" => "নাম", "Share time" => "ভাগাভাগির সময়", +"Sorry, this link doesn’t seem to work anymore." => "দুঃখিত, এই লিঙ্কটি আর কার্যকর নয়।", "Reasons might be:" => "কারণসমূহ হতে পারে:", "the item was removed" => "আইটেমটি অপসারণ করা হয়েছিল", "the link expired" => "মেয়াদোত্তীর্ন লিঙ্ক", diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php index 5f1226d89d8..ca7e58d93bd 100644 --- a/apps/files_trashbin/lib/trashbin.php +++ b/apps/files_trashbin/lib/trashbin.php @@ -142,6 +142,12 @@ class Trashbin { $user = \OCP\User::getUser(); $size = 0; list($owner, $ownerPath) = self::getUidAndFilename($file_path); + + // file has been deleted in between + if (empty($ownerPath)) { + return false; + } + self::setUpTrash($user); $view = new \OC\Files\View('/' . $user); @@ -219,6 +225,10 @@ class Trashbin { $rootView = new \OC\Files\View('/'); list($owner, $ownerPath) = self::getUidAndFilename($file_path); + // file has been deleted in between + if (empty($ownerPath)) { + return 0; + } if ($rootView->is_dir($owner . '/files_versions/' . $ownerPath)) { $size += self::calculateSize(new \OC\Files\View('/' . $owner . '/files_versions/' . $ownerPath)); @@ -262,6 +272,11 @@ class Trashbin { list($owner, $ownerPath) = self::getUidAndFilename($file_path); + // file has been deleted in between + if (empty($ownerPath)) { + return 0; + } + $util = new \OCA\Encryption\Util(new \OC\Files\View('/'), $user); // disable proxy to prevent recursive calls @@ -440,6 +455,12 @@ class Trashbin { list($owner, $ownerPath) = self::getUidAndFilename($target); + // file has been deleted in between + if (empty($ownerPath)) { + \OC_FileProxy::$enabled = $proxyStatus; + return false; + } + if ($timestamp) { $versionedFile = $filename; } else { @@ -484,6 +505,11 @@ class Trashbin { list($owner, $ownerPath) = self::getUidAndFilename($target); + // file has been deleted in between + if (empty($ownerPath)) { + return false; + } + $util = new \OCA\Encryption\Util(new \OC\Files\View('/'), $user); if ($util->isSystemWideMountPoint($ownerPath)) { diff --git a/autotest.sh b/autotest.sh index d6b975c62d2..e86240e4e56 100755 --- a/autotest.sh +++ b/autotest.sh @@ -26,12 +26,12 @@ function print_syntax { echo -e "\nIf no arguments are specified, all tests will be run with all database configs" >&2 } -if ! [ -x $PHPUNIT ]; then +if ! [ -x "$PHPUNIT" ]; then echo "phpunit executable not found, please install phpunit version >= 3.7" >&2 exit 3 fi -PHPUNIT_VERSION=$($PHPUNIT --version | cut -d" " -f2) +PHPUNIT_VERSION=$("$PHPUNIT" --version | cut -d" " -f2) PHPUNIT_MAJOR_VERSION=$(echo $PHPUNIT_VERSION | cut -d"." -f1) PHPUNIT_MINOR_VERSION=$(echo $PHPUNIT_VERSION | cut -d"." -f2) @@ -45,10 +45,10 @@ if ! [ -w config -a -w config/config.php ]; then exit 1 fi -if [ $1 ]; then +if [ "$1" ]; then FOUND=0 for DBCONFIG in $DBCONFIGS; do - if [ $1 = $DBCONFIG ]; then + if [ "$1" = $DBCONFIG ]; then FOUND=1 break fi @@ -148,14 +148,14 @@ DELIM function execute_tests { echo "Setup environment for $1 testing ..." # back to root folder - cd $BASEDIR + cd "$BASEDIR" # revert changes to tests/data git checkout tests/data # reset data directory - rm -rf $DATADIR - mkdir $DATADIR + rm -rf "$DATADIR" + mkdir "$DATADIR" # remove the old config file #rm -rf config/config.php @@ -194,7 +194,7 @@ EOF fi # copy autoconfig - cp $BASEDIR/tests/autoconfig-$1.php $BASEDIR/config/autoconfig.php + cp "$BASEDIR/tests/autoconfig-$1.php" "$BASEDIR/config/autoconfig.php" # trigger installation echo "INDEX" @@ -204,15 +204,15 @@ EOF #test execution echo "Testing with $1 ..." cd tests - rm -rf coverage-html-$1 - mkdir coverage-html-$1 + rm -rf "coverage-html-$1" + mkdir "coverage-html-$1" php -f enable_all.php | grep -i -C9999 error && echo "Error during setup" && exit 101 if [ -z "$NOCOVERAGE" ]; then - $PHPUNIT --configuration phpunit-autotest.xml --log-junit autotest-results-$1.xml --coverage-clover autotest-clover-$1.xml --coverage-html coverage-html-$1 $2 $3 + "$PHPUNIT" --configuration phpunit-autotest.xml --log-junit "autotest-results-$1.xml" --coverage-clover "autotest-clover-$1.xml" --coverage-html "coverage-html-$1" "$2" "$3" RESULT=$? else echo "No coverage" - $PHPUNIT --configuration phpunit-autotest.xml --log-junit autotest-results-$1.xml $2 $3 + "$PHPUNIT" --configuration phpunit-autotest.xml --log-junit "autotest-results-$1.xml" "$2" "$3" RESULT=$? fi } @@ -227,10 +227,10 @@ if [ -z "$1" ] execute_tests $DBCONFIG done else - execute_tests $1 $2 $3 + execute_tests "$1" "$2" "$3" fi -cd $BASEDIR +cd "$BASEDIR" restore_config # diff --git a/build/prepareTests.sh b/build/prepareTests.sh deleted file mode 100755 index 84bbfd40f6d..00000000000 --- a/build/prepareTests.sh +++ /dev/null @@ -1,141 +0,0 @@ -#!/bin/bash -# -# ownCloud -# -# @author Thomas Müller -# @author Morris Jobke -# @copyright 2012, 2013 Thomas Müller thomas.mueller@tmit.eu -# @copyright 2014 Morris Jobke hey@morrisjobke.de -# - -DATABASENAME=oc_autotest -DATABASEUSER=oc_autotest -ADMINLOGIN=admin -BASEDIR=$PWD - -# check for database parameter -if [ $1 ]; then - DBCONFIGS="sqlite mysql pgsql oracle" - FOUND=0 - for DBCONFIG in $DBCONFIGS; do - if [ $1 = $DBCONFIG ]; then - FOUND=1 - break - fi - done - if [ $FOUND = 0 ]; then - echo -e "Unknown database config name \"$1\"\n" >&2 - exit 2 - fi -else - echo "Please pass in a database to use as first parameter" >&2 - exit 1 -fi - -# check if config dir and file is writable -if ! [[ -w config && ( !( -e config/config.php ) || -w config/config.php ) ]]; then - echo "Please enable write permissions on config and config/config.php" >&2 - exit 1 -fi - -# use tmpfs for datadir - should speedup unit test execution -if [ -d /dev/shm ]; then - DATADIR=/dev/shm/data-autotest -else - DATADIR=$BASEDIR/data-autotest -fi - -echo "Setup environment for $1 testing ..." -# revert changes to tests/data -git checkout tests/data/* - -# reset data directory -rm -rf $DATADIR -mkdir $DATADIR - -cp tests/preseed-config.php config/config.php - -# # # # # # -# SQLite # -# # # # # # -if [ "$1" == "sqlite" ] ; then - cat > ./config/autoconfig.php <<DELIM -<?php -\$AUTOCONFIG = array ( - 'installed' => false, - 'dbtype' => 'sqlite', - 'dbtableprefix' => 'oc_', - 'adminlogin' => '$ADMINLOGIN', - 'adminpass' => 'admin', - 'directory' => '$DATADIR', -); -DELIM -fi - -# # # # # -# MySQL # -# # # # # -if [ "$1" == "mysql" ] ; then - cat > ./config/autoconfig.php <<DELIM -<?php -\$AUTOCONFIG = array ( - 'installed' => false, - 'dbtype' => 'mysql', - 'dbtableprefix' => 'oc_', - 'adminlogin' => '$ADMINLOGIN', - 'adminpass' => 'admin', - 'directory' => '$DATADIR', - 'dbuser' => '$DATABASEUSER', - 'dbname' => '$DATABASENAME', - 'dbhost' => 'localhost', - 'dbpass' => 'owncloud', -); -DELIM -fi - -# # # # # # # # -# PostgreSQL # -# # # # # # # # -if [ "$1" == "pgsql" ] ; then - cat > ./config/autoconfig.php <<DELIM -<?php -\$AUTOCONFIG = array ( - 'installed' => false, - 'dbtype' => 'pgsql', - 'dbtableprefix' => 'oc_', - 'adminlogin' => '$ADMINLOGIN', - 'adminpass' => 'admin', - 'directory' => '$DATADIR', - 'dbuser' => '$DATABASEUSER', - 'dbname' => '$DATABASENAME', - 'dbhost' => 'localhost', - 'dbpass' => 'owncloud', -); -DELIM - -fi - -# # # # # # -# Oracle # -# # # # # # -if [ "$1" == "oracle" ] ; then - build/prepareTestsOracle.sh $DATABASENAME $DATABASEUSER $ADMINLOGIN $DATADIR -fi - -echo "Trigger ownCloud installation" -php -f index.php | grep -i -C9999 error && echo "Error during setup" && exit 101 - -echo "Enable apps ..." -cd tests -php -f enable_all.php | grep -i -C9999 error && echo "Error during setup" && exit 101 -cd $BASEDIR - -# show environment -echo "ownCloud configuration:" -cat $BASEDIR/config/config.php - -echo "ownCloud data directory:" -ls -ll $DATADIR - -echo "owncloud.log:" -cat $DATADIR/owncloud.log diff --git a/build/prepareTestsOracle.sh b/build/prepareTestsOracle.sh deleted file mode 100755 index 65a59036659..00000000000 --- a/build/prepareTestsOracle.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash -# -# ownCloud - prepareTestOracle.sh -# -# @author Morris Jobke -# @copyright 2014 Morris Jobke hey@morrisjobke.de -# - -DATABASENAME=$1 -DATABASEUSER=$2 -ADMINLOGIN=$3 -DATADIR=$4 - -# set oracle home if it is not set -TRAVIS_ORACLE_HOME="/usr/lib/oracle/xe/app/oracle/product/10.2.0/server" -[ -z "$ORACLE_HOME" ] && ORACLE_HOME=$TRAVIS_ORACLE_HOME - -echo "Load Oracle environment variables so that we can run 'sqlplus'." - . $ORACLE_HOME/bin/oracle_env.sh - -echo "drop the database" -sqlplus64 -s -l / as sysdba <<EOF - drop user $DATABASENAME cascade; -EOF - -echo "create the database" -sqlplus64 -s -l / as sysdba <<EOF - create user $DATABASENAME identified by owncloud; - alter user $DATABASENAME default tablespace users - temporary tablespace temp - quota unlimited on users; - grant create session - , create table - , create procedure - , create sequence - , create trigger - , create view - , create synonym - , alter session - to $DATABASENAME; - exit; -EOF - -# there was a maximum cursor limit exceed -# therefore increase the limit -sqlplus64 -s -l / as sysdba <<EOF - ALTER SYSTEM SET open_cursors = 1000 SCOPE=BOTH; -EOF - -cat > ./config/autoconfig.php <<DELIM -<?php -\$AUTOCONFIG = array ( - 'installed' => false, - 'dbtype' => 'oci', - 'dbtableprefix' => 'oc_', - 'adminlogin' => '$ADMINLOGIN', - 'adminpass' => 'admin', - 'directory' => '$DATADIR', - 'dbuser' => '$DATABASEUSER', - 'dbname' => 'XE', - 'dbhost' => 'localhost', - 'dbpass' => 'owncloud', -); -DELIM - diff --git a/build/travis.php.ini b/build/travis.php.ini deleted file mode 100644 index 5e5483e2d6a..00000000000 --- a/build/travis.php.ini +++ /dev/null @@ -1 +0,0 @@ -memory_limit = 1024M diff --git a/config/config.sample.php b/config/config.sample.php index 879ba9e9d01..8d9bb975662 100755 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -282,7 +282,30 @@ $CONFIG = array( /* custom path for libreoffice / openoffice binary */ 'preview_libreoffice_path' => '/usr/bin/libreoffice', /* cl parameters for libreoffice / openoffice */ -'preview_office_cl_parameters' => '', +'preview_office_cl_parameters' => ' --headless --nologo --nofirststartwizard --invisible --norestore -convert-to pdf -outdir ', + +/** + * Only register providers that have been explicitly enabled + * + * The following providers are enabled by default: + * - OC\Preview\Image + * - OC\Preview\MP3 + * - OC\Preview\TXT + * - OC\Preview\MarkDown + * + * The following providers are disabled by default due to performance or privacy concerns: + * - OC\Preview\Office + * - OC\Preview\SVG + * - OC\Preview\Movies + * - OC\Preview\PDF + * - OC\Preview\Tiff + */ +'enabledPreviewProviders' => array( + 'OC\Preview\Image', + 'OC\Preview\MP3', + 'OC\Preview\TXT', + 'OC\Preview\MarkDown' +), /* whether avatars should be enabled */ 'enable_avatars' => true, diff --git a/core/command/upgrade.php b/core/command/upgrade.php index d037082c5e8..5b9432d631b 100644 --- a/core/command/upgrade.php +++ b/core/command/upgrade.php @@ -9,6 +9,7 @@ namespace OC\Core\Command; use OC\Updater; +use OCP\IConfig; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -22,6 +23,20 @@ class Upgrade extends Command { const ERROR_UP_TO_DATE = 3; const ERROR_INVALID_ARGUMENTS = 4; + public $upgradeFailed = false; + + /** + * @var IConfig + */ + private $config; + + /** + * @param IConfig $config + */ + public function __construct(IConfig $config) { + $this->config = $config; + } + protected function configure() { $this ->setName('upgrade') @@ -48,14 +63,6 @@ class Upgrade extends Command { */ protected function execute(InputInterface $input, OutputInterface $output) { - require_once \OC::$SERVERROOT . '/lib/base.php'; - - // Don't do anything if ownCloud has not been installed - if(!\OC_Config::getValue('installed', false)) { - $output->writeln('<error>ownCloud has not yet been installed</error>'); - return self::ERROR_NOT_INSTALLED; - } - $simulateStepEnabled = true; $updateStepEnabled = true; @@ -75,6 +82,7 @@ class Upgrade extends Command { } if(\OC::checkUpgrade(false)) { + $self = $this; $updater = new Updater(); $updater->setSimulateStepEnabled($simulateStepEnabled); @@ -83,15 +91,14 @@ class Upgrade extends Command { $updater->listen('\OC\Updater', 'maintenanceStart', function () use($output) { $output->writeln('<info>Turned on maintenance mode</info>'); }); - $updater->listen('\OC\Updater', 'maintenanceEnd', function () use($output, $updateStepEnabled) { - $output->writeln('<info>Turned off maintenance mode</info>'); - if (!$updateStepEnabled) { - $output->writeln('<info>Update simulation successful</info>'); - } - else { - $output->writeln('<info>Update successful</info>'); - } - }); + $updater->listen('\OC\Updater', 'maintenanceEnd', + function () use($output, $updateStepEnabled, $self) { + $output->writeln('<info>Turned off maintenance mode</info>'); + $mode = $updateStepEnabled ? 'Update' : 'Update simulation'; + $status = $self->upgradeFailed ? 'failed' : 'successful'; + $message = "<info>$mode $status</info>"; + $output->writeln($message); + }); $updater->listen('\OC\Updater', 'dbUpgrade', function () use($output) { $output->writeln('<info>Updated database</info>'); }); @@ -102,9 +109,9 @@ class Upgrade extends Command { $output->writeln('<info>Disabled incompatible apps: ' . implode(', ', $appList) . '</info>'); }); - $updater->listen('\OC\Updater', 'failure', function ($message) use($output) { - $output->writeln($message); - \OC_Config::setValue('maintenance', false); + $updater->listen('\OC\Updater', 'failure', function ($message) use($output, $self) { + $output->writeln("<error>$message</error>"); + $self->upgradeFailed = true; }); $updater->upgrade(); @@ -112,7 +119,7 @@ class Upgrade extends Command { $this->postUpgradeCheck($input, $output); return self::ERROR_SUCCESS; - } else if(\OC_Config::getValue('maintenance', false)) { + } else if($this->config->getSystemValue('maintenance', false)) { //Possible scenario: ownCloud core is updated but an app failed $output->writeln('<warning>ownCloud is in maintenance mode</warning>'); $output->write('<comment>Maybe an upgrade is already in process. Please check the ' @@ -134,7 +141,7 @@ class Upgrade extends Command { * @param OutputInterface $output output interface */ protected function postUpgradeCheck(InputInterface $input, OutputInterface $output) { - $trustedDomains = \OC_Config::getValue('trusted_domains', array()); + $trustedDomains = $this->config->getSystemValue('trusted_domains', array()); if (empty($trustedDomains)) { $output->write( '<warning>The setting "trusted_domains" could not be ' . diff --git a/core/l10n/en_GB.php b/core/l10n/en_GB.php index b4aa17e2f3f..03b48abe943 100644 --- a/core/l10n/en_GB.php +++ b/core/l10n/en_GB.php @@ -140,6 +140,9 @@ $TRANSLATIONS = array( "Error favoriting" => "Error favouriting", "Error unfavoriting" => "Error unfavouriting", "Access forbidden" => "Access denied", +"File not found" => "File not found", +"The specified document has not been found on the server." => "The specified document has not been found on the server.", +"You can click here to return to %s." => "You can click here to return to %s.", "Hey there,\n\njust letting you know that %s shared %s with you.\nView it: %s\n\n" => "Hey there,\n\njust letting you know that %s shared %s with you.\nView it: %s\n\n", "The share will expire on %s." => "The share will expire on %s.", "Cheers!" => "Cheers!", @@ -185,6 +188,8 @@ $TRANSLATIONS = array( "The theme %s has been disabled." => "The theme %s has been disabled.", "Please make sure that the database, the config folder and the data folder have been backed up before proceeding." => "Please make sure that the database, the config folder and the data folder have been backed up before proceeding.", "Start update" => "Start update", -"To avoid timeouts with larger installations, you can instead run the following command from your installation directory:" => "To avoid timeouts with larger installations, you can instead run the following command from your installation directory:" +"To avoid timeouts with larger installations, you can instead run the following command from your installation directory:" => "To avoid timeouts with larger installations, you can instead run the following command from your installation directory:", +"This %s instance is currently being updated, which may take a while." => "This %s instance is currently being updated, which may take a while.", +"This page will refresh itself when the %s instance is available again." => "This page will refresh itself when the %s instance is available again." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/core/l10n/fr.php b/core/l10n/fr.php index 5460ab79f0d..493f26f2d47 100644 --- a/core/l10n/fr.php +++ b/core/l10n/fr.php @@ -5,6 +5,8 @@ $TRANSLATIONS = array( "Turned off maintenance mode" => "Basculé en mode production (non maintenance)", "Updated database" => "Base de données mise à jour", "Checked database schema update" => "Mise à jour du schéma de la base de données vérifiée", +"Checked database schema update for apps" => "La mise à jour du schéma de la base de données pour les applications a été vérifiée", +"Updated \"%s\" to %s" => "Mise à jour de \"%s\" à %s", "Disabled incompatible apps: %s" => "Applications incompatibles désactivées: %s", "No image or file provided" => "Aucune image ou fichier fourni", "Unknown filetype" => "Type de fichier inconnu", @@ -138,6 +140,9 @@ $TRANSLATIONS = array( "Error favoriting" => "Erreur lors de la mise en favori", "Error unfavoriting" => "Erreur lors de la suppression des favoris", "Access forbidden" => "Accès interdit", +"File not found" => "Fichier non trouvé", +"The specified document has not been found on the server." => "Le document spécifié n'a pu être trouvé sur le serveur.", +"You can click here to return to %s." => "Vous pouvez cliquer ici pour retourner à %s.", "Hey there,\n\njust letting you know that %s shared %s with you.\nView it: %s\n\n" => "Bonjour,\n\nNous vous informons que %s a partagé %s avec vous.\nConsultez-le : %s\n", "The share will expire on %s." => "Le partage expirera le %s.", "Cheers!" => "À bientôt !", diff --git a/core/l10n/pt_PT.php b/core/l10n/pt_PT.php index 3033d62a30a..568499ab2f4 100644 --- a/core/l10n/pt_PT.php +++ b/core/l10n/pt_PT.php @@ -140,6 +140,9 @@ $TRANSLATIONS = array( "Error favoriting" => "Erro a definir como favorito", "Error unfavoriting" => "Erro a remover como favorito", "Access forbidden" => "Acesso interdito", +"File not found" => "Ficheiro não encontrado", +"The specified document has not been found on the server." => "O documento especificado não foi encontrado no servidor.", +"You can click here to return to %s." => "Pode clicar aqui para retornar para %s.", "Hey there,\n\njust letting you know that %s shared %s with you.\nView it: %s\n\n" => "Olá,\n\napenas para informar que %s partilhou »%s« consigo.\nConsulte aqui: %s\n", "The share will expire on %s." => "Esta partilha vai expirar em %s.", "Cheers!" => "Parabéns!", @@ -185,6 +188,8 @@ $TRANSLATIONS = array( "The theme %s has been disabled." => "O tema %s foi desativado.", "Please make sure that the database, the config folder and the data folder have been backed up before proceeding." => "Por favor garanta a cópia de segurança da base de dados e das pastas 'config' e 'data' antes de prosseguir.", "Start update" => "Iniciar atualização", -"To avoid timeouts with larger installations, you can instead run the following command from your installation directory:" => "Para evitar tempos de espera com instalações maiores, você pode em vez disso, executar o seguinte comando a partir do diretório de instalação:" +"To avoid timeouts with larger installations, you can instead run the following command from your installation directory:" => "Para evitar tempos de espera com instalações maiores, você pode em vez disso, executar o seguinte comando a partir do diretório de instalação:", +"This %s instance is currently being updated, which may take a while." => "Esta instância %s está actualmente a ser actualizada, poderá demorar algum tempo.", +"This page will refresh itself when the %s instance is available again." => "Esta página irá ser recarregada novamente quando a instância %s ficar novamente disponível." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/core/register_command.php b/core/register_command.php index b02988bbdd8..aaf10d946b2 100644 --- a/core/register_command.php +++ b/core/register_command.php @@ -12,7 +12,7 @@ $repair = new \OC\Repair(\OC\Repair::getRepairSteps()); $application->add(new OC\Core\Command\Status); $application->add(new OC\Core\Command\Db\GenerateChangeScript()); $application->add(new OC\Core\Command\Db\ConvertType(OC_Config::getObject(), new \OC\DB\ConnectionFactory())); -$application->add(new OC\Core\Command\Upgrade()); +$application->add(new OC\Core\Command\Upgrade(\OC::$server->getConfig())); $application->add(new OC\Core\Command\Maintenance\SingleUser()); $application->add(new OC\Core\Command\Maintenance\Mode(OC_Config::getObject())); $application->add(new OC\Core\Command\App\Disable()); diff --git a/l10n/templates/core.pot b/l10n/templates/core.pot index d751cec8db4..e6ad633a86b 100644 --- a/l10n/templates/core.pot +++ b/l10n/templates/core.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ownCloud Core 6.0.0\n" "Report-Msgid-Bugs-To: translations@owncloud.org\n" -"POT-Creation-Date: 2014-09-22 01:54-0400\n" +"POT-Creation-Date: 2014-09-23 02:03-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" diff --git a/l10n/templates/files.pot b/l10n/templates/files.pot index 2cdf2d4e7e1..4932617dc86 100644 --- a/l10n/templates/files.pot +++ b/l10n/templates/files.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ownCloud Core 6.0.0\n" "Report-Msgid-Bugs-To: translations@owncloud.org\n" -"POT-Creation-Date: 2014-09-22 01:54-0400\n" +"POT-Creation-Date: 2014-09-23 02:03-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" diff --git a/l10n/templates/files_encryption.pot b/l10n/templates/files_encryption.pot index 45ee9751c03..3a02d45e59c 100644 --- a/l10n/templates/files_encryption.pot +++ b/l10n/templates/files_encryption.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ownCloud Core 6.0.0\n" "Report-Msgid-Bugs-To: translations@owncloud.org\n" -"POT-Creation-Date: 2014-09-22 01:54-0400\n" +"POT-Creation-Date: 2014-09-23 02:03-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" diff --git a/l10n/templates/files_external.pot b/l10n/templates/files_external.pot index c4ee5c65556..ec0a6052e4b 100644 --- a/l10n/templates/files_external.pot +++ b/l10n/templates/files_external.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ownCloud Core 6.0.0\n" "Report-Msgid-Bugs-To: translations@owncloud.org\n" -"POT-Creation-Date: 2014-09-22 01:54-0400\n" +"POT-Creation-Date: 2014-09-23 02:03-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" diff --git a/l10n/templates/files_sharing.pot b/l10n/templates/files_sharing.pot index 2ab7cf95612..503dae723f6 100644 --- a/l10n/templates/files_sharing.pot +++ b/l10n/templates/files_sharing.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ownCloud Core 6.0.0\n" "Report-Msgid-Bugs-To: translations@owncloud.org\n" -"POT-Creation-Date: 2014-09-22 01:54-0400\n" +"POT-Creation-Date: 2014-09-23 02:03-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" diff --git a/l10n/templates/files_trashbin.pot b/l10n/templates/files_trashbin.pot index 40b12a7b9b6..641aecc7e2d 100644 --- a/l10n/templates/files_trashbin.pot +++ b/l10n/templates/files_trashbin.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ownCloud Core 6.0.0\n" "Report-Msgid-Bugs-To: translations@owncloud.org\n" -"POT-Creation-Date: 2014-09-22 01:54-0400\n" +"POT-Creation-Date: 2014-09-23 02:03-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -39,7 +39,7 @@ msgstr "" msgid "Error" msgstr "" -#: lib/trashbin.php:940 lib/trashbin.php:942 +#: lib/trashbin.php:966 lib/trashbin.php:968 msgid "restored" msgstr "" diff --git a/l10n/templates/files_versions.pot b/l10n/templates/files_versions.pot index cd62beb6507..c841a4b6452 100644 --- a/l10n/templates/files_versions.pot +++ b/l10n/templates/files_versions.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ownCloud Core 6.0.0\n" "Report-Msgid-Bugs-To: translations@owncloud.org\n" -"POT-Creation-Date: 2014-09-22 01:54-0400\n" +"POT-Creation-Date: 2014-09-23 02:03-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" diff --git a/l10n/templates/lib.pot b/l10n/templates/lib.pot index bf8a965cf5a..e37cdebb4c9 100644 --- a/l10n/templates/lib.pot +++ b/l10n/templates/lib.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ownCloud Core 6.0.0\n" "Report-Msgid-Bugs-To: translations@owncloud.org\n" -"POT-Creation-Date: 2014-09-22 01:54-0400\n" +"POT-Creation-Date: 2014-09-23 02:04-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" diff --git a/l10n/templates/private.pot b/l10n/templates/private.pot index fb8ed2a6268..234e1494fca 100644 --- a/l10n/templates/private.pot +++ b/l10n/templates/private.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ownCloud Core 6.0.0\n" "Report-Msgid-Bugs-To: translations@owncloud.org\n" -"POT-Creation-Date: 2014-09-22 01:54-0400\n" +"POT-Creation-Date: 2014-09-23 02:04-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" diff --git a/l10n/templates/settings.pot b/l10n/templates/settings.pot index a82506faea8..2d1bcd0918b 100644 --- a/l10n/templates/settings.pot +++ b/l10n/templates/settings.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ownCloud Core 6.0.0\n" "Report-Msgid-Bugs-To: translations@owncloud.org\n" -"POT-Creation-Date: 2014-09-22 01:54-0400\n" +"POT-Creation-Date: 2014-09-23 02:04-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" diff --git a/l10n/templates/user_ldap.pot b/l10n/templates/user_ldap.pot index 1223abc4ea5..a4e9433c881 100644 --- a/l10n/templates/user_ldap.pot +++ b/l10n/templates/user_ldap.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ownCloud Core 6.0.0\n" "Report-Msgid-Bugs-To: translations@owncloud.org\n" -"POT-Creation-Date: 2014-09-22 01:54-0400\n" +"POT-Creation-Date: 2014-09-23 02:03-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" diff --git a/l10n/templates/user_webdavauth.pot b/l10n/templates/user_webdavauth.pot index af4478c7432..4f37d64b64d 100644 --- a/l10n/templates/user_webdavauth.pot +++ b/l10n/templates/user_webdavauth.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ownCloud Core 6.0.0\n" "Report-Msgid-Bugs-To: translations@owncloud.org\n" -"POT-Creation-Date: 2014-09-22 01:54-0400\n" +"POT-Creation-Date: 2014-09-23 02:03-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" diff --git a/lib/l10n/bn_BD.php b/lib/l10n/bn_BD.php index 2440616b88d..89149cf96c5 100644 --- a/lib/l10n/bn_BD.php +++ b/lib/l10n/bn_BD.php @@ -17,6 +17,7 @@ $TRANSLATIONS = array( "App directory already exists" => "এই অ্যাপ ডিরেক্টরিটি পূর্ব থেকেই বিদ্যমান", "Can't create app folder. Please fix permissions. %s" => "অ্যাপ ফোল্ডার বানানো হেলনা। অনুমতি নির্ধারণ করুন। %s", "No source specified when installing app" => "অ্যাপ ইনস্টল করতে যেয়ে কোন উৎস নির্দিষ্ট করা হয়নি", +"Failed to open archive when installing app" => "অ্যাপ ইনস্টল করতে যেয়ে আর্কাইভ উম্মুক্তকরণ ব্যার্থ হলো", "App does not provide an info.xml file" => "অ্যাপের সঙ্গে একটি info.xml ফাইল নেই", "App can't be installed because of not allowed code in the App" => "অ্যাপের সাথে অননুমোদিত কোড থাকায় অ্যাপটি ইনস্টল করা যাবেনা", "App can't be installed because it contains the <shipped>true</shipped> tag which is not allowed for non shipped apps" => "অ্যাপ ইনস্টল করা যাবেনা কারণ এতে ননশিপড অ্যাপ এর জন্য অননুমোদিত <shipped>true</shipped> ট্যাগ বিদ্যমান ", diff --git a/lib/l10n/fr.php b/lib/l10n/fr.php index 3f1fe6a9925..0c85c7cfe3d 100644 --- a/lib/l10n/fr.php +++ b/lib/l10n/fr.php @@ -4,6 +4,8 @@ $TRANSLATIONS = array( "This can usually be fixed by giving the webserver write access to the config directory" => "Ce problème est généralement résolu en donnant au serveur web un accès en écriture à ce répertoire", "See %s" => "Voir %s", "This can usually be fixed by %sgiving the webserver write access to the config directory%s." => "Ce problème est généralement résolu %sen donnant au serveur web un accès en écriture au répertoire de configuration%s.", +"Sample configuration detected" => "Configuration d'example détectée", +"It has been detected that the sample configuration has been copied. This can break your installation and is unsupported. Please read the documentation before performing changes on config.php" => "Il a été détecté que le configuration donnée à titre d'exemple a été copiée. Cela peut rendre votre installation inopérante et n'est pas supporté. Veuillez lire la documentation avant d'effectuer des modifications dans config.php", "Help" => "Aide", "Personal" => "Personnel", "Settings" => "Paramètres", diff --git a/lib/private/connector/sabre/directory.php b/lib/private/connector/sabre/directory.php index 9cd7c553f0b..597fbdae0cc 100644 --- a/lib/private/connector/sabre/directory.php +++ b/lib/private/connector/sabre/directory.php @@ -192,7 +192,10 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node throw new \Sabre\DAV\Exception\Forbidden(); } - $this->fileView->rmdir($this->path); + if (!$this->fileView->rmdir($this->path)) { + // assume it wasn't possible to remove due to permission issue + throw new \Sabre\DAV\Exception\Forbidden(); + } } diff --git a/lib/private/connector/sabre/file.php b/lib/private/connector/sabre/file.php index 246749903b3..903c3447b56 100644 --- a/lib/private/connector/sabre/file.php +++ b/lib/private/connector/sabre/file.php @@ -167,7 +167,11 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements \Sabre\ if (!$this->info->isDeletable()) { throw new \Sabre\DAV\Exception\Forbidden(); } - $this->fileView->unlink($this->path); + + if (!$this->fileView->unlink($this->path)) { + // assume it wasn't possible to delete due to permissions + throw new \Sabre\DAV\Exception\Forbidden(); + } // remove properties $this->removeProperties(); diff --git a/lib/private/files/stream/close.php b/lib/private/files/stream/close.php index 0e1f088fcf9..97e45e37ad7 100644 --- a/lib/private/files/stream/close.php +++ b/lib/private/files/stream/close.php @@ -29,7 +29,7 @@ class Close { } public function stream_seek($offset, $whence = SEEK_SET) { - fseek($this->source, $offset, $whence); + return fseek($this->source, $offset, $whence) === 0; } public function stream_tell() { diff --git a/lib/private/files/stream/oc.php b/lib/private/files/stream/oc.php index c206b41f55e..8c3531638ec 100644 --- a/lib/private/files/stream/oc.php +++ b/lib/private/files/stream/oc.php @@ -48,7 +48,7 @@ class OC { } public function stream_seek($offset, $whence = SEEK_SET) { - fseek($this->fileSource, $offset, $whence); + return fseek($this->fileSource, $offset, $whence) === 0; } public function stream_tell() { diff --git a/lib/private/files/stream/quota.php b/lib/private/files/stream/quota.php index bb4623b1a7b..cef9d84f560 100644 --- a/lib/private/files/stream/quota.php +++ b/lib/private/files/stream/quota.php @@ -83,7 +83,7 @@ class Quota { } // this wrapper needs to return "true" for success. // the fseek call itself returns 0 on succeess - return !fseek($this->source, $offset, $whence); + return fseek($this->source, $offset, $whence) === 0; } public function stream_tell() { diff --git a/lib/private/helper.php b/lib/private/helper.php index f696b5a8900..1297d356d09 100644 --- a/lib/private/helper.php +++ b/lib/private/helper.php @@ -630,10 +630,10 @@ class OC_Helper { * temporary files are automatically cleaned up after the script is finished */ public static function tmpFolder() { - $path = get_temp_dir() . '/' . md5(time() . rand()); + $path = get_temp_dir() . DIRECTORY_SEPARATOR . md5(time() . rand()); mkdir($path); self::$tmpFiles[] = $path; - return $path . '/'; + return $path . DIRECTORY_SEPARATOR; } /** diff --git a/lib/private/preview.php b/lib/private/preview.php index b04cc2b8564..9d44d00e686 100755 --- a/lib/private/preview.php +++ b/lib/private/preview.php @@ -13,7 +13,6 @@ */ namespace OC; -use OC\Files\Filesystem; use OC\Preview\Provider; use OCP\Files\NotFoundException; @@ -23,7 +22,6 @@ require_once 'preview/mp3.php'; require_once 'preview/pdf.php'; require_once 'preview/svg.php'; require_once 'preview/txt.php'; -require_once 'preview/unknown.php'; require_once 'preview/office.php'; require_once 'preview/tiff.php'; @@ -62,6 +60,7 @@ class Preview { //preview providers static private $providers = array(); static private $registeredProviders = array(); + static private $enabledProviders = array(); /** * @var \OCP\Files\FileInfo @@ -669,12 +668,39 @@ class Preview { } /** - * register a new preview provider to be used + * Register a new preview provider to be used + * @param $class * @param array $options - * @return void */ public static function registerProvider($class, $options = array()) { - self::$registeredProviders[] = array('class' => $class, 'options' => $options); + /** + * Only register providers that have been explicitly enabled + * + * The following providers are enabled by default: + * - OC\Preview\Image + * - OC\Preview\MP3 + * - OC\Preview\TXT + * - OC\Preview\MarkDown + * + * The following providers are disabled by default due to performance or privacy concerns: + * - OC\Preview\Office + * - OC\Preview\SVG + * - OC\Preview\Movies + * - OC\Preview\PDF + * - OC\Preview\Tiff + */ + if(empty(self::$enabledProviders)) { + self::$enabledProviders = \OC::$server->getConfig()->getSystemValue('enabledPreviewProviders', array( + 'OC\Preview\Image', + 'OC\Preview\MP3', + 'OC\Preview\TXT', + 'OC\Preview\MarkDown', + )); + } + + if(in_array($class, self::$enabledProviders)) { + self::$registeredProviders[] = array('class' => $class, 'options' => $options); + } } /** @@ -682,9 +708,8 @@ class Preview { * @return void */ private static function initProviders() { - if (!\OC_Config::getValue('enable_previews', true)) { - $provider = new Preview\Unknown(array()); - self::$providers = array($provider->getMimeType() => $provider); + if (!\OC::$server->getConfig()->getSystemValue('enable_previews', true)) { + self::$providers = array(); return; } @@ -698,12 +723,12 @@ class Preview { /** @var $object Provider */ $object = new $class($options); - self::$providers[$object->getMimeType()] = $object; } $keys = array_map('strlen', array_keys(self::$providers)); array_multisort($keys, SORT_DESC, self::$providers); + } public static function post_write($args) { @@ -758,9 +783,7 @@ class Preview { self::initProviders(); } - //remove last element because it has the mimetype * - $providers = array_slice(self::$providers, 0, -1); - foreach ($providers as $supportedMimeType => $provider) { + foreach (self::$providers as $supportedMimeType => $provider) { /** * @var \OC\Preview\Provider $provider */ diff --git a/lib/private/preview/svg.php b/lib/private/preview/svg.php index 82ef3cdebf6..0b5dbc9716f 100644 --- a/lib/private/preview/svg.php +++ b/lib/private/preview/svg.php @@ -31,6 +31,11 @@ if (extension_loaded('imagick')) { $content = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' . $content; } + // Do not parse SVG files with references + if(stripos($content, 'xlink:href') !== false) { + return false; + } + $svg->readImageBlob($content); $svg->setImageFormat('png32'); } catch (\Exception $e) { diff --git a/lib/private/preview/unknown.php b/lib/private/preview/unknown.php deleted file mode 100644 index 2d3b5c5655e..00000000000 --- a/lib/private/preview/unknown.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * Copyright (c) 2013 Frank Karlitschek frank@owncloud.org - * Copyright (c) 2013 Georg Ehrke georg@ownCloud.com - * This file is licensed under the Affero General Public License version 3 or - * later. - * See the COPYING-README file. - */ -namespace OC\Preview; - -class Unknown extends Provider { - - public function getMimeType() { - return '/.*/'; - } - - public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) { - $mimetype = $fileview->getMimeType($path); - - $path = \OC_Helper::mimetypeIcon($mimetype); - $path = \OC::$SERVERROOT . substr($path, strlen(\OC::$WEBROOT)); - - $svgPath = substr_replace($path, 'svg', -3); - - if (extension_loaded('imagick') && file_exists($svgPath) && count(@\Imagick::queryFormats("SVG")) === 1) { - - // http://www.php.net/manual/de/imagick.setresolution.php#85284 - $svg = new \Imagick(); - $svg->readImage($svgPath); - $res = $svg->getImageResolution(); - $x_ratio = $res['x'] / $svg->getImageWidth(); - $y_ratio = $res['y'] / $svg->getImageHeight(); - $svg->removeImage(); - $svg->setResolution($maxX * $x_ratio, $maxY * $y_ratio); - $svg->setBackgroundColor(new \ImagickPixel('transparent')); - $svg->readImage($svgPath); - $svg->setImageFormat('png32'); - - $image = new \OC_Image(); - $image->loadFromData($svg); - } else { - $image = new \OC_Image($path); - } - - return $image; - } -} - -\OC\Preview::registerProvider('OC\Preview\Unknown'); diff --git a/settings/l10n/fr.php b/settings/l10n/fr.php index 42cd848597f..9ce50d51d32 100644 --- a/settings/l10n/fr.php +++ b/settings/l10n/fr.php @@ -43,6 +43,7 @@ $TRANSLATIONS = array( "Are you really sure you want add \"{domain}\" as trusted domain?" => "Êtes-vous vraiment sûr de vouloir ajouter \"{domain}\" comme domaine de confiance ?", "Add trusted domain" => "Ajouter un domaine de confiance", "Sending..." => "Envoi en cours...", +"All" => "Tous", "User Documentation" => "Documentation utilisateur", "Admin Documentation" => "Documentation administrateur", "Update to {appversion}" => "Mettre à jour vers {appversion}", @@ -71,12 +72,12 @@ $TRANSLATIONS = array( "Decrypting files... Please wait, this can take some time." => "Déchiffrement en cours... Cela peut prendre un certain temps.", "Delete encryption keys permanently." => "Supprimer définitivement les clés de chiffrement", "Restore encryption keys." => "Restaurer les clés de chiffrement", +"Groups" => "Groupes", "Unable to delete {objName}" => "Impossible de supprimer {objName}", "Error creating group" => "Erreur lors de la création du groupe", "A valid group name must be provided" => "Vous devez spécifier un nom de groupe valide", "deleted {groupName}" => "{groupName} supprimé", "undo" => "annuler", -"Groups" => "Groupes", "Group Admin" => "Admin Groupe", "never" => "jamais", "deleted {userName}" => "{userName} supprimé", @@ -119,6 +120,8 @@ $TRANSLATIONS = array( "We strongly suggest to install the required packages on your system to support one of the following locales: %s." => "Nous conseillons vivement d'installer les paquets requis sur votre système pour supporter l'un des paramètres régionaux suivants : %s.", "Internet connection not working" => "La connexion internet ne fonctionne pas", "This server has no working internet connection. This means that some of the features like mounting of external storage, notifications about updates or installation of 3rd party apps don´t work. Accessing files from remote and sending of notification emails might also not work. We suggest to enable internet connection for this server if you want to have all features." => "Ce serveur ne peut se connecter à internet. Cela signifie que certaines fonctionnalités, telles que le montage de supports de stockage distants, les notifications de mises à jour ou l'installation d'applications tierces ne fonctionneront pas. L'accès aux fichiers à distance, ainsi que les notifications par mails ne seront pas fonctionnels également. Il est recommandé d'activer la connexion internet pour ce serveur si vous souhaitez disposer de l'ensemble des fonctionnalités offertes.", +"URL generation in notification emails" => "Génération d'URL dans les mails de notification", +"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" => "Si votre installation n'a pas été effectuée à la racine du domaine et qu'elle utilise le cron du système, il peut y avoir des problèmes avec la génération d'URL. Pour les éviter, veuillez configurer l'option \"overwritewebroot\" de votre fichier config.php avec le chemin de la racine de votre installation (suggéré : \"%s\")", "Cron" => "Cron", "Last cron was executed at %s." => "Le dernier cron s'est exécuté à %s.", "Last cron was executed at %s. This is more than an hour ago, something seems wrong." => "Le dernier cron s'est exécuté à %s. Cela fait plus d'une heure, quelque chose a du mal se passer.", @@ -170,7 +173,6 @@ $TRANSLATIONS = array( "See application website" => "Voir le site web de l'application", "<span class=\"licence\"></span>-licensed by <span class=\"author\"></span>" => "Distribué sous licence <span class=\"licence\"></span>, par <span class=\"author\"></span>", "Enable only for specific groups" => "Activer uniquement pour certains groupes", -"All" => "Tous", "Administrator Documentation" => "Documentation administrateur", "Online Documentation" => "Documentation en ligne", "Forum" => "Forum", @@ -201,6 +203,10 @@ $TRANSLATIONS = array( "Language" => "Langue", "Help translate" => "Aidez à traduire", "SSL root certificates" => "Certificats racine SSL", +"Common Name" => "Nom d'usage", +"Valid until" => "Valide jusqu'à", +"Issued By" => "Délivré par", +"Valid until %s" => "Valide jusqu'à %s", "Import Root Certificate" => "Importer un certificat racine", "The encryption app is no longer enabled, please decrypt all your files" => "L'app de chiffrement n’est plus activée, veuillez déchiffrer tous vos fichiers", "Log-in password" => "Mot de passe de connexion", @@ -208,6 +214,7 @@ $TRANSLATIONS = array( "Your encryption keys are moved to a backup location. If something went wrong you can restore the keys. Only delete them permanently if you are sure that all files are decrypted correctly." => "Vos clés de chiffrement ont été déplacées dans l'emplacement de backup. Si quelque chose devait mal se passer, vous pouvez restaurer les clés. Choisissez la suppression permanente seulement si vous êtes sûr que tous les fichiers ont été déchiffrés correctement.", "Restore Encryption Keys" => "Restaurer les clés de chiffrement", "Delete Encryption Keys" => "Supprimer les clés de chiffrement", +"Show storage location" => "Afficher l'emplacement du stockage", "Show last log in" => "Montrer la dernière identification", "Login Name" => "Nom d'utilisateur", "Create" => "Créer", diff --git a/tests/data/testcal.ics b/tests/data/testcal.ics deleted file mode 100644 index e05f01ba1c2..00000000000 --- a/tests/data/testcal.ics +++ /dev/null @@ -1,13 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//some random cal software//EN -VERSION:2.0 -BEGIN:VEVENT -CREATED:20130102T120000Z -LAST-MODIFIED:20130102T120000Z -DTSTAMP:20130102T120000Z -UID:f106ecdf-c716-43ef-9d94-4e6f19f2fcfb -SUMMARY:a test cal file -DTSTART;VALUE=DATE:20130101 -DTEND;VALUE=DATE:20130102 -END:VEVENT -END:VCALENDAR
\ No newline at end of file diff --git a/tests/data/testcontact.vcf b/tests/data/testcontact.vcf deleted file mode 100644 index 2af963d6916..00000000000 --- a/tests/data/testcontact.vcf +++ /dev/null @@ -1,6 +0,0 @@ -BEGIN:VCARD -VERSION:3.0 -PRODID:-//some random contact software//EN -N:def;abc;;; -FN:abc def -END:VCARD
\ No newline at end of file diff --git a/tests/lib/cache/file.php b/tests/lib/cache/file.php index 3767c83fcb1..0e19c105cd1 100644 --- a/tests/lib/cache/file.php +++ b/tests/lib/cache/file.php @@ -46,8 +46,8 @@ class FileCache extends \Test_Cache { $storage = new \OC\Files\Storage\Temporary(array()); \OC\Files\Filesystem::mount($storage,array(),'/'); $datadir = str_replace('local::', '', $storage->getId()); - $this->datadir = \OC_Config::getValue('datadirectory', \OC::$SERVERROOT.'/data'); - \OC_Config::setValue('datadirectory', $datadir); + $this->datadir = \OC_Config::getValue('cachedirectory', \OC::$SERVERROOT.'/data/cache'); + \OC_Config::setValue('cachedirectory', $datadir); \OC_User::clearBackends(); \OC_User::useBackend(new \OC_User_Dummy()); @@ -67,6 +67,6 @@ class FileCache extends \Test_Cache { public function tearDown() { \OC_User::setUserId($this->user); - \OC_Config::setValue('datadirectory', $this->datadir); + \OC_Config::setValue('cachedirectory', $this->datadir); } } diff --git a/tests/lib/cache/usercache.php b/tests/lib/cache/usercache.php index 21b7f848ab6..a1b6af1c55d 100644 --- a/tests/lib/cache/usercache.php +++ b/tests/lib/cache/usercache.php @@ -42,8 +42,8 @@ class UserCache extends \Test_Cache { $storage = new \OC\Files\Storage\Temporary(array()); \OC\Files\Filesystem::mount($storage,array(),'/'); $datadir = str_replace('local::', '', $storage->getId()); - $this->datadir = \OC_Config::getValue('datadirectory', \OC::$SERVERROOT.'/data'); - \OC_Config::setValue('datadirectory', $datadir); + $this->datadir = \OC_Config::getValue('cachedirectory', \OC::$SERVERROOT.'/data/cache'); + \OC_Config::setValue('cachedirectory', $datadir); \OC_User::clearBackends(); \OC_User::useBackend(new \OC_User_Dummy()); @@ -63,6 +63,5 @@ class UserCache extends \Test_Cache { public function tearDown() { \OC_User::setUserId($this->user); - \OC_Config::setValue('datadirectory', $this->datadir); } } diff --git a/tests/lib/config.php b/tests/lib/config.php index c67a66c832e..f739df3ce97 100644 --- a/tests/lib/config.php +++ b/tests/lib/config.php @@ -79,6 +79,9 @@ class Test_Config extends PHPUnit_Framework_TestCase { * @expectedException \OC\HintException */ public function testWriteData() { + if (\OC_Util::runningOnWindows()) { + throw new \OC\HintException('this is ireelevent for windows'); + } $config = new OC\Config('/non-writable'); $config->setValue('foo', 'bar'); } diff --git a/tests/lib/connector/sabre/directory.php b/tests/lib/connector/sabre/directory.php index 8a1550ffa95..453d8e8d42a 100644 --- a/tests/lib/connector/sabre/directory.php +++ b/tests/lib/connector/sabre/directory.php @@ -8,18 +8,24 @@ */ class Test_OC_Connector_Sabre_Directory extends PHPUnit_Framework_TestCase { + private $view; + private $info; + + public function setUp() { + $this->view = $this->getMock('OC\Files\View', array(), array(), '', false); + $this->info = $this->getMock('OC\Files\FileInfo', array(), array(), '', false); + } + private function getRootDir() { - $view = $this->getMock('OC\Files\View', array(), array(), '', false); - $view->expects($this->once()) + $this->view->expects($this->once()) ->method('getRelativePath') ->will($this->returnValue('')); - $info = $this->getMock('OC\Files\FileInfo', array(), array(), '', false); - $info->expects($this->once()) + $this->info->expects($this->once()) ->method('getPath') ->will($this->returnValue('')); - return new OC_Connector_Sabre_Directory($view, $info); + return new OC_Connector_Sabre_Directory($this->view, $this->info); } /** @@ -45,4 +51,52 @@ class Test_OC_Connector_Sabre_Directory extends PHPUnit_Framework_TestCase { $dir = $this->getRootDir(); $dir->delete(); } + + /** + * + */ + public function testDeleteFolderWhenAllowed() { + // deletion allowed + $this->info->expects($this->once()) + ->method('isDeletable') + ->will($this->returnValue(true)); + + // but fails + $this->view->expects($this->once()) + ->method('rmdir') + ->will($this->returnValue(true)); + + $dir = $this->getRootDir(); + $dir->delete(); + } + + /** + * @expectedException \Sabre\DAV\Exception\Forbidden + */ + public function testDeleteFolderFailsWhenNotAllowed() { + $this->info->expects($this->once()) + ->method('isDeletable') + ->will($this->returnValue(false)); + + $dir = $this->getRootDir(); + $dir->delete(); + } + + /** + * @expectedException \Sabre\DAV\Exception\Forbidden + */ + public function testDeleteFolderThrowsWhenDeletionFailed() { + // deletion allowed + $this->info->expects($this->once()) + ->method('isDeletable') + ->will($this->returnValue(true)); + + // but fails + $this->view->expects($this->once()) + ->method('rmdir') + ->will($this->returnValue(false)); + + $dir = $this->getRootDir(); + $dir->delete(); + } } diff --git a/tests/lib/connector/sabre/file.php b/tests/lib/connector/sabre/file.php index 1602c5181fe..0993a27f372 100644 --- a/tests/lib/connector/sabre/file.php +++ b/tests/lib/connector/sabre/file.php @@ -143,4 +143,67 @@ class Test_OC_Connector_Sabre_File extends PHPUnit_Framework_TestCase { // action $file->put('test data'); } + + /** + * + */ + public function testDeleteWhenAllowed() { + // setup + $view = $this->getMock('\OC\Files\View', + array()); + + $view->expects($this->once()) + ->method('unlink') + ->will($this->returnValue(true)); + + $info = new \OC\Files\FileInfo('/test.txt', null, null, array( + 'permissions' => \OCP\PERMISSION_ALL + )); + + $file = new OC_Connector_Sabre_File($view, $info); + + // action + $file->delete(); + } + + /** + * @expectedException \Sabre\DAV\Exception\Forbidden + */ + public function testDeleteThrowsWhenDeletionNotAllowed() { + // setup + $view = $this->getMock('\OC\Files\View', + array()); + + $info = new \OC\Files\FileInfo('/test.txt', null, null, array( + 'permissions' => 0 + )); + + $file = new OC_Connector_Sabre_File($view, $info); + + // action + $file->delete(); + } + + /** + * @expectedException \Sabre\DAV\Exception\Forbidden + */ + public function testDeleteThrowsWhenDeletionFailed() { + // setup + $view = $this->getMock('\OC\Files\View', + array()); + + // but fails + $view->expects($this->once()) + ->method('unlink') + ->will($this->returnValue(false)); + + $info = new \OC\Files\FileInfo('/test.txt', null, null, array( + 'permissions' => \OCP\PERMISSION_ALL + )); + + $file = new OC_Connector_Sabre_File($view, $info); + + // action + $file->delete(); + } } diff --git a/tests/lib/largefilehelpergetfilesize.php b/tests/lib/largefilehelpergetfilesize.php index 86ce6d295cf..21a0aa9a233 100644 --- a/tests/lib/largefilehelpergetfilesize.php +++ b/tests/lib/largefilehelpergetfilesize.php @@ -19,7 +19,8 @@ class LargeFileHelperGetFileSize extends \PHPUnit_Framework_TestCase { public function setUp() { parent::setUp(); - $this->filename = __DIR__ . '/../data/data.tar.gz'; + $ds = DIRECTORY_SEPARATOR; + $this->filename = dirname(__DIR__) . "{$ds}data{$ds}data.tar.gz"; $this->fileSize = 4195; $this->helper = new \OC\LargeFileHelper; } diff --git a/tests/lib/preview.php b/tests/lib/preview.php index 4ef61fb8257..2febe524cba 100644 --- a/tests/lib/preview.php +++ b/tests/lib/preview.php @@ -97,13 +97,9 @@ class Preview extends \PHPUnit_Framework_TestCase { public function txtBlacklist() { $txt = 'random text file'; - $ics = file_get_contents(__DIR__ . '/../data/testcal.ics'); - $vcf = file_get_contents(__DIR__ . '/../data/testcontact.vcf'); return array( array('txt', $txt, false), - array('ics', $ics, true), - array('vcf', $vcf, true), ); } diff --git a/tests/lib/streamwrappers.php b/tests/lib/streamwrappers.php index d15b712139d..1b61446f4dc 100644 --- a/tests/lib/streamwrappers.php +++ b/tests/lib/streamwrappers.php @@ -79,6 +79,16 @@ class Test_StreamWrappers extends PHPUnit_Framework_TestCase { $this->assertEquals(array('.', '..', 'bar.txt', 'foo.txt'), scandir('oc:///')); $this->assertEquals('qwerty', file_get_contents('oc:///bar.txt')); + $fh = fopen('oc:///bar.txt', 'rb'); + $this->assertSame(0, ftell($fh)); + $content = fread($fh, 4); + $this->assertSame(4, ftell($fh)); + $this->assertSame('qwer', $content); + $content = fread($fh, 1); + $this->assertSame(5, ftell($fh)); + $this->assertSame(0, fseek($fh, 0)); + $this->assertSame(0, ftell($fh)); + unlink('oc:///foo.txt'); $this->assertEquals(array('.', '..', 'bar.txt'), scandir('oc:///')); } |