Use the login page form instead of the pop form.
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;
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,
);
</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 = {
$("#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>
<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>
<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>
<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-row"> -->
+ <!-- <div class="glm-columns glm-large--12"> -->
+ <!-- <a class="forgotLogin" href="{$regUrl}?page=forgot">Forgot Password</a> -->
+ <!-- </div> -->
+ <!-- </div> -->
</8div>
</div>