| @@ -6,63 +6,63 @@ | ||
| 6 | 6 | $baseDir = $vendorDir; | 
| 7 | 7 | |
| 8 | 8 | return array( | 
| 9 | - 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', | |
| 10 | - 'OCA\\Settings\\Activity\\GroupProvider' => $baseDir . '/../lib/Activity/GroupProvider.php', | |
| 11 | - 'OCA\\Settings\\Activity\\GroupSetting' => $baseDir . '/../lib/Activity/GroupSetting.php', | |
| 12 | - 'OCA\\Settings\\Activity\\Provider' => $baseDir . '/../lib/Activity/Provider.php', | |
| 13 | - 'OCA\\Settings\\Activity\\SecurityFilter' => $baseDir . '/../lib/Activity/SecurityFilter.php', | |
| 14 | - 'OCA\\Settings\\Activity\\SecurityProvider' => $baseDir . '/../lib/Activity/SecurityProvider.php', | |
| 15 | - 'OCA\\Settings\\Activity\\SecuritySetting' => $baseDir . '/../lib/Activity/SecuritySetting.php', | |
| 16 | - 'OCA\\Settings\\Activity\\Setting' => $baseDir . '/../lib/Activity/Setting.php', | |
| 17 | - 'OCA\\Settings\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php', | |
| 18 | - 'OCA\\Settings\\BackgroundJobs\\VerifyUserData' => $baseDir . '/../lib/BackgroundJobs/VerifyUserData.php', | |
| 19 | - 'OCA\\Settings\\Controller\\AdminSettingsController' => $baseDir . '/../lib/Controller/AdminSettingsController.php', | |
| 20 | - 'OCA\\Settings\\Controller\\AppSettingsController' => $baseDir . '/../lib/Controller/AppSettingsController.php', | |
| 21 | - 'OCA\\Settings\\Controller\\AuthSettingsController' => $baseDir . '/../lib/Controller/AuthSettingsController.php', | |
| 22 | - 'OCA\\Settings\\Controller\\ChangePasswordController' => $baseDir . '/../lib/Controller/ChangePasswordController.php', | |
| 23 | - 'OCA\\Settings\\Controller\\CheckSetupController' => $baseDir . '/../lib/Controller/CheckSetupController.php', | |
| 24 | - 'OCA\\Settings\\Controller\\CommonSettingsTrait' => $baseDir . '/../lib/Controller/CommonSettingsTrait.php', | |
| 25 | - 'OCA\\Settings\\Controller\\HelpController' => $baseDir . '/../lib/Controller/HelpController.php', | |
| 26 | - 'OCA\\Settings\\Controller\\LogSettingsController' => $baseDir . '/../lib/Controller/LogSettingsController.php', | |
| 27 | - 'OCA\\Settings\\Controller\\MailSettingsController' => $baseDir . '/../lib/Controller/MailSettingsController.php', | |
| 28 | - 'OCA\\Settings\\Controller\\PersonalSettingsController' => $baseDir . '/../lib/Controller/PersonalSettingsController.php', | |
| 29 | - 'OCA\\Settings\\Controller\\ReasonsController' => $baseDir . '/../lib/Controller/ReasonsController.php', | |
| 30 | - 'OCA\\Settings\\Controller\\TwoFactorSettingsController' => $baseDir . '/../lib/Controller/TwoFactorSettingsController.php', | |
| 31 | - 'OCA\\Settings\\Controller\\UsersController' => $baseDir . '/../lib/Controller/UsersController.php', | |
| 32 | - 'OCA\\Settings\\Controller\\WebAuthnController' => $baseDir . '/../lib/Controller/WebAuthnController.php', | |
| 33 | - 'OCA\\Settings\\Events\\BeforeTemplateRenderedEvent' => $baseDir . '/../lib/Events/BeforeTemplateRenderedEvent.php', | |
| 34 | - 'OCA\\Settings\\Hooks' => $baseDir . '/../lib/Hooks.php', | |
| 35 | - 'OCA\\Settings\\Listener\\AppPasswordCreatedActivityListener' => $baseDir . '/../lib/Listener/AppPasswordCreatedActivityListener.php', | |
| 36 | - 'OCA\\Settings\\Listener\\UserAddedToGroupActivityListener' => $baseDir . '/../lib/Listener/UserAddedToGroupActivityListener.php', | |
| 37 | - 'OCA\\Settings\\Listener\\UserRemovedFromGroupActivityListener' => $baseDir . '/../lib/Listener/UserRemovedFromGroupActivityListener.php', | |
| 38 | - 'OCA\\Settings\\Mailer\\NewUserMailHelper' => $baseDir . '/../lib/Mailer/NewUserMailHelper.php', | |
| 39 | - 'OCA\\Settings\\Middleware\\SubadminMiddleware' => $baseDir . '/../lib/Middleware/SubadminMiddleware.php', | |
| 40 | - 'OCA\\Settings\\Search\\AppSearch' => $baseDir . '/../lib/Search/AppSearch.php', | |
| 41 | - 'OCA\\Settings\\Search\\SectionSearch' => $baseDir . '/../lib/Search/SectionSearch.php', | |
| 42 | - 'OCA\\Settings\\Sections\\Admin\\Additional' => $baseDir . '/../lib/Sections/Admin/Additional.php', | |
| 43 | - 'OCA\\Settings\\Sections\\Admin\\Groupware' => $baseDir . '/../lib/Sections/Admin/Groupware.php', | |
| 44 | - 'OCA\\Settings\\Sections\\Admin\\Overview' => $baseDir . '/../lib/Sections/Admin/Overview.php', | |
| 45 | - 'OCA\\Settings\\Sections\\Admin\\Security' => $baseDir . '/../lib/Sections/Admin/Security.php', | |
| 46 | - 'OCA\\Settings\\Sections\\Admin\\Server' => $baseDir . '/../lib/Sections/Admin/Server.php', | |
| 47 | - 'OCA\\Settings\\Sections\\Admin\\Sharing' => $baseDir . '/../lib/Sections/Admin/Sharing.php', | |
| 48 | - 'OCA\\Settings\\Sections\\Personal\\PersonalInfo' => $baseDir . '/../lib/Sections/Personal/PersonalInfo.php', | |
| 49 | - 'OCA\\Settings\\Sections\\Personal\\Security' => $baseDir . '/../lib/Sections/Personal/Security.php', | |
| 50 | - 'OCA\\Settings\\Sections\\Personal\\SyncClients' => $baseDir . '/../lib/Sections/Personal/SyncClients.php', | |
| 51 | - 'OCA\\Settings\\Settings\\Admin\\Mail' => $baseDir . '/../lib/Settings/Admin/Mail.php', | |
| 52 | - 'OCA\\Settings\\Settings\\Admin\\Overview' => $baseDir . '/../lib/Settings/Admin/Overview.php', | |
| 53 | - 'OCA\\Settings\\Settings\\Admin\\Security' => $baseDir . '/../lib/Settings/Admin/Security.php', | |
| 54 | - 'OCA\\Settings\\Settings\\Admin\\Server' => $baseDir . '/../lib/Settings/Admin/Server.php', | |
| 55 | - 'OCA\\Settings\\Settings\\Admin\\Sharing' => $baseDir . '/../lib/Settings/Admin/Sharing.php', | |
| 56 | - 'OCA\\Settings\\Settings\\Personal\\Additional' => $baseDir . '/../lib/Settings/Personal/Additional.php', | |
| 57 | - 'OCA\\Settings\\Settings\\Personal\\PersonalInfo' => $baseDir . '/../lib/Settings/Personal/PersonalInfo.php', | |
| 58 | - 'OCA\\Settings\\Settings\\Personal\\Security\\Authtokens' => $baseDir . '/../lib/Settings/Personal/Security/Authtokens.php', | |
| 59 | - 'OCA\\Settings\\Settings\\Personal\\Security\\Password' => $baseDir . '/../lib/Settings/Personal/Security/Password.php', | |
| 60 | - 'OCA\\Settings\\Settings\\Personal\\Security\\TwoFactor' => $baseDir . '/../lib/Settings/Personal/Security/TwoFactor.php', | |
| 61 | - 'OCA\\Settings\\Settings\\Personal\\Security\\WebAuthn' => $baseDir . '/../lib/Settings/Personal/Security/WebAuthn.php', | |
| 62 | - 'OCA\\Settings\\Settings\\Personal\\ServerDevNotice' => $baseDir . '/../lib/Settings/Personal/ServerDevNotice.php', | |
| 63 | - 'OCA\\Settings\\SetupChecks\\CheckUserCertificates' => $baseDir . '/../lib/SetupChecks/CheckUserCertificates.php', | |
| 64 | - 'OCA\\Settings\\SetupChecks\\LegacySSEKeyFormat' => $baseDir . '/../lib/SetupChecks/LegacySSEKeyFormat.php', | |
| 65 | - 'OCA\\Settings\\SetupChecks\\PhpDefaultCharset' => $baseDir . '/../lib/SetupChecks/PhpDefaultCharset.php', | |
| 66 | - 'OCA\\Settings\\SetupChecks\\PhpOutputBuffering' => $baseDir . '/../lib/SetupChecks/PhpOutputBuffering.php', | |
| 67 | - 'OCA\\Settings\\SetupChecks\\SupportedDatabase' => $baseDir . '/../lib/SetupChecks/SupportedDatabase.php', | |
| 9 | + 'Composer\\InstalledVersions' => $vendorDir.'/composer/InstalledVersions.php', | |
| 10 | + 'OCA\\Settings\\Activity\\GroupProvider' => $baseDir.'/../lib/Activity/GroupProvider.php', | |
| 11 | + 'OCA\\Settings\\Activity\\GroupSetting' => $baseDir.'/../lib/Activity/GroupSetting.php', | |
| 12 | + 'OCA\\Settings\\Activity\\Provider' => $baseDir.'/../lib/Activity/Provider.php', | |
| 13 | + 'OCA\\Settings\\Activity\\SecurityFilter' => $baseDir.'/../lib/Activity/SecurityFilter.php', | |
| 14 | + 'OCA\\Settings\\Activity\\SecurityProvider' => $baseDir.'/../lib/Activity/SecurityProvider.php', | |
| 15 | + 'OCA\\Settings\\Activity\\SecuritySetting' => $baseDir.'/../lib/Activity/SecuritySetting.php', | |
| 16 | + 'OCA\\Settings\\Activity\\Setting' => $baseDir.'/../lib/Activity/Setting.php', | |
| 17 | + 'OCA\\Settings\\AppInfo\\Application' => $baseDir.'/../lib/AppInfo/Application.php', | |
| 18 | + 'OCA\\Settings\\BackgroundJobs\\VerifyUserData' => $baseDir.'/../lib/BackgroundJobs/VerifyUserData.php', | |
| 19 | + 'OCA\\Settings\\Controller\\AdminSettingsController' => $baseDir.'/../lib/Controller/AdminSettingsController.php', | |
| 20 | + 'OCA\\Settings\\Controller\\AppSettingsController' => $baseDir.'/../lib/Controller/AppSettingsController.php', | |
| 21 | + 'OCA\\Settings\\Controller\\AuthSettingsController' => $baseDir.'/../lib/Controller/AuthSettingsController.php', | |
| 22 | + 'OCA\\Settings\\Controller\\ChangePasswordController' => $baseDir.'/../lib/Controller/ChangePasswordController.php', | |
| 23 | + 'OCA\\Settings\\Controller\\CheckSetupController' => $baseDir.'/../lib/Controller/CheckSetupController.php', | |
| 24 | + 'OCA\\Settings\\Controller\\CommonSettingsTrait' => $baseDir.'/../lib/Controller/CommonSettingsTrait.php', | |
| 25 | + 'OCA\\Settings\\Controller\\HelpController' => $baseDir.'/../lib/Controller/HelpController.php', | |
| 26 | + 'OCA\\Settings\\Controller\\LogSettingsController' => $baseDir.'/../lib/Controller/LogSettingsController.php', | |
| 27 | + 'OCA\\Settings\\Controller\\MailSettingsController' => $baseDir.'/../lib/Controller/MailSettingsController.php', | |
| 28 | + 'OCA\\Settings\\Controller\\PersonalSettingsController' => $baseDir.'/../lib/Controller/PersonalSettingsController.php', | |
| 29 | + 'OCA\\Settings\\Controller\\ReasonsController' => $baseDir.'/../lib/Controller/ReasonsController.php', | |
| 30 | + 'OCA\\Settings\\Controller\\TwoFactorSettingsController' => $baseDir.'/../lib/Controller/TwoFactorSettingsController.php', | |
| 31 | + 'OCA\\Settings\\Controller\\UsersController' => $baseDir.'/../lib/Controller/UsersController.php', | |
| 32 | + 'OCA\\Settings\\Controller\\WebAuthnController' => $baseDir.'/../lib/Controller/WebAuthnController.php', | |
| 33 | + 'OCA\\Settings\\Events\\BeforeTemplateRenderedEvent' => $baseDir.'/../lib/Events/BeforeTemplateRenderedEvent.php', | |
| 34 | + 'OCA\\Settings\\Hooks' => $baseDir.'/../lib/Hooks.php', | |
| 35 | + 'OCA\\Settings\\Listener\\AppPasswordCreatedActivityListener' => $baseDir.'/../lib/Listener/AppPasswordCreatedActivityListener.php', | |
| 36 | + 'OCA\\Settings\\Listener\\UserAddedToGroupActivityListener' => $baseDir.'/../lib/Listener/UserAddedToGroupActivityListener.php', | |
| 37 | + 'OCA\\Settings\\Listener\\UserRemovedFromGroupActivityListener' => $baseDir.'/../lib/Listener/UserRemovedFromGroupActivityListener.php', | |
| 38 | + 'OCA\\Settings\\Mailer\\NewUserMailHelper' => $baseDir.'/../lib/Mailer/NewUserMailHelper.php', | |
| 39 | + 'OCA\\Settings\\Middleware\\SubadminMiddleware' => $baseDir.'/../lib/Middleware/SubadminMiddleware.php', | |
| 40 | + 'OCA\\Settings\\Search\\AppSearch' => $baseDir.'/../lib/Search/AppSearch.php', | |
| 41 | + 'OCA\\Settings\\Search\\SectionSearch' => $baseDir.'/../lib/Search/SectionSearch.php', | |
| 42 | + 'OCA\\Settings\\Sections\\Admin\\Additional' => $baseDir.'/../lib/Sections/Admin/Additional.php', | |
| 43 | + 'OCA\\Settings\\Sections\\Admin\\Groupware' => $baseDir.'/../lib/Sections/Admin/Groupware.php', | |
| 44 | + 'OCA\\Settings\\Sections\\Admin\\Overview' => $baseDir.'/../lib/Sections/Admin/Overview.php', | |
| 45 | + 'OCA\\Settings\\Sections\\Admin\\Security' => $baseDir.'/../lib/Sections/Admin/Security.php', | |
| 46 | + 'OCA\\Settings\\Sections\\Admin\\Server' => $baseDir.'/../lib/Sections/Admin/Server.php', | |
| 47 | + 'OCA\\Settings\\Sections\\Admin\\Sharing' => $baseDir.'/../lib/Sections/Admin/Sharing.php', | |
| 48 | + 'OCA\\Settings\\Sections\\Personal\\PersonalInfo' => $baseDir.'/../lib/Sections/Personal/PersonalInfo.php', | |
| 49 | + 'OCA\\Settings\\Sections\\Personal\\Security' => $baseDir.'/../lib/Sections/Personal/Security.php', | |
| 50 | + 'OCA\\Settings\\Sections\\Personal\\SyncClients' => $baseDir.'/../lib/Sections/Personal/SyncClients.php', | |
| 51 | + 'OCA\\Settings\\Settings\\Admin\\Mail' => $baseDir.'/../lib/Settings/Admin/Mail.php', | |
| 52 | + 'OCA\\Settings\\Settings\\Admin\\Overview' => $baseDir.'/../lib/Settings/Admin/Overview.php', | |
| 53 | + 'OCA\\Settings\\Settings\\Admin\\Security' => $baseDir.'/../lib/Settings/Admin/Security.php', | |
| 54 | + 'OCA\\Settings\\Settings\\Admin\\Server' => $baseDir.'/../lib/Settings/Admin/Server.php', | |
| 55 | + 'OCA\\Settings\\Settings\\Admin\\Sharing' => $baseDir.'/../lib/Settings/Admin/Sharing.php', | |
| 56 | + 'OCA\\Settings\\Settings\\Personal\\Additional' => $baseDir.'/../lib/Settings/Personal/Additional.php', | |
| 57 | + 'OCA\\Settings\\Settings\\Personal\\PersonalInfo' => $baseDir.'/../lib/Settings/Personal/PersonalInfo.php', | |
| 58 | + 'OCA\\Settings\\Settings\\Personal\\Security\\Authtokens' => $baseDir.'/../lib/Settings/Personal/Security/Authtokens.php', | |
| 59 | + 'OCA\\Settings\\Settings\\Personal\\Security\\Password' => $baseDir.'/../lib/Settings/Personal/Security/Password.php', | |
| 60 | + 'OCA\\Settings\\Settings\\Personal\\Security\\TwoFactor' => $baseDir.'/../lib/Settings/Personal/Security/TwoFactor.php', | |
| 61 | + 'OCA\\Settings\\Settings\\Personal\\Security\\WebAuthn' => $baseDir.'/../lib/Settings/Personal/Security/WebAuthn.php', | |
| 62 | + 'OCA\\Settings\\Settings\\Personal\\ServerDevNotice' => $baseDir.'/../lib/Settings/Personal/ServerDevNotice.php', | |
| 63 | + 'OCA\\Settings\\SetupChecks\\CheckUserCertificates' => $baseDir.'/../lib/SetupChecks/CheckUserCertificates.php', | |
| 64 | + 'OCA\\Settings\\SetupChecks\\LegacySSEKeyFormat' => $baseDir.'/../lib/SetupChecks/LegacySSEKeyFormat.php', | |
| 65 | + 'OCA\\Settings\\SetupChecks\\PhpDefaultCharset' => $baseDir.'/../lib/SetupChecks/PhpDefaultCharset.php', | |
| 66 | + 'OCA\\Settings\\SetupChecks\\PhpOutputBuffering' => $baseDir.'/../lib/SetupChecks/PhpOutputBuffering.php', | |
| 67 | + 'OCA\\Settings\\SetupChecks\\SupportedDatabase' => $baseDir.'/../lib/SetupChecks/SupportedDatabase.php', | |
| 68 | 68 | ); | 
| @@ -6,85 +6,85 @@ | ||
| 6 | 6 | |
| 7 | 7 | class ComposerStaticInitSettings | 
| 8 | 8 |  { | 
| 9 | - public static $prefixLengthsPsr4 = array ( | |
| 9 | + public static $prefixLengthsPsr4 = array( | |
| 10 | 10 | 'O' => | 
| 11 | - array ( | |
| 11 | + array( | |
| 12 | 12 | 'OCA\\Settings\\' => 13, | 
| 13 | 13 | ), | 
| 14 | 14 | ); | 
| 15 | 15 | |
| 16 | - public static $prefixDirsPsr4 = array ( | |
| 16 | + public static $prefixDirsPsr4 = array( | |
| 17 | 17 | 'OCA\\Settings\\' => | 
| 18 | - array ( | |
| 19 | - 0 => __DIR__ . '/..' . '/../lib', | |
| 18 | + array( | |
| 19 | + 0 => __DIR__.'/..'.'/../lib', | |
| 20 | 20 | ), | 
| 21 | 21 | ); | 
| 22 | 22 | |
| 23 | - public static $classMap = array ( | |
| 24 | - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', | |
| 25 | - 'OCA\\Settings\\Activity\\GroupProvider' => __DIR__ . '/..' . '/../lib/Activity/GroupProvider.php', | |
| 26 | - 'OCA\\Settings\\Activity\\GroupSetting' => __DIR__ . '/..' . '/../lib/Activity/GroupSetting.php', | |
| 27 | - 'OCA\\Settings\\Activity\\Provider' => __DIR__ . '/..' . '/../lib/Activity/Provider.php', | |
| 28 | - 'OCA\\Settings\\Activity\\SecurityFilter' => __DIR__ . '/..' . '/../lib/Activity/SecurityFilter.php', | |
| 29 | - 'OCA\\Settings\\Activity\\SecurityProvider' => __DIR__ . '/..' . '/../lib/Activity/SecurityProvider.php', | |
| 30 | - 'OCA\\Settings\\Activity\\SecuritySetting' => __DIR__ . '/..' . '/../lib/Activity/SecuritySetting.php', | |
| 31 | - 'OCA\\Settings\\Activity\\Setting' => __DIR__ . '/..' . '/../lib/Activity/Setting.php', | |
| 32 | - 'OCA\\Settings\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php', | |
| 33 | - 'OCA\\Settings\\BackgroundJobs\\VerifyUserData' => __DIR__ . '/..' . '/../lib/BackgroundJobs/VerifyUserData.php', | |
| 34 | - 'OCA\\Settings\\Controller\\AdminSettingsController' => __DIR__ . '/..' . '/../lib/Controller/AdminSettingsController.php', | |
| 35 | - 'OCA\\Settings\\Controller\\AppSettingsController' => __DIR__ . '/..' . '/../lib/Controller/AppSettingsController.php', | |
| 36 | - 'OCA\\Settings\\Controller\\AuthSettingsController' => __DIR__ . '/..' . '/../lib/Controller/AuthSettingsController.php', | |
| 37 | - 'OCA\\Settings\\Controller\\ChangePasswordController' => __DIR__ . '/..' . '/../lib/Controller/ChangePasswordController.php', | |
| 38 | - 'OCA\\Settings\\Controller\\CheckSetupController' => __DIR__ . '/..' . '/../lib/Controller/CheckSetupController.php', | |
| 39 | - 'OCA\\Settings\\Controller\\CommonSettingsTrait' => __DIR__ . '/..' . '/../lib/Controller/CommonSettingsTrait.php', | |
| 40 | - 'OCA\\Settings\\Controller\\HelpController' => __DIR__ . '/..' . '/../lib/Controller/HelpController.php', | |
| 41 | - 'OCA\\Settings\\Controller\\LogSettingsController' => __DIR__ . '/..' . '/../lib/Controller/LogSettingsController.php', | |
| 42 | - 'OCA\\Settings\\Controller\\MailSettingsController' => __DIR__ . '/..' . '/../lib/Controller/MailSettingsController.php', | |
| 43 | - 'OCA\\Settings\\Controller\\PersonalSettingsController' => __DIR__ . '/..' . '/../lib/Controller/PersonalSettingsController.php', | |
| 44 | - 'OCA\\Settings\\Controller\\ReasonsController' => __DIR__ . '/..' . '/../lib/Controller/ReasonsController.php', | |
| 45 | - 'OCA\\Settings\\Controller\\TwoFactorSettingsController' => __DIR__ . '/..' . '/../lib/Controller/TwoFactorSettingsController.php', | |
| 46 | - 'OCA\\Settings\\Controller\\UsersController' => __DIR__ . '/..' . '/../lib/Controller/UsersController.php', | |
| 47 | - 'OCA\\Settings\\Controller\\WebAuthnController' => __DIR__ . '/..' . '/../lib/Controller/WebAuthnController.php', | |
| 48 | - 'OCA\\Settings\\Events\\BeforeTemplateRenderedEvent' => __DIR__ . '/..' . '/../lib/Events/BeforeTemplateRenderedEvent.php', | |
| 49 | - 'OCA\\Settings\\Hooks' => __DIR__ . '/..' . '/../lib/Hooks.php', | |
| 50 | - 'OCA\\Settings\\Listener\\AppPasswordCreatedActivityListener' => __DIR__ . '/..' . '/../lib/Listener/AppPasswordCreatedActivityListener.php', | |
| 51 | - 'OCA\\Settings\\Listener\\UserAddedToGroupActivityListener' => __DIR__ . '/..' . '/../lib/Listener/UserAddedToGroupActivityListener.php', | |
| 52 | - 'OCA\\Settings\\Listener\\UserRemovedFromGroupActivityListener' => __DIR__ . '/..' . '/../lib/Listener/UserRemovedFromGroupActivityListener.php', | |
| 53 | - 'OCA\\Settings\\Mailer\\NewUserMailHelper' => __DIR__ . '/..' . '/../lib/Mailer/NewUserMailHelper.php', | |
| 54 | - 'OCA\\Settings\\Middleware\\SubadminMiddleware' => __DIR__ . '/..' . '/../lib/Middleware/SubadminMiddleware.php', | |
| 55 | - 'OCA\\Settings\\Search\\AppSearch' => __DIR__ . '/..' . '/../lib/Search/AppSearch.php', | |
| 56 | - 'OCA\\Settings\\Search\\SectionSearch' => __DIR__ . '/..' . '/../lib/Search/SectionSearch.php', | |
| 57 | - 'OCA\\Settings\\Sections\\Admin\\Additional' => __DIR__ . '/..' . '/../lib/Sections/Admin/Additional.php', | |
| 58 | - 'OCA\\Settings\\Sections\\Admin\\Groupware' => __DIR__ . '/..' . '/../lib/Sections/Admin/Groupware.php', | |
| 59 | - 'OCA\\Settings\\Sections\\Admin\\Overview' => __DIR__ . '/..' . '/../lib/Sections/Admin/Overview.php', | |
| 60 | - 'OCA\\Settings\\Sections\\Admin\\Security' => __DIR__ . '/..' . '/../lib/Sections/Admin/Security.php', | |
| 61 | - 'OCA\\Settings\\Sections\\Admin\\Server' => __DIR__ . '/..' . '/../lib/Sections/Admin/Server.php', | |
| 62 | - 'OCA\\Settings\\Sections\\Admin\\Sharing' => __DIR__ . '/..' . '/../lib/Sections/Admin/Sharing.php', | |
| 63 | - 'OCA\\Settings\\Sections\\Personal\\PersonalInfo' => __DIR__ . '/..' . '/../lib/Sections/Personal/PersonalInfo.php', | |
| 64 | - 'OCA\\Settings\\Sections\\Personal\\Security' => __DIR__ . '/..' . '/../lib/Sections/Personal/Security.php', | |
| 65 | - 'OCA\\Settings\\Sections\\Personal\\SyncClients' => __DIR__ . '/..' . '/../lib/Sections/Personal/SyncClients.php', | |
| 66 | - 'OCA\\Settings\\Settings\\Admin\\Mail' => __DIR__ . '/..' . '/../lib/Settings/Admin/Mail.php', | |
| 67 | - 'OCA\\Settings\\Settings\\Admin\\Overview' => __DIR__ . '/..' . '/../lib/Settings/Admin/Overview.php', | |
| 68 | - 'OCA\\Settings\\Settings\\Admin\\Security' => __DIR__ . '/..' . '/../lib/Settings/Admin/Security.php', | |
| 69 | - 'OCA\\Settings\\Settings\\Admin\\Server' => __DIR__ . '/..' . '/../lib/Settings/Admin/Server.php', | |
| 70 | - 'OCA\\Settings\\Settings\\Admin\\Sharing' => __DIR__ . '/..' . '/../lib/Settings/Admin/Sharing.php', | |
| 71 | - 'OCA\\Settings\\Settings\\Personal\\Additional' => __DIR__ . '/..' . '/../lib/Settings/Personal/Additional.php', | |
| 72 | - 'OCA\\Settings\\Settings\\Personal\\PersonalInfo' => __DIR__ . '/..' . '/../lib/Settings/Personal/PersonalInfo.php', | |
| 73 | - 'OCA\\Settings\\Settings\\Personal\\Security\\Authtokens' => __DIR__ . '/..' . '/../lib/Settings/Personal/Security/Authtokens.php', | |
| 74 | - 'OCA\\Settings\\Settings\\Personal\\Security\\Password' => __DIR__ . '/..' . '/../lib/Settings/Personal/Security/Password.php', | |
| 75 | - 'OCA\\Settings\\Settings\\Personal\\Security\\TwoFactor' => __DIR__ . '/..' . '/../lib/Settings/Personal/Security/TwoFactor.php', | |
| 76 | - 'OCA\\Settings\\Settings\\Personal\\Security\\WebAuthn' => __DIR__ . '/..' . '/../lib/Settings/Personal/Security/WebAuthn.php', | |
| 77 | - 'OCA\\Settings\\Settings\\Personal\\ServerDevNotice' => __DIR__ . '/..' . '/../lib/Settings/Personal/ServerDevNotice.php', | |
| 78 | - 'OCA\\Settings\\SetupChecks\\CheckUserCertificates' => __DIR__ . '/..' . '/../lib/SetupChecks/CheckUserCertificates.php', | |
| 79 | - 'OCA\\Settings\\SetupChecks\\LegacySSEKeyFormat' => __DIR__ . '/..' . '/../lib/SetupChecks/LegacySSEKeyFormat.php', | |
| 80 | - 'OCA\\Settings\\SetupChecks\\PhpDefaultCharset' => __DIR__ . '/..' . '/../lib/SetupChecks/PhpDefaultCharset.php', | |
| 81 | - 'OCA\\Settings\\SetupChecks\\PhpOutputBuffering' => __DIR__ . '/..' . '/../lib/SetupChecks/PhpOutputBuffering.php', | |
| 82 | - 'OCA\\Settings\\SetupChecks\\SupportedDatabase' => __DIR__ . '/..' . '/../lib/SetupChecks/SupportedDatabase.php', | |
| 23 | + public static $classMap = array( | |
| 24 | + 'Composer\\InstalledVersions' => __DIR__.'/..'.'/composer/InstalledVersions.php', | |
| 25 | + 'OCA\\Settings\\Activity\\GroupProvider' => __DIR__.'/..'.'/../lib/Activity/GroupProvider.php', | |
| 26 | + 'OCA\\Settings\\Activity\\GroupSetting' => __DIR__.'/..'.'/../lib/Activity/GroupSetting.php', | |
| 27 | + 'OCA\\Settings\\Activity\\Provider' => __DIR__.'/..'.'/../lib/Activity/Provider.php', | |
| 28 | + 'OCA\\Settings\\Activity\\SecurityFilter' => __DIR__.'/..'.'/../lib/Activity/SecurityFilter.php', | |
| 29 | + 'OCA\\Settings\\Activity\\SecurityProvider' => __DIR__.'/..'.'/../lib/Activity/SecurityProvider.php', | |
| 30 | + 'OCA\\Settings\\Activity\\SecuritySetting' => __DIR__.'/..'.'/../lib/Activity/SecuritySetting.php', | |
| 31 | + 'OCA\\Settings\\Activity\\Setting' => __DIR__.'/..'.'/../lib/Activity/Setting.php', | |
| 32 | + 'OCA\\Settings\\AppInfo\\Application' => __DIR__.'/..'.'/../lib/AppInfo/Application.php', | |
| 33 | + 'OCA\\Settings\\BackgroundJobs\\VerifyUserData' => __DIR__.'/..'.'/../lib/BackgroundJobs/VerifyUserData.php', | |
| 34 | + 'OCA\\Settings\\Controller\\AdminSettingsController' => __DIR__.'/..'.'/../lib/Controller/AdminSettingsController.php', | |
| 35 | + 'OCA\\Settings\\Controller\\AppSettingsController' => __DIR__.'/..'.'/../lib/Controller/AppSettingsController.php', | |
| 36 | + 'OCA\\Settings\\Controller\\AuthSettingsController' => __DIR__.'/..'.'/../lib/Controller/AuthSettingsController.php', | |
| 37 | + 'OCA\\Settings\\Controller\\ChangePasswordController' => __DIR__.'/..'.'/../lib/Controller/ChangePasswordController.php', | |
| 38 | + 'OCA\\Settings\\Controller\\CheckSetupController' => __DIR__.'/..'.'/../lib/Controller/CheckSetupController.php', | |
| 39 | + 'OCA\\Settings\\Controller\\CommonSettingsTrait' => __DIR__.'/..'.'/../lib/Controller/CommonSettingsTrait.php', | |
| 40 | + 'OCA\\Settings\\Controller\\HelpController' => __DIR__.'/..'.'/../lib/Controller/HelpController.php', | |
| 41 | + 'OCA\\Settings\\Controller\\LogSettingsController' => __DIR__.'/..'.'/../lib/Controller/LogSettingsController.php', | |
| 42 | + 'OCA\\Settings\\Controller\\MailSettingsController' => __DIR__.'/..'.'/../lib/Controller/MailSettingsController.php', | |
| 43 | + 'OCA\\Settings\\Controller\\PersonalSettingsController' => __DIR__.'/..'.'/../lib/Controller/PersonalSettingsController.php', | |
| 44 | + 'OCA\\Settings\\Controller\\ReasonsController' => __DIR__.'/..'.'/../lib/Controller/ReasonsController.php', | |
| 45 | + 'OCA\\Settings\\Controller\\TwoFactorSettingsController' => __DIR__.'/..'.'/../lib/Controller/TwoFactorSettingsController.php', | |
| 46 | + 'OCA\\Settings\\Controller\\UsersController' => __DIR__.'/..'.'/../lib/Controller/UsersController.php', | |
| 47 | + 'OCA\\Settings\\Controller\\WebAuthnController' => __DIR__.'/..'.'/../lib/Controller/WebAuthnController.php', | |
| 48 | + 'OCA\\Settings\\Events\\BeforeTemplateRenderedEvent' => __DIR__.'/..'.'/../lib/Events/BeforeTemplateRenderedEvent.php', | |
| 49 | + 'OCA\\Settings\\Hooks' => __DIR__.'/..'.'/../lib/Hooks.php', | |
| 50 | + 'OCA\\Settings\\Listener\\AppPasswordCreatedActivityListener' => __DIR__.'/..'.'/../lib/Listener/AppPasswordCreatedActivityListener.php', | |
| 51 | + 'OCA\\Settings\\Listener\\UserAddedToGroupActivityListener' => __DIR__.'/..'.'/../lib/Listener/UserAddedToGroupActivityListener.php', | |
| 52 | + 'OCA\\Settings\\Listener\\UserRemovedFromGroupActivityListener' => __DIR__.'/..'.'/../lib/Listener/UserRemovedFromGroupActivityListener.php', | |
| 53 | + 'OCA\\Settings\\Mailer\\NewUserMailHelper' => __DIR__.'/..'.'/../lib/Mailer/NewUserMailHelper.php', | |
| 54 | + 'OCA\\Settings\\Middleware\\SubadminMiddleware' => __DIR__.'/..'.'/../lib/Middleware/SubadminMiddleware.php', | |
| 55 | + 'OCA\\Settings\\Search\\AppSearch' => __DIR__.'/..'.'/../lib/Search/AppSearch.php', | |
| 56 | + 'OCA\\Settings\\Search\\SectionSearch' => __DIR__.'/..'.'/../lib/Search/SectionSearch.php', | |
| 57 | + 'OCA\\Settings\\Sections\\Admin\\Additional' => __DIR__.'/..'.'/../lib/Sections/Admin/Additional.php', | |
| 58 | + 'OCA\\Settings\\Sections\\Admin\\Groupware' => __DIR__.'/..'.'/../lib/Sections/Admin/Groupware.php', | |
| 59 | + 'OCA\\Settings\\Sections\\Admin\\Overview' => __DIR__.'/..'.'/../lib/Sections/Admin/Overview.php', | |
| 60 | + 'OCA\\Settings\\Sections\\Admin\\Security' => __DIR__.'/..'.'/../lib/Sections/Admin/Security.php', | |
| 61 | + 'OCA\\Settings\\Sections\\Admin\\Server' => __DIR__.'/..'.'/../lib/Sections/Admin/Server.php', | |
| 62 | + 'OCA\\Settings\\Sections\\Admin\\Sharing' => __DIR__.'/..'.'/../lib/Sections/Admin/Sharing.php', | |
| 63 | + 'OCA\\Settings\\Sections\\Personal\\PersonalInfo' => __DIR__.'/..'.'/../lib/Sections/Personal/PersonalInfo.php', | |
| 64 | + 'OCA\\Settings\\Sections\\Personal\\Security' => __DIR__.'/..'.'/../lib/Sections/Personal/Security.php', | |
| 65 | + 'OCA\\Settings\\Sections\\Personal\\SyncClients' => __DIR__.'/..'.'/../lib/Sections/Personal/SyncClients.php', | |
| 66 | + 'OCA\\Settings\\Settings\\Admin\\Mail' => __DIR__.'/..'.'/../lib/Settings/Admin/Mail.php', | |
| 67 | + 'OCA\\Settings\\Settings\\Admin\\Overview' => __DIR__.'/..'.'/../lib/Settings/Admin/Overview.php', | |
| 68 | + 'OCA\\Settings\\Settings\\Admin\\Security' => __DIR__.'/..'.'/../lib/Settings/Admin/Security.php', | |
| 69 | + 'OCA\\Settings\\Settings\\Admin\\Server' => __DIR__.'/..'.'/../lib/Settings/Admin/Server.php', | |
| 70 | + 'OCA\\Settings\\Settings\\Admin\\Sharing' => __DIR__.'/..'.'/../lib/Settings/Admin/Sharing.php', | |
| 71 | + 'OCA\\Settings\\Settings\\Personal\\Additional' => __DIR__.'/..'.'/../lib/Settings/Personal/Additional.php', | |
| 72 | + 'OCA\\Settings\\Settings\\Personal\\PersonalInfo' => __DIR__.'/..'.'/../lib/Settings/Personal/PersonalInfo.php', | |
| 73 | + 'OCA\\Settings\\Settings\\Personal\\Security\\Authtokens' => __DIR__.'/..'.'/../lib/Settings/Personal/Security/Authtokens.php', | |
| 74 | + 'OCA\\Settings\\Settings\\Personal\\Security\\Password' => __DIR__.'/..'.'/../lib/Settings/Personal/Security/Password.php', | |
| 75 | + 'OCA\\Settings\\Settings\\Personal\\Security\\TwoFactor' => __DIR__.'/..'.'/../lib/Settings/Personal/Security/TwoFactor.php', | |
| 76 | + 'OCA\\Settings\\Settings\\Personal\\Security\\WebAuthn' => __DIR__.'/..'.'/../lib/Settings/Personal/Security/WebAuthn.php', | |
| 77 | + 'OCA\\Settings\\Settings\\Personal\\ServerDevNotice' => __DIR__.'/..'.'/../lib/Settings/Personal/ServerDevNotice.php', | |
| 78 | + 'OCA\\Settings\\SetupChecks\\CheckUserCertificates' => __DIR__.'/..'.'/../lib/SetupChecks/CheckUserCertificates.php', | |
| 79 | + 'OCA\\Settings\\SetupChecks\\LegacySSEKeyFormat' => __DIR__.'/..'.'/../lib/SetupChecks/LegacySSEKeyFormat.php', | |
| 80 | + 'OCA\\Settings\\SetupChecks\\PhpDefaultCharset' => __DIR__.'/..'.'/../lib/SetupChecks/PhpDefaultCharset.php', | |
| 81 | + 'OCA\\Settings\\SetupChecks\\PhpOutputBuffering' => __DIR__.'/..'.'/../lib/SetupChecks/PhpOutputBuffering.php', | |
| 82 | + 'OCA\\Settings\\SetupChecks\\SupportedDatabase' => __DIR__.'/..'.'/../lib/SetupChecks/SupportedDatabase.php', | |
| 83 | 83 | ); | 
| 84 | 84 | |
| 85 | 85 | public static function getInitializer(ClassLoader $loader) | 
| 86 | 86 |      { | 
| 87 | -        return \Closure::bind(function () use ($loader) { | |
| 87 | +        return \Closure::bind(function() use ($loader) { | |
| 88 | 88 | $loader->prefixLengthsPsr4 = ComposerStaticInitSettings::$prefixLengthsPsr4; | 
| 89 | 89 | $loader->prefixDirsPsr4 = ComposerStaticInitSettings::$prefixDirsPsr4; | 
| 90 | 90 | $loader->classMap = ComposerStaticInitSettings::$classMap; | 
| @@ -37,60 +37,60 @@ | ||
| 37 | 37 | |
| 38 | 38 |  class UserRemovedFromGroupActivityListener implements IEventListener { | 
| 39 | 39 | |
| 40 | - /** @var Manager */ | |
| 41 | - private $groupManager; | |
| 42 | - | |
| 43 | - /** @var IManager */ | |
| 44 | - private $activityManager; | |
| 45 | - | |
| 46 | - /** @var IUserSession */ | |
| 47 | - private $userSession; | |
| 48 | - | |
| 49 | - public function __construct( | |
| 50 | - Manager $groupManager, | |
| 51 | - IManager $activityManager, | |
| 52 | - IUserSession $userSession | |
| 53 | -	) { | |
| 54 | - $this->groupManager = $groupManager; | |
| 55 | - $this->activityManager = $activityManager; | |
| 56 | - $this->userSession = $userSession; | |
| 57 | - } | |
| 58 | - | |
| 59 | -	public function handle(Event $event): void { | |
| 60 | -		if (!($event instanceof UserRemovedEvent)) { | |
| 61 | - return; | |
| 62 | - } | |
| 63 | - | |
| 64 | - $user = $event->getUser(); | |
| 65 | - $group = $event->getGroup(); | |
| 66 | - | |
| 67 | - $subAdminManager = $this->groupManager->getSubAdmin(); | |
| 68 | - $usersToNotify = $subAdminManager->getGroupsSubAdmins($group); | |
| 69 | - $usersToNotify[] = $user; | |
| 70 | - | |
| 71 | - | |
| 72 | - $event = $this->activityManager->generateEvent(); | |
| 73 | -		$event->setApp('settings') | |
| 74 | -			->setType('group_settings'); | |
| 75 | - | |
| 76 | - $actor = $this->userSession->getUser(); | |
| 77 | -		if ($actor instanceof IUser) { | |
| 78 | - $event->setAuthor($actor->getUID()) | |
| 79 | - ->setSubject(GroupProvider::REMOVED_FROM_GROUP, [ | |
| 80 | - 'user' => $user->getUID(), | |
| 81 | - 'group' => $group->getGID(), | |
| 82 | - 'actor' => $actor->getUID(), | |
| 83 | - ]); | |
| 84 | -		} else { | |
| 85 | - $event->setSubject(GroupProvider::REMOVED_FROM_GROUP, [ | |
| 86 | - 'user' => $user->getUID(), | |
| 87 | - 'group' => $group->getGID(), | |
| 88 | - ]); | |
| 89 | - } | |
| 90 | - | |
| 91 | -		foreach ($usersToNotify as $userToNotify) { | |
| 92 | - $event->setAffectedUser($userToNotify->getUID()); | |
| 93 | - $this->activityManager->publish($event); | |
| 94 | - } | |
| 95 | - } | |
| 40 | + /** @var Manager */ | |
| 41 | + private $groupManager; | |
| 42 | + | |
| 43 | + /** @var IManager */ | |
| 44 | + private $activityManager; | |
| 45 | + | |
| 46 | + /** @var IUserSession */ | |
| 47 | + private $userSession; | |
| 48 | + | |
| 49 | + public function __construct( | |
| 50 | + Manager $groupManager, | |
| 51 | + IManager $activityManager, | |
| 52 | + IUserSession $userSession | |
| 53 | +    ) { | |
| 54 | + $this->groupManager = $groupManager; | |
| 55 | + $this->activityManager = $activityManager; | |
| 56 | + $this->userSession = $userSession; | |
| 57 | + } | |
| 58 | + | |
| 59 | +    public function handle(Event $event): void { | |
| 60 | +        if (!($event instanceof UserRemovedEvent)) { | |
| 61 | + return; | |
| 62 | + } | |
| 63 | + | |
| 64 | + $user = $event->getUser(); | |
| 65 | + $group = $event->getGroup(); | |
| 66 | + | |
| 67 | + $subAdminManager = $this->groupManager->getSubAdmin(); | |
| 68 | + $usersToNotify = $subAdminManager->getGroupsSubAdmins($group); | |
| 69 | + $usersToNotify[] = $user; | |
| 70 | + | |
| 71 | + | |
| 72 | + $event = $this->activityManager->generateEvent(); | |
| 73 | +        $event->setApp('settings') | |
| 74 | +            ->setType('group_settings'); | |
| 75 | + | |
| 76 | + $actor = $this->userSession->getUser(); | |
| 77 | +        if ($actor instanceof IUser) { | |
| 78 | + $event->setAuthor($actor->getUID()) | |
| 79 | + ->setSubject(GroupProvider::REMOVED_FROM_GROUP, [ | |
| 80 | + 'user' => $user->getUID(), | |
| 81 | + 'group' => $group->getGID(), | |
| 82 | + 'actor' => $actor->getUID(), | |
| 83 | + ]); | |
| 84 | +        } else { | |
| 85 | + $event->setSubject(GroupProvider::REMOVED_FROM_GROUP, [ | |
| 86 | + 'user' => $user->getUID(), | |
| 87 | + 'group' => $group->getGID(), | |
| 88 | + ]); | |
| 89 | + } | |
| 90 | + | |
| 91 | +        foreach ($usersToNotify as $userToNotify) { | |
| 92 | + $event->setAffectedUser($userToNotify->getUID()); | |
| 93 | + $this->activityManager->publish($event); | |
| 94 | + } | |
| 95 | + } | |
| 96 | 96 | } | 
| @@ -37,60 +37,60 @@ | ||
| 37 | 37 | |
| 38 | 38 |  class UserAddedToGroupActivityListener implements IEventListener { | 
| 39 | 39 | |
| 40 | - /** @var Manager */ | |
| 41 | - private $groupManager; | |
| 42 | - | |
| 43 | - /** @var IManager */ | |
| 44 | - private $activityManager; | |
| 45 | - | |
| 46 | - /** @var IUserSession */ | |
| 47 | - private $userSession; | |
| 48 | - | |
| 49 | - public function __construct( | |
| 50 | - Manager $groupManager, | |
| 51 | - IManager $activityManager, | |
| 52 | - IUserSession $userSession | |
| 53 | -	) { | |
| 54 | - $this->groupManager = $groupManager; | |
| 55 | - $this->activityManager = $activityManager; | |
| 56 | - $this->userSession = $userSession; | |
| 57 | - } | |
| 58 | - | |
| 59 | -	public function handle(Event $event): void { | |
| 60 | -		if (!($event instanceof UserAddedEvent)) { | |
| 61 | - return; | |
| 62 | - } | |
| 63 | - | |
| 64 | - $user = $event->getUser(); | |
| 65 | - $group = $event->getGroup(); | |
| 66 | - | |
| 67 | - $subAdminManager = $this->groupManager->getSubAdmin(); | |
| 68 | - $usersToNotify = $subAdminManager->getGroupsSubAdmins($group); | |
| 69 | - $usersToNotify[] = $user; | |
| 70 | - | |
| 71 | - | |
| 72 | - $event = $this->activityManager->generateEvent(); | |
| 73 | -		$event->setApp('settings') | |
| 74 | -			->setType('group_settings'); | |
| 75 | - | |
| 76 | - $actor = $this->userSession->getUser(); | |
| 77 | -		if ($actor instanceof IUser) { | |
| 78 | - $event->setAuthor($actor->getUID()) | |
| 79 | - ->setSubject(GroupProvider::ADDED_TO_GROUP, [ | |
| 80 | - 'user' => $user->getUID(), | |
| 81 | - 'group' => $group->getGID(), | |
| 82 | - 'actor' => $actor->getUID(), | |
| 83 | - ]); | |
| 84 | -		} else { | |
| 85 | - $event->setSubject(GroupProvider::ADDED_TO_GROUP, [ | |
| 86 | - 'user' => $user->getUID(), | |
| 87 | - 'group' => $group->getGID(), | |
| 88 | - ]); | |
| 89 | - } | |
| 90 | - | |
| 91 | -		foreach ($usersToNotify as $userToNotify) { | |
| 92 | - $event->setAffectedUser($userToNotify->getUID()); | |
| 93 | - $this->activityManager->publish($event); | |
| 94 | - } | |
| 95 | - } | |
| 40 | + /** @var Manager */ | |
| 41 | + private $groupManager; | |
| 42 | + | |
| 43 | + /** @var IManager */ | |
| 44 | + private $activityManager; | |
| 45 | + | |
| 46 | + /** @var IUserSession */ | |
| 47 | + private $userSession; | |
| 48 | + | |
| 49 | + public function __construct( | |
| 50 | + Manager $groupManager, | |
| 51 | + IManager $activityManager, | |
| 52 | + IUserSession $userSession | |
| 53 | +    ) { | |
| 54 | + $this->groupManager = $groupManager; | |
| 55 | + $this->activityManager = $activityManager; | |
| 56 | + $this->userSession = $userSession; | |
| 57 | + } | |
| 58 | + | |
| 59 | +    public function handle(Event $event): void { | |
| 60 | +        if (!($event instanceof UserAddedEvent)) { | |
| 61 | + return; | |
| 62 | + } | |
| 63 | + | |
| 64 | + $user = $event->getUser(); | |
| 65 | + $group = $event->getGroup(); | |
| 66 | + | |
| 67 | + $subAdminManager = $this->groupManager->getSubAdmin(); | |
| 68 | + $usersToNotify = $subAdminManager->getGroupsSubAdmins($group); | |
| 69 | + $usersToNotify[] = $user; | |
| 70 | + | |
| 71 | + | |
| 72 | + $event = $this->activityManager->generateEvent(); | |
| 73 | +        $event->setApp('settings') | |
| 74 | +            ->setType('group_settings'); | |
| 75 | + | |
| 76 | + $actor = $this->userSession->getUser(); | |
| 77 | +        if ($actor instanceof IUser) { | |
| 78 | + $event->setAuthor($actor->getUID()) | |
| 79 | + ->setSubject(GroupProvider::ADDED_TO_GROUP, [ | |
| 80 | + 'user' => $user->getUID(), | |
| 81 | + 'group' => $group->getGID(), | |
| 82 | + 'actor' => $actor->getUID(), | |
| 83 | + ]); | |
| 84 | +        } else { | |
| 85 | + $event->setSubject(GroupProvider::ADDED_TO_GROUP, [ | |
| 86 | + 'user' => $user->getUID(), | |
| 87 | + 'group' => $group->getGID(), | |
| 88 | + ]); | |
| 89 | + } | |
| 90 | + | |
| 91 | +        foreach ($usersToNotify as $userToNotify) { | |
| 92 | + $event->setAffectedUser($userToNotify->getUID()); | |
| 93 | + $this->activityManager->publish($event); | |
| 94 | + } | |
| 95 | + } | |
| 96 | 96 | } | 
| @@ -60,106 +60,106 @@ | ||
| 60 | 60 | use OCP\Util; | 
| 61 | 61 | |
| 62 | 62 |  class Application extends App implements IBootstrap { | 
| 63 | - public const APP_ID = 'settings'; | |
| 63 | + public const APP_ID = 'settings'; | |
| 64 | 64 | |
| 65 | - /** | |
| 66 | - * @param array $urlParams | |
| 67 | - */ | |
| 68 | -	public function __construct(array $urlParams = []) { | |
| 69 | - parent::__construct(self::APP_ID, $urlParams); | |
| 70 | - } | |
| 65 | + /** | |
| 66 | + * @param array $urlParams | |
| 67 | + */ | |
| 68 | +    public function __construct(array $urlParams = []) { | |
| 69 | + parent::__construct(self::APP_ID, $urlParams); | |
| 70 | + } | |
| 71 | 71 | |
| 72 | -	public function register(IRegistrationContext $context): void { | |
| 73 | - // Register Middleware | |
| 74 | -		$context->registerServiceAlias('SubadminMiddleware', SubadminMiddleware::class); | |
| 75 | - $context->registerMiddleware(SubadminMiddleware::class); | |
| 76 | - $context->registerSearchProvider(SectionSearch::class); | |
| 77 | - $context->registerSearchProvider(AppSearch::class); | |
| 72 | +    public function register(IRegistrationContext $context): void { | |
| 73 | + // Register Middleware | |
| 74 | +        $context->registerServiceAlias('SubadminMiddleware', SubadminMiddleware::class); | |
| 75 | + $context->registerMiddleware(SubadminMiddleware::class); | |
| 76 | + $context->registerSearchProvider(SectionSearch::class); | |
| 77 | + $context->registerSearchProvider(AppSearch::class); | |
| 78 | 78 | |
| 79 | - // Register listeners | |
| 80 | - $context->registerEventListener(AppPasswordCreatedEvent::class, AppPasswordCreatedActivityListener::class); | |
| 81 | - $context->registerEventListener(UserAddedEvent::class, UserAddedToGroupActivityListener::class); | |
| 82 | - $context->registerEventListener(UserRemovedEvent::class, UserRemovedFromGroupActivityListener::class); | |
| 79 | + // Register listeners | |
| 80 | + $context->registerEventListener(AppPasswordCreatedEvent::class, AppPasswordCreatedActivityListener::class); | |
| 81 | + $context->registerEventListener(UserAddedEvent::class, UserAddedToGroupActivityListener::class); | |
| 82 | + $context->registerEventListener(UserRemovedEvent::class, UserRemovedFromGroupActivityListener::class); | |
| 83 | 83 | |
| 84 | - /** | |
| 85 | - * Core class wrappers | |
| 86 | - */ | |
| 87 | - /** FIXME: Remove once OC_User is non-static and mockable */ | |
| 88 | -		$context->registerService('isAdmin', function () { | |
| 89 | - return \OC_User::isAdminUser(\OC_User::getUser()); | |
| 90 | - }); | |
| 91 | - /** FIXME: Remove once OC_SubAdmin is non-static and mockable */ | |
| 92 | -		$context->registerService('isSubAdmin', function () { | |
| 93 | - $userObject = \OC::$server->getUserSession()->getUser(); | |
| 94 | - $isSubAdmin = false; | |
| 95 | -			if ($userObject !== null) { | |
| 96 | - $isSubAdmin = \OC::$server->getGroupManager()->getSubAdmin()->isSubAdmin($userObject); | |
| 97 | - } | |
| 98 | - return $isSubAdmin; | |
| 99 | - }); | |
| 100 | -		$context->registerService(IProvider::class, function (IAppContainer $appContainer) { | |
| 101 | - /** @var IServerContainer $serverContainer */ | |
| 102 | - $serverContainer = $appContainer->query(IServerContainer::class); | |
| 103 | - return $serverContainer->query(IProvider::class); | |
| 104 | - }); | |
| 105 | -		$context->registerService(IManager::class, function (IAppContainer $appContainer) { | |
| 106 | - /** @var IServerContainer $serverContainer */ | |
| 107 | - $serverContainer = $appContainer->query(IServerContainer::class); | |
| 108 | - return $serverContainer->getSettingsManager(); | |
| 109 | - }); | |
| 84 | + /** | |
| 85 | + * Core class wrappers | |
| 86 | + */ | |
| 87 | + /** FIXME: Remove once OC_User is non-static and mockable */ | |
| 88 | +        $context->registerService('isAdmin', function () { | |
| 89 | + return \OC_User::isAdminUser(\OC_User::getUser()); | |
| 90 | + }); | |
| 91 | + /** FIXME: Remove once OC_SubAdmin is non-static and mockable */ | |
| 92 | +        $context->registerService('isSubAdmin', function () { | |
| 93 | + $userObject = \OC::$server->getUserSession()->getUser(); | |
| 94 | + $isSubAdmin = false; | |
| 95 | +            if ($userObject !== null) { | |
| 96 | + $isSubAdmin = \OC::$server->getGroupManager()->getSubAdmin()->isSubAdmin($userObject); | |
| 97 | + } | |
| 98 | + return $isSubAdmin; | |
| 99 | + }); | |
| 100 | +        $context->registerService(IProvider::class, function (IAppContainer $appContainer) { | |
| 101 | + /** @var IServerContainer $serverContainer */ | |
| 102 | + $serverContainer = $appContainer->query(IServerContainer::class); | |
| 103 | + return $serverContainer->query(IProvider::class); | |
| 104 | + }); | |
| 105 | +        $context->registerService(IManager::class, function (IAppContainer $appContainer) { | |
| 106 | + /** @var IServerContainer $serverContainer */ | |
| 107 | + $serverContainer = $appContainer->query(IServerContainer::class); | |
| 108 | + return $serverContainer->getSettingsManager(); | |
| 109 | + }); | |
| 110 | 110 | |
| 111 | -		$context->registerService(NewUserMailHelper::class, function (IAppContainer $appContainer) { | |
| 112 | - /** @var Server $server */ | |
| 113 | - $server = $appContainer->query(IServerContainer::class); | |
| 114 | - /** @var Defaults $defaults */ | |
| 115 | - $defaults = $server->query(Defaults::class); | |
| 111 | +        $context->registerService(NewUserMailHelper::class, function (IAppContainer $appContainer) { | |
| 112 | + /** @var Server $server */ | |
| 113 | + $server = $appContainer->query(IServerContainer::class); | |
| 114 | + /** @var Defaults $defaults */ | |
| 115 | + $defaults = $server->query(Defaults::class); | |
| 116 | 116 | |
| 117 | - return new NewUserMailHelper( | |
| 118 | - $defaults, | |
| 119 | - $server->getURLGenerator(), | |
| 120 | - $server->getL10NFactory(), | |
| 121 | - $server->getMailer(), | |
| 122 | - $server->getSecureRandom(), | |
| 123 | - new TimeFactory(), | |
| 124 | - $server->getConfig(), | |
| 125 | - $server->getCrypto(), | |
| 126 | -				Util::getDefaultEmailAddress('no-reply') | |
| 127 | - ); | |
| 128 | - }); | |
| 129 | - } | |
| 117 | + return new NewUserMailHelper( | |
| 118 | + $defaults, | |
| 119 | + $server->getURLGenerator(), | |
| 120 | + $server->getL10NFactory(), | |
| 121 | + $server->getMailer(), | |
| 122 | + $server->getSecureRandom(), | |
| 123 | + new TimeFactory(), | |
| 124 | + $server->getConfig(), | |
| 125 | + $server->getCrypto(), | |
| 126 | +                Util::getDefaultEmailAddress('no-reply') | |
| 127 | + ); | |
| 128 | + }); | |
| 129 | + } | |
| 130 | 130 | |
| 131 | -	public function boot(IBootContext $context): void { | |
| 132 | -		Util::connectHook('OC_User', 'post_setPassword', $this, 'onChangePassword'); | |
| 133 | -		Util::connectHook('OC_User', 'changeUser', $this, 'onChangeInfo'); | |
| 134 | - } | |
| 131 | +    public function boot(IBootContext $context): void { | |
| 132 | +        Util::connectHook('OC_User', 'post_setPassword', $this, 'onChangePassword'); | |
| 133 | +        Util::connectHook('OC_User', 'changeUser', $this, 'onChangeInfo'); | |
| 134 | + } | |
| 135 | 135 | |
| 136 | - /** | |
| 137 | - * @param array $parameters | |
| 138 | - * @throws \InvalidArgumentException | |
| 139 | - * @throws \BadMethodCallException | |
| 140 | - * @throws \Exception | |
| 141 | - * @throws \OCP\AppFramework\QueryException | |
| 142 | - */ | |
| 143 | -	public function onChangePassword(array $parameters) { | |
| 144 | - /** @var Hooks $hooks */ | |
| 145 | - $hooks = $this->getContainer()->query(Hooks::class); | |
| 146 | - $hooks->onChangePassword($parameters['uid']); | |
| 147 | - } | |
| 136 | + /** | |
| 137 | + * @param array $parameters | |
| 138 | + * @throws \InvalidArgumentException | |
| 139 | + * @throws \BadMethodCallException | |
| 140 | + * @throws \Exception | |
| 141 | + * @throws \OCP\AppFramework\QueryException | |
| 142 | + */ | |
| 143 | +    public function onChangePassword(array $parameters) { | |
| 144 | + /** @var Hooks $hooks */ | |
| 145 | + $hooks = $this->getContainer()->query(Hooks::class); | |
| 146 | + $hooks->onChangePassword($parameters['uid']); | |
| 147 | + } | |
| 148 | 148 | |
| 149 | - /** | |
| 150 | - * @param array $parameters | |
| 151 | - * @throws \InvalidArgumentException | |
| 152 | - * @throws \BadMethodCallException | |
| 153 | - * @throws \Exception | |
| 154 | - * @throws \OCP\AppFramework\QueryException | |
| 155 | - */ | |
| 156 | -	public function onChangeInfo(array $parameters) { | |
| 157 | -		if ($parameters['feature'] !== 'eMailAddress') { | |
| 158 | - return; | |
| 159 | - } | |
| 149 | + /** | |
| 150 | + * @param array $parameters | |
| 151 | + * @throws \InvalidArgumentException | |
| 152 | + * @throws \BadMethodCallException | |
| 153 | + * @throws \Exception | |
| 154 | + * @throws \OCP\AppFramework\QueryException | |
| 155 | + */ | |
| 156 | +    public function onChangeInfo(array $parameters) { | |
| 157 | +        if ($parameters['feature'] !== 'eMailAddress') { | |
| 158 | + return; | |
| 159 | + } | |
| 160 | 160 | |
| 161 | - /** @var Hooks $hooks */ | |
| 162 | - $hooks = $this->getContainer()->query(Hooks::class); | |
| 163 | - $hooks->onChangeEmail($parameters['user'], $parameters['old_value']); | |
| 164 | - } | |
| 161 | + /** @var Hooks $hooks */ | |
| 162 | + $hooks = $this->getContainer()->query(Hooks::class); | |
| 163 | + $hooks->onChangeEmail($parameters['user'], $parameters['old_value']); | |
| 164 | + } | |
| 165 | 165 | } | 
| @@ -85,11 +85,11 @@ discard block | ||
| 85 | 85 | * Core class wrappers | 
| 86 | 86 | */ | 
| 87 | 87 | /** FIXME: Remove once OC_User is non-static and mockable */ | 
| 88 | -		$context->registerService('isAdmin', function () { | |
| 88 | +		$context->registerService('isAdmin', function() { | |
| 89 | 89 | return \OC_User::isAdminUser(\OC_User::getUser()); | 
| 90 | 90 | }); | 
| 91 | 91 | /** FIXME: Remove once OC_SubAdmin is non-static and mockable */ | 
| 92 | -		$context->registerService('isSubAdmin', function () { | |
| 92 | +		$context->registerService('isSubAdmin', function() { | |
| 93 | 93 | $userObject = \OC::$server->getUserSession()->getUser(); | 
| 94 | 94 | $isSubAdmin = false; | 
| 95 | 95 |  			if ($userObject !== null) { | 
| @@ -97,18 +97,18 @@ discard block | ||
| 97 | 97 | } | 
| 98 | 98 | return $isSubAdmin; | 
| 99 | 99 | }); | 
| 100 | -		$context->registerService(IProvider::class, function (IAppContainer $appContainer) { | |
| 100 | +		$context->registerService(IProvider::class, function(IAppContainer $appContainer) { | |
| 101 | 101 | /** @var IServerContainer $serverContainer */ | 
| 102 | 102 | $serverContainer = $appContainer->query(IServerContainer::class); | 
| 103 | 103 | return $serverContainer->query(IProvider::class); | 
| 104 | 104 | }); | 
| 105 | -		$context->registerService(IManager::class, function (IAppContainer $appContainer) { | |
| 105 | +		$context->registerService(IManager::class, function(IAppContainer $appContainer) { | |
| 106 | 106 | /** @var IServerContainer $serverContainer */ | 
| 107 | 107 | $serverContainer = $appContainer->query(IServerContainer::class); | 
| 108 | 108 | return $serverContainer->getSettingsManager(); | 
| 109 | 109 | }); | 
| 110 | 110 | |
| 111 | -		$context->registerService(NewUserMailHelper::class, function (IAppContainer $appContainer) { | |
| 111 | +		$context->registerService(NewUserMailHelper::class, function(IAppContainer $appContainer) { | |
| 112 | 112 | /** @var Server $server */ | 
| 113 | 113 | $server = $appContainer->query(IServerContainer::class); | 
| 114 | 114 | /** @var Defaults $defaults */ | 
| @@ -40,176 +40,176 @@ | ||
| 40 | 40 | |
| 41 | 41 |  class Hooks { | 
| 42 | 42 | |
| 43 | - /** @var IActivityManager */ | |
| 44 | - protected $activityManager; | |
| 45 | - /** @var IGroupManager|\OC\Group\Manager */ | |
| 46 | - protected $groupManager; | |
| 47 | - /** @var IUserManager */ | |
| 48 | - protected $userManager; | |
| 49 | - /** @var IUserSession */ | |
| 50 | - protected $userSession; | |
| 51 | - /** @var IURLGenerator */ | |
| 52 | - protected $urlGenerator; | |
| 53 | - /** @var IMailer */ | |
| 54 | - protected $mailer; | |
| 55 | - /** @var IConfig */ | |
| 56 | - protected $config; | |
| 57 | - /** @var IFactory */ | |
| 58 | - protected $languageFactory; | |
| 59 | - | |
| 60 | - public function __construct(IActivityManager $activityManager, | |
| 61 | - IGroupManager $groupManager, | |
| 62 | - IUserManager $userManager, | |
| 63 | - IUserSession $userSession, | |
| 64 | - IURLGenerator $urlGenerator, | |
| 65 | - IMailer $mailer, | |
| 66 | - IConfig $config, | |
| 67 | -								IFactory $languageFactory) { | |
| 68 | - $this->activityManager = $activityManager; | |
| 69 | - $this->groupManager = $groupManager; | |
| 70 | - $this->userManager = $userManager; | |
| 71 | - $this->userSession = $userSession; | |
| 72 | - $this->urlGenerator = $urlGenerator; | |
| 73 | - $this->mailer = $mailer; | |
| 74 | - $this->config = $config; | |
| 75 | - $this->languageFactory = $languageFactory; | |
| 76 | - } | |
| 77 | - | |
| 78 | - /** | |
| 79 | - * @param string $uid | |
| 80 | - * @throws \InvalidArgumentException | |
| 81 | - * @throws \BadMethodCallException | |
| 82 | - * @throws \Exception | |
| 83 | - */ | |
| 84 | -	public function onChangePassword($uid) { | |
| 85 | - $user = $this->userManager->get($uid); | |
| 86 | - | |
| 87 | -		if (!$user instanceof IUser || $user->getLastLogin() === 0) { | |
| 88 | - // User didn't login, so don't create activities and emails. | |
| 89 | - return; | |
| 90 | - } | |
| 91 | - | |
| 92 | - $event = $this->activityManager->generateEvent(); | |
| 93 | -		$event->setApp('settings') | |
| 94 | -			->setType('personal_settings') | |
| 95 | - ->setAffectedUser($user->getUID()); | |
| 96 | - | |
| 97 | -		$instanceUrl = $this->urlGenerator->getAbsoluteURL('/'); | |
| 98 | - $language = $this->languageFactory->getUserLanguage($user); | |
| 99 | -		$l = $this->languageFactory->get('settings', $language); | |
| 100 | - | |
| 101 | - $actor = $this->userSession->getUser(); | |
| 102 | -		if ($actor instanceof IUser) { | |
| 103 | -			if ($actor->getUID() !== $user->getUID()) { | |
| 104 | - // Admin changed the password through the user panel | |
| 105 | -				$text = $l->t('%1$s changed your password on %2$s.', [$actor->getDisplayName(), $instanceUrl]); | |
| 106 | - $event->setAuthor($actor->getUID()) | |
| 107 | - ->setSubject(Provider::PASSWORD_CHANGED_BY, [$actor->getUID()]); | |
| 108 | -			} else { | |
| 109 | - // User changed their password themselves through settings | |
| 110 | -				$text = $l->t('Your password on %s was changed.', [$instanceUrl]); | |
| 111 | - $event->setAuthor($actor->getUID()) | |
| 112 | - ->setSubject(Provider::PASSWORD_CHANGED_SELF); | |
| 113 | - } | |
| 114 | -		} else { | |
| 115 | -			if (\OC::$CLI) { | |
| 116 | - // Admin used occ to reset the password | |
| 117 | -				$text = $l->t('Your password on %s was reset by an administrator.', [$instanceUrl]); | |
| 118 | - $event->setSubject(Provider::PASSWORD_RESET); | |
| 119 | -			} else { | |
| 120 | - // User reset their password from Lost page | |
| 121 | -				$text = $l->t('Your password on %s was reset.', [$instanceUrl]); | |
| 122 | - $event->setSubject(Provider::PASSWORD_RESET_SELF); | |
| 123 | - } | |
| 124 | - } | |
| 125 | - | |
| 126 | - $this->activityManager->publish($event); | |
| 127 | - | |
| 128 | -		if ($user->getEMailAddress() !== null) { | |
| 129 | -			$template = $this->mailer->createEMailTemplate('settings.PasswordChanged', [ | |
| 130 | - 'displayname' => $user->getDisplayName(), | |
| 131 | - 'emailAddress' => $user->getEMailAddress(), | |
| 132 | - 'instanceUrl' => $instanceUrl, | |
| 133 | - ]); | |
| 134 | - | |
| 135 | -			$template->setSubject($l->t('Password for %1$s changed on %2$s', [$user->getDisplayName(), $instanceUrl])); | |
| 136 | - $template->addHeader(); | |
| 137 | -			$template->addHeading($l->t('Password changed for %s', [$user->getDisplayName()]), false); | |
| 138 | -			$template->addBodyText($text . ' ' . $l->t('If you did not request this, please contact an administrator.')); | |
| 139 | - $template->addFooter(); | |
| 140 | - | |
| 141 | - | |
| 142 | - $message = $this->mailer->createMessage(); | |
| 143 | - $message->setTo([$user->getEMailAddress() => $user->getDisplayName()]); | |
| 144 | - $message->useTemplate($template); | |
| 145 | - $this->mailer->send($message); | |
| 146 | - } | |
| 147 | - } | |
| 148 | - | |
| 149 | - /** | |
| 150 | - * @param IUser $user | |
| 151 | - * @param string|null $oldMailAddress | |
| 152 | - * @throws \InvalidArgumentException | |
| 153 | - * @throws \BadMethodCallException | |
| 154 | - */ | |
| 155 | -	public function onChangeEmail(IUser $user, $oldMailAddress) { | |
| 156 | - if ($oldMailAddress === $user->getEMailAddress() || | |
| 157 | -			$user->getLastLogin() === 0) { | |
| 158 | - // Email didn't really change or user didn't login, | |
| 159 | - // so don't create activities and emails. | |
| 160 | - return; | |
| 161 | - } | |
| 162 | - | |
| 163 | - $event = $this->activityManager->generateEvent(); | |
| 164 | -		$event->setApp('settings') | |
| 165 | -			->setType('personal_settings') | |
| 166 | - ->setAffectedUser($user->getUID()); | |
| 167 | - | |
| 168 | -		$instanceUrl = $this->urlGenerator->getAbsoluteURL('/'); | |
| 169 | - $language = $this->languageFactory->getUserLanguage($user); | |
| 170 | -		$l = $this->languageFactory->get('settings', $language); | |
| 171 | - | |
| 172 | - $actor = $this->userSession->getUser(); | |
| 173 | -		if ($actor instanceof IUser) { | |
| 174 | - $subject = Provider::EMAIL_CHANGED_SELF; | |
| 175 | -			if ($actor->getUID() !== $user->getUID()) { | |
| 176 | - $subject = Provider::EMAIL_CHANGED; | |
| 177 | - } | |
| 178 | -			$text = $l->t('Your email address on %s was changed.', [$instanceUrl]); | |
| 179 | - $event->setAuthor($actor->getUID()) | |
| 180 | - ->setSubject($subject); | |
| 181 | -		} else { | |
| 182 | -			if ($this->config->getAppValue('settings', 'disable_activity.email_address_changed_by_admin', 'no') === 'yes') { | |
| 183 | - return; | |
| 184 | - } | |
| 185 | -			$text = $l->t('Your email address on %s was changed by an administrator.', [$instanceUrl]); | |
| 186 | - $event->setSubject(Provider::EMAIL_CHANGED); | |
| 187 | - } | |
| 188 | - $this->activityManager->publish($event); | |
| 189 | - | |
| 190 | - | |
| 191 | -		if ($oldMailAddress !== null) { | |
| 192 | -			$template = $this->mailer->createEMailTemplate('settings.EmailChanged', [ | |
| 193 | - 'displayname' => $user->getDisplayName(), | |
| 194 | - 'newEMailAddress' => $user->getEMailAddress(), | |
| 195 | - 'oldEMailAddress' => $oldMailAddress, | |
| 196 | - 'instanceUrl' => $instanceUrl, | |
| 197 | - ]); | |
| 198 | - | |
| 199 | -			$template->setSubject($l->t('Email address for %1$s changed on %2$s', [$user->getDisplayName(), $instanceUrl])); | |
| 200 | - $template->addHeader(); | |
| 201 | -			$template->addHeading($l->t('Email address changed for %s', [$user->getDisplayName()]), false); | |
| 202 | -			$template->addBodyText($text . ' ' . $l->t('If you did not request this, please contact an administrator.')); | |
| 203 | -			if ($user->getEMailAddress()) { | |
| 204 | -				$template->addBodyText($l->t('The new email address is %s', [$user->getEMailAddress()])); | |
| 205 | - } | |
| 206 | - $template->addFooter(); | |
| 207 | - | |
| 208 | - | |
| 209 | - $message = $this->mailer->createMessage(); | |
| 210 | - $message->setTo([$oldMailAddress => $user->getDisplayName()]); | |
| 211 | - $message->useTemplate($template); | |
| 212 | - $this->mailer->send($message); | |
| 213 | - } | |
| 214 | - } | |
| 43 | + /** @var IActivityManager */ | |
| 44 | + protected $activityManager; | |
| 45 | + /** @var IGroupManager|\OC\Group\Manager */ | |
| 46 | + protected $groupManager; | |
| 47 | + /** @var IUserManager */ | |
| 48 | + protected $userManager; | |
| 49 | + /** @var IUserSession */ | |
| 50 | + protected $userSession; | |
| 51 | + /** @var IURLGenerator */ | |
| 52 | + protected $urlGenerator; | |
| 53 | + /** @var IMailer */ | |
| 54 | + protected $mailer; | |
| 55 | + /** @var IConfig */ | |
| 56 | + protected $config; | |
| 57 | + /** @var IFactory */ | |
| 58 | + protected $languageFactory; | |
| 59 | + | |
| 60 | + public function __construct(IActivityManager $activityManager, | |
| 61 | + IGroupManager $groupManager, | |
| 62 | + IUserManager $userManager, | |
| 63 | + IUserSession $userSession, | |
| 64 | + IURLGenerator $urlGenerator, | |
| 65 | + IMailer $mailer, | |
| 66 | + IConfig $config, | |
| 67 | +                                IFactory $languageFactory) { | |
| 68 | + $this->activityManager = $activityManager; | |
| 69 | + $this->groupManager = $groupManager; | |
| 70 | + $this->userManager = $userManager; | |
| 71 | + $this->userSession = $userSession; | |
| 72 | + $this->urlGenerator = $urlGenerator; | |
| 73 | + $this->mailer = $mailer; | |
| 74 | + $this->config = $config; | |
| 75 | + $this->languageFactory = $languageFactory; | |
| 76 | + } | |
| 77 | + | |
| 78 | + /** | |
| 79 | + * @param string $uid | |
| 80 | + * @throws \InvalidArgumentException | |
| 81 | + * @throws \BadMethodCallException | |
| 82 | + * @throws \Exception | |
| 83 | + */ | |
| 84 | +    public function onChangePassword($uid) { | |
| 85 | + $user = $this->userManager->get($uid); | |
| 86 | + | |
| 87 | +        if (!$user instanceof IUser || $user->getLastLogin() === 0) { | |
| 88 | + // User didn't login, so don't create activities and emails. | |
| 89 | + return; | |
| 90 | + } | |
| 91 | + | |
| 92 | + $event = $this->activityManager->generateEvent(); | |
| 93 | +        $event->setApp('settings') | |
| 94 | +            ->setType('personal_settings') | |
| 95 | + ->setAffectedUser($user->getUID()); | |
| 96 | + | |
| 97 | +        $instanceUrl = $this->urlGenerator->getAbsoluteURL('/'); | |
| 98 | + $language = $this->languageFactory->getUserLanguage($user); | |
| 99 | +        $l = $this->languageFactory->get('settings', $language); | |
| 100 | + | |
| 101 | + $actor = $this->userSession->getUser(); | |
| 102 | +        if ($actor instanceof IUser) { | |
| 103 | +            if ($actor->getUID() !== $user->getUID()) { | |
| 104 | + // Admin changed the password through the user panel | |
| 105 | +                $text = $l->t('%1$s changed your password on %2$s.', [$actor->getDisplayName(), $instanceUrl]); | |
| 106 | + $event->setAuthor($actor->getUID()) | |
| 107 | + ->setSubject(Provider::PASSWORD_CHANGED_BY, [$actor->getUID()]); | |
| 108 | +            } else { | |
| 109 | + // User changed their password themselves through settings | |
| 110 | +                $text = $l->t('Your password on %s was changed.', [$instanceUrl]); | |
| 111 | + $event->setAuthor($actor->getUID()) | |
| 112 | + ->setSubject(Provider::PASSWORD_CHANGED_SELF); | |
| 113 | + } | |
| 114 | +        } else { | |
| 115 | +            if (\OC::$CLI) { | |
| 116 | + // Admin used occ to reset the password | |
| 117 | +                $text = $l->t('Your password on %s was reset by an administrator.', [$instanceUrl]); | |
| 118 | + $event->setSubject(Provider::PASSWORD_RESET); | |
| 119 | +            } else { | |
| 120 | + // User reset their password from Lost page | |
| 121 | +                $text = $l->t('Your password on %s was reset.', [$instanceUrl]); | |
| 122 | + $event->setSubject(Provider::PASSWORD_RESET_SELF); | |
| 123 | + } | |
| 124 | + } | |
| 125 | + | |
| 126 | + $this->activityManager->publish($event); | |
| 127 | + | |
| 128 | +        if ($user->getEMailAddress() !== null) { | |
| 129 | +            $template = $this->mailer->createEMailTemplate('settings.PasswordChanged', [ | |
| 130 | + 'displayname' => $user->getDisplayName(), | |
| 131 | + 'emailAddress' => $user->getEMailAddress(), | |
| 132 | + 'instanceUrl' => $instanceUrl, | |
| 133 | + ]); | |
| 134 | + | |
| 135 | +            $template->setSubject($l->t('Password for %1$s changed on %2$s', [$user->getDisplayName(), $instanceUrl])); | |
| 136 | + $template->addHeader(); | |
| 137 | +            $template->addHeading($l->t('Password changed for %s', [$user->getDisplayName()]), false); | |
| 138 | +            $template->addBodyText($text . ' ' . $l->t('If you did not request this, please contact an administrator.')); | |
| 139 | + $template->addFooter(); | |
| 140 | + | |
| 141 | + | |
| 142 | + $message = $this->mailer->createMessage(); | |
| 143 | + $message->setTo([$user->getEMailAddress() => $user->getDisplayName()]); | |
| 144 | + $message->useTemplate($template); | |
| 145 | + $this->mailer->send($message); | |
| 146 | + } | |
| 147 | + } | |
| 148 | + | |
| 149 | + /** | |
| 150 | + * @param IUser $user | |
| 151 | + * @param string|null $oldMailAddress | |
| 152 | + * @throws \InvalidArgumentException | |
| 153 | + * @throws \BadMethodCallException | |
| 154 | + */ | |
| 155 | +    public function onChangeEmail(IUser $user, $oldMailAddress) { | |
| 156 | + if ($oldMailAddress === $user->getEMailAddress() || | |
| 157 | +            $user->getLastLogin() === 0) { | |
| 158 | + // Email didn't really change or user didn't login, | |
| 159 | + // so don't create activities and emails. | |
| 160 | + return; | |
| 161 | + } | |
| 162 | + | |
| 163 | + $event = $this->activityManager->generateEvent(); | |
| 164 | +        $event->setApp('settings') | |
| 165 | +            ->setType('personal_settings') | |
| 166 | + ->setAffectedUser($user->getUID()); | |
| 167 | + | |
| 168 | +        $instanceUrl = $this->urlGenerator->getAbsoluteURL('/'); | |
| 169 | + $language = $this->languageFactory->getUserLanguage($user); | |
| 170 | +        $l = $this->languageFactory->get('settings', $language); | |
| 171 | + | |
| 172 | + $actor = $this->userSession->getUser(); | |
| 173 | +        if ($actor instanceof IUser) { | |
| 174 | + $subject = Provider::EMAIL_CHANGED_SELF; | |
| 175 | +            if ($actor->getUID() !== $user->getUID()) { | |
| 176 | + $subject = Provider::EMAIL_CHANGED; | |
| 177 | + } | |
| 178 | +            $text = $l->t('Your email address on %s was changed.', [$instanceUrl]); | |
| 179 | + $event->setAuthor($actor->getUID()) | |
| 180 | + ->setSubject($subject); | |
| 181 | +        } else { | |
| 182 | +            if ($this->config->getAppValue('settings', 'disable_activity.email_address_changed_by_admin', 'no') === 'yes') { | |
| 183 | + return; | |
| 184 | + } | |
| 185 | +            $text = $l->t('Your email address on %s was changed by an administrator.', [$instanceUrl]); | |
| 186 | + $event->setSubject(Provider::EMAIL_CHANGED); | |
| 187 | + } | |
| 188 | + $this->activityManager->publish($event); | |
| 189 | + | |
| 190 | + | |
| 191 | +        if ($oldMailAddress !== null) { | |
| 192 | +            $template = $this->mailer->createEMailTemplate('settings.EmailChanged', [ | |
| 193 | + 'displayname' => $user->getDisplayName(), | |
| 194 | + 'newEMailAddress' => $user->getEMailAddress(), | |
| 195 | + 'oldEMailAddress' => $oldMailAddress, | |
| 196 | + 'instanceUrl' => $instanceUrl, | |
| 197 | + ]); | |
| 198 | + | |
| 199 | +            $template->setSubject($l->t('Email address for %1$s changed on %2$s', [$user->getDisplayName(), $instanceUrl])); | |
| 200 | + $template->addHeader(); | |
| 201 | +            $template->addHeading($l->t('Email address changed for %s', [$user->getDisplayName()]), false); | |
| 202 | +            $template->addBodyText($text . ' ' . $l->t('If you did not request this, please contact an administrator.')); | |
| 203 | +            if ($user->getEMailAddress()) { | |
| 204 | +                $template->addBodyText($l->t('The new email address is %s', [$user->getEMailAddress()])); | |
| 205 | + } | |
| 206 | + $template->addFooter(); | |
| 207 | + | |
| 208 | + | |
| 209 | + $message = $this->mailer->createMessage(); | |
| 210 | + $message->setTo([$oldMailAddress => $user->getDisplayName()]); | |
| 211 | + $message->useTemplate($template); | |
| 212 | + $this->mailer->send($message); | |
| 213 | + } | |
| 214 | + } | |
| 215 | 215 | } |