aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2024-09-24 16:20:04 +0200
committerLouis Chemineau <louis@chmn.me>2024-09-25 17:50:17 +0200
commit20eb4648357ffb0620e45a982c6afd22e50dfca8 (patch)
tree09d8e741cb47ce042cde2f290f213d692931e72f /apps/files_external
parente247c260715c0dc7db7b4c0649413bed2629aafa (diff)
downloadnextcloud-server-20eb4648357ffb0620e45a982c6afd22e50dfca8.tar.gz
nextcloud-server-20eb4648357ffb0620e45a982c6afd22e50dfca8.zip
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php b/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php
index ca1c9ca2bee..f11dab2785f 100644
--- a/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php
+++ b/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php
@@ -19,6 +19,7 @@ use OCP\Security\ICredentialsManager;
*/
class GlobalAuth extends AuthMechanism {
public const CREDENTIALS_IDENTIFIER = 'password::global';
+ private const PWD_PLACEHOLDER = '************************';
/** @var ICredentialsManager */
protected $credentialsManager;
@@ -41,11 +42,18 @@ class GlobalAuth extends AuthMechanism {
'password' => ''
];
} else {
+ $auth['password'] = self::PWD_PLACEHOLDER;
return $auth;
}
}
public function saveAuth($uid, $user, $password) {
+ // Use old password if it has not changed.
+ if ($password === self::PWD_PLACEHOLDER) {
+ $auth = $this->credentialsManager->retrieve($uid, self::CREDENTIALS_IDENTIFIER);
+ $password = $auth['password'];
+ }
+
$this->credentialsManager->store($uid, self::CREDENTIALS_IDENTIFIER, [
'user' => $user,
'password' => $password