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 3737 */
3838class GlobalAuth extends AuthMechanism {
3939 public const CREDENTIALS_IDENTIFIER = 'password::global ' ;
40+ private const PWD_PLACEHOLDER = '************************ ' ;
4041
4142 /** @var ICredentialsManager */
4243 protected $ credentialsManager ;
@@ -59,11 +60,18 @@ public function getAuth($uid) {
5960 'password ' => ''
6061 ];
6162 } else {
63+ $ auth ['password ' ] = self ::PWD_PLACEHOLDER ;
6264 return $ auth ;
6365 }
6466 }
6567
6668 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+
6775 $ this ->credentialsManager ->store ($ uid , self ::CREDENTIALS_IDENTIFIER , [
6876 'user ' => $ user ,
6977 'password ' => $ password
You can’t perform that action at this time.
0 commit comments