Permalink
Browse files

Fixed direct login issue

  • Loading branch information...
1 parent b97e5c7 commit fcc28410c57f212595b5ba7e9b7adc41ce654dff @ericmmartin ericmmartin committed Jul 19, 2010
Showing with 19 additions and 13 deletions.
  1. +3 −3 css/default.css
  2. +2 −2 css/osx.css
  3. +3 −3 js/default.js
  4. +5 −4 js/osx.js
  5. +6 −1 simplemodal-login.php
View
6 css/default.css
@@ -9,13 +9,13 @@
#simplemodal-login-container {width:350px;}
#simplemodal-login-container a {color:#666;}
#simplemodal-login-container .message,
-#simplemodal-login-container #login_error {background-color: #ffebe8; border:1px solid #c00; margin-bottom:8px; padding:6px; -moz-border-radius:3px; -khtml-border-radius:3px; -webkit-border-radius:3px; border-radius:3px;}
+#simplemodal-login-container #login_error {background-color: #ffebe8; border:1px solid #c00; margin-bottom:8px; padding:6px; -moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px;}
#simplemodal-login-container .message {background-color:#ffffe0; border-color:#e6db55;}
-#simplemodal-login-container form {background:#fff; border:1px solid #e5e5e5; font-weight:normal; margin-left:0 auto; padding:16px; text-align:left; -moz-border-radius:11px; -khtml-border-radius:11px; -webkit-border-radius:11px; border-radius:5px; -moz-box-shadow:rgba(200,200,200,1) 0 4px 18px; -webkit-box-shadow:rgba(200,200,200,1) 0 4px 18px; -khtml-box-shadow:rgba(200,200,200,1) 0 4px 18px; box-shadow:rgba(200,200,200,1) 0 4px 18px;}
+#simplemodal-login-container form {background:#fff; border:1px solid #e5e5e5; font-weight:normal; margin-left:0 auto; padding:16px; text-align:left; -moz-border-radius:11px; -webkit-border-radius:11px; border-radius:5px; -moz-box-shadow:rgba(200,200,200,1) 0 4px 18px; -webkit-box-shadow:rgba(200,200,200,1) 0 4px 18px; box-shadow:rgba(200,200,200,1) 0 4px 18px;}
#simplemodal-login-container form label {color:#777; font-size:13px;}
#simplemodal-login-container form p {margin:0;}
#simplemodal-login-container form .forgetmenot {font-size:11px; font-weight:normal; float:left; line-height:19px; margin-bottom:0; }
-#simplemodal-login-container form .submit input {background-color:#257ea8; border:none; border:1px solid; color:#fff; font-weight:bold; padding:3px 10px; font-size:12px; -moz-border-radius:11px; -khtml-border-radius:11px; -webkit-border-radius:11px; border-radius:11px; cursor:pointer; text-decoration:none; margin-top:-3px;}
+#simplemodal-login-container form .submit input {background-color:#257ea8; border:none; border:1px solid; color:#fff; font-weight:bold; padding:3px 10px; font-size:12px; -moz-border-radius:11px; -webkit-border-radius:11px; border-radius:11px; cursor:pointer; text-decoration:none; margin-top:-3px;}
#simplemodal-login-container form .submit {float:right;}
#simplemodal-login-container form .submit input.simplemodal-close {background-color:#c00;}
#simplemodal-login-container .title {color:#257ea8; font-size:18px; padding-bottom:12px;}
View
4 css/osx.css
@@ -6,9 +6,9 @@
*/
#simplemodal-login-overlay-osx {background-color:#000; cursor:wait;}
-#simplemodal-login-container-osx {background-color:#eee; color:#000; font-family:"Lucida Grande",Arial,sans-serif; font-size:12px; padding-bottom:4px; width:350px; -moz-border-radius-bottomleft:6px; -webkit-border-bottom-left-radius:6px; -moz-border-radius-bottomright:6px; -webkit-border-bottom-right-radius:6px; -moz-box-shadow:0 0 64px #000; -webkit-box-shadow:0 0 64px #000;}
+#simplemodal-login-container-osx {background-color:#eee; color:#000; font-family:"Lucida Grande",Arial,sans-serif; font-size:12px; padding-bottom:4px; text-align:left; border-radius:0 0 6px 6px; -moz-border-radius-bottomleft:6px; -webkit-border-bottom-left-radius:6px; -moz-border-radius-bottomright:6px; -webkit-border-bottom-right-radius:6px; box-shadow:0 0 64px #000; -moz-box-shadow:0 0 64px #000; -webkit-box-shadow:0 0 64px #000;}
#simplemodal-login-container-osx .message,
-#simplemodal-login-container-osx #login_error {background-color: #ffebe8; border:1px solid #c00; margin-bottom:8px; padding:6px; -moz-border-radius:3px; -khtml-border-radius:3px; -webkit-border-radius:3px; border-radius:3px;}
+#simplemodal-login-container-osx #login_error {background-color: #ffebe8; border:1px solid #c00; margin-bottom:8px; padding:6px; -moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px;}
#simplemodal-login-container-osx .message {background-color:#ffffe0; border-color:#e6db55;}
#simplemodal-login-container-osx a {color:#666;}
#simplemodal-login-container-osx p {margin:0;}
View
6 js/default.js
@@ -56,8 +56,8 @@ jQuery(function ($) {
fields = $('.simplemodal-login-fields', form[0]),
activity = $('.simplemodal-login-activity', form[0]);
- // resize and focus dialog
- !obj && s.modal.resize();
+ // update and focus dialog
+ !obj && s.modal.update();
s.dialog.container.css({height:'auto'});
form.unbind('submit.simplemodal-login').bind('submit.simplemodal-login', function (e) {
@@ -105,7 +105,7 @@ jQuery(function ($) {
form = s.login;
s.lostpw.hide(); s.register.hide();
s.login.show();
- s.modal.resize();
+ s.modal.update();
}
$('p:first', form[0]).before(message);
activity.hide(); fields.show();
View
9 js/osx.js
@@ -33,10 +33,11 @@ jQuery(function ($) {
$('#simplemodal-login-form').modal({
overlayId: 'simplemodal-login-overlay-osx',
containerId: 'simplemodal-login-container-osx',
+ minWidth: '350px',
closeHTML: '<div class="close"><a href="#" class="simplemodal-close">x</a></div>',
opacity:65,
- position:['0', null],
overlayClose:true,
+ position:['0', null],
onOpen:SimpleModalLogin.open,
onShow:SimpleModalLogin.show,
onClose:SimpleModalLogin.close
@@ -70,8 +71,8 @@ jQuery(function ($) {
fields = $('.simplemodal-login-fields', form[0]),
activity = $('.simplemodal-login-activity', form[0]);
- // resize and focus dialog
- !obj && s.modal.resize();
+ // update and focus dialog
+ !obj && s.modal.update();
s.dialog.container.css({height:'auto'});
form.unbind('submit.simplemodal-login').bind('submit.simplemodal-login', function (e) {
@@ -120,7 +121,7 @@ jQuery(function ($) {
form = s.login;
s.lostpw.hide(); s.register.hide();
s.login.show();
- s.modal.resize();
+ s.modal.update();
}
$('p:first', form[0]).before(message);
activity.hide(); fields.show();
View
7 simplemodal-login.php
@@ -248,6 +248,11 @@ function get_options() {
$options = $this->check_options();
$this->options = $options;
}
+
+ function is_ajax() {
+ return isset($_SERVER['HTTP_X_REQUESTED_WITH'])
+ && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest';
+ }
/**
* Checks to see if the given plugin is active.
@@ -434,7 +439,7 @@ function login_loginout($link) {
}
function login_redirect($redirect_to, $req_redirect_to, $user) {
- if (!isset($user->user_login)) {
+ if (!isset($user->user_login) || !$this->is_ajax()) {
return $redirect_to;
}
if ($this->is_plugin_active('peters-login-redirect/wplogin_redirect.php')

0 comments on commit fcc2841

Please sign in to comment.