Commit Graph

62 Commits (8fdf2a7eae7ed26364b5ee09d1423847c2814526)

Author SHA1 Message Date
Ferdinand Thiessen fbef47a5d7
fix(AccountManager): Sanitize social media handles
Ensure to only accept valid X and fediverse handles.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-02-06 11:58:24 +07:00
John Molakvoæ (skjnldsv) 8fb64b886a
fix(settings): pronouns UsersControllerTest
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2024-09-18 13:30:33 +07:00
Christoph Wurst 49dd79eabb
refactor: Add void return type to PHPUnit test methods
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2024-09-15 22:32:31 +07:00
Daniel Kesselberg af6de04e9e
style: update codestyle for coding-standard 1.2.3
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-08-25 19:34:58 +07:00
Jake Nabasny f863290572
feat(ldap): sync additional properties to profile and SAB
Synced from LDAP to profile:
- Date of birth

Synced from LDAP to SAB (via the profile):
- Biography
- Date of birth

Original code by Jake Nabasny (GitHub: @slapcat)

Co-authored-by: Jake Nabasny <jake@nabasny.com>
Co-authored-by: Richard Steinmetz <richard@steinmetz.cloud>
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
2024-05-30 12:01:13 +07:00
Andy Scherzinger 1f7e2ba599
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-13 17:41:36 +07:00
Côme Chilliet ec5133b739 fix: Apply new coding standard to all files
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-02 14:16:21 +07:00
Joas Schilling 0956b493b6
fix(phonenumber): Use the newly introduced API to limit 3rdparty lib usage
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-09-25 15:54:21 +07:00
Joas Schilling 68fc9b48c2
feat!: Migrate AccountManager event to typed event
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-28 14:11:19 +07:00
Côme Chilliet f5c361cf44
composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-20 11:45:08 +07:00
Carl Schwan e35bcc9381 Fix tests
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-11-22 10:06:19 +07:00
Thomas Citharel 4d26a9afa0
Allow to tweak default scopes for accounts
Close #6582

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2022-05-16 22:54:51 +07:00
Carl Schwan eef973e85b Minor optimizations for saving user personal information
* 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)
2022-05-12 21:02:52 +07:00
Christopher Ng 108abd77ed Add profile default setting for admin
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2022-03-18 02:55:12 +07: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 +07: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 +07:00
Joas Schilling 172be810b8
Fix test
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-01-11 12:54:41 +07:00
Christopher Ng 19a3656fd9 Fix email verification
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2022-01-06 23:47:42 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07:00
Arthur Schiwon c7bf4295cc
adjust email verification checker
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-06-30 00:47:36 +07: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 +07: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 +07: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 +07: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 +07:00
Arthur Schiwon ff2382e5a4
CI: more flexible assertions
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-06-07 23:41:04 +07: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 +07:00
Arthur Schiwon 0bade27479
add IAccountPropertyCollection with implementation
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-06-03 20:49:49 +07:00
Arthur Schiwon afea57352b
update unit tests
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-06-03 20:49:49 +07: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 +07: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 +07: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 +07:00
Vincent Petry b73df5846c
Add property scope tests for AccountManager
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-03-26 13:07:09 +07: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 +07:00
Joas Schilling a609074c18
Fix Test class name
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-03-12 08:53:43 +07:00
Joas Schilling f0ca76aefb
Add and fix unit tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-12-07 14:19:38 +07:00
Joas Schilling da9462b482
Make code strict
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-12-07 14:19:37 +07: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 +07:00
Joas Schilling 4bc821edd9
PSR logger for accounts
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-10-20 17:41:47 +07: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 +07: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 +07: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 +07: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 +07: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 +07:00
Roeland Jago Douma 3a7cf40aaa
Mode to modern phpunit
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-27 15:27:18 +07:00
Roeland Jago Douma c007ca624f
Make phpunit8 compatible
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-27 13:34:41 +07:00