loginredirect

NP_LoginRedirect.php

Automatically redirect members to their profile page when they login.

General Plugin info
Author: Frank Truscott, yama
Current Version: 0.31
Code: NP_LoginRedirect Code
Download: :np_loginredirect_v031.zip
Demo: N/A
Forum Thread: Here

Installing

  1. Copy code into a file called NP_LoginRedirect.php and upload to your plugins directory.
  2. Install the plugin...
  3. No further setup needed. You can disable it from the plugin options.

How to use the plugin

Just install it and it works.

Available SkinVars and/or TemplateVars

  • None

Options

  • Should login redirect be enabled? - Whether the login is enabled or not. (Yes). You can temporarily disable it here without uninstalling the plugin, if needed.
  • destination - Destination of redirect. (member profile page). Select either member profile page or site top (main index of site).

Tips and Tricks

Wishlist

Bugs

  • The plugin doesn’t work with Fancy URLs (like item/11) and Fancier Urls (like item/this-is-a-title). Reported by kg.
  • Note from plugin author: In theory, the plugin should not depend on the URL scheme because it simply hooks into the postlogin event and redirects to the member’s page. Where the URL to the member’s page is created using the createMemberLink() method and should create the member url correct according to the scheme in use, if the scheme is properly using the GenerateURL event. I have tested this plugin successfully using Fancy URLs (member/1) and using NP_CustomURL (member/webmaster.html). I have not tested using NP_FancierURL2. kg, could you contact me, or post on the forum thread to give more details about what is failing in your environment - ftruscot
  • It seems that the ‘MemberKey’ get lost in Nucleus 3.31. I have no real explanation for it. But as a workaround I have changed the function event_LoginSuccess so that it set the lost value:
	function event_LoginSuccess(&$data) {
        if ($this->getOption('redirect_enabled') == 'yes') {
            global $shared, $CONF;
            $errormessage = '';
            ACTIONLOG::add(INFO, "Login successful for ".$data['member']->displayname." (sharedpc=$shared)");
			$CONF['MemberKey'] = 'member';
			$url = createMemberLink($data['member']->id);
            header("Location: $url");
            exit;
        }
	}

Note from plugin author. More discussion at the forum thread, but I tweaked kg’s suggestion and added it to v 0.3. So this should be fixed as of v 0.3.

History

  • 0.3 released 15 November 2007
    • fix bug of failure with certain fancy url methods. Thanks kg.
  • 0.2 released 15 March 2007
    • initial

Plugin review

NP_LoginRedirect version 0.2 works with Nucleus CMS version 3.31 - 2007-11-14 kg

 
loginredirect.txt · Last modified: 2009/12/14 19:30 by ftruscot