Commit Graph

49 Commits

Author SHA1 Message Date
Christopher Ng
108abd77ed Add profile default setting for admin
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2022-03-18 02:55:12 +00:00
Christopher Ng
2d9d0702f0 Add method to set all account properties from json
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2022-03-17 16:33:19 +00:00
Christopher Ng
a99d33c72d Discard duplicate collection name from account serialization
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2022-03-17 04:27:39 +00:00
Joas Schilling
172be810b8
Fix test
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-01-11 12:54:41 +01:00
Christopher Ng
19a3656fd9 Fix email verification
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2022-01-06 23:47:42 +00:00
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>
2021-10-22 23:05:43 +02:00
John Molakvoæ
c98039c1df
Merge pull request #26725 from nextcloud/fix-federated-scope-not-shown-when-public-addressbook-upload-is-disabled 2021-10-22 11:52:56 +02:00
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>
2021-10-19 04:44:40 +00:00
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>
2021-09-09 14:03:35 +02:00
Daniel Calviño Sánchez
83b39d6111 Add missing scope to test
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2021-08-18 19:05:33 +02:00
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>
2021-06-30 00:48:01 +02:00
Arthur Schiwon
c7bf4295cc
adjust email verification checker
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-06-30 00:47:36 +02:00
Arthur Schiwon
3d6ffd3da2
adjust verification state updater method
- also fixes scope of internal methods

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-06-30 00:42:42 +02:00
Arthur Schiwon
af3fdbea7b
make AccountManager actually write multi value properties
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-06-30 00:41:12 +02:00
Arthur Schiwon
638c04d6e0
accounts event handler to use eventdispatcher, DI and Accounts API
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-06-30 00:41:11 +02:00
Arthur Schiwon
13818005a3
prov api reports additional emails on getUser
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-06-30 00:41:10 +02:00
Arthur Schiwon
ff2382e5a4
CI: more flexible assertions
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-06-07 23:41:04 +02:00
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>
2021-06-03 20:49:49 +02:00
Arthur Schiwon
0bade27479
add IAccountPropertyCollection with implementation
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-06-03 20:49:49 +02:00
Arthur Schiwon
afea57352b
update unit tests
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-06-03 20:49:49 +02:00
Arthur Schiwon
847ed37afc
do not use private AccountManager in UsersController
- extends IAccountProperty for verificationData getters and setters
- implementation thereof ^
- and of course adaption of UsersController

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-05-25 14:35:38 +02:00
Arthur Schiwon
8413ed9475
allow to set valid scopes only in AccountProperty
the auto-fallback to v2-local is removed as well to react on wrong input

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-05-12 01:31:15 +02:00
Joas Schilling
d80cc76ee7
Validate the website field input to be a valid URL
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-04-22 16:34:13 +02:00
Vincent Petry
b73df5846c
Add property scope tests for AccountManager
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-03-26 13:07:09 +01:00
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>
2021-03-26 13:07:08 +01:00
Joas Schilling
a609074c18
Fix Test class name
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-03-12 08:53:43 +01:00
Joas Schilling
f0ca76aefb
Add and fix unit tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-12-07 14:19:38 +01:00
Joas Schilling
da9462b482
Make code strict
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-12-07 14:19:37 +01:00
Joas Schilling
8027dcbc6f
Don't leave cursors open when tests fail
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-11-09 12:28:17 +01:00
Joas Schilling
4bc821edd9
PSR logger for accounts
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-10-20 17:41:47 +02:00
Morris Jobke
234b510652
Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to \PHPUnit\Framework\MockObject\MockObject
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-12 13:55:19 +02:00
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>
2020-04-10 14:19:56 +02:00
Christoph Wurst
41b5e5923a
Use exactly one empty line after the namespace declaration
For PSR2

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 11:48:10 +02:00
Christoph Wurst
2fbad1ed72
Fix (array) indent style to always use one tab
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 10:16:08 +02:00
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>
2019-12-13 12:39:29 +01:00
Roeland Jago Douma
3a7cf40aaa
Mode to modern phpunit
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-27 15:27:18 +01:00
Roeland Jago Douma
c007ca624f
Make phpunit8 compatible
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-27 13:34:41 +01:00
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>
2019-11-22 20:52:10 +01:00
Julius Härtl
b9a87a69cf
Use IAccountManager constants
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2018-10-15 13:30:31 +02:00
Julius Härtl
9381e681a9
Add tests for new account api classes
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2018-10-15 13:30:31 +02:00
Morris Jobke
43e498844e
Use ::class in test mocks
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-10-24 17:45:32 +02:00
Bjoern Schiessle
5fa0e6df39
fix email verification status
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2017-04-28 23:41:37 -03:00
Bjoern Schiessle
71657db4be
updated unit tests
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2017-04-28 23:41:36 -03:00
Lukas Reschke
afb5d45705 Merge pull request #4256 from nextcloud/theming
Move OC_Defaults to OCP\Defaults
2017-04-11 14:39:46 +02:00
Joas Schilling
bc217cdf87
Also send the new account data with the event
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-04-10 10:22:57 +02:00
Morris Jobke
5b4adf66e5
Move OC_Defaults to OCP\Defaults
* currently there are two ways to access default values:
  OCP\Defaults or OC_Defaults (which is extended by
  OCA\Theming\ThemingDefaults)
* our code used a mixture of both of them, which made
  it hard to work on theme values
* this extended the public interface with the missing
  methods and uses them everywhere to only rely on the
  public interface

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-04-09 21:43:01 -05:00
Bjoern Schiessle
0de685c562
bring back setEmailAddress for the user management
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2016-11-25 10:26:48 +01:00
Bjoern Schiessle
3fc75073b8
update accounts table if email address or display name changes from outside
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2016-11-25 10:26:47 +01:00
Bjoern Schiessle
08e6541a88
fix unit tests
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2016-11-21 11:29:58 +01:00