aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Accounts
Commit message (Collapse)AuthorAgeFilesLines
* Rename mastodon to fediverseCarl Schwan2022-11-221-4/+4
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Add mastodon personal info fieldCarl Schwan2022-11-211-0/+9
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Cleanup tags and Share componentCarl Schwan2022-09-291-0/+3
| | | | | | | | | - Port to LoggerInterface - Use IDBConnection and IQueryBuilder instead of raw SQL and OC_DB - Use IEventListener instead of hooks - Remove the now unused OC_DB and OC_DB_StatementWrapper legacy utils Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Move CappedMemoryCache to OCPCarl Schwan2022-07-141-1/+1
| | | | | | | | This is an helpful helper that should be used in more place than just server and this is already the case with groupfodlers, deck, user_oidc and more using it, so let's make it public Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Fix exception handling when profile data is too longJoas Schilling2022-06-091-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Allow to tweak default scopes for accountsThomas Citharel2022-05-161-25/+37
| | | | | | Close #6582 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* Minor optimizations for saving user personal informationCarl Schwan2022-05-121-9/+9
| | | | | | | | | | | | | | | | * Remove double hook: the OC_User::changeUser triggers an OC\AccountManager::userUpdated and the app is already listening to this signal in its Application definition * Make createCard not check if an card exists if we already checked previously. We also don't try to get the card if the user is disabled as we don't use the card in this case We this change we go from 100 DB requests to 80 DB requests when saving an user email address. Signed-off-by: Carl Schwan <carl@carlschwan.eu> (cherry picked from commit c6fd482edf33214a9ad4787e4cac278f871fa7c8)
* Cache account informationCarl Schwan2022-04-051-1/+10
| | | | | | | | | | | | | Currently, each field of the profile settings is fetching the account information. This patch makes it so that only the first time do a DB call and all the later ones are cached. Reduce by 5 queries when loading the profile setting page and I suppose other pages are affected since loading a page generates always fetch at least once the account information to see if the profile feature is enabled for the user. Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Add profile default setting for adminChristopher Ng2022-03-181-1/+4
| | | | Signed-off-by: Christopher Ng <chrng8@gmail.com>
* Add method to set all account properties from jsonChristopher Ng2022-03-171-0/+22
| | | | Signed-off-by: Christopher Ng <chrng8@gmail.com>
* Discard duplicate collection name from account serializationChristopher Ng2022-03-171-2/+9
| | | | Signed-off-by: Christopher Ng <chrng8@gmail.com>
* Merge pull request #30508 from nextcloud/fix/psaml-binCarl Schwan2022-01-131-1/+1
|\ | | | | Fix psalm not running
| * Check style updateCarl Schwan2022-01-131-1/+1
| | | | | | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* | Fix undefined/unset scope in account propertiesJoas Schilling2022-01-111-0/+1
| | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* | Fix email verificationChristopher Ng2022-01-061-1/+4
|/ | | | Signed-off-by: Christopher Ng <chrng8@gmail.com>
* Obey col length of 255 to insert and search in accounts_dataArthur Schiwon2021-11-261-1/+8
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Fix ArrayAccess and JsonSerializable return typesCôme Chilliet2021-11-233-3/+4
| | | | | | First round of modifications for PHP 8.1 Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix populating account array with missing default valuesArthur Schiwon2021-10-221-6/+7
| | | | | | | | - both $userData and $defaultUserData have numeric indices - each element contains at least the name and other fields - appending the missing data array is sufficient Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Add new account propertiesChristopher Ng2021-10-192-13/+53
| | | | | | | | | | | | | | - New properties - Organisation - Role - Headline - Biography - Profile Enabled property - Fix errors with building default account properties - Fix L10N factory method `getLanguage` not public error - Update tests Signed-off-by: Christopher Ng <chrng8@gmail.com>
* implement verification for additional mailsArthur Schiwon2021-09-093-11/+150
| | | | | | | | | | | | - mails added by (sub)admins are automatically verified - provisioning_api controller as verification endpoint - IAccountProperty gets a locallyVerified property - IPropertyCollection gets a method to fetch an IAccountProperty by value - an remove equivalent was already present - AccountManager always initiates mail verification on update if necessary - add core success template for arbitrary title and message Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* cleanupArthur Schiwon2021-06-301-7/+3
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* adjust internal data handling logic to fix store and loadArthur Schiwon2021-06-302-132/+147
| | | | | | - format as stored previously in oc_accounts table is kept Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* adjust email verification checkerArthur Schiwon2021-06-301-16/+18
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* fix code styleArthur Schiwon2021-06-302-2/+2
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* adjust verification state updater methodArthur Schiwon2021-06-301-70/+33
| | | | | | - also fixes scope of internal methods Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* make AccountManager actually write multi value propertiesArthur Schiwon2021-06-301-98/+145
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* accounts event handler to use eventdispatcher, DI and Accounts APIArthur Schiwon2021-06-301-39/+28
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* prov api to be able to edit multivalue propertiesArthur Schiwon2021-06-301-0/+13
| | | | | | | - adding as usual - deleting and scope setting via additional endpoint Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* prov api reports additional emails on getUserArthur Schiwon2021-06-301-2/+26
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Merge pull request #27189 from ↵blizzz2021-06-084-57/+273
|\ | | | | | | | | nextcloud/feat/26866/account-collection-properties Extend Accounts with multivalue properties (PropertyCollection)
| * psalm happinessArthur Schiwon2021-06-042-2/+2
| | | | | | | | | | | | | | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de> psalm happiness Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
| * adjust property type declarationArthur Schiwon2021-06-031-1/+1
| | | | | | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
| * fix code styleArthur Schiwon2021-06-033-3/+2
| | | | | | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
| * allow interacting with IAccountPropertyCollectionsArthur Schiwon2021-06-034-14/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | - in fact the API could be done in a nicer way and it might be possible to work without IAccountPropertyCollection, but only with the IAccountProperties. - To keep it simple at first and not overengineer the blunt attempt is followed - If necessary helpful in the further cause of development adjustements or extensions can be done quickly with this base Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
| * add IAccountPropertyCollection with implementationArthur Schiwon2021-06-031-0/+86
| | | | | | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
| * deal with property collections when fetching users (with update)Arthur Schiwon2021-06-031-14/+39
| | | | | | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
| * refactor validators and sanitizersArthur Schiwon2021-06-031-35/+57
| | | | | | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* | Update php licensesJohn Molakvoæ (skjnldsv)2021-06-044-7/+9
|/ | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* do not use private AccountManager in UsersControllerArthur Schiwon2021-05-252-4/+17
| | | | | | | | - extends IAccountProperty for verificationData getters and setters - implementation thereof ^ - and of course adaption of UsersController Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* allow to set valid scopes only in AccountPropertyArthur Schiwon2021-05-121-11/+20
| | | | | | the auto-fallback to v2-local is removed as well to react on wrong input Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Merge pull request #26259 from ↵Joas Schilling2021-04-261-0/+30
|\ | | | | | | | | nextcloud/feature/noid/validate-website-to-be-valid Validate the website field input to be a valid URL
| * Validate the website field input to be a valid URLJoas Schilling2021-04-221-0/+30
| | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* | Guard against null phone number valueDaniel Calviño Sánchez2021-04-231-0/+3
|/ | | | | | | "parsePhoneNumber()" expects a string, so a TypeError would be thrown if the phone number value is null. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Limit size of properties to 2048 charactersLukas Reschke2021-04-081-0/+11
| | | | | | | | | It is unreasonable to expect that one of these fields would be longer than 2048 characters. Whilst some have definitely lower limits (such as for phone numbers or domain names), a upper bound as sanity check makes sense. Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* Allow apps to write/update account dataJoas Schilling2021-03-311-0/+14
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Add property scope tests for AccountManagerVincent Petry2021-03-261-6/+13
| | | | Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* OCS allow reading and writing account property scopesVincent Petry2021-03-262-2/+33
| | | | | | | Extends the provisioning API to allow a user to get and set their own account property scopes. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Map old account scope properties to new namesVincent Petry2021-03-262-10/+28
| | | | | | | | Use new scope values in settings page. Adjust all consumers to use the new constants. Map old scope values to new ones in account property getter. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Chunk the array of phone numbersJoas Schilling2021-03-121-5/+9
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Update all license headers for Nextcloud 21Christoph Wurst2020-12-161-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>