diff options
author | nickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-18 18:42:09 +0000 |
---|---|---|
committer | nickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-18 18:42:09 +0000 |
commit | 951d084b015bcb86019180d270297efaae635b2e (patch) | |
tree | b4989c8db760c47573bfc855ff9d23d5f03817d2 /mod | |
parent | dd09373e0cefa8d33d0e9faa741593802d53c2a7 (diff) | |
download | elgg-951d084b015bcb86019180d270297efaae635b2e.tar.gz elgg-951d084b015bcb86019180d270297efaae635b2e.tar.bz2 |
Adding plugin hooks for authorization and login events.
git-svn-id: http://code.elgg.org/elgg/trunk@8289 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod')
-rw-r--r-- | mod/twitterservice/twitterservice_lib.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mod/twitterservice/twitterservice_lib.php b/mod/twitterservice/twitterservice_lib.php index bc9d28ec6..b3af18079 100644 --- a/mod/twitterservice/twitterservice_lib.php +++ b/mod/twitterservice/twitterservice_lib.php @@ -74,6 +74,9 @@ function twitterservice_login() { if ($users) { if (count($users) == 1 && login($users[0])) { system_message(elgg_echo('twitterservice:login:success')); + + // trigger login hook + elgg_trigger_plugin_hook('login', 'twitterservice', array('user' => $users[0])); } else { system_message(elgg_echo('twitterservice:login:error')); } @@ -153,6 +156,9 @@ function twitterservice_login() { // login new user if (login($user)) { system_message(elgg_echo('twitterservice:login:success')); + + // trigger login hook for new user + elgg_trigger_plugin_hook('first_login', 'twitterservice', array('user' => $user)); } else { system_message(elgg_echo('twitterservice:login:error')); } @@ -242,6 +248,9 @@ function twitterservice_authorize() { elgg_set_plugin_user_setting('twitter_name', $token['screen_name']); elgg_set_plugin_user_setting('access_key', $token['oauth_token']); elgg_set_plugin_user_setting('access_secret', $token['oauth_token_secret']); + + // trigger authorization hook + elgg_trigger_plugin_hook('authorize', 'twitterservice', array('token' => $token)); system_message(elgg_echo('twitterservice:authorize:success')); forward('pg/settings/plugins', 'twitterservice'); |