Login updates
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 9 Jan 2018 20:24:06 +0000 (15:24 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 9 Jan 2018 20:24:06 +0000 (15:24 -0500)
Use the login page form instead of the pop form.

models/front/registrations/login.php
views/front/registrations/accountHeader.html
views/front/registrations/forgot.html
views/front/registrations/login.html

index 76cf51e..6087bed 100644 (file)
 
     public function modelAction($actionData = false)
     {
-        $view    = 'login';
-        $message = '';
+        $view          = 'login';
+        $message       = '';
         $modelRedirect = false;
+        $email         = '';
 
         // Check for $option
         $option = ( isset( $_REQUEST['option'] ) ) ? filter_var( $_REQUEST['option'], FILTER_SANITIZE_STRING) : null;
@@ -76,6 +77,7 @@
 
                 if ($this->wpdb->last_error || $returnData == NULL) {
                     $message = 'Login Fail';
+                    $email   = $username;
                 } else {
 
                     // Get the hashed password and ID from the user account
 
                     } else {
                         $message = 'Login Fail!';
+                        $email   = $username;
                     }
                 }
 
         $templateData = array(
             'page'     => 'login',
             'message'  => $message,
+            'email'    => $email,
             'regUrl'   => GLM_MEMBERS_REGISTRATIONS_SITE_BASE_URL.$this->config['settings']['canonical_reg_page'].'/',
             'loggedIn' => ( isset( $_SESSION['LoginAccount'] ) ) ? $_SESSION['LoginAccount']: false,
         );
index d3ccc22..d425053 100644 (file)
@@ -68,7 +68,7 @@
         </a>
         <span class="button glm-reg-header-btn" style="cursor: default;"> Logged in as {$loggedIn.fname} {$loggedIn.lname} </span>
     {else}
-        <a id="appLogin" class="button glm-reg-header-btn" href="#">
+        <a id="appLogin" class="button glm-reg-header-btn" href="{$regUrl}?page=login">
             <span>Login</span>
         </a>
         <a id="register" class="" href="{$regUrl}?page=register">
     {/if}
     </div>
 
-    <div id="glm-login-form" title="Login">
-        <p class="glm-required">All Fields Required</p>
-        <form action="{$regUrl}?page=login" method="post">
-            <input type="hidden" name="option" value="submit">
-            <input type="hidden" name="page" value="login">
-            <label>Email Address</label>
-            <input type="email" name="username" class="login-email text ui-widget-content ui-corner-all">
-            <label>Password</label>
-            <input type="password" name="password" class="login-password text ui-widget-content ui-corner-all">
-        </form>
-    </div>
-
 </div>
 <script type="text/javascript">
 var glmWidget = {
@@ -130,50 +118,6 @@ jQuery(document).ready(function($) {
     $("#appLogin").click(function(){
         dialog.dialog( 'open' );
     });
-    function checkEmail(email){
-        var regex = {literal}/^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/{/literal};
-        if( !regex.test(email.val().trim()) ) {
-            email.addClass( 'ui-state-error' );
-            return false;
-        } else {
-            return true;
-        }
-    };
-    function checkLength( o, n, min, max ) {
-      if ( o.val().length > max || o.val().length < min ) {
-        o.addClass( "ui-state-error" );
-        updateTips( "Length of " + n + " must be between " +
-          min + " and " + max + "." );
-        return false;
-      } else {
-        return true;
-      }
-    }
-    dialog = $("#glm-login-form").dialog({
-        autoOpen: false,
-        resizable: false,
-        modal: true,
-        width: 350,
-        height: 330,
-        closeText: "cancel",
-        buttons: {
-            "Login": function(){
-                var valid = true;
-
-                valid = valid && checkEmail( email );
-                valid = valid && checkLength( email, 'username', 6, 80 );
-                valid = valid && checkLength( password, 'password', 5, 16 );
-
-                console.log( email );
-                console.log( password );
-                console.log( valid );
-                return false;
-            },
-            "Cancel": function(){
-                $(this).dialog('close');
-            },
-        },
-    });
 
 });
 </script>
index f4eb9f8..b8bfa33 100644 (file)
@@ -3,12 +3,18 @@
 <form action="{$regUrl}?page=forgot" method="post">
     <input type="hidden" name="option" value="submit">
     <input type="hidden" name="page" value="forgot">
-    <div class="glm-reg-forgot">
-        <h4>Forgot Password</h4>
-        {if $message}
-            <span style="color: red;">{$message}</span>
-        {/if}
-        <input class="login" placeholder="Email Address" type="email" name="username" value="">
-        <input type="submit" class="accountLogin" value="Reset Password">
+    <div class="glm-row">
+        <div class="glm-columns glm-small-12 glm-medium-8">
+
+            <div class="glm-reg-forgot">
+                <h4>Forgot Password</h4>
+                {if $message}
+                    <span style="color: red;">{$message}</span>
+                {/if}
+                <input class="login" placeholder="Email Address" type="email" name="username" value="">
+                <input type="submit" class="button accountLogin" value="Reset Password">
+            </div>
+
+        </div>
     </div>
 </form>
index 7372b33..1ff0895 100644 (file)
@@ -10,7 +10,7 @@
 
                 <h4>Login</h4>
                 <div class="glm-row">
-                    <div class="glm-columns glm-large--12">
+                    <div class="glm-columns glm-large-12">
                         {if $message}<span style="color: red;">{$message}</span>{/if}
                     </div>
                 </div>
@@ -19,7 +19,7 @@
                         <label style="color:red;">Email Address</label>
                     </div>
                     <div class="glm-columns glm-small-12">
-                        <input class="login" type="email" name="username" value="">
+                        <input class="login" type="email" name="username" value="{$email}">
                     </div>
                 </div>
                 <div class="glm-row">
                 </div>
                 <div class="glm-row">
                     <div class="glm-columns glm-large--12">
-                        <input type="submit" class="accountLogin" value="Login">
-                    </div>
-                </div>
-                <div class="glm-row">
-                    <div class="glm-columns glm-large--12">
-                        <a class="forgotLogin" href="{$regUrl}?page=forgot">Forgot Password</a>
+                        <input class="button" type="submit" class="accountLogin" value="Login">
                     </div>
                 </div>
+                <!-- <div class="glm&#45;row"> -->
+                <!--     <div class="glm&#45;columns glm&#45;large&#45;&#45;12"> -->
+                <!--         <a class="forgotLogin" href="{$regUrl}?page=forgot">Forgot Password</a> -->
+                <!--     </div> -->
+                <!-- </div> -->
 
         </8div>
         </div>