mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
create user functionality
This commit is contained in:
+14
@@ -158,6 +158,20 @@ public class CloudPresenter {
|
||||
|
||||
}
|
||||
|
||||
public void createUserAccount(String username, String password,
|
||||
String email, String website, String bio) throws CloudException {
|
||||
try {
|
||||
String res = service.createUser(username, password, email, website,
|
||||
bio);
|
||||
if (res == null)
|
||||
throw new CloudException("Could not create user account.");
|
||||
if (!SUCCESS.equals(res))
|
||||
throw new CloudException(res);
|
||||
} catch (Exception e) {
|
||||
throw new CloudException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public UserEntity getUserDetails() throws CloudException {
|
||||
String username = ConfigurationManager.getInstance().readString(
|
||||
USERNAME_KEY, null);
|
||||
|
||||
+4
-2
@@ -258,7 +258,7 @@ public class CloudPlugIn implements IPlugIn, CloudListener {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
UserEditDialog dialog = DialogFactory.getInstance()
|
||||
final UserEditDialog dialog = DialogFactory.getInstance()
|
||||
.createUserEditDialog(null);
|
||||
dialog.setVisible(true);
|
||||
if (ButtonDialog.OK.equals(dialog.getSelectedButtonCaption())) {
|
||||
@@ -266,7 +266,9 @@ public class CloudPlugIn implements IPlugIn, CloudListener {
|
||||
|
||||
@Override
|
||||
public Void doInBackground() throws Exception {
|
||||
|
||||
cloudPresenter.createUserAccount(dialog.getUserName(),
|
||||
dialog.getPassword(), dialog.getEmail(),
|
||||
dialog.getWebsite(), dialog.getBio());
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user