Commit Graph

300 Commits (54b6d0708bcf389857fdc7e0afe8f0edcf8ea3f3)

Author SHA1 Message Date
Joas Schilling 144514e49e
Fix avatar cleanup on user delete
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-09-19 21:36:50 +07:00
Vincent Petry 25888a3d42
Merge pull request #34073 from nextcloud/login-email-filter
dont try email login if the provider username is not a valid email
2022-09-16 14:54:24 +07:00
Maxence Lange 381eb046b5
Merge pull request #33793 from nextcloud/fix/noid/rtrim-cloud-id
rtrim cloudId url earlier
2022-09-15 10:46:39 +07:00
Robin Appelman 1fbb951691
dont try email login if the provider username is not a valid email
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-09-14 14:04:13 +07:00
Louis Chemineau 6c11944679 I dug into it again, and the issue is much simpler than I previously though.
- LDAP has an email address with capital letters
- NC store this address in lower case
- When the user logs in, we compare the [stored email with the new lower case email](https://github.com/nextcloud/server/blob/master/lib/private/AllConfig.php#L259-L261) before storing it. Here, both email will be the same, so we won't store the new email address with upper case letters. Which is what we want.
- We then [compare emails as they are before triggering an event](https://github.com/nextcloud/server/blob/master/lib/private/User/User.php#L202-L204), they won't match, so the user will receive an email signaling an email change every time he logs in.

The fix is to compare the old email with the new lower case email before sending the event.

Signed-off-by: Louis Chemineau <louis@chmn.me>
2022-09-06 13:18:07 +07:00
Vincent Petry 253c0641b1
Merge pull request #33625 from nextcloud/fix/33572/add-user
Fix creation of new user and display the correct error message
2022-09-01 17:07:13 +07:00
Maxence Lange c37bad1ce4 rtrim url earlier
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2022-09-01 11:32:14 +07:00
blizzz 2020c15303
Merge pull request #33780 from nextcloud/enh/noid/cloud-id-cli
filter index.php from cloudId
2022-09-01 13:35:50 +07:00
Maxence Lange c4bdc1cfbc filter index.php from cloudId
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2022-08-31 18:33:09 +07:00
Christoph Wurst 0184fbe86b
Log if cookie login failed with token mismatch or session unavailability
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2022-08-31 14:55:51 +07:00
Christopher Ng d59585974e Fix creation of new user and display the correct error message
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2022-08-22 19:13:11 +07:00
Carl Schwan 8004aa7721
Make DisplayNameCache return null if user doesn't exists
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-08-16 14:10:05 +07:00
Carl Schwan 51b9847fad
Merge branch 'master' into display-name-cache-public
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-08-15 15:28:30 +07:00
Robin Appelman 9e34a21129
only update last login timestamp with minute percision
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-07-20 16:43:42 +07:00
Carl Schwan d5c23dbb9f Move CappedMemoryCache to OCP
This is an helpful helper that should be used in more place than just
server and this is already the case with groupfodlers, deck, user_oidc
and more using it, so let's make it public

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-07-14 15:54:31 +07:00
Carl Schwan 16b5e6bc7f
Merge pull request #32973 from nextcloud/cleanup/avatar-code
Cleanup avatar related code
2022-07-11 11:56:39 +07:00
Carl Schwan ec5cbdeb7f Make Color class public
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-07-05 14:44:44 +07:00
Christopher Ng c0868f93f1 Do not save invalid display name to the database
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2022-06-28 18:03:15 +07:00
Carl Schwan 812016d626 Cleanup avatar related code
- Move event listener to new event handling
- Add typing almost everywhere
- Fix inconsistent interface parameter

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-06-22 16:11:42 +07:00
Joas Schilling 6e3d668436
Keep non default protocol in cloud id
When there is no protocol on the cloud id, we assume it's https://
But this means that when an http:// server currently sends an OCM
invite to another server, the protocol is striped and the remote
instance will try to talk back to https:// which might not be available.

Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-06-09 15:23:05 +07:00
Carl Schwan 9ec0cb0a90 Fix psalm issues related to the user backend
- Reflect the actual return value returned by the implementation in the
  the interface. E.g. IUser|bool -> IUser|false
- Remove $hasLoggedIn parameter from private countUser implementation.
  Replace the two call with the equivalent countSeenUser
- getBackend is nuallable, add this to the interface
- Use backend interface to make psalm happy about call to undefined
  methods. Also helps with getting rid at some point of the old
  implementActions

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-05-20 17:14:58 +07:00
Robin Appelman 6d6662ec68
expose displayname cache trough a public interface
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-05-18 03:47:34 +07:00
Louis Chemineau 8a2cf5bb68 Do not dispatch postSetPassword when setPassword fails
Also Improve error message when setPassword fails

Signed-off-by: Louis Chemineau <louis@chmn.me>
2022-05-05 17:21:23 +07:00
Vincent Petry ff385dc679
Merge pull request #32082 from nextcloud/directory-content-lazy-owner
use a lazy user for the file owner when listing a directory
2022-04-25 11:44:44 +07:00
Robin Appelman 7a6c724a81 Use a lazy user for the file owner when listing a directory
Only getUID and getDisplayName are called on the file owner objects anyway
and we can get this information often without DB request

Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-22 17:02:37 +07:00
Robin Appelman 674c0bec2c
cache display names in local memory before external memcache
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-22 13:02:30 +07:00
Carl Schwan ed4c1e584f Update cache when display name change
This improve the correctness of the data

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-04-22 10:29:18 +07:00
Carl Schwan 4333c215cb Cache display name
This should saves some query in the share backend when displaying the
owner and it's not important if the display name is 10 minutes outdated
as it is very rare that this gets changed.

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-04-22 10:22:15 +07:00
Côme Chilliet 6be7aa112f
Migrate from ILogger to LoggerInterface in lib/private
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 16:21:25 +07:00
Joas Schilling 18bafefb00
Merge pull request #31218 from nextcloud/techdebt/noid/use-cache-also-for-userbackend-getpassword
Use the cache also for UserBackend::getPassword
2022-03-02 11:41:32 +07:00
Joas Schilling b90e657ac7
Delay loading user preferences until we need them
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-02-28 13:49:12 +07:00
Joas Schilling 86de1d569f
Only setupFS when we have to copy the skeleton
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-02-25 15:55:06 +07:00
Joas Schilling 25caf4a42c
Update cache when setting the password
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-02-18 09:47:18 +07:00
Joas Schilling 23ef02fbe2
Use the cache also for UserBackend::getPassword
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-02-16 18:00:47 +07:00
Marek-Wojtowicz f76a915096 Update Session.php
The http headers according to rfc 2616 is iso-8859-1. This patch fixes the behavior when non-ascii characters are present in the header.

Signed-off-by: Marek Wójtowicz <Marek.Wojtowicz@agh.edu.pl>
2022-01-12 23:07:28 +07:00
Joas Schilling 78e90b69ba
Don't check the configvalue for lastLogin which is never null
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-10 16:26:13 +07:00
Joas Schilling c0ba89ecc9
Remove default token which is deprecated since Nextcloud 13
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-01 18:41:31 +07:00
Côme Chilliet 008b79d808
Fix type errors
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-11-23 09:28:58 +07:00
Joas Schilling ccfaddf781
Fix missing token update
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-12 14:43:23 +07:00
Joas Schilling b578a1e8b5
Fair use of push notifications
We want to keep offering our push notification service for free, but large
users overload our infrastructure. For this reason we have to rate-limit the
use of push notifications. If you need this feature, consider setting up your
own push server or using Nextcloud Enterprise.

Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-10-23 00:54:50 +07:00
Joas Schilling 1b8ebf2cf1
Use cached user backend info for password login
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-09-14 08:40:19 +07:00
Arthur Schiwon 4461b9e870
enable the user to set a primary (notification) email address (backend)
- specific getters and setters on IUser and implementation
- new notify_email field in provisioning API

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-09-09 19:23:04 +07:00
Julius Härtl 95987d903d
Merge pull request #28481 from nextcloud/fix/hash-key
Hash cache key
2021-08-18 15:18:58 +07:00
Christopher Ng 60ecc432a4 Hash cache key
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2021-08-17 21:55:01 +07:00
Christoph Wurst a143337791
Emit an error log when the app token login name does not match
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-08-13 10:31:51 +07:00
Julien Veyssier 416d10f76c refs #21045 add app config to disable unlimited quota and to set max quota
avoid unlimited quota as default_quota fallback value if unlimited quota is not allowed
avoid getting/setting/displaying unlimited default quota if not allowed
implement tests for unlimited quota restrictions

Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
2021-07-29 19:31:36 +07:00
Julius Härtl f43c2b45d8
Directly return cloud id from user
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-07-14 09:52:15 +07:00
Gary Kim b78f3a57d1
Migrate HintException to OCP
Signed-off-by: Gary Kim <gary@garykim.dev>
2021-06-30 15:28:02 +07:00
John Molakvoæ (skjnldsv) 215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +07:00
John Molakvoæ d0cf20cc51
Merge pull request #26792 from nextcloud/user-delete-cleanup-files
better cleanup of user files on user deletion
2021-06-02 17:02:00 +07:00