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.3 to 30ec598
Date Mon, 16 Feb 2015 10:04:00 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.3 aa3b61503 -> 30ec59817


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>

Conflicts:
	api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java
	api/src/org/apache/cloudstack/api/command/admin/user/CreateUserCmd.java


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

Branch: refs/heads/4.3
Commit: 30ec59817d9bb2e3ceee4280214b6bc4dcf37565
Parents: aa3b615
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:33:45 2015 +0530

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30ec5981/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 94325f6..90ab7ad 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
@@ -28,6 +28,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 org.apache.log4j.Logger;
 
@@ -162,6 +163,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(),
                 getDomainId(), getNetworkDomain(), getDetails(), getAccountUUID(), getUserUUID());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30ec5981/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 378d636..72365b2 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,7 +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;
@@ -139,6 +139,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(), getUserUUID());
         if (user != null) {


Mime
View raw message