aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Accounts/AccountManager.php
Commit message (Collapse)AuthorAgeFilesLines
* Renames the property to improve the code readbility/clarity.Faraz Samapoor2023-07-051-2/+2
| | | | | | | | Based on: https://github.com/nextcloud/server/pull/38978#pullrequestreview-1514202944 Co-authored-by: Arthur Schiwon <blizzz@arthur-schiwon.de> Signed-off-by: Faraz Samapoor <fsa@adlas.at>
* Fixes testcase errors.Faraz Samapoor2023-07-021-8/+9
| | | | Signed-off-by: Faraz Samapoor <fsa@adlas.at>
* Fixes Psalm error.Faraz Samapoor2023-07-011-4/+1
| | | | Signed-off-by: Faraz Samapoor <fsa@adlas.at>
* Refactors lib/private/Accounts.Faraz Samapoor2023-07-011-72/+18
| | | | | | Mainly using PHP8's constructor property promotion. Signed-off-by: Faraz Samapoor <fsa@adlas.at>
* fix(caching): Avoid checking existence before fetchingChristoph Wurst2023-06-121-2/+3
| | | | | | | | The cache might expire between checking for key existence and fetching the value. In this rare case the code continues with a null value when it doesn't expect one. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #38261 from fsamapoor/replace_strpos_calls_in_lib_privateRobin Appelman2023-06-011-1/+1
|\ | | | | Refactors "strpos" calls in lib/private to improve code readability.
| * Refactors "strpos" calls in lib/private to improve code readability.Faraz Samapoor2023-05-151-1/+1
| | | | | | | | Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
* | fix(CI): Satisfy psalm by removing a now obsolete type checkJoas Schilling2023-05-311-2/+1
|/ | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* 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>
* 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>
* 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 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 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-191-12/+48
| | | | | | | | | | | | | | - 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-091-10/+121
| | | | | | | | | | | | - 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-301-126/+137
| | | | | | - 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-301-1/+1
| | | | 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>
* 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-081-49/+89
|\ | | | | | | | | nextcloud/feat/26866/account-collection-properties Extend Accounts with multivalue properties (PropertyCollection)
| * psalm happinessArthur Schiwon2021-06-041-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de> psalm happiness Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
| * fix code styleArthur Schiwon2021-06-031-1/+1
| | | | | | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
| * allow interacting with IAccountPropertyCollectionsArthur Schiwon2021-06-031-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | - 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>
| * 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-041-1/+3
|/ | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* 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-261-1/+32
| | | | | | | 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-261-8/+8
| | | | | | | | 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>
* Make the throwing optional, so background tasks don't breakJoas Schilling2020-12-071-3/+11
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Add a config for default region of phone numbersJoas Schilling2020-12-071-12/+36
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Also translate the phone number when coming in via the accounts manager API ↵Joas Schilling2020-12-071-2/+26
| | | | | | directly Signed-off-by: Joas Schilling <coding@schilljs.com>
* Add an endpoint to search for accounts based on phone numberJoas Schilling2020-12-071-0/+19
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>