Skip to content

Commit

Permalink
Disallow Updating of Federated User's Passwords (#444)
Browse files Browse the repository at this point in the history
* Disallow editing passwords for federated users.
  • Loading branch information
chakrabortyr authored Feb 26, 2018
1 parent d7cca18 commit 805c793
Show file tree
Hide file tree
Showing 2 changed files with 432 additions and 437 deletions.
5 changes: 4 additions & 1 deletion classes/XDUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Models\Acl;
use Models\Services\Acls;
use User\aRole;
use DataWarehouse\Query\Exceptions\AccessDeniedException;

/**
* XDMoD Portal User
Expand Down Expand Up @@ -544,9 +545,11 @@ public static function getUserByID($uid, &$targetInstance = NULL)

public function setPassword($raw_password)
{
if ($this->getUserType() === FEDERATED_USER_TYPE) {
throw new AccessDeniedException("Permission Denied. Only local accounts may have their passwords modified.");
}

return $this->_password = $raw_password;

}//setPassword

// ---------------------------
Expand Down
Loading

0 comments on commit 805c793

Please sign in to comment.