From 53ab8cf80e4990ac1daf17c7a23931d26110e2f5 Mon Sep 17 00:00:00 2001 From: cash Date: Tue, 14 Dec 2010 12:54:15 +0000 Subject: Fixes #2723 members listing pages now in core git-svn-id: http://code.elgg.org/elgg/trunk@7616 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/upgrades/2010121401.php | 7 +++++++ engine/lib/users.php | 24 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 engine/lib/upgrades/2010121401.php (limited to 'engine') diff --git a/engine/lib/upgrades/2010121401.php b/engine/lib/upgrades/2010121401.php new file mode 100644 index 000000000..30e4dff32 --- /dev/null +++ b/engine/lib/upgrades/2010121401.php @@ -0,0 +1,7 @@ +site->guid); \ No newline at end of file diff --git a/engine/lib/users.php b/engine/lib/users.php index a91f143b0..a7153a1be 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -1461,6 +1461,29 @@ function user_create_hook_add_site_relationship($event, $object_type, $object) { add_entity_relationship($object->getGUID(), 'member_of_site', $CONFIG->site->getGUID()); } +/** + * Members page handler + * + * @param array $page url segments + */ +function elgg_members_page_handler($page) { + global $CONFIG; + + if (!isset($page[0])) { + $page[0] = 'newest'; + } + + $vars = array(); + $vars['page'] = $page[0]; + + if ($page[0] == 'search') { + $vars['search_type'] = $page[1]; + require_once("{$CONFIG->path}pages/members/search.php"); + } else { + require_once("{$CONFIG->path}pages/members/index.php"); + } +} + /** * Sets up user-related menu items * @@ -1511,6 +1534,7 @@ function users_init() { register_page_handler('register', 'registration_page_handler'); register_page_handler('resetpassword', 'elgg_user_resetpassword_page_handler'); register_page_handler('login', 'elgg_user_login_page_handler'); + register_page_handler('members', 'elgg_members_page_handler'); elgg_register_action("register", '', 'public'); elgg_register_action("useradd", '', 'public'); -- cgit v1.2.3