aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-08 19:52:10 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-08 19:52:10 +0000
commitccb6d625239b59b283b4d3fc00da704ab743d74c (patch)
treeda9b11d8758b3007c025e4d5487410ae1ca69f68
parent1368785a6b6f9c946dcc5eca078540bacce71f60 (diff)
downloadelgg-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
-rw-r--r--actions/admin/user/ban.php2
-rw-r--r--actions/admin/user/delete.php2
-rw-r--r--actions/admin/user/removeadmin.php2
-rw-r--r--actions/comments/add.php2
-rw-r--r--actions/comments/delete.php2
-rw-r--r--actions/email/save.php2
-rw-r--r--actions/friends/add.php4
-rw-r--r--actions/friends/addcollection.php4
-rw-r--r--actions/friends/deletecollection.php4
-rw-r--r--actions/friends/remove.php2
-rw-r--r--actions/likes/add.php4
-rw-r--r--actions/likes/delete.php2
-rw-r--r--actions/notifications/settings/usersettings/save.php2
-rw-r--r--actions/plugins/usersettings/save.php2
-rw-r--r--actions/user/default_access.php2
-rw-r--r--actions/user/language.php2
-rw-r--r--actions/user/name.php2
-rw-r--r--actions/user/password.php4
-rw-r--r--actions/user/spotlight.php2
-rw-r--r--actions/useradd.php2
-rw-r--r--actions/widgets/delete.php2
-rw-r--r--actions/widgets/move.php2
-rw-r--r--documentation/examples/events/advanced.php2
-rw-r--r--index.php2
-rw-r--r--js/lib/languages.js2
-rw-r--r--js/lib/session.js14
-rw-r--r--js/lib/ui.widgets.js2
-rw-r--r--mod/blog/actions/blog/auto_save_revision.php2
-rw-r--r--mod/blog/actions/blog/save.php4
-rw-r--r--mod/blog/lib/blog.php12
-rw-r--r--mod/blog/views/default/blog/sidebar/archives.php2
-rw-r--r--mod/blog/views/default/blog/sidebar/tagcloud.php2
-rw-r--r--mod/bookmarks/bookmarklet.php4
-rw-r--r--mod/bookmarks/pages/all.php2
-rw-r--r--mod/bookmarks/pages/owner.php2
-rw-r--r--mod/bookmarks/start.php6
-rw-r--r--mod/bookmarks/views/default/bookmarks/bookmarklet.php2
-rw-r--r--mod/bookmarks/views/default/bookmarks/owner_block.php2
-rw-r--r--mod/defaultwidgets/start.php4
-rw-r--r--mod/defaultwidgets/views/default/admin/appearance/default_dashboard_widgets.php2
-rw-r--r--mod/defaultwidgets/views/default/admin/appearance/default_profile_widgets.php2
-rw-r--r--mod/diagnostics/actions/download.php2
-rw-r--r--mod/file/actions/file/upload.php4
-rw-r--r--mod/file/index.php4
-rw-r--r--mod/file/start.php2
-rw-r--r--mod/file/views/default/file/embed_upload.php2
-rw-r--r--mod/groups/actions/addtogroup.php4
-rw-r--r--mod/groups/actions/delete.php2
-rw-r--r--mod/groups/actions/discussion/save.php2
-rw-r--r--mod/groups/actions/edit.php2
-rw-r--r--mod/groups/actions/groupskillinvitation.php2
-rw-r--r--mod/groups/actions/groupskillrequest.php2
-rw-r--r--mod/groups/actions/invite.php2
-rw-r--r--mod/groups/actions/join.php2
-rw-r--r--mod/groups/actions/joinrequest.php2
-rw-r--r--mod/groups/actions/leave.php4
-rw-r--r--mod/groups/lib/discussion.php2
-rw-r--r--mod/groups/lib/groups.php2
-rw-r--r--mod/groups/start.php14
-rw-r--r--mod/groups/views/default/forms/groups/edit.php2
-rw-r--r--mod/groups/views/default/forms/groups/invite.php2
-rw-r--r--mod/groups/views/default/group/default.php2
-rw-r--r--mod/groups/views/default/groups/invitationrequests.php2
-rw-r--r--mod/groups/views/default/groups/profile/buttons.php2
-rw-r--r--mod/groups/views/default/groups/profile/closed_membership.php2
-rw-r--r--mod/groups/views/default/groups/side_menu.php6
-rw-r--r--mod/invitefriends/actions/invite.php2
-rw-r--r--mod/invitefriends/start.php2
-rw-r--r--mod/messageboard/actions/add.php2
-rw-r--r--mod/messageboard/ajax_endpoint/load.php2
-rw-r--r--mod/messageboard/history.php2
-rw-r--r--mod/messageboard/index.php2
-rw-r--r--mod/messageboard/views/default/messageboard/messageboard_content.php2
-rw-r--r--mod/messageboard/views/default/widgets/messageboard/content.php4
-rw-r--r--mod/messages/actions/messages/send.php2
-rw-r--r--mod/messages/read.php2
-rw-r--r--mod/messages/send.php2
-rw-r--r--mod/messages/start.php28
-rw-r--r--mod/messages/views/default/messages/topbar.php4
-rw-r--r--mod/notifications/actions/groupsave.php6
-rw-r--r--mod/notifications/actions/save.php2
-rw-r--r--mod/notifications/groups.php4
-rw-r--r--mod/notifications/index.php4
-rw-r--r--mod/notifications/start.php4
-rw-r--r--mod/notifications/views/default/notifications/subscriptions/collections.php8
-rw-r--r--mod/notifications/views/default/notifications/subscriptions/forminternals.php4
-rw-r--r--mod/notifications/views/default/notifications/subscriptions/groupsform.php2
-rw-r--r--mod/notifications/views/default/notifications/subscriptions/personal.php2
-rw-r--r--mod/pages/actions/pages/edit.php2
-rw-r--r--mod/pages/index.php2
-rw-r--r--mod/pages/start.php4
-rw-r--r--mod/profile/start.php2
-rwxr-xr-xmod/profile/views/default/profile/owner_block.php4
-rw-r--r--mod/reportedcontent/actions/add.php2
-rw-r--r--mod/reportedcontent/start.php4
-rw-r--r--mod/reportedcontent/views/default/reportedcontent/form.php2
-rw-r--r--mod/sitepages/start.php2
-rw-r--r--mod/sitepages/views/default/sitepages/custom_frontpage.php2
-rw-r--r--mod/thewire/actions/add.php2
-rw-r--r--mod/thewire/actions/delete.php2
-rw-r--r--mod/thewire/add.php2
-rw-r--r--mod/thewire/everyone.php2
-rw-r--r--mod/thewire/index.php4
-rw-r--r--mod/thewire/start.php6
-rw-r--r--mod/thewire/views/default/object/thewire.php2
-rw-r--r--mod/thewire/views/default/thewire/profile_status.php2
-rw-r--r--mod/twitterservice/start.php2
-rw-r--r--mod/twitterservice/views/default/usersettings/twitterservice/edit.php2
-rw-r--r--pages/account/forgotten_password.php2
-rw-r--r--pages/account/register.php2
-rw-r--r--pages/dashboard.php2
-rw-r--r--pages/friends/add.php2
-rw-r--r--pages/friends/collections.php2
-rw-r--r--pages/river.php4
-rw-r--r--pages/settings/account.php2
-rw-r--r--pages/settings/statistics.php2
-rw-r--r--pages/settings/tools.php2
-rw-r--r--views/default/admin/dashboard.php2
-rw-r--r--views/default/core/account/login_dropdown.php2
-rw-r--r--views/default/core/friends/collection.php6
-rw-r--r--views/default/core/friends/collectiontabs.php4
-rw-r--r--views/default/core/likes/display.php2
-rw-r--r--views/default/core/river/controls.php4
-rw-r--r--views/default/core/settings/account/password.php2
-rw-r--r--views/default/core/settings/statistics/numentities.php2
-rw-r--r--views/default/core/settings/statistics/online.php2
-rw-r--r--views/default/core/settings/tools/plugin.php2
-rw-r--r--views/default/export/entity.php2
-rw-r--r--views/default/forms/comments/add.php2
-rw-r--r--views/default/forms/comments/inline.php2
-rw-r--r--views/default/forms/register.php2
-rw-r--r--views/default/forms/useradd.php2
-rw-r--r--views/default/icon/user/default.php4
-rw-r--r--views/default/js/initialize_elgg.php2
-rw-r--r--views/default/layout/elements/owner_block.php2
-rw-r--r--views/default/layout/shells/admin.php2
-rw-r--r--views/default/layout/shells/content/filter.php4
-rw-r--r--views/default/layout/shells/content/header.php4
-rw-r--r--views/default/navigation/menu/user_hover.php4
-rw-r--r--views/default/page/elements/content_header.php4
-rw-r--r--views/default/page/elements/topbar.php2
-rw-r--r--views/default/user/default.php4
-rw-r--r--views/foaf/page/shells/default.php4
143 files changed, 218 insertions, 218 deletions
diff --git a/actions/admin/user/ban.php b/actions/admin/user/ban.php
index a8fa57925..209ece2a0 100644
--- a/actions/admin/user/ban.php
+++ b/actions/admin/user/ban.php
@@ -12,7 +12,7 @@
$guid = get_input('guid');
$user = get_entity($guid);
-if ($guid == get_loggedin_userid()) {
+if ($guid == elgg_get_logged_in_user_guid()) {
register_error(elgg_echo('admin:user:self:ban:no'));
forward(REFERER);
}
diff --git a/actions/admin/user/delete.php b/actions/admin/user/delete.php
index c6ed5b819..04061ac0c 100644
--- a/actions/admin/user/delete.php
+++ b/actions/admin/user/delete.php
@@ -13,7 +13,7 @@
$guid = get_input('guid');
$user = get_entity($guid);
-if ($guid == get_loggedin_userid()) {
+if ($guid == elgg_get_logged_in_user_guid()) {
register_error(elgg_echo('admin:user:self:delete:no'));
forward(REFERER);
}
diff --git a/actions/admin/user/removeadmin.php b/actions/admin/user/removeadmin.php
index 4466e925f..8cebc7078 100644
--- a/actions/admin/user/removeadmin.php
+++ b/actions/admin/user/removeadmin.php
@@ -9,7 +9,7 @@
$guid = get_input('guid');
$user = get_entity($guid);
-if ($guid == get_loggedin_userid()) {
+if ($guid == elgg_get_logged_in_user_guid()) {
register_error(elgg_echo('admin:user:self:removeadmin:no'));
forward(REFERER);
}
diff --git a/actions/comments/add.php b/actions/comments/add.php
index 38c91c412..5bd741413 100644
--- a/actions/comments/add.php
+++ b/actions/comments/add.php
@@ -21,7 +21,7 @@ if (!$entity) {
forward(REFERER);
}
-$user = get_loggedin_user();
+$user = elgg_get_logged_in_user_entity();
$annotation = create_annotation($entity->guid,
'generic_comment',
diff --git a/actions/comments/delete.php b/actions/comments/delete.php
index d0f5c7b84..54eb97077 100644
--- a/actions/comments/delete.php
+++ b/actions/comments/delete.php
@@ -6,7 +6,7 @@
*/
// Ensure we're logged in
-if (!isloggedin()) {
+if (!elgg_is_logged_in()) {
forward();
}
diff --git a/actions/email/save.php b/actions/email/save.php
index 13bc14d65..d0ce4571b 100644
--- a/actions/email/save.php
+++ b/actions/email/save.php
@@ -10,7 +10,7 @@ $email = get_input('email');
$user_id = get_input('guid');
if (!$user_id) {
- $user = get_loggedin_user();
+ $user = elgg_get_logged_in_user_entity();
} else {
$user = get_entity($user_id);
}
diff --git a/actions/friends/add.php b/actions/friends/add.php
index e6fa5b62e..53e4971d4 100644
--- a/actions/friends/add.php
+++ b/actions/friends/add.php
@@ -14,7 +14,7 @@ $errors = false;
// Get the user
try {
- if (!get_loggedin_user()->addFriend($friend_guid)) {
+ if (!elgg_get_logged_in_user_entity()->addFriend($friend_guid)) {
$errors = true;
}
} catch (Exception $e) {
@@ -23,7 +23,7 @@ try {
}
if (!$errors) {
// add to river
- add_to_river('friends/river/create', 'friend', get_loggedin_userid(), $friend_guid);
+ add_to_river('friends/river/create', 'friend', elgg_get_logged_in_user_guid(), $friend_guid);
system_message(elgg_echo("friends:add:successful", array($friend->name)));
}
diff --git a/actions/friends/addcollection.php b/actions/friends/addcollection.php
index 92c78a2c1..eac8bced8 100644
--- a/actions/friends/addcollection.php
+++ b/actions/friends/addcollection.php
@@ -13,7 +13,7 @@ $friends = get_input('friends_collection');
if ($collection_name) {
//create the collection
- $create_collection = create_access_collection($collection_name, get_loggedin_userid());
+ $create_collection = create_access_collection($collection_name, elgg_get_logged_in_user_guid());
//if the collection was created and the user passed some friends from the form, add them
if ($create_collection && (!empty($friends))) {
@@ -26,7 +26,7 @@ if ($collection_name) {
// Success message
system_message(elgg_echo("friends:collectionadded"));
// Forward to the collections page
- forward("pg/collections/" . get_loggedin_user()->username);
+ forward("pg/collections/" . elgg_get_logged_in_user_entity()->username);
} else {
register_error(elgg_echo("friends:nocollectionname"));
diff --git a/actions/friends/deletecollection.php b/actions/friends/deletecollection.php
index 1c3d878a1..f0ceaf023 100644
--- a/actions/friends/deletecollection.php
+++ b/actions/friends/deletecollection.php
@@ -13,7 +13,7 @@ $get_collection = get_access_collection($collection_id);
if ($get_collection) {
- if ($get_collection->owner_guid == get_loggedin_userid()) {
+ if ($get_collection->owner_guid == elgg_get_logged_in_user_guid()) {
$delete_collection = delete_access_collection($collection_id);
@@ -33,4 +33,4 @@ if ($get_collection) {
}
// Forward to the collections page
-forward("pg/collections/" . get_loggedin_user()->username);
+forward("pg/collections/" . elgg_get_logged_in_user_entity()->username);
diff --git a/actions/friends/remove.php b/actions/friends/remove.php
index 0a43c95bc..d69d18f31 100644
--- a/actions/friends/remove.php
+++ b/actions/friends/remove.php
@@ -14,7 +14,7 @@ $errors = false;
// Get the user
try{
if ($friend instanceof ElggUser) {
- get_loggedin_user()->removeFriend($friend_guid);
+ elgg_get_logged_in_user_entity()->removeFriend($friend_guid);
} else {
register_error(elgg_echo("friends:remove:failure", array($friend->name)));
$errors = true;
diff --git a/actions/likes/add.php b/actions/likes/add.php
index 9abe0b60e..a59ccae2b 100644
--- a/actions/likes/add.php
+++ b/actions/likes/add.php
@@ -21,12 +21,12 @@ if (!$entity) {
}
// cannot like your own stuff
-if (get_loggedin_userid() == $entity->getOwnerGUID()) {
+if (elgg_get_logged_in_user_guid() == $entity->getOwnerGUID()) {
register_error(elgg_echo("likes:no_self_like"));
forward(REFERER);
}
-$user = get_loggedin_user();
+$user = elgg_get_logged_in_user_entity();
$annotation = create_annotation($entity->guid,
'likes',
"likes",
diff --git a/actions/likes/delete.php b/actions/likes/delete.php
index 7ccf2de37..168818a60 100644
--- a/actions/likes/delete.php
+++ b/actions/likes/delete.php
@@ -7,7 +7,7 @@
*/
// Ensure we're logged in
-if (!isloggedin()) {
+if (!elgg_is_logged_in()) {
forward();
}
diff --git a/actions/notifications/settings/usersettings/save.php b/actions/notifications/settings/usersettings/save.php
index eaa01c3ad..455a444e1 100644
--- a/actions/notifications/settings/usersettings/save.php
+++ b/actions/notifications/settings/usersettings/save.php
@@ -17,7 +17,7 @@ foreach ($method as $k => $v) {
continue;
}
- $result = set_user_notification_setting(get_loggedin_userid(), $k, ($v == 'yes') ? true : false);
+ $result = set_user_notification_setting(elgg_get_logged_in_user_guid(), $k, ($v == 'yes') ? true : false);
if (!$result) {
register_error(elgg_echo('notifications:usersettings:save:fail'));
diff --git a/actions/plugins/usersettings/save.php b/actions/plugins/usersettings/save.php
index ddf7e822e..a54df627a 100644
--- a/actions/plugins/usersettings/save.php
+++ b/actions/plugins/usersettings/save.php
@@ -13,7 +13,7 @@ $result = false;
foreach ($params as $k => $v) {
// Save
- $result = set_plugin_usersetting($k, $v, get_loggedin_userid(), $plugin);
+ $result = set_plugin_usersetting($k, $v, elgg_get_logged_in_user_guid(), $plugin);
// Error?
if (!$result) {
diff --git a/actions/user/default_access.php b/actions/user/default_access.php
index 0b7d0bfbd..5ddd86296 100644
--- a/actions/user/default_access.php
+++ b/actions/user/default_access.php
@@ -11,7 +11,7 @@ if (elgg_get_config('allow_user_default_access')) {
$user_id = get_input('guid');
if (!$user_id) {
- $user = get_loggedin_user();
+ $user = elgg_get_logged_in_user_entity();
} else {
$user = get_entity($user_id);
}
diff --git a/actions/user/language.php b/actions/user/language.php
index 44c591d7a..30d3b45e8 100644
--- a/actions/user/language.php
+++ b/actions/user/language.php
@@ -10,7 +10,7 @@ $language = get_input('language');
$user_id = get_input('guid');
if (!$user_id) {
- $user = get_loggedin_user();
+ $user = elgg_get_logged_in_user_entity();
} else {
$user = get_entity($user_id);
}
diff --git a/actions/user/name.php b/actions/user/name.php
index e293d409c..881019e86 100644
--- a/actions/user/name.php
+++ b/actions/user/name.php
@@ -10,7 +10,7 @@ $name = strip_tags(get_input('name'));
$user_id = get_input('guid');
if (!$user_id) {
- $user = get_loggedin_user();
+ $user = elgg_get_logged_in_user_entity();
} else {
$user = get_entity($user_id);
}
diff --git a/actions/user/password.php b/actions/user/password.php
index bbeb0ea7f..8619372e4 100644
--- a/actions/user/password.php
+++ b/actions/user/password.php
@@ -12,14 +12,14 @@ $password2 = get_input('password2');
$user_id = get_input('guid');
if (!$user_id) {
- $user = get_loggedin_user();
+ $user = elgg_get_logged_in_user_entity();
} else {
$user = get_entity($user_id);
}
if (($user) && ($password != "")) {
// let admin user change anyone's password without knowing it except his own.
- if (!isadminloggedin() || isadminloggedin() && $user->guid == get_loggedin_userid()) {
+ if (!elgg_is_admin_logged_in() || elgg_is_admin_logged_in() && $user->guid == elgg_get_logged_in_user_guid()) {
$credentials = array(
'username' => $user->username,
'password' => $current_password
diff --git a/actions/user/spotlight.php b/actions/user/spotlight.php
index 390197e78..202dde387 100644
--- a/actions/user/spotlight.php
+++ b/actions/user/spotlight.php
@@ -14,6 +14,6 @@ if ($closed != 'true') {
$closed = true;
}
-get_loggedin_user()->spotlightclosed = $closed;
+elgg_get_logged_in_user_entity()->spotlightclosed = $closed;
// exit as this action is called through Ajax
exit; \ No newline at end of file
diff --git a/actions/useradd.php b/actions/useradd.php
index 0219361fb..f20b9d070 100644
--- a/actions/useradd.php
+++ b/actions/useradd.php
@@ -29,7 +29,7 @@ try {
}
$new_user->admin_created = TRUE;
- $new_user->created_by_guid = get_loggedin_userid();
+ $new_user->created_by_guid = elgg_get_logged_in_user_guid();
$subject = elgg_echo('useradd:subject');
$body = elgg_echo('useradd:body', array(
diff --git a/actions/widgets/delete.php b/actions/widgets/delete.php
index 167324b0c..5b8aaf75e 100644
--- a/actions/widgets/delete.php
+++ b/actions/widgets/delete.php
@@ -8,7 +8,7 @@
$guid = get_input('guid');
-$user = get_loggedin_user();
+$user = elgg_get_logged_in_user_entity();
$widget = get_entity($guid);
if ($widget && $user->canEdit() && $widget->delete()) {
diff --git a/actions/widgets/move.php b/actions/widgets/move.php
index 276dcb55e..2edc7912e 100644
--- a/actions/widgets/move.php
+++ b/actions/widgets/move.php
@@ -10,7 +10,7 @@ $guid = get_input('guid');
$column = get_input('column', 1);
$position = get_input('position');
-$user = get_loggedin_user();
+$user = elgg_get_logged_in_user_entity();
$widget = get_entity($guid);
if ($widget && $user->canEdit()) {
diff --git a/documentation/examples/events/advanced.php b/documentation/examples/events/advanced.php
index f566e0006..22a407579 100644
--- a/documentation/examples/events/advanced.php
+++ b/documentation/examples/events/advanced.php
@@ -5,6 +5,6 @@ elgg_register_event_handler('create', 'object', 'example_event_handler');
function example_event_handler($event, $type, $params) {
// Don't allow any non-admin users to create objects
// Returning false from this function will halt the creation of the object.
- return isadminloggedin();
+ return elgg_is_admin_logged_in();
}
diff --git a/index.php b/index.php
index e35a8efdd..6642984aa 100644
--- a/index.php
+++ b/index.php
@@ -16,7 +16,7 @@ if (elgg_trigger_plugin_hook('index', 'system', null, FALSE) != FALSE) {
exit;
}
-if (isloggedin()) {
+if (elgg_is_logged_in()) {
forward('pg/activity/');
}
diff --git a/js/lib/languages.js b/js/lib/languages.js
index 727e939c0..e8c2ad0ca 100644
--- a/js/lib/languages.js
+++ b/js/lib/languages.js
@@ -41,7 +41,7 @@ elgg.reload_all_translations = function(language) {
* @return {String}
*/
elgg.get_language = function() {
- var user = elgg.get_loggedin_user();
+ var user = elgg.elgg_get_logged_in_user_entity();
if (user && user.language) {
return user.language;
diff --git a/js/lib/session.js b/js/lib/session.js
index 613910412..2d319b00f 100644
--- a/js/lib/session.js
+++ b/js/lib/session.js
@@ -83,30 +83,30 @@ elgg.session.cookie = function (name, value, options) {
/**
* @return {ElggUser} The logged in user
*/
-elgg.get_loggedin_user = function() {
+elgg.elgg_get_logged_in_user_entity = function() {
return elgg.session.user;
};
/**
* @return {number} The GUID of the logged in user
*/
-elgg.get_loggedin_userid = function() {
- var user = elgg.get_loggedin_user();
+elgg.elgg_get_logged_in_user_guid = function() {
+ var user = elgg.elgg_get_logged_in_user_entity();
return user ? user.guid : 0;
};
/**
* @return {boolean} Whether there is a user logged in
*/
-elgg.isloggedin = function() {
- return (elgg.get_loggedin_user() instanceof elgg.ElggUser);
+elgg.elgg_is_logged_in = function() {
+ return (elgg.elgg_get_logged_in_user_entity() instanceof elgg.ElggUser);
};
/**
* @return {boolean} Whether there is an admin logged in
*/
-elgg.isadminloggedin = function() {
- var user = elgg.get_loggedin_user();
+elgg.elgg_is_admin_logged_in = function() {
+ var user = elgg.elgg_get_logged_in_user_entity();
return (user instanceof elgg.ElggUser) && user.isAdmin();
};
diff --git a/js/lib/ui.widgets.js b/js/lib/ui.widgets.js
index 922029c34..660548a15 100644
--- a/js/lib/ui.widgets.js
+++ b/js/lib/ui.widgets.js
@@ -56,7 +56,7 @@ elgg.ui.widgets.add = function(event) {
elgg.action('widgets/add', {
data: {
handler: type,
- user_guid: elgg.get_loggedin_userid(),
+ user_guid: elgg.elgg_get_logged_in_user_guid(),
context: $("input[name='widget_context']").val()
},
success: function(json) {
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&hellip;</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');
diff --git a/pages/account/forgotten_password.php b/pages/account/forgotten_password.php
index 8ec7b6cbd..93d786e22 100644
--- a/pages/account/forgotten_password.php
+++ b/pages/account/forgotten_password.php
@@ -8,7 +8,7 @@
require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-if (isloggedin()) {
+if (elgg_is_logged_in()) {
forward();
}
diff --git a/pages/account/register.php b/pages/account/register.php
index 680a9f240..58544ef49 100644
--- a/pages/account/register.php
+++ b/pages/account/register.php
@@ -22,7 +22,7 @@ $friend_guid = (int) get_input('friend_guid', 0);
$invitecode = get_input('invitecode');
// only logged out people need to register
-if (isloggedin()) {
+if (elgg_is_logged_in()) {
forward();
}
diff --git a/pages/dashboard.php b/pages/dashboard.php
index 0f4b113c5..31cc9087d 100644
--- a/pages/dashboard.php
+++ b/pages/dashboard.php
@@ -11,7 +11,7 @@ gatekeeper();
// Set context and title
elgg_set_context('dashboard');
-elgg_set_page_owner_guid(get_loggedin_userid());
+elgg_set_page_owner_guid(elgg_get_logged_in_user_guid());
$title = elgg_echo('dashboard');
// wrap intro message in a div
diff --git a/pages/friends/add.php b/pages/friends/add.php
index 81fe7b05b..1b7b0288f 100644
--- a/pages/friends/add.php
+++ b/pages/friends/add.php
@@ -14,7 +14,7 @@ $title = elgg_echo('friends:collections:add');
$content = elgg_view_title($title);
$content .= elgg_view('forms/friends/edit', array(
- 'friends' => get_user_friends(get_loggedin_userid(), "", 9999)
+ 'friends' => get_user_friends(elgg_get_logged_in_user_guid(), "", 9999)
)
);
diff --git a/pages/friends/collections.php b/pages/friends/collections.php
index 76ae9d20b..5a32b7f90 100644
--- a/pages/friends/collections.php
+++ b/pages/friends/collections.php
@@ -13,7 +13,7 @@ $title = elgg_echo('friends:collections');
$content = elgg_view_title($title);
-$content .= elgg_view_access_collections(get_loggedin_userid());
+$content .= elgg_view_access_collections(elgg_get_logged_in_user_guid());
$body = elgg_view_layout('one_sidebar', array('content' => $content));
diff --git a/pages/river.php b/pages/river.php
index 120ad4b57..728df50e1 100644
--- a/pages/river.php
+++ b/pages/river.php
@@ -26,12 +26,12 @@ switch ($page_type) {
case 'mine':
$title = elgg_echo('river:mine');
$page_filter = 'mine';
- $options['subject_guid'] = get_loggedin_userid();
+ $options['subject_guid'] = elgg_get_logged_in_user_guid();
break;
case 'friends':
$title = elgg_echo('river:friends');
$page_filter = 'friends';
- $options['relationship_guid'] = get_loggedin_userid();
+ $options['relationship_guid'] = elgg_get_logged_in_user_guid();
$options['relationship'] = 'friend';
break;
default:
diff --git a/pages/settings/account.php b/pages/settings/account.php
index 2d3edd695..e6a5da97b 100644
--- a/pages/settings/account.php
+++ b/pages/settings/account.php
@@ -11,7 +11,7 @@ gatekeeper();
// Make sure we don't open a security hole ...
if ((!elgg_get_page_owner_entity()) || (!elgg_get_page_owner_entity()->canEdit())) {
- set_page_owner(get_loggedin_userid());
+ set_page_owner(elgg_get_logged_in_user_guid());
}
$title = elgg_echo('usersettings:user');
diff --git a/pages/settings/statistics.php b/pages/settings/statistics.php
index 5cb935e07..b7394cbe8 100644
--- a/pages/settings/statistics.php
+++ b/pages/settings/statistics.php
@@ -11,7 +11,7 @@ gatekeeper();
// Make sure we don't open a security hole ...
if ((!elgg_get_page_owner_entity()) || (!elgg_get_page_owner_entity()->canEdit())) {
- set_page_owner(get_loggedin_userid());
+ set_page_owner(elgg_get_logged_in_user_guid());
}
$title = elgg_echo("usersettings:statistics");
diff --git a/pages/settings/tools.php b/pages/settings/tools.php
index ec0786c17..dcb026677 100644
--- a/pages/settings/tools.php
+++ b/pages/settings/tools.php
@@ -11,7 +11,7 @@ gatekeeper();
// Make sure we don't open a security hole ...
if ((!elgg_get_page_owner_entity()) || (!elgg_get_page_owner_entity()->canEdit())) {
- set_page_owner(get_loggedin_userid());
+ set_page_owner(elgg_get_logged_in_user_guid());
}
$title = elgg_echo("usersettings:plugins");
diff --git a/views/default/admin/dashboard.php b/views/default/admin/dashboard.php
index 1b042f14b..d3976ca38 100644
--- a/views/default/admin/dashboard.php
+++ b/views/default/admin/dashboard.php
@@ -1,6 +1,6 @@
<?php
-elgg_set_page_owner_guid(get_loggedin_userid());
+elgg_set_page_owner_guid(elgg_get_logged_in_user_guid());
$params = array(
'num_columns' => 2,
diff --git a/views/default/core/account/login_dropdown.php b/views/default/core/account/login_dropdown.php
index 356aa48de..fd01b4711 100644
--- a/views/default/core/account/login_dropdown.php
+++ b/views/default/core/account/login_dropdown.php
@@ -4,7 +4,7 @@
*
*/
-if (isloggedin()) {
+if (elgg_is_logged_in()) {
return true;
}
diff --git a/views/default/core/friends/collection.php b/views/default/core/friends/collection.php
index 9463d5b42..bfe88a166 100644
--- a/views/default/core/friends/collection.php
+++ b/views/default/core/friends/collection.php
@@ -22,7 +22,7 @@ if (is_array($vars['collection']->members)) {
echo "<li><h2>";
//as collections are private, check that the logged in user is the owner
-if ($coll->owner_guid == get_loggedin_userid()) {
+if ($coll->owner_guid == elgg_get_logged_in_user_guid()) {
echo "<div class=\"friends_collections_controls\">";
echo elgg_view('output/confirmlink', array(
'href' => 'action/friends/deletecollection?collection=' . $coll->id,
@@ -35,7 +35,7 @@ echo " (<span id=\"friends_membership_count{$vars['friendspicker']}\">{$count}</
// individual collection panels
if ($friends = $vars['collection']->entities) {
- $content = elgg_view('core/friends/collectiontabs', array('owner' => get_loggedin_user(), 'collection' => $vars['collection'], 'friendspicker' => $vars['friendspicker']));
+ $content = elgg_view('core/friends/collectiontabs', array('owner' => elgg_get_logged_in_user_entity(), 'collection' => $vars['collection'], 'friendspicker' => $vars['friendspicker']));
echo elgg_view('core/friends/picker', array('entities' => $friends, 'value' => $members, 'content' => $content, 'replacement' => '', 'friendspicker' => $vars['friendspicker']));
?>
@@ -43,7 +43,7 @@ if ($friends = $vars['collection']->entities) {
<script type="text/javascript">
$(document).ready(function () {
- $('#friends-picker_placeholder<?php echo $vars['friendspicker']; ?>').load('<?php echo elgg_get_site_url(); ?>pages/friends/pickercallback.php?username=<?php echo get_loggedin_user()->username; ?>&type=list&collection=<?php echo $vars['collection']->id; ?>');
+ $('#friends-picker_placeholder<?php echo $vars['friendspicker']; ?>').load('<?php echo elgg_get_site_url(); ?>pages/friends/pickercallback.php?username=<?php echo elgg_get_logged_in_user_entity()->username; ?>&type=list&collection=<?php echo $vars['collection']->id; ?>');
});
</script>
diff --git a/views/default/core/friends/collectiontabs.php b/views/default/core/friends/collectiontabs.php
index 6a939aca7..c8d0deb67 100644
--- a/views/default/core/friends/collectiontabs.php
+++ b/views/default/core/friends/collectiontabs.php
@@ -30,7 +30,7 @@ $(document).ready(function () {
$('a.collectionmembers<?php echo $friendspicker; ?>').click(function () {
// load collection members pane
- $('#friends-picker_placeholder<?php echo $friendspicker; ?>').load('<?php echo elgg_get_site_url(); ?>pages/friends/pickercallback.php?username=<?php echo get_loggedin_user()->username; ?>&type=list&collection=<?php echo $collectionid; ?>&friendspicker=<?php echo $friendspicker; ?>');
+ $('#friends-picker_placeholder<?php echo $friendspicker; ?>').load('<?php echo elgg_get_site_url(); ?>pages/friends/pickercallback.php?username=<?php echo elgg_get_logged_in_user_entity()->username; ?>&type=list&collection=<?php echo $collectionid; ?>&friendspicker=<?php echo $friendspicker; ?>');
// remove selected state from previous tab
$(this).parent().parent().find("li.selected").removeClass("selected");
@@ -42,7 +42,7 @@ $(document).ready(function () {
$('a.editmembers<?php echo $friendspicker; ?>').click(function () {
// load friends picker pane
- $('#friends-picker_placeholder<?php echo $friendspicker; ?>').load('<?php echo elgg_get_site_url(); ?>pages/friends/pickercallback.php?username=<?php echo get_loggedin_user()->username; ?>&type=picker&collection=<?php echo $collectionid; ?>&friendspicker=<?php echo $friendspicker; ?>');
+ $('#friends-picker_placeholder<?php echo $friendspicker; ?>').load('<?php echo elgg_get_site_url(); ?>pages/friends/pickercallback.php?username=<?php echo elgg_get_logged_in_user_entity()->username; ?>&type=picker&collection=<?php echo $collectionid; ?>&friendspicker=<?php echo $friendspicker; ?>');
// remove selected state from previous tab
$(this).parent().parent().find("li.selected").removeClass("selected");
diff --git a/views/default/core/likes/display.php b/views/default/core/likes/display.php
index 5b59c7215..209b6de2d 100644
--- a/views/default/core/likes/display.php
+++ b/views/default/core/likes/display.php
@@ -25,7 +25,7 @@ if (!elgg_annotation_exists($guid, 'likes')) {
);
$likes_button = elgg_view('output/url', $params);
} else {
- $likes = get_annotations($guid, '', '', 'likes', '', get_loggedin_userid());
+ $likes = get_annotations($guid, '', '', 'likes', '', elgg_get_logged_in_user_guid());
$url = elgg_get_site_url() . "action/likes/delete?annotation_id={$likes[0]->id}";
$params = array(
'href' => $url,
diff --git a/views/default/core/river/controls.php b/views/default/core/river/controls.php
index 66fbc5059..7c5e94581 100644
--- a/views/default/core/river/controls.php
+++ b/views/default/core/river/controls.php
@@ -8,7 +8,7 @@
$object = $vars['item']->getObjectEntity();
-if (isloggedin()) {
+if (elgg_is_logged_in()) {
// comments and non-objects cannot be commented on or liked
if ($object->getType() == 'object' && $vars['item']->annotation_id == 0) {
$params = array(
@@ -29,7 +29,7 @@ if (isloggedin()) {
);
echo elgg_view('output/url', $params);
} else {
- $likes = get_annotations($guid, '', '', 'likes', '', get_loggedin_userid());
+ $likes = get_annotations($guid, '', '', 'likes', '', elgg_get_logged_in_user_guid());
$url = elgg_get_site_url() . "action/likes/delete?annotation_id={$likes[0]->id}";
$params = array(
'href' => $url,
diff --git a/views/default/core/settings/account/password.php b/views/default/core/settings/account/password.php
index 0ee215f9c..06e59dfbb 100644
--- a/views/default/core/settings/account/password.php
+++ b/views/default/core/settings/account/password.php
@@ -17,7 +17,7 @@ if ($user) {
<div class="elgg-body">
<?php
// only make the admin user enter current password for changing his own password.
- if (!isadminloggedin() || isadminloggedin() && $user->guid == get_loggedin_userid()) {
+ if (!elgg_is_admin_logged_in() || elgg_is_admin_logged_in() && $user->guid == elgg_get_logged_in_user_guid()) {
?>
<p>
<?php echo elgg_echo('user:current_password:label'); ?>:
diff --git a/views/default/core/settings/statistics/numentities.php b/views/default/core/settings/statistics/numentities.php
index 388af0af6..245fd67be 100644
--- a/views/default/core/settings/statistics/numentities.php
+++ b/views/default/core/settings/statistics/numentities.php
@@ -7,7 +7,7 @@
*/
// Get entity statistics
-$entity_stats = get_entity_statistics(get_loggedin_userid());
+$entity_stats = get_entity_statistics(elgg_get_logged_in_user_guid());
if ($entity_stats) {
?>
diff --git a/views/default/core/settings/statistics/online.php b/views/default/core/settings/statistics/online.php
index df477d871..65db42cb1 100644
--- a/views/default/core/settings/statistics/online.php
+++ b/views/default/core/settings/statistics/online.php
@@ -6,7 +6,7 @@
* @subpackage Core
*/
-$user = get_loggedin_user();
+$user = elgg_get_logged_in_user_entity();
$logged_in = 0;
$log = get_system_log($user->guid, "login", "", 'user', '', 1);
diff --git a/views/default/core/settings/tools/plugin.php b/views/default/core/settings/tools/plugin.php
index 50cc55b50..d89e93c2f 100644
--- a/views/default/core/settings/tools/plugin.php
+++ b/views/default/core/settings/tools/plugin.php
@@ -18,7 +18,7 @@ $manifest = $details['manifest'];
$user_guid = $details['user_guid'];
if ($user_guid) {
- $user_guid = get_loggedin_userid();
+ $user_guid = elgg_get_logged_in_user_guid();
}
if (elgg_view("usersettings/{$plugin}/edit")) {
diff --git a/views/default/export/entity.php b/views/default/export/entity.php
index 333179fbb..faf27e932 100644
--- a/views/default/export/entity.php
+++ b/views/default/export/entity.php
@@ -22,7 +22,7 @@ $exportable_values = $entity->getExportableValues();
<h2><?php echo elgg_echo('Entity'); ?></h2>
<?php
foreach ($entity as $k => $v) {
- if ((in_array($k, $exportable_values)) || (isadminloggedin())) {
+ if ((in_array($k, $exportable_values)) || (elgg_is_admin_logged_in())) {
?>
<p class="margin-none"><b><?php echo $k; ?>: </b><?php echo strip_tags($v); ?></p>
<?php
diff --git a/views/default/forms/comments/add.php b/views/default/forms/comments/add.php
index 74ee5ba4b..238777422 100644
--- a/views/default/forms/comments/add.php
+++ b/views/default/forms/comments/add.php
@@ -7,7 +7,7 @@
* @uses $vars['entity']
*/
-if (isset($vars['entity']) && isloggedin()) {
+if (isset($vars['entity']) && elgg_is_logged_in()) {
?>
<p class="mbn">
<label><?php echo elgg_echo("generic_comments:text"); ?></label>
diff --git a/views/default/forms/comments/inline.php b/views/default/forms/comments/inline.php
index ee5883435..9c44905be 100644
--- a/views/default/forms/comments/inline.php
+++ b/views/default/forms/comments/inline.php
@@ -5,7 +5,7 @@
* @uses $vars['entity']
*/
-if (isset($vars['entity']) && isloggedin()) {
+if (isset($vars['entity']) && elgg_is_logged_in()) {
echo elgg_view('input/text', array('internalname' => 'generic_comment'));
echo elgg_view('input/hidden', array(
'internalname' => 'entity_guid',
diff --git a/views/default/forms/register.php b/views/default/forms/register.php
index 93e2585d8..b2f4d14f7 100644
--- a/views/default/forms/register.php
+++ b/views/default/forms/register.php
@@ -11,7 +11,7 @@ $email = get_input('e');
$name = get_input('n');
$admin_option = false;
-if (isadminloggedin() && isset($vars['show_admin'])) {
+if (elgg_is_admin_logged_in() && isset($vars['show_admin'])) {
$admin_option = true;
}
diff --git a/views/default/forms/useradd.php b/views/default/forms/useradd.php
index efb691551..ae0049267 100644
--- a/views/default/forms/useradd.php
+++ b/views/default/forms/useradd.php
@@ -7,7 +7,7 @@
*/
$admin_option = false;
-if ((get_loggedin_user()->isAdmin()) && ($vars['show_admin'])) {
+if ((elgg_get_logged_in_user_entity()->isAdmin()) && ($vars['show_admin'])) {
$admin_option = true;
}
diff --git a/views/default/icon/user/default.php b/views/default/icon/user/default.php
index c0bfc4676..9d5a862d8 100644
--- a/views/default/icon/user/default.php
+++ b/views/default/icon/user/default.php
@@ -10,7 +10,7 @@
* @uses $vars['hover'] Display the hover menu? (true)
*/
-$user = elgg_get_array_value('entity', $vars, get_loggedin_user());
+$user = elgg_get_array_value('entity', $vars, elgg_get_logged_in_user_entity());
$size = elgg_get_array_value('size', $vars, 'medium');
if (!in_array($size, array('topbar', 'tiny', 'small', 'medium', 'large', 'master'))) {
$size = 'medium';
@@ -37,7 +37,7 @@ $spacer_url = elgg_get_site_url() . '_graphics/spacer.gif';
$icon_url = $user->getIconURL($size);
$icon = "<img src=\"$spacer_url\" alt=\"$name\" title=\"$name\" $js style=\"background: url($icon_url) no-repeat;\" />";
-$show_menu = $hover && (isadminloggedin() || !$user->isBanned());
+$show_menu = $hover && (elgg_is_admin_logged_in() || !$user->isBanned());
?>
<div class="elgg-avatar elgg-avatar-<?php echo $size; ?>">
diff --git a/views/default/js/initialize_elgg.php b/views/default/js/initialize_elgg.php
index 6a82b879e..b967a0914 100644
--- a/views/default/js/initialize_elgg.php
+++ b/views/default/js/initialize_elgg.php
@@ -28,7 +28,7 @@ if ($page_owner instanceof ElggEntity) {
echo 'elgg.page_owner = '.json_encode($page_owner_json).';';
}
-$user = get_loggedin_user();
+$user = elgg_get_logged_in_user_entity();
if ($user instanceof ElggUser) {
$user_json = array();
diff --git a/views/default/layout/elements/owner_block.php b/views/default/layout/elements/owner_block.php
index 6ec4ebabe..dce4c1632 100644
--- a/views/default/layout/elements/owner_block.php
+++ b/views/default/layout/elements/owner_block.php
@@ -13,7 +13,7 @@ elgg_push_context('owner_block');
// groups and other users get owner block
$owner = elgg_get_page_owner_entity();
if ($owner instanceof ElggGroup ||
- ($owner instanceof ElggUser && $owner->getGUID() != get_loggedin_userid())) {
+ ($owner instanceof ElggUser && $owner->getGUID() != elgg_get_logged_in_user_guid())) {
$header = elgg_view_entity($owner, false);
diff --git a/views/default/layout/shells/admin.php b/views/default/layout/shells/admin.php
index 988606ec1..7d38500d7 100644
--- a/views/default/layout/shells/admin.php
+++ b/views/default/layout/shells/admin.php
@@ -30,7 +30,7 @@ $logout = elgg_view('output/url', array(
</a>
</h1>
<ul class="elgg-menu-user">
- <li><?php echo elgg_echo('admin:loggedin', array(get_loggedin_user()->name)); ?></li>
+ <li><?php echo elgg_echo('admin:loggedin', array(elgg_get_logged_in_user_entity()->name)); ?></li>
<li><?php echo $view_site; ?></li>
<li><?php echo $logout; ?></li>
</ul>
diff --git a/views/default/layout/shells/content/filter.php b/views/default/layout/shells/content/filter.php
index d84c27a63..c9f774e72 100644
--- a/views/default/layout/shells/content/filter.php
+++ b/views/default/layout/shells/content/filter.php
@@ -16,8 +16,8 @@ if (isset($vars['filter_override'])) {
$context = elgg_get_array_value('context', $vars, elgg_get_context());
-if (isloggedin() && $context) {
- $username = get_loggedin_user()->username;
+if (elgg_is_logged_in() && $context) {
+ $username = elgg_get_logged_in_user_entity()->username;
$filter_context = elgg_get_array_value('filter_context', $vars, 'everyone');
// generate a list of default tabs
diff --git a/views/default/layout/shells/content/header.php b/views/default/layout/shells/content/header.php
index b0bab9dc9..f3517e9ad 100644
--- a/views/default/layout/shells/content/header.php
+++ b/views/default/layout/shells/content/header.php
@@ -25,12 +25,12 @@ if ($context) {
if (isset($vars['buttons'])) {
$buttons = $vars['buttons'];
} else {
- if (isloggedin() && $context) {
+ if (elgg_is_logged_in() && $context) {
$owner = elgg_get_page_owner_entity();
if (elgg_instanceof($owner, 'group')) {
$guid = $owner->getGUID();
} else {
- $guid = get_loggedin_userid();
+ $guid = elgg_get_logged_in_user_guid();
}
$new_link = elgg_get_array_value('new_link', $vars, "pg/$context/add/$guid/");
$params = array(
diff --git a/views/default/navigation/menu/user_hover.php b/views/default/navigation/menu/user_hover.php
index 25bed11f5..9ceda38e5 100644
--- a/views/default/navigation/menu/user_hover.php
+++ b/views/default/navigation/menu/user_hover.php
@@ -23,7 +23,7 @@ $name_link = elgg_view('output/url', array(
echo "<li>$name_link</li>";
// actions
-if (isloggedin() && $actions) {
+if (elgg_is_logged_in() && $actions) {
echo '<li><ul>';
foreach ($actions as $menu_item) {
echo elgg_view('navigation/menu/elements/item', array('item' => $menu_item));
@@ -41,7 +41,7 @@ if ($main) {
}
// admin
-if (isadminloggedin() && $admin) {
+if (elgg_is_admin_logged_in() && $admin) {
echo '<li><ul class="elgg-hover-admin">';
foreach ($admin as $menu_item) {
echo elgg_view('navigation/menu/elements/item', array('item' => $menu_item));
diff --git a/views/default/page/elements/content_header.php b/views/default/page/elements/content_header.php
index 6383c2f18..becf4a13a 100644
--- a/views/default/page/elements/content_header.php
+++ b/views/default/page/elements/content_header.php
@@ -18,7 +18,7 @@
*/
$page_owner = elgg_get_page_owner_entity();
-$logged_in_user = get_loggedin_user();
+$logged_in_user = elgg_get_logged_in_user_entity();
$username = $logged_in_user->username;
if (!$page_owner) {
@@ -61,7 +61,7 @@ $title = elgg_echo($type);
$title = '<div class="content-header-title">' . elgg_view_title($title) . '</div>';
// must be logged in to see any action buttons
-if (isloggedin()) {
+if (elgg_is_logged_in()) {
// only show the new button when not on the add form.
// hide the tabs when on the add form.
if ($filter_context == 'action') {
diff --git a/views/default/page/elements/topbar.php b/views/default/page/elements/topbar.php
index 40306fcc3..6981d7d7a 100644
--- a/views/default/page/elements/topbar.php
+++ b/views/default/page/elements/topbar.php
@@ -4,7 +4,7 @@
* The standard elgg top toolbar
*/
-$user = get_loggedin_user();
+$user = elgg_get_logged_in_user_entity();
if (!elgg_instanceof($user, 'user')) {
// do not show tobpar to logged out users
return true;
diff --git a/views/default/user/default.php b/views/default/user/default.php
index 3e2b9f433..2abc19991 100644
--- a/views/default/user/default.php
+++ b/views/default/user/default.php
@@ -12,9 +12,9 @@ $icon = elgg_view('profile/icon', array('entity' => $user, 'size' => 'tiny'));
// Simple XFN
$rel = '';
-if (get_loggedin_userid() == $user->guid) {
+if (elgg_get_logged_in_user_guid() == $user->guid) {
$rel = 'rel="me"';
-} elseif (check_entity_relationship(get_loggedin_userid(), 'friend', $user->guid)) {
+} elseif (check_entity_relationship(elgg_get_logged_in_user_guid(), 'friend', $user->guid)) {
$rel = 'rel="friend"';
}
diff --git a/views/foaf/page/shells/default.php b/views/foaf/page/shells/default.php
index d360f209b..f955279d0 100644
--- a/views/foaf/page/shells/default.php
+++ b/views/foaf/page/shells/default.php
@@ -15,10 +15,10 @@ header("Content-Type: text/xml");
echo "<?xml version='1.0'?>\n";
if (!$owner = elgg_get_page_owner_entity()) {
- if (!isloggedin()) {
+ if (!elgg_is_logged_in()) {
exit;
} else {
- $owner = get_loggedin_user();
+ $owner = elgg_get_logged_in_user_entity();
}
}