Redirecting New Joomla Users On First Visit
While fine-tuning the user flow of our Joomla Engineering website, we needed a way to redirect new users to a designated page immediately upon registering (we're not using the activation email feature). To accomplish that, we engineered a system plugin to do so. It checks whether or not the user's lastvisitDate is "0000-00-00 00:00:00", and if it is, it sets the date to the current time and sends them to the designated page.
Sound like something that would be useful to you? If so, download the Redirect First Login plugin.
Comments
You could also try changing this:
Quote:
to this:
Quote:
Best,
Matt
1. Changed all plugin orders so that redirect plugin was the only one on order 1. Everything else was 2, 3, etc.
2. Disabled all plugins related to OSE Member Control. Also disabled System - Legacy.
3. Disabled OSE Member Login Module. Enabled standard Joomla login module.
4. Cleared cache.
Still no returned output :(
Yes, the comment system removes certain tags like that.
Quoting Josh:
Other plugins can be acting on that event, however if they prevent the redirect plugin from firing before the user last login date is set, the redirect plugin won't fire. Have you tried changing the order of the redirect plugin so that it is the first user plugin?
Regardless, I replaced the code in redirectfirstlo gin.php with what you provided and I did *not* receive the echo on the screen.
Any ideas where to go from here?
Should anything else be calling "onLoginUser" besides the redirect plugin? If not, I can do a text search on all of the files in my install to see if that's the case.
Normally the way I debug it is to put an echo state and then a die statement in the plugin to see if is being fired on that system event. That might be a good place to start.
Once installed, you can change plugins/user/redirectfirtlog in.php to Quote:
I just tested that in a fresh install of 1.5 and it seems to work fine.
Hope that helps!
Matt
I appreciate the quick reply!
I have checked the last login and verified it is indeed updating. It also is set to all zeroes on account creation.
Just for kicks, I disabled all OSE components and reverted back to the Joomla login component (OSE uses its own). Still no luck. Any way we can debug?
My guess would be that the OSE Login Module is hijacking the onLoginUser event, which is the same event that this plugin uses. Does this plugin work fine without the OSE Login Module? Also, does the lastloginDate entry ever get updated after the user logs in?
Best,
Matt
I am trying to get this working on my Joomla 1.5.22 installation. I am using OSE Login Module but am not sure if that is affecting this. I have installed plugin and verified it is enabled as well as changed default redirect location.
I setup a test account and have verified the lastloginDate DB entry is set properly:
UPDATE `joomla`.`jos_users` SET `lastvisitDate` = '0000-00-00 00:00:00' WHERE `jos_users`.`id` =160;
Still, nothing happens when I login. Any ideas?
Thanks for the feedback. Unfortunately, registering and logging in are two separate issues when it comes to Joomla. This plugin redirects after they are logged in, which does not happen automatically with Joomla's default registration process. If you want a seamless registration process that also logs in the user immediately after they register and then are redirected to a specific page, you need to look a third-party registration component like ccUsers for the registration portion and this plugin to redirect their first visit.
Best,
Matt
RSS feed for comments to this post