Save user data for each user in ejabberd

I need to store data for each user in ejabberd. How can i do this? I mean, I need to add another field to the user table and I have to update this data every time.

How can i do this?

+3


source to share


1 answer


This is what I am doing.

During the registration process in my Android Chat app, I submit data such as the desired user id (jabberid), password, email address, display name, gender, mobile, etc. to my PHP API. The PHP code checks to see if the user ID already exists, and if not, it first creates a user in the external mysql database, storing all the fields received in the column, and then creates a real user in ejabberd by executing the ejabberdctl register command. There will be some permission issues executing a command inside apace \ PHP which I successfully resolved with this answer here . Now I can access user data using my PHP API.



The idea is that I am not overloading the mnesia database with infrequently accessed or modified data. IMHO this helps if you don't want to switch ejabberd to odbc \ mysql mode and lose the potential benefits of mnesia or if you plan to run mnesia in RAM only mode. All this I say with limited edjabberd knowledge, so do not take the word as gospel.

0


source







All Articles