Integration of SocialEngine with external user administration
I recently had the task to integrate a SocialEngine installation (4.1.6) with an external user administration system (written in PHP). Social Engine users should be automatically created/enabled/disabled when a user in the external system is created or deleted. In addition to that the passwords should be kept synchronized: i.e. whenever the password of a user is changed in the external system it should automatically be changed in SocialEngine as well.
In order to minimize the efforts I choose the minimal-effort-path: Integration on a database level. I've created the following PHP functions that I'm calling at the appropriate places in my external user administration system. Note the ugly SOCIAL_ENGINE_TABLENAMES_PREFIX constant that I'm using because Mysql does not support synonyms and I wanted to separate the two systems database wise. Maybe the code helps somebody else that have to deal with the SocialEngine integration in an external system.
Oh and if one of the SocialEngine developers reads this: I would recommend switching to a different hash algorithm. MD5 can no longer be considered safe these days.