I'm a reasonably experienced PHP dev, but much less certain about elgg.
There are two integration I want to try:
1. Have an external system push user profile data to a corresponding user profile in Elgg. I would have to maintain a table of Elgg entity ids so I know which user to update. Any hints about where in Elgg to write my code? The code would have to be a rest service or some other interface that can receive and process the data. I don't think manipulating the db directly is a good idea.
OR
2. When a user has to update their profile data, have Elgg redirect them to our external system, and have Elgg read from that external system whenever it needs to reference that data.
Can an an experienced Elgg Dev suggest where to start with either of these? Any other opinions are welcome too. I can handle the PHP part of this, but just need to understand the Elgg framework and model better.
It's my strong preference to avoid using iframes for any of this. Would like to avoid this sort of ui trickery.
Thank you.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Juho Jaakkola@juho.jaakkola
Juho Jaakkola - 0 likes
- http://learn.elgg.org/en/2.0/guides/database.html
- http://learn.elgg.org/en/2.0/design/database.html
- http://learn.elgg.org/en/2.0/guides/plugins.html
- http://learn.elgg.org/en/2.0/guides/guidelines.html
- http://learn.elgg.org/en/2.0/tutorials/index.html
- dmxfan@dr99
dmxfan - 0 likes
- Steve Clay@steve_clay
Steve Clay - 0 likes
You must log in to post replies.Thanks to Elgg's data model you don't need to add database tables (it is in fact highly discouraged).
Saving a piece of data to a user account is as simple as:
Read more from these:
Plugins - all custom features must always go to plugins. You can get started by reading these:
What exactly is the system? The best approach may depend a lot on it.
Hey gracias for such a timely reply Juho.
The existing system is a PHP website. It already has a user table and it's own login code. It has a user profile system (city/country, interests, birthdate, occupation, etc). I'll customize that code so that when a user saves or updates their profile data, PHP will do its MySQL update but also call a rest service with the updated parameters, so this is how it will update the data in Elgg. Does that make sense?
many thanks.
I've not used it, but the bundled web_services plugin appears functional, if unloved, for building small JSON APIs with authentication (XML output is currently broken).
I'd recommend storing your users' Elgg GUIDs & usernames in your user table (or a link table). If you want to also store Elgg metadata for easier retrieval within Elgg, that's fine, but you don't want to have to read Elgg MySQL data from another system.