Commit Graph

100 Commits (b9ab00a59e2d906fdb43eaaea37eb7a4a9cc8a13)

Author SHA1 Message Date
skjnldsv 027471b146 fix: force lowercase emails
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
2025-07-10 09:10:01 +07:00
Ferdinand Thiessen e143921896
feat(IUser): add `getQuotaBytes` method to get machine readable quota
Proper replacement for deprecated `OC_Util::getUserQuota`.
Also we still use this in some cases we can now replace, moreover it
just makes sense to have a machine readable format in the API instead of
only the human readable format which is less precise.
Alings also with `getQuota` of the quota storage, which already returned
the machine readable format.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-05-22 12:50:38 +07:00
Ferdinand Thiessen 1ae3fa4003
chore: replace leagcy OC_Helper calls with OCP\Util
- Replace legacy calls with OCP\Util
- Add missing deprecation notices
- Inline implementation in OCP\Util and call it from OC_Helper

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-05-14 10:18:04 +07:00
provokateurin 8da9c0f48c
Revert "refactor: add migration for email setting"
This reverts commit e7859f0dac.

Signed-off-by: provokateurin <kate@provokateurin.de>
2025-04-07 09:55:09 +07:00
Ferdinand Thiessen e7859f0dac refactor: add migration for email setting
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-04-02 19:06:25 +07:00
provokateurin eb98e99530 fix(settings): Handle email change restriction separately from display name change restriction
Co-authored-by: provokateurin <kate@provokateurin.de>
Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Louis <louis@chmn.me>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-04-02 19:06:25 +07:00
Côme Chilliet b995912207
feat(users): Use -1 for unknown firstLogin instead of setting it to current date
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-01-07 16:30:22 +07:00
Côme Chilliet baf7293cfe
feat: Add first login timestamp of each user to oc_preferences and user:info output
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-01-07 16:29:50 +07:00
provokateurin 51d9d63a01
chore: Use more gender neutral language
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-10-14 13:59:24 +07:00
Ferdinand Thiessen d57a2dd465
fix: Skip users that still exist in backend
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-09-26 20:48:45 +07:00
Ferdinand Thiessen 16833aff86
fix: Make user removal more resilient
Currently there is a problem if an exception is thrown in `User::delete`,
because at that point the user is already removed from the backend,
but not all data is deleted.

There is no way to recover from this state, as the user is gone no information is available anymore.
This means the data is still available on the server but can not removed by any API anymore.

The solution here is to first set a flag and backup the user home,
this can be used to recover failed user deletions in a way the delete can be re-tried.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-09-26 20:48:37 +07:00
provokateurin 9836e9b164
chore(deps): Update nextcloud/coding-standard to v1.3.1
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-19 14:21:20 +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
Christopher Ng 34d97d45cf feat: Allow getting/setting the password hash of a user
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2024-07-08 16:30:52 +07:00
John Molakvoæ 84789222b1
chore: php lint fix import
Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
2024-05-30 18:38:02 +07:00
John Molakvoæ 65ad1d0abe
Merge branch 'master' into refactor/OC-Server-getNotificationManager
Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
2024-05-30 14:33:12 +07:00
Andy Scherzinger dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +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
Andrew Summers 6910832170 Refactor `OC\Server::getCommentsManager`
Signed-off-by: Andrew Summers <18727110+summersab@users.noreply.github.com>
2024-03-15 13:14:06 +07:00
Joas Schilling aa5f037af7
chore: apply changes from Nextcloud coding standards 1.1.1
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2023-11-23 10:36:13 +07:00
Arthur Schiwon bc1da2fa54
Merge pull request #40114 from summersab/refactor/OC-Server-getAvatarManager
Refactor `OC\Server::getAvatarManager`
2023-11-22 11:43:51 +07:00
Robin Appelman ef87ff1848
Merge pull request #39216 from shdehnavi/replace_substr_calls_in_lib_private
Refactor "substr" calls in lib/private to improve code readability
2023-09-21 16:34:27 +07:00
Andrew Summers 2258058fd6
Refactor `OC\Server::getAvatarManager
Signed-off-by: Andrew Summers <18727110+summersab@users.noreply.github.com>
2023-09-01 16:43:04 +07:00
Andrew Summers 5dccf25e11
Refactor `OC\Server::getNotificationManager`
Signed-off-by: Andrew Summers <18727110+summersab@users.noreply.github.com>
2023-08-29 21:32:10 +07:00
Joas Schilling ad12a740cb
fix!: Remove symfony EventDispatcherInterface from User
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-27 23:13:37 +07:00
Joas Schilling 35c313e280
fix!: Remove User events which have a typed event replacement
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-27 09:57:54 +07:00
Hamid Dehnavi d0b20534b9 Refactor "substr" calls to improve code readability
Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
2023-07-07 04:54:20 +07:00
Christoph Wurst 14719110b9 chore: Replace \OC::$server->query with \OCP\Server::get in /lib
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-07-06 15:21:22 +07:00
Côme Chilliet b2f01b72fe
Merge pull request #34443 from nextcloud/feat/add-enabled-user-backend
Add IProvideEnabledStateBackend interface
2023-07-03 10:19:32 +07:00
Côme Chilliet 1603cdc8d2
Fix since annotations and add boolean return type for setUserEnabled
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-06-20 15:10:39 +07:00
Robin Appelman 9f1d497a0b
Merge pull request #38261 from fsamapoor/replace_strpos_calls_in_lib_private
Refactors "strpos" calls in  lib/private to improve code readability.
2023-06-01 23:10:00 +07:00
Joas Schilling ef93bb926c
fix(dav): Fix avatar size in system address book
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-05-26 10:03:58 +07:00
Côme Chilliet 285c42ab14
Fix user tests, avoid setting enabled state to the same value
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-05-23 17:18:19 +07:00
Côme Chilliet 3af1ab2b2a
Add user enabled state backend feature
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-05-23 11:25:03 +07:00
Faraz Samapoor e7cc7653b8 Refactors "strpos" calls in lib/private to improve code readability.
Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
2023-05-15 15:17:19 +07:00
Christoph Wurst 1381c4c157
feat(users): Store and load a user's manager
Co-Authored-By: hamza221 <hamzamahjoubi221@gmail.com>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-05-12 13:56:48 +07:00
Christopher Ng 4ecae83385 fix(user): Can change display name
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2023-05-04 11:14:49 +07:00
Côme Chilliet 426c0341ff
Use typed version of IConfig::getSystemValue as much as possible
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-05 12:50:08 +07:00
Julius Härtl 3287eddbbc fix: Recalculate storage statistics on updating the quota
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-03-06 22:46:07 +07:00
Côme Chilliet 5aed587e25
Fix setQuota on User on 32bits
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-02-07 11:23:30 +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
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
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
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
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
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
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