Created
March 16, 2017 09:39
-
-
Save Aebian/eb1d016cfe1eeb57535a1f5c3ba5ba85 to your computer and use it in GitHub Desktop.
Deny password change for Rainlab Users Plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\RainLab\User\Models\User::extend(function($model) { | |
$model->bindEvent('model.beforeUpdate', function() use ($model) { | |
if ($model->isDirty('password')) { | |
throw new \ValidationException(['password' => 'Sorry!...']); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment