Fork me on GitHub
Get XOOPS XOOPSXOOPS FAQFAQ ForumsForums NewsNews ThemesThemes ModulesModules
New Posts New Topics All Posts All Forums Index General Modules Themes Development International XOOPS.org

Search

Donat-O-Meter

Make donations with PayPal!
Stats
Goal: $100.00
Due Date: Sep 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00

Learn XOOPS Core

Local Support

Advertisement

XOOPS Code hosted on SourceForge

Cumulus Tag Cloud

- 2 2.5 2.6 3.0 4 6 2013 adslight Android AntiHarvesting AntiMalUser AntiSpam API Apple Battlefield billige Bootstrap Captcha cell cent chronolabs CHUNG Clicks content CĂN demo docek download Dresses evden eve facebook Fat floor Food for free Gateway Google Guide herre Home Honeypot HP Human HỘ IP iPhone jQuery Language List log Loss mobile module modules Monster new newbb news NHÀ online PARK phone PHP Prevention profile project Protector publisher Rapid RESIDENCE responsive review Rights rmcommon security Sentry site Smartphone Smoking Solution Spam stem Studio tdmcreate template The Theme themes web weight Wishcraft xoops Xortify XPayment ZendFramework

New Users

Registering user

# 137777

MrMister

Welcome to XOOPS!




Bottom   Previous Topic   Next Topic  Register To Post



#1 Posted on: 2010/6/26 11:19 Question about Login through user.php
Hi..

i want to disable login block

and make all user login through user.php

the problem is

it is not redirecting them back to where there were

as example when a guest is in forum and click the login link (user.php) to login

after successful login it bring the user back to index page

is there any hack to bring back them to where they were ? the forum page ?


or is there any other way...

help..TQ


EDIT
p/s :sorry for this double post...i just found out that i opened up the same post back in 2007...lol..

http://www.xoops.org/modules/newbb/vi ... id=267949#forumpost267949

i don't remember this...but still hope can have an answer how to do this or it is not doable

Top

jimmyx
Quite a regular
Quite a regular
Joined:
2007/7/17 21:35
Group:
Registered Users
Posts: 337
(Show More) (Show Less)


#2 Posted on: 2010/6/26 15:18 Re: Question about Login through user.php
There is no quick, simple, easy hack to this. However, it was built-in to XOOPS to allow module developers to do that, but it requires the module developer to set a particular variable before redirecting.

The function is redirect_header found in the include/functions.php file:

function redirect_header($url, $time = 3, $message = '', $addredirect = true, $allowExternalLink = false)

the passed variable $url is the one you are looking for. Realistically it should pickup the referring URL if none is passed. Unfortunately a lot of modules don't use this very well and just give you the home "index.php" page as passed. Sloppy, but done a lot

So, you'll have to find the instance in the code that does this redirect_header and then pull the current URL to pass as the $url.

Clear as mud?

BTW, many folk just add a login area to the theme and the URL ($url) that is passed in the form is the current URL. That way it times them right back to where they were. That code can be found on this site, too, of course, and is in a couple of the programmatic themes.

Top


Pessimists see difficulty in opportunity; Optimists see opportunity in difficulty. --W Churchill

XOOPS: Latest | Debug | Hosting and Web Development
mboyden
Moderator
Moderator
Joined:
2005/3/9 12:07
From Austin, TX (USA)
Group:
Registered Users
Posts: 475
(Show More) (Show Less)


#3 Posted on: 2010/6/27 5:08 Re: Question about Login through user.php
Try this and see if it works for you k.

Open user.php and look for the line (roughly line 52):

if (isset($_GET['xoops_redirect'])) {
            
$xoopsTpl->assign('redirect_page'htmlspecialchars(trim($_GET['xoops_redirect']), ENT_QUOTES));
        }

and change it to this:

if ( isset( $_GET['xoops_redirect'] ) ) {
            
$xoopsTpl->assign'redirect_page'htmlspecialcharstrim$_GET['xoops_redirect'] ), ENT_QUOTES ) );
        } else if ( isset( 
$_SERVER['REQUEST_URI'] ) ) {
            
$xoopsTpl->assign'redirect_page'htmlspecialcharsxoops_getenv'REQUEST_URI' ), ENT_QUOTES ) );
        }



Also, in /include/checklogin.php, look for line 103:

$url .= $_POST['xoops_redirect'];


and change it to:

$url .= str_replace(XOOPS_URL''$_POST['xoops_redirect']);



It's not perfect but it should do what you want........ hopefully

John


Top

Catzwolf
Home away from home
Home away from home
Joined:
2007/9/29 23:21
Group:
Registered Users
Posts: 1317
(Show More) (Show Less)


#4 Posted on: 2010/9/30 13:46 Re: Question about Login through user.php
Thanks John. Works perfectly!

Top

Mazarin
Just can't stay away
Just can't stay away
Joined:
2008/12/10 15:05
From Knivsta, Sweden
Group:
Registered Users
Repository Group
Posts: 518
(Show More) (Show Less)


#5 Posted on: 2011/9/13 6:37 Re: Question about Login through user.php
can this be included in the core ?

I noticed this feature is implemented in the sourceforge website .. (ive been reporting a few xoops bugs lately)

1. i want to report xoops bug

http://sourceforge.net/tracker/?func= ... roup_id=41586&atid=430840

this is not accessible for guest

2. click the login link on top bar
http://sourceforge.net/account/login.php

3. input username/password

4. success login

5. im redirected to my previous page
http://sourceforge.net/tracker/?func= ... roup_id=41586&atid=430840






Top

sabahan
Quite a regular
Quite a regular
Joined:
2006/3/3 23:35
Group:
Registered Users
Posts: 299
(Show More) (Show Less)


#6 Posted on: 2011/9/13 8:31 Re: Question about Login through user.php
Please make it a feature request. No guarantees that it will be implemented, but at least it will be entered.

Top


Please support XOOPS & DONATE
Use 2.5.7 | Debugging | Requests | Bugs
Mamba
Moderator
Moderator
Joined:
2004/4/23 13:58
From Ohio, USA
Group:
Webmaster
Registered Users
Designer Group
Posts: 8055
(Show More) (Show Less)


#7 Posted on: 2011/9/13 9:33 Re: Question about Login through user.php


added here
https://sourceforge.net/tracker/?func= ... roup_id=41586&atid=430843


Top

sabahan
Quite a regular
Quite a regular
Joined:
2006/3/3 23:35
Group:
Registered Users
Posts: 299
(Show More) (Show Less)


#8 Posted on: 2011/9/13 9:50 Re: Question about Login through user.php
btw i tried the catzwolf solution above..it is not working..i don't know if i did correctly

what i did was...

a. change the lines mentioned

b. then create a custom block show in all pages..make link to root/user.php in the block

c. when to a module page (forum topic) as guest ..

d. click the login link to user.php in the custom block

e. after login in user.php i am redirected to my profile page and not to the forum topic where i was before

Top

sabahan
Quite a regular
Quite a regular
Joined:
2006/3/3 23:35
Group:
Registered Users
Posts: 299
(Show More) (Show Less)







You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.

[Advanced Search]