AccountController: Prohibit password changes for users with `no-user/password-change`
This commit is contained in:
parent
7ae3f187bd
commit
67cc81e49f
|
@ -43,6 +43,7 @@ class AccountController extends Controller
|
|||
$config = Config::app()->getSection('global');
|
||||
$user = $this->Auth()->getUser();
|
||||
if ($user->getAdditional('backend_type') === 'db') {
|
||||
if ($user->can('*') || ! $user->can('no-user/password-change')) {
|
||||
try {
|
||||
$userBackend = UserBackend::create($user->getAdditional('backend_name'));
|
||||
} catch (ConfigurationError $e) {
|
||||
|
@ -56,6 +57,7 @@ class AccountController extends Controller
|
|||
$this->view->changePasswordForm = $changePasswordForm;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$form = new PreferenceForm();
|
||||
$form->setPreferences($user->getPreferences());
|
||||
|
|
Loading…
Reference in New Issue