Commit Graph

117 Commits

Author SHA1 Message Date
Roeland Jago Douma 4a2775a442 Harden apptoken check
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2021-05-17 16:05:45 +02:00
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
2021-04-26 13:56:01 +02:00
Daniel Calviño Sánchez 67dd087ce4 Fix deleting properties of user settings when not given explicitly
The controller can receive an optional subset of the properties of the
user settings; values not given are set to "null" by default. However,
those null values overwrote the previously existing values, so in
practice any value not given was deleted from the user settings. Now
only non null values overwrite the previous values.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2021-04-23 11:44:41 +02:00
Daniel Calviño Sánchez ac0c18327e Fix TypeError when "email" is not given in the controller request
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2021-04-23 11:44:41 +02:00
Daniel Calviño Sánchez a7431817b9 Respect additional user settings not covered by the controller
"AccountManager::updateUser()" wipes previous user data with whichever
user data is given (except for some adjustments, like resetting the
verified status when needed). As the controller overrode the properties
those properties would lose some of their attributes even if they are
not affected by the changes made by the controller. Now the controller
only modifies the attributes set ("value" and "scope") to prevent that.

Note that with this change the controller no longer removes the
"verified" status, but this is not a problem because, as mentioned,
"AccountManager::updateUser()" resets them when needed (for example,
when the value of the website property changes).

This change is a previous step to fix overwritting properties with null
values, and it will prevent the controller from making unexpected
changes if more attributes are added in the future.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2021-04-23 11:44:41 +02:00
Daniel Calviño Sánchez 8cae515daa Use constants from interface rather than class
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2021-04-23 11:44:40 +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
Roeland Jago Douma bd2e6309b5
Merge pull request #25605 from nextcloud/trusted-proxy-warning-localhost
dont show trusted proxy warning when the proxy and remote are both localhost
2021-04-01 13:27:26 +02:00
Vincent Petry 5d14fd4396
Make extra user profile fields always editable
The fields for phone number, address, website and twitter are now
editable regardless whether federated sharing and the lookup server
are enabled or not.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-03-26 13:07:08 +01:00
Joas Schilling 61ed57b757
Rename some parameters and methods to make the API more clear
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-03-10 20:30:29 +01:00
Joas Schilling 07095fd122
Also clear the knownUser when changing via the settings endpoint
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-03-10 19:37:10 +01:00
Roeland Jago Douma 2afa1c5739
Merge pull request #25862 from nextcloud/techdept/psalm/some_loggers
Move away some ILoggers
2021-03-02 15:01:44 +01:00
Roeland Jago Douma 38f761f25f Move away some ILoggers
Makes psalm happier

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2021-03-02 10:47:25 +01:00
Roeland Jago Douma 3d0dff0d2b Fix lying docblocks
* typed the return
* removed unneeded temp variable

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2021-03-01 16:48:04 +01:00
dependabot-preview[bot] eb502c02ff
Bump nextcloud/coding-standard from 0.3.0 to 0.5.0
Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 0.3.0 to 0.5.0.
- [Release notes](https://github.com/nextcloud/coding-standard/releases)
- [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nextcloud/coding-standard/compare/v0.3.0...v0.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-02-18 13:31:24 +01:00
Roeland Jago Douma bd8b1786c5 Some psalm fixes in the settings app
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2021-02-15 10:00:35 +01:00
Roeland Jago Douma 7d8e9baa77
Revert "use the configured forwarded headers for the setup check" 2021-02-13 18:03:32 +01:00
Robin Appelman 01118a2218
use the configured forwarded headers for the setup check
instead of always checking against the same header

Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-02-12 14:22:27 +01:00
Robin Appelman cc0cc68c8d
dont show trusted proxy warning when the proxy and remote are both localhost
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-02-12 13:32:51 +01:00
Christoph Wurst c1d4f8161b
Migrate internal classes to the OCP db col types
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-01-12 14:09:13 +01:00
Roeland Jago Douma 6c8f2dc7bc
Merge pull request #25016 from nextcloud/enh/noid/add-check-for-unsupported-db
Add setup check to verify that the used DB version is still supported…
2021-01-11 14:21:42 +01:00
Morris Jobke 24d436cb60
Remove unneeded casts that were found by Psalm
In preparation of the update of Psalm from 4.2.1 to 4.3.1+ (see https://github.com/nextcloud/server/pull/24521)

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2021-01-11 13:14:41 +01:00
Morris Jobke bffa61fc32
Add setup check to verify that the used DB version is still supported in the next major release
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2021-01-08 13:38:32 +01:00
Christoph Wurst 8b64e92b92
Bump doctrine/dbal from 2.12.0 to 3.0.0
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-01-08 11:45:19 +01:00
Christoph Wurst 90d0732828
Fix updating user settings
The requests dispatched from the personal settings page don't always
send all the possible params but just a subset. Hence requests currently
fail on master e.g. when you update your email. This makes the arguments
optional again.

Regression of da9462b482

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-01-05 12:59:50 +01:00
Christoph Wurst 9ce3ea3368
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-12-30 14:07:05 +01:00
Roeland Jago Douma adc4f1a811
Merge pull request #22916 from J0WI/unifiy-links-to-php.net
Unify links to php.net
2020-12-22 09:53:31 +01:00
Christoph Wurst d89a75be0b
Update all license headers for Nextcloud 21
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-12-16 18:48:22 +01:00
Julius Härtl a0444bc69c
Merge pull request #24247 from nextcloud/bugfix/noid/ocm-providerId-string 2020-12-09 17:25:59 +01:00
Julius Härtl 8f6c2ec357
Move columns to bigint
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-12-08 16:05:53 +01:00
Joas Schilling f648635758
Make the throwing optional, so background tasks don't break
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-12-07 14:19:38 +01:00
Joas Schilling 46b073d7ce
Add a config for default region of phone numbers
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-12-07 14:19:38 +01:00
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>
2020-12-07 14:19:38 +01:00
Joas Schilling efe79f2937
Validate and standardize the phone number on saving
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-12-07 14:19:37 +01:00
Joas Schilling c2913f18d2
Also return the phone number and twitter handle on the API
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-12-07 14:19:37 +01:00
Joas Schilling da9462b482
Make code strict
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-12-07 14:19:37 +01:00
Morris Jobke fe79a1ad3e
Harden setup check for TLS version if host is not reachable
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-12-02 13:17:05 +01:00
Joas Schilling d5df033ede
Create primary keys on all tables and add a command to create the afterwards
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-11-10 15:36:27 +01:00
Morris Jobke a223f603f9
Simplify the check if admin can change password based on encryption status
Found by Psalm:
```
/home/runner/work/server/server/apps/settings/lib/Controller/UsersController.php:324:8:error - RedundantCondition: Type true for $isEncryptionModuleLoaded is never falsy
```

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-11-05 22:20:34 +01:00
Morris Jobke 1c496a5a35
Add a background job that checks for potential user imported SSL certificates and shows a warning in the admin settings
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-11-03 10:06:33 +01:00
nhirokinet 830348dbee
Add SVG support check to setup check
Signed-off-by: nhirokinet <nhirokinet@nhiroki.net>
2020-11-02 11:29:08 +01:00
Morris Jobke b8ed997238
Remove ISection in favor of IIconSection
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-10-28 23:05:00 +01:00
Roeland Jago Douma 28d82394f1
Merge pull request #23720 from nextcloud/lowercase-email
save email as lower case
2020-10-27 20:14:43 +01:00
Robin Appelman cbd6e65678
save email as lower case
email addresses are case insensitive

Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-10-27 14:56:52 +01:00
timm2k 60efad45cf
Update CheckSetupController.php 2020-10-26 09:42:01 +01:00
Roeland Jago Douma 0dbb99a81b
Merge pull request #23161 from nextcloud/enh/noid/setup-checks2
Remove setup check for php mail
2020-10-08 22:40:37 +02:00
Christoph Wurst d9015a8c94
Format code to a single space around binary operators
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-10-05 20:25:24 +02:00
Daniel Kesselberg 9c8e8007f9
Remove setup check for php mail
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2020-10-03 21:58:55 +02:00
J0WI 68ce17e59b Unify links to php.net
Update all links to https://www.php.net/

Signed-off-by: J0WI <J0WI@users.noreply.github.com>
2020-09-17 17:40:04 +02:00
Roeland Jago Douma 05edd1e5d6
Merge pull request #22890 from nextcloud/techdebt/18680/help-static-code-analysis-understand-code
Help static code analysis to understand code
2020-09-17 08:51:20 +02:00