Support Forums

Old 05-12-2006, 04:29 AM   #1
Senior Member
 
frommarcq's Avatar
 
Join Date: Mar 2006
Location: Lille (France)
Posts: 120
Rep Power: 16
frommarcq is on a distinguished road
Wink suggestion : no redirection when login

I've a particular question for you :

If you go to my test website (http://www.tout-sur-ma-ville.com/annoncesv3/index.php),
you'll see that the login form is placed in the 'layout'.
(A member can login whenever s/he wants)

The problem is : when a member logs in, s/he's automatically redirected to 'userindex.php'.

I thing it would be better for the member to stay in the same page.

Example :
I'm viewing the member #3 (http://www.tout-sur-ma-ville.com/ann...r.php?member=3).
I want to place a review about him, but it's only allowed if I'm logged.
I enter my screenname (test59) the password (mypass),
-today, I'm redirected to userindex.php, and I have to find again the page...
-The goal : stay in the same page.

Who has the solution (is it possible) ? Can it cause some problems with caching ?

If you have an answer, don't hesitate !

Pascal
__________________
68classifieds (V4.0.9Developer)

Last edited by frommarcq; 05-12-2006 at 02:14 PM.
frommarcq is offline   Reply With Quote
Old 05-12-2006, 07:33 AM   #2
Moderator
 
Chaslie's Avatar
 
Join Date: Mar 2006
Location: Great Ocean Road - Australia
Posts: 741
Rep Power: 28
Chaslie will become famous soon enough
Default

That sounds like a very reasonable and practical idea.
__________________
Chaslie
V4.1 dev


68 Classifieds Important Links
Customer Area | Issue Tracker | User Manuals & Documentation

HTML Help
W3 Schools
Chaslie is offline   Reply With Quote
Old 05-12-2006, 08:49 AM   #3
Moderator
 
juven14's Avatar
 
Join Date: Mar 2006
Location: Texas
Posts: 2,213
Rep Power: 61
juven14 is a jewel in the rough
Default

You can manipulate the redirect from userlogin.php. You might just redirect to the referrer.

Here is the part you would edit.

PHP Code:
//they have looged in
//go to the user index page
$location="userindex.php";
$class_tpl->assign('title',LANG_LOGIN_SUCCESS);
$class_tpl->assign('forward',TRUE);
$class_tpl->assign('location',$location);
$class_tpl->assign('body','forward.tpl.php'); 
__________________
John Snyder
PHP Developer
juven14 is offline   Reply With Quote
Old 05-12-2006, 09:12 AM   #4
Senior Member
 
frommarcq's Avatar
 
Join Date: Mar 2006
Location: Lille (France)
Posts: 120
Rep Power: 16
frommarcq is on a distinguished road
Wink UUUUhhhh !!!!

Thanks a lot John !!!

I replaced twice
Code:
userindex.php
by
Code:
getenv("HTTP_REFERER")
Is it correct, � big php chief ?

(it displays corrcetly but I want to be sure of what I've done...)

Pascal
__________________
68classifieds (V4.0.9Developer)
frommarcq is offline   Reply With Quote
Old 05-12-2006, 01:06 PM   #5
Moderator
 
juven14's Avatar
 
Join Date: Mar 2006
Location: Texas
Posts: 2,213
Rep Power: 61
juven14 is a jewel in the rough
Default

That looks good. I honestly had not used getenv('REMOTE_ADDR') just yet, I have always used $_SERVER["REMOTE_ADDR"].
__________________
John Snyder
PHP Developer
juven14 is offline   Reply With Quote
Old 05-12-2006, 01:58 PM   #6
68 Classifieds Staff
 
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,075
Rep Power: 117
Eric Barnes is a jewel in the rough
Default

That does sound fine. I would just try and make sure they can't manually force the REFFER to something like the administraton. Which I believe the login system will not allow them to be logged in there it is a good idea to check.
__________________
Eric Barnes
68 Classifieds Developer
Please do not send me a private message asking for support. Instead use these open forums or our ticket system.

Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 05-12-2006, 02:16 PM   #7
Moderator
 
juven14's Avatar
 
Join Date: Mar 2006
Location: Texas
Posts: 2,213
Rep Power: 61
juven14 is a jewel in the rough
Default

What I did was check the referer and if it was usercheckout.php it would go back there otherwise it would send them to userindex.php.
__________________
John Snyder
PHP Developer
juven14 is offline   Reply With Quote
Old 07-11-2006, 06:36 AM   #8
Senior Member
 
frommarcq's Avatar
 
Join Date: Mar 2006
Location: Lille (France)
Posts: 120
Rep Power: 16
frommarcq is on a distinguished road
Default

Hi guys !

What do you think of this code ?

PHP Code:
               if (getenv("HTTP_REFERER")=="user")
                    {
                    
$location="userindex.php";
                    }
                    else
                    {
                    
$location=getenv("HTTP_REFERER");
                    } 
__________________
68classifieds (V4.0.9Developer)
frommarcq is offline   Reply With Quote

Bookmarks

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
AOL Customers are not able to login? zman78 v3.1 Questions & Support 11 05-24-2006 09:02 AM
Login Over and Over and Over garysmith v3.1 Questions & Support 6 05-16-2006 07:55 AM
Cant login to my website with netscape navigator zman78 v3.0 Questions & Support 2 04-19-2006 01:42 PM


All times are GMT -4. The time now is 12:11 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0