diff options
Diffstat (limited to 'mod')
33 files changed, 208 insertions, 167 deletions
diff --git a/mod/blog/start.php b/mod/blog/start.php index 9e77b0a93..052c63651 100644 --- a/mod/blog/start.php +++ b/mod/blog/start.php @@ -93,14 +93,14 @@ function blog_init() { * @todo no archives for all blogs or friends * * @param array $page - * @return NULL + * @return bool */ function blog_page_handler($page) { elgg_load_library('elgg:blog'); // @todo remove the forwarder in 1.9 - // forward to correct URL for bookmarks pre-1.7.5 + // forward to correct URL for blog pages pre-1.7.5 blog_url_forwarder($page); // push all blogs breadcrumb @@ -139,10 +139,10 @@ function blog_page_handler($page) { $params = blog_get_page_content_list($page[1]); break; case 'all': - default: - $title = elgg_echo('blog:title:all_blogs'); $params = blog_get_page_content_list(); break; + default: + return false; } $params['sidebar'] .= elgg_view('blog/sidebar', array('page' => $page_type)); @@ -150,6 +150,7 @@ function blog_page_handler($page) { $body = elgg_view_layout('content', $params); echo elgg_view_page($params['title'], $body); + return true; } /** diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php index 2a7b44e97..21a2d8940 100644 --- a/mod/bookmarks/start.php +++ b/mod/bookmarks/start.php @@ -83,6 +83,7 @@ function bookmarks_init() { * Title is ignored * * @param array $page + * @return bool */ function bookmarks_page_handler($page) { elgg_load_library('elgg:bookmarks'); @@ -151,7 +152,6 @@ function bookmarks_page_handler($page) { } elgg_pop_context(); - return true; } diff --git a/mod/categories/start.php b/mod/categories/start.php index b6bc4a55c..0aacf11e7 100644 --- a/mod/categories/start.php +++ b/mod/categories/start.php @@ -27,12 +27,12 @@ function categories_init() { /** - * Page handler - * + * Category page handler + * @return bool */ function categories_page_handler() { include(dirname(__FILE__) . "/pages/categories/listing.php"); - return TRUE; + return true; } /** diff --git a/mod/custom_index/views/default/custom_index/css.php b/mod/custom_index/views/default/custom_index/css.php index 841b66761..4c780a905 100644 --- a/mod/custom_index/views/default/custom_index/css.php +++ b/mod/custom_index/views/default/custom_index/css.php @@ -11,12 +11,12 @@ .custom-index { padding: 10px 0; } -.elgg-module-front { +.elgg-module-highlight { -webkit-box-shadow: 1px 1px 5px #CCC; -moz-box-shadow: 1px 1px 5px #CCC; box-shadow: 1px 1px 5px #CCC; } -.elgg-module-front:hover { +.elgg-module-highlight:hover { -webkit-box-shadow: 1px 1px 6px #AAA; -moz-box-shadow: 1px 1px 6px #AAA; box-shadow: 1px 1px 6px #AAA; diff --git a/mod/custom_index/views/default/page/layouts/custom_index.php b/mod/custom_index/views/default/page/layouts/custom_index.php index 46efa11e2..1267e19b2 100644 --- a/mod/custom_index/views/default/page/layouts/custom_index.php +++ b/mod/custom_index/views/default/page/layouts/custom_index.php @@ -7,7 +7,7 @@ * */ -$mod_params = array('class' => 'elgg-module-featured'); +$mod_params = array('class' => 'elgg-module-highlight'); ?> @@ -25,22 +25,19 @@ if (elgg_is_logged_in()) { } else { $top_box = $vars['login']; } -echo elgg_view_module('front', '', $top_box, array( - 'header' => false, - 'class' => 'elgg-module-featured', -)); +echo elgg_view_module('featured', '', $top_box, $mod_params); // a view for plugins to extend echo elgg_view("index/lefthandside"); // files if (elgg_is_active_plugin('file')) { - echo elgg_view_module('front', elgg_echo("custom:files"), $vars['files'], $mod_params); + echo elgg_view_module('featured', elgg_echo("custom:files"), $vars['files'], $mod_params); } // groups if (elgg_is_active_plugin('groups')) { - echo elgg_view_module('front', elgg_echo("custom:groups"), $vars['groups'], $mod_params); + echo elgg_view_module('featured', elgg_echo("custom:groups"), $vars['groups'], $mod_params); } ?> </div> @@ -54,16 +51,16 @@ if (elgg_is_active_plugin('groups')) { echo elgg_view("index/righthandside"); // files -echo elgg_view_module('front', elgg_echo("custom:members"), $vars['members'], $mod_params); +echo elgg_view_module('featured', elgg_echo("custom:members"), $vars['members'], $mod_params); // groups if (elgg_is_active_plugin('blog')) { - echo elgg_view_module('front', elgg_echo("custom:blogs"), $vars['blogs'], $mod_params); + echo elgg_view_module('featured', elgg_echo("custom:blogs"), $vars['blogs'], $mod_params); } // files if (elgg_is_active_plugin('bookmarks')) { - echo elgg_view_module('front', elgg_echo("custom:bookmarks"), $vars['bookmarks'], $mod_params); + echo elgg_view_module('featured', elgg_echo("custom:bookmarks"), $vars['bookmarks'], $mod_params); } ?> </div> diff --git a/mod/dashboard/start.php b/mod/dashboard/start.php index 5635ead57..65007d1a8 100644 --- a/mod/dashboard/start.php +++ b/mod/dashboard/start.php @@ -29,6 +29,10 @@ function dashboard_init() { elgg_register_plugin_hook_handler('get_list', 'default_widgets', 'dashboard_default_widgets'); } +/** + * Dashboard page handler + * @return bool + */ function dashboard_page_handler() { // Ensure that only logged-in users can see this page gatekeeper(); @@ -51,6 +55,7 @@ function dashboard_page_handler() { $body = elgg_view_layout('one_column', array('content' => $widgets)); echo elgg_view_page($title, $body); + return true; } diff --git a/mod/developers/start.php b/mod/developers/start.php index ab9a174a4..2e3df7663 100644 --- a/mod/developers/start.php +++ b/mod/developers/start.php @@ -157,6 +157,7 @@ function developers_log_events($name, $type) { * Serve the theme preview pages * * @param array $page + * @return bool */ function developers_theme_preview_controller($page) { if (!isset($page[0])) { @@ -191,4 +192,5 @@ function developers_theme_preview_controller($page) { )); echo elgg_view_page($title, $layout, 'theme_preview'); + return true; } diff --git a/mod/diagnostics/start.php b/mod/diagnostics/start.php index 735e15042..0bcc08bd9 100644 --- a/mod/diagnostics/start.php +++ b/mod/diagnostics/start.php @@ -12,9 +12,6 @@ elgg_register_event_handler('init', 'system', 'diagnostics_init'); */ function diagnostics_init() { - // Register a page handler, so we can have nice URLs - elgg_register_page_handler('diagnostics','diagnostics_page_handler'); - // Add admin menu item elgg_register_admin_menu_item('develop', 'diagnostics', 'develop_utilities'); diff --git a/mod/externalpages/start.php b/mod/externalpages/start.php index 3169503be..13235af53 100644 --- a/mod/externalpages/start.php +++ b/mod/externalpages/start.php @@ -53,6 +53,7 @@ function expages_setup_footer_menu() { * * @param array $page URL segements * @param string $handler Handler identifier + * @return bool */ function expages_page_handler($page, $handler) { if ($handler == 'expages') { @@ -76,6 +77,7 @@ function expages_page_handler($page, $handler) { $body = elgg_view_layout("one_sidebar", array('content' => $content)); echo elgg_view_page($title, $body); + return true; } /** diff --git a/mod/file/start.php b/mod/file/start.php index 9007fc9ba..f8b7fa423 100644 --- a/mod/file/start.php +++ b/mod/file/start.php @@ -100,7 +100,7 @@ function file_init() { * Title is ignored * * @param array $page - * @return NULL + * @return bool */ function file_page_handler($page) { @@ -136,19 +136,21 @@ function file_page_handler($page) { include "$file_dir/owner.php"; break; case 'all': - default: include "$file_dir/world.php"; break; + default: + return false; } + return true; } /** * Creates the notification message body * - * @param unknown_type $hook - * @param unknown_type $entity_type - * @param unknown_type $returnvalue - * @param unknown_type $params + * @param string $hook + * @param string $entity_type + * @param string $returnvalue + * @param array $params */ function file_notify_message($hook, $entity_type, $returnvalue, $params) { $entity = $params['entity']; diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php index 0818e5602..09feaf8d1 100644 --- a/mod/groups/languages/en.php +++ b/mod/groups/languages/en.php @@ -114,6 +114,7 @@ $english = array( 'discussion:latest' => 'Latest discussion', 'discussion:group' => 'Group discussion', 'discussion:none' => 'No discussion', + 'discussion:reply:title' => 'Reply by %s', 'discussion:topic:created' => 'The discussion topic was created.', 'discussion:topic:updated' => 'The discussion topic was updated.', diff --git a/mod/groups/start.php b/mod/groups/start.php index 1b5b03ce7..5469da013 100644 --- a/mod/groups/start.php +++ b/mod/groups/start.php @@ -192,6 +192,7 @@ function groups_setup_sidebar_menus() { * Group members: groups/members/<guid> * * @param array $page Array of url segments for routing + * @return bool */ function groups_page_handler($page) { @@ -238,13 +239,17 @@ function groups_page_handler($page) { case 'requests': groups_handle_requests_page($page[1]); break; + default: + return false; } + return true; } /** * Handle group icons. * - * @param unknown_type $page + * @param array $page + * @return void */ function groups_icon_handler($page) { @@ -750,6 +755,7 @@ function discussion_init() { * Edit discussion topic: discussion/edit/<guid> * * @param array $page Array of url segments for routing + * @return bool */ function discussion_page_handler($page) { @@ -773,7 +779,10 @@ function discussion_page_handler($page) { case 'view': discussion_handle_view_page($page[1]); break; + default: + return false; } + return true; } /** diff --git a/mod/groups/views/rss/annotation/group_topic_post.php b/mod/groups/views/rss/annotation/group_topic_post.php new file mode 100644 index 000000000..0d3a40117 --- /dev/null +++ b/mod/groups/views/rss/annotation/group_topic_post.php @@ -0,0 +1,32 @@ +<?php +/** + * RSS view for a discussion reply + * + * @uses $vars['annotation'] + */ + +$annotation = $vars['annotation']; + +$poster = $annotation->getOwnerEntity(); +$poster_name = htmlspecialchars($poster->name, ENT_NOQUOTES, 'UTF-8'); +$pubdate = date('r', $annotation->getTimeCreated()); +$permalink = $annotation->getURL(); + +$title = elgg_echo('discussion:reply:title', array($poster_name)); + +$creator = elgg_view('page/components/creator', array('entity' => $annotation)); +$extensions = elgg_view('extensions/item', $vars); + +$item = <<<__HTML +<item> + <guid isPermaLink='true'>$permalink</guid> + <pubDate>$pubdate</pubDate> + <link>$permalink</link> + <title><![CDATA[$title]]></title> + <description><![CDATA[{$vars['annotation']->value}]]></description> + $creator$extensions +</item> + +__HTML; + +echo $item; diff --git a/mod/groups/views/rss/discussion/replies.php b/mod/groups/views/rss/discussion/replies.php new file mode 100644 index 000000000..419003b21 --- /dev/null +++ b/mod/groups/views/rss/discussion/replies.php @@ -0,0 +1,12 @@ +<?php +/** + * List replies RSS view + * + * @uses $vars['entity'] ElggEntity + */ + +$options = array( + 'guid' => $vars['entity']->getGUID(), + 'annotation_name' => 'group_topic_post', +); +echo elgg_list_annotations($options); diff --git a/mod/groups/views/rss/forum/topicposts.php b/mod/groups/views/rss/forum/topicposts.php deleted file mode 100644 index 15c5adc7f..000000000 --- a/mod/groups/views/rss/forum/topicposts.php +++ /dev/null @@ -1,3 +0,0 @@ -<?php - -?>
\ No newline at end of file diff --git a/mod/groups/views/rss/forum/topics.php b/mod/groups/views/rss/forum/topics.php deleted file mode 100644 index 1cb22aaea..000000000 --- a/mod/groups/views/rss/forum/topics.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - /** - * Elgg groups plugin - * - * @package ElggGroups - */ - - // If there are any topics to view, view them - echo $vars['topics']; -?>
\ No newline at end of file diff --git a/mod/groups/views/rss/forum/viewposts.php b/mod/groups/views/rss/forum/viewposts.php deleted file mode 100644 index ad52365e6..000000000 --- a/mod/groups/views/rss/forum/viewposts.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - - /** - * Elgg groups plugin display topic posts - * - * @package ElggGroups - */ - - //display follow up comments - $count = $vars['entity']->countAnnotations('group_topic_post'); - $offset = (int) get_input('offset',0); - - foreach($vars['entity']->getAnnotations('group_topic_post', 50, $offset, "asc") as $post) { - - $post->title = ''; - $post->description = $post->value; - echo elgg_view('object/default', array('entity' => $post)); - // echo elgg_view("forum/topicposts",array('entity' => $post)); - - } - -?>
\ No newline at end of file diff --git a/mod/groups/views/rss/groups/contentwrapper.php b/mod/groups/views/rss/groups/contentwrapper.php deleted file mode 100644 index 15397d552..000000000 --- a/mod/groups/views/rss/groups/contentwrapper.php +++ /dev/null @@ -1,5 +0,0 @@ -<?php - - echo $vars['body']; - -?>
\ No newline at end of file diff --git a/mod/groups/views/rss/groups/profile/layout.php b/mod/groups/views/rss/groups/profile/layout.php new file mode 100644 index 000000000..3eeb9eaf2 --- /dev/null +++ b/mod/groups/views/rss/groups/profile/layout.php @@ -0,0 +1,13 @@ +<?php +/** + * Group profile RSS view + * + * Displays a list of the latest content in the group + * + * @uses $vars['entity'] ElggGroup object + */ + +echo elgg_list_entities(array( + 'type' => 'object', + 'container_guid' => $vars['entity']->getGUID(), +)); diff --git a/mod/groups/views/rss/groups/profileitems.php b/mod/groups/views/rss/groups/profileitems.php deleted file mode 100644 index 5e595a379..000000000 --- a/mod/groups/views/rss/groups/profileitems.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - /** - * Elgg groups items view. - * This is the messageboard, members, pages and latest forums posts. Each plugin will extend the views - * - * @package ElggGroups - */ - - //right column - if ($forae = elgg_get_entities(array('types' => 'object', 'container_guid' => $vars['entity']->guid))) { - foreach($forae as $forum) - echo elgg_view_entity($forum); - } - -?>
\ No newline at end of file diff --git a/mod/groups/views/rss/object/groupforumtopic.php b/mod/groups/views/rss/object/groupforumtopic.php index 19297b350..d730ef796 100644 --- a/mod/groups/views/rss/object/groupforumtopic.php +++ b/mod/groups/views/rss/object/groupforumtopic.php @@ -1,32 +1,35 @@ <?php /** - * Elgg groupforumtopic view + * Elgg groupforumtopic RSS view * - * @package Elgg - * @subpackage Core + * @package ElggGroups */ $title = $vars['entity']->title; - -$body = ''; -$annotation = $vars['entity']->getAnnotations('group_topic_post', 1, 0, "asc"); -if (count($annotation == 1)) { - $body = $annotation[0]->value; +if (empty($title)) { + $title = strip_tags($vars['entity']->description); + $title = elgg_get_excerpt($title, 32); } -?> +$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8'); +$pubdate = date('r', $vars['entity']->getTimeCreated()); + +$description = autop($vars['entity']->description); + +$creator = elgg_view('page/components/creator', $vars); +$georss = elgg_view('page/components/georss', $vars); +$extension = elgg_view('extensions/item', $vars); + +$item = <<<__HTML <item> -<guid isPermaLink='true'><?php echo htmlspecialchars($vars['entity']->getURL()); ?></guid> -<pubDate><?php echo date("r",$vars['entity']->time_created) ?></pubDate> -<link><?php echo htmlspecialchars($vars['entity']->getURL()); ?></link> -<title><![CDATA[<?php echo $title; ?>]]></title> -<description><![CDATA[<?php echo (autop($body)); ?>]]></description> -<?php - $owner = $vars['entity']->getOwnerEntity(); - if ($owner) { -?> -<dc:creator><?php echo $owner->name; ?></dc:creator> -<?php - } -?> -</item>
\ No newline at end of file + <guid isPermaLink="true">$permalink</guid> + <pubDate>$pubdate</pubDate> + <link>$permalink</link> + <title><![CDATA[$title]]></title> + <description><![CDATA[$description]]></description> + $creator$georss$extension +</item> + +__HTML; + +echo $item; diff --git a/mod/invitefriends/start.php b/mod/invitefriends/start.php index f39d25f4b..be853f2ce 100644 --- a/mod/invitefriends/start.php +++ b/mod/invitefriends/start.php @@ -27,6 +27,7 @@ function invitefriends_init() { * Page handler function * * @param array $page Page URL segments + * @return bool */ function invitefriends_page_handler($page) { gatekeeper(); @@ -45,4 +46,5 @@ function invitefriends_page_handler($page) { $body = elgg_view_layout('one_sidebar', $params); echo elgg_view_page($title, $body); + return true; } diff --git a/mod/members/start.php b/mod/members/start.php index 2c1793c17..54787cd16 100644 --- a/mod/members/start.php +++ b/mod/members/start.php @@ -19,6 +19,7 @@ function members_init() { * Members page handler * * @param array $page url segments + * @return bool */ function members_page_handler($page) { $base = elgg_get_plugins_path() . 'members/pages/members'; @@ -36,4 +37,5 @@ function members_page_handler($page) { } else { require_once "$base/index.php"; } + return true; } diff --git a/mod/messageboard/start.php b/mod/messageboard/start.php index 0b0155069..0c65edc4f 100644 --- a/mod/messageboard/start.php +++ b/mod/messageboard/start.php @@ -84,8 +84,10 @@ function messageboard_page_handler($page) { set_input('page_owner_guid', $owner_guid); include "$pages/owner.php"; break; - } + default: + return false; + } return true; } diff --git a/mod/messages/start.php b/mod/messages/start.php index 4a3b0b250..e4ef4d43a 100644 --- a/mod/messages/start.php +++ b/mod/messages/start.php @@ -115,7 +115,6 @@ function messages_page_handler($page) { default: return false; } - return true; } diff --git a/mod/notifications/start.php b/mod/notifications/start.php index c6701cc3e..761f17e40 100644 --- a/mod/notifications/start.php +++ b/mod/notifications/start.php @@ -36,6 +36,7 @@ function notifications_plugin_init() { * Route page requests * * @param array $page Array of url parameters + * @return bool */ function notifications_page_handler($page) { @@ -51,12 +52,12 @@ function notifications_page_handler($page) { require "$base/groups.php"; break; case 'personal': - default: require "$base/index.php"; break; + default: + return false; } - - return TRUE; + return true; } /** diff --git a/mod/pages/start.php b/mod/pages/start.php index 744306649..b2f26c719 100644 --- a/mod/pages/start.php +++ b/mod/pages/start.php @@ -100,6 +100,7 @@ function pages_init() { * Title is ignored * * @param array $page + * @return bool */ function pages_page_handler($page) { @@ -149,12 +150,12 @@ function pages_page_handler($page) { include "$base_dir/revision.php"; break; case 'all': - default: include "$base_dir/world.php"; break; + default: + return false; } - - return; + return true; } /** diff --git a/mod/profile/start.php b/mod/profile/start.php index 0f13ad844..0ee2d0152 100644 --- a/mod/profile/start.php +++ b/mod/profile/start.php @@ -48,6 +48,7 @@ function profile_init() { * Profile page handler * * @param array $page Array of URL segments passed by the page handling mechanism + * @return bool */ function profile_page_handler($page) { @@ -84,6 +85,7 @@ function profile_page_handler($page) { $body = elgg_view_layout('one_column', array('content' => $content)); echo elgg_view_page($title, $body); + return true; } /** diff --git a/mod/reportedcontent/start.php b/mod/reportedcontent/start.php index 66a1248d9..8b18a4d64 100644 --- a/mod/reportedcontent/start.php +++ b/mod/reportedcontent/start.php @@ -60,6 +60,7 @@ function reportedcontent_init() { * Serves the add report page * * @param array $page Array of page routing elements + * @return bool */ function reportedcontent_page_handler($page) { // only logged in users can report things @@ -76,6 +77,7 @@ function reportedcontent_page_handler($page) { $body = elgg_view_layout('one_sidebar', $params); echo elgg_view_page(elgg_echo('reportedcontent:this'), $body); + return true; } /** diff --git a/mod/search/start.php b/mod/search/start.php index 9ab14f42f..73a96dc0a 100644 --- a/mod/search/start.php +++ b/mod/search/start.php @@ -14,7 +14,7 @@ function search_init() { require_once 'search_hooks.php'; // page handler for search actions and results - elgg_register_page_handler('search','search_page_handler'); + elgg_register_page_handler('search', 'search_page_handler'); // register some default search hooks elgg_register_plugin_hook_handler('search', 'object', 'search_objects_hook'); @@ -55,7 +55,8 @@ function search_init() { /** * Page handler for search * - * @param array $page Page elements from pain page handler + * @param array $page Page elements from core page handler + * @return bool */ function search_page_handler($page) { @@ -71,6 +72,7 @@ function search_page_handler($page) { $base_dir = elgg_get_plugins_path() . 'search/pages/search'; include_once("$base_dir/index.php"); + return true; } /** diff --git a/mod/thewire/start.php b/mod/thewire/start.php index d5e995359..2ed0f0b4d 100644 --- a/mod/thewire/start.php +++ b/mod/thewire/start.php @@ -84,57 +84,60 @@ function thewire_init() { * thewire/tag/<tag> View wire posts tagged with <tag> * * @param array $page From the page_handler function - * @return true|false Depending on success + * @return bool */ function thewire_page_handler($page) { $base_dir = elgg_get_plugins_path() . 'thewire/pages/thewire'; - // if just /thewire go to global view in the else statement - if (isset($page[0]) && $page[0]) { - - switch ($page[0]) { - case "all": - include "$base_dir/everyone.php"; - break; - - case "friends": - include "$base_dir/friends.php"; - break; - - case "owner": - include "$base_dir/owner.php"; - break; - - case "thread": - if (isset($page[1])) { - set_input('thread_id', $page[1]); - } - include "$base_dir/thread.php"; - break; - case "reply": - if (isset($page[1])) { - set_input('guid', $page[1]); - } - include "$base_dir/reply.php"; - break; - case "tag": - if (isset($page[1])) { - set_input('tag', $page[1]); - } - include "$base_dir/tag.php"; - break; - case "previous": - if (isset($page[1])) { - set_input('guid', $page[1]); - } - include "$base_dir/previous.php"; - break; - } - } else { - include "$base_dir/everyone.php"; + if (!isset($page[0])) { + $page = array('all'); } + switch ($page[0]) { + case "all": + include "$base_dir/everyone.php"; + break; + + case "friends": + include "$base_dir/friends.php"; + break; + + case "owner": + include "$base_dir/owner.php"; + break; + + case "thread": + if (isset($page[1])) { + set_input('thread_id', $page[1]); + } + include "$base_dir/thread.php"; + break; + + case "reply": + if (isset($page[1])) { + set_input('guid', $page[1]); + } + include "$base_dir/reply.php"; + break; + + case "tag": + if (isset($page[1])) { + set_input('tag', $page[1]); + } + include "$base_dir/tag.php"; + break; + + case "previous": + if (isset($page[1])) { + set_input('guid', $page[1]); + } + include "$base_dir/previous.php"; + break; + + default: + return false; + } return true; } diff --git a/mod/twitter_api/start.php b/mod/twitter_api/start.php index b17643c8c..08bce5479 100644 --- a/mod/twitter_api/start.php +++ b/mod/twitter_api/start.php @@ -45,6 +45,7 @@ function twitter_api_init() { * Handles old pg/twitterservice/ handler * * @param array $page + * @return bool */ function twitter_api_pagehandler_deprecated($page) { $url = elgg_get_site_url() . 'pg/twitter_api/authorize'; @@ -59,10 +60,11 @@ function twitter_api_pagehandler_deprecated($page) { * Serves pages for twitter. * * @param array $page + * @return void */ function twitter_api_pagehandler($page) { if (!isset($page[0])) { - forward(); + return false; } switch ($page[0]) { @@ -91,9 +93,9 @@ function twitter_api_pagehandler($page) { include "$pages/interstitial.php"; break; default: - forward(); - break; + return false; } + return true; } /** diff --git a/mod/uservalidationbyemail/start.php b/mod/uservalidationbyemail/start.php index d3d0c3488..6904ce9e2 100644 --- a/mod/uservalidationbyemail/start.php +++ b/mod/uservalidationbyemail/start.php @@ -149,6 +149,7 @@ function uservalidationbyemail_check_auth_attempt($credentials) { * Checks sent passed validation code and user guids and validates the user. * * @param array $page + * @return bool */ function uservalidationbyemail_page_handler($page) { @@ -162,7 +163,7 @@ function uservalidationbyemail_page_handler($page) { $user = get_entity($user_guid); - if (($code) && ($user)) { + if ($code && $user) { if (uservalidationbyemail_validate_email($user_guid, $code)) { elgg_push_context('uservalidationbyemail_validate_user'); @@ -184,7 +185,8 @@ function uservalidationbyemail_page_handler($page) { register_error(elgg_echo('email:confirm:fail')); } - forward(); + // forward to front page + forward(''); } /** |