diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-08 19:52:10 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-08 19:52:10 +0000 |
commit | ccb6d625239b59b283b4d3fc00da704ab743d74c (patch) | |
tree | da9b11d8758b3007c025e4d5487410ae1ca69f68 /mod | |
parent | 1368785a6b6f9c946dcc5eca078540bacce71f60 (diff) | |
download | elgg-ccb6d625239b59b283b4d3fc00da704ab743d74c.tar.gz elgg-ccb6d625239b59b283b4d3fc00da704ab743d74c.tar.bz2 |
Refs #2543: Updated trunk mods and views to use the new functions from previous 2 commits.
git-svn-id: http://code.elgg.org/elgg/trunk@8079 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod')
81 files changed, 133 insertions, 133 deletions
diff --git a/mod/blog/actions/blog/auto_save_revision.php b/mod/blog/actions/blog/auto_save_revision.php index d400dda90..86812c6d3 100644 --- a/mod/blog/actions/blog/auto_save_revision.php +++ b/mod/blog/actions/blog/auto_save_revision.php @@ -6,7 +6,7 @@ */ $guid = get_input('guid'); -$user = get_loggedin_user(); +$user = elgg_get_logged_in_user_entity(); $title = get_input('title'); $description = get_input('description'); $excerpt = get_input('excerpt'); diff --git a/mod/blog/actions/blog/save.php b/mod/blog/actions/blog/save.php index 4e6e9133b..dbbe25e04 100644 --- a/mod/blog/actions/blog/save.php +++ b/mod/blog/actions/blog/save.php @@ -11,7 +11,7 @@ // store errors to pass along $error = FALSE; $error_forward_url = REFERER; -$user = get_loggedin_user(); +$user = elgg_get_logged_in_user_entity(); // edit or create a new entity $guid = get_input('guid'); @@ -146,7 +146,7 @@ if (!$error) { // @todo do we want to alert on updates? if ($new_post && $blog->status == 'published') { - add_to_river('river/object/blog/create', 'create', get_loggedin_userid(), $blog->getGUID()); + add_to_river('river/object/blog/create', 'create', elgg_get_logged_in_user_guid(), $blog->getGUID()); } if ($blog->status == 'published') { forward($blog->getURL()); diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php index 3a8985026..5e2cc7c52 100644 --- a/mod/blog/lib/blog.php +++ b/mod/blog/lib/blog.php @@ -67,7 +67,7 @@ function blog_get_page_content_list($container_guid = NULL) { //'order_by_metadata' => array('name'=>'publish_date', 'direction'=>'DESC', 'as'=>'int') ); - $loggedin_userid = get_loggedin_userid(); + $loggedin_userid = elgg_get_logged_in_user_guid(); if ($container_guid) { $options['container_guid'] = $container_guid; $container = get_entity($container_guid); @@ -90,7 +90,7 @@ function blog_get_page_content_list($container_guid = NULL) { if (elgg_instanceof($container, 'group')) { $return['filter'] = ''; - if ($container->isMember(get_loggedin_user())) { + if ($container->isMember(elgg_get_logged_in_user_entity())) { $url = "pg/blog/add/$container->guid"; $params = array( 'href' => $url, @@ -108,7 +108,7 @@ function blog_get_page_content_list($container_guid = NULL) { // show all posts for admin or users looking at their own blogs // show only published posts for other users. - if (!(isadminloggedin() || (isloggedin() && $container_guid == $loggedin_userid))) { + if (!(elgg_is_admin_logged_in() || (elgg_is_logged_in() && $container_guid == $loggedin_userid))) { $options['metadata_name_value_pairs'] = array( array('name' => 'status', 'value' => 'published'), //array('name' => 'publish_date', 'operand' => '<', 'value' => time()) @@ -162,7 +162,7 @@ function blog_get_page_content_friends($user_guid) { // admin / owners can see any posts // everyone else can only see published posts - if (!(isadminloggedin() || (isloggedin() && $owner_guid == get_loggedin_userid()))) { + if (!(elgg_is_admin_logged_in() || (elgg_is_logged_in() && $owner_guid == elgg_get_logged_in_user_guid()))) { if ($upper > $now) { $upper = $now; } @@ -222,7 +222,7 @@ function blog_get_page_content_archive($owner_guid, $lower = 0, $upper = 0) { // admin / owners can see any posts // everyone else can only see published posts - if (!(isadminloggedin() || (isloggedin() && $owner_guid == get_loggedin_userid()))) { + if (!(elgg_is_admin_logged_in() || (elgg_is_logged_in() && $owner_guid == elgg_get_logged_in_user_guid()))) { if ($upper > $now) { $upper = $now; } @@ -321,7 +321,7 @@ function blog_get_page_content_edit($page, $guid = 0, $revision = NULL) { } } else { if (!$guid) { - $container = get_loggedin_user(); + $container = elgg_get_logged_in_user_entity(); } else { $container = get_entity($guid); } diff --git a/mod/blog/views/default/blog/sidebar/archives.php b/mod/blog/views/default/blog/sidebar/archives.php index 477e1261e..bd74500ca 100644 --- a/mod/blog/views/default/blog/sidebar/archives.php +++ b/mod/blog/views/default/blog/sidebar/archives.php @@ -3,7 +3,7 @@ * Blog archives */ -$loggedin_user = get_loggedin_user(); +$loggedin_user = elgg_get_logged_in_user_entity(); $page_owner = elgg_get_page_owner_entity(); // This is a limitation of the URL schema. diff --git a/mod/blog/views/default/blog/sidebar/tagcloud.php b/mod/blog/views/default/blog/sidebar/tagcloud.php index f1ef7ffdb..70c454390 100644 --- a/mod/blog/views/default/blog/sidebar/tagcloud.php +++ b/mod/blog/views/default/blog/sidebar/tagcloud.php @@ -3,7 +3,7 @@ * Blog tag cloud */ -$loggedin_user = get_loggedin_user(); +$loggedin_user = elgg_get_logged_in_user_entity(); $page_owner = elgg_get_page_owner_entity(); if ($page_owner && $vars['page'] != 'friends') { diff --git a/mod/bookmarks/bookmarklet.php b/mod/bookmarks/bookmarklet.php index a156cf035..9f9dd5150 100644 --- a/mod/bookmarks/bookmarklet.php +++ b/mod/bookmarks/bookmarklet.php @@ -13,8 +13,8 @@ gatekeeper(); // Get the current page's owner $page_owner = elgg_get_page_owner_entity(); -if ($page_owner === false || is_null($page_owner) && (get_loggedin_user())) { - $page_owner = get_loggedin_user(); +if ($page_owner === false || is_null($page_owner) && (elgg_get_logged_in_user_entity())) { + $page_owner = elgg_get_logged_in_user_entity(); set_page_owner($page_owner->getGUID()); } diff --git a/mod/bookmarks/pages/all.php b/mod/bookmarks/pages/all.php index 2bde462ba..3442f32c7 100644 --- a/mod/bookmarks/pages/all.php +++ b/mod/bookmarks/pages/all.php @@ -10,7 +10,7 @@ elgg_push_breadcrumb(elgg_echo('bookmarks')); $page_owner = elgg_get_page_owner_entity(); if (!$page_owner) { - $page_owner = get_loggedin_userid(); + $page_owner = elgg_get_logged_in_user_guid(); elgg_set_page_owner_guid($page_owner); } diff --git a/mod/bookmarks/pages/owner.php b/mod/bookmarks/pages/owner.php index 1e45bc518..5b864ff48 100644 --- a/mod/bookmarks/pages/owner.php +++ b/mod/bookmarks/pages/owner.php @@ -10,7 +10,7 @@ elgg_push_breadcrumb(elgg_echo('bookmarks'), 'pg/bookmarks/all'); $page_owner = elgg_get_page_owner_entity(); if (!$page_owner) { - $page_owner = get_loggedin_userid(); + $page_owner = elgg_get_logged_in_user_guid(); elgg_set_page_owner_guid($page_owner); } diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php index b7e2e5df9..04a452d32 100644 --- a/mod/bookmarks/start.php +++ b/mod/bookmarks/start.php @@ -59,10 +59,10 @@ function bookmarks_pagesetup() { //add submenu options if (get_context() == "bookmarks") { - if (isloggedin()) { + if (elgg_is_logged_in()) { // link to add bookmark form if ($page_owner instanceof ElggGroup) { - if ($page_owner->isMember(get_loggedin_user())) { + if ($page_owner->isMember(elgg_get_logged_in_user_entity())) { add_submenu_item(elgg_echo('bookmarks:add'), $CONFIG->wwwroot."pg/bookmarks/add/" . $page_owner->username); } } else { @@ -82,7 +82,7 @@ function bookmarks_pagesetup() { } // Bookmarklet - if ((isloggedin()) && (page_owner()) && (can_write_to_container(0, page_owner()))) { + if ((elgg_is_logged_in()) && (page_owner()) && (can_write_to_container(0, page_owner()))) { $bmtext = elgg_echo('bookmarks:bookmarklet'); if ($page_owner instanceof ElggGroup) { diff --git a/mod/bookmarks/views/default/bookmarks/bookmarklet.php b/mod/bookmarks/views/default/bookmarks/bookmarklet.php index bb2cf885e..531619409 100644 --- a/mod/bookmarks/views/default/bookmarks/bookmarklet.php +++ b/mod/bookmarks/views/default/bookmarks/bookmarklet.php @@ -15,7 +15,7 @@ if ($page_owner instanceof ElggGroup) { $name = $page_owner->username; } -if (!$name && ($user = get_loggedin_user())) { +if (!$name && ($user = elgg_get_logged_in_user_entity())) { $name = $user->username; } diff --git a/mod/bookmarks/views/default/bookmarks/owner_block.php b/mod/bookmarks/views/default/bookmarks/owner_block.php index 654ff9152..d9b31d8d4 100644 --- a/mod/bookmarks/views/default/bookmarks/owner_block.php +++ b/mod/bookmarks/views/default/bookmarks/owner_block.php @@ -1,7 +1,7 @@ <?php $label = elgg_echo('bookmarks:this'); -$user = get_loggedin_user(); +$user = elgg_get_logged_in_user_entity(); $url = "'" . $vars['url'] . "pg/bookmarks/add/{$user->username}?address='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)"; ?> diff --git a/mod/defaultwidgets/start.php b/mod/defaultwidgets/start.php index 653ac6fce..89754f4f4 100644 --- a/mod/defaultwidgets/start.php +++ b/mod/defaultwidgets/start.php @@ -25,7 +25,7 @@ function defaultwidgets_init() { elgg_register_event_handler('create', 'user', 'defaultwidgets_newusers' ); // set the widget access to the default access on validation if this is not an admin-created user - if (!isadminloggedin()) { + if (!elgg_is_admin_logged_in()) { elgg_register_event_handler('validate', 'user', 'defaultwidgets_reset_access'); } @@ -93,7 +93,7 @@ function defaultwidgets_newusers($event, $object_type, $object) { // get the new user guid $guid = $object->guid; - if (isadminloggedin()) { + if (elgg_is_admin_logged_in()) { // this is an admin-created user // no permissions problems, so set proper access now // use system default access (not the admin's default access!, because that could be a personal access level) diff --git a/mod/defaultwidgets/views/default/admin/appearance/default_dashboard_widgets.php b/mod/defaultwidgets/views/default/admin/appearance/default_dashboard_widgets.php index b6cc010df..e4a6ca51f 100644 --- a/mod/defaultwidgets/views/default/admin/appearance/default_dashboard_widgets.php +++ b/mod/defaultwidgets/views/default/admin/appearance/default_dashboard_widgets.php @@ -7,7 +7,7 @@ **/ // Set admin user for user block -set_page_owner(get_loggedin_userid()); +set_page_owner(elgg_get_logged_in_user_guid()); // create the view $time = time(); diff --git a/mod/defaultwidgets/views/default/admin/appearance/default_profile_widgets.php b/mod/defaultwidgets/views/default/admin/appearance/default_profile_widgets.php index bb1f3fbe0..b95a123eb 100644 --- a/mod/defaultwidgets/views/default/admin/appearance/default_profile_widgets.php +++ b/mod/defaultwidgets/views/default/admin/appearance/default_profile_widgets.php @@ -7,7 +7,7 @@ **/ // set admin user for user block -set_page_owner(get_loggedin_userid()); +set_page_owner(elgg_get_logged_in_user_guid()); // create the view $time = time(); diff --git a/mod/diagnostics/actions/download.php b/mod/diagnostics/actions/download.php index 3c096eb0a..a79527f78 100644 --- a/mod/diagnostics/actions/download.php +++ b/mod/diagnostics/actions/download.php @@ -7,7 +7,7 @@ admin_gatekeeper(); - $output = elgg_echo('diagnostics:header', array(date('r'), get_loggedin_user()->name)); + $output = elgg_echo('diagnostics:header', array(date('r'), elgg_get_logged_in_user_entity()->name)); $output = elgg_trigger_plugin_hook('diagnostics:report', 'system', null, $output); header("Cache-Control: public"); diff --git a/mod/file/actions/file/upload.php b/mod/file/actions/file/upload.php index 5ce98c101..1a30b6cef 100644 --- a/mod/file/actions/file/upload.php +++ b/mod/file/actions/file/upload.php @@ -16,7 +16,7 @@ $tags = get_input("tags"); $ajax = get_input('ajax', FALSE); if ($container_guid == 0) { - $container_guid = get_loggedin_userid(); + $container_guid = elgg_get_logged_in_user_guid(); } elgg_make_sticky_form('file'); @@ -166,7 +166,7 @@ if ($new_file) { } else { system_message($message); - add_to_river('river/object/file/create', 'create', get_loggedin_userid(), $file->guid); + add_to_river('river/object/file/create', 'create', elgg_get_logged_in_user_guid(), $file->guid); } } else { // failed to save file object - nothing we can do about this diff --git a/mod/file/index.php b/mod/file/index.php index 44906d72d..4a8e35bdb 100644 --- a/mod/file/index.php +++ b/mod/file/index.php @@ -17,7 +17,7 @@ elgg_push_breadcrumb($owner->name); $params = array(); -if ($owner->guid == get_loggedin_userid()) { +if ($owner->guid == elgg_get_logged_in_user_guid()) { // user looking at own files $title = elgg_echo('file:yours'); $params['filter_context'] = 'mine'; @@ -31,7 +31,7 @@ if ($owner->guid == get_loggedin_userid()) { // group files $title = elgg_echo("file:user", array($owner->name)); $params['filter'] = ''; - if ($owner->isMember(get_loggedin_user())) { + if ($owner->isMember(elgg_get_logged_in_user_entity())) { $url = "pg/file/add/$owner->guid"; $vars = array( 'href' => $url, diff --git a/mod/file/start.php b/mod/file/start.php index 360f64d1f..cea8b6bd5 100644 --- a/mod/file/start.php +++ b/mod/file/start.php @@ -364,7 +364,7 @@ function file_embed_get_sections($hook, $type, $value, $params) { */ function file_embed_get_items($hook, $type, $value, $params) { $options = array( - 'owner_guid' => get_loggedin_userid(), + 'owner_guid' => elgg_get_logged_in_user_guid(), 'type_subtype_pair' => array('object' => 'file'), 'count' => TRUE ); diff --git a/mod/file/views/default/file/embed_upload.php b/mod/file/views/default/file/embed_upload.php index 8a54a4fa9..229fcd40b 100644 --- a/mod/file/views/default/file/embed_upload.php +++ b/mod/file/views/default/file/embed_upload.php @@ -3,7 +3,7 @@ * Files upload form for embed */ -$access_id = get_default_access(get_loggedin_user()); +$access_id = get_default_access(elgg_get_logged_in_user_entity()); if ($categories = elgg_view('categories', $vars)) { $categories = "<p>$categories</p>"; } diff --git a/mod/groups/actions/addtogroup.php b/mod/groups/actions/addtogroup.php index 651b90abb..d75c5fdb8 100644 --- a/mod/groups/actions/addtogroup.php +++ b/mod/groups/actions/addtogroup.php @@ -4,7 +4,7 @@ * * @package ElggGroups */ -$logged_in_user = get_loggedin_user(); +$logged_in_user = elgg_get_logged_in_user_entity(); $user_guid = get_input('user_guid'); if (!is_array($user_guid)) @@ -20,7 +20,7 @@ if (sizeof($user_guid)) { if ($user && $group) { - //if (get_loggedin_userid() == $group->owner_guid) + //if (elgg_get_logged_in_user_guid() == $group->owner_guid) if ($group->canEdit()) { // If the group is open or the user has requested membership diff --git a/mod/groups/actions/delete.php b/mod/groups/actions/delete.php index 5672e8c47..a99b3a2c6 100644 --- a/mod/groups/actions/delete.php +++ b/mod/groups/actions/delete.php @@ -16,5 +16,5 @@ if (($entity) && ($entity instanceof ElggGroup)) else register_error(elgg_echo('group:notdeleted')); -$url_name = get_loggedin_user()->username; +$url_name = elgg_get_logged_in_user_entity()->username; forward(elgg_get_site_url() . "pg/groups/member/{$url_name}"); diff --git a/mod/groups/actions/discussion/save.php b/mod/groups/actions/discussion/save.php index 8e8f08a50..f553b562c 100644 --- a/mod/groups/actions/discussion/save.php +++ b/mod/groups/actions/discussion/save.php @@ -67,7 +67,7 @@ elgg_clear_sticky_form('topic'); // handle results differently for new topics and topic edits if ($new_topic) { system_message(elgg_echo('discussion:topic:created')); - add_to_river('river/forum/topic/create', 'create', get_loggedin_userid(), $topic->guid); + add_to_river('river/forum/topic/create', 'create', elgg_get_logged_in_user_guid(), $topic->guid); } else { system_message(elgg_echo('discussion:topic:updated')); } diff --git a/mod/groups/actions/edit.php b/mod/groups/actions/edit.php index c8a68d238..e10739244 100644 --- a/mod/groups/actions/edit.php +++ b/mod/groups/actions/edit.php @@ -34,7 +34,7 @@ foreach ($CONFIG->group as $shortname => $valuetype) { $input['name'] = get_input('name'); $input['name'] = html_entity_decode($input['name'], ENT_COMPAT, 'UTF-8'); -$user = get_loggedin_user(); +$user = elgg_get_logged_in_user_entity(); $group_guid = (int)get_input('group_guid'); $new_group_flag = $group_guid == 0; diff --git a/mod/groups/actions/groupskillinvitation.php b/mod/groups/actions/groupskillinvitation.php index 503c41939..516490bc9 100644 --- a/mod/groups/actions/groupskillinvitation.php +++ b/mod/groups/actions/groupskillinvitation.php @@ -5,7 +5,7 @@ * @package ElggGroups */ -$user_guid = get_input('user_guid', get_loggedin_userid()); +$user_guid = get_input('user_guid', elgg_get_logged_in_user_guid()); $group_guid = get_input('group_guid'); $user = get_entity($user_guid); diff --git a/mod/groups/actions/groupskillrequest.php b/mod/groups/actions/groupskillrequest.php index f7f8a5157..9d45bb25f 100644 --- a/mod/groups/actions/groupskillrequest.php +++ b/mod/groups/actions/groupskillrequest.php @@ -5,7 +5,7 @@ * @package ElggGroups */ -$user_guid = get_input('user_guid', get_loggedin_userid()); +$user_guid = get_input('user_guid', elgg_get_logged_in_user_guid()); $group_guid = get_input('group_guid'); $user = get_entity($user_guid); diff --git a/mod/groups/actions/invite.php b/mod/groups/actions/invite.php index e8eeb3330..1f8281071 100644 --- a/mod/groups/actions/invite.php +++ b/mod/groups/actions/invite.php @@ -5,7 +5,7 @@ * @package ElggGroups */ -$logged_in_user = get_loggedin_user(); +$logged_in_user = elgg_get_logged_in_user_entity(); $user_guid = get_input('user_guid'); if (!is_array($user_guid)) { diff --git a/mod/groups/actions/join.php b/mod/groups/actions/join.php index e058cdc22..72294c3ad 100644 --- a/mod/groups/actions/join.php +++ b/mod/groups/actions/join.php @@ -5,7 +5,7 @@ * @package ElggGroups */ -$user_guid = get_input('user_guid', get_loggedin_userid()); +$user_guid = get_input('user_guid', elgg_get_logged_in_user_guid()); $group_guid = get_input('group_guid'); // @todo fix for #287 diff --git a/mod/groups/actions/joinrequest.php b/mod/groups/actions/joinrequest.php index c1d41e8e8..1631712b6 100644 --- a/mod/groups/actions/joinrequest.php +++ b/mod/groups/actions/joinrequest.php @@ -5,7 +5,7 @@ * @package ElggGroups */ -$user_guid = get_input('user_guid', get_loggedin_userid()); +$user_guid = get_input('user_guid', elgg_get_logged_in_user_guid()); $group_guid = get_input('group_guid'); diff --git a/mod/groups/actions/leave.php b/mod/groups/actions/leave.php index a9163a3d1..390870df1 100644 --- a/mod/groups/actions/leave.php +++ b/mod/groups/actions/leave.php @@ -10,7 +10,7 @@ $group_guid = get_input('group_guid'); $user = NULL; if (!$user_guid) { - $user = get_loggedin_user(); + $user = elgg_get_logged_in_user_entity(); } else { $user = get_entity($user_guid); } @@ -20,7 +20,7 @@ $group = get_entity($group_guid); set_page_owner($group->guid); if (($user instanceof ElggUser) && ($group instanceof ElggGroup)) { - if ($group->getOwnerGUID() != get_loggedin_userid()) { + if ($group->getOwnerGUID() != elgg_get_logged_in_user_guid()) { if ($group->leave($user)) { system_message(elgg_echo("groups:left")); } else { diff --git a/mod/groups/lib/discussion.php b/mod/groups/lib/discussion.php index 4a3cd989a..62b0552e0 100644 --- a/mod/groups/lib/discussion.php +++ b/mod/groups/lib/discussion.php @@ -169,7 +169,7 @@ function discussion_handle_view_page($guid) { if ($topic->status == 'closed') { $content .= elgg_view_comments($topic, false); $content .= elgg_view('discussion/closed'); - } elseif ($group->isMember() || isadminloggedin()) { + } elseif ($group->isMember() || elgg_is_admin_logged_in()) { $content .= elgg_view_comments($topic); } else { $content .= elgg_view_comments($topic, false); diff --git a/mod/groups/lib/groups.php b/mod/groups/lib/groups.php index cff7fe258..8faba3179 100644 --- a/mod/groups/lib/groups.php +++ b/mod/groups/lib/groups.php @@ -121,7 +121,7 @@ function groups_handle_edit_page($page, $guid = 0) { gatekeeper(); if ($page == 'add') { - elgg_set_page_owner_guid(get_loggedin_userid()); + elgg_set_page_owner_guid(elgg_get_logged_in_user_guid()); $title = elgg_echo('groups:add'); elgg_push_breadcrumb($title); $content = elgg_view('groups/edit'); diff --git a/mod/groups/start.php b/mod/groups/start.php index 5e318a5f1..44b5363dc 100644 --- a/mod/groups/start.php +++ b/mod/groups/start.php @@ -130,14 +130,14 @@ function groups_submenus() { if (elgg_get_context() == 'groups') { if ($page_owner instanceof ElggGroup) { - if (isloggedin() && $page_owner->canEdit() && !$page_owner->isPublicMembership()) { + if (elgg_is_logged_in() && $page_owner->canEdit() && !$page_owner->isPublicMembership()) { $url = elgg_get_site_url() . "pg/groups/requests/{$page_owner->getGUID()}"; add_submenu_item(elgg_echo('groups:membershiprequests'), $url, 'groupsactions1'); } } else { add_submenu_item(elgg_echo('groups:all'), "pg/groups/world/", 'groupslinks1'); - if ($user = get_loggedin_user()) { + if ($user = elgg_get_logged_in_user_entity()) { add_submenu_item(elgg_echo('groups:owned'), "pg/groups/owned/$user->username", 'groupslinks1'); add_submenu_item(elgg_echo('groups:yours'), "pg/groups/member/$user->username", 'groupslinks1'); add_submenu_item(elgg_echo('groups:invitations'), "pg/groups/invitations/$user->username", 'groupslinks1'); @@ -295,7 +295,7 @@ function groups_create_event_listener($event, $object_type, $object) { */ function groups_read_acl_plugin_hook($hook, $entity_type, $returnvalue, $params) { //error_log("READ: " . var_export($returnvalue)); - $user = get_loggedin_user(); + $user = elgg_get_logged_in_user_entity(); if ($user) { // Not using this because of recursion. // Joining a group automatically add user to ACL, @@ -319,7 +319,7 @@ function groups_read_acl_plugin_hook($hook, $entity_type, $returnvalue, $params) */ function groups_write_acl_plugin_hook($hook, $entity_type, $returnvalue, $params) { $page_owner = elgg_get_page_owner_entity(); - if (!$loggedin = get_loggedin_user()) { + if (!$loggedin = elgg_get_logged_in_user_entity()) { return $returnvalue; } @@ -646,7 +646,7 @@ function groupforumtopic_notify_message($hook, $entity_type, $returnvalue, $para if ($method == 'sms') { return elgg_echo("groupforumtopic:new") . ': ' . $url . " ({$owner->name}: {$title})"; } else { - return get_loggedin_user()->name . ' ' . elgg_echo("groups:viagroups") . ': ' . $title . "\n\n" . $msg . "\n\n" . $entity->getURL(); + return elgg_get_logged_in_user_entity()->name . ' ' . elgg_echo("groups:viagroups") . ': ' . $title . "\n\n" . $msg . "\n\n" . $entity->getURL(); } } return null; @@ -661,9 +661,9 @@ function groupforumtopic_notify_message($hook, $entity_type, $returnvalue, $para function groups_can_edit_discussion($entity, $group_owner) { //logged in user - $user = get_loggedin_userid(); + $user = elgg_get_logged_in_user_guid(); - if (($entity->owner_guid == $user) || $group_owner == $user || isadminloggedin()) { + if (($entity->owner_guid == $user) || $group_owner == $user || elgg_is_admin_logged_in()) { return true; } else { return false; diff --git a/mod/groups/views/default/forms/groups/edit.php b/mod/groups/views/default/forms/groups/edit.php index e0c90af8d..7d24a3c00 100644 --- a/mod/groups/views/default/forms/groups/edit.php +++ b/mod/groups/views/default/forms/groups/edit.php @@ -66,7 +66,7 @@ if ($group_profile_fields > 0) { if (get_plugin_setting('hidden_groups', 'groups') == 'yes') { $this_owner = $vars['entity']->owner_guid; if (!$this_owner) { - $this_owner = get_loggedin_userid(); + $this_owner = elgg_get_logged_in_user_guid(); } $access = array( ACCESS_FRIENDS => elgg_echo("access:friends:label"), diff --git a/mod/groups/views/default/forms/groups/invite.php b/mod/groups/views/default/forms/groups/invite.php index 8b8ccb665..2c89db384 100644 --- a/mod/groups/views/default/forms/groups/invite.php +++ b/mod/groups/views/default/forms/groups/invite.php @@ -8,7 +8,7 @@ $group = $vars['entity']; $owner = get_entity($vars['entity']->owner_guid); $forward_url = $group->getURL(); - $friends = get_loggedin_user()->getFriends('', 0); + $friends = elgg_get_logged_in_user_entity()->getFriends('', 0); if ($friends) { ?> diff --git a/mod/groups/views/default/group/default.php b/mod/groups/views/default/group/default.php index d025a894b..63e1e4226 100644 --- a/mod/groups/views/default/group/default.php +++ b/mod/groups/views/default/group/default.php @@ -25,7 +25,7 @@ $metadata = "<ul class=\"elgg-list-metadata\"><li>$mem</li>"; $metadata .= "<li>$num_members $members_string</li>"; // feature link -if (isadminloggedin()) { +if (elgg_is_admin_logged_in()) { if ($group->featured_group == "yes") { $url = "action/groups/featured?group_guid={$group->guid}&action_type=unfeature"; $wording = elgg_echo("groups:makeunfeatured"); diff --git a/mod/groups/views/default/groups/invitationrequests.php b/mod/groups/views/default/groups/invitationrequests.php index 9bb76e264..c65e8987e 100644 --- a/mod/groups/views/default/groups/invitationrequests.php +++ b/mod/groups/views/default/groups/invitationrequests.php @@ -1,7 +1,7 @@ <?php if (!empty($vars['invitations']) && is_array($vars['invitations'])) { - $user = get_loggedin_user(); + $user = elgg_get_logged_in_user_entity(); foreach($vars['invitations'] as $group) if ($group instanceof ElggGroup) { diff --git a/mod/groups/views/default/groups/profile/buttons.php b/mod/groups/views/default/groups/profile/buttons.php index b88c93ad1..bd7560bb8 100644 --- a/mod/groups/views/default/groups/profile/buttons.php +++ b/mod/groups/views/default/groups/profile/buttons.php @@ -5,7 +5,7 @@ * @uses $vars['entity'] */ -if (!isloggedin()) { +if (!elgg_is_logged_in()) { return true; } diff --git a/mod/groups/views/default/groups/profile/closed_membership.php b/mod/groups/views/default/groups/profile/closed_membership.php index f80103711..24526d378 100644 --- a/mod/groups/views/default/groups/profile/closed_membership.php +++ b/mod/groups/views/default/groups/profile/closed_membership.php @@ -9,7 +9,7 @@ <p class="mtm"> <?php echo elgg_echo('groups:closedgroup'); -if (isloggedin()) { +if (elgg_is_logged_in()) { echo ' ' . elgg_echo('groups:closedgroup:request'); } ?> diff --git a/mod/groups/views/default/groups/side_menu.php b/mod/groups/views/default/groups/side_menu.php index 99eb13a11..0ae2bef63 100644 --- a/mod/groups/views/default/groups/side_menu.php +++ b/mod/groups/views/default/groups/side_menu.php @@ -1,8 +1,8 @@ <ul class="submenu page_navigation"> <?php - if(isloggedin()){ - echo "<li><a href=\"".elgg_get_site_url()."pg/groups/member/{get_loggedin_user()->username}\">". elgg_echo('groups:yours') ."</a></li>"; - echo "<li><a href=\"".elgg_get_site_url()."pg/groups/invitations/{get_loggedin_user()->username}\">". elgg_echo('groups:invitations') ."</a></li>"; + if(elgg_is_logged_in()){ + echo "<li><a href=\"".elgg_get_site_url()."pg/groups/member/{elgg_get_logged_in_user_entity()->username}\">". elgg_echo('groups:yours') ."</a></li>"; + echo "<li><a href=\"".elgg_get_site_url()."pg/groups/invitations/{elgg_get_logged_in_user_entity()->username}\">". elgg_echo('groups:invitations') ."</a></li>"; } ?> </ul>
\ No newline at end of file diff --git a/mod/invitefriends/actions/invite.php b/mod/invitefriends/actions/invite.php index 75311071c..1a8956419 100644 --- a/mod/invitefriends/actions/invite.php +++ b/mod/invitefriends/actions/invite.php @@ -21,7 +21,7 @@ if (!is_array($emails) || count($emails) == 0) { forward(REFERER); } -$current_user = get_loggedin_user(); +$current_user = elgg_get_logged_in_user_entity(); $error = FALSE; $bad_emails = array(); diff --git a/mod/invitefriends/start.php b/mod/invitefriends/start.php index f3e4a0baa..1b1b0a0ed 100644 --- a/mod/invitefriends/start.php +++ b/mod/invitefriends/start.php @@ -30,7 +30,7 @@ function invitefriends_page_handler($page) { gatekeeper(); elgg_set_context('friends'); - set_page_owner(get_loggedin_userid()); + set_page_owner(elgg_get_logged_in_user_guid()); $title = elgg_echo('friends:invite'); diff --git a/mod/messageboard/actions/add.php b/mod/messageboard/actions/add.php index 77f638bb1..1058482d9 100644 --- a/mod/messageboard/actions/add.php +++ b/mod/messageboard/actions/add.php @@ -14,7 +14,7 @@ $user = get_entity($page_owner); // the message board owner's details // Let's see if we can get a user entity from the specified page_owner if ($user && !empty($message_content)) { - if (messageboard_add(get_loggedin_user(), $user, $message_content, $user->access_id)) { + if (messageboard_add(elgg_get_logged_in_user_entity(), $user, $message_content, $user->access_id)) { system_message(elgg_echo("messageboard:posted")); } else { register_error(elgg_echo("messageboard:failure")); diff --git a/mod/messageboard/ajax_endpoint/load.php b/mod/messageboard/ajax_endpoint/load.php index 008c6fe0f..4509c30ef 100644 --- a/mod/messageboard/ajax_endpoint/load.php +++ b/mod/messageboard/ajax_endpoint/load.php @@ -21,7 +21,7 @@ $user = get_entity(get_input('pageOwner')); //stage one - if a message was posted, add it as an annotation if ($message) { - if (!messageboard_add(get_loggedin_user(), $user, $message, $user->access_id)) { + if (!messageboard_add(elgg_get_logged_in_user_entity(), $user, $message, $user->access_id)) { echo elgg_echo("messageboard:failure"); } diff --git a/mod/messageboard/history.php b/mod/messageboard/history.php index ca0584ccc..648e45a78 100644 --- a/mod/messageboard/history.php +++ b/mod/messageboard/history.php @@ -11,7 +11,7 @@ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); // Get the user who is the owner of the message board -$current_user = get_loggedin_userid(); +$current_user = elgg_get_logged_in_user_guid(); // this is the user how has posted on your messageboard that you want to display your history with $history_user = get_input('user'); diff --git a/mod/messageboard/index.php b/mod/messageboard/index.php index c6d6bed7a..102959e24 100644 --- a/mod/messageboard/index.php +++ b/mod/messageboard/index.php @@ -20,7 +20,7 @@ $contents = $entity->getAnnotations('messageboard', 50, 0, 'desc'); $area2 = elgg_view_title(elgg_echo('messageboard:board')); // only display the add form and board to logged in users -if (isloggedin()) { +if (elgg_is_logged_in()) { $area2 .= elgg_view("messageboard/forms/add"); $area2 .= elgg_view("messageboard/messageboard", array('annotation' => $contents)); } diff --git a/mod/messageboard/views/default/messageboard/messageboard_content.php b/mod/messageboard/views/default/messageboard/messageboard_content.php index b6307f33b..abd81d0ad 100644 --- a/mod/messageboard/views/default/messageboard/messageboard_content.php +++ b/mod/messageboard/views/default/messageboard/messageboard_content.php @@ -43,7 +43,7 @@ <?php // If the message being looked at is owned by the current user, don't show the reply // Also do not show if the user is not logged in - if (isloggedin() && $vars['annotation']->owner_guid != get_loggedin_userid()) { + if (elgg_is_logged_in() && $vars['annotation']->owner_guid != elgg_get_logged_in_user_guid()) { //get the message owner $msg_owner = get_entity($vars['annotation']->owner_guid); diff --git a/mod/messageboard/views/default/widgets/messageboard/content.php b/mod/messageboard/views/default/widgets/messageboard/content.php index 71315a526..a81a99b44 100644 --- a/mod/messageboard/views/default/widgets/messageboard/content.php +++ b/mod/messageboard/views/default/widgets/messageboard/content.php @@ -17,7 +17,7 @@ if (isset($vars['entity']->num_display)) { } //Just the loggedin user can post messages -if (isloggedin()) { +if (elgg_is_logged_in()) { ?> <script type="text/javascript"> $(document).ready(function(){ @@ -62,7 +62,7 @@ if (isloggedin()) { </div><!-- end of mb_input_wrapper div --> <?php -} // if(isloggedin()) +} // if(elgg_is_logged_in()) //this for the first time the page loads, grab the latest messages. $contents = $user->getAnnotations('messageboard', $num_display, 0, 'desc'); diff --git a/mod/messages/actions/messages/send.php b/mod/messages/actions/messages/send.php index f6bac606d..a643b44b4 100644 --- a/mod/messages/actions/messages/send.php +++ b/mod/messages/actions/messages/send.php @@ -43,4 +43,4 @@ elgg_clear_sticky_form('messages'); system_message(elgg_echo("messages:posted")); -forward('pg/messages/inbox/' . get_loggedin_user()->username); +forward('pg/messages/inbox/' . elgg_get_logged_in_user_entity()->username); diff --git a/mod/messages/read.php b/mod/messages/read.php index 84ec7e124..561eaa3ce 100644 --- a/mod/messages/read.php +++ b/mod/messages/read.php @@ -37,7 +37,7 @@ if ($inbox) { $body_params = array('message' => $message); $content .= elgg_view_form('messages/reply', $form_params, $body_params); - if (get_loggedin_userid() == elgg_get_page_owner_guid()) { + if (elgg_get_logged_in_user_guid() == elgg_get_page_owner_guid()) { $buttons = elgg_view('output/url', array( 'text' => elgg_echo('messages:answer'), 'class' => 'elgg-action-button', diff --git a/mod/messages/send.php b/mod/messages/send.php index 1f31e9e02..884c20cca 100644 --- a/mod/messages/send.php +++ b/mod/messages/send.php @@ -7,7 +7,7 @@ gatekeeper(); -$page_owner = get_loggedin_user(); +$page_owner = elgg_get_logged_in_user_entity(); set_page_owner($page_owner->getGUID()); $title = elgg_echo('messages:add'); diff --git a/mod/messages/start.php b/mod/messages/start.php index a36bbc621..c1693bbcc 100644 --- a/mod/messages/start.php +++ b/mod/messages/start.php @@ -15,17 +15,17 @@ function messages_init() { elgg_register_library('elgg:messages', elgg_get_plugins_path() . 'messages/lib/messages.php'); // add page menu items - if (isloggedin()) { + if (elgg_is_logged_in()) { elgg_register_menu_item('page', array( 'name' => 'messages:inbox', 'title' => elgg_echo('messages:inbox'), - 'url' => "pg/messages/inbox/" . get_loggedin_user()->username, + 'url' => "pg/messages/inbox/" . elgg_get_logged_in_user_entity()->username, 'context' => 'messages', )); elgg_register_menu_item('page', array( 'name' => 'messages:sentmessages', 'title' => elgg_echo('messages:sentmessages'), - 'url' => "pg/messages/sent/" . get_loggedin_user()->username, + 'url' => "pg/messages/sent/" . elgg_get_logged_in_user_entity()->username, 'context' => 'messages', )); } @@ -75,7 +75,7 @@ function messages_page_handler($page) { elgg_load_library('elgg:messages'); - elgg_push_breadcrumb(elgg_echo('messages'), 'pg/messages/inbox/' . get_loggedin_user()->username); + elgg_push_breadcrumb(elgg_echo('messages'), 'pg/messages/inbox/' . elgg_get_logged_in_user_entity()->username); if (!isset($page[0])) { $page[0] = 'inbox'; @@ -89,7 +89,7 @@ function messages_page_handler($page) { } if (!isset($page[1])) { - $page[1] = get_loggedin_user()->username; + $page[1] = elgg_get_logged_in_user_entity()->username; } $base_dir = elgg_get_plugins_path() . 'messages'; @@ -207,7 +207,7 @@ function messages_send($subject, $body, $send_to, $from = 0, $reply = 0, $notify // If $from == 0, set to current user if ($from == 0) { - $from = (int) get_loggedin_userid(); + $from = (int) elgg_get_logged_in_user_guid(); } // Initialise 2 new ElggObject @@ -262,17 +262,17 @@ function messages_send($subject, $body, $send_to, $from = 0, $reply = 0, $notify } $message_contents = strip_tags($body); - if ($send_to != get_loggedin_user() && $notify) { + if ($send_to != elgg_get_logged_in_user_entity() && $notify) { $subject = elgg_echo('messages:email:subject'); $body = elgg_echo('messages:email:body', array( - get_loggedin_user()->name, + elgg_get_logged_in_user_entity()->name, $message_contents, elgg_get_site_url() . "pg/messages/inbox/" . $user->username, - get_loggedin_user()->name, - elgg_get_site_url() . "pg/messages/compose?send_to=" . get_loggedin_userid() + elgg_get_logged_in_user_entity()->name, + elgg_get_site_url() . "pg/messages/compose?send_to=" . elgg_get_logged_in_user_guid() )); - notify_user($send_to, get_loggedin_userid(), $subject, $body); + notify_user($send_to, elgg_get_logged_in_user_guid(), $subject, $body); } $messagesendflag = 0; @@ -299,11 +299,11 @@ function messages_count_unread() { $options = array( 'metadata_name_value_pairs' => array( - 'toId' => get_loggedin_userid(), + 'toId' => elgg_get_logged_in_user_guid(), 'readYet' => 0, 'msg' => 1 ), - 'owner_guid' => get_loggedin_userid() + 'owner_guid' => elgg_get_logged_in_user_guid() ); $num_messages = elgg_get_entities_from_metadata($options); @@ -348,7 +348,7 @@ function messages_site_notify_handler(ElggEntity $from, ElggUser $to, $subject, function messages_user_hover_menu($hook, $type, $return, $params) { $user = $params['entity']; - if (isloggedin() && get_loggedin_userid() != $user->guid) { + if (elgg_is_logged_in() && elgg_get_logged_in_user_guid() != $user->guid) { $url = "pg/messages/compose?send_to={$user->guid}"; $item = new ElggMenuItem('send', elgg_echo('messages:sendmessage'), $url); $item->setSection('action'); diff --git a/mod/messages/views/default/messages/topbar.php b/mod/messages/views/default/messages/topbar.php index 20c2f4396..b859b3aee 100644 --- a/mod/messages/views/default/messages/topbar.php +++ b/mod/messages/views/default/messages/topbar.php @@ -5,7 +5,7 @@ * @package ElggMessages */ -if (!isloggedin()) { +if (!elgg_is_logged_in()) { return true; } @@ -20,7 +20,7 @@ if ($num_messages != 0) { } echo elgg_view('output/url', array( - 'href' => 'pg/messages/inbox/' . get_loggedin_user()->username, + 'href' => 'pg/messages/inbox/' . elgg_get_logged_in_user_entity()->username, 'text' => $text, 'class' => $class, )); diff --git a/mod/notifications/actions/groupsave.php b/mod/notifications/actions/groupsave.php index f39beb665..c304cb856 100644 --- a/mod/notifications/actions/groupsave.php +++ b/mod/notifications/actions/groupsave.php @@ -11,7 +11,7 @@ global $NOTIFICATION_HANDLERS; // Get group memberships and condense them down to an array of guids $groups = array(); -if ($groupmemberships = elgg_get_entities_from_relationship(array('relationship' => 'member', 'relationship_guid' => get_loggedin_userid(), 'types' => 'group', 'limit' => 9999))) { +if ($groupmemberships = elgg_get_entities_from_relationship(array('relationship' => 'member', 'relationship_guid' => elgg_get_logged_in_user_guid(), 'types' => 'group', 'limit' => 9999))) { foreach($groupmemberships as $groupmembership) { $groups[] = $groupmembership->guid; } @@ -24,9 +24,9 @@ foreach($NOTIFICATION_HANDLERS as $method => $foo) { if (!empty($groups)) { foreach($groups as $group) { if (in_array($group,$subscriptions[$method])) { - add_entity_relationship(get_loggedin_userid(), 'notify'.$method, $group); + add_entity_relationship(elgg_get_logged_in_user_guid(), 'notify'.$method, $group); } else { - remove_entity_relationship(get_loggedin_userid(), 'notify'.$method, $group); + remove_entity_relationship(elgg_get_logged_in_user_guid(), 'notify'.$method, $group); } } } diff --git a/mod/notifications/actions/save.php b/mod/notifications/actions/save.php index eddda9dc6..163b656aa 100644 --- a/mod/notifications/actions/save.php +++ b/mod/notifications/actions/save.php @@ -6,7 +6,7 @@ * @package ElggNotifications */ -$user = get_loggedin_user(); +$user = elgg_get_logged_in_user_entity(); global $NOTIFICATION_HANDLERS; foreach($NOTIFICATION_HANDLERS as $method => $foo) { diff --git a/mod/notifications/groups.php b/mod/notifications/groups.php index c4f59c049..a3d7b3cad 100644 --- a/mod/notifications/groups.php +++ b/mod/notifications/groups.php @@ -11,7 +11,7 @@ require_once(dirname(dirname(dirname(__FILE__))) . '/engine/start.php'); // Ensure only logged-in users can see this page gatekeeper(); -set_page_owner(get_loggedin_userid()); +set_page_owner(elgg_get_logged_in_user_guid()); // Set the context to settings elgg_set_context('settings'); @@ -21,7 +21,7 @@ $title = elgg_echo('notifications:subscriptions:changesettings:groups'); // Get the form $people = array(); -$groupmemberships = elgg_get_entities_from_relationship(array('relationship' => 'member', 'relationship_guid' => get_loggedin_userid(), 'types' => 'group', 'limit' => 9999)); +$groupmemberships = elgg_get_entities_from_relationship(array('relationship' => 'member', 'relationship_guid' => elgg_get_logged_in_user_guid(), 'types' => 'group', 'limit' => 9999)); $form_body = elgg_view('notifications/subscriptions/groupsform',array('groups' => $groupmemberships)); $body = elgg_view('input/form',array( diff --git a/mod/notifications/index.php b/mod/notifications/index.php index 4536b8788..a0235632d 100644 --- a/mod/notifications/index.php +++ b/mod/notifications/index.php @@ -11,7 +11,7 @@ require_once(dirname(dirname(dirname(__FILE__))) . '/engine/start.php'); // Ensure only logged-in users can see this page gatekeeper(); -set_page_owner(get_loggedin_userid()); +set_page_owner(elgg_get_logged_in_user_guid()); $js_url = elgg_view_get_simplecache_url('js', 'friendsPickerv1'); elgg_register_js($js_url, 'friendsPicker'); @@ -23,7 +23,7 @@ $title = elgg_echo('notifications:subscriptions:changesettings'); // Get the form $people = array(); -if ($people_ents = elgg_get_entities_from_relationship(array('relationship' => 'notify', 'relationship_guid' => get_loggedin_userid(), 'types' => 'user', 'limit' => 99999))) { +if ($people_ents = elgg_get_entities_from_relationship(array('relationship' => 'notify', 'relationship_guid' => elgg_get_logged_in_user_guid(), 'types' => 'user', 'limit' => 99999))) { foreach($people_ents as $ent) { $people[] = $ent->guid; } diff --git a/mod/notifications/start.php b/mod/notifications/start.php index 00e981f7b..a200a6513 100644 --- a/mod/notifications/start.php +++ b/mod/notifications/start.php @@ -64,8 +64,8 @@ function notifications_page_handler($page) { * */ function notifications_plugin_pagesetup() { - if (elgg_get_context() == "settings" && get_loggedin_userid()) { - $user = get_loggedin_user(); + if (elgg_get_context() == "settings" && elgg_get_logged_in_user_guid()) { + $user = elgg_get_logged_in_user_entity(); $params = array( 'name' => '2_a_user_notify', diff --git a/mod/notifications/views/default/notifications/subscriptions/collections.php b/mod/notifications/views/default/notifications/subscriptions/collections.php index 55e330cab..765998e0e 100644 --- a/mod/notifications/views/default/notifications/subscriptions/collections.php +++ b/mod/notifications/views/default/notifications/subscriptions/collections.php @@ -42,7 +42,7 @@ </tr> <?php $members = array(); - if ($friends = get_user_friends(get_loggedin_userid(), '', 9999, 0)) { + if ($friends = get_user_friends(elgg_get_logged_in_user_guid(), '', 9999, 0)) { foreach($friends as $friend) { $members[] = $friend->guid; } @@ -63,7 +63,7 @@ $i = 0; foreach($NOTIFICATION_HANDLERS as $method => $foo) { $metaname = 'collections_notifications_preferences_' . $method; - if ($collections_preferences = get_loggedin_user()->$metaname) { + if ($collections_preferences = elgg_get_logged_in_user_entity()->$metaname) { if (!empty($collections_preferences) && !is_array($collections_preferences)) { $collections_preferences = array($collections_preferences); } @@ -95,7 +95,7 @@ END; @todo collections removed from notifications - they are no longer used and will be replaced with shared access collections - if ($collections = get_user_access_collections(get_loggedin_userid())) { + if ($collections = get_user_access_collections(elgg_get_logged_in_user_guid())) { foreach($collections as $collection) { $members = get_members_of_access_collection($collection->id, true); $memberno = sizeof($members); @@ -115,7 +115,7 @@ END; $i = 0; foreach($NOTIFICATION_HANDLERS as $method => $foo) { $metaname = 'collections_notifications_preferences_' . $method; - if ($collections_preferences = get_loggedin_user()->$metaname) { + if ($collections_preferences = elgg_get_logged_in_user_entity()->$metaname) { if (!empty($collections_preferences) && !is_array($collections_preferences)) { $collections_preferences = array($collections_preferences); } diff --git a/mod/notifications/views/default/notifications/subscriptions/forminternals.php b/mod/notifications/views/default/notifications/subscriptions/forminternals.php index f0d391d0d..960b024db 100644 --- a/mod/notifications/views/default/notifications/subscriptions/forminternals.php +++ b/mod/notifications/views/default/notifications/subscriptions/forminternals.php @@ -11,11 +11,11 @@ <?php // Get friends and subscriptions -$friends = get_user_friends(get_loggedin_userid(),'',9999,0); +$friends = get_user_friends(elgg_get_logged_in_user_guid(),'',9999,0); global $NOTIFICATION_HANDLERS; foreach($NOTIFICATION_HANDLERS as $method => $foo) { - $subsbig[$method] = elgg_get_entities_from_relationship(array('relationship' => 'notify' . $method, 'relationship_guid' => get_loggedin_userid(), 'types' => 'user', 'limit' => 99999)); + $subsbig[$method] = elgg_get_entities_from_relationship(array('relationship' => 'notify' . $method, 'relationship_guid' => elgg_get_logged_in_user_guid(), 'types' => 'user', 'limit' => 99999)); } $subs = array(); diff --git a/mod/notifications/views/default/notifications/subscriptions/groupsform.php b/mod/notifications/views/default/notifications/subscriptions/groupsform.php index b7b43cb66..632e34a54 100644 --- a/mod/notifications/views/default/notifications/subscriptions/groupsform.php +++ b/mod/notifications/views/default/notifications/subscriptions/groupsform.php @@ -7,7 +7,7 @@ global $NOTIFICATION_HANDLERS; foreach($NOTIFICATION_HANDLERS as $method => $foo) { - $subsbig[$method] = elgg_get_entities_from_relationship(array('relationship' => 'notify' . $method, 'relationship_guid' => get_loggedin_userid(), 'types' => 'group', 'limit' => 99999)); + $subsbig[$method] = elgg_get_entities_from_relationship(array('relationship' => 'notify' . $method, 'relationship_guid' => elgg_get_logged_in_user_guid(), 'types' => 'group', 'limit' => 99999)); $tmparray = array(); if ($subsbig[$method]) { foreach($subsbig[$method] as $tmpent) { diff --git a/mod/notifications/views/default/notifications/subscriptions/personal.php b/mod/notifications/views/default/notifications/subscriptions/personal.php index ee8d948b9..e75bda758 100644 --- a/mod/notifications/views/default/notifications/subscriptions/personal.php +++ b/mod/notifications/views/default/notifications/subscriptions/personal.php @@ -40,7 +40,7 @@ foreach($NOTIFICATION_HANDLERS as $method => $foo) { $fields = ''; $i = 0; foreach($NOTIFICATION_HANDLERS as $method => $foo) { - if ($notification_settings = get_user_notification_settings(get_loggedin_userid())) { + if ($notification_settings = get_user_notification_settings(elgg_get_logged_in_user_guid())) { if ($notification_settings->$method) { $personalchecked[$method] = 'checked="checked"'; } else { diff --git a/mod/pages/actions/pages/edit.php b/mod/pages/actions/pages/edit.php index e8e7a254a..6950d4b2f 100644 --- a/mod/pages/actions/pages/edit.php +++ b/mod/pages/actions/pages/edit.php @@ -69,7 +69,7 @@ if ($page->save()) { system_message(elgg_echo('pages:saved')); if ($new_page) { - add_to_river('river/object/page/create', 'create', get_loggedin_userid(), $page->guid); + add_to_river('river/object/page/create', 'create', elgg_get_logged_in_user_guid(), $page->guid); } forward($page->getURL()); diff --git a/mod/pages/index.php b/mod/pages/index.php index afda594cb..ff5a78311 100644 --- a/mod/pages/index.php +++ b/mod/pages/index.php @@ -32,7 +32,7 @@ if (!$content) { } $filter_context = ''; -if (elgg_get_page_owner_guid() == get_loggedin_userid()) { +if (elgg_get_page_owner_guid() == elgg_get_logged_in_user_guid()) { $filter_context = 'mine'; } diff --git a/mod/pages/start.php b/mod/pages/start.php index 4a48368ec..31288e040 100644 --- a/mod/pages/start.php +++ b/mod/pages/start.php @@ -275,7 +275,7 @@ function pages_container_permission_check($hook, $entity_type, $returnvalue, $pa if (elgg_get_context() == "pages") { if (elgg_get_page_owner_guid()) { - if (can_write_to_container(get_loggedin_userid(), elgg_get_page_owner_guid())) return true; + if (can_write_to_container(elgg_get_logged_in_user_guid(), elgg_get_page_owner_guid())) return true; } if ($page_guid = get_input('page_guid',0)) { $entity = get_entity($page_guid); @@ -284,7 +284,7 @@ function pages_container_permission_check($hook, $entity_type, $returnvalue, $pa } if ($entity instanceof ElggObject) { if ( - can_write_to_container(get_loggedin_userid(), $entity->container_guid) + can_write_to_container(elgg_get_logged_in_user_guid(), $entity->container_guid) || in_array($entity->write_access_id,get_access_list()) ) { return true; diff --git a/mod/profile/start.php b/mod/profile/start.php index 2a12bce48..21f7a8c05 100644 --- a/mod/profile/start.php +++ b/mod/profile/start.php @@ -50,7 +50,7 @@ function profile_page_handler($page) { } // short circuit if invalid or banned username - if (!$user || ($user->isBanned() && !isadminloggedin())) { + if (!$user || ($user->isBanned() && !elgg_is_admin_logged_in())) { register_error(elgg_echo('profile:notfound')); forward(); } diff --git a/mod/profile/views/default/profile/owner_block.php b/mod/profile/views/default/profile/owner_block.php index 4edcec8d1..e36658004 100755 --- a/mod/profile/views/default/profile/owner_block.php +++ b/mod/profile/views/default/profile/owner_block.php @@ -25,7 +25,7 @@ $actions = elgg_get_array_value('action', $menu, array()); $admin = elgg_get_array_value('admin', $menu, array()); $profile_actions = ''; -if (isloggedin() && $actions) { +if (elgg_is_logged_in() && $actions) { $profile_actions = '<ul class="elgg-menu">'; foreach ($actions as $action) { $profile_actions .= '<li>' . $action->getLink(array('class' => 'elgg-action-button')) . '</li>'; @@ -35,7 +35,7 @@ if (isloggedin() && $actions) { // if admin, display admin links $admin_links = ''; -if (isadminloggedin() && get_loggedin_userid() != elgg_get_page_owner_guid()) { +if (elgg_is_admin_logged_in() && elgg_get_logged_in_user_guid() != elgg_get_page_owner_guid()) { $admin_links = '<ul class="profile-admin-menu-wrapper">'; $admin_links .= '<li><a class="elgg-toggle" id="elgg-toggler-admin-menu">Admin options…</a>'; $admin_links .= '<ul class="profile-admin-menu" id="elgg-togglee-admin-menu">'; diff --git a/mod/reportedcontent/actions/add.php b/mod/reportedcontent/actions/add.php index 7c60cdf22..f0a1b05c8 100644 --- a/mod/reportedcontent/actions/add.php +++ b/mod/reportedcontent/actions/add.php @@ -13,7 +13,7 @@ if ($title && $address) { $report = new ElggObject; $report->subtype = "reported_content"; - $report->owner_guid = get_loggedin_userid(); + $report->owner_guid = elgg_get_logged_in_user_guid(); $report->title = $title; $report->address = $address; $report->description = $description; diff --git a/mod/reportedcontent/start.php b/mod/reportedcontent/start.php index 360e868f7..e231216cd 100644 --- a/mod/reportedcontent/start.php +++ b/mod/reportedcontent/start.php @@ -20,7 +20,7 @@ function reportedcontent_init() { elgg_extend_view('css/admin', 'reportedcontent/admin_css'); // Extend footer with report content link - if (isloggedin()) { + if (elgg_is_logged_in()) { elgg_extend_view('footer/links', 'reportedcontent/footer_link'); } @@ -76,7 +76,7 @@ function reportedcontent_user_hover_menu($hook, $type, $return, $params) { $name = urlencode($user->name); $url = "pg/reportedcontent/add/?address=$profile_url&title=$name"; - if (isloggedin() && get_loggedin_userid() != $user->guid) { + if (elgg_is_logged_in() && elgg_get_logged_in_user_guid() != $user->guid) { $item = new ElggMenuItem( 'reportuser', elgg_echo('reportedcontent:user'), diff --git a/mod/reportedcontent/views/default/reportedcontent/form.php b/mod/reportedcontent/views/default/reportedcontent/form.php index c7e37ed36..83076c282 100644 --- a/mod/reportedcontent/views/default/reportedcontent/form.php +++ b/mod/reportedcontent/views/default/reportedcontent/form.php @@ -15,7 +15,7 @@ if ($address == "previous") { $tags = array(); $access_id = ACCESS_PRIVATE; $shares = array(); -$owner = get_loggedin_user(); +$owner = elgg_get_logged_in_user_entity(); ?> <form action="<?php echo elgg_get_site_url(); ?>action/reportedcontent/add" method="post" class="mtm"> diff --git a/mod/sitepages/start.php b/mod/sitepages/start.php index e2c8065db..4a2b15dcd 100644 --- a/mod/sitepages/start.php +++ b/mod/sitepages/start.php @@ -113,7 +113,7 @@ function sitepages_url($expage) { function sitepages_page_handler($page) { // for the owner block. - if ($logged_in_guid = get_loggedin_userid()) { + if ($logged_in_guid = elgg_get_logged_in_user_guid()) { set_page_owner($logged_in_guid); } diff --git a/mod/sitepages/views/default/sitepages/custom_frontpage.php b/mod/sitepages/views/default/sitepages/custom_frontpage.php index 10ef62641..95310e1e5 100644 --- a/mod/sitepages/views/default/sitepages/custom_frontpage.php +++ b/mod/sitepages/views/default/sitepages/custom_frontpage.php @@ -9,7 +9,7 @@ $sitepage = sitepages_get_sitepage_object('front'); if ($sitepage) { - if (get_loggedin_userid()) { + if (elgg_get_logged_in_user_guid()) { echo $sitepage->logged_in_content; } else { echo $sitepage->logged_out_content; diff --git a/mod/thewire/actions/add.php b/mod/thewire/actions/add.php index 181ac55aa..04aa2bc82 100644 --- a/mod/thewire/actions/add.php +++ b/mod/thewire/actions/add.php @@ -7,7 +7,7 @@ */ // Make sure we're logged in (send us to the front page if not) -if (!isloggedin()) forward(); +if (!elgg_is_logged_in()) forward(); // Get input data $body = get_input('new_post_textarea'); diff --git a/mod/thewire/actions/delete.php b/mod/thewire/actions/delete.php index 9b6bf4a99..849433e0f 100644 --- a/mod/thewire/actions/delete.php +++ b/mod/thewire/actions/delete.php @@ -7,7 +7,7 @@ */ // Make sure we're logged in (send us to the front page if not) - if (!isloggedin()) forward(); + if (!elgg_is_logged_in()) forward(); // Get input data $guid = (int) get_input('thewirepost'); diff --git a/mod/thewire/add.php b/mod/thewire/add.php index 64afe1d7c..a63a10190 100644 --- a/mod/thewire/add.php +++ b/mod/thewire/add.php @@ -11,7 +11,7 @@ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); // If we're not logged in, forward to the front page - if (!isloggedin()) forward(); + if (!elgg_is_logged_in()) forward(); // choose the required canvas layout and items to display $area2 = elgg_view_title(elgg_echo('thewire:add')); diff --git a/mod/thewire/everyone.php b/mod/thewire/everyone.php index 7a4b5c93d..05793ed03 100644 --- a/mod/thewire/everyone.php +++ b/mod/thewire/everyone.php @@ -12,7 +12,7 @@ $area2 = elgg_view_title(elgg_echo("thewire:everyone")); //add form - if (isloggedin()) { + if (elgg_is_logged_in()) { $area2 .= elgg_view("thewire/forms/add"); } $offset = (int)get_input('offset', 0); diff --git a/mod/thewire/index.php b/mod/thewire/index.php index d69cbd5ca..7ed43e3bc 100644 --- a/mod/thewire/index.php +++ b/mod/thewire/index.php @@ -12,12 +12,12 @@ // Get the current page's owner $page_owner = elgg_get_page_owner_entity(); if ($page_owner === false || is_null($page_owner)) { - $page_owner = get_loggedin_user(); + $page_owner = elgg_get_logged_in_user_entity(); set_page_owner($page_owner->getGUID()); } // title - if (elgg_get_page_owner_guid() == get_loggedin_userid()) { + if (elgg_get_page_owner_guid() == elgg_get_logged_in_user_guid()) { $area2 = elgg_view_title(elgg_echo("thewire:read")); } else { $area2 = elgg_view_title(elgg_echo("thewire:user",array($page_owner->name))); diff --git a/mod/thewire/start.php b/mod/thewire/start.php index 1c984d792..fea2cf460 100644 --- a/mod/thewire/start.php +++ b/mod/thewire/start.php @@ -101,8 +101,8 @@ function rest_wire_post($username, $text) { //add submenu options if (elgg_get_context() == "thewire") { - if ((elgg_get_page_owner_guid() == get_loggedin_userid() || !elgg_get_page_owner_guid()) && isloggedin()) { - add_submenu_item(elgg_echo('thewire:read'),"{$base_url}pg/thewire/" . get_loggedin_user()->username); + if ((elgg_get_page_owner_guid() == elgg_get_logged_in_user_guid() || !elgg_get_page_owner_guid()) && elgg_is_logged_in()) { + add_submenu_item(elgg_echo('thewire:read'),"{$base_url}pg/thewire/" . elgg_get_logged_in_user_entity()->username); add_submenu_item(elgg_echo('thewire:everyone'),"{$base_url}mod/thewire/everyone.php"); } } @@ -191,7 +191,7 @@ function rest_wire_post($username, $text) { $thewire->subtype = "thewire"; // Set its owner to the current user - $thewire->owner_guid = get_loggedin_userid(); + $thewire->owner_guid = elgg_get_logged_in_user_guid(); // For now, set its access to public (we'll add an access dropdown shortly) $thewire->access_id = $access_id; diff --git a/mod/thewire/views/default/object/thewire.php b/mod/thewire/views/default/object/thewire.php index b2a8b65c9..09568a47f 100644 --- a/mod/thewire/views/default/object/thewire.php +++ b/mod/thewire/views/default/object/thewire.php @@ -28,7 +28,7 @@ if (isset($vars['entity'])) { <div class="wire_post_options"> <?php - if(isloggedin()){ + if(elgg_is_logged_in()){ ?> <a href="<?php echo elgg_get_site_url(); ?>mod/thewire/add.php?wire_username=<?php echo $vars['entity']->getOwnerEntity()->username; ?>" class="elgg-action-button reply small"><?php echo elgg_echo('thewire:reply'); ?></a> <?php diff --git a/mod/thewire/views/default/thewire/profile_status.php b/mod/thewire/views/default/thewire/profile_status.php index ec1980abc..401401171 100644 --- a/mod/thewire/views/default/thewire/profile_status.php +++ b/mod/thewire/views/default/thewire/profile_status.php @@ -24,7 +24,7 @@ if ($latest_wire) { echo "<div class='wire_post'><div class='wire_post_contents clearfix radius8'>"; echo $content; - if ($owner == get_loggedin_userid()) { + if ($owner == elgg_get_logged_in_user_guid()) { $text = elgg_echo('thewire:update'); echo "<a class='elgg-action-button update small' href=\"{$url_to_wire}\">$text</a>"; } diff --git a/mod/twitterservice/start.php b/mod/twitterservice/start.php index 14885ffc1..9f37aa151 100644 --- a/mod/twitterservice/start.php +++ b/mod/twitterservice/start.php @@ -94,7 +94,7 @@ function twitterservice_tweet($hook, $entity_type, $returnvalue, $params) { } // check user settings - $user_id = get_loggedin_userid(); + $user_id = elgg_get_logged_in_user_guid(); $access_key = get_plugin_usersetting('access_key', $user_id, 'twitterservice'); $access_secret = get_plugin_usersetting('access_secret', $user_id, 'twitterservice'); if (!($access_key && $access_secret)) { diff --git a/mod/twitterservice/views/default/usersettings/twitterservice/edit.php b/mod/twitterservice/views/default/usersettings/twitterservice/edit.php index d3083d48f..11afa6671 100644 --- a/mod/twitterservice/views/default/usersettings/twitterservice/edit.php +++ b/mod/twitterservice/views/default/usersettings/twitterservice/edit.php @@ -3,7 +3,7 @@ * */ -$user_id = get_loggedin_userid(); +$user_id = elgg_get_logged_in_user_guid(); $twitter_name = get_plugin_usersetting('twitter_name', $user_id, 'twitterservice'); $access_key = get_plugin_usersetting('access_key', $user_id, 'twitterservice'); $access_secret = get_plugin_usersetting('access_secret', $user_id, 'twitterservice'); |