Work for Oauth

This commit is contained in:
Deon George 2013-05-23 15:42:56 +10:00
parent c06068fc90
commit ab1adad456
7 changed files with 415 additions and 52 deletions

View File

@ -40,12 +40,22 @@ class lnApp_Controller_Login extends Controller_TemplateDefault {
}
}
$output .= View::factory('pages/login');
$oauthlogin = is_null($x=Session::instance()->get_once('login-no-oauth',NULL)) ? TRUE : ! $x;
$output .= View::factory('pages/login')
->set('oauth',$oauthlogin);
Style::factory()
->type('file')
->data('media/theme/baseadmin/css/pages/login.css');
Style::factory()
->type('file')
->data('media/css/auth-buttons.css');
if ($oauthlogin)
foreach (ORM::factory('Oauth')->list_active() as $oo)
$output .= $oo->plugin()->html();
$this->template->content = $output;
$this->template->shownavbar = FALSE;
}

382
media/css/auth-buttons.css Normal file
View File

@ -0,0 +1,382 @@
/**
* Button Object
*/
/**
* 1. Corrects inability to style clickable 'input' types in iOS
* 2. Remove excess padding in IE6/7
* 3. IE6/7 inline-block hack for native block-level elements
*/
.btn-auth,
.btn-auth:visited {
position: relative;
display: inline-block;
height: 22px;
padding: 0 1em;
border: 1px solid #999;
border-radius: 2px;
margin: 0;
text-align: center;
text-decoration: none;
font-size: 14px;
line-height: 22px;
white-space: nowrap;
cursor: pointer;
color: #222;
background: #fff;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
/* iOS */
-webkit-appearance: none; /* 1 */
/* IE6/7 hacks */
*overflow: visible; /* 2 */
*display: inline; /* 3 */
*zoom: 1; /* 3 */
}
.btn-auth:hover,
.btn-auth:focus,
.btn-auth:active {
color: #222;
text-decoration: none;
}
.btn-auth:before {
content: "";
float: left;
width: 22px;
height: 22px;
background: url(../img/auth-icons.png) no-repeat 99px 99px;
}
/**
* 36px
*/
.btn-auth.large {
height: 36px;
line-height: 36px;
font-size: 20px;
}
.btn-auth.large:before {
width: 36px;
height: 36px;
}
/*
* Remove excess padding and border in FF3+
*/
.btn-auth::-moz-focus-inner {
border: 0;
padding: 0;
}
/* Facebook (extends .btn-auth)
========================================================================== */
.btn-facebook,
.btn-facebook:visited {
border-color: #29447e;
border-bottom-color: #1a356e;
color: #fff;
background-color: #5872a7;
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#637bad), to(#5872a7));
background-image: -webkit-linear-gradient(#637bad, #5872a7);
background-image: -moz-linear-gradient(#637bad, #5872a7);
background-image: -ms-linear-gradient(#637bad, #5872a7);
background-image: -o-linear-gradient(#637bad, #5872a7);
background-image: linear-gradient(#637bad, #5872a7);
-webkit-box-shadow: inset 0 1px 0 #879ac0;
box-shadow: inset 0 1px 0 #879ac0;
}
.btn-facebook:hover,
.btn-facebook:focus {
color: #fff;
background-color: #3b5998;
}
.btn-facebook:active {
color: #fff;
background: #4f6aa3;
-webkit-box-shadow: inset 0 1px 0 #45619d;
box-shadow: inset 0 1px 0 #45619d;
}
/*
* Icon
*/
.btn-facebook:before {
border-right: 1px solid #465f94;
margin: 0 1em 0 -1em;
background-position: 0 0;
}
.btn-facebook.large:before {
background-position: 0 -22px;
}
/* GitHub
========================================================================== */
.btn-github,
.btn-github:visited {
border-color: #d4d4d4;
background: #ececec;
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f4f4f4), to(#ececec));
background-image: -webkit-linear-gradient(#f4f4f4, #ececec);
background-image: -moz-linear-gradient(#f4f4f4, #ececec);
background-image: -ms-linear-gradient(#f4f4f4, #ececec);
background-image: -o-linear-gradient(#f4f4f4, #ececec);
background-image: linear-gradient(#f4f4f4, #ececec);
}
.btn-github:hover,
.btn-github:focus {
border-color: #518cc6;
border-bottom-color: #2a65a0;
color: #fff;
background-color: #599bdc;
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#599bdc), to(#3072b3));
background-image: -webkit-linear-gradient(#599bdc, #3072b3);
background-image: -moz-linear-gradient(#599bdc, #3072b3);
background-image: -ms-linear-gradient(#599bdc, #3072b3);
background-image: -o-linear-gradient(#599bdc, #3072b3);
background-image: linear-gradient(#599bdc, #3072b3);
}
.btn-github:active {
border-color: #2A65A0;
border-bottom-color: #518CC6;
color: #fff;
background: #3072B3;
background: -webkit-gradient(linear, 0 0, 0 100%, from(#3072b3), to(#599bdc));
background: -webkit-linear-gradient(#3072b3, #599bdc);
background: -moz-linear-gradient(#3072b3, #599bdc);
background: -ms-linear-gradient(#3072b3, #599bdc);
background: -o-linear-gradient(#3072b3, #599bdc);
background: linear-gradient(#3072b3, #599bdc);
}
/*
* Icon
*/
.btn-github:before {
margin: 0 0.6em 0 -0.6em;
background-position: -44px 0;
}
.btn-github:hover:before,
.btn-github:focus:before,
.btn-github:active:before {
background-position: -66px 0;
}
.btn-github.large:before {
background-position: -72px -22px;
}
.btn-github.large:hover:before,
.btn-github.large:focus:before,
.btn-github.large:active:before {
background-position: -108px -22px;
}
/* Google
========================================================================== */
.btn-google,
.btn-google:visited {
border-color: #3079ed;
color: #fff;
background: #4787ed;
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#4d90fe), to(#4787ed));
background-image: -webkit-linear-gradient(#4d90fe, #4787ed);
background-image: -moz-linear-gradient(#4d90fe, #4787ed);
background-image: -ms-linear-gradient(#4d90fe, #4787ed);
background-image: -o-linear-gradient(#4d90fe, #4787ed);
background-image: linear-gradient(#4d90fe, #4787ed);
}
.btn-google:hover,
.btn-google:focus,
.btn-google:active {
color: #fff;
background-color: #357ae8;
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#4d90fe), to(#357ae8));
background-image: -webkit-linear-gradient(#4d90fe, #357ae8);
background-image: -moz-linear-gradient(#4d90fe, #357ae8);
background-image: -ms-linear-gradient(#4d90fe, #357ae8);
background-image: -o-linear-gradient(#4d90fe, #357ae8);
background-image: linear-gradient(#4d90fe, #357ae8);
}
.btn-google:active {
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}
/*
* Icon
*/
.btn-google:before {
margin: 0 1em 0 -1em;
background-position: -88px 0;
background-color: #e6e6e6;
}
.btn-google.large:before {
background-position: -144px -22px;
}
/* Open ID
========================================================================== */
.btn-openid:hover,
.btn-openid:focus {
border-color: #777;
background: #fcfcfc;
}
.btn-openid:active {
background: #f5f5f5;
}
/*
* Icon
*/
.btn-openid:before {
margin: 0 0.6em 0 -0.6em;
background-position: -154px 0;
}
.btn-openid.large:before {
background-position: -252px -22px;
}
/* Twitter
========================================================================== */
.btn-twitter,
.btn-twitter:visited {
border-color: #a6cde6;
color: #327695;
background: #cfe4f0;
/* css3 */
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f1f5f7), to(rgba(255, 255, 255, 0)));
background-image: -webkit-linear-gradient(#f1f5f7, rgba(255, 255, 255, 0));
background-image: -moz-linear-gradient(#f1f5f7, rgba(255, 255, 255, 0));
background-image: -ms-linear-gradient(#f1f5f7, rgba(255, 255, 255, 0));
background-image: -o-linear-gradient(#f1f5f7, rgba(255, 255, 255, 0));
background-image: linear-gradient(#f1f5f7, rgba(255, 255, 255, 0));
-webkit-box-shadow: inset 0 1px 0 #fff;
box-shadow: inset 0 1px 0 #fff;
}
.btn-twitter:hover,
.btn-twitter:focus,
.btn-twitter:active {
color: #327695;
border-color: #8dc2e4;
background-color: #cadde9;
}
.btn-twitter:active {
background: #cadde9;
-webkit-box-shadow: inset 0 1px 0 #bbd6e7;
box-shadow: inset 0 1px 0 #bbd6e7;
}
/*
* Icon
*/
.btn-twitter:before {
margin: 0 0.6em 0 -0.6em;
background-position: -22px 0;
}
.btn-twitter.large:before {
background-position: -36px -22px;
}
/* Windows Live ID
========================================================================== */
.btn-windows:hover,
.btn-windows:focus {
border-color: #777;
background: #fcfcfc;
}
.btn-windows:active {
background: #f5f5f5;
}
/*
* Icon
*/
.btn-windows:before {
margin: 0 0.6em 0 -0.6em;
background-position: -110px 0;
}
.btn-windows.large:before {
background-position: -180px -22px;
}
/* Yahoo!
========================================================================== */
.btn-yahoo,
.btn-yahoo:visited {
border-color: #ffb305;
background: #ffc426;
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(rgba(255, 255, 255, 0.5)), to(rgba(255, 255, 255, 0)));
background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
background-image: -o-linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
background-image: linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
}
.btn-yahoo:hover,
.btn-yahoo:focus {
background-color: #fabf20;
}
.btn-yahoo:active {
border-color: #f09700;
background-image: none;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.3);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.3);
}
/*
* Icon
*/
.btn-yahoo:before {
margin: 0 0.6em 0 -0.6em;
background-position: -132px 0;
}
.btn-yahoo.large:before {
background-position: -216px -22px;
}

BIN
media/img/auth-icons.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@ -86,6 +86,10 @@ body{ color:#838383; /*font: 13px/1.7em 'Open Sans';*/}
border-left: none;
}
.login-social p {
margin-bottom: 1em;
}
span.login-checkbox {
float: left;
margin-top: 31px;
@ -137,52 +141,23 @@ span.login-checkbox > input[type='checkbox']:checked + label {
}
/** Buttons **/
.twitter, .fb {
.social-btn {
position: relative;
height: 32px;
width: 157px;
width: 155px;
display: block;
background: url(../../img/login/twitter_btn.png) no-repeat;
padding-right: 5px;
float: left;
}
.fb {
width: 162px;
background: url(../../img/login/fb_btn.png) no-repeat;
}
.twitter:active, .fb:active {
top: 1px;
}
.twitter:hover, .fb:hover {
background-position: 0 -32px;
}
.twitter a, .fb a {
padding: 5px 0 0 35px;
text-shadow: -1px -1px 0px rgba(0,0,0,.3);
color:#fff;
font-weight: bold;
.social-btn a {
font-size: 11px;
height: 32px;
display: block;
}
.fb a {
padding: 5px 0 0 31px;
}
.twitter, .fb {
display: inline-block;
}
.twitter a:hover, .fb a:hover {
color: #FFF;
.social-btn a:hover {
text-decoration: none;
}
@ -241,11 +216,6 @@ span.login-checkbox > input[type='checkbox']:checked + label {
width: 100%;
}
.twitter {
display: block;
margin-bottom: 1em;
}
.register .login-fields input {
width: 204px;
padding-left: 6px;
@ -253,11 +223,13 @@ span.login-checkbox > input[type='checkbox']:checked + label {
}
.modal-body {
max-height: 500px;
}
.modal-body .account-container {
margin-top: 10px;
}
.modal-body .account-container h1 {
font-weight: normal;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -17,6 +17,7 @@
</div> <!-- /login-fields -->
<div class="login-actions">
Forgot your <a href="<?php echo URL::site('login/reset'); ?>" data-toggle="modal" data-target="#modal-reset">Password</a>?
<!--
<span class="login-checkbox">
<input id="Field" name="Field" type="checkbox" class="field login-checkbox" value="First Choice" tabindex="4" />
@ -26,18 +27,16 @@
<button class="button btn btn-warning btn-large">Sign In</button>
</div> <!-- .actions -->
<!--
<?php if ($oauth) : ?>
<div class="login-social">
<p>Sign in using social network:</p>
<div class="twitter">
<a href="#" class="btn_1">Login with Twitter</a>
<?php foreach (ORM::factory('Oauth')->list_active() as $oo) : ?>
<div class="social-btn">
<?php echo HTML::anchor('oauth/login/'.$oo->name,'Login with <b>'.ucfirst($oo->name).'</b>',array('class'=>'btn-auth btn-'.$oo->name)); ?>
</div>
<div class="fb">
<a href="#" class="btn_2">Login with Facebook</a>
<?php endforeach ?>
</div>
</div>
-->
<?php endif ?>
</form>
</div> <!-- /content -->
</div> <!-- /account-container -->
@ -45,8 +44,8 @@
<!-- Text Under Box -->
<div class="login-extra">
<!-- Don't have an account? <a href="./signup.html">Sign Up</a><br/> -->
Forgot your <a href="<?php echo URL::site('login/reset'); ?>" data-toggle="modal" data-target="#modal-reset">Password</a>?
</div> <!-- /login-extra -->
<div class="modal hide fade" id="modal-reset" role="dialog" aria-hidden="true">
<div class="modal-body"></div>
</div>
<div class="fb-root"></div>