improved google auth

This commit is contained in:
SJ 2013-09-26 23:20:56 +02:00
parent 74ab6f0193
commit e298d2b9c0
2 changed files with 35 additions and 24 deletions

View File

@ -32,27 +32,33 @@
<div id="logo-lg"><img src="<?php print SITE_URL; ?><?php print SITE_LOGO_LG; ?>" alt="Archive Logo Image" title="Login" /></div> <div id="logo-lg"><img src="<?php print SITE_URL; ?><?php print SITE_LOGO_LG; ?>" alt="Archive Logo Image" title="Login" /></div>
<form name="login" action="login.php" method="post" class="form-signin"> <form name="login" action="login.php" method="post" class="form-signin">
<h2 class="form-signin-heading"><?php print $text_login; ?></h2> <h2 class="form-signin-heading"><?php print $text_login; ?></h2>
<?php if(isset($x)){ ?><p class="alert alert-error lead"><?php print $x; ?></p><?php } ?> <?php if(isset($x)){ ?><p class="alert alert-error lead"><?php print $x; ?></p><?php } ?>
<input type="hidden" name="relocation" value="<?php if(isset($_GET['route']) && !preg_match("/^login/", $_GET['route']) ) { if(isset($_SERVER['REDIRECT_URL'])) { print $_SERVER['REDIRECT_URL']; } else { print $_SERVER['QUERY_STRING']; } } ?>" /> <input type="hidden" name="relocation" value="<?php if(isset($_GET['route']) && !preg_match("/^login/", $_GET['route']) ) { if(isset($_SERVER['REDIRECT_URL'])) { print $_SERVER['REDIRECT_URL']; } else { print $_SERVER['QUERY_STRING']; } } ?>" />
<?php if(ENABLE_GOOGLE_LOGIN == 1 && $_SERVER['QUERY_STRING'] == '') { ?> <input type="text" class="input-block-level" name="username" placeholder="<?php print $text_email; ?>">
<div class="info"><a href="<?php print $auth_url; ?>"><?php print $text_login_via_google; ?></a></div> <input type="password" class="input-block-level" name="password" placeholder="<?php print $text_password; ?>">
<?php } else { ?>
<input type="text" class="input-block-level" name="username" placeholder="<?php print $text_email; ?>">
<input type="password" class="input-block-level" name="password" placeholder="<?php print $text_password; ?>">
<?php if(CAPTCHA_FAILED_LOGIN_COUNT > 0 && $failed_login_count > CAPTCHA_FAILED_LOGIN_COUNT) { ?> <?php if(CAPTCHA_FAILED_LOGIN_COUNT > 0 && $failed_login_count > CAPTCHA_FAILED_LOGIN_COUNT) { ?>
<img src="securimage/securimage_show.php" alt="captcha image" id="captcha" /> <img src="securimage/securimage_show.php" alt="captcha image" id="captcha" />
<input type="text" class="input-block-level" name="captcha" placeholder="CAPTCHA" /> <input type="text" class="input-block-level" name="captcha" placeholder="CAPTCHA" />
<?php } ?>
<button class="btn btn-large btn-primary" type="submit" value="<?php print $text_submit; ?>"><?php print $text_submit; ?></button>
<?php } ?> <?php } ?>
<button class="btn btn-large btn-primary" type="submit" value="<?php print $text_submit; ?>"><?php print $text_submit; ?></button>
</form> </form>
<div id="compatibility" class="well well-large"><?php print COMPATIBILITY; ?></div>
<div id="compatibility" class="well well-large">
<?php if(ENABLE_GOOGLE_LOGIN == 1) { ?>
<p><a href="<?php print $auth_url; ?>"><?php print $text_login_via_google; ?></a></p>
<?php } ?>
<p><?php print COMPATIBILITY; ?></p>
</div>
</div> </div>

View File

@ -36,27 +36,32 @@
<div id="logo-lg"><img src="<?php print SITE_URL; ?><?php print SITE_LOGO_LG; ?>" alt="Archive Logo Image" title="<?php print $text_login; ?>" /></div> <div id="logo-lg"><img src="<?php print SITE_URL; ?><?php print SITE_LOGO_LG; ?>" alt="Archive Logo Image" title="<?php print $text_login; ?>" /></div>
<form name="login" action="login.php" method="post" class="form-signin"> <form name="login" action="login.php" method="post" class="form-signin">
<h2 class="form-signin-heading"><?php print $text_login; ?></h2> <h2 class="form-signin-heading"><?php print $text_login; ?></h2>
<?php if(isset($x)){ ?><p class="alert alert-error lead"><?php print $x; ?></p><?php } ?> <?php if(isset($x)){ ?><p class="alert alert-error lead"><?php print $x; ?></p><?php } ?>
<input type="hidden" name="relocation" value="<?php if(isset($_GET['route']) && !preg_match("/^login/", $_GET['route']) ) { if(isset($_SERVER['REDIRECT_URL'])) { print $_SERVER['REDIRECT_URL']; } else { print $_SERVER['QUERY_STRING']; } } ?>" /> <input type="hidden" name="relocation" value="<?php if(isset($_GET['route']) && !preg_match("/^login/", $_GET['route']) ) { if(isset($_SERVER['REDIRECT_URL'])) { print $_SERVER['REDIRECT_URL']; } else { print $_SERVER['QUERY_STRING']; } } ?>" />
<?php if(ENABLE_GOOGLE_LOGIN == 1 && $_SERVER['QUERY_STRING'] == '') { ?> <input type="text" class="input-block-level" name="username" placeholder="<?php print $text_email; ?>">
<div class="info"><a href="<?php print $auth_url; ?>"><?php print $text_login_via_google; ?></a></div> <input type="password" class="input-block-level bold" name="password" placeholder="<?php print $text_password; ?>">
<?php } else { ?>
<input type="text" class="input-block-level" name="username" placeholder="<?php print $text_email; ?>">
<input type="password" class="input-block-level bold" name="password" placeholder="<?php print $text_password; ?>">
<?php if(CAPTCHA_FAILED_LOGIN_COUNT > 0 && $failed_login_count > CAPTCHA_FAILED_LOGIN_COUNT) { ?> <?php if(CAPTCHA_FAILED_LOGIN_COUNT > 0 && $failed_login_count > CAPTCHA_FAILED_LOGIN_COUNT) { ?>
<img src="securimage/securimage_show.php" alt="captcha image" id="captcha" /> <img src="securimage/securimage_show.php" alt="captcha image" id="captcha" />
<input type="text" class="input-block-level" name="captcha" placeholder="CAPTCHA" /> <input type="text" class="input-block-level" name="captcha" placeholder="CAPTCHA" />
<?php } ?> <?php } ?>
<button class="btn btn-large btn-primary" type="submit" value="<?php print $text_submit; ?>"><?php print $text_submit; ?></button> <button class="btn btn-large btn-primary" type="submit" value="<?php print $text_submit; ?>"><?php print $text_submit; ?></button>
<?php } ?>
</form> </form>
<div id="compatibility" class="well well-large"><?php print COMPATIBILITY; ?></div> <div id="compatibility" class="well well-large">
<?php if(ENABLE_GOOGLE_LOGIN == 1) { ?>
<p><a href="<?php print $auth_url; ?>"><?php print $text_login_via_google; ?></a></p>
<?php } ?>
<p><?php print COMPATIBILITY; ?></p>
</div>
</div> </div>