summaryrefslogtreecommitdiffstats
path: root/lib/private/Accounts/AccountManager.php
Commit message (Collapse)AuthorAgeFilesLines
* Fix exception handling when profile data is too longJoas Schilling2022-06-121-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* 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>
* Add a database table for the accounts data so we can search it betterJoas Schilling2020-12-071-2/+47
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Make code strictJoas Schilling2020-12-071-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* PSR logger for accountsJoas Schilling2020-10-201-10/+3
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Only run the query to get the account data onceJoas Schilling2020-10-061-5/+7
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Create account structure also for empty recordDaniel Kesselberg2020-05-171-1/+1
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-101-10/+7
| | | | | | | | | | | | | | | To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headers for 18Christoph Wurst2019-12-201-1/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Log critical fallback to user default if we can't parse the JSONChristoph Wurst2019-12-131-2/+13
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Return a default user record if json is brokenDaniel Kesselberg2019-12-131-0/+3
| | | | | | | It's possible that json_decode returns null. Mostly the json is broken. AddMissingDefaultValues expects an array. Pass null will fail. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Update license headersChristoph Wurst2019-12-051-1/+4
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Some php-cs fixesRoeland Jago Douma2019-11-221-2/+1
| | | | | | | | | | | * Order the imports * No leading slash on imports * Empty line before namespace * One line per import * Empty after imports * Emmpty line at bottom of file Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Move settings to an appChristoph Wurst2019-09-281-1/+1
| | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at> Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
* Add default values when parsing account dataJulius Härtl2018-12-231-1/+1
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>