Skip to content

Instantly share code, notes, and snippets.

@Aebian
Created March 16, 2017 09:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Aebian/eb1d016cfe1eeb57535a1f5c3ba5ba85 to your computer and use it in GitHub Desktop.
Save Aebian/eb1d016cfe1eeb57535a1f5c3ba5ba85 to your computer and use it in GitHub Desktop.
Deny password change for Rainlab Users Plugin
\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