summaryrefslogtreecommitdiff
path: root/app/Validator/UserValidator.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Validator/UserValidator.php')
-rw-r--r--app/Validator/UserValidator.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/Validator/UserValidator.php b/app/Validator/UserValidator.php
index fe402c47..041390a3 100644
--- a/app/Validator/UserValidator.php
+++ b/app/Validator/UserValidator.php
@@ -116,6 +116,10 @@ class UserValidator extends BaseValidator
$v = new Validator($values, array_merge($rules, $this->commonPasswordValidationRules()));
if ($v->execute()) {
+ if (! $this->userSession->isAdmin() && $values['id'] != $this->userSession->getId()) {
+ return array(false, array('current_password' => array('Invalid User ID')));
+ }
+
if ($this->authenticationManager->passwordAuthentication($this->userSession->getUsername(), $values['current_password'], false)) {
return array(true, array());
} else {