summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTING.md16
-rw-r--r--apps/dav/lib/connector/sabre/objecttree.php2
-rw-r--r--apps/dav/tests/unit/connector/sabre/objecttree.php41
-rw-r--r--apps/encryption/l10n/pt_BR.js2
-rw-r--r--apps/encryption/l10n/pt_BR.json2
-rw-r--r--apps/files/command/scan.php190
-rw-r--r--apps/files/l10n/pt_BR.js4
-rw-r--r--apps/files/l10n/pt_BR.json4
-rw-r--r--apps/files_external/l10n/pt_BR.js10
-rw-r--r--apps/files_external/l10n/pt_BR.json10
-rw-r--r--apps/files_sharing/ajax/external.php11
-rw-r--r--apps/files_sharing/js/external.js3
-rw-r--r--apps/files_sharing/js/public.js7
-rw-r--r--apps/files_sharing/js/share.js3
-rw-r--r--apps/files_sharing/l10n/fi_FI.js1
-rw-r--r--apps/files_sharing/l10n/fi_FI.json1
-rw-r--r--apps/files_sharing/l10n/it.js1
-rw-r--r--apps/files_sharing/l10n/it.json1
-rw-r--r--apps/files_sharing/l10n/lt_LT.js1
-rw-r--r--apps/files_sharing/l10n/lt_LT.json1
-rw-r--r--apps/files_sharing/l10n/pt_BR.js17
-rw-r--r--apps/files_sharing/l10n/pt_BR.json17
-rw-r--r--apps/files_sharing/l10n/sq.js4
-rw-r--r--apps/files_sharing/l10n/sq.json4
-rw-r--r--apps/files_sharing/lib/controllers/sharecontroller.php1
-rw-r--r--apps/files_sharing/templates/public.php2
-rw-r--r--apps/files_sharing/tests/controller/sharecontroller.php1
-rw-r--r--apps/files_sharing/tests/js/externalSpec.js4
-rw-r--r--apps/files_sharing/tests/js/sharedfilelistSpec.js2
-rw-r--r--apps/files_trashbin/l10n/pt_BR.js4
-rw-r--r--apps/files_trashbin/l10n/pt_BR.json4
-rw-r--r--apps/user_ldap/appinfo/update.php16
-rw-r--r--apps/user_ldap/lib/access.php95
-rw-r--r--apps/user_ldap/lib/mapping/abstractmapping.php12
-rw-r--r--apps/user_ldap/tests/user_ldap.php62
-rw-r--r--apps/user_ldap/user_ldap.php43
-rw-r--r--config/config.sample.php16
-rw-r--r--core/avatar/avatarcontroller.php24
-rw-r--r--core/js/files/client.js2
-rw-r--r--core/js/tests/specs/files/clientSpec.js10
-rw-r--r--core/l10n/pt_BR.js6
-rw-r--r--core/l10n/pt_BR.json6
-rw-r--r--core/templates/404.php2
-rw-r--r--lib/l10n/fi_FI.js1
-rw-r--r--lib/l10n/fi_FI.json1
-rw-r--r--lib/l10n/it.js1
-rw-r--r--lib/l10n/it.json1
-rw-r--r--lib/l10n/pt_BR.js1
-rw-r--r--lib/l10n/pt_BR.json1
-rw-r--r--lib/l10n/sq.js1
-rw-r--r--lib/l10n/sq.json1
-rw-r--r--lib/private/avatar.php69
-rw-r--r--lib/private/helper.php21
-rw-r--r--lib/private/log/owncloud.php3
-rw-r--r--lib/private/route/router.php2
-rw-r--r--lib/private/share/helper.php34
-rw-r--r--lib/private/share/share.php13
-rw-r--r--lib/private/template/functions.php2
-rw-r--r--lib/private/templatelayout.php12
-rw-r--r--lib/public/iavatar.php11
-rw-r--r--lib/public/util.php2
-rw-r--r--settings/l10n/pt_BR.js10
-rw-r--r--settings/l10n/pt_BR.json10
-rw-r--r--settings/l10n/sq.js2
-rw-r--r--settings/l10n/sq.json2
-rw-r--r--tests/core/avatar/avatarcontrollertest.php42
-rw-r--r--tests/lib/avatartest.php15
-rw-r--r--tests/lib/helper.php46
-rw-r--r--tests/lib/share/helper.php37
69 files changed, 771 insertions, 235 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index ecd2b1e49e5..66d54c61e98 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -18,20 +18,8 @@ If you have questions about how to install or use ownCloud, please direct these
- [iOS client](https://github.com/owncloud/ios/issues)
- [Desktop client](https://github.com/owncloud/client/issues)
- [Documentation](https://github.com/owncloud/documentation/issues)
- - Apps:
- - [Activity](https://github.com/owncloud/activity/issues)
- - [Bookmarks](https://github.com/owncloud/bookmarks/issues)
- - [Calendar](https://github.com/owncloud/calendar/issues)
- - [Contacts](https://github.com/owncloud/contacts/issues)
- - [Documents](https://github.com/owncloud/documents/issues)
- - [Gallery](https://github.com/owncloud/gallery/issues)
- - [Mail](https://github.com/owncloud/mail/issues)
- - [Music](https://github.com/owncloud/music/issues)
- - [News](https://github.com/owncloud/news/issues)
- - [Notes](https://github.com/owncloud/notes/issues)
- - [Shorty](https://github.com/owncloud/shorty/issues)
- - [Tasks](https://github.com/owncloud/tasks/issues)
- - [All other apps](https://github.com/owncloud/apps/issues)
+ - [ownCloud apps](https://github.com/owncloud/core/wiki/Maintainers#apps-repo)
+
* Report the issue using our [template][template], it includes all the information we need to track down the issue.
Help us to maximize the effort we can spend fixing issues and adding new features, by not reporting duplicate issues.
diff --git a/apps/dav/lib/connector/sabre/objecttree.php b/apps/dav/lib/connector/sabre/objecttree.php
index 2e9c1b9916c..809d202aea4 100644
--- a/apps/dav/lib/connector/sabre/objecttree.php
+++ b/apps/dav/lib/connector/sabre/objecttree.php
@@ -190,7 +190,7 @@ class ObjectTree extends \Sabre\DAV\Tree {
$targetNodeExists = $this->nodeExists($destinationPath);
$sourceNode = $this->getNodeForPath($sourcePath);
if ($sourceNode instanceof \Sabre\DAV\ICollection && $targetNodeExists) {
- throw new \Sabre\DAV\Exception\Forbidden('Could not copy directory ' . $sourceNode . ', target exists');
+ throw new \Sabre\DAV\Exception\Forbidden('Could not copy directory ' . $sourceNode->getName() . ', target exists');
}
list($sourceDir,) = \Sabre\HTTP\URLUtil::splitPath($sourcePath);
list($destinationDir,) = \Sabre\HTTP\URLUtil::splitPath($destinationPath);
diff --git a/apps/dav/tests/unit/connector/sabre/objecttree.php b/apps/dav/tests/unit/connector/sabre/objecttree.php
index 1cea4ff0b69..6164b96c986 100644
--- a/apps/dav/tests/unit/connector/sabre/objecttree.php
+++ b/apps/dav/tests/unit/connector/sabre/objecttree.php
@@ -294,4 +294,45 @@ class ObjectTree extends \Test\TestCase {
$this->assertInstanceOf('\Sabre\DAV\INode', $tree->getNodeForPath($path));
}
+
+ /**
+ * @expectedException \Sabre\DAV\Exception\Forbidden
+ * @expectedExceptionMessage Could not copy directory nameOfSourceNode, target exists
+ */
+ public function testFailingMove() {
+ $source = 'a/b';
+ $destination = 'b/b';
+ $updatables = array('a' => true, 'a/b' => true, 'b' => true, 'b/b' => false);
+ $deletables = array('a/b' => true);
+
+ $view = new TestDoubleFileView($updatables, $deletables);
+
+ $info = new FileInfo('', null, null, array(), null);
+
+ $rootDir = new \OCA\DAV\Connector\Sabre\Directory($view, $info);
+ $objectTree = $this->getMock('\OCA\DAV\Connector\Sabre\ObjectTree',
+ array('nodeExists', 'getNodeForPath'),
+ array($rootDir, $view));
+
+ $sourceNode = $this->getMockBuilder('\Sabre\DAV\ICollection')
+ ->disableOriginalConstructor()
+ ->getMock();
+ $sourceNode->expects($this->once())
+ ->method('getName')
+ ->will($this->returnValue('nameOfSourceNode'));
+
+ $objectTree->expects($this->once())
+ ->method('nodeExists')
+ ->with($this->identicalTo($destination))
+ ->will($this->returnValue(true));
+ $objectTree->expects($this->once())
+ ->method('getNodeForPath')
+ ->with($this->identicalTo($source))
+ ->will($this->returnValue($sourceNode));
+
+ /** @var $objectTree \OCA\DAV\Connector\Sabre\ObjectTree */
+ $mountManager = \OC\Files\Filesystem::getMountManager();
+ $objectTree->init($rootDir, $view, $mountManager);
+ $objectTree->move($source, $destination);
+ }
}
diff --git a/apps/encryption/l10n/pt_BR.js b/apps/encryption/l10n/pt_BR.js
index 334bbf05282..80c35dea495 100644
--- a/apps/encryption/l10n/pt_BR.js
+++ b/apps/encryption/l10n/pt_BR.js
@@ -30,7 +30,7 @@ OC.L10N.register(
"Can not read this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Não é possível ler este arquivo, provavelmente este é um arquivo compartilhado. Por favor, pergunte o dono do arquivo para recompartilhar o arquivo com você.",
"Hey there,\n\nthe admin enabled server-side-encryption. Your files were encrypted using the password '%s'.\n\nPlease login to the web interface, go to the section 'ownCloud basic encryption module' of your personal settings and update your encryption password by entering this password into the 'old log-in password' field and your current login-password.\n\n" : "Olá,\n\nO administrador habilitou criptografia-lado-servidor. Os seus arquivos foram criptografados usando a senha '%s'.\n\nPor favor faça o login para a interface da Web, vá para a seção 'ownCloud módulo de criptografia básico' das suas definições pessoais e atualize sua senha de criptografia, inserindo esta senha no campo 'senha antiga de log-in' e sua atual senha-de-login.\n\n",
"The share will expire on %s." : "O compartilhamento irá expirar em %s.",
- "Cheers!" : "Saúde!",
+ "Cheers!" : "Saudações!",
"Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section \"ownCloud basic encryption module\" of your personal settings and update your encryption password by entering this password into the \"old log-in password\" field and your current login-password.<br><br>" : "Olá,<br><br>o administrador habilitou criptografia-lado-servidor. Os seus arquivos foram criptografados usando a senha <strong>%s</strong>.<br><br>Por favor faça o login para a interface da Web, vá para a seção 'ownCloud módulo de criptografia básico' das suas definições pessoais e atualize sua senha de criptografia, inserindo esta senha no campo 'senha antiga de log-in' e sua atual senha-de-login..<br><br>",
"Encrypt the home storage" : "Criptografar a pasta de armazenamento home",
"Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" : "Ativar essa opção de criptografia para todos os arquivos armazenados no armazenamento principal, caso contrário, apenas arquivos no armazenamento externo serão criptografados",
diff --git a/apps/encryption/l10n/pt_BR.json b/apps/encryption/l10n/pt_BR.json
index 794eb478c74..b3ce8c7238e 100644
--- a/apps/encryption/l10n/pt_BR.json
+++ b/apps/encryption/l10n/pt_BR.json
@@ -28,7 +28,7 @@
"Can not read this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Não é possível ler este arquivo, provavelmente este é um arquivo compartilhado. Por favor, pergunte o dono do arquivo para recompartilhar o arquivo com você.",
"Hey there,\n\nthe admin enabled server-side-encryption. Your files were encrypted using the password '%s'.\n\nPlease login to the web interface, go to the section 'ownCloud basic encryption module' of your personal settings and update your encryption password by entering this password into the 'old log-in password' field and your current login-password.\n\n" : "Olá,\n\nO administrador habilitou criptografia-lado-servidor. Os seus arquivos foram criptografados usando a senha '%s'.\n\nPor favor faça o login para a interface da Web, vá para a seção 'ownCloud módulo de criptografia básico' das suas definições pessoais e atualize sua senha de criptografia, inserindo esta senha no campo 'senha antiga de log-in' e sua atual senha-de-login.\n\n",
"The share will expire on %s." : "O compartilhamento irá expirar em %s.",
- "Cheers!" : "Saúde!",
+ "Cheers!" : "Saudações!",
"Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section \"ownCloud basic encryption module\" of your personal settings and update your encryption password by entering this password into the \"old log-in password\" field and your current login-password.<br><br>" : "Olá,<br><br>o administrador habilitou criptografia-lado-servidor. Os seus arquivos foram criptografados usando a senha <strong>%s</strong>.<br><br>Por favor faça o login para a interface da Web, vá para a seção 'ownCloud módulo de criptografia básico' das suas definições pessoais e atualize sua senha de criptografia, inserindo esta senha no campo 'senha antiga de log-in' e sua atual senha-de-login..<br><br>",
"Encrypt the home storage" : "Criptografar a pasta de armazenamento home",
"Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" : "Ativar essa opção de criptografia para todos os arquivos armazenados no armazenamento principal, caso contrário, apenas arquivos no armazenamento externo serão criptografados",
diff --git a/apps/files/command/scan.php b/apps/files/command/scan.php
index 31ae555e041..7e00d8a2312 100644
--- a/apps/files/command/scan.php
+++ b/apps/files/command/scan.php
@@ -32,6 +32,7 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Helper\Table;
class Scan extends Command {
@@ -39,6 +40,15 @@ class Scan extends Command {
* @var \OC\User\Manager $userManager
*/
private $userManager;
+ /** @var float */
+ protected $execTime = 0;
+ /** @var int */
+ protected $foldersCounter = 0;
+ /** @var int */
+ protected $filesCounter = 0;
+ /** @var bool */
+ protected $interrupted = false;
+
public function __construct(\OC\User\Manager $userManager) {
$this->userManager = $userManager;
@@ -64,7 +74,13 @@ class Scan extends Command {
'quiet',
'q',
InputOption::VALUE_NONE,
- 'suppress output'
+ 'suppress any output'
+ )
+ ->addOption(
+ 'verbose',
+ '-v|vv|vvv',
+ InputOption::VALUE_NONE,
+ 'verbose the output'
)
->addOption(
'all',
@@ -74,19 +90,31 @@ class Scan extends Command {
);
}
- protected function scanFiles($user, $path, $quiet, OutputInterface $output) {
+ protected function scanFiles($user, $path, $verbose, OutputInterface $output) {
$scanner = new \OC\Files\Utils\Scanner($user, \OC::$server->getDatabaseConnection(), \OC::$server->getLogger());
- if (!$quiet) {
+ # printout and count
+ if ($verbose) {
$scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function ($path) use ($output) {
$output->writeln("Scanning file <info>$path</info>");
+ $this->filesCounter += 1;
});
$scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function ($path) use ($output) {
$output->writeln("Scanning folder <info>$path</info>");
+ $this->foldersCounter += 1;
});
$scanner->listen('\OC\Files\Utils\Scanner', 'StorageNotAvailable', function (StorageNotAvailableException $e) use ($output) {
$output->writeln("Error while scanning, storage not available (" . $e->getMessage() . ")");
});
+ # count only
+ } else {
+ $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function ($path) use ($output) {
+ $this->filesCounter += 1;
+ });
+ $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function ($path) use ($output) {
+ $this->foldersCounter += 1;
+ });
}
+
try {
$scanner->scan($path);
} catch (ForbiddenException $e) {
@@ -95,6 +123,7 @@ class Scan extends Command {
}
}
+
protected function execute(InputInterface $input, OutputInterface $output) {
$inputPath = $input->getOption('path');
if ($inputPath) {
@@ -106,24 +135,173 @@ class Scan extends Command {
} else {
$users = $input->getArgument('user_id');
}
- $quiet = $input->getOption('quiet');
-
if (count($users) === 0) {
$output->writeln("<error>Please specify the user id to scan, \"--all\" to scan for all users or \"--path=...\"</error>");
return;
}
+ # no messaging level option means: no full printout but statistics
+ # $quiet means no print at all
+ # $verbose means full printout including statistics
+ # -q -v full stat
+ # 0 0 no yes
+ # 0 1 yes yes
+ # 1 -- no no (quiet overrules verbose)
+ $verbose = $input->getOption('verbose');
+ $quiet = $input->getOption('quiet');
+ # restrict the verbosity level to VERBOSITY_VERBOSE
+ if ($output->getVerbosity()>OutputInterface::VERBOSITY_VERBOSE) {
+ $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
+ }
+ if ($quiet) {
+ $verbose = false;
+ }
+
+ $this->initTools();
+
foreach ($users as $user) {
if (is_object($user)) {
$user = $user->getUID();
}
$path = $inputPath ? $inputPath : '/' . $user;
if ($this->userManager->userExists($user)) {
- $this->scanFiles($user, $path, $quiet, $output);
+ # full: printout data if $verbose was set
+ $this->scanFiles($user, $path, $verbose, $output);
} else {
$output->writeln("<error>Unknown user $user</error>");
}
}
+
+ # stat: printout statistics if $quiet was not set
+ if (!$quiet) {
+ $this->presentStats($output);
+ }
+
+ }
+
+
+ /**
+ * Checks if the command was interrupted by ctrl-c
+ */
+ protected function checkForInterruption($output) {
+ if ($this->hasBeenInterrupted()) {
+ $this->presentResults($output);
+ exit;
+ }
+ }
+
+
+ /**
+ * Initialises some useful tools for the Command
+ */
+ protected function initTools() {
+ // Start the timer
+ $this->execTime = -microtime(true);
+ // Convert PHP errors to exceptions
+ set_error_handler([$this, 'exceptionErrorHandler'], E_ALL);
+
+ // Collect interrupts and notify the running command
+ pcntl_signal(SIGTERM, [$this, 'cancelOperation']);
+ pcntl_signal(SIGINT, [$this, 'cancelOperation']);
+ }
+
+
+ /**
+ * Changes the status of the command to "interrupted"
+ *
+ * Gives a chance to the command to properly terminate what it's doing
+ */
+ private function cancelOperation() {
+ $this->interrupted = true;
+ }
+
+
+ /**
+ * Processes PHP errors as exceptions in order to be able to keep track of problems
+ *
+ * @see https://secure.php.net/manual/en/function.set-error-handler.php
+ *
+ * @param int $severity the level of the error raised
+ * @param string $message
+ * @param string $file the filename that the error was raised in
+ * @param int $line the line number the error was raised
+ *
+ * @throws \ErrorException
+ */
+ public function exceptionErrorHandler($severity, $message, $file, $line) {
+ if (!(error_reporting() & $severity)) {
+ // This error code is not included in error_reporting
+ return;
+ }
+ throw new \ErrorException($message, 0, $severity, $file, $line);
}
+
+
+ /**
+ * @return bool
+ */
+ protected function hasBeenInterrupted() {
+ $cancelled = false;
+ pcntl_signal_dispatch();
+ if ($this->interrupted) {
+ $cancelled = true;
+ }
+
+ return $cancelled;
+ }
+
+
+ /**
+ * @param OutputInterface $output
+ */
+ protected function presentStats(OutputInterface $output) {
+ // Stop the timer
+ $this->execTime += microtime(true);
+ $output->writeln("");
+
+ $headers = [
+ 'Folders', 'Files', 'Elapsed time'
+ ];
+
+ $this->showSummary($headers, null, $output);
+ }
+
+
+ /**
+ * Shows a summary of operations
+ *
+ * @param string[] $headers
+ * @param string[] $rows
+ * @param OutputInterface $output
+ */
+ protected function showSummary($headers, $rows, OutputInterface $output) {
+ $niceDate = $this->formatExecTime();
+ if (!$rows) {
+ $rows = [
+ $this->foldersCounter,
+ $this->filesCounter,
+ $niceDate,
+ ];
+ }
+ $table = new Table($output);
+ $table
+ ->setHeaders($headers)
+ ->setRows([$rows]);
+ $table->render();
+ }
+
+
+ /**
+ * Formats microtime into a human readable format
+ *
+ * @return string
+ */
+ protected function formatExecTime() {
+ list($secs, $tens) = explode('.', sprintf("%.1f", ($this->execTime)));
+ $niceDate = date('H:i:s', $secs) . '.' . $tens;
+
+ return $niceDate;
+ }
+
}
diff --git a/apps/files/l10n/pt_BR.js b/apps/files/l10n/pt_BR.js
index e3200d28a27..2cf4a3dbc80 100644
--- a/apps/files/l10n/pt_BR.js
+++ b/apps/files/l10n/pt_BR.js
@@ -81,7 +81,7 @@ OC.L10N.register(
"An error occurred while trying to update the tags" : "Ocorreu um erro enquanto tentava atualizar as etiquetas",
"A new file or folder has been <strong>created</strong>" : "Um novo arquivo ou pasta foi <strong>criado</strong>",
"A file or folder has been <strong>changed</strong>" : "Um arquivo ou pasta foi <strong>modificado</strong>",
- "Limit notifications about creation and changes to your <strong>favorite files</strong> <em>(Stream only)</em>" : "Limite de notificações sobre a criação e alterações em seus <strong>arquivos favoritos</strong> <em>(Stream apenas)</em>",
+ "Limit notifications about creation and changes to your <strong>favorite files</strong> <em>(Stream only)</em>" : "Limite de notificações sobre a criação e alterações em seus <strong>arquivos favoritos</strong> <em>(apenas Stream)</em>",
"A file or folder has been <strong>deleted</strong>" : "Um arquivo ou pasta foi <strong>excluído</strong>",
"A file or folder has been <strong>restored</strong>" : "Um arquivo ou pasta foi <strong>restautado</strong>",
"You created %1$s" : "Você criou %1$s",
@@ -116,7 +116,7 @@ OC.L10N.register(
"Files are being scanned, please wait." : "Arquivos sendo escaneados, por favor aguarde.",
"Currently scanning" : "Atualmente escaneando",
"No favorites" : "Sem favoritos",
- "Files and folders you mark as favorite will show up here" : "Arquivos e pastas que você marcou como favorito são mostrados aqui",
+ "Files and folders you mark as favorite will show up here" : "Arquivos e pastas que você marcou como favoritos são mostrados aqui",
"Text file" : "Arquivo texto",
"New text file.txt" : "Novo texto file.txt"
},
diff --git a/apps/files/l10n/pt_BR.json b/apps/files/l10n/pt_BR.json
index 0aa0e94e87c..be96373df6a 100644
--- a/apps/files/l10n/pt_BR.json
+++ b/apps/files/l10n/pt_BR.json
@@ -79,7 +79,7 @@
"An error occurred while trying to update the tags" : "Ocorreu um erro enquanto tentava atualizar as etiquetas",
"A new file or folder has been <strong>created</strong>" : "Um novo arquivo ou pasta foi <strong>criado</strong>",
"A file or folder has been <strong>changed</strong>" : "Um arquivo ou pasta foi <strong>modificado</strong>",
- "Limit notifications about creation and changes to your <strong>favorite files</strong> <em>(Stream only)</em>" : "Limite de notificações sobre a criação e alterações em seus <strong>arquivos favoritos</strong> <em>(Stream apenas)</em>",
+ "Limit notifications about creation and changes to your <strong>favorite files</strong> <em>(Stream only)</em>" : "Limite de notificações sobre a criação e alterações em seus <strong>arquivos favoritos</strong> <em>(apenas Stream)</em>",
"A file or folder has been <strong>deleted</strong>" : "Um arquivo ou pasta foi <strong>excluído</strong>",
"A file or folder has been <strong>restored</strong>" : "Um arquivo ou pasta foi <strong>restautado</strong>",
"You created %1$s" : "Você criou %1$s",
@@ -114,7 +114,7 @@
"Files are being scanned, please wait." : "Arquivos sendo escaneados, por favor aguarde.",
"Currently scanning" : "Atualmente escaneando",
"No favorites" : "Sem favoritos",
- "Files and folders you mark as favorite will show up here" : "Arquivos e pastas que você marcou como favorito são mostrados aqui",
+ "Files and folders you mark as favorite will show up here" : "Arquivos e pastas que você marcou como favoritos são mostrados aqui",
"Text file" : "Arquivo texto",
"New text file.txt" : "Novo texto file.txt"
},"pluralForm" :"nplurals=2; plural=(n > 1);"
diff --git a/apps/files_external/l10n/pt_BR.js b/apps/files_external/l10n/pt_BR.js
index 0d4f04ae226..296d51836ca 100644
--- a/apps/files_external/l10n/pt_BR.js
+++ b/apps/files_external/l10n/pt_BR.js
@@ -17,6 +17,7 @@ OC.L10N.register(
"Unsatisfied backend parameters" : "Parâmetros de back-end não-atendidos",
"Unsatisfied authentication mechanism parameters" : "Parâmetros de mecanismos de autenticação não satisfeitos",
"Insufficient data: %s" : "Dados insuficientes: %s",
+ "%s" : "%s",
"Personal" : "Pessoal",
"System" : "Sistema",
"Grant access" : "Permitir acesso",
@@ -35,6 +36,15 @@ OC.L10N.register(
"(group)" : "(grupo)",
"Admin defined" : "Definido pelo administrador",
"Saved" : "Salvo",
+ "Empty response from the server" : "Resposta vazia a partir do servidor",
+ "Couldn't access. Please logout and login to activate this mount point" : "Não foi possível acessar. Por favor, desconectar e conectar novamente para ativar este ponto de montagem",
+ "Couldn't get the information from the ownCloud server: {code} {type}" : "Não foi possível obter as informações do servidor ownCloud: {code} {type}",
+ "Couldn't get the list of external mount points: {type}" : "Não foi possível obter a lista de pontos de montagem externos: {type}",
+ "There was an error with message: " : "Houve um erro com a mensagem:",
+ "External mount error" : "Erro de montagem externa",
+ "goto-external-storage" : "ir-montagem-externa",
+ "Couldn't get the list of Windows network drive mount points: empty response from the server" : "Não foi possível obter a lista unidades de pontos de montagem da rede do Windows: resposta vazia a partir do servidor",
+ "Some of the configured external mount points are not connected. Please click on the red row(s) for more information" : "Alguns dos pontos de montagem externos configurados não estão conectados. Por favor clique na linha vermelha(s) para mais informações",
"Access key" : "Chave da acesso",
"Secret key" : "Chave secreta",
"Builtin" : "Construídas em",
diff --git a/apps/files_external/l10n/pt_BR.json b/apps/files_external/l10n/pt_BR.json
index d49e818ea0f..5e4aed0b191 100644
--- a/apps/files_external/l10n/pt_BR.json
+++ b/apps/files_external/l10n/pt_BR.json
@@ -15,6 +15,7 @@
"Unsatisfied backend parameters" : "Parâmetros de back-end não-atendidos",
"Unsatisfied authentication mechanism parameters" : "Parâmetros de mecanismos de autenticação não satisfeitos",
"Insufficient data: %s" : "Dados insuficientes: %s",
+ "%s" : "%s",
"Personal" : "Pessoal",
"System" : "Sistema",
"Grant access" : "Permitir acesso",
@@ -33,6 +34,15 @@
"(group)" : "(grupo)",
"Admin defined" : "Definido pelo administrador",
"Saved" : "Salvo",
+ "Empty response from the server" : "Resposta vazia a partir do servidor",
+ "Couldn't access. Please logout and login to activate this mount point" : "Não foi possível acessar. Por favor, desconectar e conectar novamente para ativar este ponto de montagem",
+ "Couldn't get the information from the ownCloud server: {code} {type}" : "Não foi possível obter as informações do servidor ownCloud: {code} {type}",
+ "Couldn't get the list of external mount points: {type}" : "Não foi possível obter a lista de pontos de montagem externos: {type}",
+ "There was an error with message: " : "Houve um erro com a mensagem:",
+ "External mount error" : "Erro de montagem externa",
+ "goto-external-storage" : "ir-montagem-externa",
+ "Couldn't get the list of Windows network drive mount points: empty response from the server" : "Não foi possível obter a lista unidades de pontos de montagem da rede do Windows: resposta vazia a partir do servidor",
+ "Some of the configured external mount points are not connected. Please click on the red row(s) for more information" : "Alguns dos pontos de montagem externos configurados não estão conectados. Por favor clique na linha vermelha(s) para mais informações",
"Access key" : "Chave da acesso",
"Secret key" : "Chave secreta",
"Builtin" : "Construídas em",
diff --git a/apps/files_sharing/ajax/external.php b/apps/files_sharing/ajax/external.php
index 0f8a3d56cf0..2ba1cb470c2 100644
--- a/apps/files_sharing/ajax/external.php
+++ b/apps/files_sharing/ajax/external.php
@@ -40,6 +40,7 @@ if (OCA\Files_Sharing\Helper::isIncomingServer2serverShareEnabled() === false) {
$token = $_POST['token'];
$remote = $_POST['remote'];
$owner = $_POST['owner'];
+$ownerDisplayName = $_POST['ownerDisplayName'];
$name = $_POST['name'];
$password = $_POST['password'];
@@ -49,6 +50,14 @@ if(!\OCP\Util::isValidFileName($name)) {
exit();
}
+$currentUser = \OC::$server->getUserSession()->getUser()->getUID();
+$currentServer = \OC::$server->getURLGenerator()->getAbsoluteURL('/');
+if (\OC\Share\Helper::isSameUserOnSameServer($owner, $remote, $currentUser, $currentServer )) {
+ \OCP\JSON::error(array('data' => array('message' => $l->t('Not allowed to create a federated share with the same user server'))));
+ exit();
+}
+
+
$externalManager = new \OCA\Files_Sharing\External\Manager(
\OC::$server->getDatabaseConnection(),
\OC\Files\Filesystem::getMountManager(),
@@ -68,7 +77,7 @@ if (substr($remote, 0, 5) === 'https') {
}
}
-$mount = $externalManager->addShare($remote, $token, $password, $name, $owner, true);
+$mount = $externalManager->addShare($remote, $token, $password, $name, $ownerDisplayName, true);
/**
* @var \OCA\Files_Sharing\External\Storage $storage
diff --git a/apps/files_sharing/js/external.js b/apps/files_sharing/js/external.js
index f658de307ab..45a6ef02758 100644
--- a/apps/files_sharing/js/external.js
+++ b/apps/files_sharing/js/external.js
@@ -19,7 +19,7 @@
*/
OCA.Sharing.showAddExternalDialog = function (share, passwordProtected, callback) {
var remote = share.remote;
- var owner = share.owner;
+ var owner = share.ownerDisplayName || share.owner;
var name = share.name;
var remoteClean = (remote.substr(0, 8) === 'https://') ? remote.substr(8) : remote.substr(7);
@@ -92,6 +92,7 @@
remote: share.remote,
token: share.token,
owner: share.owner,
+ ownerDisplayName: share.ownerDisplayName || share.owner,
name: share.name,
password: password}, function(result) {
if (result.status === 'error') {
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index 70c1ba5c0c2..af808447381 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -242,9 +242,10 @@ OCA.Sharing.PublicApp = {
var remote = $(this).find('input[type="text"]').val();
var token = $('#sharingToken').val();
var owner = $('#save').data('owner');
+ var ownerDisplayName = $('#save').data('owner-display-name');
var name = $('#save').data('name');
var isProtected = $('#save').data('protected') ? 1 : 0;
- OCA.Sharing.PublicApp._saveToOwnCloud(remote, token, owner, name, isProtected);
+ OCA.Sharing.PublicApp._saveToOwnCloud(remote, token, owner, ownerDisplayName, name, isProtected);
});
$('#remote_address').on("keyup paste", function() {
@@ -291,7 +292,7 @@ OCA.Sharing.PublicApp = {
this.fileList.changeDirectory(params.path || params.dir, false, true);
},
- _saveToOwnCloud: function (remote, token, owner, name, isProtected) {
+ _saveToOwnCloud: function (remote, token, owner, ownerDisplayName, name, isProtected) {
var location = window.location.protocol + '//' + window.location.host + OC.webroot;
if(remote.substr(-1) !== '/') {
@@ -299,7 +300,7 @@ OCA.Sharing.PublicApp = {
};
var url = remote + 'index.php/apps/files#' + 'remote=' + encodeURIComponent(location) // our location is the remote for the other server
- + "&token=" + encodeURIComponent(token) + "&owner=" + encodeURIComponent(owner) + "&name=" + encodeURIComponent(name) + "&protected=" + isProtected;
+ + "&token=" + encodeURIComponent(token) + "&owner=" + encodeURIComponent(owner) +"&ownerDisplayName=" + encodeURIComponent(ownerDisplayName) + "&name=" + encodeURIComponent(name) + "&protected=" + isProtected;
if (remote.indexOf('://') > 0) {
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index 3d105f283d8..f8d89828f4d 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -45,6 +45,9 @@
if (fileData.type === 'file') {
// files can't be shared with delete permissions
sharePermissions = sharePermissions & ~OC.PERMISSION_DELETE;
+
+ // create permissions don't mean anything for files
+ sharePermissions = sharePermissions & ~OC.PERMISSION_CREATE;
}
tr.attr('data-share-permissions', sharePermissions);
if (fileData.shareOwner) {
diff --git a/apps/files_sharing/l10n/fi_FI.js b/apps/files_sharing/l10n/fi_FI.js
index a87d6156d40..accd43020ff 100644
--- a/apps/files_sharing/l10n/fi_FI.js
+++ b/apps/files_sharing/l10n/fi_FI.js
@@ -3,6 +3,7 @@ OC.L10N.register(
{
"Server to server sharing is not enabled on this server" : "Palvelimelta-palvelimelle-jakaminen ei ole käytössä tällä palvelimella",
"The mountpoint name contains invalid characters." : "Liitospisteen nimi sisältää virheellisiä merkkejä.",
+ "Not allowed to create a federated share with the same user server" : "Saman käyttäjäpalvelimen kanssa ei ole sallittua luoda federoitua jakoa",
"Invalid or untrusted SSL certificate" : "Virheellinen tai ei-luotettu SSL-varmenne",
"Could not authenticate to remote share, password might be wrong" : "Tunnistautuminen etäjakoa kohtaan epäonnistui. Salasana saattaa olla väärä",
"Storage not valid" : "Tallennustila ei ole kelvollinen",
diff --git a/apps/files_sharing/l10n/fi_FI.json b/apps/files_sharing/l10n/fi_FI.json
index 172b8476092..e321d64732f 100644
--- a/apps/files_sharing/l10n/fi_FI.json
+++ b/apps/files_sharing/l10n/fi_FI.json
@@ -1,6 +1,7 @@
{ "translations": {
"Server to server sharing is not enabled on this server" : "Palvelimelta-palvelimelle-jakaminen ei ole käytössä tällä palvelimella",
"The mountpoint name contains invalid characters." : "Liitospisteen nimi sisältää virheellisiä merkkejä.",
+ "Not allowed to create a federated share with the same user server" : "Saman käyttäjäpalvelimen kanssa ei ole sallittua luoda federoitua jakoa",
"Invalid or untrusted SSL certificate" : "Virheellinen tai ei-luotettu SSL-varmenne",
"Could not authenticate to remote share, password might be wrong" : "Tunnistautuminen etäjakoa kohtaan epäonnistui. Salasana saattaa olla väärä",
"Storage not valid" : "Tallennustila ei ole kelvollinen",
diff --git a/apps/files_sharing/l10n/it.js b/apps/files_sharing/l10n/it.js
index 8cd66b34d24..39f7ced4bbd 100644
--- a/apps/files_sharing/l10n/it.js
+++ b/apps/files_sharing/l10n/it.js
@@ -3,6 +3,7 @@ OC.L10N.register(
{
"Server to server sharing is not enabled on this server" : "La condivisione tra server non è abilitata su questo server",
"The mountpoint name contains invalid characters." : "Il nome del punto di mount contiene caratteri non validi.",
+ "Not allowed to create a federated share with the same user server" : "Non è consentito creare una condivisione federata con lo stesso server dell'utente",
"Invalid or untrusted SSL certificate" : "Certificato SSL non valido o non attendibile",
"Could not authenticate to remote share, password might be wrong" : "Impossibile autenticarsi sulla condivisione remota, la password potrebbe essere errata",
"Storage not valid" : "Archiviazione non valida",
diff --git a/apps/files_sharing/l10n/it.json b/apps/files_sharing/l10n/it.json
index b93dafd7555..f40fbb4b232 100644
--- a/apps/files_sharing/l10n/it.json
+++ b/apps/files_sharing/l10n/it.json
@@ -1,6 +1,7 @@
{ "translations": {
"Server to server sharing is not enabled on this server" : "La condivisione tra server non è abilitata su questo server",
"The mountpoint name contains invalid characters." : "Il nome del punto di mount contiene caratteri non validi.",
+ "Not allowed to create a federated share with the same user server" : "Non è consentito creare una condivisione federata con lo stesso server dell'utente",
"Invalid or untrusted SSL certificate" : "Certificato SSL non valido o non attendibile",
"Could not authenticate to remote share, password might be wrong" : "Impossibile autenticarsi sulla condivisione remota, la password potrebbe essere errata",
"Storage not valid" : "Archiviazione non valida",
diff --git a/apps/files_sharing/l10n/lt_LT.js b/apps/files_sharing/l10n/lt_LT.js
index 93848326605..517cc0915be 100644
--- a/apps/files_sharing/l10n/lt_LT.js
+++ b/apps/files_sharing/l10n/lt_LT.js
@@ -3,6 +3,7 @@ OC.L10N.register(
{
"Server to server sharing is not enabled on this server" : "Serveris - serveris dalinimasis neįjungtas šiame serveryje",
"The mountpoint name contains invalid characters." : "Prijungimo taškas su neleistinais simboliais.",
+ "Not allowed to create a federated share with the same user server" : "Neleidžiama dalintis tarp serverių, nes vartotojas tame pačiame serveryje.",
"Invalid or untrusted SSL certificate" : "Netinkamas arba nepatikimas SSL sertifikatas",
"Could not authenticate to remote share, password might be wrong" : "Nepavyko identifikuotis serveryje, gal netinkamas slaptažodis",
"Storage not valid" : "Talpykla negalioja",
diff --git a/apps/files_sharing/l10n/lt_LT.json b/apps/files_sharing/l10n/lt_LT.json
index 6d777024052..923971c336b 100644
--- a/apps/files_sharing/l10n/lt_LT.json
+++ b/apps/files_sharing/l10n/lt_LT.json
@@ -1,6 +1,7 @@
{ "translations": {
"Server to server sharing is not enabled on this server" : "Serveris - serveris dalinimasis neįjungtas šiame serveryje",
"The mountpoint name contains invalid characters." : "Prijungimo taškas su neleistinais simboliais.",
+ "Not allowed to create a federated share with the same user server" : "Neleidžiama dalintis tarp serverių, nes vartotojas tame pačiame serveryje.",
"Invalid or untrusted SSL certificate" : "Netinkamas arba nepatikimas SSL sertifikatas",
"Could not authenticate to remote share, password might be wrong" : "Nepavyko identifikuotis serveryje, gal netinkamas slaptažodis",
"Storage not valid" : "Talpykla negalioja",
diff --git a/apps/files_sharing/l10n/pt_BR.js b/apps/files_sharing/l10n/pt_BR.js
index d2dac6d5955..2faf1455480 100644
--- a/apps/files_sharing/l10n/pt_BR.js
+++ b/apps/files_sharing/l10n/pt_BR.js
@@ -3,6 +3,7 @@ OC.L10N.register(
{
"Server to server sharing is not enabled on this server" : "Compartilhamento de servidor para servidor não está habilitado no servidor",
"The mountpoint name contains invalid characters." : "O nome do ponto de montagem contém caracteres inválidos.",
+ "Not allowed to create a federated share with the same user server" : "Não permitido para criar um compartilhamento associado com o mesmo servidor do usuário",
"Invalid or untrusted SSL certificate" : "Certificado SSL inválido ou não confiável",
"Could not authenticate to remote share, password might be wrong" : "Não foi possível autenticação com o compartilhamento remoto, a senha deve estar errada",
"Storage not valid" : "Armazenamento não válido",
@@ -27,8 +28,8 @@ OC.L10N.register(
"Shared by" : "Compartilhado por",
"Sharing" : "Compartilhamento",
"A file or folder has been <strong>shared</strong>" : "Um arquivo ou pasta foi <strong>compartilhado</strong> ",
- "A file or folder was shared from <strong>another server</strong>" : "Um arquivo ou pasta foi compartilhada a partir de <strong>outro servidor</strong>",
- "A public shared file or folder was <strong>downloaded</strong>" : "Um arquivo ou pasta compartilhada publicamente foi <strong>baixado</strong>",
+ "A file or folder was shared from <strong>another server</strong>" : "Um arquivo ou pasta foi compartilhado a partir de <strong>outro servidor</strong>",
+ "A public shared file or folder was <strong>downloaded</strong>" : "Um arquivo ou pasta compartilhado publicamente foi <strong>baixado</strong>",
"You received a new remote share %2$s from %1$s" : "Você recebeu um novo conpartilhamento remoto %2$s de %1$s",
"You received a new remote share from %s" : "Você recebeu um novo compartilhamento remoto de %s",
"%1$s accepted remote share %2$s" : "%1$s aceitou o compartilhamento remoto %2$s",
@@ -55,14 +56,14 @@ OC.L10N.register(
"You received %2$s as a remote share from %1$s" : "Você recebeu %2$s como um compartilhamento remoto de %1$s",
"Accept" : "Aceitar",
"Decline" : "Rejeitar",
- "Share with me through my #ownCloud Federated Cloud ID, see %s" : "Compartilhe comigo através do meu #ownCloud Nuvem Federados ID, veja %s",
- "Share with me through my #ownCloud Federated Cloud ID" : "Compartilhe comigo através do meu #ownCloud Nuvem Federados ID",
+ "Share with me through my #ownCloud Federated Cloud ID, see %s" : "Compartilhe comigo através do meu #ownCloud Nuvem ID Associada, veja %s",
+ "Share with me through my #ownCloud Federated Cloud ID" : "Compartilhe comigo através do meu #ownCloud Nuvem ID Associada",
"This share is password-protected" : "Este compartilhamento esta protegido por senha",
"The password is wrong. Try again." : "Senha incorreta. Tente novamente.",
"Password" : "Senha",
"No entries found in this folder" : "Nenhuma entrada foi encontrada nesta pasta",
"Name" : "Nome",
- "Share time" : "Tempo de compartilhamento",
+ "Share time" : "Data compartilhado",
"Sorry, this link doesn’t seem to work anymore." : "Desculpe, este link parece não mais funcionar.",
"Reasons might be:" : "As razões podem ser:",
"the item was removed" : "o item foi removido",
@@ -73,12 +74,12 @@ OC.L10N.register(
"Download" : "Baixar",
"Download %s" : "Baixar %s",
"Direct link" : "Link direto",
- "Federated Cloud Sharing" : "Compartilhamento de Nuvem Conglomerada",
+ "Federated Cloud Sharing" : "Compartilhamento de Nuvem Associada",
"Open documentation" : "Abrir documentação",
"Allow users on this server to send shares to other servers" : "Permitir que os usuários deste servidor enviem compartilhamentos para outros servidores",
"Allow users on this server to receive shares from other servers" : "Permitir que os usuários nesse servidor recebam compartilhamentos de outros servidores",
- "Federated Cloud" : "Nuvem Conglomerada",
- "Your Federated Cloud ID:" : "Seu Federados Nuvem ID:",
+ "Federated Cloud" : "Nuvem Associada",
+ "Your Federated Cloud ID:" : "Sua ID na Nuvem Associada:",
"Share it:" : "Compartilhe:",
"Add to your website" : "Adicione ao seu website",
"Share with me via ownCloud" : "Compartilhe comigo via ownCloud",
diff --git a/apps/files_sharing/l10n/pt_BR.json b/apps/files_sharing/l10n/pt_BR.json
index e64c07ff8e0..51e6e9e6f0a 100644
--- a/apps/files_sharing/l10n/pt_BR.json
+++ b/apps/files_sharing/l10n/pt_BR.json
@@ -1,6 +1,7 @@
{ "translations": {
"Server to server sharing is not enabled on this server" : "Compartilhamento de servidor para servidor não está habilitado no servidor",
"The mountpoint name contains invalid characters." : "O nome do ponto de montagem contém caracteres inválidos.",
+ "Not allowed to create a federated share with the same user server" : "Não permitido para criar um compartilhamento associado com o mesmo servidor do usuário",
"Invalid or untrusted SSL certificate" : "Certificado SSL inválido ou não confiável",
"Could not authenticate to remote share, password might be wrong" : "Não foi possível autenticação com o compartilhamento remoto, a senha deve estar errada",
"Storage not valid" : "Armazenamento não válido",
@@ -25,8 +26,8 @@
"Shared by" : "Compartilhado por",
"Sharing" : "Compartilhamento",
"A file or folder has been <strong>shared</strong>" : "Um arquivo ou pasta foi <strong>compartilhado</strong> ",
- "A file or folder was shared from <strong>another server</strong>" : "Um arquivo ou pasta foi compartilhada a partir de <strong>outro servidor</strong>",
- "A public shared file or folder was <strong>downloaded</strong>" : "Um arquivo ou pasta compartilhada publicamente foi <strong>baixado</strong>",
+ "A file or folder was shared from <strong>another server</strong>" : "Um arquivo ou pasta foi compartilhado a partir de <strong>outro servidor</strong>",
+ "A public shared file or folder was <strong>downloaded</strong>" : "Um arquivo ou pasta compartilhado publicamente foi <strong>baixado</strong>",
"You received a new remote share %2$s from %1$s" : "Você recebeu um novo conpartilhamento remoto %2$s de %1$s",
"You received a new remote share from %s" : "Você recebeu um novo compartilhamento remoto de %s",
"%1$s accepted remote share %2$s" : "%1$s aceitou o compartilhamento remoto %2$s",
@@ -53,14 +54,14 @@
"You received %2$s as a remote share from %1$s" : "Você recebeu %2$s como um compartilhamento remoto de %1$s",
"Accept" : "Aceitar",
"Decline" : "Rejeitar",
- "Share with me through my #ownCloud Federated Cloud ID, see %s" : "Compartilhe comigo através do meu #ownCloud Nuvem Federados ID, veja %s",
- "Share with me through my #ownCloud Federated Cloud ID" : "Compartilhe comigo através do meu #ownCloud Nuvem Federados ID",
+ "Share with me through my #ownCloud Federated Cloud ID, see %s" : "Compartilhe comigo através do meu #ownCloud Nuvem ID Associada, veja %s",
+ "Share with me through my #ownCloud Federated Cloud ID" : "Compartilhe comigo através do meu #ownCloud Nuvem ID Associada",
"This share is password-protected" : "Este compartilhamento esta protegido por senha",
"The password is wrong. Try again." : "Senha incorreta. Tente novamente.",
"Password" : "Senha",
"No entries found in this folder" : "Nenhuma entrada foi encontrada nesta pasta",
"Name" : "Nome",
- "Share time" : "Tempo de compartilhamento",
+ "Share time" : "Data compartilhado",
"Sorry, this link doesn’t seem to work anymore." : "Desculpe, este link parece não mais funcionar.",
"Reasons might be:" : "As razões podem ser:",
"the item was removed" : "o item foi removido",
@@ -71,12 +72,12 @@
"Download" : "Baixar",
"Download %s" : "Baixar %s",
"Direct link" : "Link direto",
- "Federated Cloud Sharing" : "Compartilhamento de Nuvem Conglomerada",
+ "Federated Cloud Sharing" : "Compartilhamento de Nuvem Associada",
"Open documentation" : "Abrir documentação",
"Allow users on this server to send shares to other servers" : "Permitir que os usuários deste servidor enviem compartilhamentos para outros servidores",
"Allow users on this server to receive shares from other servers" : "Permitir que os usuários nesse servidor recebam compartilhamentos de outros servidores",
- "Federated Cloud" : "Nuvem Conglomerada",
- "Your Federated Cloud ID:" : "Seu Federados Nuvem ID:",
+ "Federated Cloud" : "Nuvem Associada",
+ "Your Federated Cloud ID:" : "Sua ID na Nuvem Associada:",
"Share it:" : "Compartilhe:",
"Add to your website" : "Adicione ao seu website",
"Share with me via ownCloud" : "Compartilhe comigo via ownCloud",
diff --git a/apps/files_sharing/l10n/sq.js b/apps/files_sharing/l10n/sq.js
index 413214d58de..e25c170df9c 100644
--- a/apps/files_sharing/l10n/sq.js
+++ b/apps/files_sharing/l10n/sq.js
@@ -3,6 +3,7 @@ OC.L10N.register(
{
"Server to server sharing is not enabled on this server" : "Ndarja mes shërbyesish s’është e aktivizuar në këtë shërbyes",
"The mountpoint name contains invalid characters." : "Emri i pikës së montimit përmban shenja të pavlefshme.",
+ "Not allowed to create a federated share with the same user server" : "Nuk i lejohet të krijojë një ndarje të federuar me të njëjtin shërbyes përdoruesi",
"Invalid or untrusted SSL certificate" : "Dëshmi SSL e pavlefshme ose e pabesuar",
"Could not authenticate to remote share, password might be wrong" : "S’bëri dot mirëfilltësimin te ndarja e largët, fjalëkalimi mund të jetë i gabuar",
"Storage not valid" : "Depozitë jo e vlefshme",
@@ -33,6 +34,7 @@ OC.L10N.register(
"You received a new remote share from %s" : "Morët një ndarje të largët nga %s",
"%1$s accepted remote share %2$s" : "%1$s pranoi ndarjen e largët %2$s",
"%1$s declined remote share %2$s" : "%1$s hodhi tej ndarjen e largët %2$s",
+ "%1$s unshared %2$s from you" : "%1$s shndau me ju %2$s",
"Public shared folder %1$s was downloaded" : "U shkarkua dosja e ndarë publikisht %1$s",
"Public shared file %1$s was downloaded" : "U shkarkua kartela e ndarë publikisht %1$s",
"You shared %1$s with %2$s" : "Ndatë %1$s me %2$s",
@@ -72,9 +74,11 @@ OC.L10N.register(
"Download" : "Shkarko",
"Download %s" : "Shkarko %s",
"Direct link" : "Lidhje e drejtpërdrejtë",
+ "Federated Cloud Sharing" : "Ndarje Në Re e Federuar ",
"Open documentation" : "Hap dokumentimin",
"Allow users on this server to send shares to other servers" : "Lejoju përdoruesve në këtë shërbyes të dërgojnë ndarje në shërbyes të tjerë",
"Allow users on this server to receive shares from other servers" : "Lejoju përdoruesve në këtë shërbyes të marrin ndarje nga shërbyes të tjerë",
+ "Federated Cloud" : "Ndarje e Federuar",
"Your Federated Cloud ID:" : "ID-ja juaj Federated Cloud:",
"Share it:" : "Ndajeni:",
"Add to your website" : "Shtojeni te sajti juaj",
diff --git a/apps/files_sharing/l10n/sq.json b/apps/files_sharing/l10n/sq.json
index 8722966f5da..d16d1710a55 100644
--- a/apps/files_sharing/l10n/sq.json
+++ b/apps/files_sharing/l10n/sq.json
@@ -1,6 +1,7 @@
{ "translations": {
"Server to server sharing is not enabled on this server" : "Ndarja mes shërbyesish s’është e aktivizuar në këtë shërbyes",
"The mountpoint name contains invalid characters." : "Emri i pikës së montimit përmban shenja të pavlefshme.",
+ "Not allowed to create a federated share with the same user server" : "Nuk i lejohet të krijojë një ndarje të federuar me të njëjtin shërbyes përdoruesi",
"Invalid or untrusted SSL certificate" : "Dëshmi SSL e pavlefshme ose e pabesuar",
"Could not authenticate to remote share, password might be wrong" : "S’bëri dot mirëfilltësimin te ndarja e largët, fjalëkalimi mund të jetë i gabuar",
"Storage not valid" : "Depozitë jo e vlefshme",
@@ -31,6 +32,7 @@
"You received a new remote share from %s" : "Morët një ndarje të largët nga %s",
"%1$s accepted remote share %2$s" : "%1$s pranoi ndarjen e largët %2$s",
"%1$s declined remote share %2$s" : "%1$s hodhi tej ndarjen e largët %2$s",
+ "%1$s unshared %2$s from you" : "%1$s shndau me ju %2$s",
"Public shared folder %1$s was downloaded" : "U shkarkua dosja e ndarë publikisht %1$s",
"Public shared file %1$s was downloaded" : "U shkarkua kartela e ndarë publikisht %1$s",
"You shared %1$s with %2$s" : "Ndatë %1$s me %2$s",
@@ -70,9 +72,11 @@
"Download" : "Shkarko",
"Download %s" : "Shkarko %s",
"Direct link" : "Lidhje e drejtpërdrejtë",
+ "Federated Cloud Sharing" : "Ndarje Në Re e Federuar ",
"Open documentation" : "Hap dokumentimin",
"Allow users on this server to send shares to other servers" : "Lejoju përdoruesve në këtë shërbyes të dërgojnë ndarje në shërbyes të tjerë",
"Allow users on this server to receive shares from other servers" : "Lejoju përdoruesve në këtë shërbyes të marrin ndarje nga shërbyes të tjerë",
+ "Federated Cloud" : "Ndarje e Federuar",
"Your Federated Cloud ID:" : "ID-ja juaj Federated Cloud:",
"Share it:" : "Ndajeni:",
"Add to your website" : "Shtojeni te sajti juaj",
diff --git a/apps/files_sharing/lib/controllers/sharecontroller.php b/apps/files_sharing/lib/controllers/sharecontroller.php
index fe7b159449c..e28019c358c 100644
--- a/apps/files_sharing/lib/controllers/sharecontroller.php
+++ b/apps/files_sharing/lib/controllers/sharecontroller.php
@@ -181,6 +181,7 @@ class ShareController extends Controller {
$shareTmpl = [];
$shareTmpl['displayName'] = User::getDisplayName($shareOwner);
+ $shareTmpl['owner'] = $shareOwner;
$shareTmpl['filename'] = $file;
$shareTmpl['directory_path'] = $linkItem['file_target'];
$shareTmpl['mimetype'] = Filesystem::getMimeType($originalSharePath);
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index b5dd653d718..046f954106a 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -72,7 +72,7 @@ $thumbSize = 1024;
if ($_['server2serversharing']) {
?>
<span id="save" data-protected="<?php p($_['protected']) ?>"
- data-owner="<?php p($_['displayName']) ?>" data-name="<?php p($_['filename']) ?>">
+ data-owner-display-name="<?php p($_['displayName']) ?>" data-owner="<?php p($_['owner']) ?>" data-name="<?php p($_['filename']) ?>">
<button id="save-button"><?php p($l->t('Add to your ownCloud')) ?></button>
<form class="save-form hidden" action="#">
<input type="text" id="remote_address" placeholder="example.com/owncloud"/>
diff --git a/apps/files_sharing/tests/controller/sharecontroller.php b/apps/files_sharing/tests/controller/sharecontroller.php
index ccef4263c2b..168488f5613 100644
--- a/apps/files_sharing/tests/controller/sharecontroller.php
+++ b/apps/files_sharing/tests/controller/sharecontroller.php
@@ -168,6 +168,7 @@ class ShareControllerTest extends \Test\TestCase {
$response = $this->shareController->showShare($this->token);
$sharedTmplParams = array(
'displayName' => $this->user,
+ 'owner' => $this->user,
'filename' => 'file1.txt',
'directory_path' => '/file1.txt',
'mimetype' => 'text/plain',
diff --git a/apps/files_sharing/tests/js/externalSpec.js b/apps/files_sharing/tests/js/externalSpec.js
index 255f0fc3a48..362df49252b 100644
--- a/apps/files_sharing/tests/js/externalSpec.js
+++ b/apps/files_sharing/tests/js/externalSpec.js
@@ -67,6 +67,7 @@ describe('OCA.Sharing external tests', function() {
remote: 'http://example.com/owncloud',
token: 'abcdefg',
owner: 'theowner',
+ ownerDisplayName: 'The Generous Owner',
name: 'the share name'
};
});
@@ -88,6 +89,7 @@ describe('OCA.Sharing external tests', function() {
remote: 'http://example.com/owncloud',
token: 'abcdefg',
owner: 'theowner',
+ ownerDisplayName: 'The Generous Owner',
name: 'the share name',
password: ''
});
@@ -104,6 +106,7 @@ describe('OCA.Sharing external tests', function() {
remote: 'http://example.com/owncloud',
token: 'abcdefg',
owner: 'theowner',
+ ownerDisplayName: 'The Generous Owner',
name: 'the share name',
password: 'thepassword'
});
@@ -148,6 +151,7 @@ describe('OCA.Sharing external tests', function() {
remote: 'http://example.com/owncloud',
token: 'abcdefg',
owner: 'theowner',
+ ownerDisplayName: 'The Generous Owner',
name: 'the share name'
};
});
diff --git a/apps/files_sharing/tests/js/sharedfilelistSpec.js b/apps/files_sharing/tests/js/sharedfilelistSpec.js
index fdc9de49c17..0b0676a19e6 100644
--- a/apps/files_sharing/tests/js/sharedfilelistSpec.js
+++ b/apps/files_sharing/tests/js/sharedfilelistSpec.js
@@ -712,7 +712,7 @@ describe('OCA.Sharing.FileList tests', function() {
$tr = fileList.$el.find('tr:first');
expect(parseInt($tr.attr('data-share-permissions'), 10))
- .toEqual(OC.PERMISSION_ALL - OC.PERMISSION_SHARE - OC.PERMISSION_DELETE);
+ .toEqual(OC.PERMISSION_ALL - OC.PERMISSION_SHARE - OC.PERMISSION_DELETE - OC.PERMISSION_CREATE);
});
});
});
diff --git a/apps/files_trashbin/l10n/pt_BR.js b/apps/files_trashbin/l10n/pt_BR.js
index b1a3768a3bd..806200ea651 100644
--- a/apps/files_trashbin/l10n/pt_BR.js
+++ b/apps/files_trashbin/l10n/pt_BR.js
@@ -11,8 +11,8 @@ OC.L10N.register(
"This operation is forbidden" : "Esta operação é proibida",
"This directory is unavailable, please check the logs or contact the administrator" : "Este diretório não está disponível, por favor, verifique os logs ou entre em contato com o administrador",
"restored" : "restaurado",
- "No deleted files" : "Aquivos não removidos",
- "You will be able to recover deleted files from here" : "Você pode recuperar arquivos removidos daqui",
+ "No deleted files" : "Nenhum arquivo excluído",
+ "You will be able to recover deleted files from here" : "Neste local, você será capaz de recuperar arquivos excluídos",
"No entries found in this folder" : "Nenhuma entrada foi encontrada nesta pasta",
"Select all" : "Selecionar tudo",
"Name" : "Nome",
diff --git a/apps/files_trashbin/l10n/pt_BR.json b/apps/files_trashbin/l10n/pt_BR.json
index db2dc331d5d..177a377bdfd 100644
--- a/apps/files_trashbin/l10n/pt_BR.json
+++ b/apps/files_trashbin/l10n/pt_BR.json
@@ -9,8 +9,8 @@
"This operation is forbidden" : "Esta operação é proibida",
"This directory is unavailable, please check the logs or contact the administrator" : "Este diretório não está disponível, por favor, verifique os logs ou entre em contato com o administrador",
"restored" : "restaurado",
- "No deleted files" : "Aquivos não removidos",
- "You will be able to recover deleted files from here" : "Você pode recuperar arquivos removidos daqui",
+ "No deleted files" : "Nenhum arquivo excluído",
+ "You will be able to recover deleted files from here" : "Neste local, você será capaz de recuperar arquivos excluídos",
"No entries found in this folder" : "Nenhuma entrada foi encontrada nesta pasta",
"Select all" : "Selecionar tudo",
"Name" : "Nome",
diff --git a/apps/user_ldap/appinfo/update.php b/apps/user_ldap/appinfo/update.php
index 7d358e5b268..7a61101f578 100644
--- a/apps/user_ldap/appinfo/update.php
+++ b/apps/user_ldap/appinfo/update.php
@@ -21,21 +21,5 @@
*
*/
-$installedVersion = \OC::$server->getConfig()->getAppValue('user_ldap', 'installed_version');
-
-if (version_compare($installedVersion, '0.6.1', '<')) {
- \OC::$server->getConfig()->setAppValue('user_ldap', 'enforce_home_folder_naming_rule', false);
-}
-
-if(version_compare($installedVersion, '0.6.2', '<')) {
- // Remove LDAP case insensitive setting from DB as it is no longer beeing used.
- $helper = new \OCA\user_ldap\lib\Helper();
- $prefixes = $helper->getServerConfigurationPrefixes();
-
- foreach($prefixes as $prefix) {
- \OC::$server->getConfig()->deleteAppValue('user_ldap', $prefix . "ldap_nocase");
- }
-}
-
OCP\Backgroundjob::registerJob('OCA\user_ldap\lib\Jobs');
OCP\Backgroundjob::registerJob('\OCA\User_LDAP\Jobs\CleanUp');
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php
index 667f1076235..693a420a74d 100644
--- a/apps/user_ldap/lib/access.php
+++ b/apps/user_ldap/lib/access.php
@@ -1277,6 +1277,54 @@ class Access extends LDAPUtility implements user\IUserTools {
}
/**
+ * reverse lookup of a DN given a known UUID
+ *
+ * @param string $uuid
+ * @return string
+ * @throws \Exception
+ */
+ public function getUserDnByUuid($uuid) {
+ $uuidOverride = $this->connection->ldapExpertUUIDUserAttr;
+ $filter = $this->connection->ldapUserFilter;
+ $base = $this->connection->ldapBaseUsers;
+
+ if($this->connection->ldapUuidUserAttribute === 'auto' && empty($uuidOverride)) {
+ // Sacrebleu! The UUID attribute is unknown :( We need first an
+ // existing DN to be able to reliably detect it.
+ $result = $this->search($filter, $base, ['dn'], 1);
+ if(!isset($result[0]) || !isset($result[0]['dn'])) {
+ throw new \Exception('Cannot determine UUID attribute');
+ }
+ $dn = $result[0]['dn'][0];
+ if(!$this->detectUuidAttribute($dn, true)) {
+ throw new \Exception('Cannot determine UUID attribute');
+ }
+ } else {
+ // The UUID attribute is either known or an override is given.
+ // By calling this method we ensure that $this->connection->$uuidAttr
+ // is definitely set
+ if(!$this->detectUuidAttribute('', true)) {
+ throw new \Exception('Cannot determine UUID attribute');
+ }
+ }
+
+ $uuidAttr = $this->connection->ldapUuidUserAttribute;
+ if($uuidAttr === 'guid' || $uuidAttr === 'objectguid') {
+ $uuid = $this->formatGuid2ForFilterUser($uuid);
+ }
+
+ $filter = $uuidAttr . '=' . $uuid;
+ $result = $this->searchUsers($filter, ['dn'], 2);
+ if(is_array($result) && isset($result[0]) && isset($result[0]['dn']) && count($result) === 1) {
+ // we put the count into account to make sure that this is
+ // really unique
+ return $result[0]['dn'][0];
+ }
+
+ throw new \Exception('Cannot determine UUID attribute');
+ }
+
+ /**
* auto-detects the directory's UUID attribute
* @param string $dn a known DN used to check against
* @param bool $isUser
@@ -1379,6 +1427,53 @@ class Access extends LDAPUtility implements user\IUserTools {
}
/**
+ * the first three blocks of the string-converted GUID happen to be in
+ * reverse order. In order to use it in a filter, this needs to be
+ * corrected. Furthermore the dashes need to be replaced and \\ preprended
+ * to every two hax figures.
+ *
+ * If an invalid string is passed, it will be returned without change.
+ *
+ * @param string $guid
+ * @return string
+ */
+ public function formatGuid2ForFilterUser($guid) {
+ if(!is_string($guid)) {
+ throw new \InvalidArgumentException('String expected');
+ }
+ $blocks = explode('-', $guid);
+ if(count($blocks) !== 5) {
+ /*
+ * Why not throw an Exception instead? This method is a utility
+ * called only when trying to figure out whether a "missing" known
+ * LDAP user was or was not renamed on the LDAP server. And this
+ * even on the use case that a reverse lookup is needed (UUID known,
+ * not DN), i.e. when finding users (search dialog, users page,
+ * login, …) this will not be fired. This occurs only if shares from
+ * a users are supposed to be mounted who cannot be found. Throwing
+ * an exception here would kill the experience for a valid, acting
+ * user. Instead we write a log message.
+ */
+ \OC::$server->getLogger()->info(
+ 'Passed string does not resemble a valid GUID. Known UUID ' .
+ '({uuid}) probably does not match UUID configuration.',
+ [ 'app' => 'user_ldap', 'uuid' => $guid ]
+ );
+ return $guid;
+ }
+ for($i=0; $i < 3; $i++) {
+ $pairs = str_split($blocks[$i], 2);
+ $pairs = array_reverse($pairs);
+ $blocks[$i] = implode('', $pairs);
+ }
+ for($i=0; $i < 5; $i++) {
+ $pairs = str_split($blocks[$i], 2);
+ $blocks[$i] = '\\' . implode('\\', $pairs);
+ }
+ return implode('', $blocks);
+ }
+
+ /**
* gets a SID of the domain of the given dn
* @param string $dn
* @return string|bool
diff --git a/apps/user_ldap/lib/mapping/abstractmapping.php b/apps/user_ldap/lib/mapping/abstractmapping.php
index f0f0f6df75e..c3d38ce8b71 100644
--- a/apps/user_ldap/lib/mapping/abstractmapping.php
+++ b/apps/user_ldap/lib/mapping/abstractmapping.php
@@ -158,7 +158,7 @@ abstract class AbstractMapping {
}
/**
- * Gets the name based on the provided LDAP DN.
+ * Gets the name based on the provided LDAP UUID.
* @param string $uuid
* @return string|false
*/
@@ -167,6 +167,16 @@ abstract class AbstractMapping {
}
/**
+ * Gets the UUID based on the provided LDAP DN
+ * @param string $dn
+ * @return false|string
+ * @throws \Exception
+ */
+ public function getUUIDByDN($dn) {
+ return $this->getXbyY('directory_uuid', 'ldap_dn', $dn);
+ }
+
+ /**
* gets a piece of the mapping list
* @param int $offset
* @param int $limit
diff --git a/apps/user_ldap/tests/user_ldap.php b/apps/user_ldap/tests/user_ldap.php
index 7593371d85d..3aec2a5ce57 100644
--- a/apps/user_ldap/tests/user_ldap.php
+++ b/apps/user_ldap/tests/user_ldap.php
@@ -70,14 +70,26 @@ class Test_User_Ldap_Direct extends \Test\TestCase {
array($lw, null, null));
$this->configMock = $this->getMock('\OCP\IConfig');
- $um = new \OCA\user_ldap\lib\user\Manager(
+
+ $offlineUser = $this->getMockBuilder('\OCA\user_ldap\lib\user\OfflineUser')
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $um = $this->getMockBuilder('\OCA\user_ldap\lib\user\Manager')
+ ->setMethods(['getDeletedUser'])
+ ->setConstructorArgs([
$this->configMock,
$this->getMock('\OCA\user_ldap\lib\FilesystemHelper'),
$this->getMock('\OCA\user_ldap\lib\LogWrapper'),
$this->getMock('\OCP\IAvatarManager'),
$this->getMock('\OCP\Image'),
$this->getMock('\OCP\IDBConnection')
- );
+ ])
+ ->getMock();
+
+ $um->expects($this->any())
+ ->method('getDeletedUser')
+ ->will($this->returnValue($offlineUser));
$access = $this->getMock('\OCA\user_ldap\lib\Access',
$accMethods,
@@ -661,6 +673,44 @@ class Test_User_Ldap_Direct extends \Test\TestCase {
$this->assertFalse($result);
}
+ /**
+ * @expectedException \OC\User\NoUserException
+ */
+ public function testGetHomeDeletedUser() {
+ $access = $this->getAccessMock();
+ $backend = new UserLDAP($access, $this->getMock('\OCP\IConfig'));
+ $this->prepareMockForUserExists($access);
+
+ $access->connection->expects($this->any())
+ ->method('__get')
+ ->will($this->returnCallback(function($name) {
+ if($name === 'homeFolderNamingRule') {
+ return 'attr:testAttribute';
+ }
+ return null;
+ }));
+
+ $access->expects($this->any())
+ ->method('readAttribute')
+ ->will($this->returnValue([]));
+
+ $userMapper = $this->getMockBuilder('\OCA\User_LDAP\Mapping\UserMapping')
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $access->expects($this->any())
+ ->method('getUserMapper')
+ ->will($this->returnValue($userMapper));
+
+ $this->configMock->expects($this->any())
+ ->method('getUserValue')
+ ->will($this->returnValue(true));
+
+ //no path at all – triggers OC default behaviour
+ $result = $backend->getHome('newyorker');
+ $this->assertFalse($result);
+ }
+
private function prepareAccessForGetDisplayName(&$access) {
$access->connection->expects($this->any())
->method('__get')
@@ -686,6 +736,14 @@ class Test_User_Ldap_Direct extends \Test\TestCase {
return false;
}
}));
+
+ $userMapper = $this->getMockBuilder('\OCA\User_LDAP\Mapping\UserMapping')
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $access->expects($this->any())
+ ->method('getUserMapper')
+ ->will($this->returnValue($userMapper));
}
public function testGetDisplayName() {
diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php
index 0097dda89b5..a266be7b7f7 100644
--- a/apps/user_ldap/user_ldap.php
+++ b/apps/user_ldap/user_ldap.php
@@ -30,6 +30,7 @@
namespace OCA\user_ldap;
+use OC\User\NoUserException;
use OCA\user_ldap\lib\BackendUtility;
use OCA\user_ldap\lib\Access;
use OCA\user_ldap\lib\user\OfflineUser;
@@ -190,15 +191,18 @@ class USER_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
/**
* checks whether a user is still available on LDAP
+ *
* @param string|\OCA\User_LDAP\lib\user\User $user either the ownCloud user
* name or an instance of that user
* @return bool
+ * @throws \Exception
+ * @throws \OC\ServerNotAvailableException
*/
public function userExistsOnLDAP($user) {
if(is_string($user)) {
$user = $this->access->userManager->get($user);
}
- if(!$user instanceof User) {
+ if(is_null($user)) {
return false;
}
@@ -209,7 +213,22 @@ class USER_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
if(is_null($lcr)) {
throw new \Exception('No LDAP Connection to server ' . $this->access->connection->ldapHost);
}
- return false;
+
+ try {
+ $uuid = $this->access->getUserMapper()->getUUIDByDN($dn);
+ if(!$uuid) {
+ return false;
+ }
+ $newDn = $this->access->getUserDnByUuid($uuid);
+ $this->access->getUserMapper()->setDNbyUUID($newDn, $uuid);
+ return true;
+ } catch (\Exception $e) {
+ return false;
+ }
+ }
+
+ if($user instanceof OfflineUser) {
+ $user->unmark();
}
return true;
@@ -274,10 +293,13 @@ class USER_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
}
/**
- * get the user's home directory
- * @param string $uid the username
- * @return string|bool
- */
+ * get the user's home directory
+ *
+ * @param string $uid the username
+ * @return bool|string
+ * @throws NoUserException
+ * @throws \Exception
+ */
public function getHome($uid) {
if(isset($this->homesToKill[$uid]) && !empty($this->homesToKill[$uid])) {
//a deleted user who needs some clean up
@@ -295,6 +317,15 @@ class USER_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
}
$user = $this->access->userManager->get($uid);
+ if(is_null($user) || ($user instanceof OfflineUser && !$this->userExistsOnLDAP($user->getOCName()))) {
+ throw new NoUserException($uid . ' is not a valid user anymore');
+ }
+ if($user instanceof OfflineUser) {
+ // apparently this user survived the userExistsOnLDAP check,
+ // we request the user instance again in order to retrieve a User
+ // instance instead
+ $user = $this->access->userManager->get($uid);
+ }
$path = $user->getHomePath();
$this->access->cacheUserHome($uid, $path);
diff --git a/config/config.sample.php b/config/config.sample.php
index 9b10792944f..6e823e3968d 100644
--- a/config/config.sample.php
+++ b/config/config.sample.php
@@ -799,22 +799,6 @@ $CONFIG = array(
'ldapUserCleanupInterval' => 51,
/**
- * Enforce the existence of the home folder naming rule for all users
- *
- * Following scenario:
- * * a home folder naming rule is set in LDAP advanced settings
- * * a user doesn't have the home folder naming rule attribute set
- *
- * If this is set to **true** (default) it will NOT fallback to the core's
- * default naming rule of using the internal user ID as home folder name.
- *
- * If this is set to **false** it will fallback for the users without the
- * attribute set to naming the home folder like the internal user ID.
- *
- */
-'enforce_home_folder_naming_rule' => true,
-
-/**
* Comments
*
* Global settings for the Comments infrastructure
diff --git a/core/avatar/avatarcontroller.php b/core/avatar/avatarcontroller.php
index 6c0321e6b5e..e8139aa50ae 100644
--- a/core/avatar/avatarcontroller.php
+++ b/core/avatar/avatarcontroller.php
@@ -30,6 +30,7 @@ use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Http\DataDisplayResponse;
+use OCP\Files\NotFoundException;
use OCP\IAvatarManager;
use OCP\ILogger;
use OCP\IL10N;
@@ -112,20 +113,23 @@ class AvatarController extends Controller {
$size = 64;
}
- $avatar = $this->avatarManager->getAvatar($userId);
- $image = $avatar->get($size);
-
- if ($image instanceof \OCP\IImage) {
- $resp = new DataDisplayResponse($image->data(),
+ try {
+ $avatar = $this->avatarManager->getAvatar($userId)->getFile($size);
+ $resp = new DataDisplayResponse($avatar->getContent(),
Http::STATUS_OK,
- ['Content-Type' => $image->mimeType()]);
- $resp->setETag(crc32($image->data()));
- } else {
+ ['Content-Type' => $avatar->getMimeType()]);
+ $resp->setETag($avatar->getEtag());
+ } catch (NotFoundException $e) {
$user = $this->userManager->get($userId);
- $userName = $user ? $user->getDisplayName() : '';
$resp = new DataResponse([
'data' => [
- 'displayname' => $userName,
+ 'displayname' => $user->getDisplayName(),
+ ],
+ ]);
+ } catch (\Exception $e) {
+ $resp = new DataResponse([
+ 'data' => [
+ 'displayname' => '',
],
]);
}
diff --git a/core/js/files/client.js b/core/js/files/client.js
index 70dac7d6690..3d31f974ff8 100644
--- a/core/js/files/client.js
+++ b/core/js/files/client.js
@@ -251,7 +251,7 @@
id: props['{' + Client.NS_OWNCLOUD + '}fileid'],
path: OC.dirname(path) || '/',
name: OC.basename(path),
- mtime: new Date(props['{' + Client.NS_DAV + '}getlastmodified'])
+ mtime: (new Date(props['{' + Client.NS_DAV + '}getlastmodified'])).getTime()
};
var etagProp = props['{' + Client.NS_DAV + '}getetag'];
diff --git a/core/js/tests/specs/files/clientSpec.js b/core/js/tests/specs/files/clientSpec.js
index 3a3181d8426..61cff0a66ec 100644
--- a/core/js/tests/specs/files/clientSpec.js
+++ b/core/js/tests/specs/files/clientSpec.js
@@ -252,7 +252,7 @@ describe('OC.Files.Client tests', function() {
expect(info.name).toEqual('One.txt');
expect(info.permissions).toEqual(31);
expect(info.size).toEqual(250);
- expect(info.mtime.getTime()).toEqual(1436535485000);
+ expect(info.mtime).toEqual(1436535485000);
expect(info.mimetype).toEqual('text/plain');
expect(info.etag).toEqual('559fcabd79a38');
@@ -264,7 +264,7 @@ describe('OC.Files.Client tests', function() {
expect(info.name).toEqual('sub');
expect(info.permissions).toEqual(31);
expect(info.size).toEqual(100);
- expect(info.mtime.getTime()).toEqual(1436536800000);
+ expect(info.mtime).toEqual(1436536800000);
expect(info.mimetype).toEqual('httpd/unix-directory');
expect(info.etag).toEqual('66cfcabd79abb');
});
@@ -295,7 +295,7 @@ describe('OC.Files.Client tests', function() {
expect(info.name).toEqual('文件夹');
expect(info.permissions).toEqual(31);
expect(info.size).toEqual(120);
- expect(info.mtime.getTime()).toEqual(1436522405000);
+ expect(info.mtime).toEqual(1436522405000);
expect(info.mimetype).toEqual('httpd/unix-directory');
expect(info.etag).toEqual('56cfcabd79abb');
@@ -376,7 +376,7 @@ describe('OC.Files.Client tests', function() {
expect(info.name).toEqual('文件夹');
expect(info.permissions).toEqual(31);
expect(info.size).toEqual(120);
- expect(info.mtime.getTime()).toEqual(1436522405000);
+ expect(info.mtime).toEqual(1436522405000);
expect(info.mimetype).toEqual('httpd/unix-directory');
expect(info.etag).toEqual('56cfcabd79abb');
});
@@ -425,7 +425,7 @@ describe('OC.Files.Client tests', function() {
expect(info.name).toEqual('in root');
expect(info.permissions).toEqual(31);
expect(info.size).toEqual(120);
- expect(info.mtime.getTime()).toEqual(1436522405000);
+ expect(info.mtime).toEqual(1436522405000);
expect(info.mimetype).toEqual('httpd/unix-directory');
expect(info.etag).toEqual('56cfcabd79abb');
});
diff --git a/core/l10n/pt_BR.js b/core/l10n/pt_BR.js
index a1f0e287b7d..54ec2f4b9f3 100644
--- a/core/l10n/pt_BR.js
+++ b/core/l10n/pt_BR.js
@@ -124,7 +124,7 @@ OC.L10N.register(
"The \"{header}\" HTTP header is not configured to equal to \"{expected}\". This is a potential security or privacy risk and we recommend adjusting this setting." : "O \"{header}\" cabeçalho HTTP não está configurado igual ao \"{expected}\". Este é um risco potencial para a segurança e recomendamos ajustar essa configuração.",
"The \"Strict-Transport-Security\" HTTP header is not configured to least \"{seconds}\" seconds. For enhanced security we recommend enabling HSTS as described in our <a href=\"{docUrl}\">security tips</a>." : "O cabeçalho \"Transporte-de-Segurança-Restrita\"HTTP não está configurada para menos de \"{seconds}\" segundos. Para uma maior segurança recomendamos a ativação HSTS conforme descrito em nossas <a href=\"{docUrl}\">dicas de segurança</a>.",
"You are accessing this site via HTTP. We strongly suggest you configure your server to require using HTTPS instead as described in our <a href=\"{docUrl}\">security tips</a>." : "Você está acessando este site via HTTP. Nós fortemente sugerimos que você ao invéz, configure o servidor para exigir o uso de HTTPS como descrito em nossas <a href=\"{docUrl}\">dicas de segurança</a>.",
- "Shared" : "Compartilhados",
+ "Shared" : "Compartilhado",
"Shared with {recipients}" : "Compartilhado com {recipients}",
"Error" : "Erro",
"Error while sharing" : "Erro ao compartilhar",
@@ -218,7 +218,7 @@ OC.L10N.register(
"You can click here to return to %s." : "Você 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\ngostaria que você soubesse que %s compartilhou %s com você.\nVeja isto: %s\n\n",
"The share will expire on %s." : "O compartilhamento irá expirar em %s.",
- "Cheers!" : "Saúde!",
+ "Cheers!" : "Saudações!",
"Internal Server Error" : "Erro Interno do Servidor",
"The server encountered an internal error and was unable to complete your request." : "O servidor encontrou um erro interno e não conseguiu concluir o seu pedido.",
"Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report." : "Entre em contato com o administrador do servidor se este erro reaparece várias vezes, por favor, inclua os detalhes técnicos abaixo em seu relatório.",
@@ -256,7 +256,7 @@ OC.L10N.register(
"Finishing …" : "Finalizando ...",
"Need help?" : "Precisa de ajuda?",
"See the documentation" : "Veja a documentação",
- "Hey there,<br><br>just letting you know that %s shared <strong>%s</strong> with you.<br><a href=\"%s\">View it!</a><br><br>" : "Olá,<br><br>só para seu conhecimento que %s compartilhou <strong>%s</strong> com você. <br><a href=\"%s\">Verificar!</a><br><br> ",
+ "Hey there,<br><br>just letting you know that %s shared <strong>%s</strong> with you.<br><a href=\"%s\">View it!</a><br><br>" : "Olá,<br><br>só para seu conhecimento que %s compartilhou <strong>%s</strong> com você. <br><a href=\"%s\">Visualize-o!</a><br><br> ",
"This application requires JavaScript for correct operation. Please {linkstart}enable JavaScript{linkend} and reload the page." : "Esta aplicação requer JavaScript para sua correta operação. Por favor {linkstart}habilite JavaScript{linkend} e recerregue a página.",
"Log out" : "Sair",
"Search" : "Perquisar",
diff --git a/core/l10n/pt_BR.json b/core/l10n/pt_BR.json
index fd3c4f6ac2d..7445fc2aeab 100644
--- a/core/l10n/pt_BR.json
+++ b/core/l10n/pt_BR.json
@@ -122,7 +122,7 @@
"The \"{header}\" HTTP header is not configured to equal to \"{expected}\". This is a potential security or privacy risk and we recommend adjusting this setting." : "O \"{header}\" cabeçalho HTTP não está configurado igual ao \"{expected}\". Este é um risco potencial para a segurança e recomendamos ajustar essa configuração.",
"The \"Strict-Transport-Security\" HTTP header is not configured to least \"{seconds}\" seconds. For enhanced security we recommend enabling HSTS as described in our <a href=\"{docUrl}\">security tips</a>." : "O cabeçalho \"Transporte-de-Segurança-Restrita\"HTTP não está configurada para menos de \"{seconds}\" segundos. Para uma maior segurança recomendamos a ativação HSTS conforme descrito em nossas <a href=\"{docUrl}\">dicas de segurança</a>.",
"You are accessing this site via HTTP. We strongly suggest you configure your server to require using HTTPS instead as described in our <a href=\"{docUrl}\">security tips</a>." : "Você está acessando este site via HTTP. Nós fortemente sugerimos que você ao invéz, configure o servidor para exigir o uso de HTTPS como descrito em nossas <a href=\"{docUrl}\">dicas de segurança</a>.",
- "Shared" : "Compartilhados",
+ "Shared" : "Compartilhado",
"Shared with {recipients}" : "Compartilhado com {recipients}",
"Error" : "Erro",
"Error while sharing" : "Erro ao compartilhar",
@@ -216,7 +216,7 @@
"You can click here to return to %s." : "Você 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\ngostaria que você soubesse que %s compartilhou %s com você.\nVeja isto: %s\n\n",
"The share will expire on %s." : "O compartilhamento irá expirar em %s.",
- "Cheers!" : "Saúde!",
+ "Cheers!" : "Saudações!",
"Internal Server Error" : "Erro Interno do Servidor",
"The server encountered an internal error and was unable to complete your request." : "O servidor encontrou um erro interno e não conseguiu concluir o seu pedido.",
"Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report." : "Entre em contato com o administrador do servidor se este erro reaparece várias vezes, por favor, inclua os detalhes técnicos abaixo em seu relatório.",
@@ -254,7 +254,7 @@
"Finishing …" : "Finalizando ...",
"Need help?" : "Precisa de ajuda?",
"See the documentation" : "Veja a documentação",
- "Hey there,<br><br>just letting you know that %s shared <strong>%s</strong> with you.<br><a href=\"%s\">View it!</a><br><br>" : "Olá,<br><br>só para seu conhecimento que %s compartilhou <strong>%s</strong> com você. <br><a href=\"%s\">Verificar!</a><br><br> ",
+ "Hey there,<br><br>just letting you know that %s shared <strong>%s</strong> with you.<br><a href=\"%s\">View it!</a><br><br>" : "Olá,<br><br>só para seu conhecimento que %s compartilhou <strong>%s</strong> com você. <br><a href=\"%s\">Visualize-o!</a><br><br> ",
"This application requires JavaScript for correct operation. Please {linkstart}enable JavaScript{linkend} and reload the page." : "Esta aplicação requer JavaScript para sua correta operação. Por favor {linkstart}habilite JavaScript{linkend} e recerregue a página.",
"Log out" : "Sair",
"Search" : "Perquisar",
diff --git a/core/templates/404.php b/core/templates/404.php
index c8d16e3e8f7..2b12b12cff7 100644
--- a/core/templates/404.php
+++ b/core/templates/404.php
@@ -16,7 +16,7 @@ if(!isset($_)) {//also provide standalone error page
<li class="error">
<?php p($l->t('File not found')); ?><br>
<p class="hint"><?php p($l->t('The specified document has not been found on the server.')); ?></p>
- <p class="hint"><a href="<?php p(OC_Helper::linkTo('', 'index.php')) ?>"><?php p($l->t('You can click here to return to %s.', array($theme->getName()))); ?></a></p>
+ <p class="hint"><a href="<?php p(\OC::$server->getURLGenerator()->linkTo('', 'index.php')) ?>"><?php p($l->t('You can click here to return to %s.', array($theme->getName()))); ?></a></p>
</li>
</ul>
<?php endif; ?>
diff --git a/lib/l10n/fi_FI.js b/lib/l10n/fi_FI.js
index d4035633f08..16eacd0366a 100644
--- a/lib/l10n/fi_FI.js
+++ b/lib/l10n/fi_FI.js
@@ -87,6 +87,7 @@ OC.L10N.register(
"Sharing %s failed, because %s is not a member of the group %s" : "Kohteen %s jakaminen epäonnistui, koska käyttäjä %s ei ole ryhmän %s jäsen",
"You need to provide a password to create a public link, only protected links are allowed" : "Anna salasana luodaksesi julkisen linkin. Vain suojatut linkit ovat sallittuja",
"Sharing %s failed, because sharing with links is not allowed" : "Kohteen %s jakaminen epäonnistui, koska jakaminen linkkejä käyttäen ei ole sallittu",
+ "Not allowed to create a federated share with the same user" : "Saman käyttäjän kanssa ei ole sallittua luoda federoitua jakoa",
"Sharing %s failed, could not find %s, maybe the server is currently unreachable." : "Kohteen %s jakaminen epäonnistui, kohdetta %s ei löytynyt. Kenties palvelin ei ole juuri nyt tavoitettavissa.",
"Setting permissions for %s failed, because the item was not found" : "Kohteen %s oikeuksien asettaminen epäonnistui, koska kohdetta ei löytynyt",
"Cannot set expiration date. Expiration date is in the past" : "Vanhentumispäivää ei voi asettaa. Vanhentumispäivä on jo mennyt",
diff --git a/lib/l10n/fi_FI.json b/lib/l10n/fi_FI.json
index b961e6b862d..738ef893d72 100644
--- a/lib/l10n/fi_FI.json
+++ b/lib/l10n/fi_FI.json
@@ -85,6 +85,7 @@
"Sharing %s failed, because %s is not a member of the group %s" : "Kohteen %s jakaminen epäonnistui, koska käyttäjä %s ei ole ryhmän %s jäsen",
"You need to provide a password to create a public link, only protected links are allowed" : "Anna salasana luodaksesi julkisen linkin. Vain suojatut linkit ovat sallittuja",
"Sharing %s failed, because sharing with links is not allowed" : "Kohteen %s jakaminen epäonnistui, koska jakaminen linkkejä käyttäen ei ole sallittu",
+ "Not allowed to create a federated share with the same user" : "Saman käyttäjän kanssa ei ole sallittua luoda federoitua jakoa",
"Sharing %s failed, could not find %s, maybe the server is currently unreachable." : "Kohteen %s jakaminen epäonnistui, kohdetta %s ei löytynyt. Kenties palvelin ei ole juuri nyt tavoitettavissa.",
"Setting permissions for %s failed, because the item was not found" : "Kohteen %s oikeuksien asettaminen epäonnistui, koska kohdetta ei löytynyt",
"Cannot set expiration date. Expiration date is in the past" : "Vanhentumispäivää ei voi asettaa. Vanhentumispäivä on jo mennyt",
diff --git a/lib/l10n/it.js b/lib/l10n/it.js
index ed9f01c8a39..5c611b750f4 100644
--- a/lib/l10n/it.js
+++ b/lib/l10n/it.js
@@ -96,6 +96,7 @@ OC.L10N.register(
"Sharing %s failed, because %s is not a member of the group %s" : "Condivisione di %s non riuscita, poiché %s non appartiene al gruppo %s",
"You need to provide a password to create a public link, only protected links are allowed" : "Devi fornire una password per creare un collegamento pubblico, sono consentiti solo i collegamenti protetti",
"Sharing %s failed, because sharing with links is not allowed" : "Condivisione di %s non riuscita, poiché i collegamenti non sono consentiti",
+ "Not allowed to create a federated share with the same user" : "Non è consentito creare una condivisione federata con lo stesso utente",
"Sharing %s failed, could not find %s, maybe the server is currently unreachable." : "La condivisione di %s non è riuscita, impossibile trovare %s, è probabile che il server non sia al momento raggiungibile.",
"Share type %s is not valid for %s" : "Il tipo di condivisione %s non è valido per %s",
"Setting permissions for %s failed, because the permissions exceed permissions granted to %s" : "Impostazione permessi per %s non riuscita, poiché i permessi superano i permessi accordati a %s",
diff --git a/lib/l10n/it.json b/lib/l10n/it.json
index 4a6735185d6..93d4c6a5c72 100644
--- a/lib/l10n/it.json
+++ b/lib/l10n/it.json
@@ -94,6 +94,7 @@
"Sharing %s failed, because %s is not a member of the group %s" : "Condivisione di %s non riuscita, poiché %s non appartiene al gruppo %s",
"You need to provide a password to create a public link, only protected links are allowed" : "Devi fornire una password per creare un collegamento pubblico, sono consentiti solo i collegamenti protetti",
"Sharing %s failed, because sharing with links is not allowed" : "Condivisione di %s non riuscita, poiché i collegamenti non sono consentiti",
+ "Not allowed to create a federated share with the same user" : "Non è consentito creare una condivisione federata con lo stesso utente",
"Sharing %s failed, could not find %s, maybe the server is currently unreachable." : "La condivisione di %s non è riuscita, impossibile trovare %s, è probabile che il server non sia al momento raggiungibile.",
"Share type %s is not valid for %s" : "Il tipo di condivisione %s non è valido per %s",
"Setting permissions for %s failed, because the permissions exceed permissions granted to %s" : "Impostazione permessi per %s non riuscita, poiché i permessi superano i permessi accordati a %s",
diff --git a/lib/l10n/pt_BR.js b/lib/l10n/pt_BR.js
index 2595d5dfd38..f4e52410ba1 100644
--- a/lib/l10n/pt_BR.js
+++ b/lib/l10n/pt_BR.js
@@ -96,6 +96,7 @@ OC.L10N.register(
"Sharing %s failed, because %s is not a member of the group %s" : "Compartilhamento %s falhou, porque %s não é membro do grupo %s",
"You need to provide a password to create a public link, only protected links are allowed" : "Você precisa fornecer uma senha para criar um link público, apenas links protegidos são permitidos",
"Sharing %s failed, because sharing with links is not allowed" : "Compartilhamento %s falhou, porque compartilhamento com links não é permitido",
+ "Not allowed to create a federated share with the same user" : "Não é permitido criar um compartilhamento associado com o mesmo usuário",
"Sharing %s failed, could not find %s, maybe the server is currently unreachable." : "O compartilhamento %s falhou, porque não foi possível encontrar %s, talvez o servidor esteja inacessível.",
"Share type %s is not valid for %s" : "Tipo de compartilhamento %s não é válido para %s",
"Setting permissions for %s failed, because the permissions exceed permissions granted to %s" : "Definir permissões para %s falhou, porque as permissões excedem as permissões concedidas a %s",
diff --git a/lib/l10n/pt_BR.json b/lib/l10n/pt_BR.json
index 0da54181b3f..80fad95147c 100644
--- a/lib/l10n/pt_BR.json
+++ b/lib/l10n/pt_BR.json
@@ -94,6 +94,7 @@
"Sharing %s failed, because %s is not a member of the group %s" : "Compartilhamento %s falhou, porque %s não é membro do grupo %s",
"You need to provide a password to create a public link, only protected links are allowed" : "Você precisa fornecer uma senha para criar um link público, apenas links protegidos são permitidos",
"Sharing %s failed, because sharing with links is not allowed" : "Compartilhamento %s falhou, porque compartilhamento com links não é permitido",
+ "Not allowed to create a federated share with the same user" : "Não é permitido criar um compartilhamento associado com o mesmo usuário",
"Sharing %s failed, could not find %s, maybe the server is currently unreachable." : "O compartilhamento %s falhou, porque não foi possível encontrar %s, talvez o servidor esteja inacessível.",
"Share type %s is not valid for %s" : "Tipo de compartilhamento %s não é válido para %s",
"Setting permissions for %s failed, because the permissions exceed permissions granted to %s" : "Definir permissões para %s falhou, porque as permissões excedem as permissões concedidas a %s",
diff --git a/lib/l10n/sq.js b/lib/l10n/sq.js
index 386cd1adeff..3318d18ad38 100644
--- a/lib/l10n/sq.js
+++ b/lib/l10n/sq.js
@@ -96,6 +96,7 @@ OC.L10N.register(
"Sharing %s failed, because %s is not a member of the group %s" : "Ndarja e %s me të tjerët dështoi, ngaqë %s s’është anëtar i grupit %s",
"You need to provide a password to create a public link, only protected links are allowed" : "Lypset të jepni një fjalëkalim që të krijoni një lidhje publike, lejohen vetëm lidhje të mbrojtura",
"Sharing %s failed, because sharing with links is not allowed" : "Ndarja e %s me të tjerët dështoi, ngaqë nuk lejohet ndarja me lidhje",
+ "Not allowed to create a federated share with the same user" : "S’i lejohet të krijojë një ndarje të federuar me të njëjtin përdorues",
"Sharing %s failed, could not find %s, maybe the server is currently unreachable." : "Ndarja për %s dështoi, s’u gjet dot %s, ndoshta shërbyesi është hëpërhë jashtë pune.",
"Share type %s is not valid for %s" : "Lloji i ndarjes %s s’është i vlefshëm për %s",
"Setting permissions for %s failed, because the permissions exceed permissions granted to %s" : "Caktimi i lejeve për %s dështoi, ngaqë lejet tejkalojnë lejet e akorduara për %s",
diff --git a/lib/l10n/sq.json b/lib/l10n/sq.json
index 3cf25314937..d902d07ee1b 100644
--- a/lib/l10n/sq.json
+++ b/lib/l10n/sq.json
@@ -94,6 +94,7 @@
"Sharing %s failed, because %s is not a member of the group %s" : "Ndarja e %s me të tjerët dështoi, ngaqë %s s’është anëtar i grupit %s",
"You need to provide a password to create a public link, only protected links are allowed" : "Lypset të jepni një fjalëkalim që të krijoni një lidhje publike, lejohen vetëm lidhje të mbrojtura",
"Sharing %s failed, because sharing with links is not allowed" : "Ndarja e %s me të tjerët dështoi, ngaqë nuk lejohet ndarja me lidhje",
+ "Not allowed to create a federated share with the same user" : "S’i lejohet të krijojë një ndarje të federuar me të njëjtin përdorues",
"Sharing %s failed, could not find %s, maybe the server is currently unreachable." : "Ndarja për %s dështoi, s’u gjet dot %s, ndoshta shërbyesi është hëpërhë jashtë pune.",
"Share type %s is not valid for %s" : "Lloji i ndarjes %s s’është i vlefshëm për %s",
"Setting permissions for %s failed, because the permissions exceed permissions granted to %s" : "Caktimi i lejeve për %s dështoi, ngaqë lejet tejkalojnë lejet e akorduara për %s",
diff --git a/lib/private/avatar.php b/lib/private/avatar.php
index 37a813f3ff8..c87facd25da 100644
--- a/lib/private/avatar.php
+++ b/lib/private/avatar.php
@@ -31,6 +31,7 @@ namespace OC;
use OCP\Files\Folder;
use OCP\Files\File;
+use OCP\Files\NotFoundException;
use OCP\IL10N;
use OC_Image;
@@ -62,28 +63,14 @@ class Avatar implements \OCP\IAvatar {
* @return boolean|\OCP\IImage containing the avatar or false if there's no image
*/
public function get ($size = 64) {
- if ($this->folder->nodeExists('avatar.jpg')) {
- $ext = 'jpg';
- } elseif ($this->folder->nodeExists('avatar.png')) {
- $ext = 'png';
- } else {
+ try {
+ $file = $this->getFile($size);
+ } catch (NotFoundException $e) {
return false;
}
$avatar = new OC_Image();
- if ($this->folder->nodeExists('avatar.' . $size . '.' . $ext)) {
- /** @var File $node */
- $node = $this->folder->get('avatar.' . $size . '.' . $ext);
- $avatar->loadFromData($node->getContent());
- } else {
- /** @var File $node */
- $node = $this->folder->get('avatar.' . $ext);
- $avatar->loadFromData($node->getContent());
- if ($size > 0) {
- $avatar->resize($size);
- }
- $this->folder->newFile('avatar.' . $size . '.' . $ext)->putContent($avatar->data());
- }
+ $avatar->loadFromData($file->getContent());
return $avatar;
}
@@ -144,4 +131,50 @@ class Avatar implements \OCP\IAvatar {
$this->folder->get('avatar.png')->delete();
} catch (\OCP\Files\NotFoundException $e) {}
}
+
+ /**
+ * Get the File of an avatar of size $size.
+ *
+ * @param int $size
+ * @return File
+ * @throws NotFoundException
+ */
+ public function getFile($size) {
+ $ext = $this->getExtention();
+
+ $path = 'avatar.' . $size . '.' . $ext;
+
+ try {
+ $file = $this->folder->get($path);
+ } catch (NotFoundException $e) {
+ if ($size <= 0) {
+ throw new NotFoundException;
+ }
+
+ $avatar = new OC_Image();
+ /** @var File $file */
+ $file = $this->folder->get('avatar.' . $ext);
+ $avatar->loadFromData($file->getContent());
+ $avatar->resize($size);
+ $file = $this->folder->newFile($path);
+ $file->putContent($avatar->data());
+ }
+
+ return $file;
+ }
+
+ /**
+ * Get the extention of the avatar. If there is no avatar throw Exception
+ *
+ * @return string
+ * @throws NotFoundException
+ */
+ private function getExtention() {
+ if ($this->folder->nodeExists('avatar.jpg')) {
+ return 'jpg';
+ } elseif ($this->folder->nodeExists('avatar.png')) {
+ return 'png';
+ }
+ throw new NotFoundException;
+ }
}
diff --git a/lib/private/helper.php b/lib/private/helper.php
index 78a567638ef..779a67a2340 100644
--- a/lib/private/helper.php
+++ b/lib/private/helper.php
@@ -67,21 +67,6 @@ class OC_Helper {
}
/**
- * Creates an url
- * @param string $app app
- * @param string $file file
- * @param array $args array with param=>value, will be appended to the returned url
- * The value of $args will be urlencoded
- * @return string the url
- * @deprecated Use \OC::$server->getURLGenerator()->linkTo($app, $file, $args)
- *
- * Returns a url to the given app and file.
- */
- public static function linkTo( $app, $file, $args = array() ) {
- return OC::$server->getURLGenerator()->linkTo($app, $file, $args);
- }
-
- /**
* Creates an absolute url
* @param string $app app
* @param string $file file
@@ -93,7 +78,7 @@ class OC_Helper {
*/
public static function linkToAbsolute($app, $file, $args = array()) {
return OC::$server->getURLGenerator()->getAbsoluteURL(
- self::linkTo($app, $file, $args)
+ OC::$server->getURLGenerator()->linkTo($app, $file, $args)
);
}
@@ -117,7 +102,7 @@ class OC_Helper {
* Returns a url to the given service.
*/
public static function linkToRemoteBase($service) {
- return self::linkTo('', 'remote.php') . '/' . $service;
+ return OC::$server->getURLGenerator()->linkTo('', 'remote.php') . '/' . $service;
}
/**
@@ -147,7 +132,7 @@ class OC_Helper {
if ($service === 'files') {
$url = OC::$server->getURLGenerator()->getAbsoluteURL('/s');
} else {
- $url = OC::$server->getURLGenerator()->getAbsoluteURL(self::linkTo('', 'public.php').'?service='.$service);
+ $url = OC::$server->getURLGenerator()->getAbsoluteURL(OC::$server->getURLGenerator()->linkTo('', 'public.php').'?service='.$service);
}
return $url . (($add_slash && $service[strlen($service) - 1] != '/') ? '/' : '');
}
diff --git a/lib/private/log/owncloud.php b/lib/private/log/owncloud.php
index f8a5f7534c5..be69150d877 100644
--- a/lib/private/log/owncloud.php
+++ b/lib/private/log/owncloud.php
@@ -101,6 +101,9 @@ class OC_Log_Owncloud {
// Fall back to error_log
error_log($entry);
}
+ if (php_sapi_name() === 'cli-server') {
+ error_log($message, 4);
+ }
}
/**
diff --git a/lib/private/route/router.php b/lib/private/route/router.php
index 4ca5e16ddf2..f144c543989 100644
--- a/lib/private/route/router.php
+++ b/lib/private/route/router.php
@@ -92,7 +92,7 @@ class Router implements IRouter {
$this->logger = $logger;
$baseUrl = \OC::$WEBROOT;
if(!(getenv('front_controller_active') === 'true')) {
- $baseUrl = \OC_Helper::linkTo('', 'index.php');
+ $baseUrl = \OC::$server->getURLGenerator()->linkTo('', 'index.php');
}
if (!\OC::$CLI) {
$method = $_SERVER['REQUEST_METHOD'];
diff --git a/lib/private/share/helper.php b/lib/private/share/helper.php
index 26bbca81317..0441647df83 100644
--- a/lib/private/share/helper.php
+++ b/lib/private/share/helper.php
@@ -289,4 +289,38 @@ class Helper extends \OC\Share\Constants {
$hint = $l->t('Invalid Federated Cloud ID');
throw new HintException('Invalid Fededrated Cloud ID', $hint);
}
+
+ /**
+ * check if two federated cloud IDs refer to the same user
+ *
+ * @param string $user1
+ * @param string $server1
+ * @param string $user2
+ * @param string $server2
+ * @return bool true if both users and servers are the same
+ */
+ public static function isSameUserOnSameServer($user1, $server1, $user2, $server2) {
+ $normalizedServer1 = strtolower(\OC\Share\Share::removeProtocolFromUrl($server1));
+ $normalizedServer2 = strtolower(\OC\Share\Share::removeProtocolFromUrl($server2));
+
+ if (rtrim($normalizedServer1, '/') === rtrim($normalizedServer2, '/')) {
+ // FIXME this should be a method in the user management instead
+ \OCP\Util::emitHook(
+ '\OCA\Files_Sharing\API\Server2Server',
+ 'preLoginNameUsedAsUserName',
+ array('uid' => &$user1)
+ );
+ \OCP\Util::emitHook(
+ '\OCA\Files_Sharing\API\Server2Server',
+ 'preLoginNameUsedAsUserName',
+ array('uid' => &$user2)
+ );
+
+ if ($user1 === $user2) {
+ return true;
+ }
+ }
+
+ return false;
+ }
}
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index 3edffba8a3f..fff437b3ff7 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -849,11 +849,20 @@ class Share extends Constants {
throw new \Exception($message_t);
}
+ // don't allow federated shares if source and target server are the same
+ list($user, $remote) = Helper::splitUserRemote($shareWith);
+ $currentServer = self::removeProtocolFromUrl(\OC::$server->getURLGenerator()->getAbsoluteURL('/'));
+ $currentUser = \OC::$server->getUserSession()->getUser()->getUID();
+ if (Helper::isSameUserOnSameServer($user, $remote, $currentUser, $currentServer)) {
+ $message = 'Not allowed to create a federated share with the same user.';
+ $message_t = $l->t('Not allowed to create a federated share with the same user');
+ \OCP\Util::writeLog('OCP\Share', $message, \OCP\Util::DEBUG);
+ throw new \Exception($message_t);
+ }
$token = \OC::$server->getSecureRandom()->getMediumStrengthGenerator()->generate(self::TOKEN_LENGTH, \OCP\Security\ISecureRandom::CHAR_LOWER . \OCP\Security\ISecureRandom::CHAR_UPPER .
\OCP\Security\ISecureRandom::CHAR_DIGITS);
- list($user, $remote) = Helper::splitUserRemote($shareWith);
$shareWith = $user . '@' . $remote;
$shareId = self::put($itemType, $itemSource, $shareType, $shareWith, $uidOwner, $permissions, null, $token, $itemSourceName);
@@ -2510,7 +2519,7 @@ class Share extends Constants {
* @param string $url
* @return string
*/
- private static function removeProtocolFromUrl($url) {
+ public static function removeProtocolFromUrl($url) {
if (strpos($url, 'https://') === 0) {
return substr($url, strlen('https://'));
} else if (strpos($url, 'http://') === 0) {
diff --git a/lib/private/template/functions.php b/lib/private/template/functions.php
index d156d26f9ce..6298f25edc1 100644
--- a/lib/private/template/functions.php
+++ b/lib/private/template/functions.php
@@ -146,7 +146,7 @@ function component($app, $file) {
* For further information have a look at OC_Helper::linkTo
*/
function link_to( $app, $file, $args = array() ) {
- return OC_Helper::linkTo( $app, $file, $args );
+ return \OC::$server->getURLGenerator()->linkTo($app, $file, $args);
}
/**
diff --git a/lib/private/templatelayout.php b/lib/private/templatelayout.php
index 1a6a07ddc9f..fce018115ac 100644
--- a/lib/private/templatelayout.php
+++ b/lib/private/templatelayout.php
@@ -136,7 +136,13 @@ class OC_TemplateLayout extends OC_Template {
$this->assign('user_uid', OC_User::getUser());
$this->assign('appsmanagement_active', $appsMgmtActive);
$this->assign('enableAvatars', $this->config->getSystemValue('enable_avatars', true));
- $this->assign('userAvatarSet', \OC_Helper::userAvatarSet(OC_User::getUser()));
+
+ if (OC_User::getUser() === false) {
+ $this->assign('userAvatarSet', false);
+ } else {
+ $this->assign('userAvatarSet', \OC::$server->getAvatarManager()->getAvatar(OC_User::getUser())->exists());
+ }
+
} else if ($renderAs == 'error') {
parent::__construct('core', 'layout.guest', '', false);
$this->assign('bodyid', 'body-login');
@@ -275,8 +281,8 @@ class OC_TemplateLayout extends OC_Template {
$writer->writeAsset($cssCollection);
}
- $this->append('jsfiles', OC_Helper::linkTo('assets', "$jsHash.js"));
- $this->append('cssfiles', OC_Helper::linkTo('assets', "$cssHash.css"));
+ $this->append('jsfiles', \OC::$server->getURLGenerator()->linkTo('assets', "$jsHash.js"));
+ $this->append('cssfiles', \OC::$server->getURLGenerator()->linkTo('assets', "$cssHash.css"));
}
/**
diff --git a/lib/public/iavatar.php b/lib/public/iavatar.php
index fc29212a599..3d92d00b83d 100644
--- a/lib/public/iavatar.php
+++ b/lib/public/iavatar.php
@@ -24,6 +24,8 @@
*/
namespace OCP;
+use OCP\Files\File;
+use OCP\Files\NotFoundException;
/**
* This class provides avatar functionality
@@ -64,4 +66,13 @@ interface IAvatar {
* @since 6.0.0
*/
public function remove();
+
+ /**
+ * Get the file of the avatar
+ * @param int $size
+ * @return File
+ * @throws NotFoundException
+ * @since 9.0.0
+ */
+ public function getFile($size);
}
diff --git a/lib/public/util.php b/lib/public/util.php
index 4e783b764ed..e0c875438f2 100644
--- a/lib/public/util.php
+++ b/lib/public/util.php
@@ -316,7 +316,7 @@ class Util {
* @since 4.0.0 - parameter $args was added in 4.5.0
*/
public static function linkTo( $app, $file, $args = array() ) {
- return(\OC_Helper::linkTo( $app, $file, $args ));
+ return \OC::$server->getURLGenerator()->linkTo($app, $file, $args);
}
/**
diff --git a/settings/l10n/pt_BR.js b/settings/l10n/pt_BR.js
index 9949b4f7d8e..9abef09085e 100644
--- a/settings/l10n/pt_BR.js
+++ b/settings/l10n/pt_BR.js
@@ -217,18 +217,18 @@ OC.L10N.register(
"Uninstall App" : "Desinstalar Aplicativo",
"Enable experimental apps" : "Habilitar aplicativos experimentais",
"Hey there,<br><br>just letting you know that you now have an %s account.<br><br>Your username: %s<br>Access it: <a href=\"%s\">%s</a><br><br>" : "Olá,<br><br>somente para lembrar que agora você tem uma conta %s.<br><br>Seu nome de usuário é: %s<br>Acesse em: <a href=\"%s\">%s</a><br><br>",
- "Cheers!" : "Saúde!",
+ "Cheers!" : "Saudações!",
"Hey there,\n\njust letting you know that you now have an %s account.\n\nYour username: %s\nAccess it: %s\n\n" : "Olá,\n\nsomente para lembrar que agora você tem uma conta %s.\n\nSeu nome de usuário é: %s\nAcesse em: %s\n\n",
"Administrator documentation" : "Documentação do administrador",
"Online documentation" : "Documentação online",
"Forum" : "Fórum",
"Issue tracker" : "Rastreador de tópicos",
"Commercial support" : "Suporte comercial",
- "Get the apps to sync your files" : "Faça com que os apps sincronizem seus arquivos",
+ "Get the apps to sync your files" : "Obtenha apps para sincronizar seus arquivos",
"Desktop client" : "Cliente Desktop",
"Android app" : "App Android",
"iOS app" : "App iOS",
- "If you want to support the project\n\t\t<a href=\"https://owncloud.org/contribute\"\n\t\t\ttarget=\"_blank\" rel=\"noreferrer\">join development</a>\n\t\tor\n\t\t<a href=\"https://owncloud.org/promote\"\n\t\t\ttarget=\"_blank\" rel=\"noreferrer\">spread the word</a>!" : "Se você quiser dar suporte ao projeto\n⇥⇥<a href=\"https://owncloud.org/contribute\"\n⇥⇥⇥target=\"_blank\" rel=\"noreferrer\">juntese ao desenvolvimento</a>\n⇥⇥ou\n⇥⇥<a href=\"https://owncloud.org/promote\"\n⇥⇥⇥target=\"_blank\" rel=\"noreferrer\">espalhe para o mundo</a>!",
+ "If you want to support the project\n\t\t<a href=\"https://owncloud.org/contribute\"\n\t\t\ttarget=\"_blank\" rel=\"noreferrer\">join development</a>\n\t\tor\n\t\t<a href=\"https://owncloud.org/promote\"\n\t\t\ttarget=\"_blank\" rel=\"noreferrer\">spread the word</a>!" : "Se você quiser suportar o projeto, \n⇥⇥<a href=\"https://owncloud.org/contribute\"\n⇥⇥⇥target=\"_blank\" rel=\"noreferrer\">ajude com o desenvolvimento</a>\n⇥⇥ou\n⇥⇥<a href=\"https://owncloud.org/promote\"\n⇥⇥⇥target=\"_blank\" rel=\"noreferrer\">ajude a divulgá-lo</a>!",
"Show First Run Wizard again" : "Mostrar Assistente de Primeira Execução novamente",
"You have used <strong>%s</strong> of the available <strong>%s</strong>" : "Você usou <strong>%s</strong> do seu espaço de <strong>%s</strong>",
"Password" : "Senha",
@@ -245,9 +245,9 @@ OC.L10N.register(
"You are member of the following groups:" : "Você é membro dos seguintes grupos:",
"Profile picture" : "Imagem para o perfil",
"Upload new" : "Enviar nova foto",
- "Select new from Files" : "Selecinar uma nova dos Arquivos",
+ "Select new from Files" : "Selecionar uma nova dos Arquivos",
"Remove image" : "Remover imagem",
- "Either png or jpg. Ideally square but you will be able to crop it. The file is not allowed to exceed the maximum size of 20 MB." : "Ou png ou jpg. Idealmente quadrada, mas você será capaz de cortá-la. O arquivo não pode exceder o tamanho máximo de 20 MB.",
+ "Either png or jpg. Ideally square but you will be able to crop it. The file is not allowed to exceed the maximum size of 20 MB." : "Formato png ou jpg. Idealmente quadrada, mas você será capaz de cortá-la. O arquivo não pode exceder o tamanho máximo de 20 MB.",
"Your avatar is provided by your original account." : "Seu avatar é fornecido por sua conta original.",
"Cancel" : "Cancelar",
"Choose as profile image" : "Escolha como imagem para o perfil",
diff --git a/settings/l10n/pt_BR.json b/settings/l10n/pt_BR.json
index 6cb18294c06..f885dd22136 100644
--- a/settings/l10n/pt_BR.json
+++ b/settings/l10n/pt_BR.json
@@ -215,18 +215,18 @@
"Uninstall App" : "Desinstalar Aplicativo",
"Enable experimental apps" : "Habilitar aplicativos experimentais",
"Hey there,<br><br>just letting you know that you now have an %s account.<br><br>Your username: %s<br>Access it: <a href=\"%s\">%s</a><br><br>" : "Olá,<br><br>somente para lembrar que agora você tem uma conta %s.<br><br>Seu nome de usuário é: %s<br>Acesse em: <a href=\"%s\">%s</a><br><br>",
- "Cheers!" : "Saúde!",
+ "Cheers!" : "Saudações!",
"Hey there,\n\njust letting you know that you now have an %s account.\n\nYour username: %s\nAccess it: %s\n\n" : "Olá,\n\nsomente para lembrar que agora você tem uma conta %s.\n\nSeu nome de usuário é: %s\nAcesse em: %s\n\n",
"Administrator documentation" : "Documentação do administrador",
"Online documentation" : "Documentação online",
"Forum" : "Fórum",
"Issue tracker" : "Rastreador de tópicos",
"Commercial support" : "Suporte comercial",
- "Get the apps to sync your files" : "Faça com que os apps sincronizem seus arquivos",
+ "Get the apps to sync your files" : "Obtenha apps para sincronizar seus arquivos",
"Desktop client" : "Cliente Desktop",
"Android app" : "App Android",
"iOS app" : "App iOS",
- "If you want to support the project\n\t\t<a href=\"https://owncloud.org/contribute\"\n\t\t\ttarget=\"_blank\" rel=\"noreferrer\">join development</a>\n\t\tor\n\t\t<a href=\"https://owncloud.org/promote\"\n\t\t\ttarget=\"_blank\" rel=\"noreferrer\">spread the word</a>!" : "Se você quiser dar suporte ao projeto\n⇥⇥<a href=\"https://owncloud.org/contribute\"\n⇥⇥⇥target=\"_blank\" rel=\"noreferrer\">juntese ao desenvolvimento</a>\n⇥⇥ou\n⇥⇥<a href=\"https://owncloud.org/promote\"\n⇥⇥⇥target=\"_blank\" rel=\"noreferrer\">espalhe para o mundo</a>!",
+ "If you want to support the project\n\t\t<a href=\"https://owncloud.org/contribute\"\n\t\t\ttarget=\"_blank\" rel=\"noreferrer\">join development</a>\n\t\tor\n\t\t<a href=\"https://owncloud.org/promote\"\n\t\t\ttarget=\"_blank\" rel=\"noreferrer\">spread the word</a>!" : "Se você quiser suportar o projeto, \n⇥⇥<a href=\"https://owncloud.org/contribute\"\n⇥⇥⇥target=\"_blank\" rel=\"noreferrer\">ajude com o desenvolvimento</a>\n⇥⇥ou\n⇥⇥<a href=\"https://owncloud.org/promote\"\n⇥⇥⇥target=\"_blank\" rel=\"noreferrer\">ajude a divulgá-lo</a>!",
"Show First Run Wizard again" : "Mostrar Assistente de Primeira Execução novamente",
"You have used <strong>%s</strong> of the available <strong>%s</strong>" : "Você usou <strong>%s</strong> do seu espaço de <strong>%s</strong>",
"Password" : "Senha",
@@ -243,9 +243,9 @@
"You are member of the following groups:" : "Você é membro dos seguintes grupos:",
"Profile picture" : "Imagem para o perfil",
"Upload new" : "Enviar nova foto",
- "Select new from Files" : "Selecinar uma nova dos Arquivos",
+ "Select new from Files" : "Selecionar uma nova dos Arquivos",
"Remove image" : "Remover imagem",
- "Either png or jpg. Ideally square but you will be able to crop it. The file is not allowed to exceed the maximum size of 20 MB." : "Ou png ou jpg. Idealmente quadrada, mas você será capaz de cortá-la. O arquivo não pode exceder o tamanho máximo de 20 MB.",
+ "Either png or jpg. Ideally square but you will be able to crop it. The file is not allowed to exceed the maximum size of 20 MB." : "Formato png ou jpg. Idealmente quadrada, mas você será capaz de cortá-la. O arquivo não pode exceder o tamanho máximo de 20 MB.",
"Your avatar is provided by your original account." : "Seu avatar é fornecido por sua conta original.",
"Cancel" : "Cancelar",
"Choose as profile image" : "Escolha como imagem para o perfil",
diff --git a/settings/l10n/sq.js b/settings/l10n/sq.js
index 7248797b6f2..6f816c350d4 100644
--- a/settings/l10n/sq.js
+++ b/settings/l10n/sq.js
@@ -29,6 +29,7 @@ OC.L10N.register(
"Enabled" : "E aktivizuar",
"Not enabled" : "E paaktivizuar",
"installing and updating apps via the app store or Federated Cloud Sharing" : "instalim dhe përditësim aplikacionesh përmes shitores së aplikacioneve ose Federated Cloud Sharing",
+ "Federated Cloud Sharing" : "Ndarje Në Re e Federuar ",
"cURL is using an outdated %s version (%s). Please update your operating system or features such as %s will not work reliably." : "cURL-ja po përdor një version %s të vjetruar (%s). Ju lutemi, përditësoni sistemin tuaj operativ ose përndryshe veçori të tilla si %s nuk do të punojnë në mënyrë të qëndrueshme.",
"A problem occurred, please check your log files (Error: %s)" : "Ndodhi një gabim, ju lutemi, kontrolloni kartelat tuaja regjistër (Error: %s)",
"Migration Completed" : "Migrimi u Plotësua",
@@ -127,6 +128,7 @@ OC.L10N.register(
"Your server is running on Microsoft Windows. We highly recommend Linux for optimal user experience." : "Shërbyesi juaj xhiron nën Microsoft Windows. Këshillojmë fort Linux-in për punim optimal nga ana e përdoruesit.",
"%1$s below version %2$s is installed, for stability and performance reasons we recommend to update to a newer %1$s version." : "Ka të instaluar %1$s nën versionin %2$s, për arsye qëndrueshmërie dhe performance këshillojmë të përditësohet me një version %1$s më të ri.",
"The PHP module 'fileinfo' is missing. We strongly recommend to enable this module to get best results with mime-type detection." : "Moduli PHP 'fileinfo' mungon. Ju këshillojmë me forcë ta aktivizoni këtë modul, për të patur përfundimet më të mira në zbulim llojesh MIME.",
+ "Transactional file locking is disabled, this might lead to issues with race conditions. Enable 'filelocking.enabled' in config.php to avoid these problems. See the <a target=\"_blank\" href=\"%s\">documentation ↗</a> for more information." : "Kyçja e kartelave gjatë transaksioneve është e çaktivizuar, kjo mund të sjellë probleme me gjendje <em>race conditions</em>. Që të shmangni këto probleme, aktivizoni 'filelocking.enabled' te config.php. Për më tepër të dhëna, shihni <a target=\"_blank\" href=\"%s\">dokumentimin ↗</a>.",
"System locale can not be set to a one which supports UTF-8." : "Si vendore sistemi nuk mund të caktohet një që mbulon UTF-8.",
"This means that there might be problems with certain characters in file names." : "Kjo do të thotë që mund të ketë probleme me disa shenja në emra kartelash.",
"We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Këshillojmë me forcë instalimin në sistemin tuaj të paketave të domosdoshme për mbulim të një prej vendoreve vijuese: %s.",
diff --git a/settings/l10n/sq.json b/settings/l10n/sq.json
index 1b27cb6d31f..5192207a879 100644
--- a/settings/l10n/sq.json
+++ b/settings/l10n/sq.json
@@ -27,6 +27,7 @@
"Enabled" : "E aktivizuar",
"Not enabled" : "E paaktivizuar",
"installing and updating apps via the app store or Federated Cloud Sharing" : "instalim dhe përditësim aplikacionesh përmes shitores së aplikacioneve ose Federated Cloud Sharing",
+ "Federated Cloud Sharing" : "Ndarje Në Re e Federuar ",
"cURL is using an outdated %s version (%s). Please update your operating system or features such as %s will not work reliably." : "cURL-ja po përdor një version %s të vjetruar (%s). Ju lutemi, përditësoni sistemin tuaj operativ ose përndryshe veçori të tilla si %s nuk do të punojnë në mënyrë të qëndrueshme.",
"A problem occurred, please check your log files (Error: %s)" : "Ndodhi një gabim, ju lutemi, kontrolloni kartelat tuaja regjistër (Error: %s)",
"Migration Completed" : "Migrimi u Plotësua",
@@ -125,6 +126,7 @@
"Your server is running on Microsoft Windows. We highly recommend Linux for optimal user experience." : "Shërbyesi juaj xhiron nën Microsoft Windows. Këshillojmë fort Linux-in për punim optimal nga ana e përdoruesit.",
"%1$s below version %2$s is installed, for stability and performance reasons we recommend to update to a newer %1$s version." : "Ka të instaluar %1$s nën versionin %2$s, për arsye qëndrueshmërie dhe performance këshillojmë të përditësohet me një version %1$s më të ri.",
"The PHP module 'fileinfo' is missing. We strongly recommend to enable this module to get best results with mime-type detection." : "Moduli PHP 'fileinfo' mungon. Ju këshillojmë me forcë ta aktivizoni këtë modul, për të patur përfundimet më të mira në zbulim llojesh MIME.",
+ "Transactional file locking is disabled, this might lead to issues with race conditions. Enable 'filelocking.enabled' in config.php to avoid these problems. See the <a target=\"_blank\" href=\"%s\">documentation ↗</a> for more information." : "Kyçja e kartelave gjatë transaksioneve është e çaktivizuar, kjo mund të sjellë probleme me gjendje <em>race conditions</em>. Që të shmangni këto probleme, aktivizoni 'filelocking.enabled' te config.php. Për më tepër të dhëna, shihni <a target=\"_blank\" href=\"%s\">dokumentimin ↗</a>.",
"System locale can not be set to a one which supports UTF-8." : "Si vendore sistemi nuk mund të caktohet një që mbulon UTF-8.",
"This means that there might be problems with certain characters in file names." : "Kjo do të thotë që mund të ketë probleme me disa shenja në emra kartelash.",
"We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Këshillojmë me forcë instalimin në sistemin tuaj të paketave të domosdoshme për mbulim të një prej vendoreve vijuese: %s.",
diff --git a/tests/core/avatar/avatarcontrollertest.php b/tests/core/avatar/avatarcontrollertest.php
index a113add72b9..7f69ba0aadb 100644
--- a/tests/core/avatar/avatarcontrollertest.php
+++ b/tests/core/avatar/avatarcontrollertest.php
@@ -26,8 +26,10 @@ use OCP\AppFramework\IAppContainer;
use OCP\AppFramework\Http;
use OCP\Files\Folder;
use OCP\Files\File;
+use OCP\Files\NotFoundException;
use OCP\IUser;
use OCP\IAvatar;
+use Punic\Exception;
use Test\Traits\UserTrait;
/**
@@ -56,6 +58,8 @@ class AvatarControllerTest extends \Test\TestCase {
private $avatarMock;
/** @var IUser */
private $userMock;
+ /** @var File */
+ private $avatarFile;
protected function setUp() {
parent::setUp();
@@ -88,6 +92,10 @@ class AvatarControllerTest extends \Test\TestCase {
->willReturnMap([['userId', $this->userMock]]);
$this->container['UserSession']->method('getUser')->willReturn($this->userMock);
+ $this->avatarFile = $this->getMock('OCP\Files\File');
+ $this->avatarFile->method('getContnet')->willReturn('image data');
+ $this->avatarFile->method('getMimeType')->willReturn('image type');
+ $this->avatarFile->method('getEtag')->willReturn('my etag');
}
public function tearDown() {
@@ -100,6 +108,7 @@ class AvatarControllerTest extends \Test\TestCase {
*/
public function testGetAvatarNoAvatar() {
$this->container['AvatarManager']->method('getAvatar')->willReturn($this->avatarMock);
+ $this->avatarMock->method('getFile')->will($this->throwException(new NotFoundException()));
$response = $this->avatarController->getAvatar('userId', 32);
//Comment out until JS is fixed
@@ -112,12 +121,8 @@ class AvatarControllerTest extends \Test\TestCase {
* Fetch the user's avatar
*/
public function testGetAvatar() {
- $image = $this->getMock('OCP\IImage');
- $image->method('data')->willReturn('image data');
- $image->method('mimeType')->willReturn('image type');
-
- $this->avatarMock->method('get')->willReturn($image);
- $this->container['AvatarManager']->method('getAvatar')->willReturn($this->avatarMock);
+ $this->avatarMock->method('getFile')->willReturn($this->avatarFile);
+ $this->container['AvatarManager']->method('getAvatar')->with('userId')->willReturn($this->avatarMock);
$response = $this->avatarController->getAvatar('userId', 32);
@@ -125,17 +130,19 @@ class AvatarControllerTest extends \Test\TestCase {
$this->assertArrayHasKey('Content-Type', $response->getHeaders());
$this->assertEquals('image type', $response->getHeaders()['Content-Type']);
- $this->assertEquals(crc32('image data'), $response->getEtag());
+ $this->assertEquals('my etag', $response->getEtag());
}
/**
* Fetch the avatar of a non-existing user
*/
public function testGetAvatarNoUser() {
- $this->avatarMock->method('get')->willReturn(null);
- $this->container['AvatarManager']->method('getAvatar')->willReturn($this->avatarMock);
+ $this->container['AvatarManager']
+ ->method('getAvatar')
+ ->with('userDoesNotExist')
+ ->will($this->throwException(new \Exception('user does not exist')));
- $response = $this->avatarController->getAvatar('userDoesnotexist', 32);
+ $response = $this->avatarController->getAvatar('userDoesNotExist', 32);
//Comment out until JS is fixed
//$this->assertEquals(Http::STATUS_NOT_FOUND, $response->getStatus());
@@ -148,8 +155,9 @@ class AvatarControllerTest extends \Test\TestCase {
*/
public function testGetAvatarSize() {
$this->avatarMock->expects($this->once())
- ->method('get')
- ->with($this->equalTo(32));
+ ->method('getFile')
+ ->with($this->equalTo(32))
+ ->willReturn($this->avatarFile);
$this->container['AvatarManager']->method('getAvatar')->willReturn($this->avatarMock);
@@ -161,8 +169,9 @@ class AvatarControllerTest extends \Test\TestCase {
*/
public function testGetAvatarSizeMin() {
$this->avatarMock->expects($this->once())
- ->method('get')
- ->with($this->equalTo(64));
+ ->method('getFile')
+ ->with($this->equalTo(64))
+ ->willReturn($this->avatarFile);
$this->container['AvatarManager']->method('getAvatar')->willReturn($this->avatarMock);
@@ -174,8 +183,9 @@ class AvatarControllerTest extends \Test\TestCase {
*/
public function testGetAvatarSizeMax() {
$this->avatarMock->expects($this->once())
- ->method('get')
- ->with($this->equalTo(2048));
+ ->method('getFile')
+ ->with($this->equalTo(2048))
+ ->willReturn($this->avatarFile);
$this->container['AvatarManager']->method('getAvatar')->willReturn($this->avatarMock);
diff --git a/tests/lib/avatartest.php b/tests/lib/avatartest.php
index 49e8be98c83..3d77a282a7d 100644
--- a/tests/lib/avatartest.php
+++ b/tests/lib/avatartest.php
@@ -60,12 +60,25 @@ class AvatarTest extends \Test\TestCase {
$file = $this->getMock('\OCP\Files\File');
$file->method('getContent')->willReturn($expected->data());
- $this->folder->method('get')->with('avatar.png')->willReturn($file);
+
+ $this->folder->method('get')
+ ->will($this->returnCallback(
+ function($path) use ($file) {
+ if ($path === 'avatar.png') {
+ return $file;
+ } else {
+ throw new \OCP\Files\NotFoundException;
+ }
+ }
+ ));
$newFile = $this->getMock('\OCP\Files\File');
$newFile->expects($this->once())
->method('putContent')
->with($expected2->data());
+ $newFile->expects($this->once())
+ ->method('getContent')
+ ->willReturn($expected2->data());
$this->folder->expects($this->once())
->method('newFile')
->with('avatar.32.png')
diff --git a/tests/lib/helper.php b/tests/lib/helper.php
index b7deb3fc13d..469ffecc773 100644
--- a/tests/lib/helper.php
+++ b/tests/lib/helper.php
@@ -296,52 +296,6 @@ class Test_Helper extends \Test\TestCase {
/**
* @small
- * test linkTo URL construction
- * @dataProvider provideDocRootAppUrlParts
- */
- public function testLinkToDocRoot($app, $file, $args, $expectedResult) {
- \OC::$WEBROOT = '';
- $result = \OC_Helper::linkTo($app, $file, $args);
-
- $this->assertEquals($expectedResult, $result);
- }
-
- /**
- * @small
- * test linkTo URL construction in sub directory
- * @dataProvider provideSubDirAppUrlParts
- */
- public function testLinkToSubDir($app, $file, $args, $expectedResult) {
- \OC::$WEBROOT = '/owncloud';
- $result = \OC_Helper::linkTo($app, $file, $args);
-
- $this->assertEquals($expectedResult, $result);
- }
-
- /**
- * @return array
- */
- public function provideDocRootAppUrlParts() {
- return array(
- array('files', 'ajax/list.php', array(), '/index.php/apps/files/ajax/list.php'),
- array('files', 'ajax/list.php', array('trut' => 'trat', 'dut' => 'dat'), '/index.php/apps/files/ajax/list.php?trut=trat&dut=dat'),
- array('', 'index.php', array('trut' => 'trat', 'dut' => 'dat'), '/index.php?trut=trat&dut=dat'),
- );
- }
-
- /**
- * @return array
- */
- public function provideSubDirAppUrlParts() {
- return array(
- array('files', 'ajax/list.php', array(), '/owncloud/index.php/apps/files/ajax/list.php'),
- array('files', 'ajax/list.php', array('trut' => 'trat', 'dut' => 'dat'), '/owncloud/index.php/apps/files/ajax/list.php?trut=trat&dut=dat'),
- array('', 'index.php', array('trut' => 'trat', 'dut' => 'dat'), '/owncloud/index.php?trut=trat&dut=dat'),
- );
- }
-
- /**
- * @small
* test linkToAbsolute URL construction
* @dataProvider provideDocRootAppAbsoluteUrlParts
*/
diff --git a/tests/lib/share/helper.php b/tests/lib/share/helper.php
index e37a3db8bf0..eaa29c8cb90 100644
--- a/tests/lib/share/helper.php
+++ b/tests/lib/share/helper.php
@@ -19,6 +19,10 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
+/**
+ * @group DB
+ * Class Test_Share_Helper
+ */
class Test_Share_Helper extends \Test\TestCase {
public function expireDateProvider() {
@@ -121,4 +125,37 @@ class Test_Share_Helper extends \Test\TestCase {
public function testSplitUserRemoteError($id) {
\OC\Share\Helper::splitUserRemote($id);
}
+
+ /**
+ * @dataProvider dataTestCompareServerAddresses
+ *
+ * @param string $server1
+ * @param string $server2
+ * @param bool $expected
+ */
+ public function testIsSameUserOnSameServer($user1, $server1, $user2, $server2, $expected) {
+ $this->assertSame($expected,
+ \OC\Share\Helper::isSameUserOnSameServer($user1, $server1, $user2, $server2)
+ );
+ }
+
+ public function dataTestCompareServerAddresses() {
+ return [
+ ['user1', 'http://server1', 'user1', 'http://server1', true],
+ ['user1', 'https://server1', 'user1', 'http://server1', true],
+ ['user1', 'http://serVer1', 'user1', 'http://server1', true],
+ ['user1', 'http://server1/', 'user1', 'http://server1', true],
+ ['user1', 'server1', 'user1', 'http://server1', true],
+ ['user1', 'http://server1', 'user1', 'http://server2', false],
+ ['user1', 'https://server1', 'user1', 'http://server2', false],
+ ['user1', 'http://serVer1', 'user1', 'http://serer2', false],
+ ['user1', 'http://server1/', 'user1', 'http://server2', false],
+ ['user1', 'server1', 'user1', 'http://server2', false],
+ ['user1', 'http://server1', 'user2', 'http://server1', false],
+ ['user1', 'https://server1', 'user2', 'http://server1', false],
+ ['user1', 'http://serVer1', 'user2', 'http://server1', false],
+ ['user1', 'http://server1/', 'user2', 'http://server1', false],
+ ['user1', 'server1', 'user2', 'http://server1', false],
+ ];
+ }
}