summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-06-02 12:27:30 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2015-06-02 12:29:06 +0200
commit9a4040c7ca2c0e4fc3f213ba3f6144e80f687754 (patch)
tree9fc19fd59b76d251b932f1001549219cc2761bda
parentd2f3710ede1fa72658a4c12264a90a1936faf9ca (diff)
downloadnextcloud-server-9a4040c7ca2c0e4fc3f213ba3f6144e80f687754.tar.gz
nextcloud-server-9a4040c7ca2c0e4fc3f213ba3f6144e80f687754.zip
Move the storage wrapping into a testable method
-rw-r--r--lib/private/encryption/manager.php53
-rw-r--r--lib/private/encryption/util.php49
2 files changed, 59 insertions, 43 deletions
diff --git a/lib/private/encryption/manager.php b/lib/private/encryption/manager.php
index ecbb86993ec..eeddea26b1a 100644
--- a/lib/private/encryption/manager.php
+++ b/lib/private/encryption/manager.php
@@ -208,49 +208,16 @@ class Manager implements IManager {
return $this->config->getAppValue('core', 'default_encryption_module');
}
+ /**
+ * Add storage wrapper
+ */
public static function setupStorage() {
- \OC\Files\Filesystem::addStorageWrapper('oc_encryption', function ($mountPoint, $storage, IMountPoint $mount) {
- $parameters = [
- 'storage' => $storage,
- 'mountPoint' => $mountPoint,
- 'mount' => $mount];
-
- if (!($storage instanceof Shared)) {
- $manager = \OC::$server->getEncryptionManager();
- $util = new Util(
- new View(),
- \OC::$server->getUserManager(),
- \OC::$server->getGroupManager(),
- \OC::$server->getConfig()
- );
- $user = \OC::$server->getUserSession()->getUser();
- $logger = \OC::$server->getLogger();
- $mountManager = Filesystem::getMountManager();
- $uid = $user ? $user->getUID() : null;
- $fileHelper = \OC::$server->getEncryptionFilesHelper();
- $keyStorage = \OC::$server->getEncryptionKeyStorage();
- $update = new Update(
- new View(),
- $util,
- Filesystem::getMountManager(),
- $manager,
- $fileHelper,
- $uid
- );
- return new Encryption(
- $parameters,
- $manager,
- $util,
- $logger,
- $fileHelper,
- $uid,
- $keyStorage,
- $update,
- $mountManager
- );
- } else {
- return $storage;
- }
- }, 2);
+ $util = new Util(
+ new View(),
+ \OC::$server->getUserManager(),
+ \OC::$server->getGroupManager(),
+ \OC::$server->getConfig()
+ );
+ \OC\Files\Filesystem::addStorageWrapper('oc_encryption', array($util, 'wrapStorage'), 2);
}
}
diff --git a/lib/private/encryption/util.php b/lib/private/encryption/util.php
index b77672d2f6b..d233b715f88 100644
--- a/lib/private/encryption/util.php
+++ b/lib/private/encryption/util.php
@@ -26,8 +26,12 @@ use OC\Encryption\Exceptions\EncryptionHeaderKeyExistsException;
use OC\Encryption\Exceptions\EncryptionHeaderToLargeException;
use OC\Encryption\Exceptions\ModuleDoesNotExistsException;
use OC\Files\Filesystem;
+use OC\Files\Storage\Shared;
+use OC\Files\Storage\Wrapper\Encryption;
use OC\Files\View;
use OCP\Encryption\IEncryptionModule;
+use OCP\Files\Mount\IMountPoint;
+use OCP\Files\Storage;
use OCP\IConfig;
class Util {
@@ -386,4 +390,49 @@ class Util {
return ($enabled === '1') ? true : false;
}
+ /**
+ * Wraps the given storage when it is not a shared storage
+ *
+ * @param string $mountPoint
+ * @param Storage $storage
+ * @param IMountPoint $mount
+ * @return Encryption|Storage
+ */
+ public function wrapStorage($mountPoint, Storage $storage, IMountPoint $mount) {
+ $parameters = [
+ 'storage' => $storage,
+ 'mountPoint' => $mountPoint,
+ 'mount' => $mount];
+
+ if (!($storage instanceof Shared)) {
+ $manager = \OC::$server->getEncryptionManager();
+ $user = \OC::$server->getUserSession()->getUser();
+ $logger = \OC::$server->getLogger();
+ $mountManager = Filesystem::getMountManager();
+ $uid = $user ? $user->getUID() : null;
+ $fileHelper = \OC::$server->getEncryptionFilesHelper();
+ $keyStorage = \OC::$server->getEncryptionKeyStorage();
+ $update = new Update(
+ new View(),
+ $this,
+ Filesystem::getMountManager(),
+ $manager,
+ $fileHelper,
+ $uid
+ );
+ return new Encryption(
+ $parameters,
+ $manager,
+ $this,
+ $logger,
+ $fileHelper,
+ $uid,
+ $keyStorage,
+ $update,
+ $mountManager
+ );
+ } else {
+ return $storage;
+ }
+ }
}
d='n332' href='#n332'>332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# 
# Translators:
# Mariano  <mstreet@kde.org.ar>, 2012.
# Michael Moroni <haikara90@gmail.com>, 2012.
#   <mstreet@kde.org.ar>, 2011, 2012.
msgid ""
msgstr ""
"Project-Id-Version: ownCloud\n"
"Report-Msgid-Bugs-To: http://bugs.owncloud.org/\n"
"POT-Creation-Date: 2013-04-17 02:20+0200\n"
"PO-Revision-Date: 2013-04-17 00:21+0000\n"
"Last-Translator: I Robot <owncloud-bot@tmit.eu>\n"
"Language-Team: Esperanto (http://www.transifex.com/projects/p/owncloud/language/eo/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: eo\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: ajax/share.php:97
#, php-format
msgid "User %s shared a file with you"
msgstr "La uzanto %s kunhavigis dosieron kun vi"

#: ajax/share.php:99
#, php-format
msgid "User %s shared a folder with you"
msgstr "La uzanto %s kunhavigis dosierujon kun vi"

#: ajax/share.php:101
#, php-format
msgid ""
"User %s shared the file \"%s\" with you. It is available for download here: "
"%s"
msgstr "La uzanto %s kunhavigis la dosieron “%s” kun vi. Ĝi elŝuteblas el tie ĉi: %s"

#: ajax/share.php:104
#, php-format
msgid ""
"User %s shared the folder \"%s\" with you. It is available for download "
"here: %s"
msgstr "La uzanto %s kunhavigis la dosierujon “%s” kun vi. Ĝi elŝuteblas el tie ĉi: %s"

#: ajax/vcategories/add.php:26 ajax/vcategories/edit.php:25
msgid "Category type not provided."
msgstr "Ne proviziĝis tipon de kategorio."

#: ajax/vcategories/add.php:30
msgid "No category to add?"
msgstr "Ĉu neniu kategorio estas aldonota?"

#: ajax/vcategories/add.php:37
#, php-format
msgid "This category already exists: %s"
msgstr ""

#: ajax/vcategories/addToFavorites.php:26 ajax/vcategories/delete.php:27
#: ajax/vcategories/favorites.php:24
#: ajax/vcategories/removeFromFavorites.php:26
msgid "Object type not provided."
msgstr "Ne proviziĝis tipon de objekto."

#: ajax/vcategories/addToFavorites.php:30
#: ajax/vcategories/removeFromFavorites.php:30
#, php-format
msgid "%s ID not provided."
msgstr "Ne proviziĝis ID-on de %s."

#: ajax/vcategories/addToFavorites.php:35
#, php-format
msgid "Error adding %s to favorites."
msgstr "Eraro dum aldono de %s al favoratoj."

#: ajax/vcategories/delete.php:35 js/oc-vcategories.js:136
msgid "No categories selected for deletion."
msgstr "Neniu kategorio elektiĝis por forigo."

#: ajax/vcategories/removeFromFavorites.php:35
#, php-format
msgid "Error removing %s from favorites."
msgstr "Eraro dum forigo de %s el favoratoj."

#: js/config.php:34
msgid "Sunday"
msgstr "dimanĉo"

#: js/config.php:35
msgid "Monday"
msgstr "lundo"

#: js/config.php:36
msgid "Tuesday"
msgstr "mardo"

#: js/config.php:37
msgid "Wednesday"
msgstr "merkredo"

#: js/config.php:38
msgid "Thursday"
msgstr "ĵaŭdo"

#: js/config.php:39
msgid "Friday"
msgstr "vendredo"

#: js/config.php:40
msgid "Saturday"
msgstr "sabato"

#: js/config.php:45
msgid "January"
msgstr "Januaro"

#: js/config.php:46
msgid "February"
msgstr "Februaro"

#: js/config.php:47
msgid "March"
msgstr "Marto"

#: js/config.php:48
msgid "April"
msgstr "Aprilo"

#: js/config.php:49
msgid "May"
msgstr "Majo"

#: js/config.php:50
msgid "June"
msgstr "Junio"

#: js/config.php:51
msgid "July"
msgstr "Julio"

#: js/config.php:52
msgid "August"
msgstr "Aŭgusto"

#: js/config.php:53
msgid "September"
msgstr "Septembro"

#: js/config.php:54
msgid "October"
msgstr "Oktobro"

#: js/config.php:55
msgid "November"
msgstr "Novembro"

#: js/config.php:56
msgid "December"
msgstr "Decembro"

#: js/js.js:286
msgid "Settings"
msgstr "Agordo"

#: js/js.js:718
msgid "seconds ago"
msgstr "sekundoj antaŭe"

#: js/js.js:719
msgid "1 minute ago"
msgstr "antaŭ 1 minuto"

#: js/js.js:720
msgid "{minutes} minutes ago"
msgstr "antaŭ {minutes} minutoj"

#: js/js.js:721
msgid "1 hour ago"
msgstr "antaŭ 1 horo"

#: js/js.js:722
msgid "{hours} hours ago"
msgstr "antaŭ {hours} horoj"

#: js/js.js:723
msgid "today"
msgstr "hodiaŭ"

#: js/js.js:724
msgid "yesterday"
msgstr "hieraŭ"

#: js/js.js:725
msgid "{days} days ago"
msgstr "antaŭ {days} tagoj"

#: js/js.js:726
msgid "last month"
msgstr "lastamonate"

#: js/js.js:727
msgid "{months} months ago"
msgstr "antaŭ {months} monatoj"

#: js/js.js:728
msgid "months ago"
msgstr "monatoj antaŭe"

#: js/js.js:729
msgid "last year"
msgstr "lastajare"

#: js/js.js:730
msgid "years ago"
msgstr "jaroj antaŭe"

#: js/oc-dialogs.js:117 js/oc-dialogs.js:247
msgid "Ok"
msgstr "Akcepti"

#: js/oc-dialogs.js:121 js/oc-dialogs.js:189 js/oc-dialogs.js:240
msgid "Cancel"
msgstr "Nuligi"

#: js/oc-dialogs.js:185
msgid "Choose"
msgstr "Elekti"

#: js/oc-dialogs.js:215
msgid "Yes"
msgstr "Jes"

#: js/oc-dialogs.js:222
msgid "No"
msgstr "Ne"

#: js/oc-vcategories.js:5 js/oc-vcategories.js:85 js/oc-vcategories.js:102
#: js/oc-vcategories.js:117 js/oc-vcategories.js:132 js/oc-vcategories.js:162
msgid "The object type is not specified."
msgstr "Ne indikiĝis tipo de la objekto."

#: js/oc-vcategories.js:14 js/oc-vcategories.js:80 js/oc-vcategories.js:95
#: js/oc-vcategories.js:110 js/oc-vcategories.js:125 js/oc-vcategories.js:136
#: js/oc-vcategories.js:172 js/oc-vcategories.js:189 js/oc-vcategories.js:195
#: js/oc-vcategories.js:199 js/share.js:136 js/share.js:143 js/share.js:577
#: js/share.js:589
msgid "Error"
msgstr "Eraro"

#: js/oc-vcategories.js:179
msgid "The app name is not specified."
msgstr "Ne indikiĝis nomo de la aplikaĵo."

#: js/oc-vcategories.js:194
msgid "The required file {file} is not installed!"
msgstr "La necesa dosiero {file} ne instaliĝis!"

#: js/share.js:30 js/share.js:45 js/share.js:87
msgid "Shared"
msgstr ""

#: js/share.js:90
msgid "Share"
msgstr "Kunhavigi"

#: js/share.js:125 js/share.js:617
msgid "Error while sharing"
msgstr "Eraro dum kunhavigo"

#: js/share.js:136
msgid "Error while unsharing"
msgstr "Eraro dum malkunhavigo"

#: js/share.js:143
msgid "Error while changing permissions"
msgstr "Eraro dum ŝanĝo de permesoj"

#: js/share.js:152
msgid "Shared with you and the group {group} by {owner}"
msgstr "Kunhavigita kun vi kaj la grupo {group} de {owner}"

#: js/share.js:154
msgid "Shared with you by {owner}"
msgstr "Kunhavigita kun vi de {owner}"

#: js/share.js:159
msgid "Share with"
msgstr "Kunhavigi kun"

#: js/share.js:164
msgid "Share with link"
msgstr "Kunhavigi per ligilo"

#: js/share.js:167
msgid "Password protect"
msgstr "Protekti per pasvorto"

#: js/share.js:169 templates/installation.php:54 templates/login.php:35
msgid "Password"
msgstr "Pasvorto"

#: js/share.js:173
msgid "Email link to person"
msgstr "Retpoŝti la ligilon al ulo"

#: js/share.js:174
msgid "Send"
msgstr "Sendi"

#: js/share.js:178
msgid "Set expiration date"
msgstr "Agordi limdaton"

#: js/share.js:179
msgid "Expiration date"
msgstr "Limdato"

#: js/share.js:211
msgid "Share via email:"
msgstr "Kunhavigi per retpoŝto:"

#: js/share.js:213
msgid "No people found"
msgstr "Ne troviĝis gento"

#: js/share.js:251
msgid "Resharing is not allowed"
msgstr "Rekunhavigo ne permesatas"

#: js/share.js:287
msgid "Shared in {item} with {user}"
msgstr "Kunhavigita en {item} kun {user}"

#: js/share.js:308
msgid "Unshare"
msgstr "Malkunhavigi"

#: js/share.js:320
msgid "can edit"
msgstr "povas redakti"

#: js/share.js:322
msgid "access control"
msgstr "alirkontrolo"

#: js/share.js:325
msgid "create"
msgstr "krei"

#: js/share.js:328
msgid "update"
msgstr "ĝisdatigi"

#: js/share.js:331
msgid "delete"
msgstr "forigi"

#: js/share.js:334
msgid "share"
msgstr "kunhavigi"

#: js/share.js:368 js/share.js:564
msgid "Password protected"
msgstr "Protektita per pasvorto"

#: js/share.js:577
msgid "Error unsetting expiration date"
msgstr "Eraro dum malagordado de limdato"

#: js/share.js:589
msgid "Error setting expiration date"
msgstr "Eraro dum agordado de limdato"

#: js/share.js:604
msgid "Sending ..."
msgstr "Sendante..."

#: js/share.js:615
msgid "Email sent"
msgstr "La retpoŝtaĵo sendiĝis"

#: js/update.js:14
msgid ""
"The update was unsuccessful. Please report this issue to the <a "
"href=\"https://github.com/owncloud/core/issues\" target=\"_blank\">ownCloud "
"community</a>."
msgstr ""

#: js/update.js:18
msgid "The update was successful. Redirecting you to ownCloud now."
msgstr ""

#: lostpassword/controller.php:48
msgid "ownCloud password reset"
msgstr "La pasvorto de ownCloud restariĝis."

#: lostpassword/templates/email.php:2
msgid "Use the following link to reset your password: {link}"
msgstr "Uzu la jenan ligilon por restarigi vian pasvorton: {link}"

#: lostpassword/templates/lostpassword.php:3
msgid "You will receive a link to reset your password via Email."
msgstr "Vi ricevos ligilon retpoŝte por rekomencigi vian pasvorton."

#: lostpassword/templates/lostpassword.php:5
msgid "Reset email send."
msgstr ""

#: lostpassword/templates/lostpassword.php:8
msgid "Request failed!"
msgstr "Peto malsukcesis!"

#: lostpassword/templates/lostpassword.php:11 templates/installation.php:48
#: templates/login.php:28
msgid "Username"
msgstr "Uzantonomo"

#: lostpassword/templates/lostpassword.php:14
msgid "Request reset"
msgstr "Peti rekomencigon"

#: lostpassword/templates/resetpassword.php:4
msgid "Your password was reset"
msgstr "Via pasvorto rekomencis"

#: lostpassword/templates/resetpassword.php:5
msgid "To login page"
msgstr "Al la ensaluta paĝo"

#: lostpassword/templates/resetpassword.php:8
msgid "New password"
msgstr "Nova pasvorto"

#: lostpassword/templates/resetpassword.php:11
msgid "Reset password"
msgstr "Rekomenci la pasvorton"

#: strings.php:5
msgid "Personal"
msgstr "Persona"

#: strings.php:6
msgid "Users"
msgstr "Uzantoj"

#: strings.php:7
msgid "Apps"
msgstr "Aplikaĵoj"

#: strings.php:8
msgid "Admin"
msgstr "Administranto"

#: strings.php:9
msgid "Help"
msgstr "Helpo"

#: templates/403.php:12
msgid "Access forbidden"
msgstr "Aliro estas malpermesata"

#: templates/404.php:12
msgid "Cloud not found"
msgstr "La nubo ne estas trovita"

#: templates/edit_categories_dialog.php:4
msgid "Edit categories"
msgstr "Redakti kategoriojn"

#: templates/edit_categories_dialog.php:16
msgid "Add"
msgstr "Aldoni"

#: templates/installation.php:24 templates/installation.php:31
#: templates/installation.php:38
msgid "Security Warning"
msgstr "Sekureca averto"

#: templates/installation.php:25
msgid "Your PHP version is vulnerable to the NULL Byte attack (CVE-2006-7243)"
msgstr ""

#: templates/installation.php:26
msgid "Please update your PHP installation to use ownCloud securely."
msgstr ""

#: templates/installation.php:32
msgid ""
"No secure random number generator is available, please enable the PHP "
"OpenSSL extension."
msgstr "Ne disponeblas sekura generilo de hazardaj numeroj; bonvolu kapabligi la OpenSSL-kromaĵon por PHP."

#: templates/installation.php:33
msgid ""
"Without a secure random number generator an attacker may be able to predict "
"password reset tokens and take over your account."
msgstr ""

#: templates/installation.php:39
msgid ""
"Your data directory and files are probably accessible from the internet "
"because the .htaccess file does not work."
msgstr ""

#: templates/installation.php:40
msgid ""
"For information how to properly configure your server, please see the <a "
"href=\"http://doc.owncloud.org/server/5.0/admin_manual/installation.html\" "
"target=\"_blank\">documentation</a>."
msgstr ""

#: templates/installation.php:44
msgid "Create an <strong>admin account</strong>"
msgstr "Krei <strong>administran konton</strong>"

#: templates/installation.php:62
msgid "Advanced"
msgstr "Progresinta"

#: templates/installation.php:64
msgid "Data folder"
msgstr "Datuma dosierujo"

#: templates/installation.php:73
msgid "Configure the database"
msgstr "Agordi la datumbazon"

#: templates/installation.php:78 templates/installation.php:90
#: templates/installation.php:101 templates/installation.php:112
#: templates/installation.php:124
msgid "will be used"
msgstr "estos uzata"

#: templates/installation.php:136
msgid "Database user"
msgstr "Datumbaza uzanto"

#: templates/installation.php:143
msgid "Database password"
msgstr "Datumbaza pasvorto"

#: templates/installation.php:148
msgid "Database name"
msgstr "Datumbaza nomo"

#: templates/installation.php:158
msgid "Database tablespace"
msgstr "Datumbaza tabelospaco"

#: templates/installation.php:165
msgid "Database host"
msgstr "Datumbaza gastigo"

#: templates/installation.php:171
msgid "Finish setup"
msgstr "Fini la instalon"

#: templates/layout.guest.php:40
msgid "web services under your control"
msgstr "TTT-servoj sub via kontrolo"

#: templates/layout.user.php:58
msgid "Log out"
msgstr "Elsaluti"

#: templates/login.php:10
msgid "Automatic logon rejected!"
msgstr ""

#: templates/login.php:11
msgid ""
"If you did not change your password recently, your account may be "
"compromised!"
msgstr "Se vi ne ŝanĝis vian pasvorton lastatempe, via konto eble kompromitas!"

#: templates/login.php:13
msgid "Please change your password to secure your account again."
msgstr "Bonvolu ŝanĝi vian pasvorton por sekurigi vian konton ree."

#: templates/login.php:19
msgid "Lost your password?"
msgstr "Ĉu vi perdis vian pasvorton?"

#: templates/login.php:41
msgid "remember"
msgstr "memori"

#: templates/login.php:43
msgid "Log in"
msgstr "Ensaluti"

#: templates/login.php:49
msgid "Alternative Logins"
msgstr ""

#: templates/part.pagenavi.php:3
msgid "prev"
msgstr "maljena"

#: templates/part.pagenavi.php:20
msgid "next"
msgstr "jena"

#: templates/update.php:3
#, php-format
msgid "Updating ownCloud to version %s, this may take a while."
msgstr ""