From a76b3e545010f2c33adbfc29063e989b6aac8c55 Mon Sep 17 00:00:00 2001 From: nickw Date: Fri, 16 Apr 2010 21:24:21 +0000 Subject: Registering a Walled Garden hook which will not allow new user signup with Twitter Services. git-svn-id: http://code.elgg.org/elgg/trunk@5784 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/walledgarden/languages/en.php | 12 ++++++++++++ mod/walledgarden/start.php | 9 ++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 mod/walledgarden/languages/en.php diff --git a/mod/walledgarden/languages/en.php b/mod/walledgarden/languages/en.php new file mode 100644 index 000000000..4943ec94f --- /dev/null +++ b/mod/walledgarden/languages/en.php @@ -0,0 +1,12 @@ + 'Walled Garden', + + 'walledgarden:new_user:fail' => 'This site does not accept new user registration.', +); + +add_translation('en', $english); diff --git a/mod/walledgarden/start.php b/mod/walledgarden/start.php index 9d28a1418..df0982d3c 100644 --- a/mod/walledgarden/start.php +++ b/mod/walledgarden/start.php @@ -29,7 +29,8 @@ //if (function_exists('elgg_view_disable_simplecache')) { // elgg_view_disable_simplecache(); //} - + + register_plugin_hook('new_twitter_user', 'twitter_service', 'walledgarden_new_twitter_user'); } function walledgarden_pagesetup() { @@ -52,6 +53,12 @@ return true; } + + function walledgarden_new_twitter_user($hook, $entity_type, $returnvalue, $params) { + // do not allow new users to be created within the walled-garden + register_error(elgg_echo('walledgarden:new_user:fail')); + return FALSE; + } register_elgg_event_handler('init','system','walledgarden_init'); register_elgg_event_handler('pagesetup','system','walledgarden_pagesetup'); -- cgit v1.2.3