php - How to call an elgg module action via url -
im new elgg, requirement create elgg plugin import contact gmail,yahoo , msn.
i imported contacts in joomla. when create elgg plugin , oauth call url given invitefriends/gmailcallback
or direct call like
mod/invitefriends/actions/gmailcallback.php
its not working.
in first case return form token missing tried add form token dynamically below.
$ts = time(); elgg_register_action('invitefriends/gmailcallback', true, elgg_get_plugins_path() . 'invitefriends/actions/gmailcallback.php?__elgg_token='.generate_action_token($ts).'&__elgg_ts='.$ts);
but still same error. tried access module file directly works fine ,but problem didn't $_session['oauth_token_secret']
session variable not getting, set in default view , have proper value unable session in action file in direct call method.
iam not sure in elgg standard, please advice me solve problem
thanks in advance..
don't use direct call. first thing: you're using deprecated action registration parameters - update call. assume you're writing elgg 1.8 or later.
you're additng action tokens in wrong way! they're necessary prevent xsrf attacks, need pe added @ url generation. elgg_register_action, need pass action file path, not url. use elgg_add_action_tokens_to_url
and read through http://docs.elgg.org/wiki/actions#security
you should specific error telling that, didn't mention it.
Comments
Post a Comment