Commit Graph

63 Commits (6312c0df6949955d1cd59c3dd444268e0773293c)

Author SHA1 Message Date
Carl Schwan 6312c0df69
Check style update
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2 years ago
Arthur Schiwon 998144f832
Obey col length of 255 to insert and search in accounts_data
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
3 years ago
Arthur Schiwon e26d6f080b
fix populating account array with missing default values
- 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>
3 years ago
Christopher Ng 7215148a24 Add new account properties
- 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>
3 years ago
Arthur Schiwon aacaad2a3f
implement verification for additional mails
- 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>
3 years ago
Arthur Schiwon ad0a11b2bf
cleanup
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
3 years ago
Arthur Schiwon 506227b509
adjust internal data handling logic to fix store and load
- format as stored previously in oc_accounts table is kept

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
3 years ago
Arthur Schiwon c7bf4295cc
adjust email verification checker
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
3 years ago
Arthur Schiwon d64411e9df
fix code style
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
3 years ago
Arthur Schiwon 3d6ffd3da2
adjust verification state updater method
- also fixes scope of internal methods

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
3 years ago
Arthur Schiwon af3fdbea7b
make AccountManager actually write multi value properties
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
3 years ago
Arthur Schiwon 13818005a3
prov api reports additional emails on getUser
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
3 years ago
blizzz 662ab937e0
Merge pull request #27189 from nextcloud/feat/26866/account-collection-properties
Extend Accounts with multivalue properties (PropertyCollection)
3 years ago
John Molakvoæ (skjnldsv) 215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
3 years ago
Arthur Schiwon 35d5395089
psalm happiness
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>

psalm happiness

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
3 years ago
Arthur Schiwon 2701c3e7dc
fix code style
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
3 years ago
Arthur Schiwon 44827e37c0
allow interacting with IAccountPropertyCollections
- 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>
3 years ago
Arthur Schiwon 839bff1641
deal with property collections when fetching users (with update)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
3 years ago
Arthur Schiwon 956bfba2e2
refactor validators and sanitizers
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
3 years ago
Joas Schilling aa651fd629
Merge pull request #26259 from nextcloud/feature/noid/validate-website-to-be-valid
Validate the website field input to be a valid URL
3 years ago
Daniel Calviño Sánchez 7159a70894 Guard against null phone number value
"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>
3 years ago
Joas Schilling d80cc76ee7
Validate the website field input to be a valid URL
Signed-off-by: Joas Schilling <coding@schilljs.com>
3 years ago
Lukas Reschke 2befac662c Limit size of properties to 2048 characters
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>
3 years ago
Joas Schilling fcedbc85d0
Allow apps to write/update account data
Signed-off-by: Joas Schilling <coding@schilljs.com>
3 years ago
Vincent Petry b73df5846c
Add property scope tests for AccountManager
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
3 years ago
Vincent Petry 266a6fb5f8
OCS allow reading and writing account property scopes
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>
3 years ago
Vincent Petry 278a73789e
Map old account scope properties to new names
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>
3 years ago
Joas Schilling 2e08c8b5a1
Chunk the array of phone numbers
Signed-off-by: Joas Schilling <coding@schilljs.com>
3 years ago
Joas Schilling f648635758
Make the throwing optional, so background tasks don't break
Signed-off-by: Joas Schilling <coding@schilljs.com>
4 years ago
Joas Schilling 46b073d7ce
Add a config for default region of phone numbers
Signed-off-by: Joas Schilling <coding@schilljs.com>
4 years ago
Joas Schilling 9e04e6f99a
Also translate the phone number when coming in via the accounts manager API directly
Signed-off-by: Joas Schilling <coding@schilljs.com>
4 years ago
Joas Schilling fe9c46e595
Add an endpoint to search for accounts based on phone number
Signed-off-by: Joas Schilling <coding@schilljs.com>
4 years ago
Joas Schilling eaba155a09
Add a database table for the accounts data so we can search it better
Signed-off-by: Joas Schilling <coding@schilljs.com>
4 years ago
Joas Schilling da9462b482
Make code strict
Signed-off-by: Joas Schilling <coding@schilljs.com>
4 years ago
Joas Schilling 4bc821edd9
PSR logger for accounts
Signed-off-by: Joas Schilling <coding@schilljs.com>
4 years ago
Joas Schilling ac59f23daa
Only run the query to get the account data once
Signed-off-by: Joas Schilling <coding@schilljs.com>
4 years ago
Daniel Kesselberg c6f770ea59
Create account structure also for empty record
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
4 years ago
Christoph Wurst caff1023ea
Format control structures, classes, methods and function
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>
4 years ago
Christoph Wurst 1b46621cd3
Update license headers for 18
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
5 years ago
Christoph Wurst b97d90e0c3
Log critical fallback to user default if we can't parse the JSON
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
5 years ago
Daniel Kesselberg bbe41a73dd
Return a default user record if json is broken
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>
5 years ago
Christoph Wurst 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
5 years ago
Roeland Jago Douma 68748d4f85
Some php-cs fixes
* 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>
5 years ago
Christoph Wurst de6940352a Move settings to an app
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
5 years ago
Julius Härtl 0f911e2d13
Add default values when parsing account data
Signed-off-by: Julius Härtl <jus@bitgrid.net>
6 years ago
Julius Härtl 3b3824c486
Use empty string instead of null
Signed-off-by: Julius Härtl <jus@bitgrid.net>
6 years ago
Julius Härtl d05080f56a
Add \OCP\Account public API
Signed-off-by: Julius Härtl <jus@bitgrid.net>
6 years ago
Morris Jobke eb51f06a3b
Use ::class statement instead of string
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
6 years ago
Morris Jobke 0eebff152a
Update license headers
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
7 years ago
Joas Schilling 975e572a3d
Remove account data on user deletion
Signed-off-by: Joas Schilling <coding@schilljs.com>
7 years ago