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.5 to e5cd757
Date Mon, 16 Feb 2015 10:02:00 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.5 8ad2e309a -> e5cd75790


CLOUDSTACK-7085, CLOUDSTACK-7084: disallow empty passwords

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/e5cd7579
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e5cd7579
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e5cd7579

Branch: refs/heads/4.5
Commit: e5cd75790a64e4ba2e8bef83affabe6db4de8acd
Parents: 8ad2e30
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:31:22 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/e5cd7579/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/e5cd7579/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 8f223ac..122fd43 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