Go Back   Web Scribble Forums » Joomla » jConnector
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-04-2009, 02:33 AM
Junior Member
 
Join Date: Aug 2009
Posts: 4
Default Redirecting to previous page

Hi all, anyone knows how to redirect previous page instead of homepage after login?
For example user is viewing 'index.php?option=com_mycom&view=myview' when user logs in with jconnector, I want the user redirected to 'index.php?option=com_mycom&view=myview' after login, how can I do this?
Reply With Quote
  #2 (permalink)  
Old 09-23-2009, 04:53 AM
Web Scribble Staff
 
Join Date: Jul 2009
Posts: 246
Default

Hi,

At the current moment jConnector redirects to a static page. So the best you can do is change this static page to another static page (in modules/mod_jconnector/jconnector_server.php).
Your idea makes good sense though and I am adding this to my ToDo list and this will be available in the future release.
Reply With Quote
  #3 (permalink)  
Old 10-11-2009, 04:57 AM
Junior Member
 
Join Date: Oct 2009
Posts: 1
Default More info

Hello!

I'm not sure what to change in jconnector_server.php. Can you provide more information?

Thank you.
Reply With Quote
  #4 (permalink)  
Old 10-12-2009, 11:18 AM
Web Scribble Staff
 
Join Date: Jul 2009
Posts: 246
Default

Hi,

Redirects are done by a function called header(). There are two of them in jconnector_server.php and they look like this
Code:
header('Location: '.str_replace('modules/mod_jconnector/', '', JURI::base()));
For example by changing them to
Code:
header('Location: '.str_replace('modules/mod_jconnector/', '', JURI::base()).'?option=com_comprofiler');
I get a redirect to the user profile page (I run Community Builder extension).

If you have any more questions or something is not fully clear, please feel free to ask me.
Reply With Quote
  #5 (permalink)  
Old 11-08-2009, 04:32 PM
Junior Member
 
Join Date: Nov 2009
Posts: 1
Default

Hi, if Joomla SEF is enabled, how to redirect to a specified page like: www.mysite.com/category/example.html ?
Reply With Quote
  #6 (permalink)  
Old 02-05-2010, 05:17 AM
Junior Member
 
Join Date: Feb 2010
Posts: 3
Default

hi,

I have SEF enabled, i wauld like to redirect to the previous page after login with jconnector on facebook.

Someone have an idea or an issue ?

regards
Reply With Quote
  #7 (permalink)  
Old 02-05-2010, 05:30 AM
Junior Member
 
Join Date: Feb 2010
Posts: 3
Default

ok, it's so easy :

replace last line in jconnector_server.php:
Code:
header('Location: '.str_replace('modules/mod_jconnector/', '', JURI::base));
by

Code:
header('Location: '.str_replace('modules/mod_jconnector/', '', $_SERVER["HTTP_REFERER"]));
Reply With Quote
  #8 (permalink)  
Old 02-12-2010, 05:44 PM
Junior Member
 
Join Date: Feb 2010
Posts: 4
Default

Quote:
Originally Posted by neo.51 View Post
ok, it's so easy :

replace last line in jconnector_server.php:
Code:
header('Location: '.str_replace('modules/mod_jconnector/', '', JURI::base));
by

Code:
header('Location: '.str_replace('modules/mod_jconnector/', '', $_SERVER["HTTP_REFERER"]));

it works!

line 68 and 129 on jconnector_server.php file
Reply With Quote
  #9 (permalink)  
Old 03-05-2010, 02:35 AM
Junior Member
 
Join Date: Mar 2010
Posts: 2
Default

Tried using HTTP_REFERER but it didnt work so well in IE8.

With on logins it would just return me to
http:/site/module/mod_jconnector/
this is using with SH404SEF.

So what i did was in my joomla template index.php I placed this at the end of the code.

Code:
<?php 
$last_page = str_replace('&lang','&amp;lang',$_SERVER["REQUEST_URI"]); 	$_SESSION['lastPage'] = $last_page; 
?>
then used $_SESSION['lastPage'] in place of $_SERVER["HTTP_REFERER"] as shown by neo.51 above.
Reply With Quote
  #10 (permalink)  
Old 03-10-2010, 11:18 AM
Junior Member
 
Join Date: Feb 2010
Posts: 4
Default

Anyone had any luck redirecting the DENIED ONLY? I've tried changing the line in jconnector_server.php but I only get the denied message on all attempts...good or bad.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -5. The time now is 08:00 PM.