cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject git commit: updated refs/heads/4.4 to a8273c0
Date Mon, 16 Feb 2015 10:02:20 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4 fbafc957d -> a8273c0a9


CLOUDSTACK-7085, CLOUDSTACK-7084: disallow empty passwords

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit e5cd75790a64e4ba2e8bef83affabe6db4de8acd)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/a8273c0a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a8273c0a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a8273c0a

Branch: refs/heads/4.4
Commit: a8273c0a94216175619f800d22e3595c0058f1c0
Parents: fbafc95
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Mon Feb 16 15:31:22 2015 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Mon Feb 16 15:32:12 2015 +0530

----------------------------------------------------------------------
 .../cloudstack/api/command/admin/account/CreateAccountCmd.java   | 4 ++++
 .../apache/cloudstack/api/command/admin/user/CreateUserCmd.java  | 4 ++++
 2 files changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a8273c0a/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java
b/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java
index 50d67d9..ec3090f 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java
@@ -31,6 +31,7 @@ import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.response.AccountResponse;
 import org.apache.cloudstack.api.response.DomainResponse;
 import org.apache.cloudstack.context.CallContext;
+import org.apache.commons.lang.StringUtils;
 
 import com.cloud.user.Account;
 import com.cloud.user.UserAccount;
@@ -174,6 +175,9 @@ public class CreateAccountCmd extends BaseCmd {
 
     @Override
     public void execute() {
+        if (StringUtils.isEmpty(getPassword())) {
+            throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Empty passwords are not
allowed");
+        }
         CallContext.current().setEventDetails("Account Name: " + getAccountName() + ", Domain
Id:" + getDomainId());
         UserAccount userAccount =
             _accountService.createUserAccount(getUsername(), getPassword(), getFirstName(),
getLastName(), getEmail(), getTimeZone(), getAccountName(), getAccountType(),

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a8273c0a/api/src/org/apache/cloudstack/api/command/admin/user/CreateUserCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/user/CreateUserCmd.java b/api/src/org/apache/cloudstack/api/command/admin/user/CreateUserCmd.java
index bd67436..6f26040 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/user/CreateUserCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/user/CreateUserCmd.java
@@ -25,6 +25,7 @@ import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.response.DomainResponse;
 import org.apache.cloudstack.api.response.UserResponse;
 import org.apache.cloudstack.context.CallContext;
+import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
 
 import com.cloud.user.Account;
@@ -149,6 +150,9 @@ public class CreateUserCmd extends BaseCmd {
 
     @Override
     public void execute() {
+        if (StringUtils.isEmpty(getPassword())) {
+            throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Empty passwords are not
allowed");
+        }
         CallContext.current().setEventDetails("UserName: " + getUserName() + ", FirstName
:" + getFirstName() + ", LastName: " + getLastName());
         User user =
             _accountService.createUser(getUserName(), getPassword(), getFirstName(), getLastName(),
getEmail(), getTimezone(), getAccountName(), getDomainId(),


Mime
View raw message