Active
Project:
Ajax Login/Register
Version:
6.x-2.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Jan 2010 at 23:13 UTC
Updated:
21 Mar 2011 at 14:44 UTC
Hi,
i was wondering if it is possible to just login / register without being redirect to my profile ? I just want to reload the page so it says "Welcome: john" ?
Thx in advance !
Comments
Comment #1
aaronl commentedI was wondering the same thing, whenever the "Ajax plugin - disable_redirect " is enabled, the login doesnt work
advise? Thanks!!
Comment #2
toyowheelin commentedI just ran into this issue as well, how can I simply login with no redirect?
Comment #3
Rowan Gray commentedI'm having the same problem, I tried to solve this with a redirect action on the login trigger, but this causes the AJAX to fail (the login still succeeds but the window doesn't close and no redirect, the ajax error message pops up)
Comment #4
jghyde commentedThis technique here http://drupal.org/node/574078#comment-2806610 works for remaining on the same page after logout. Tested and compliant logout-stay-on-same-page with ajax_register. I haven't solved the problem of how to stay on the same page after login.
Joe Hyde
http://www.hydeinteractive.com/
Comment #5
SphereOfSilence commentedSame issue here - anyone managed to solve this?
Comment #6
SphereOfSilence commentedFound a way ... sort of.
Using logging in as an example: The idea is to store the uri of the page calling the ajax login, in session variable. Then retrieve this uri at the form alter function, replacing action path of login form. This will ensure that the form submission leads to the calling page's uri, instead of the ajax login/register popup's uri.
Here's how I did it:
1) Include this lines of code in your page.tpl.php:
2. Include the following line right after line 74 of ajax_register.module:
$form['#action'] = $_SESSION['previous_uri'];
This gets the job done for me. I'm not sure if this has any drawbacks though. Anyone has any better ideas, I'm all ears.
Comment #7
BManuel commentedI get error with your code
I placed the code as the first line of page.tpl
and inserted the module code after
if ($form_id == 'user_login') {
//Set form to work with ajax
$form['#ajax'] = array(
'enabled' => TRUE
);
But I get an error when I try to login. pop up error.
what I my doing wrong?
thanks
Comment #8
jghyde commentedHere's another module to consider.
This is based loosely on the Ajax_Register module, except that instead of using Thickbox (which appears to no longer be a supported JQuery thing), it uses JQuery_UI's dialog plugin and Modal Frame API.
It stays on the same page after submitting the "log in" button and does the same for user/register too.
http://drupal.org/node/845218
Comment #9
mattwmc commentedI get an error as well: "ajax.module: An unknown error has occurred."
Is this the correct spot in the mod?
Comment #10
Berliner-dupe commentedHave the same error when i make this from #6
"ajax.module: An unknown error has accurred"
Have anyone an other idea how can i disable the redirect to own profile?
Comment #11
MrMaksimize commentedMight be a little late judging by the dates, but i found an answer in a different thread. check this out:
I'm bootstrapping the block in the template file, and I changed this function:
$query = drupal_get_destination(); will redirect you back to the node where you started.