From 13b1b45ee4bab5b832ca3a1602b4c4fb6d391f86 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Fri, 3 Oct 2014 15:14:22 +0200 Subject: Refactor MailSettings controller - Do not store the password (fixes https://github.com/owncloud/core/issues/11385) - Refactor to AppFramework - Add unit tests Conflicts: settings/admin/controller.php --- settings/application.php | 70 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 settings/application.php (limited to 'settings/application.php') diff --git a/settings/application.php b/settings/application.php new file mode 100644 index 00000000000..b17ca01c2f3 --- /dev/null +++ b/settings/application.php @@ -0,0 +1,70 @@ +getContainer(); + + /** + * Controllers + */ + $container->registerService('MailSettingsController', function(SimpleContainer $c) { + return new MailSettingsController( + $c->query('AppName'), + $c->query('Request'), + $c->query('L10N'), + $c->query('Config'), + $c->query('UserSession'), + $c->query('Defaults'), + $c->query('Mail'), + $c->query('DefaultMailAddress') + ); + }); + + /** + * Core class wrappers + */ + $container->registerService('Config', function(SimpleContainer $c) { + return $c->query('ServerContainer')->getConfig(); + }); + $container->registerService('L10N', function(SimpleContainer $c) { + return $c->query('ServerContainer')->getL10N('settings'); + }); + $container->registerService('UserSession', function(SimpleContainer $c) { + return $c->query('ServerContainer')->getUserSession(); + }); + $container->registerService('Mail', function(SimpleContainer $c) { + return new \OC_Mail; + }); + $container->registerService('Defaults', function(SimpleContainer $c) { + return new \OC_Defaults; + }); + $container->registerService('DefaultMailAddress', function(SimpleContainer $c) { + return Util::getDefaultEmailAddress('no-reply'); + }); + } +} -- cgit v1.2.3