*/
private String token;
+ /**
+ * The WebDAV password of the current user
+ */
+ private String webDAVPassword;
+
private PickupDragController dragController;
public void onModuleLoad() {
* Parse and store the user credentials to the appropriate fields.
*/
private void parseUserCredentials() {
- //------------------------
- // XXX This part is only for development environments!
- // XXX Remove/comment for production deployment!
- final String _username = Window.Location.getParameter("user");
- token = Window.Location.getParameter("token");
- if (_username != null) {
- DeferredCommand.addCommand(new Command() {
- public void execute() {
- fetchUser(_username);
- }
- });
- return;
- }
- //------------------------
Configuration conf = (Configuration) GWT.create(Configuration.class);
String cookie = conf.authCookie();
String auth = Cookies.getCookie(cookie);
final String username = auth.substring(0, sepIndex);
if (username == null)
authenticateUser();
+
+ refreshWebDAVPassword();
+
DeferredCommand.addCommand(new Command() {
public void execute() {
fetchUser(username);
return statusPanel;
}
+
+ /**
+ * Retrieve the userDetailsPanel.
+ *
+ * @return the userDetailsPanel
+ */
+ public UserDetailsPanel getUserDetailsPanel() {
+ return userDetailsPanel;
+ }
+
/**
* Retrieve the dragController.
*
return token;
}
+ public String getWebDAVPassword() {
+ return webDAVPassword;
+ }
+
public void removeGlassPanel(){
glassPanel.removeFromParent();
}
return currentUserResource;
}
+ /**
+ * Modify the currentUserResource.
+ *
+ * @param newUser the new currentUserResource
+ */
+ public void setCurrentUserResource(UserResource newUser) {
+ currentUserResource = newUser;
+ }
+
public static native void preventIESelection() /*-{
$doc.body.onselectstart = function () { return false; };
}-*/;
return GWT.getModuleBaseURL() + conf.apiPath();
}
+ public void refreshWebDAVPassword() {
+ Configuration conf = (Configuration) GWT.create(Configuration.class);
+ String domain = Window.Location.getHostName();
+ String path = Window.Location.getPath();
+ String cookie = conf.webdavCookie();
+ webDAVPassword = Cookies.getCookie(cookie);
+ Cookies.setCookie(cookie, "", null, domain, path, false);
+ }
+
}