File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
apps/files_external/lib/Lib/Auth/Password Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 37
37
*/
38
38
class GlobalAuth extends AuthMechanism {
39
39
public const CREDENTIALS_IDENTIFIER = 'password::global ' ;
40
+ private const PWD_PLACEHOLDER = '************************ ' ;
40
41
41
42
/** @var ICredentialsManager */
42
43
protected $ credentialsManager ;
@@ -59,11 +60,18 @@ public function getAuth($uid) {
59
60
'password ' => ''
60
61
];
61
62
} else {
63
+ $ auth ['password ' ] = self ::PWD_PLACEHOLDER ;
62
64
return $ auth ;
63
65
}
64
66
}
65
67
66
68
public function saveAuth ($ uid , $ user , $ password ) {
69
+ // Use old password if it has not changed.
70
+ if ($ password === self ::PWD_PLACEHOLDER ) {
71
+ $ auth = $ this ->credentialsManager ->retrieve ($ uid , self ::CREDENTIALS_IDENTIFIER );
72
+ $ password = $ auth ['password ' ];
73
+ }
74
+
67
75
$ this ->credentialsManager ->store ($ uid , self ::CREDENTIALS_IDENTIFIER , [
68
76
'user ' => $ user ,
69
77
'password ' => $ password
You can’t perform that action at this time.
0 commit comments