You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2019/12/28 11:33:38 UTC

[GitHub] [incubator-dolphinscheduler] Technoboy- commented on a change in pull request #1619: User update not check params

Technoboy- commented on a change in pull request #1619: User update  not check params
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1619#discussion_r361790815
 
 

 ##########
 File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UsersService.java
 ##########
 @@ -233,14 +239,29 @@ public User queryUser(String name, String password) {
         }
 
         if (StringUtils.isNotEmpty(userPassword)) {
+            if (!CheckUtils.checkPassword(userPassword)){
+                putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR,userPassword);
+                return result;
+            }
             user.setUserPassword(EncryptionUtils.getMd5(userPassword));
         }
 
         if (StringUtils.isNotEmpty(email)) {
+            if (!CheckUtils.checkEmail(email)){
+                putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR,email);
+                return result;
+            }
             user.setEmail(email);
         }
-        user.setQueue(queue);
+
+        if (StringUtils.isNotEmpty(phone)) {
+            if (!CheckUtils.checkPhone(phone)){
+                putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR,phone);
+                return result;
+            }
+        }
         user.setPhone(phone);
 
 Review comment:
   ```
   if (StringUtils.isNotEmpty(phone)) {
               if (!CheckUtils.checkPhone(phone)){
                   putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR,phone);
                   return result;
               }
           }
          user.setPhone(phone);
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services