23
23
use Pydio \Core \Http \Middleware \WorkspaceAuthMiddleware ;
24
24
use Pydio \Core \Http \Response \JSONSerializableResponseChunk ;
25
25
use Pydio \Core \Http \Response \XMLSerializableResponseChunk ;
26
+ use Pydio \Core \Services \LocaleService ;
26
27
27
28
defined ('AJXP_EXEC ' ) or die ( 'Access not allowed ' );
28
29
@@ -83,12 +84,15 @@ public function __construct($promptType, $data, $messageString, $messageId = fal
83
84
* @return PydioPromptException
84
85
*/
85
86
public static function promptForWorkspaceCredentials ($ parameters , $ postSubmitCallback = "" ){
87
+ $ mess = LocaleService::getMessages ();
86
88
$ inputs = [];
87
89
foreach ($ parameters as $ key => $ value ){
88
90
if ($ key === WorkspaceAuthMiddleware::FORM_RESUBMIT_LOGIN ) {
89
- $ inputs [] = "<input type='text' name=' $ key' value=' $ value' placeholder='Login'> " ;
91
+ $ loginString = str_replace ("' " ,"\' " , $ mess ['181 ' ]);
92
+ $ inputs [] = "<input type='text' name=' $ key' value=' $ value' placeholder=' $ loginString'> " ;
90
93
}else if ($ key === WorkspaceAuthMiddleware::FORM_RESUBMIT_PASS ){
91
- $ inputs [] = "<input type='password' name=' $ key' value='' placeholder='Password' autocomplete='off'> " ;
94
+ $ passString = str_replace ("' " ,"\' " , $ mess ['182 ' ]);
95
+ $ inputs [] = "<input type='password' name=' $ key' value='' placeholder=' $ passString' autocomplete='off'> " ;
92
96
}else {
93
97
$ inputs [] = "<input type='hidden' name=' $ key' value=' $ value'> " ;
94
98
}
@@ -97,8 +101,8 @@ public static function promptForWorkspaceCredentials($parameters, $postSubmitCal
97
101
"confirm " ,
98
102
array (
99
103
"DIALOG " => "<div>
100
- <h3>Credentials Required </h3>
101
- <div class='dialogLegend'>Please provide a password to enter this workspace. </div>
104
+ <h3> " . $ mess [ ' 557 ' ]. " </h3>
105
+ <div class='dialogLegend'> " . $ mess [ ' 558 ' ]. " </div>
102
106
<form autocomplete='off'>
103
107
" .implode ("\n" , $ inputs )."
104
108
</form>
@@ -112,7 +116,7 @@ public static function promptForWorkspaceCredentials($parameters, $postSubmitCal
112
116
"EVAL " => ""
113
117
)
114
118
),
115
- " Credentials Needed " );
119
+ $ mess [ ' 557 ' ] );
116
120
117
121
}
118
122
0 commit comments