Post User Login Update Plugin v0.2

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.

Changes in version 0.2

  • Added "Auto Friend Username" plugin setting instead of hardcoded "admin". So administrator can specify any username to be added as friend for users logging in.
  • Added setting "Custom Login Message" plugin setting where the administrator can now specify a message to be displayed.

 

  • Prashant, thank you! Is it possible to add something like "Auto Group ID" too? People like your plugin because it is similar to Be Tom, but more persistent. If you could add something similar to autosubscribegroup plugin, to your post-user-login-update plugin, this would be very great too!  Thank you for your hard work.

  • great plugin, i follow ukr idea about groups, but in my opinion would be better to force user to choose any available group before instead of forcing him to join.  anyway, great mod

  • Hi Prashant. Thank's for that. I'm trying to customise Elgg to use as the basis for our intranet and so I'm looking for a way to make everyone automatically friends with everyone. How easy would it be to amend your mod to do that? Thanks. John

  • @johnb: I don't think the code itself would be difficult to write but I think performance would be an issue... If you are ensuring a person is friends with everyone on each login by brute force then it would slow logins as number of users increase. One could optimize this by keep track of last login and only adding as friend people that joined since. Other option: it would be better to modify the "BeTom" plugin since this is done only when a user is created. This however would not help for users that are already in the system but one could write a quick and dirty script to take care of existing users.

  • @SocialTrak Guru. I hadn't thought about that, but it makes sense: I should do it as a one-off job rather than every login. Thanks for your advice.

  • Thanks Prashant!  I like this plugin; exactly what I needed.

  • Awesome plugin!! Thanks for sharing =D

  • This plugin is great! Thanks Prashant

    I agree with Ukr, the auto-join of a group would be a logical and well apreciated evolution of this. :-)

  • I installed this plugin, but the add friend automatically feature does not work.  Where should this plugin be in comparison to other plugins in the tool administration panel?  Top, bottom or does it not matter?  Everytime I register a new user the admin is not added as a friend automatically.

  • works perfect with my 1.7

     

    @Michael, y put this plugin at the bottom of the plugin list

  • Super plugin, thanks. Is there a possibility that each newly registered also will be member in a group?

  • @Haziz

    Sure, upload this plugin: http://community.elgg.org/pg/plugins/project/384425/developer/Phil/autosubscribe-to-group

    One thing you have to remember is that the parameter value you should give is the Group ID, not a group name. To find out the ID, click on a group name and the address bar would show something like this:

    ../pg/groups/35/common-room/

    In this example, the Group ID is 35, and "common room" is the group name.

Stats

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

Other Projects

View Prashant Juvekar's plugins