aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-12-17 16:21:41 -0500
committercash <cash.costello@gmail.com>2011-12-17 16:21:41 -0500
commitde76ce685a8bb37a4fc7daa621b496a3bbae3878 (patch)
treeeee182097acc19c3e522b70339d36877473d3d35
parent3778bd5b448277dba6a779259de7b302ec39eb33 (diff)
downloadelgg-de76ce685a8bb37a4fc7daa621b496a3bbae3878.tar.gz
elgg-de76ce685a8bb37a4fc7daa621b496a3bbae3878.tar.bz2
preventing an openid user from setting password
-rw-r--r--start.php25
1 files changed, 8 insertions, 17 deletions
diff --git a/start.php b/start.php
index afe12ae92..a1defd280 100644
--- a/start.php
+++ b/start.php
@@ -26,7 +26,8 @@ function openid_client_init() {
elgg_register_event_handler('create', 'user', 'openid_client_set_subtype', 1);
- //elgg_register_page_handler('openid_client', 'openid_client_page_handler');
+ // don't let OpenID users set their passwords
+ elgg_register_event_handler('pagesetup', 'system', 'openid_client_remove_email');
}
/**
@@ -83,21 +84,11 @@ function openid_client_setup_menu($hook, $type, $menu, $params) {
}
/**
- * OpenID client page handler
- *
- * @param type $page Array of URL segments
- * @return bool
+ * Remove the password view from the account settings form
*/
-function openid_client_page_handler($page) {
-
- // this is test code for right now
- elgg_load_library('openid_client');
- openid_client_registration_page_handler(array(
- 'username' => 'john',
- 'email' => 'john@example.org',
- 'name' => 'John Doe',
- 'openid_identifier' => 'abcdefghijklmnopqrstuvwxyz',
- ));
-
- return true;
+function openid_client_remove_email() {
+ $page_owner = elgg_get_page_owner_entity();
+ if ($page_owner && elgg_instanceof($page_owner, 'user', 'openid')) {
+ elgg_unextend_view('forms/account/settings', 'core/settings/account/password');
+ }
}