Post User Login Update Plugin v0.1

Release Notes

This is simple module that hooks onto the user's login event and allows the module writer to do some interesting things upon successfull logon by changing the code in the handler function (see start.php:post_login_update_handler).

Default implementation has code that will add an user called "admin" as the friend for the user logging in. This ensures that all user's that get into the system have the admin as their friend. There is also a message displayed greeting the user. This could be a place to place user's profile dependent customized messages. It could also be used to nag the user to fill out their profiles.

This module was developed and is used at www.socialtrak.com for the above two purposes (add admin as friend and nag about incomplete profiles).

The username could be made configurable and also the message displayed on logon. If you would like that functionality let us know at: admin@socialtrak.com

To use, drop into the mod folder and then enable from the Administrator's Tools Menu.

  • hmmm... a rather interesting plugin;;; i was considering functionality along similar lines - i.e. after successful register / login we want to trigger come *cross-site notification messages (data) to be propagated.. Before I study your code (more coffee) -- it should be quite simple to adjust / create plugin to do similar hooks for a post register update, correct ?

  • Definitely... I think there are a couple of plugins out there that do some things based on registration event (see MySpace BeTom plugin). You could adapt that using the post_login_update... just register the event for user create: register_elgg_event_handler('create', 'user', 'create_user_handler,501);

  • of course ! how did I forget my-space-like-be-tom ;-O ? too many thoughts stuck in my old head, thx...

  • Will other plugins used on Socialtrak be released? I really like the layout as well.

  • @dhrup feel free to share after your nescafe.... oh yeah just made a major discovery, try coconut juice instead of water wth your coffee (coconut juice is full of electrolytes) just heat a little water to melt the coffee put into some well chilled coconut juice and its an instant tastebud and brain wow.

  • We will be contributing plugins as we go along... One of the problem is that we have modified the core heavily to support the multiple profiles and fine grained access control. Some plugins use that infrastructure so contributing them requires cleaning up any dependencies on core modifications. Keep an eye out and if you see something that you like let me know so I can keep it on my list of plugins to contribute :)

  • @Wayne

    ของ Google ลิงกล่าว - สวัสดี Wayne?
  • @Dhrup

    im not very good at written thai. So are you asking me if my idea is original? or im a monkey?

    lmao i use thai2english.com

    The idea came from me but it may already be out there.

  • ""google monkey says hi wayne: ;-O -- i just plugged into google translate heh heh;;;

  • Prashant, nice work. What we all would benefit from is an advanced registration and profile, like SocialTrak has. If you could release this, it would be an amazing contribution to us. Thank you!

  • Prashant,

    Great work on this and thanks for uploading it back up to the community. To add to Prashant's comments above; we will certainly try and contribute more back for you folks. If you have any recommendations for features you would like to see in SocialTrak, or cool plugins you have developed please drop us an email at: admin@socialtrak.com

    Thanks

    Andy

  • I see you have gender based default icons too.  This would be a wonderful thing to contribute back as well.  :-)

  • how to make the register form like Socialtrak.com?

  • Should we disable be_tom plugin if it's installed?  Thanks.

  • Such a registration form (with gender specific default icons) is the thing I think we are all dreaming of.  If it could even be added to siteaccess, so they work together, this would be a dream come true.

  • The gender based icons are fairly easy to do. You can check if a user has selected male or female in their profile, and do a simple if statement to swap the default graphic over for a male or female icon.

    I'll put together an example code snippet and upload it here for you guys to check out.

     

  • elggboy, the be_tom hooks the user create event so you should work fine... however the problem with the be_tom is that it adds the admin as friend only on new registrations. This plugin would do it on the user's login so all current users registered would also benefit. 

  • @Prashant, thank you for explanation.  Is this "persistent" kind of plugin, that would persistently add admin as friend?  If so, I think that would be good thing.

    @Andy, yes, I imagine that code would be simple, for the gender, but having more sophisticated registration form tied to profile is key.  Also, do you have your site set-up so that admin OK's each registration and can you see details from registration form before you OK registration?  I think many-many of us are needing that because our social network sites are for smaller nitches and keeping the "purity" or "quality" or "consistency" to members, based on certain nitch traits is important.  Hope this makes sense.

  • I have installed and enabled the plugin, but members don't get any message similar to that on SocialTrak when they login.

    The 'auto assign admin as friend' is working.

    I have the 'river' dashboard enabled and the 'profile-nagger' plugin installed. Could there be a conflict?

  • Mick, If the admin add is working then the plugin is working. The message I have in the default code will appear along with the login message that you see... If you need a detailed nag based on a condition then you need to modify the code to do that.

  • Okay. Thanks for that, but there is definately no message appearing. It might be me, I'll take another look.

    Thanks for sharing the plugin. It's a cool edition and one which works towards finding a solution to this real issue of members NOT customising their profiles.

  • Any ideas how to get this to add default notifications for the user to be enabled?
    Diving into the notifications plugin code there's a method such as:

    set_user_notification_setting($_SESSION['user']->guid, $method, ($personal[$method] == '1') ? true : false);

    though I'm wondering what $method is?

  • @ SocialTrak Guru

    It's great to have already a "built-in-friend" when you register and login for the first time.

    I am a member of a fast growing elgg-site that uses the technique. But I suggest you make an arrangement with Jeroen, who has developed the login_redirector plugin. Because these two plugins clash. When both are enabled, I am thrown out of my site to get a blank page with an error message saying the page can't be found.

    Personally, I can't part with login_redirector, it's such a useful plugin.

    Can you do something about it, please?

    Thanks.

  • This doesn't seem to be working with Elgg 1.6.1 could you please look into that?

Stats

  • Category: Uncategorized
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 854
  • Recommendations: 1

Other Projects

View Prashant Juvekar's plugins