aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files/l10n/nn_NO.js1
-rw-r--r--apps/files/l10n/nn_NO.json1
-rw-r--r--apps/files/l10n/ru.js1
-rw-r--r--apps/files/l10n/ru.json1
-rw-r--r--apps/files/tests/activitytest.php4
-rw-r--r--apps/files_sharing/appinfo/app.php7
-rw-r--r--apps/files_sharing/lib/cache.php4
-rw-r--r--apps/files_sharing/lib/helper.php4
-rw-r--r--apps/files_sharing/lib/maintainer.php2
-rw-r--r--apps/files_sharing/lib/scanner.php5
-rw-r--r--apps/files_sharing/lib/sharedstorage.php4
-rw-r--r--apps/files_sharing/lib/updater.php4
-rw-r--r--core/l10n/ru.js22
-rw-r--r--core/l10n/ru.json22
-rw-r--r--lib/private/Activity/Manager.php (renamed from lib/private/ActivityManager.php)5
-rw-r--r--lib/private/App/InfoParser.php12
-rw-r--r--lib/private/Installer.php (renamed from lib/private/legacy/installer.php)86
-rw-r--r--lib/private/Log.php2
-rw-r--r--lib/private/Repair.php11
-rw-r--r--lib/private/Server.php4
-rw-r--r--lib/private/Session/CryptoSessionData.php12
-rw-r--r--lib/private/Session/Internal.php17
-rw-r--r--lib/private/Session/Memory.php18
-rw-r--r--lib/private/Setup.php2
-rw-r--r--lib/private/Updater.php7
-rw-r--r--lib/private/legacy/app.php27
-rw-r--r--lib/public/Session/Exceptions/SessionNotAvailableException.php32
-rw-r--r--lib/public/isession.php9
-rw-r--r--remote.php2
-rw-r--r--settings/ajax/updateapp.php2
-rw-r--r--tests/data/app/expected-info.json4
-rw-r--r--tests/lib/InstallerTest.php (renamed from tests/lib/installer.php)29
-rw-r--r--tests/lib/activity/managertest.php (renamed from tests/lib/activitymanager.php)32
-rw-r--r--tests/lib/logger.php15
-rw-r--r--tests/lib/server.php2
-rw-r--r--tests/lib/session/memory.php9
36 files changed, 282 insertions, 139 deletions
diff --git a/apps/files/l10n/nn_NO.js b/apps/files/l10n/nn_NO.js
index 1e138d91b85..ee983939e7d 100644
--- a/apps/files/l10n/nn_NO.js
+++ b/apps/files/l10n/nn_NO.js
@@ -17,6 +17,7 @@ OC.L10N.register(
"Upload failed. Could not get file info." : "Feil ved opplasting. Klarte ikkje å henta filinfo.",
"Invalid directory." : "Ugyldig mappe.",
"Files" : "Filer",
+ "All files" : "Alle filer",
"Favorites" : "Favorittar",
"Home" : "Heime",
"Close" : "Lukk",
diff --git a/apps/files/l10n/nn_NO.json b/apps/files/l10n/nn_NO.json
index 5645a61b6bc..ec9b4efef11 100644
--- a/apps/files/l10n/nn_NO.json
+++ b/apps/files/l10n/nn_NO.json
@@ -15,6 +15,7 @@
"Upload failed. Could not get file info." : "Feil ved opplasting. Klarte ikkje å henta filinfo.",
"Invalid directory." : "Ugyldig mappe.",
"Files" : "Filer",
+ "All files" : "Alle filer",
"Favorites" : "Favorittar",
"Home" : "Heime",
"Close" : "Lukk",
diff --git a/apps/files/l10n/ru.js b/apps/files/l10n/ru.js
index 183953629a2..8e20c65f548 100644
--- a/apps/files/l10n/ru.js
+++ b/apps/files/l10n/ru.js
@@ -105,6 +105,7 @@ OC.L10N.register(
"With PHP-FPM it might take 5 minutes for changes to be applied." : "В режиме PHP-FPM применение изменений может занять до 5 минут.",
"Missing permissions to edit from here." : "Отсутствуют права на удаление.",
"Settings" : "Настройки",
+ "Show hidden files" : "Показать скрытые файлы",
"WebDAV" : "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\">access your Files via WebDAV</a>" : "Используйте этот адрес для <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\">для доступа к вашим файлам по WebDAV</a>",
"Cancel upload" : "Отменить загрузку",
diff --git a/apps/files/l10n/ru.json b/apps/files/l10n/ru.json
index f75736df6ba..d4f8617e343 100644
--- a/apps/files/l10n/ru.json
+++ b/apps/files/l10n/ru.json
@@ -103,6 +103,7 @@
"With PHP-FPM it might take 5 minutes for changes to be applied." : "В режиме PHP-FPM применение изменений может занять до 5 минут.",
"Missing permissions to edit from here." : "Отсутствуют права на удаление.",
"Settings" : "Настройки",
+ "Show hidden files" : "Показать скрытые файлы",
"WebDAV" : "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\">access your Files via WebDAV</a>" : "Используйте этот адрес для <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\">для доступа к вашим файлам по WebDAV</a>",
"Cancel upload" : "Отменить загрузку",
diff --git a/apps/files/tests/activitytest.php b/apps/files/tests/activitytest.php
index 5e73ff0b5dd..bc062dd0542 100644
--- a/apps/files/tests/activitytest.php
+++ b/apps/files/tests/activitytest.php
@@ -33,7 +33,7 @@ use Test\TestCase;
*/
class ActivityTest extends TestCase {
- /** @var \OC\ActivityManager */
+ /** @var \OCP\Activity\IManager */
private $activityManager;
/** @var \OCP\IRequest|\PHPUnit_Framework_MockObject_MockObject */
@@ -70,7 +70,7 @@ class ActivityTest extends TestCase {
->disableOriginalConstructor()
->getMock();
- $this->activityManager = new \OC\ActivityManager(
+ $this->activityManager = new \OC\Activity\Manager(
$this->request,
$this->session,
$this->config
diff --git a/apps/files_sharing/appinfo/app.php b/apps/files_sharing/appinfo/app.php
index e0cbfd7f5ba..da573d11ec5 100644
--- a/apps/files_sharing/appinfo/app.php
+++ b/apps/files_sharing/appinfo/app.php
@@ -33,13 +33,6 @@ $l = \OC::$server->getL10N('files_sharing');
\OC::$CLASSPATH['OC_Share_Backend_File'] = 'files_sharing/lib/share/file.php';
\OC::$CLASSPATH['OC_Share_Backend_Folder'] = 'files_sharing/lib/share/folder.php';
\OC::$CLASSPATH['OC\Files\Storage\Shared'] = 'files_sharing/lib/sharedstorage.php';
-\OC::$CLASSPATH['OC\Files\Cache\SharedScanner'] = 'files_sharing/lib/scanner.php';
-\OC::$CLASSPATH['OC\Files\Cache\Shared_Cache'] = 'files_sharing/lib/cache.php';
-\OC::$CLASSPATH['OC\Files\Cache\Shared_Permissions'] = 'files_sharing/lib/permissions.php';
-\OC::$CLASSPATH['OC\Files\Cache\Shared_Updater'] = 'files_sharing/lib/updater.php';
-\OC::$CLASSPATH['OC\Files\Cache\Shared_Watcher'] = 'files_sharing/lib/watcher.php';
-\OC::$CLASSPATH['OCA\Files\Share\Maintainer'] = 'files_sharing/lib/maintainer.php';
-\OC::$CLASSPATH['OCA\Files\Share\Proxy'] = 'files_sharing/lib/proxy.php';
$application = new Application();
$application->registerMountProviders();
diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php
index 4dcdaa892ad..abd75282579 100644
--- a/apps/files_sharing/lib/cache.php
+++ b/apps/files_sharing/lib/cache.php
@@ -23,7 +23,7 @@
*
*/
-namespace OC\Files\Cache;
+namespace OCA\Files_Sharing;
use OC\Files\Cache\Wrapper\CacheJail;
use OCP\Files\Cache\ICacheEntry;
@@ -34,7 +34,7 @@ use OCP\Files\Storage\IStorage;
*
* don't use this class directly if you need to get metadata, use \OC\Files\Filesystem::getFileInfo instead
*/
-class Shared_Cache extends CacheJail {
+class Cache extends CacheJail {
/**
* @var \OC\Files\Storage\Shared
*/
diff --git a/apps/files_sharing/lib/helper.php b/apps/files_sharing/lib/helper.php
index 8dad84eca49..500d82cb2d2 100644
--- a/apps/files_sharing/lib/helper.php
+++ b/apps/files_sharing/lib/helper.php
@@ -36,9 +36,9 @@ use OCP\User;
class Helper {
public static function registerHooks() {
- \OCP\Util::connectHook('OC_Filesystem', 'post_rename', '\OC\Files\Cache\Shared_Updater', 'renameHook');
+ \OCP\Util::connectHook('OC_Filesystem', 'post_rename', '\OCA\Files_Sharing\Updater', 'renameHook');
\OCP\Util::connectHook('OC_Filesystem', 'post_delete', '\OCA\Files_Sharing\Hooks', 'unshareChildren');
- \OCP\Util::connectHook('OC_Appconfig', 'post_set_value', '\OCA\Files\Share\Maintainer', 'configChangeHook');
+ \OCP\Util::connectHook('OC_Appconfig', 'post_set_value', '\OCA\Files_Sharing\Maintainer', 'configChangeHook');
\OCP\Util::connectHook('OC_User', 'post_deleteUser', '\OCA\Files_Sharing\Hooks', 'deleteUser');
}
diff --git a/apps/files_sharing/lib/maintainer.php b/apps/files_sharing/lib/maintainer.php
index a728f6bbb67..1d06a34bd0c 100644
--- a/apps/files_sharing/lib/maintainer.php
+++ b/apps/files_sharing/lib/maintainer.php
@@ -20,7 +20,7 @@
*
*/
-namespace OCA\Files\Share;
+namespace OCA\Files_Sharing;
/**
* Maintains stuff around the sharing functionality
diff --git a/apps/files_sharing/lib/scanner.php b/apps/files_sharing/lib/scanner.php
index 2e951423aa2..215c0a7b6ae 100644
--- a/apps/files_sharing/lib/scanner.php
+++ b/apps/files_sharing/lib/scanner.php
@@ -21,15 +21,14 @@
*
*/
-namespace OC\Files\Cache;
+namespace OCA\Files_Sharing;
use OC\Files\ObjectStore\NoopScanner;
-use OC\Files\Storage\Shared;
/**
* Scanner for SharedStorage
*/
-class SharedScanner extends Scanner {
+class Scanner extends \OC\Files\Cache\Scanner {
private $sourceScanner;
/**
diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php
index 1a040364f11..ce214822aa7 100644
--- a/apps/files_sharing/lib/sharedstorage.php
+++ b/apps/files_sharing/lib/sharedstorage.php
@@ -318,14 +318,14 @@ class Shared extends \OC\Files\Storage\Wrapper\Jail implements ISharedStorage {
if (!$storage) {
$storage = $this;
}
- return new \OC\Files\Cache\Shared_Cache($storage, $this->sourceStorage, $this->sourceRootInfo);
+ return new \OCA\Files_Sharing\Cache($storage, $this->sourceStorage, $this->sourceRootInfo);
}
public function getScanner($path = '', $storage = null) {
if (!$storage) {
$storage = $this;
}
- return new \OC\Files\Cache\SharedScanner($storage);
+ return new \OCA\Files_Sharing\Scanner($storage);
}
public function getPropagator($storage = null) {
diff --git a/apps/files_sharing/lib/updater.php b/apps/files_sharing/lib/updater.php
index dc47009c14b..02c349e94b6 100644
--- a/apps/files_sharing/lib/updater.php
+++ b/apps/files_sharing/lib/updater.php
@@ -25,9 +25,9 @@
*
*/
-namespace OC\Files\Cache;
+namespace OCA\Files_Sharing;
-class Shared_Updater {
+class Updater {
/**
* @param array $params
diff --git a/core/l10n/ru.js b/core/l10n/ru.js
index d52a9b6a4e3..fd81ae62fc3 100644
--- a/core/l10n/ru.js
+++ b/core/l10n/ru.js
@@ -27,6 +27,11 @@ OC.L10N.register(
"Error unfavoriting" : "Ошибка удаления из избранного",
"Couldn't send mail to following users: %s " : "Невозможно отправить письмо следующим пользователям: %s",
"Preparing update" : "Подготовка к обновлению",
+ "[%d / %d]: %s" : "[%d / %d]: %s",
+ "Repair warning: " : "Предупреждение восстановления:",
+ "Repair error: " : "Ошибка восстановления:",
+ "Please use the command line updater because automatic updating is disabled in the config.php." : "Пожалуйста, используйте обновление через командную строку, так как автоматические обновления отключены в config.php.",
+ "[%d / %d]: Checking table %s" : "[%d / %d]: Проверка таблицы %s",
"Turned on maintenance mode" : "Режим отладки включён",
"Turned off maintenance mode" : "Режим отладки отключён",
"Maintenance mode is kept active" : "Режим обслуживания оставлен включенным",
@@ -38,8 +43,6 @@ OC.L10N.register(
"Checking whether the database schema for %s can be updated (this can take a long time depending on the database size)" : "Проверка возможности обновления схемы базы данных для %s (это может занять длительное время в зависимости от размера базы данных)",
"Checked database schema update for apps" : "Проверено обновление схемы БД приложений",
"Updated \"%s\" to %s" : "Обновлено \"%s\" до %s",
- "Repair warning: " : "Предупреждение восстановления:",
- "Repair error: " : "Ошибка восстановления:",
"Set log level to debug" : "Установить журнал в режим отладки",
"Reset log level" : "Сбросить уровень журнала",
"Starting code integrity check" : "Начинается проверка целостности кода",
@@ -95,6 +98,7 @@ OC.L10N.register(
"Dec." : "Дек.",
"<a href=\"{docUrl}\">There were problems with the code integrity check. More information…</a>" : "<a href=\"{docUrl}\"> Были обнаружены проблемы с проверкой целостности кода. Подробнее ...",
"Settings" : "Настройки",
+ "Problem loading page, reloading in 5 seconds" : "Возникла проблема при загрузке страницы, повтор через 5 секунд",
"Saving..." : "Сохранение...",
"Dismiss" : "Прекратить",
"seconds ago" : "несколько секунд назад",
@@ -129,6 +133,7 @@ OC.L10N.register(
"Your web server is not set up properly to resolve \"{url}\". Further information can be found in our <a target=\"_blank\" rel=\"noreferrer\" href=\"{docLink}\">documentation</a>." : "Ваш веб-сервер настроен не корректно для разрешения \"{url}\". Дополнительная информация может быть найдена в нашей <a target=\"_blank\" rel=\"noreferrer\" href=\"{docLink}\">документации</a>.",
"This server has no working Internet connection. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. We suggest to enable Internet connection for this server if you want to have all features." : "Этот сервер не имеет подключения к Интернету. Это означает, что некоторые из функций, таких как внешнее хранилище, уведомления об обновлениях и установка сторонних приложений не будут работать. Доступ к файлам удаленно и отправки уведомлений по почте могут не работать. Рекомендуется разрешить данному серверу доступ в Интернет если хотите, чтобы все функции работали.",
"No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a target=\"_blank\" rel=\"noreferrer\" href=\"{docLink}\">documentation</a>." : "Не настроена система кеширования. Для увеличения производительности сервера, по возможности, настройте memcache. Более подробная информация в нашей <a target=\"_blank\" rel=\"noreferrer\" href=\"{docLink}\">документации</a>.",
+ "/dev/urandom is not readable by PHP which is highly discouraged for security reasons. Further information can be found in our <a target=\"_blank\" rel=\"noreferrer\" href=\"{docLink}\">documentation</a>." : "/dev/urandom не может быть прочитан из PHP, что крайне нежелательно по соображениям безопасности. Дополнительную информацию можно найти в нашей <a target=\"_blank\" href=\"{docLink}\"> документации </a>.",
"Error occurred while checking server setup" : "Произошла ошибка при проверке настроек сервера",
"Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root." : "Ваш каталог данных и ваши файлы возможно доступны из Интернета. Файл .htaccess не работает. Мы настоятельно рекомендуем Вам настроить веб сервер таким образом, чтобы каталог данных не был больше доступен или переместить каталог данных за пределы корня веб сервера.",
"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." : "Заголовок HTTP \"{header}\" не настроен на значение \"{expected}\". Это потенциальная проблема безопасности и мы рекомендуем изменить эти настройки.",
@@ -154,6 +159,7 @@ OC.L10N.register(
"Send" : "Отправить",
"Sending ..." : "Отправляется ...",
"Email sent" : "Письмо отправлено",
+ "Send link via email" : "Отправить ссылку по email",
"Shared with you and the group {group} by {owner}" : "{owner} поделился с вами и группой {group} ",
"Shared with you by {owner}" : "С вами поделился {owner} ",
"group" : "группа",
@@ -169,11 +175,17 @@ OC.L10N.register(
"Could not unshare" : "Не удается отменить доступ",
"Share details could not be loaded for this item." : "Не удалось загрузить информацию об общем доступе для этого элемента.",
"No users or groups found for {search}" : "Не найдено пользователей или групп по запросу {search}",
+ "No users found for {search}" : "Не найдено пользователей по запросу {search}",
+ "An error occurred. Please try again" : "Произошла ошибка. Попробуйте ещё раз",
"{sharee} (group)" : "{sharee} (группа)",
"{sharee} (at {server})" : "{sharee} (на {server})",
"{sharee} (remote)" : "{sharee} (удалённо)",
"Share" : "Поделиться",
"Share with people on other ownClouds using the syntax username@example.com/owncloud" : "Поделиться с людьми на других серверах ownCloud используя формат username@example.com/owncloud",
+ "Share with users…" : "Поделиться с пользователями...",
+ "Share with users, groups or remote users…" : "Поделиться с пользователями, группами или удаленными пользователями...",
+ "Share with users or groups…" : "Поделиться с пользователями или группами...",
+ "Share with users or remote users…" : "Общий доступ с пользователями или удалеными пользователями",
"Error removing share" : "Ошибка удаления общего доступа",
"Warning" : "Предупреждение",
"Error while sending notification" : "Ошибка при отправке уведомления",
@@ -183,6 +195,7 @@ OC.L10N.register(
"({scope})" : "({scope})",
"Delete" : "Удалить",
"Rename" : "Переименовать",
+ "Collaborative tags" : "Совместные теги",
"The object type is not specified." : "Тип объекта не указан",
"Enter new" : "Ввести новое",
"Add" : "Добавить",
@@ -197,6 +210,7 @@ OC.L10N.register(
"new" : "новый",
"_download %n file_::_download %n files_" : ["скачать %n файл","скачать %n файла","скачать %n файлов","скачать %n файлов"],
"The upgrade is in progress, leaving this page might interrupt the process in some environments." : "Идет обновление. Покидая эту страницу, вы можете прервать процесс обновления.",
+ "Updating to {version}" : "Обновляем до {version}",
"An error occurred." : "Произошла ошибка.",
"Please reload the page." : "Пожалуйста, обновите страницу.",
"The update was unsuccessful. For more information <a href=\"{url}\">check our forum post</a> covering this issue." : "Обновление прошло не успешно. За дополнительной информацией по этой проблеме <a href=\"{url}\">обратитесь к нашему форуму</a>.",
@@ -260,6 +274,7 @@ OC.L10N.register(
"Search" : "Найти",
"Server side authentication failed!" : "Ошибка аутентификации на стороне сервера!",
"Please contact your administrator." : "Пожалуйста, обратитесь к администратору.",
+ "An internal error occurred." : "Произошла внутренняя ошибка.",
"Please try again or contact your administrator." : "Пожалуйста попробуйте ещё раз или свяжитесь с вашим администратором",
"Log in" : "Войти",
"Wrong password. Reset it?" : "Неправильный пароль. Сбросить его?",
@@ -286,6 +301,9 @@ OC.L10N.register(
"Please make sure that the database, the config folder and the data folder have been backed up before proceeding." : "Перед продолжением убедитесь, что вы сделали резервную копию базы данных, каталога конфигурации и каталога с данными.",
"Start update" : "Запустить обновление",
"To avoid timeouts with larger installations, you can instead run the following command from your installation directory:" : "Чтобы избежать тайм-аутов в крупных установках, вместо этого можно выполнить следующую команду в каталоге установки:",
+ "Detailed logs" : "Подбробные логи",
+ "Update needed" : "Требуется обновление",
+ "For help, see the <a target=\"_blank\" rel=\"noreferrer\" href=\"%s\">documentation</a>." : "Для помощи, ознакомьтесь с <a target=\"_blank\" rel=\"noreferrer\" href=\"%s\">документацией</a>.",
"This %s instance is currently in maintenance mode, which may take a while." : "Этот сервер %s находится в режиме технического обслуживания, которое может занять некоторое время.",
"This page will refresh itself when the %s instance is available again." : "Эта страница автоматически обновится, когда сервер %s снова станет доступен."
},
diff --git a/core/l10n/ru.json b/core/l10n/ru.json
index 36e5a2ab8a5..062231026d2 100644
--- a/core/l10n/ru.json
+++ b/core/l10n/ru.json
@@ -25,6 +25,11 @@
"Error unfavoriting" : "Ошибка удаления из избранного",
"Couldn't send mail to following users: %s " : "Невозможно отправить письмо следующим пользователям: %s",
"Preparing update" : "Подготовка к обновлению",
+ "[%d / %d]: %s" : "[%d / %d]: %s",
+ "Repair warning: " : "Предупреждение восстановления:",
+ "Repair error: " : "Ошибка восстановления:",
+ "Please use the command line updater because automatic updating is disabled in the config.php." : "Пожалуйста, используйте обновление через командную строку, так как автоматические обновления отключены в config.php.",
+ "[%d / %d]: Checking table %s" : "[%d / %d]: Проверка таблицы %s",
"Turned on maintenance mode" : "Режим отладки включён",
"Turned off maintenance mode" : "Режим отладки отключён",
"Maintenance mode is kept active" : "Режим обслуживания оставлен включенным",
@@ -36,8 +41,6 @@
"Checking whether the database schema for %s can be updated (this can take a long time depending on the database size)" : "Проверка возможности обновления схемы базы данных для %s (это может занять длительное время в зависимости от размера базы данных)",
"Checked database schema update for apps" : "Проверено обновление схемы БД приложений",
"Updated \"%s\" to %s" : "Обновлено \"%s\" до %s",
- "Repair warning: " : "Предупреждение восстановления:",
- "Repair error: " : "Ошибка восстановления:",
"Set log level to debug" : "Установить журнал в режим отладки",
"Reset log level" : "Сбросить уровень журнала",
"Starting code integrity check" : "Начинается проверка целостности кода",
@@ -93,6 +96,7 @@
"Dec." : "Дек.",
"<a href=\"{docUrl}\">There were problems with the code integrity check. More information…</a>" : "<a href=\"{docUrl}\"> Были обнаружены проблемы с проверкой целостности кода. Подробнее ...",
"Settings" : "Настройки",
+ "Problem loading page, reloading in 5 seconds" : "Возникла проблема при загрузке страницы, повтор через 5 секунд",
"Saving..." : "Сохранение...",
"Dismiss" : "Прекратить",
"seconds ago" : "несколько секунд назад",
@@ -127,6 +131,7 @@
"Your web server is not set up properly to resolve \"{url}\". Further information can be found in our <a target=\"_blank\" rel=\"noreferrer\" href=\"{docLink}\">documentation</a>." : "Ваш веб-сервер настроен не корректно для разрешения \"{url}\". Дополнительная информация может быть найдена в нашей <a target=\"_blank\" rel=\"noreferrer\" href=\"{docLink}\">документации</a>.",
"This server has no working Internet connection. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. We suggest to enable Internet connection for this server if you want to have all features." : "Этот сервер не имеет подключения к Интернету. Это означает, что некоторые из функций, таких как внешнее хранилище, уведомления об обновлениях и установка сторонних приложений не будут работать. Доступ к файлам удаленно и отправки уведомлений по почте могут не работать. Рекомендуется разрешить данному серверу доступ в Интернет если хотите, чтобы все функции работали.",
"No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a target=\"_blank\" rel=\"noreferrer\" href=\"{docLink}\">documentation</a>." : "Не настроена система кеширования. Для увеличения производительности сервера, по возможности, настройте memcache. Более подробная информация в нашей <a target=\"_blank\" rel=\"noreferrer\" href=\"{docLink}\">документации</a>.",
+ "/dev/urandom is not readable by PHP which is highly discouraged for security reasons. Further information can be found in our <a target=\"_blank\" rel=\"noreferrer\" href=\"{docLink}\">documentation</a>." : "/dev/urandom не может быть прочитан из PHP, что крайне нежелательно по соображениям безопасности. Дополнительную информацию можно найти в нашей <a target=\"_blank\" href=\"{docLink}\"> документации </a>.",
"Error occurred while checking server setup" : "Произошла ошибка при проверке настроек сервера",
"Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root." : "Ваш каталог данных и ваши файлы возможно доступны из Интернета. Файл .htaccess не работает. Мы настоятельно рекомендуем Вам настроить веб сервер таким образом, чтобы каталог данных не был больше доступен или переместить каталог данных за пределы корня веб сервера.",
"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." : "Заголовок HTTP \"{header}\" не настроен на значение \"{expected}\". Это потенциальная проблема безопасности и мы рекомендуем изменить эти настройки.",
@@ -152,6 +157,7 @@
"Send" : "Отправить",
"Sending ..." : "Отправляется ...",
"Email sent" : "Письмо отправлено",
+ "Send link via email" : "Отправить ссылку по email",
"Shared with you and the group {group} by {owner}" : "{owner} поделился с вами и группой {group} ",
"Shared with you by {owner}" : "С вами поделился {owner} ",
"group" : "группа",
@@ -167,11 +173,17 @@
"Could not unshare" : "Не удается отменить доступ",
"Share details could not be loaded for this item." : "Не удалось загрузить информацию об общем доступе для этого элемента.",
"No users or groups found for {search}" : "Не найдено пользователей или групп по запросу {search}",
+ "No users found for {search}" : "Не найдено пользователей по запросу {search}",
+ "An error occurred. Please try again" : "Произошла ошибка. Попробуйте ещё раз",
"{sharee} (group)" : "{sharee} (группа)",
"{sharee} (at {server})" : "{sharee} (на {server})",
"{sharee} (remote)" : "{sharee} (удалённо)",
"Share" : "Поделиться",
"Share with people on other ownClouds using the syntax username@example.com/owncloud" : "Поделиться с людьми на других серверах ownCloud используя формат username@example.com/owncloud",
+ "Share with users…" : "Поделиться с пользователями...",
+ "Share with users, groups or remote users…" : "Поделиться с пользователями, группами или удаленными пользователями...",
+ "Share with users or groups…" : "Поделиться с пользователями или группами...",
+ "Share with users or remote users…" : "Общий доступ с пользователями или удалеными пользователями",
"Error removing share" : "Ошибка удаления общего доступа",
"Warning" : "Предупреждение",
"Error while sending notification" : "Ошибка при отправке уведомления",
@@ -181,6 +193,7 @@
"({scope})" : "({scope})",
"Delete" : "Удалить",
"Rename" : "Переименовать",
+ "Collaborative tags" : "Совместные теги",
"The object type is not specified." : "Тип объекта не указан",
"Enter new" : "Ввести новое",
"Add" : "Добавить",
@@ -195,6 +208,7 @@
"new" : "новый",
"_download %n file_::_download %n files_" : ["скачать %n файл","скачать %n файла","скачать %n файлов","скачать %n файлов"],
"The upgrade is in progress, leaving this page might interrupt the process in some environments." : "Идет обновление. Покидая эту страницу, вы можете прервать процесс обновления.",
+ "Updating to {version}" : "Обновляем до {version}",
"An error occurred." : "Произошла ошибка.",
"Please reload the page." : "Пожалуйста, обновите страницу.",
"The update was unsuccessful. For more information <a href=\"{url}\">check our forum post</a> covering this issue." : "Обновление прошло не успешно. За дополнительной информацией по этой проблеме <a href=\"{url}\">обратитесь к нашему форуму</a>.",
@@ -258,6 +272,7 @@
"Search" : "Найти",
"Server side authentication failed!" : "Ошибка аутентификации на стороне сервера!",
"Please contact your administrator." : "Пожалуйста, обратитесь к администратору.",
+ "An internal error occurred." : "Произошла внутренняя ошибка.",
"Please try again or contact your administrator." : "Пожалуйста попробуйте ещё раз или свяжитесь с вашим администратором",
"Log in" : "Войти",
"Wrong password. Reset it?" : "Неправильный пароль. Сбросить его?",
@@ -284,6 +299,9 @@
"Please make sure that the database, the config folder and the data folder have been backed up before proceeding." : "Перед продолжением убедитесь, что вы сделали резервную копию базы данных, каталога конфигурации и каталога с данными.",
"Start update" : "Запустить обновление",
"To avoid timeouts with larger installations, you can instead run the following command from your installation directory:" : "Чтобы избежать тайм-аутов в крупных установках, вместо этого можно выполнить следующую команду в каталоге установки:",
+ "Detailed logs" : "Подбробные логи",
+ "Update needed" : "Требуется обновление",
+ "For help, see the <a target=\"_blank\" rel=\"noreferrer\" href=\"%s\">documentation</a>." : "Для помощи, ознакомьтесь с <a target=\"_blank\" rel=\"noreferrer\" href=\"%s\">документацией</a>.",
"This %s instance is currently in maintenance mode, which may take a while." : "Этот сервер %s находится в режиме технического обслуживания, которое может занять некоторое время.",
"This page will refresh itself when the %s instance is available again." : "Эта страница автоматически обновится, когда сервер %s снова станет доступен."
},"pluralForm" :"nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);"
diff --git a/lib/private/ActivityManager.php b/lib/private/Activity/Manager.php
index e522dca9e3b..e68802b2abb 100644
--- a/lib/private/ActivityManager.php
+++ b/lib/private/Activity/Manager.php
@@ -20,10 +20,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-namespace OC;
+namespace OC\Activity;
-use OC\Activity\Event;
use OCP\Activity\IConsumer;
use OCP\Activity\IEvent;
use OCP\Activity\IExtension;
@@ -33,7 +32,7 @@ use OCP\IRequest;
use OCP\IUser;
use OCP\IUserSession;
-class ActivityManager implements IManager {
+class Manager implements IManager {
/** @var IRequest */
protected $request;
diff --git a/lib/private/App/InfoParser.php b/lib/private/App/InfoParser.php
index b7540c04248..21422d40603 100644
--- a/lib/private/App/InfoParser.php
+++ b/lib/private/App/InfoParser.php
@@ -74,6 +74,9 @@ class InfoParser {
if (!array_key_exists('repair-steps', $array)) {
$array['repair-steps'] = [];
}
+ if (!array_key_exists('install', $array['repair-steps'])) {
+ $array['repair-steps']['install'] = [];
+ }
if (!array_key_exists('pre-migration', $array['repair-steps'])) {
$array['repair-steps']['pre-migration'] = [];
}
@@ -83,6 +86,9 @@ class InfoParser {
if (!array_key_exists('live-migration', $array['repair-steps'])) {
$array['repair-steps']['live-migration'] = [];
}
+ if (!array_key_exists('uninstall', $array['repair-steps'])) {
+ $array['repair-steps']['uninstall'] = [];
+ }
if (array_key_exists('documentation', $array) && is_array($array['documentation'])) {
foreach ($array['documentation'] as $key => $url) {
@@ -107,6 +113,9 @@ class InfoParser {
$array['types'] = [];
}
}
+ if (isset($array['repair-steps']['install']['step']) && is_array($array['repair-steps']['install']['step'])) {
+ $array['repair-steps']['install'] = $array['repair-steps']['install']['step'];
+ }
if (isset($array['repair-steps']['pre-migration']['step']) && is_array($array['repair-steps']['pre-migration']['step'])) {
$array['repair-steps']['pre-migration'] = $array['repair-steps']['pre-migration']['step'];
}
@@ -116,6 +125,9 @@ class InfoParser {
if (isset($array['repair-steps']['live-migration']['step']) && is_array($array['repair-steps']['live-migration']['step'])) {
$array['repair-steps']['live-migration'] = $array['repair-steps']['live-migration']['step'];
}
+ if (isset($array['repair-steps']['uninstall']['step']) && is_array($array['repair-steps']['uninstall']['step'])) {
+ $array['repair-steps']['uninstall'] = $array['repair-steps']['uninstall']['step'];
+ }
return $array;
}
diff --git a/lib/private/legacy/installer.php b/lib/private/Installer.php
index 24c79b2dd8c..643590ae22e 100644
--- a/lib/private/legacy/installer.php
+++ b/lib/private/Installer.php
@@ -37,15 +37,19 @@
*
*/
+namespace OC;
+
use OC\App\CodeChecker\CodeChecker;
use OC\App\CodeChecker\EmptyCheck;
use OC\App\CodeChecker\PrivateCheck;
-use OC\OCSClient;
+use OC_App;
+use OC_DB;
+use OC_Helper;
/**
* This class provides the functionality needed to install, update and remove plugins/apps
*/
-class OC_Installer{
+class Installer {
/**
*
@@ -134,16 +138,19 @@ class OC_Installer{
self::includeAppScript($basedir . '/appinfo/install.php');
}
+ $appData = OC_App::getAppInfo($appId);
+ OC_App::executeRepairSteps($appId, $appData['repair-steps']['install']);
+
//set the installed version
- \OC::$server->getAppConfig()->setValue($info['id'], 'installed_version', OC_App::getAppVersion($info['id']));
- \OC::$server->getAppConfig()->setValue($info['id'], 'enabled', 'no');
+ \OC::$server->getConfig()->setAppValue($info['id'], 'installed_version', OC_App::getAppVersion($info['id']));
+ \OC::$server->getConfig()->setAppValue($info['id'], 'enabled', 'no');
- //set remote/public handelers
+ //set remote/public handlers
foreach($info['remote'] as $name=>$path) {
- OCP\CONFIG::setAppValue('core', 'remote_'.$name, $info['id'].'/'.$path);
+ \OC::$server->getConfig()->setAppValue('core', 'remote_'.$name, $info['id'].'/'.$path);
}
foreach($info['public'] as $name=>$path) {
- OCP\CONFIG::setAppValue('core', 'public_'.$name, $info['id'].'/'.$path);
+ \OC::$server->getConfig()->setAppValue('core', 'public_'.$name, $info['id'].'/'.$path);
}
OC_App::setAppTypes($info['id']);
@@ -158,15 +165,15 @@ class OC_Installer{
*
* Checks whether or not an app is installed, i.e. registered in apps table.
*/
- public static function isInstalled( $app ) {
- return (\OC::$server->getAppConfig()->getValue($app, "installed_version") !== null);
+ public static function isInstalled( $app ) {
+ return (\OC::$server->getConfig()->getAppValue($app, "installed_version", null) !== null);
}
/**
* @brief Update an application
* @param array $info
* @param bool $isShipped
- * @throws Exception
+ * @throws \Exception
* @return bool
*
* This function could work like described below, but currently it disables and then
@@ -229,7 +236,7 @@ class OC_Installer{
*
* @param integer $ocsId
* @return bool
- * @throws Exception
+ * @throws \Exception
*/
public static function updateAppByOCSId($ocsId) {
$ocsClient = new OCSClient(
@@ -257,7 +264,7 @@ class OC_Installer{
/**
* @param array $data
* @return array
- * @throws Exception
+ * @throws \Exception
*/
public static function downloadApp($data = array()) {
$l = \OC::$server->getL10N('lib');
@@ -293,7 +300,7 @@ class OC_Installer{
$extractDir = \OC::$server->getTempManager()->getTemporaryFolder();
OC_Helper::rmdirr($extractDir);
mkdir($extractDir);
- if($archive=OC_Archive::open($path)) {
+ if($archive=\OC_Archive::open($path)) {
$archive->extract($extractDir);
} else {
OC_Helper::rmdirr($extractDir);
@@ -375,7 +382,7 @@ class OC_Installer{
}
// check the code for not allowed calls
- if(!$isShipped && !OC_Installer::checkCode($extractDir)) {
+ if(!$isShipped && !Installer::checkCode($extractDir)) {
OC_Helper::rmdirr($extractDir);
throw new \Exception($l->t("App can't be installed because of not allowed code in the App"));
}
@@ -457,7 +464,7 @@ class OC_Installer{
* The function will check if the app is already downloaded in the apps repository
*/
public static function isDownloaded( $name ) {
- foreach(OC::$APPSROOTS as $dir) {
+ foreach(\OC::$APPSROOTS as $dir) {
$dirToTest = $dir['path'];
$dirToTest .= '/';
$dirToTest .= $name;
@@ -474,52 +481,25 @@ class OC_Installer{
/**
* Removes an app
* @param string $name name of the application to remove
- * @param array $options options
* @return boolean
*
- * This function removes an app. $options is an associative array. The
- * following keys are optional:ja
- * - keeppreferences: boolean, if true the user preferences won't be deleted
- * - keepappconfig: boolean, if true the config will be kept
- * - keeptables: boolean, if true the database will be kept
- * - keepfiles: boolean, if true the user files will be kept
*
* This function works as follows
- * -# including appinfo/remove.php
+ * -# call uninstall repair steps
* -# removing the files
*
* The function will not delete preferences, tables and the configuration,
* this has to be done by the function oc_app_uninstall().
*/
- public static function removeApp( $name, $options = array()) {
+ public static function removeApp($appId) {
- if(isset($options['keeppreferences']) and $options['keeppreferences']==false ) {
- // todo
- // remove preferences
- }
-
- if(isset($options['keepappconfig']) and $options['keepappconfig']==false ) {
- // todo
- // remove app config
- }
-
- if(isset($options['keeptables']) and $options['keeptables']==false ) {
- // todo
- // remove app database tables
- }
-
- if(isset($options['keepfiles']) and $options['keepfiles']==false ) {
- // todo
- // remove user files
- }
-
- if(OC_Installer::isDownloaded( $name )) {
- $appdir=OC_App::getInstallPath().'/'.$name;
- OC_Helper::rmdirr($appdir);
+ if(Installer::isDownloaded( $appId )) {
+ $appDir=OC_App::getInstallPath() . '/' . $appId;
+ OC_Helper::rmdirr($appDir);
return true;
}else{
- \OCP\Util::writeLog('core', 'can\'t remove app '.$name.'. It is not installed.', \OCP\Util::ERROR);
+ \OCP\Util::writeLog('core', 'can\'t remove app '.$appId.'. It is not installed.', \OCP\Util::ERROR);
return false;
}
@@ -536,25 +516,25 @@ class OC_Installer{
*/
public static function installShippedApps($softErrors = false) {
$errors = [];
- foreach(OC::$APPSROOTS as $app_dir) {
+ foreach(\OC::$APPSROOTS as $app_dir) {
if($dir = opendir( $app_dir['path'] )) {
while( false !== ( $filename = readdir( $dir ))) {
if( substr( $filename, 0, 1 ) != '.' and is_dir($app_dir['path']."/$filename") ) {
if( file_exists( $app_dir['path']."/$filename/appinfo/info.xml" )) {
- if(!OC_Installer::isInstalled($filename)) {
+ if(!Installer::isInstalled($filename)) {
$info=OC_App::getAppInfo($filename);
$enabled = isset($info['default_enable']);
if (($enabled || in_array($filename, \OC::$server->getAppManager()->getAlwaysEnabledApps()))
&& \OC::$server->getConfig()->getAppValue($filename, 'enabled') !== 'no') {
if ($softErrors) {
try {
- OC_Installer::installShippedApp($filename);
+ Installer::installShippedApp($filename);
} catch (\Doctrine\DBAL\Exception\TableExistsException $e) {
$errors[$filename] = $e;
continue;
}
} else {
- OC_Installer::installShippedApp($filename);
+ Installer::installShippedApp($filename);
}
\OC::$server->getConfig()->setAppValue($filename, 'enabled', 'yes');
}
@@ -590,6 +570,8 @@ class OC_Installer{
return false;
}
+ OC_App::executeRepairSteps($app, $info['repair-steps']['install']);
+
$config = \OC::$server->getConfig();
$config->setAppValue($app, 'installed_version', OC_App::getAppVersion($app));
diff --git a/lib/private/Log.php b/lib/private/Log.php
index bbdad9cf166..d82346bbcf0 100644
--- a/lib/private/Log.php
+++ b/lib/private/Log.php
@@ -284,7 +284,7 @@ class Log implements ILogger {
'File' => $exception->getFile(),
'Line' => $exception->getLine(),
);
- $exception['Trace'] = preg_replace('!(login|checkPassword|updatePrivateKeyPassword)\(.*\)!', '$1(*** username and password replaced ***)', $exception['Trace']);
+ $exception['Trace'] = preg_replace('!(login|checkPassword|updatePrivateKeyPassword|validateUserPass)\(.*\)!', '$1(*** username and password replaced ***)', $exception['Trace']);
$msg = isset($context['message']) ? $context['message'] : 'Exception';
$msg .= ': ' . json_encode($exception);
$this->error($msg, $context);
diff --git a/lib/private/Repair.php b/lib/private/Repair.php
index 590b0bee721..5d10cd582f0 100644
--- a/lib/private/Repair.php
+++ b/lib/private/Repair.php
@@ -73,7 +73,6 @@ class Repair implements IOutput{
* Run a series of repair steps for common problems
*/
public function run() {
- $self = $this;
if (count($this->repairSteps) === 0) {
$this->emit('\OC\Repair', 'info', array('No repair steps available'));
return;
@@ -82,16 +81,6 @@ class Repair implements IOutput{
foreach ($this->repairSteps as $step) {
$this->currentStep = $step->getName();
$this->emit('\OC\Repair', 'step', [$this->currentStep]);
-
- if ($step instanceof Emitter) {
- $step->listen('\OC\Repair', 'warning', function ($description) use ($self) {
- $self->emit('\OC\Repair', 'warning', array($description));
- });
- $step->listen('\OC\Repair', 'info', function ($description) use ($self) {
- $self->emit('\OC\Repair', 'info', array($description));
- });
- }
-
$step->run($this);
}
}
diff --git a/lib/private/Server.php b/lib/private/Server.php
index 11cce494418..a98ddc36b58 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -313,7 +313,7 @@ class Server extends ServerContainer implements IServerContainer {
);
});
$this->registerService('ActivityManager', function (Server $c) {
- return new ActivityManager(
+ return new \OC\Activity\Manager(
$c->getRequest(),
$c->getUserSession(),
$c->getConfig()
@@ -623,7 +623,7 @@ class Server extends ServerContainer implements IServerContainer {
$this->registerService('ShareManager', function(Server $c) {
$config = $c->getConfig();
$factoryClass = $config->getSystemValue('sharing.managerFactory', '\OC\Share20\ProviderFactory');
- /** @var \OC\Share20\IProviderFactory $factory */
+ /** @var \OCP\Share\IProviderFactory $factory */
$factory = new $factoryClass($this);
$manager = new \OC\Share20\Manager(
diff --git a/lib/private/Session/CryptoSessionData.php b/lib/private/Session/CryptoSessionData.php
index f6c585c1611..629e6af5412 100644
--- a/lib/private/Session/CryptoSessionData.php
+++ b/lib/private/Session/CryptoSessionData.php
@@ -24,6 +24,7 @@ namespace OC\Session;
use OCP\ISession;
use OCP\Security\ICrypto;
+use OCP\Session\Exceptions\SessionNotAvailableException;
/**
* Class CryptoSessionData
@@ -142,6 +143,17 @@ class CryptoSessionData implements \ArrayAccess, ISession {
}
/**
+ * Wrapper around session_id
+ *
+ * @return string
+ * @throws SessionNotAvailableException
+ * @since 9.1.0
+ */
+ public function getId() {
+ return $this->session->getId();
+ }
+
+ /**
* Close the session and release the lock, also writes all changed data in batch
*/
public function close() {
diff --git a/lib/private/Session/Internal.php b/lib/private/Session/Internal.php
index 09175bf1f2f..a24aec55222 100644
--- a/lib/private/Session/Internal.php
+++ b/lib/private/Session/Internal.php
@@ -26,6 +26,8 @@
namespace OC\Session;
+use OCP\Session\Exceptions\SessionNotAvailableException;
+
/**
* Class Internal
*
@@ -112,6 +114,21 @@ class Internal extends Session {
}
/**
+ * Wrapper around session_id
+ *
+ * @return string
+ * @throws SessionNotAvailableException
+ * @since 9.1.0
+ */
+ public function getId() {
+ $id = @session_id();
+ if ($id === '') {
+ throw new SessionNotAvailableException();
+ }
+ return $id;
+ }
+
+ /**
* @throws \Exception
*/
public function reopen() {
diff --git a/lib/private/Session/Memory.php b/lib/private/Session/Memory.php
index 777458a9aa5..bcb1f1d950c 100644
--- a/lib/private/Session/Memory.php
+++ b/lib/private/Session/Memory.php
@@ -26,6 +26,9 @@
namespace OC\Session;
+use Exception;
+use OCP\Session\Exceptions\SessionNotAvailableException;
+
/**
* Class Internal
*
@@ -89,6 +92,17 @@ class Memory extends Session {
public function regenerateId($deleteOldSession = true) {}
/**
+ * Wrapper around session_id
+ *
+ * @return string
+ * @throws SessionNotAvailableException
+ * @since 9.1.0
+ */
+ public function getId() {
+ throw new SessionNotAvailableException('Memory session does not have an ID');
+ }
+
+ /**
* Helper function for PHPUnit execution - don't use in non-test code
*/
public function reopen() {
@@ -98,11 +112,11 @@ class Memory extends Session {
/**
* In case the session has already been locked an exception will be thrown
*
- * @throws \Exception
+ * @throws Exception
*/
private function validateSession() {
if ($this->sessionClosed) {
- throw new \Exception('Session has been closed - no further changes to the session are allowed');
+ throw new Exception('Session has been closed - no further changes to the session are allowed');
}
}
}
diff --git a/lib/private/Setup.php b/lib/private/Setup.php
index 196ae8a8bce..23c66f98b7c 100644
--- a/lib/private/Setup.php
+++ b/lib/private/Setup.php
@@ -367,7 +367,7 @@ class Setup {
\OC_User::login($username, $password);
//guess what this does
- \OC_Installer::installShippedApps();
+ Installer::installShippedApps();
// create empty file in data dir, so we can later find
// out that this is indeed an ownCloud data directory
diff --git a/lib/private/Updater.php b/lib/private/Updater.php
index 093ebebbbe4..7ca3cd09362 100644
--- a/lib/private/Updater.php
+++ b/lib/private/Updater.php
@@ -36,7 +36,6 @@ namespace OC;
use OC\Hooks\BasicEmitter;
use OC\IntegrityCheck\Checker;
use OC_App;
-use OC_Installer;
use OCP\IConfig;
use OC\Setup;
use OCP\ILogger;
@@ -251,7 +250,7 @@ class Updater extends BasicEmitter {
// install new shipped apps on upgrade
OC_App::loadApps('authentication');
- $errors = OC_Installer::installShippedApps(true);
+ $errors = Installer::installShippedApps(true);
foreach ($errors as $appId => $exception) {
/** @var \Exception $exception */
$this->log->logException($exception, ['app' => $appId]);
@@ -443,11 +442,11 @@ class Updater extends BasicEmitter {
private function upgradeAppStoreApps(array $disabledApps) {
foreach($disabledApps as $app) {
try {
- if (OC_Installer::isUpdateAvailable($app)) {
+ if (Installer::isUpdateAvailable($app)) {
$ocsId = \OC::$server->getConfig()->getAppValue($app, 'ocsid', '');
$this->emit('\OC\Updater', 'upgradeAppStoreApp', array($app));
- OC_Installer::updateAppByOCSId($ocsId);
+ Installer::updateAppByOCSId($ocsId);
}
} catch (\Exception $ex) {
$this->log->logException($ex, ['app' => 'core']);
diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php
index 09e6f889697..fe590e4159e 100644
--- a/lib/private/legacy/app.php
+++ b/lib/private/legacy/app.php
@@ -46,6 +46,7 @@
*/
use OC\App\DependencyAnalyzer;
use OC\App\Platform;
+use OC\Installer;
use OC\OCSClient;
use OC\Repair;
@@ -323,7 +324,7 @@ class OC_App {
*/
public static function enable($app, $groups = null) {
self::$enabledAppsCache = array(); // flush
- if (!OC_Installer::isInstalled($app)) {
+ if (!Installer::isInstalled($app)) {
$app = self::installApp($app);
}
@@ -359,7 +360,7 @@ class OC_App {
// Replace spaces in download link without encoding entire URL
$download['downloadlink'] = str_replace(' ', '%20', $download['downloadlink']);
$info = array('source' => 'http', 'href' => $download['downloadlink'], 'appdata' => $appData);
- $app = OC_Installer::installApp($info);
+ $app = Installer::installApp($info);
}
return $app;
}
@@ -373,7 +374,7 @@ class OC_App {
return false;
}
- return OC_Installer::removeApp($app);
+ return Installer::removeApp($app);
}
/**
@@ -388,9 +389,19 @@ class OC_App {
$app = self::getInternalAppIdByOcs($app);
}
- self::$enabledAppsCache = array(); // flush
- // check if app is a shipped app or not. if not delete
+ // flush
+ self::$enabledAppsCache = array();
+
+ // run uninstall steps
+ $appData = OC_App::getAppInfo($app);
+ if (!is_null($appData)) {
+ OC_App::executeRepairSteps($app, $appData['repair-steps']['uninstall']);
+ }
+
+ // emit disable hook - needed anymore ?
\OC_Hook::emit('OC_App', 'pre_disable', array('app' => $app));
+
+ // finally disable it
$appManager = \OC::$server->getAppManager();
$appManager->disableApp($app);
}
@@ -846,7 +857,7 @@ class OC_App {
$info['removable'] = true;
}
- $info['update'] = ($includeUpdateInfo) ? OC_Installer::isUpdateAvailable($app) : null;
+ $info['update'] = ($includeUpdateInfo) ? Installer::isUpdateAvailable($app) : null;
$appPath = self::getAppPath($app);
if($appPath !== false) {
@@ -1092,7 +1103,7 @@ class OC_App {
if ($appData && version_compare($shippedVersion, $appData['version'], '<')) {
$app = self::downloadApp($app);
} else {
- $app = OC_Installer::installShippedApp($app);
+ $app = Installer::installShippedApp($app);
}
} else {
// Maybe the app is already installed - compare the version in this
@@ -1206,7 +1217,7 @@ class OC_App {
* @param string[] $steps
* @throws \OC\NeedsUpdateException
*/
- private static function executeRepairSteps($appId, array $steps) {
+ public static function executeRepairSteps($appId, array $steps) {
if (empty($steps)) {
return;
}
diff --git a/lib/public/Session/Exceptions/SessionNotAvailableException.php b/lib/public/Session/Exceptions/SessionNotAvailableException.php
new file mode 100644
index 00000000000..d347e0df15e
--- /dev/null
+++ b/lib/public/Session/Exceptions/SessionNotAvailableException.php
@@ -0,0 +1,32 @@
+<?php
+
+/**
+ * @author Christoph Wurst <christoph@owncloud.com>
+ *
+ * @copyright Copyright (c) 2016, ownCloud, Inc.
+ * @license AGPL-3.0
+ *
+ * This code is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License, version 3,
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+namespace OCP\Session\Exceptions;
+
+use Exception;
+
+/**
+ * @since 9.1.0
+ */
+class SessionNotAvailableException extends Exception {
+
+}
diff --git a/lib/public/isession.php b/lib/public/isession.php
index 25c76906d63..7bc8654a1b9 100644
--- a/lib/public/isession.php
+++ b/lib/public/isession.php
@@ -95,4 +95,13 @@ interface ISession {
* @since 9.0.0
*/
public function regenerateId($deleteOldSession = true);
+
+ /**
+ * Wrapper around session_id
+ *
+ * @return string
+ * @throws SessionNotAvailableException
+ * @since 9.1.0
+ */
+ public function getId();
}
diff --git a/remote.php b/remote.php
index 991ca0d2302..f28c3a35691 100644
--- a/remote.php
+++ b/remote.php
@@ -166,5 +166,5 @@ try {
} catch (Exception $ex) {
handleException($ex);
} catch (Error $e) {
- handleException($ex);
+ handleException($e);
}
diff --git a/settings/ajax/updateapp.php b/settings/ajax/updateapp.php
index 8521914884f..7ac32468fe4 100644
--- a/settings/ajax/updateapp.php
+++ b/settings/ajax/updateapp.php
@@ -50,7 +50,7 @@ $appId = OC_App::cleanAppId($appId);
$config = \OC::$server->getConfig();
$config->setSystemValue('maintenance', true);
try {
- $result = OC_Installer::updateAppByOCSId($appId);
+ $result = \OC\Installer::updateAppByOCSId($appId);
$config->setSystemValue('maintenance', false);
} catch(Exception $ex) {
$config->setSystemValue('maintenance', false);
diff --git a/tests/data/app/expected-info.json b/tests/data/app/expected-info.json
index 51d0c00ccef..cef7a7fdaba 100644
--- a/tests/data/app/expected-info.json
+++ b/tests/data/app/expected-info.json
@@ -69,8 +69,10 @@
}
},
"repair-steps": {
+ "install": [],
"pre-migration": [],
"post-migration": [],
- "live-migration": []
+ "live-migration": [],
+ "uninstall": []
}
}
diff --git a/tests/lib/installer.php b/tests/lib/InstallerTest.php
index ca210ba31ef..e1c17b841a2 100644
--- a/tests/lib/installer.php
+++ b/tests/lib/InstallerTest.php
@@ -6,7 +6,12 @@
* See the COPYING-README file.
*/
-class Test_Installer extends \Test\TestCase {
+namespace Test;
+
+
+use OC\Installer;
+
+class InstallerTest extends TestCase {
private static $appid = 'testapp';
private $appstore;
@@ -17,11 +22,11 @@ class Test_Installer extends \Test\TestCase {
$config = \OC::$server->getConfig();
$this->appstore = $config->setSystemValue('appstoreenabled', true);
$config->setSystemValue('appstoreenabled', true);
- OC_Installer::removeApp(self::$appid);
+ Installer::removeApp(self::$appid);
}
protected function tearDown() {
- OC_Installer::removeApp(self::$appid);
+ Installer::removeApp(self::$appid);
\OC::$server->getConfig()->setSystemValue('appstoreenabled', $this->appstore);
parent::tearDown();
@@ -33,7 +38,7 @@ class Test_Installer extends \Test\TestCase {
$pathOfTestApp .= 'testapp.zip';
$tmp = \OC::$server->getTempManager()->getTemporaryFile('.zip');
- OC_Helper::copyr($pathOfTestApp, $tmp);
+ \OC_Helper::copyr($pathOfTestApp, $tmp);
$data = array(
'path' => $tmp,
@@ -44,8 +49,8 @@ class Test_Installer extends \Test\TestCase {
]
);
- OC_Installer::installApp($data);
- $isInstalled = OC_Installer::isInstalled(self::$appid);
+ Installer::installApp($data);
+ $isInstalled = Installer::isInstalled(self::$appid);
$this->assertTrue($isInstalled);
}
@@ -56,7 +61,7 @@ class Test_Installer extends \Test\TestCase {
$pathOfOldTestApp .= 'testapp.zip';
$oldTmp = \OC::$server->getTempManager()->getTemporaryFile('.zip');
- OC_Helper::copyr($pathOfOldTestApp, $oldTmp);
+ \OC_Helper::copyr($pathOfOldTestApp, $oldTmp);
$oldData = array(
'path' => $oldTmp,
@@ -72,7 +77,7 @@ class Test_Installer extends \Test\TestCase {
$pathOfNewTestApp .= 'testapp2.zip';
$newTmp = \OC::$server->getTempManager()->getTemporaryFile('.zip');
- OC_Helper::copyr($pathOfNewTestApp, $newTmp);
+ \OC_Helper::copyr($pathOfNewTestApp, $newTmp);
$newData = array(
'path' => $newTmp,
@@ -83,11 +88,11 @@ class Test_Installer extends \Test\TestCase {
]
);
- OC_Installer::installApp($oldData);
- $oldVersionNumber = OC_App::getAppVersion(self::$appid);
+ Installer::installApp($oldData);
+ $oldVersionNumber = \OC_App::getAppVersion(self::$appid);
- OC_Installer::updateApp($newData);
- $newVersionNumber = OC_App::getAppVersion(self::$appid);
+ Installer::updateApp($newData);
+ $newVersionNumber = \OC_App::getAppVersion(self::$appid);
$this->assertNotEquals($oldVersionNumber, $newVersionNumber);
}
diff --git a/tests/lib/activitymanager.php b/tests/lib/activity/managertest.php
index 26759d46270..cf855dd2813 100644
--- a/tests/lib/activitymanager.php
+++ b/tests/lib/activity/managertest.php
@@ -8,18 +8,22 @@
*
*/
-class Test_ActivityManager extends \Test\TestCase {
+namespace Test\Activity;
- /** @var \OC\ActivityManager */
+use Test\TestCase;
+
+class ManagerTest extends TestCase {
+
+ /** @var \OC\Activity\Manager */
private $activityManager;
- /** @var \PHPUnit_Framework_MockObject_MockObject */
+ /** @var \OCP\IRequest|\PHPUnit_Framework_MockObject_MockObject */
protected $request;
- /** @var \PHPUnit_Framework_MockObject_MockObject */
+ /** @var \OCP\IUserSession|\PHPUnit_Framework_MockObject_MockObject */
protected $session;
- /** @var \PHPUnit_Framework_MockObject_MockObject */
+ /** @var \OCP\IConfig|\PHPUnit_Framework_MockObject_MockObject */
protected $config;
protected function setUp() {
@@ -35,7 +39,7 @@ class Test_ActivityManager extends \Test\TestCase {
->disableOriginalConstructor()
->getMock();
- $this->activityManager = new \OC\ActivityManager(
+ $this->activityManager = new \OC\Activity\Manager(
$this->request,
$this->session,
$this->config
@@ -71,7 +75,7 @@ class Test_ActivityManager extends \Test\TestCase {
*/
public function testGetConsumersInvalidConsumer() {
$this->activityManager->registerConsumer(function() {
- return new StdClass();
+ return new \stdClass();
});
$this->invokePrivate($this->activityManager, 'getConsumers');
@@ -88,7 +92,7 @@ class Test_ActivityManager extends \Test\TestCase {
*/
public function testGetExtensionsInvalidExtension() {
$this->activityManager->registerExtension(function() {
- return new StdClass();
+ return new \stdClass();
});
$this->invokePrivate($this->activityManager, 'getExtensions');
@@ -119,10 +123,10 @@ class Test_ActivityManager extends \Test\TestCase {
}
public function testTranslate() {
- $result = $this->activityManager->translate('APP0', '', '', array(), false, false, 'en');
+ $result = $this->activityManager->translate('APP0', '', array(), false, false, 'en');
$this->assertEquals('Stupid translation', $result);
- $result = $this->activityManager->translate('APP1', '', '', array(), false, false, 'en');
+ $result = $this->activityManager->translate('APP1', '', array(), false, false, 'en');
$this->assertFalse($result);
}
@@ -259,7 +263,7 @@ class Test_ActivityManager extends \Test\TestCase {
}
/**
- * @expectedException BadMethodCallException
+ * @expectedException \BadMethodCallException
* @expectedExceptionMessage App not set
* @expectedExceptionCode 10
*/
@@ -269,7 +273,7 @@ class Test_ActivityManager extends \Test\TestCase {
}
/**
- * @expectedException BadMethodCallException
+ * @expectedException \BadMethodCallException
* @expectedExceptionMessage Type not set
* @expectedExceptionCode 11
*/
@@ -280,7 +284,7 @@ class Test_ActivityManager extends \Test\TestCase {
}
/**
- * @expectedException BadMethodCallException
+ * @expectedException \BadMethodCallException
* @expectedExceptionMessage Affected user not set
* @expectedExceptionCode 12
*/
@@ -292,7 +296,7 @@ class Test_ActivityManager extends \Test\TestCase {
}
/**
- * @expectedException BadMethodCallException
+ * @expectedException \BadMethodCallException
* @expectedExceptionMessage Subject not set
* @expectedExceptionCode 13
*/
diff --git a/tests/lib/logger.php b/tests/lib/logger.php
index 9c9cd9e6728..e6a0abfbf28 100644
--- a/tests/lib/logger.php
+++ b/tests/lib/logger.php
@@ -107,4 +107,19 @@ class Logger extends TestCase {
$this->assertContains('checkPassword(*** username and password replaced ***)', $logLine);
}
}
+
+ /**
+ * @dataProvider userAndPasswordData
+ */
+ public function testDetectvalidateUserPass($user, $password) {
+ $e = new \Exception('test');
+ $this->logger->logException($e);
+ $logLines = $this->getLogs();
+
+ foreach($logLines as $logLine) {
+ $this->assertNotContains($user, $logLine);
+ $this->assertNotContains($password, $logLine);
+ $this->assertContains('validateUserPass(*** username and password replaced ***)', $logLine);
+ }
+ }
}
diff --git a/tests/lib/server.php b/tests/lib/server.php
index d13f9be0c9e..fe3c6fd5ee8 100644
--- a/tests/lib/server.php
+++ b/tests/lib/server.php
@@ -44,7 +44,7 @@ class Server extends \Test\TestCase {
public function dataTestQuery() {
return [
- ['ActivityManager', '\OC\ActivityManager'],
+ ['ActivityManager', '\OC\Activity\Manager'],
['ActivityManager', '\OCP\Activity\IManager'],
['AllConfig', '\OC\AllConfig'],
['AllConfig', '\OCP\IConfig'],
diff --git a/tests/lib/session/memory.php b/tests/lib/session/memory.php
index 1ca4956c6ea..dbf2737fb3f 100644
--- a/tests/lib/session/memory.php
+++ b/tests/lib/session/memory.php
@@ -10,8 +10,17 @@
namespace Test\Session;
class Memory extends Session {
+
protected function setUp() {
parent::setUp();
$this->instance = new \OC\Session\Memory($this->getUniqueID());
}
+
+ /**
+ * @expectedException OCP\Session\Exceptions\SessionNotAvailableException
+ */
+ public function testThrowsExceptionOnGetId() {
+ $this->instance->getId();
+ }
+
}