Matt Burica

Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

Activity

  • Matt Burica added a new discussion topic elgg_view not working when in API call in the group Plugin Development
    I wrote a function to return my a summary of the river for a user's friends. If I put this function in just a normal view for my plugin it works perfectly, however, when this function is exposed as an API call then the part using...
  • Matt Burica replied on the discussion topic Plugin aware if REST call being made to API
    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... view reply
  • Matt Burica added a new discussion topic Plugin aware if REST call being made to API in the group Plugin Development
    I have a plugin that checks COOKIES to determine if a user is currently logged in to a 3rd party site (Moodle). If they are not logged in to Moodle I do a redirect to Moodle and force them to log in. This is a cheap and dirty way to link the two...
    • 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.

       

       

  • Matt Burica joined the group Plugin Development