Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable/Disable users to change their password #12671

Closed
ghost opened this issue Nov 26, 2018 · 19 comments
Closed

Enable/Disable users to change their password #12671

ghost opened this issue Nov 26, 2018 · 19 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement

Comments

@ghost
Copy link

ghost commented Nov 26, 2018

Actually there are no steps to reproduce, we just need some feature that allows us enable/disable users to change their password.

@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #10572 (Fix security settings if password change is disabled), #9474 (It'll be nice to have "disable password confirm" option), #4008 (Disable reset password link), #12386 (Disable password change with SSO), and #5746 (Create user failed / password policy crash).

@violoncelloCH
Copy link
Member

why do you need to enable/disable users to change passwords?
passwords can be changed and users enabled/disabled independent from each other

@ghost
Copy link
Author

ghost commented Nov 28, 2018

why do you need to enable/disable users to change passwords?
passwords can be changed and users enabled/disabled independent from each other

Because people have one password for business system and they could change that only password in some subsystem like Nextcloud. Hopefully you understand what i mean.

@violoncelloCH
Copy link
Member

ahh, sorry, I misunderstood your first post... now I get it
are you using LDAP?

@ghost
Copy link
Author

ghost commented Nov 28, 2018

ahh, sorry, I misunderstood your first post... now I get it
are you using LDAP?

Yes.

@kesselb
Copy link
Contributor

kesselb commented Nov 28, 2018

https://docs.nextcloud.com/server/14/admin_manual/configuration_user/user_auth_ldap_api.html#configuration-keys

turnOnPasswordChange

@tomtomas99911
Copy link

Yes, you can disable password change in LDAP (also in user_SQL or SMTP login) but you cannot hide change password dialog - so users are confused.

We want to hide whole change password dialog, not only to disable password change.

@kesselb
Copy link
Contributor

kesselb commented Nov 28, 2018

I suppose you talk about this page?

image

Password dialog is displayed when passwordChangeSupported.

<?php if($_['passwordChangeSupported']) { ?>

$passwordChangeSupported = false;
if ($user !== null) {
$passwordChangeSupported = $user->canChangePassword();
}

public function canChangePassword() {
return $this->backend->implementsActions(Backend::SET_PASSWORD);
}

public function implementsActions($actions) {
return (bool)((Backend::CHECK_PASSWORD
| Backend::GET_HOME
| Backend::GET_DISPLAYNAME
| (($this->access->connection->ldapUserAvatarRule !== 'none') ? Backend::PROVIDE_AVATAR : 0)
| Backend::COUNT_USERS
| (((int)$this->access->connection->turnOnPasswordChange === 1)? Backend::SET_PASSWORD :0)
| $this->userPluginManager->getImplementedActions())
& $actions);
}

The good news: This feature is already there 👍
The bad news: It does not work for you 🤣

@kesselb
Copy link
Contributor

kesselb commented Nov 28, 2018

I did some testing (used https://www.forumsys.com/tutorials/integration-how-to/ldap/online-ldap-test-server/ as ldap server) and it works for me.

image

No change password form by default. Only when above checkbox is enabled. You are using nextcloud 14? (i have tested it with 15)

@tomtomas99911
Copy link

I am using NX 14 with user_sql - so I need to hide password change dialog here...

@kesselb
Copy link
Contributor

kesselb commented Nov 28, 2018

https://github.com/nextcloud/user_sql i see a "allow password change" checkbox there?

@tomtomas99911
Copy link

Yes - it disable password change - but it does not hide password change dialog. And author of user_sql said - "hiding password change dialog is feauture of nextcloud core not user_sql addon"

@kesselb
Copy link
Contributor

kesselb commented Nov 28, 2018

@mlojewski-me would you mind to reopen nextcloud/user_sql#78 and have a second look?

UserBackend and GroupBackend extend from ABackend and both implement ISetPasswordBackend.

public function implementsActions($actions): bool {
$implements = 0;
if ($this instanceof ICreateUserBackend) {
$implements |= Backend::CREATE_USER;
}
if ($this instanceof ISetPasswordBackend) {
$implements |= Backend::SET_PASSWORD;
}

Nextcloud asks the backend if a password change is possible (and if so shows the form)

public function canChangePassword() {
return $this->backend->implementsActions(Backend::SET_PASSWORD);
}

I guess you have to overwrite implementsActions and check if the user enabled password change with your backend.

@kesselb
Copy link
Contributor

kesselb commented Nov 28, 2018

Thank you @tomtomas99911 for reporting this and answering all my questions 👍

@mlojewski-me
Copy link

@danielkesselberg issue reopened, I will check it soon

@ChristophWurst ChristophWurst added the 0. Needs triage Pending check for reproducibility or if it fits our roadmap label Nov 29, 2018
@tomtomas99911
Copy link

Any advance here please?

@mlojewski-me
Copy link

@danielkesselberg issue reopened, I will check it soon

Issue nextcloud/user_sql#78 resolved

@phlegx

This comment has been minimized.

@kesselb

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement
Projects
None yet
Development

No branches or pull requests

7 participants