Repository navigation
Conversation
|
@tcitworld, thanks for your PR! By analyzing the history of the files in this pull request, we identified @LukasReschke, @MorrisJobke and @icewind1991 to be potential reviewers. |
| public function destroy($id) { | ||
| $userId = $this->userSession->getUser()->getUID(); | ||
| $user = $this->userManager->get($id); | ||
| $userOwnDeletion = $this->config->getSystemValue('user_own_account_deletion', false); |
There was a problem hiding this comment.
Please no config.php switch. This should be stored in the database.
There was a problem hiding this comment.
Okay. Where should it be activated by the administrator. Additional settings ?
| } | ||
| } | ||
|
|
||
| function deleteAccount () { |
There was a problem hiding this comment.
Global namespace 🙈 Yes I know, the other methods are also in the global namespace - but at some point we need to clean up this mess 😉
| } | ||
| } | ||
|
|
||
| function deleteAccount () { |
There was a problem hiding this comment.
Global namespace 🙈 Yes I know, the other methods are also in the global namespace - but at some point we need to clean up this mess 😉
|
Can't we just do this as an app? |
|
I thought it was a quite small feature to create an app. Also it's configurable by the admin. |
LukasReschke
left a comment
There was a problem hiding this comment.
I'd also prefer this to be in it's own app. But that may just be personal preference.
In any case, there are some problems with this:
- Missing unit tests for the UsersController
- The "delete your account" should only appear in the settings when it is possible (e.g. the user backend of the currently logged-in user supports it)
- Some remarks that Morris had as well.
|
Most of it is done. I just don't know where the admin setting should show up. Also, how to test if backend supports deletion (I've just put Database for now) ? |
f7392cf to
9a81ff8
Compare
| </div> | ||
| </div> | ||
|
|
||
| <?php if ($_['accountDeletionEnabled']) { ?> |
There was a problem hiding this comment.
Should be at the bottom of the site in my opinion
| } | ||
|
|
||
| // show account deletion button only if it's enabled and if the backend supports it | ||
| $accountDeletionEnabled = $config->getAppValue('core', 'user_own_account_deletion', false) && $user->getBackendClassName() === 'Database'; |
There was a problem hiding this comment.
Most of it is done. I just don't know where the admin setting should show up. Also, how to test if backend supports deletion (I've just put Database for now) ?
\OCP\UserInterface::implementsActions + add an action constant + adjust the backends.
No hard-coded hackery here 😉
| * @return bool | ||
| */ | ||
| public function canDeleteAccount() { | ||
| // TODO : Change this |
There was a problem hiding this comment.
For some reason. Any help here ?
There was a problem hiding this comment.
(bool)$this->config->getAppValue('core', 'user_own_account_deletion', 0) and store an integer would have been my approach.
| /** | ||
| * check if the backend supports deleting user | ||
| * | ||
| * @return bool |
There was a problem hiding this comment.
This or ownCloud notation ?
There was a problem hiding this comment.
We used 9.2 so far, I guess we should "unify" them all before the release and do one or the other.
|
|
||
| $formsAndMore = array_merge($formsAndMore, $formsMap); | ||
|
|
||
| if ($user->canDeleteAccount()) { |
Signed-off-by: Thomas Citharel <[email protected]>
Signed-off-by: Thomas Citharel <[email protected]>
* Use OCP instead of OC js namespace * Rewrite config entry condition * Rebase Signed-off-by: Thomas Citharel <[email protected]>
e3aeb52 to
a3902b5
Compare
|
Rebased. Please review. :-) |
|
I still really dislike this being in core. In 99.99% of the cases this is not required. For me the only real usecase is if a service provider wants to allow people to delete their accounts. Which is a fair use case. But, again, please do it as an app. |
Agreed. And Service Providers may want to use their own CRM to have better control over it. So the use-case is as small as this is something for a separate app, I think 😁 ...However: Good work 👍 |
|
Okay ! (I will delete the branch later) |
| * @return bool | ||
| */ | ||
| public function canDeleteAccount() { | ||
| // TODO : Change this |
There was a problem hiding this comment.
no need for the bool casting here
| public function destroy($id) { | ||
| $userId = $this->userSession->getUser()->getUID(); | ||
| $user = $this->userManager->get($id); | ||
| $userOwnDeletion = $this->config->getAppValue('core', 'user_own_account_deletion', false); |
|
|
||
| OC.Settings.Personal = OC.Settings.Personal || { | ||
| deleteAccount: function() { | ||
| OC.dialogs.confirm('Do you really want to delete your account ? All your data will be lost !', 'Delete your account ?', function (res) { |
There was a problem hiding this comment.
Please remove the spaces before ? and !
Bring the possibility for an user to delete it's own account. Administrators can enable/disable this functionality.
See owncloud/core#158