vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Mini Mods - Redirect after Login (https://vborg.vbsupport.ru/showthread.php?t=156992)

ragtek 09-03-2007 10:00 PM

Redirect after Login
 
This is Part II of this Add-ON.

Its the same, just after the Login Process.

That means it redirects you to a site you entered in the acp after the login
Changehistory
1.1 => a little bug after login in acp was repaired
1.2 =>
  • added adminhelp
  • little bugfix (modcontrolpanel redirect)
1.3 =>
  • Usergroupcheck built in => this means, you can select now usergroups which should be redirected
  • redirectpage/redirectmessage is now optional
    you can enable or disable it
1.31 =>
  • Bugfix , thx to inciarco
German translation can be found here: http://www.vbulletin-germany.org/showthread.php?t=1454

rayphua 09-04-2007 06:22 AM

What does this do?

FleaBag 09-04-2007 11:11 AM

Quote:

That means it redirects you to a site you entered in the acp after the login
It redirects users who log in to a pre-defined page (by you) in the Admin Control Panel.

Thanks ragtek, for this and the other. :)

Hornstar 09-04-2007 12:08 PM

This will come in handy next April fools, I will redirect them to something special :D

Masiello 09-04-2007 12:29 PM

Thanks, great mod, please, support for the future releases :)
*Clicks INSTALL*

Masiello 09-04-2007 12:32 PM

Please keep the "Welcome Message"

ragtek 09-04-2007 12:41 PM

yes this will come in the next version

for the login=> the login messege for logout the logout message

i'm thinking about merging the 2 hacks to one
with some options (de/activate message,...) so it would be more comfortable

FleaBag 09-04-2007 12:43 PM

Sounds good, keeps things simple. :)

Masiello 09-04-2007 05:40 PM

Quote:

Originally Posted by ragtek (Post 1332117)
yes this will come in the next version


for the login=> the login messege for logout the logout message

i'm thinking about merging the 2 hacks to one
with some options (de/activate message,...) so it would be more comfortable

Also it need to be removed the redirect after login into AdminCP

iogames 09-04-2007 07:19 PM

Ok, so users can be redirected according to the forum of their preference?
Lets say I got a medical site, and I have my forum divided by subdomains to forums, by type of topic, so can they been redirected according from the subdomain from were they originally signed up? :rolleyes:

patrickstar 09-04-2007 10:20 PM

will it work with 3.6.6? i hope so because this is exactly what i was looking for.

fluentdesigns 09-04-2007 11:07 PM

one suggestion. Make it so it only redirects 1 time for the first time the user logs in. That way I can build a "newbie" page with tutorials, and "What to do next info" etc....

ragtek 09-05-2007 05:20 AM

Quote:

Originally Posted by patrickstar (Post 1332516)
will it work with 3.6.6? i hope so because this is exactly what i was looking for.

i think so

Quote:

Originally Posted by fluentdesigns (Post 1332535)
one suggestion. Make it so it only redirects 1 time for the first time the user logs in. That way I can build a "newbie" page with tutorials, and "What to do next info" etc....

phu, that would be hard, instead of this, i would install this one: https://vborg.vbsupport.ru/showthread.php?t=151737

gforce75 09-05-2007 11:03 AM

Nice!

Grunt 09-05-2007 02:05 PM

Thanks for this :up:

patrickstar 09-05-2007 06:32 PM

Quote:

Originally Posted by ragtek (Post 1332652)
i think so

well it worked too good, i cant login to my acp lol. it redirects me to the forums.

anyhelp would be greatly appreciated.

***EDIT***

well all i had to do was click back on the 'admin' link and took me there, lol. that was a close one!

ragtek 09-05-2007 06:36 PM

edit:
thx very much for report




now its working:)

howiulf 09-05-2007 07:04 PM

indeed, it was a bit funny, login to the acp 'n' being at forumhome.

But thx for a nice hack. :D

dellow 09-06-2007 07:45 PM

Thank you for this hack,

but what if some user already logged in from last time he visit the site? is this hack can affect ?

Regards,

ragtek 09-06-2007 07:49 PM

no
this hack just redirects after you filled out the login form

marcossalazar 09-13-2007 10:11 PM

Great Hack. The only thing I would suggest is that you modify is so that the "Thank you for logging in" redirect page still displays. Right now it disappears with the hack installed (even if you don't have anything in the box that tells the forum where to redirect the user to). I had to take off the hack in order to get that back. It would be a nice transition onto a new page instead of a quick and abrupt redirect. Think that would be a possibility?

Thanks,

Marcos

ragtek 09-26-2007 07:45 PM

hi
just wanted to say, that i'm sorry, that it takes so long to update this...
got many pm's where people asked when i'm going to make this

at moment there are so many things on my to-do list that i sorted by priority
and because this add-on is working, the priority is not so high.

darkman 01-03-2008 02:19 PM

Looks good - thanks :)

apiasto 01-03-2008 03:35 PM

can this be modyfied for only zero posters to redirect them to certain place,thnx

princeedward 01-19-2008 03:59 PM

thanks for this... ;)

chatzworld 01-19-2008 04:40 PM

errrrrrrrrrrm where do i set this cant find any option?

ragtek 01-19-2008 06:16 PM

By the general options

Tomo123 01-19-2008 09:38 PM

awesome exactly what I've been looking for :)

Thanks

ragtek 01-19-2008 11:10 PM

than click install to show it;)

Pete C 01-20-2008 11:31 AM

Whilst I appreciate the convenience of importing this as a product, it appears to redirect all members (even admins) when they log in.

Since it is a relatively simple matter to write a plugin that only affects specific usergroups - or indeed a series of plugins that can redirect different usergroups to different places, I'm wondering how this hack offers further benefit?

For example, I use the following to redirect banned users to a page telling them they're banned:

Code:

Product: vBulletin

Hook Location: login_redirect

Title: Banned user redirect

Plugin PHP Code:

if (!($vbulletin->GPC['logintype'] === 'cplogin' OR $vbulletin->GPC['logintype'] === 'modcplogin'))
{
  if (is_member_of($vbulletin->userinfo, 8))
  {
        $vbulletin->url = "http://www.my site/banned/banned.htm";
  }
}

The text in red can be varied according to the usergroup / usergroup ID# / desired destination. Should it be required to redirect multiple usergroups to the same place, simply enter the usergroup ID's seperated by a comma.

This further example would send registered users to a forum of your choice:

Code:

Product: vBulletin

Hook Location: login_redirect

Title: Registered user redirect

Plugin PHP Code:

if (!($vbulletin->GPC['logintype'] === 'cplogin' OR $vbulletin->GPC['logintype'] === 'modcplogin'))
{
  if (is_member_of($vbulletin->userinfo, 2))
  {
        $vbulletin->url = "http://www.my site/forumdisplay.php?f=6";
  }
}

I don't wish to sound rude, but as yet I do not see the benefit of a product that simply redirects everyone, irrespective of their usergroup. If I'm missing some additional benefits here, I'd be grateful if someone would explain what they may be?

ragtek 01-20-2008 11:38 AM

hi
your idee with usergroups sounds realy good!
i'll try to implement it

also i wanna thank you for this snippet*g*
PHP Code:

OR $vbulletin->GPC['logintype'] === 'modcplogin' 

i've totaly forgotten on the modcp

thx

Tomo123 01-20-2008 01:48 PM

Well it's been less than 24 hours since i installed this mod and I got to say it's awesome. When ever anyone logs on I have them redirected to a page where it shows all the recent threads and posts (vBISpy - AJAX real-time feed of new posts/threads ). The few members I have think it's awsome too. :) Thanks for this

ragtek 01-20-2008 01:51 PM

your welcome:)

inciarco 01-20-2008 02:48 PM

One Bug: Only Works when ONE Usergroup is Specified, otherwise don't Work!! :confused: :(

I Think Your Should Use Other Code to user more than One Usergroup!! :confused: :rolleyes:

My Best Regards!! ;)

:)

ragtek 01-20-2008 02:51 PM

hi
are you using version 1.3???
There it is for me working.Have you made a comma separated list of all usergroupid's ??

inciarco 01-20-2008 03:33 PM

Quote:

Originally Posted by ragtek (Post 1425182)
hi
are you using version 1.3???
There it is for me working.Have you made a comma separated list of all usergroupid's ??

I'm Using the New Update (1.3), and I have vB 3.6.7 PL1; but I've Found the Answer of that Problem for You:

Quote:

Originally Posted by inciarco (Post 1425179)
One Bug: Only Works when ONE Usergroup is Specified, otherwise don't Work!! :confused: :(

I Think Your Should Use Other Code to user more than One Usergroup!! :confused: :rolleyes:

My Best Regards!! ;)

:)

I Found the Answer by looking to Similar Mods that Use a List of Member Groups to set the Permissions via Plugin and/or via PHP File:

You need to use the Code explode in the Following way to Extract and Use all the Usergroups Separated by ",":

The New Correct Code for Plugin "redirect after login" should be:

Code:

if (!($vbulletin->GPC['logintype'] === 'cplogin' OR $vbulletin->GPC['logintype'] === 'modcplogin'))
{
        if (is_member_of($vbulletin->userinfo, explode(',',$vbulletin->options['login_groups'])))
        {

                $vbulletin->url = $vbulletin->options['loginredirect'] . $vbulletin->session->vars['sessionurl_q'];
                if ($vbulletin->options['login_showredirect'] == 1)
                {
                        eval(print_standard_redirect('redirect_login', true, true));
                }
                else
                {
                        standard_redirect();
                }
        }
}

Notice that I Replaced

Code:

$vbulletin->options['login_groups']
with

Code:

explode(',',$vbulletin->options['login_groups'])
I tested it and It Works Now OK with that Small Change!! :up:

My Best Regards!! ;)

:)

ragtek 01-20-2008 03:46 PM

hm
very strange
i don't understand this
the is_member_of is built this way:
PHP Code:

// #############################################################################
/**
* Works out if a user is a member of the specified usergroup(s)
*
* This function can be overloaded to test multiple usergroups: is_member_of($user, 1, 3, 4, 6...)
*
* @param    array        User info array - must contain userid, usergroupid and membergroupids fields
* @param    integer    Usergroup ID to test
* @param boolean    Pull result from cache
*
* @return    boolean
*/
function is_member_of(&$userinfo$usergroupid$cache true

as 2 parameter it gets many integers ( all the usergroupid's)
when i now have in my option: 2,3,4 it should look like this:
PHP Code:

if (is_member_of($vbulletin->userinfo2,3,4))
    { 

and this should be ok :/
very strange
i think i have to check this part one more time
thx for your help:)
i opened a thread because i think its a important point^^

ragtek 01-20-2008 04:30 PM

thx 4 your help
i've updated it

inciarco 01-20-2008 08:32 PM

Quote:

Originally Posted by ragtek (Post 1425257)
thx 4 your help
i've updated it

You're Very Welcome, I'm Glad To Help!! :up:

My Best Regards To You!! ;)

:)

marcossalazar 01-22-2008 03:34 PM

This is one of the best mods out there. Thanks for continuing to support it!

Marcos


All times are GMT. The time now is 04:54 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01515 seconds
  • Memory Usage 1,827KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (3)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete