I am not too familiar with the Elgg platform as where most of my problems are coming from. Could you possible provide a little more information on how to approach registering a plugin hook only to trigger on an API call?
Currently reading Plugin Hooks documentation but not sure if I will get all the relevant information I need from there.
Thanks for your help.
' normal request or a request to the API ' does not compute ! ;o( once you expose a function as a 'web service' - it should be invoked only via restful uri calls with the proper authenticators (assuming you are not exposing for public access) -- unless someone, plugin coder or you write some code to violate that intrinsic coding stds requirement! i think that your issue is with something else, some other area or,, you're simply misunderstanding what web services, soa resources & other artifacts are in the http situation... ;o) anyways.. examinign the uri and the parameter set can be used quite easily to deternine whether the access 'looks like' it is meant to be a rest call or something else.
Matt, you should find answer in Elgg documentation. In simple words, you have to register to plugin hook in a following way:
elgg_register_plugin_hook('rest', 'init', 'your_function_name');, where in function named your_function_name you have to define eg. some session or global variable that says you're in API call. Later you have to just do checks against this variable.
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.