| @@ 8054-8063 (lines=10) @@ | ||
| 8051 | * @param $password The new password |
|
| 8052 | * @return \PHPPgAdmin\Database\A 0 success |
|
| 8053 | */ |
|
| 8054 | public function changePassword($rolename, $password) |
|
| 8055 | { |
|
| 8056 | $enc = $this->_encryptPassword($rolename, $password); |
|
| 8057 | $this->fieldClean($rolename); |
|
| 8058 | $this->clean($enc); |
|
| 8059 | ||
| 8060 | $sql = "ALTER ROLE \"{$rolename}\" WITH ENCRYPTED PASSWORD '{$enc}'"; |
|
| 8061 | ||
| 8062 | return $this->execute($sql); |
|
| 8063 | } |
|
| 8064 | ||
| 8065 | /** |
|
| 8066 | * Adds a group member |
|
| @@ 151-160 (lines=10) @@ | ||
| 148 | * @param $password The new password |
|
| 149 | * @return \PHPPgAdmin\Database\A 0 success |
|
| 150 | */ |
|
| 151 | public function changePassword($username, $password) |
|
| 152 | { |
|
| 153 | $enc = $this->_encryptPassword($username, $password); |
|
| 154 | $this->fieldClean($username); |
|
| 155 | $this->clean($enc); |
|
| 156 | ||
| 157 | $sql = "ALTER USER \"{$username}\" WITH ENCRYPTED PASSWORD '{$enc}'"; |
|
| 158 | ||
| 159 | return $this->execute($sql); |
|
| 160 | } |
|
| 161 | ||
| 162 | // View functions |
|
| 163 | ||