diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base.php | 3 | ||||
-rw-r--r-- | lib/composer/composer/autoload_classmap.php | 3 | ||||
-rw-r--r-- | lib/composer/composer/autoload_static.php | 3 | ||||
-rw-r--r-- | lib/private/Server.php | 4 | ||||
-rw-r--r-- | lib/private/ServerContainer.php | 9 | ||||
-rw-r--r-- | lib/private/User/User.php | 7 |
6 files changed, 24 insertions, 5 deletions
diff --git a/lib/base.php b/lib/base.php index feb54ec0331..1db6b84c5fb 100644 --- a/lib/base.php +++ b/lib/base.php @@ -727,6 +727,9 @@ class OC { self::registerAccountHooks(); self::registerSettingsHooks(); + $settings = new \OC\Settings\Application(); + $settings->register(); + //make sure temporary files are cleaned up $tmpManager = \OC::$server->getTempManager(); register_shutdown_function(array($tmpManager, 'clean')); diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 29eab9c124b..a978a2ec575 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -760,6 +760,8 @@ return array( 'OC\\Session\\Internal' => $baseDir . '/lib/private/Session/Internal.php', 'OC\\Session\\Memory' => $baseDir . '/lib/private/Session/Memory.php', 'OC\\Session\\Session' => $baseDir . '/lib/private/Session/Session.php', + 'OC\\Settings\\Activity\\Provider' => $baseDir . '/settings/Activity/Provider.php', + 'OC\\Settings\\Activity\\Setting' => $baseDir . '/settings/Activity/Setting.php', 'OC\\Settings\\Admin\\Additional' => $baseDir . '/lib/private/Settings/Admin/Additional.php', 'OC\\Settings\\Admin\\Encryption' => $baseDir . '/lib/private/Settings/Admin/Encryption.php', 'OC\\Settings\\Admin\\Server' => $baseDir . '/lib/private/Settings/Admin/Server.php', @@ -780,6 +782,7 @@ return array( 'OC\\Settings\\Controller\\PersonalController' => $baseDir . '/settings/Controller/PersonalController.php', 'OC\\Settings\\Controller\\SecuritySettingsController' => $baseDir . '/settings/Controller/SecuritySettingsController.php', 'OC\\Settings\\Controller\\UsersController' => $baseDir . '/settings/Controller/UsersController.php', + 'OC\\Settings\\Hooks' => $baseDir . '/settings/Hooks.php', 'OC\\Settings\\Mailer\\NewUserMailHelper' => $baseDir . '/settings/Mailer/NewUserMailHelper.php', 'OC\\Settings\\Manager' => $baseDir . '/lib/private/Settings/Manager.php', 'OC\\Settings\\Mapper' => $baseDir . '/lib/private/Settings/Mapper.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index 61741bf3252..0967f0541ea 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -790,6 +790,8 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c 'OC\\Session\\Internal' => __DIR__ . '/../../..' . '/lib/private/Session/Internal.php', 'OC\\Session\\Memory' => __DIR__ . '/../../..' . '/lib/private/Session/Memory.php', 'OC\\Session\\Session' => __DIR__ . '/../../..' . '/lib/private/Session/Session.php', + 'OC\\Settings\\Activity\\Provider' => __DIR__ . '/../../..' . '/settings/Activity/Provider.php', + 'OC\\Settings\\Activity\\Setting' => __DIR__ . '/../../..' . '/settings/Activity/Setting.php', 'OC\\Settings\\Admin\\Additional' => __DIR__ . '/../../..' . '/lib/private/Settings/Admin/Additional.php', 'OC\\Settings\\Admin\\Encryption' => __DIR__ . '/../../..' . '/lib/private/Settings/Admin/Encryption.php', 'OC\\Settings\\Admin\\Server' => __DIR__ . '/../../..' . '/lib/private/Settings/Admin/Server.php', @@ -810,6 +812,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c 'OC\\Settings\\Controller\\PersonalController' => __DIR__ . '/../../..' . '/settings/Controller/PersonalController.php', 'OC\\Settings\\Controller\\SecuritySettingsController' => __DIR__ . '/../../..' . '/settings/Controller/SecuritySettingsController.php', 'OC\\Settings\\Controller\\UsersController' => __DIR__ . '/../../..' . '/settings/Controller/UsersController.php', + 'OC\\Settings\\Hooks' => __DIR__ . '/../../..' . '/settings/Hooks.php', 'OC\\Settings\\Mailer\\NewUserMailHelper' => __DIR__ . '/../../..' . '/settings/Mailer/NewUserMailHelper.php', 'OC\\Settings\\Manager' => __DIR__ . '/../../..' . '/lib/private/Settings/Manager.php', 'OC\\Settings\\Mapper' => __DIR__ . '/../../..' . '/lib/private/Settings/Mapper.php', diff --git a/lib/private/Server.php b/lib/private/Server.php index 2aa7c15af00..1ee34a57b93 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -343,9 +343,9 @@ class Server extends ServerContainer implements IServerContainer { $userSession->listen('\OC\User', 'logout', function () { \OC_Hook::emit('OC_User', 'logout', array()); }); - $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value) { + $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) { /** @var $user \OC\User\User */ - \OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value)); + \OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue)); }); return $userSession; }); diff --git a/lib/private/ServerContainer.php b/lib/private/ServerContainer.php index e7b1ed2dad7..3391dd83a04 100644 --- a/lib/private/ServerContainer.php +++ b/lib/private/ServerContainer.php @@ -102,6 +102,15 @@ class ServerContainer extends SimpleContainer { // Didn't find the service or the respective app container, // ignore it and fall back to the core container. } + } else if (strpos($name, 'OC\\Settings\\') === 0 && substr_count($name, '\\') >= 3) { + $segments = explode('\\', $name); + try { + $appContainer = $this->getAppContainer(strtolower($segments[1])); + return $appContainer->queryNoFallback($name); + } catch (QueryException $e) { + // Didn't find the service or the respective app container, + // ignore it and fall back to the core container. + } } return parent::query($name); diff --git a/lib/private/User/User.php b/lib/private/User/User.php index bca9c46bfd0..a3be0c24bb9 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -158,12 +158,13 @@ class User implements IUser { * @since 9.0.0 */ public function setEMailAddress($mailAddress) { + $oldMailAddress = $this->getEMailAddress(); if($mailAddress === '') { $this->config->deleteUserValue($this->uid, 'settings', 'email'); } else { $this->config->setUserValue($this->uid, 'settings', 'email', $mailAddress); } - $this->triggerChange('eMailAddress', $mailAddress); + $this->triggerChange('eMailAddress', $mailAddress, $oldMailAddress); } /** @@ -435,9 +436,9 @@ class User implements IUser { return $url; } - public function triggerChange($feature, $value = null) { + public function triggerChange($feature, $value = null, $oldValue = null) { if ($this->emitter) { - $this->emitter->emit('\OC\User', 'changeUser', array($this, $feature, $value)); + $this->emitter->emit('\OC\User', 'changeUser', array($this, $feature, $value, $oldValue)); } } } |