First of all sorry for my english =)
So in template.php i use -
function gonobobel_theme() {
return array(
'user_login' => array(
'template' => 'user-login',
'arguments' => array('form' => NULL),
),
);
}
function gonobobel_user_login($form) {
return drupal_render($form);
}
in user-login.tpl.php i use -
function loginform() {
$loginform=user_login_block();
$loginform['name']['#size']=15;
$loginform['name']['#title']="Name";
$loginform['name']['#description']=drupal_get_destination();
$loginform['pass']['#size']=8;
$loginform['pass']['#title']="Passwort";
$loginform['pass']['#description']="";
//print_r($loginform);
return $loginform;
}
print drupal_get_form('loginform');
in page.tpl.php i use -
print l("Увійти", 'user', array('attributes' => array('class' => 'popups')));
After submitting name\password as in picture 1 a see dot whill loading and then - picture 2. So main page stays the same, not logged in. but in popup "window" i am logged in.
Please help me to fix my problem!
Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | popups.js_.patch | 753 bytes | enzipher |
| #10 | popups.js_.patch | 560 bytes | enzipher |
| 2.jpg | 13.5 KB | gonobobel | |
| 1.jpg | 14.5 KB | gonobobel |
Comments
Comment #1
gonobobel commentedComment #2
starbow commentedComment #3
gonobobel commentednothing new happens. I used
in page.tpl.php, but all happens the same. please, help me!
Comment #4
phpsharma commentedremoved..
Comment #5
gonobobel commentedSo, people, how can I solve my problem?
Comment #6
starbow commentedread comment #4
Comment #7
pdcarto commentedDon't read comment #4 - it doesn't work! The problem is that after submitting the login form from a popup, the page is not reloaded, so no redirect action happens.
Comment #8
frankcarey commented#2 seems to work fine for me in 6.x.2.0-rc-5.
Comment #9
alextronic commentedI have exactly the same issue. #2 doesn't work for me... maybe there is another workaround? I'm using module Login destination, but doesn't seem to be the problem.
Comment #10
enzipher commentedAfter all this time I ran into this issue as well, that the page does not reload using "popups-form-reload" for the path "user". I got it working in my case by changing line 909 in popups.js as follows:
Before:
After:
This is not tested extensively and might have a negative impact on something else.
Cheers,
Comment #11
joseph28 commentedthe patch solve the problem if the username and password are correct, but what if the password or the username are wrong?
Comment #12
enzipher commentedI should have posted an update. I did some more testing and you are right, the patch pretty much bypasses the error check. I have updated the code I am using to check for an error in the returned content. This is based on the standard Drupal class names, so if you have modified the "error" class this will fail. That said, here is the updated code which I haven't encountered any problems with yet.
What the patch does is that instead of using the isDone() function, a check is made to see if the requested content contains
class="error".Cheers,
Comment #13
drewish commentedI didn't test it but just looking at the code it could be a bit tighter:
That said I think there might be a better way to do this.
Comment #14
enzipher commentedYes, some optimization would not hurt, however, in order to return true/false I needed to type cast the result. I changed the variable to make things more logical as well.
However, as you say there are probably better ways of doing this, but this works for my needs atm.
Comment #15
qilen commentedJust add
location.reload();
at the end of function: Popups.formSuccess = function(popup, data) {
it will be like this:
Popups.formSuccess = function(popup, data) {
blablabla...
location.reload();
};
/**
* Get a jQuery object for the content of a layer.
* @param layer
* Either a popup, or null to signify the original page.
*/