Revision 749068ba src/gr/grnet/pithos/web/client/CredentialsDialog.java
b/src/gr/grnet/pithos/web/client/CredentialsDialog.java | ||
---|---|---|
34 | 34 |
*/ |
35 | 35 |
package gr.grnet.pithos.web.client; |
36 | 36 |
|
37 |
import com.google.gwt.user.client.Window; |
|
38 | 37 |
import gr.grnet.pithos.web.client.rest.PostCommand; |
39 | 38 |
import gr.grnet.pithos.web.client.rest.RestException; |
40 | 39 |
|
... | ... | |
96 | 95 |
Button ok = new Button("Yes", new ClickHandler() { |
97 | 96 |
@Override |
98 | 97 |
public void onClick(ClickEvent event) { |
99 |
resetPassword(GSS.get().getCurrentUserResource().getUri());
|
|
98 |
resetPassword(Pithos.get().getCurrentUserResource().getUri());
|
|
100 | 99 |
hide(); |
101 | 100 |
} |
102 | 101 |
}); |
... | ... | |
161 | 160 |
Button confirm = new Button("Proceed", new ClickHandler() { |
162 | 161 |
@Override |
163 | 162 |
public void onClick(ClickEvent event) { |
164 |
GSS.get().authenticateUser();
|
|
163 |
Pithos.get().authenticateUser();
|
|
165 | 164 |
hide(); |
166 | 165 |
} |
167 | 166 |
}); |
... | ... | |
180 | 179 |
// either enter or escape is pressed. |
181 | 180 |
switch (evt.getKeyCode()) { |
182 | 181 |
case KeyCodes.KEY_ENTER: |
183 |
GSS.get().authenticateUser();
|
|
182 |
Pithos.get().authenticateUser();
|
|
184 | 183 |
hide(); |
185 | 184 |
break; |
186 | 185 |
case KeyCodes.KEY_ESCAPE: |
... | ... | |
212 | 211 |
table.setText(0, 0, "Username"); |
213 | 212 |
table.setText(1, 0, "Token"); |
214 | 213 |
TextBox username = new TextBox(); |
215 |
final GSS app = GSS.get();
|
|
214 |
final Pithos app = Pithos.get();
|
|
216 | 215 |
username.setText(app.getCurrentUserResource().getUsername()); |
217 | 216 |
username.setReadOnly(true); |
218 | 217 |
username.setWidth(WIDTH_FIELD); |
219 | 218 |
username.addClickHandler(new ClickHandler() { |
220 | 219 |
@Override |
221 | 220 |
public void onClick(ClickEvent event) { |
222 |
GSS.enableIESelection();
|
|
221 |
Pithos.enableIESelection();
|
|
223 | 222 |
((TextBox) event.getSource()).selectAll(); |
224 |
GSS.preventIESelection();
|
|
223 |
Pithos.preventIESelection();
|
|
225 | 224 |
} |
226 | 225 |
|
227 | 226 |
}); |
... | ... | |
234 | 233 |
tokenBox.addClickHandler(new ClickHandler() { |
235 | 234 |
@Override |
236 | 235 |
public void onClick(ClickEvent event) { |
237 |
GSS.enableIESelection();
|
|
236 |
Pithos.enableIESelection();
|
|
238 | 237 |
((TextBox) event.getSource()).selectAll(); |
239 |
GSS.preventIESelection();
|
|
238 |
Pithos.preventIESelection();
|
|
240 | 239 |
} |
241 | 240 |
|
242 | 241 |
}); |
... | ... | |
298 | 297 |
private void resetPassword(String userUri) { |
299 | 298 |
|
300 | 299 |
if (userUri == null || userUri.length() == 0) { |
301 |
GSS.get().displayError("Empty user Uri!");
|
|
300 |
Pithos.get().displayError("Empty user Uri!");
|
|
302 | 301 |
return; |
303 | 302 |
} |
304 | 303 |
GWT.log("resetPassword(" + userUri + ")", null); |
... | ... | |
316 | 315 |
if(t instanceof RestException){ |
317 | 316 |
int statusCode = ((RestException)t).getHttpStatusCode(); |
318 | 317 |
if(statusCode == 405) |
319 |
GSS.get().displayError("You don't have the necessary" +
|
|
318 |
Pithos.get().displayError("You don't have the necessary" +
|
|
320 | 319 |
" permissions"); |
321 | 320 |
else if(statusCode == 404) |
322 |
GSS.get().displayError("Resource does not exist");
|
|
321 |
Pithos.get().displayError("Resource does not exist");
|
|
323 | 322 |
else |
324 |
GSS.get().displayError("Unable to reset password:" +
|
|
323 |
Pithos.get().displayError("Unable to reset password:" +
|
|
325 | 324 |
((RestException)t).getHttpStatusText()); |
326 | 325 |
} |
327 | 326 |
else |
328 |
GSS.get().displayError("System error resetting password:" +
|
|
327 |
Pithos.get().displayError("System error resetting password:" +
|
|
329 | 328 |
t.getMessage()); |
330 | 329 |
} |
331 | 330 |
}; |
Also available in: Unified diff