airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndo...@apache.org
Subject [1/2] airavata-php-gateway git commit: AIRAVATA - 1853
Date Thu, 15 Oct 2015 16:18:11 GMT
Repository: airavata-php-gateway
Updated Branches:
  refs/heads/master 93754768e -> 3bd7b2512


AIRAVATA - 1853

Password validations improved. Will not affect existing accounts.
Password should now contain at least-
- A digit[0-9]
- A lower case letter[a-z]
- An upper case letter[A-Z]
- One of !@#$%&* characters


Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/8a20dab1
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/8a20dab1
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/8a20dab1

Branch: refs/heads/master
Commit: 8a20dab19632b459109b87d99c52cd1243e68eb0
Parents: cf050d5
Author: Nipurn Doshi <nipunhere@gmail.com>
Authored: Thu Oct 15 12:09:12 2015 -0400
Committer: Nipurn Doshi <nipunhere@gmail.com>
Committed: Thu Oct 15 12:09:12 2015 -0400

----------------------------------------------------------------------
 app/controllers/AccountController.php |  8 ++++++--
 app/views/account/create.blade.php    | 10 +++++++++-
 2 files changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/8a20dab1/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index eac2f0b..d06f90c 100755
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -12,12 +12,16 @@ class AccountController extends BaseController
     {
         $rules = array(
             "username" => "required|min:6",
-            "password" => "required|min:6",
+            "password" => "required|min:6|regex:/^.*(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[!$#%]).*$/",
             "confirm_password" => "required|same:password",
             "email" => "required|email",
         );
 
-        $validator = Validator::make(Input::all(), $rules);
+        $messages = array(
+            'password.regex' => 'Password needs to contain at least (a) One lower case
letter (b) One Upper case letter and (c) One number (d) One of the following special characters
- !@#$%&*',
+        );
+
+        $validator = Validator::make(Input::all(), $rules, $messages);
         if ($validator->fails()) {
             $messages = $validator->messages();
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/8a20dab1/app/views/account/create.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/create.blade.php b/app/views/account/create.blade.php
index e7b3a32..f678498 100755
--- a/app/views/account/create.blade.php
+++ b/app/views/account/create.blade.php
@@ -39,7 +39,7 @@
         <div class="form-group required"><label class="control-label">Password</label>
 
             <div><input class="form-control" id="password" minlength="6" name="password"
placeholder="Password"
-                        required="required" title="" type="password"/></div>
+                        required="required" title="" type="password" data-container="body"
data-toggle="popover" data-placement="left" data-content="Password needs to contain at least
(a) One lower case letter (b) One Upper case letter and (c)  (c) One number (d) One of the
following special characters - !@#$%&*"/></div>
         </div>
         <div class="form-group required"><label class="control-label">Password
(again)</label>
 
@@ -122,3 +122,11 @@
 
 @stop
 
+@section('scripts')
+@parent
+<script>
+    $("#password").popover({
+        'trigger':'focus'
+    });
+</script>
+@stop


Mime
View raw message