airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [2/3] airavata-php-gateway git commit: AIRAVATA-2403 Adding restrictions on username characters
Date Fri, 23 Jun 2017 01:38:35 GMT
AIRAVATA-2403 Adding restrictions on username 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/975bf9ff
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/975bf9ff
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/975bf9ff

Branch: refs/heads/develop
Commit: 975bf9ff8ec4a39e7cb5d4adeec2c8733ff2e2da
Parents: 1a744a3
Author: Marcus Christie <machrist@iu.edu>
Authored: Thu Jun 22 15:57:58 2017 -0400
Committer: Marcus Christie <machrist@iu.edu>
Committed: Thu Jun 22 15:57:58 2017 -0400

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


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/975bf9ff/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index 5a707db..867c4e3 100644
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -18,13 +18,14 @@ class AccountController extends BaseController
     public function createAccountSubmit()
     {
         $rules = array(
-            "username" => "required|min:6",
+            "username" => "required|min:6|regex:/^[a-z0-9_-]+$/",
             "password" => self::PASSWORD_VALIDATION,
             "confirm_password" => "required|same:password",
             "email" => "required|email",
         );
 
         $messages = array(
+            'username.regex' => "Username can only contain lowercase letters, numbers,
underscores and hyphens.",
             'password.regex' => self::PASSWORD_VALIDATION_MESSAGE,
         );
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/975bf9ff/app/views/account/create.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/create.blade.php b/app/views/account/create.blade.php
index d6d0748..d13d72b 100644
--- a/app/views/account/create.blade.php
+++ b/app/views/account/create.blade.php
@@ -33,7 +33,9 @@
         <div class="form-group required"><label class="control-label">Username</label>
 
             <div><input class="form-control" id="username" minlength="6" maxlength="30"
name="username"
-                        placeholder="Username" required="required" type="text" value="{{Input::old('username')
}}"/>
+                        placeholder="Username" required="required" type="text" value="{{Input::old('username')
}}"
+                        onblur="this.value = this.value.toLowerCase()"
+                        data-container="body" data-toggle="popover" data-placement="left"
data-content="Username can only contain lowercase letters, numbers, underscores and hyphens."/>
             </div>
         </div>
         <div class="form-group required"><label class="control-label">Password</label>
@@ -85,10 +87,7 @@
 @section('scripts')
 @parent
 <script>
-    $("#password").popover({
-        'trigger':'focus'
-    });
-    $("#email").popover({
+    $("[data-toggle=popover]").popover({
         'trigger':'focus'
     });
 </script>


Mime
View raw message