LogMeIn

This is an Expression Engine plugin that allows you to automatically log a site visitor in from any template without having to collect details from them, great for stand-alone entry forms.

Support can be found in the comments and in this EE forum thread.

Download LogMeIn
Current Version: 1.2 (released 19 December 2008)

* Works with ExpressionEngine 1.6 and higher.

1. Concept

I developed this plugin because I wanted to allow site visitors to be able to submit stand-alone entry forms. The problem stems from the fact that in EE, visitors must be logged in to submit stand-alone entry forms. However quite often you will want to allow guests to submit forms without requiring them to create an account first. This plugin solves the problem by automatically logging them in for you.

Find out more about stand-alone entry forms.

2. How It Works

The plugin simply logs the visitor in as a user that you specify. So for example, you could set up a user account with username priveleged_guest, and assign it to any member group, say priveleged_members, that has weblog posting privelages to a weblog, say visitor_feedback

You could then put call the plugin from a template in which you have a stand-alone entry form that you want to allow guests to submit:

{exp:logmein:now username="priveleged_guest" if_member_group="3" expire="300"}

{exp:weblog:entry_form weblog="visitor_feedback"}
  Name: <input type="text" name="name" /><br />
  Email: <input type="text" name="email" /><br />
  Feedback: <textarea name="feedback"> </textarea><br />	
  <input type="submit"  value="submit" />
{/exp:weblog:entry_form}
				

The username parameter is required.

The if_member_group parameter is optional and defines the member group id that the current user must belong to (for example guest users).

The expire parameter is optional and sets the expiration time in seconds of the cookie. So in the example above the user will be logged in for only 5 minutes. The default value is 1 day.

You can also log the user out at any time by using the following tag:

{exp:logmein:logout}
				

3. Installation

  1. Download and unzip logmein.zip
  2. Upload pi.logmein.php to the system/plugins folder.

4. Download

You can download and use the plugin for free here:

If this plugin has helped you and you are feeling generous then feel free to make a small donation, it is much appreciated:

5. Changelog

Version 1.2
  • Added if_member_group parameter
Version 1.1
  • Added expire parameter
  • Added logout tag

6. Comments

Blank Avatar
Mark Bowen
20 November 2007


Hi Ben,

This works absolutely brilliantly. Saw the link on the EE forums. Well done on such a great usable addition for EE!! :-)

Best wishes,

Mark

Blank Avatar
Rudolf
23 November 2007


This is so sweet ! Thanx for sharing it.

Blank Avatar
AJP
27 November 2007


This was a lifesaver! Thanks!

Blank Avatar
jason isaacs
27 December 2007


Hi, I am trying to use this plugin to fix a problem I'm having with the Expression Engine Simple Commerce Module. It doesn't record a purchase or send the follow up emails if the purchase is not made by a registered member. It looks like this should work, but I have installed it and set it up and I am still having no luck. I didn't know if you could shed some light on this problem.

Blank Avatar
CTAC
15 January 2008


Thank you for this helpfull plugin. As I understood, when user post them news on SAEF page, him automatically logged as priveleged_guest. And after posting, him also logged as priveleged_guest and hу can post any comments or forum posts as priveleged_guest. How can I automatically unlogin them painless right after posting.
Thank you!

Blank Avatar
Ben
18 February 2008


jason: make sure that the member group that the user is automatically being logged in is allowed to make purchases.

ctac: you could automatically redirect them to the logout page after posting using the return parameter in the SAEF

Blank Avatar
Lee
21 February 2008


Thanks for this really useful plugin. Lovely site you have here!

Blank Avatar
Chad Crowell
24 February 2008


Nice job -perfect for my needs- would love to see a logmeout version as well that allows you to secretly log them back out and then redirect them, say, to a thank you page. Using the standard logout function takes them back to the homepage. Thanks!

Blank Avatar
Lee
28 February 2008


Yes a logmeout plugin would be very useful. I wonder if it's just a case of editing the logmein code . Or if logmein could have a logout after x hours property.

Blank Avatar
Ben
02 March 2008


hi guys, i have released version 1.1 which is just for you! there are now two different ways of managing to log users out. please see the changelog and instructions above.

Blank Avatar
Lee
11 March 2008


Ben, many many thanks. Do you have a donate link?


» View all comments

Leave A Comment

name (required)
email (required but will be kept completely private)
website