File tree Expand file tree Collapse file tree
apps/files_external/lib/Lib/Auth/Password Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919 */
2020class GlobalAuth extends AuthMechanism {
2121 public const CREDENTIALS_IDENTIFIER = 'password::global ' ;
22+ private const PWD_PLACEHOLDER = '************************ ' ;
2223
2324 /** @var ICredentialsManager */
2425 protected $ credentialsManager ;
@@ -41,11 +42,18 @@ public function getAuth($uid) {
4142 'password ' => ''
4243 ];
4344 } else {
45+ $ auth ['password ' ] = self ::PWD_PLACEHOLDER ;
4446 return $ auth ;
4547 }
4648 }
4749
4850 public function saveAuth ($ uid , $ user , $ password ) {
51+ // Use old password if it has not changed.
52+ if ($ password === self ::PWD_PLACEHOLDER ) {
53+ $ auth = $ this ->credentialsManager ->retrieve ($ uid , self ::CREDENTIALS_IDENTIFIER );
54+ $ password = $ auth ['password ' ];
55+ }
56+
4957 $ this ->credentialsManager ->store ($ uid , self ::CREDENTIALS_IDENTIFIER , [
5058 'user ' => $ user ,
5159 'password ' => $ password
You can’t perform that action at this time.
0 commit comments