aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-08 19:27:58 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-08 19:27:58 +0000
commit1368785a6b6f9c946dcc5eca078540bacce71f60 (patch)
tree1aa0857127ef2f21cc2e64a608d94359da172bab /engine/lib
parent9074f002ad0603014c90b12aaaf2c51d740638e9 (diff)
downloadelgg-1368785a6b6f9c946dcc5eca078540bacce71f60.tar.gz
elgg-1368785a6b6f9c946dcc5eca078540bacce71f60.tar.bz2
Refs #2543: Core uses the new functions from previous commit.
git-svn-id: http://code.elgg.org/elgg/trunk@8078 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/access.php18
-rw-r--r--engine/lib/actions.php6
-rw-r--r--engine/lib/annotations.php6
-rw-r--r--engine/lib/calendar.php2
-rw-r--r--engine/lib/configuration.php2
-rw-r--r--engine/lib/cron.php2
-rw-r--r--engine/lib/database.php2
-rw-r--r--engine/lib/entities.php16
-rw-r--r--engine/lib/extender.php6
-rw-r--r--engine/lib/filestore.php2
-rw-r--r--engine/lib/group.php6
-rw-r--r--engine/lib/input.php2
-rw-r--r--engine/lib/languages.php6
-rw-r--r--engine/lib/mb_wrapper.php2
-rw-r--r--engine/lib/memcache.php2
-rw-r--r--engine/lib/metadata.php4
-rw-r--r--engine/lib/metastrings.php2
-rw-r--r--engine/lib/notification.php6
-rw-r--r--engine/lib/objects.php2
-rw-r--r--engine/lib/opendd.php2
-rw-r--r--engine/lib/pageowner.php2
-rw-r--r--engine/lib/pam.php2
-rw-r--r--engine/lib/plugins.php10
-rw-r--r--engine/lib/river.php2
-rw-r--r--engine/lib/sessions.php4
-rw-r--r--engine/lib/statistics.php2
-rw-r--r--engine/lib/system_log.php4
-rw-r--r--engine/lib/upgrades/2008100701.php2
-rw-r--r--engine/lib/upgrades/2009022701.php2
-rw-r--r--engine/lib/upgrades/2009041701.php2
-rw-r--r--engine/lib/upgrades/2009070101.php2
-rw-r--r--engine/lib/upgrades/2010033101.php2
-rw-r--r--engine/lib/upgrades/2010040201.php2
-rw-r--r--engine/lib/upgrades/2010061501.php2
-rw-r--r--engine/lib/upgrades/2010121401.php2
-rw-r--r--engine/lib/upgrades/2011010101.php2
-rw-r--r--engine/lib/users.php22
-rw-r--r--engine/lib/usersettings.php8
-rw-r--r--engine/lib/views.php8
-rw-r--r--engine/lib/web_services.php2
-rw-r--r--engine/lib/widgets.php6
41 files changed, 93 insertions, 93 deletions
diff --git a/engine/lib/access.php b/engine/lib/access.php
index ae95982e6..68a01dfad 100644
--- a/engine/lib/access.php
+++ b/engine/lib/access.php
@@ -35,7 +35,7 @@ function get_access_list($user_id = 0, $site_id = 0, $flush = false) {
}
if ($user_id == 0) {
- $user_id = get_loggedin_userid();
+ $user_id = elgg_get_logged_in_user_guid();
}
if (($site_id == 0) && (isset($CONFIG->site_id))) {
@@ -77,7 +77,7 @@ function get_access_array($user_id = 0, $site_id = 0, $flush = false) {
}
if ($user_id == 0) {
- $user_id = get_loggedin_userid();
+ $user_id = elgg_get_logged_in_user_guid();
}
if (($site_id == 0) && (isset($CONFIG->site_guid))) {
@@ -91,7 +91,7 @@ function get_access_array($user_id = 0, $site_id = 0, $flush = false) {
$tmp_access_array = array(ACCESS_PUBLIC);
// The following can only return sensible data if the user is logged in.
- if (isloggedin()) {
+ if (elgg_is_logged_in()) {
$tmp_access_array[] = ACCESS_LOGGED_IN;
// Get ACL memberships
@@ -157,7 +157,7 @@ function get_default_access(ElggUser $user = null) {
return $CONFIG->default_access;
}
- if (!($user) && (!$user = get_loggedin_user())) {
+ if (!($user) && (!$user = elgg_get_logged_in_user_entity())) {
return $CONFIG->default_access;
}
@@ -264,7 +264,7 @@ function get_access_sql_suffix($table_prefix = '', $owner = null) {
}
if (!isset($owner)) {
- $owner = get_loggedin_userid();
+ $owner = elgg_get_logged_in_user_guid();
}
if (!$owner) {
@@ -370,7 +370,7 @@ function get_write_access_array($user_id = 0, $site_id = 0, $flush = false) {
static $access_array;
if ($user_id == 0) {
- $user_id = get_loggedin_userid();
+ $user_id = elgg_get_logged_in_user_guid();
}
if (($site_id == 0) && (isset($CONFIG->site_id))) {
@@ -437,7 +437,7 @@ function create_access_collection($name, $owner_guid = 0, $site_guid = 0) {
}
if ($owner_guid == 0) {
- $owner_guid = get_loggedin_userid();
+ $owner_guid = elgg_get_logged_in_user_guid();
}
if (($site_guid == 0) && (isset($CONFIG->site_guid))) {
$site_guid = $CONFIG->site_guid;
@@ -930,7 +930,7 @@ function access_init() {
* @elgg_event_handler permissions_check all
*/
function elgg_override_permissions_hook() {
- $user_guid = get_loggedin_userid();
+ $user_guid = elgg_get_logged_in_user_guid();
// check for admin
if ($user_guid && elgg_is_admin_user($user_guid)) {
@@ -951,4 +951,4 @@ elgg_register_event_handler('init', 'system', 'access_init', 9999);
// For overrided permissions
elgg_register_plugin_hook_handler('permissions_check', 'all', 'elgg_override_permissions_hook');
-elgg_register_plugin_hook_handler('container_permissions_check', 'all', 'elgg_override_permissions_hook'); \ No newline at end of file
+elgg_register_plugin_hook_handler('container_permissions_check', 'all', 'elgg_override_permissions_hook');
diff --git a/engine/lib/actions.php b/engine/lib/actions.php
index a93617df9..4538eda0b 100644
--- a/engine/lib/actions.php
+++ b/engine/lib/actions.php
@@ -86,8 +86,8 @@ function action($action, $forwarder = "") {
}
if (isset($CONFIG->actions[$action])) {
- if (isadminloggedin() || ($CONFIG->actions[$action]['access'] !== 'admin')) {
- if (isloggedin() || ($CONFIG->actions[$action]['access'] === 'public')) {
+ if (elgg_is_admin_logged_in() || ($CONFIG->actions[$action]['access'] !== 'admin')) {
+ if (elgg_is_logged_in() || ($CONFIG->actions[$action]['access'] === 'public')) {
// Trigger action event
// @todo This is only called before the primary action is called.
@@ -433,4 +433,4 @@ function ajax_action_hook() {
}
}
-elgg_register_event_handler('init', 'system', 'actions_init'); \ No newline at end of file
+elgg_register_event_handler('init', 'system', 'actions_init');
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php
index 035c5e705..f43c13c87 100644
--- a/engine/lib/annotations.php
+++ b/engine/lib/annotations.php
@@ -69,7 +69,7 @@ $owner_guid, $access_id = ACCESS_PRIVATE) {
$owner_guid = (int)$owner_guid;
if ($owner_guid == 0) {
- $owner_guid = get_loggedin_userid();
+ $owner_guid = elgg_get_logged_in_user_guid();
}
$access_id = (int)$access_id;
@@ -133,7 +133,7 @@ function update_annotation($annotation_id, $name, $value, $value_type, $owner_gu
$owner_guid = (int)$owner_guid;
if ($owner_guid == 0) {
- $owner_guid = get_loggedin_userid();
+ $owner_guid = elgg_get_logged_in_user_guid();
}
$access_id = (int)$access_id;
@@ -941,7 +941,7 @@ function get_annotation_url($id) {
function elgg_annotation_exists($entity_guid, $annotation_type, $owner_guid = NULL) {
global $CONFIG;
- if (!$owner_guid && !($owner_guid = get_loggedin_userid())) {
+ if (!$owner_guid && !($owner_guid = elgg_get_logged_in_user_guid())) {
return FALSE;
}
diff --git a/engine/lib/calendar.php b/engine/lib/calendar.php
index 6ee9980e5..a882aedbe 100644
--- a/engine/lib/calendar.php
+++ b/engine/lib/calendar.php
@@ -558,4 +558,4 @@ $fullview = true, $listtypetoggle = false, $navigation = true) {
return list_notable_entities($day_start, $day_end, $type, $subtype, $owner_guid, $limit,
$fullview, $listtypetoggle, $navigation);
-} \ No newline at end of file
+}
diff --git a/engine/lib/configuration.php b/engine/lib/configuration.php
index 192959896..05a5adcc4 100644
--- a/engine/lib/configuration.php
+++ b/engine/lib/configuration.php
@@ -589,4 +589,4 @@ function configuration_boot() {
get_all_config();
}
-elgg_register_event_handler('boot', 'system', 'configuration_boot', 10); \ No newline at end of file
+elgg_register_event_handler('boot', 'system', 'configuration_boot', 10);
diff --git a/engine/lib/cron.php b/engine/lib/cron.php
index ff57a41f1..f216e0b2d 100644
--- a/engine/lib/cron.php
+++ b/engine/lib/cron.php
@@ -88,4 +88,4 @@ function cron_public_pages($hook, $type, $return_value, $params) {
return $return_value;
}
-elgg_register_event_handler('init', 'system', 'cron_init'); \ No newline at end of file
+elgg_register_event_handler('init', 'system', 'cron_init');
diff --git a/engine/lib/database.php b/engine/lib/database.php
index 5f5380002..b2cc5ca29 100644
--- a/engine/lib/database.php
+++ b/engine/lib/database.php
@@ -759,4 +759,4 @@ function sanitize_int($int) {
/**
* @elgg_register_event boot system init_db
*/
-elgg_register_event_handler('boot', 'system', 'init_db', 0); \ No newline at end of file
+elgg_register_event_handler('boot', 'system', 'init_db', 0);
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index 3ab53c678..bc097e4ab 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -424,7 +424,7 @@ function update_entity($guid, $owner_guid, $access_id, $container_guid = null) {
* A plugin hook container_permissions_check:$entity_type is emitted to allow granular
* access controls in plugins.
*
- * @param int $user_guid The user guid, or 0 for get_loggedin_userid()
+ * @param int $user_guid The user guid, or 0 for elgg_get_logged_in_user_guid()
* @param int $container_guid The container, or 0 for the current page owner.
* @param string $type The type of entity we're looking to write
* @param string $subtype The subtype of the entity we're looking to write
@@ -436,7 +436,7 @@ function can_write_to_container($user_guid = 0, $container_guid = 0, $type = 'al
$user_guid = (int)$user_guid;
$user = get_entity($user_guid);
if (!$user) {
- $user = get_loggedin_user();
+ $user = elgg_get_logged_in_user_entity();
}
$container_guid = (int)$container_guid;
@@ -513,7 +513,7 @@ $container_guid = 0) {
$container_guid = $owner_guid;
}
- $user = get_loggedin_user();
+ $user = elgg_get_logged_in_user_entity();
if (!can_write_to_container($user->guid, $owner_guid, $type, $subtype)) {
return false;
}
@@ -1317,7 +1317,7 @@ function disable_entity($guid, $reason = "", $recursive = true) {
// @todo Do this better.
static $__RECURSIVE_DELETE_TOKEN;
// Make it slightly harder to guess
- $__RECURSIVE_DELETE_TOKEN = md5(get_loggedin_userid());
+ $__RECURSIVE_DELETE_TOKEN = md5(elgg_get_logged_in_user_guid());
$sub_entities = get_data("SELECT * from {$CONFIG->dbprefix}entities
WHERE container_guid=$guid
@@ -1423,7 +1423,7 @@ function delete_entity($guid, $recursive = true) {
// @todo Do this better.
static $__RECURSIVE_DELETE_TOKEN;
// Make it slightly harder to guess
- $__RECURSIVE_DELETE_TOKEN = md5(get_loggedin_userid());
+ $__RECURSIVE_DELETE_TOKEN = md5(elgg_get_logged_in_user_guid());
$sub_entities = get_data("SELECT * from {$CONFIG->dbprefix}entities
WHERE container_guid=$guid
@@ -1693,7 +1693,7 @@ function can_edit_entity($entity_guid, $user_guid = 0) {
$user_guid = (int)$user_guid;
$user = get_entity($user_guid);
if (!$user) {
- $user = get_loggedin_user();
+ $user = elgg_get_logged_in_user_entity();
}
$return = false;
@@ -2060,8 +2060,8 @@ function elgg_list_registered_entities($options) {
function recursive_delete_permissions_check() {
static $__RECURSIVE_DELETE_TOKEN;
- if ((isloggedin()) && ($__RECURSIVE_DELETE_TOKEN)
- && (strcmp($__RECURSIVE_DELETE_TOKEN, md5(get_loggedin_userid())))) {
+ if ((elgg_is_logged_in()) && ($__RECURSIVE_DELETE_TOKEN)
+ && (strcmp($__RECURSIVE_DELETE_TOKEN, md5(elgg_get_logged_in_user_guid())))) {
return true;
}
diff --git a/engine/lib/extender.php b/engine/lib/extender.php
index 8df207767..f0fc98d12 100644
--- a/engine/lib/extender.php
+++ b/engine/lib/extender.php
@@ -122,14 +122,14 @@ function import_extender_plugin_hook($hook, $entity_type, $returnvalue, $params)
* @return true|false
*/
function can_edit_extender($extender_id, $type, $user_guid = 0) {
- if (!isloggedin()) {
+ if (!elgg_is_logged_in()) {
return false;
}
$user_guid = (int)$user_guid;
$user = get_entity($user_guid);
if (!$user) {
- $user = get_loggedin_user();
+ $user = elgg_get_logged_in_user_entity();
}
$functionname = "get_{$type}";
@@ -236,4 +236,4 @@ function get_extender_url(ElggExtender $extender) {
}
/** Register the hook */
-elgg_register_plugin_hook_handler("import", "all", "import_extender_plugin_hook", 2); \ No newline at end of file
+elgg_register_plugin_hook_handler("import", "all", "import_extender_plugin_hook", 2);
diff --git a/engine/lib/filestore.php b/engine/lib/filestore.php
index 6f912599a..1e257c8b0 100644
--- a/engine/lib/filestore.php
+++ b/engine/lib/filestore.php
@@ -508,4 +508,4 @@ function filestore_test($hook, $type, $value, $params) {
elgg_register_event_handler('init', 'system', 'filestore_init', 100);
// Unit testing
-elgg_register_plugin_hook_handler('unit_test', 'system', 'filestore_test'); \ No newline at end of file
+elgg_register_plugin_hook_handler('unit_test', 'system', 'filestore_test');
diff --git a/engine/lib/group.php b/engine/lib/group.php
index 7b3f76e27..f3314ada6 100644
--- a/engine/lib/group.php
+++ b/engine/lib/group.php
@@ -261,14 +261,14 @@ function group_gatekeeper($forward = true) {
if ($group instanceof ElggGroup) {
$url = $group->getURL();
if (
- ((!isloggedin()) && (!$group->isPublicMembership())) ||
- ((!$group->isMember(get_loggedin_user()) && (!$group->isPublicMembership())))
+ ((!elgg_is_logged_in()) && (!$group->isPublicMembership())) ||
+ ((!$group->isMember(elgg_get_logged_in_user_entity()) && (!$group->isPublicMembership())))
) {
$allowed = false;
}
// Admin override
- if (isadminloggedin()) {
+ if (elgg_is_admin_logged_in()) {
$allowed = true;
}
}
diff --git a/engine/lib/input.php b/engine/lib/input.php
index b5bf4eea5..624c6111e 100644
--- a/engine/lib/input.php
+++ b/engine/lib/input.php
@@ -204,7 +204,7 @@ function elgg_clear_sticky_value($form_name, $variable) {
function input_livesearch_page_handler($page) {
global $CONFIG;
// only return results to logged in users.
- if (!$user = get_loggedin_user()) {
+ if (!$user = elgg_get_logged_in_user_entity()) {
exit;
}
diff --git a/engine/lib/languages.php b/engine/lib/languages.php
index 16169282d..7607ea3bf 100644
--- a/engine/lib/languages.php
+++ b/engine/lib/languages.php
@@ -64,7 +64,7 @@ function get_current_language() {
function get_language() {
global $CONFIG;
- $user = get_loggedin_user();
+ $user = elgg_get_logged_in_user_entity();
$language = false;
if (($user) && ($user->language)) {
@@ -230,7 +230,7 @@ function get_installed_translations() {
foreach ($CONFIG->translations as $k => $v) {
$installed[$k] = elgg_echo($k, array(), $k);
- if (isadminloggedin()) {
+ if (elgg_is_admin_logged_in()) {
$completeness = get_language_completeness($k);
if (($completeness < 100) && ($k != 'en')) {
$installed[$k] .= " (" . $completeness . "% " . elgg_echo('complete') . ")";
@@ -301,4 +301,4 @@ function get_missing_language_keys($language) {
return false;
}
-register_translations(dirname(dirname(dirname(__FILE__))) . "/languages/"); \ No newline at end of file
+register_translations(dirname(dirname(dirname(__FILE__))) . "/languages/");
diff --git a/engine/lib/mb_wrapper.php b/engine/lib/mb_wrapper.php
index da7a96c1f..c2f5503e0 100644
--- a/engine/lib/mb_wrapper.php
+++ b/engine/lib/mb_wrapper.php
@@ -230,4 +230,4 @@ function elgg_substr() {
return call_user_func_array('mb_substr', $args);
}
return call_user_func_array('substr', $args);
-} \ No newline at end of file
+}
diff --git a/engine/lib/memcache.php b/engine/lib/memcache.php
index 6e905b0d4..f79fba4a9 100644
--- a/engine/lib/memcache.php
+++ b/engine/lib/memcache.php
@@ -34,4 +34,4 @@ function is_memcache_available() {
}
return $memcache_available;
-} \ No newline at end of file
+}
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php
index 79bb774f8..6204e0461 100644
--- a/engine/lib/metadata.php
+++ b/engine/lib/metadata.php
@@ -118,7 +118,7 @@ function create_metadata($entity_guid, $name, $value, $value_type, $owner_guid,
}
if ($owner_guid == 0) {
- $owner_guid = get_loggedin_userid();
+ $owner_guid = elgg_get_logged_in_user_guid();
}
$access_id = (int)$access_id;
@@ -215,7 +215,7 @@ function update_metadata($id, $name, $value, $value_type, $owner_guid, $access_i
$owner_guid = (int)$owner_guid;
if ($owner_guid == 0) {
- $owner_guid = get_loggedin_userid();
+ $owner_guid = elgg_get_logged_in_user_guid();
}
$access_id = (int)$access_id;
diff --git a/engine/lib/metastrings.php b/engine/lib/metastrings.php
index 229adb0ed..28f8475da 100644
--- a/engine/lib/metastrings.php
+++ b/engine/lib/metastrings.php
@@ -199,4 +199,4 @@ function delete_orphaned_metastrings() {
)";
return delete_data($query);
-} \ No newline at end of file
+}
diff --git a/engine/lib/notification.php b/engine/lib/notification.php
index 44539d8b5..841920d8b 100644
--- a/engine/lib/notification.php
+++ b/engine/lib/notification.php
@@ -170,7 +170,7 @@ function get_user_notification_settings($user_guid = 0) {
$user_guid = (int)$user_guid;
if ($user_guid == 0) {
- $user_guid = get_loggedin_userid();
+ $user_guid = elgg_get_logged_in_user_guid();
}
$all_metadata = get_metadata_for_entity($user_guid);
@@ -208,7 +208,7 @@ function set_user_notification_setting($user_guid, $method, $value) {
$user = get_entity($user_guid);
if (!$user) {
- $user = get_loggedin_user();
+ $user = elgg_get_logged_in_user_entity();
}
if (($user) && ($user instanceof ElggUser)) {
@@ -513,4 +513,4 @@ function object_notifications($event, $object_type, $object) {
// Register a startup event
elgg_register_event_handler('init', 'system', 'notification_init', 0);
-elgg_register_event_handler('create', 'object', 'object_notifications'); \ No newline at end of file
+elgg_register_event_handler('create', 'object', 'object_notifications');
diff --git a/engine/lib/objects.php b/engine/lib/objects.php
index 074a638d9..8819a1094 100644
--- a/engine/lib/objects.php
+++ b/engine/lib/objects.php
@@ -134,4 +134,4 @@ function objects_test($hook, $type, $value, $params) {
}
elgg_register_event_handler('init', 'system', 'objects_init', 0);
-elgg_register_plugin_hook_handler('unit_test', 'system', 'objects_test'); \ No newline at end of file
+elgg_register_plugin_hook_handler('unit_test', 'system', 'objects_test');
diff --git a/engine/lib/opendd.php b/engine/lib/opendd.php
index d856806f5..69977d1d9 100644
--- a/engine/lib/opendd.php
+++ b/engine/lib/opendd.php
@@ -99,4 +99,4 @@ function ODD_Import($xml) {
*/
function ODD_Export(ODDDocument $document) {
return "$document";
-} \ No newline at end of file
+}
diff --git a/engine/lib/pageowner.php b/engine/lib/pageowner.php
index f8b23b6a9..3f0c58a5d 100644
--- a/engine/lib/pageowner.php
+++ b/engine/lib/pageowner.php
@@ -213,4 +213,4 @@ function page_owner_boot() {
$CONFIG->context = array('main');
}
-elgg_register_event_handler('boot', 'system', 'page_owner_boot'); \ No newline at end of file
+elgg_register_event_handler('boot', 'system', 'page_owner_boot');
diff --git a/engine/lib/pam.php b/engine/lib/pam.php
index 37e709a8a..308d4d291 100644
--- a/engine/lib/pam.php
+++ b/engine/lib/pam.php
@@ -110,4 +110,4 @@ function pam_authenticate($credentials = NULL, $policy = "user") {
}
return $authenticated;
-} \ No newline at end of file
+}
diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php
index 8d6daef6e..85f821315 100644
--- a/engine/lib/plugins.php
+++ b/engine/lib/plugins.php
@@ -775,7 +775,7 @@ function find_plugin_usersettings($plugin_id = null, $user_guid = 0) {
}
if ($user_guid == 0) {
- $user_guid = get_loggedin_userid();
+ $user_guid = elgg_get_logged_in_user_guid();
}
// Get private settings for user
@@ -825,7 +825,7 @@ function set_plugin_usersetting($name, $value, $user_guid = 0, $plugin_id = "")
$user = get_entity($user_guid);
if (!$user) {
- $user = get_loggedin_user();
+ $user = elgg_get_logged_in_user_entity();
}
if (($user) && ($user instanceof ElggUser)) {
@@ -864,7 +864,7 @@ function clear_plugin_usersetting($name, $user_guid = 0, $plugin_id = '') {
$user = get_entity((int) $user_guid);
if (!$user) {
- $user = get_loggedin_user();
+ $user = elgg_get_logged_in_user_entity();
}
if (($user) && ($user instanceof ElggUser)) {
@@ -897,7 +897,7 @@ function get_plugin_usersetting($name, $user_guid = 0, $plugin_id = "") {
$user = get_entity($user_guid);
if (!$user) {
- $user = get_loggedin_user();
+ $user = elgg_get_logged_in_user_entity();
}
if (($user) && ($user instanceof ElggUser)) {
@@ -1048,4 +1048,4 @@ function plugin_init() {
elgg_register_action('admin/plugins/set_priority', '', 'admin');
}
-elgg_register_event_handler('init', 'system', 'plugin_init'); \ No newline at end of file
+elgg_register_event_handler('init', 'system', 'plugin_init');
diff --git a/engine/lib/river.php b/engine/lib/river.php
index fd6e97b12..2c8925393 100644
--- a/engine/lib/river.php
+++ b/engine/lib/river.php
@@ -513,7 +513,7 @@ function update_river_access_by_object($object_guid, $access_id) {
function elgg_river_page_handler($page) {
global $CONFIG;
- elgg_set_page_owner_guid(get_loggedin_userid());
+ elgg_set_page_owner_guid(elgg_get_logged_in_user_guid());
$page_type = elgg_get_array_value(0, $page, 'all');
if ($page_type == 'owner') {
diff --git a/engine/lib/sessions.php b/engine/lib/sessions.php
index d91ede9f5..3a1648d3f 100644
--- a/engine/lib/sessions.php
+++ b/engine/lib/sessions.php
@@ -469,7 +469,7 @@ function session_init($event, $object_type, $object) {
* @return void
*/
function gatekeeper() {
- if (!isloggedin()) {
+ if (!elgg_is_logged_in()) {
$_SESSION['last_forward_from'] = current_page_url();
register_error(elgg_echo('loggedinrequired'));
forward('', 'login');
@@ -484,7 +484,7 @@ function gatekeeper() {
function admin_gatekeeper() {
gatekeeper();
- if (!isadminloggedin()) {
+ if (!elgg_is_admin_logged_in()) {
$_SESSION['last_forward_from'] = current_page_url();
register_error(elgg_echo('adminrequired'));
forward('', 'admin');
diff --git a/engine/lib/statistics.php b/engine/lib/statistics.php
index 578985fd0..4e822e8af 100644
--- a/engine/lib/statistics.php
+++ b/engine/lib/statistics.php
@@ -115,4 +115,4 @@ function statistics_init() {
}
/// Register init function
-elgg_register_event_handler('init', 'system', 'statistics_init'); \ No newline at end of file
+elgg_register_event_handler('init', 'system', 'statistics_init');
diff --git a/engine/lib/system_log.php b/engine/lib/system_log.php
index 1578ebeba..21e119b7c 100644
--- a/engine/lib/system_log.php
+++ b/engine/lib/system_log.php
@@ -163,7 +163,7 @@ function system_log($object, $event) {
$object_subtype = $object->getSubtype();
$event = sanitise_string($event);
$time = time();
- $performed_by = get_loggedin_userid();
+ $performed_by = elgg_get_logged_in_user_guid();
if (isset($object->access_id)) {
$access_id = $object->access_id;
@@ -274,4 +274,4 @@ function system_log_listener($event, $object_type, $object) {
elgg_register_event_handler('all', 'all', 'system_log_listener', 400);
/** Register a default system log handler */
-elgg_register_event_handler('log', 'systemlog', 'system_log_default_logger', 999); \ No newline at end of file
+elgg_register_event_handler('log', 'systemlog', 'system_log_default_logger', 999);
diff --git a/engine/lib/upgrades/2008100701.php b/engine/lib/upgrades/2008100701.php
index 394a90046..38837f81d 100644
--- a/engine/lib/upgrades/2008100701.php
+++ b/engine/lib/upgrades/2008100701.php
@@ -4,4 +4,4 @@
* Because Elgg now has a plugable account activation process we need to activate
* the email account activation plugin for existing installs.
*/
- enable_plugin('uservalidationbyemail', $CONFIG->site->guid); \ No newline at end of file
+ enable_plugin('uservalidationbyemail', $CONFIG->site->guid);
diff --git a/engine/lib/upgrades/2009022701.php b/engine/lib/upgrades/2009022701.php
index 2e83b56b3..293e9fb99 100644
--- a/engine/lib/upgrades/2009022701.php
+++ b/engine/lib/upgrades/2009022701.php
@@ -4,4 +4,4 @@
/**
* Disable update client since this has now been removed.
*/
- disable_plugin('updateclient', $CONFIG->site->guid); \ No newline at end of file
+ disable_plugin('updateclient', $CONFIG->site->guid);
diff --git a/engine/lib/upgrades/2009041701.php b/engine/lib/upgrades/2009041701.php
index acc8fc0bd..2d3d612c3 100644
--- a/engine/lib/upgrades/2009041701.php
+++ b/engine/lib/upgrades/2009041701.php
@@ -6,4 +6,4 @@
/**
* Elgg now has kses tag filtering built as a plugin. This needs to be enabled.
*/
- enable_plugin('kses', $CONFIG->site->guid); \ No newline at end of file
+ enable_plugin('kses', $CONFIG->site->guid);
diff --git a/engine/lib/upgrades/2009070101.php b/engine/lib/upgrades/2009070101.php
index 3bf89e9b7..a72d6ea95 100644
--- a/engine/lib/upgrades/2009070101.php
+++ b/engine/lib/upgrades/2009070101.php
@@ -7,4 +7,4 @@
* Kses appears to be a dead project so we are deprecating it in favour of htmlawed.
*/
disable_plugin('kses', $CONFIG->site->guid);
- enable_plugin('htmlawed', $CONFIG->site->guid); \ No newline at end of file
+ enable_plugin('htmlawed', $CONFIG->site->guid);
diff --git a/engine/lib/upgrades/2010033101.php b/engine/lib/upgrades/2010033101.php
index 5c8ee036b..3265f4e61 100644
--- a/engine/lib/upgrades/2010033101.php
+++ b/engine/lib/upgrades/2010033101.php
@@ -66,4 +66,4 @@ if ($dbversion < 2009100701) {
}
}
}
-} \ No newline at end of file
+}
diff --git a/engine/lib/upgrades/2010040201.php b/engine/lib/upgrades/2010040201.php
index 22eee15f8..92c7d6a5c 100644
--- a/engine/lib/upgrades/2010040201.php
+++ b/engine/lib/upgrades/2010040201.php
@@ -37,4 +37,4 @@ $qs[] = "DELETE FROM {$CONFIG->dbprefix}metadata
foreach ($qs as $q) {
update_data($q);
-} \ No newline at end of file
+}
diff --git a/engine/lib/upgrades/2010061501.php b/engine/lib/upgrades/2010061501.php
index d230236fc..550489e4d 100644
--- a/engine/lib/upgrades/2010061501.php
+++ b/engine/lib/upgrades/2010061501.php
@@ -71,4 +71,4 @@ if ($dbversion < 2009100701) {
}
}
}
-} \ No newline at end of file
+}
diff --git a/engine/lib/upgrades/2010121401.php b/engine/lib/upgrades/2010121401.php
index 30e4dff32..9619dd655 100644
--- a/engine/lib/upgrades/2010121401.php
+++ b/engine/lib/upgrades/2010121401.php
@@ -4,4 +4,4 @@ global $CONFIG;
/**
* Disable members plugin as it has been moved into core.
*/
-disable_plugin('members', $CONFIG->site->guid); \ No newline at end of file
+disable_plugin('members', $CONFIG->site->guid);
diff --git a/engine/lib/upgrades/2011010101.php b/engine/lib/upgrades/2011010101.php
index eac5810c4..bb1290854 100644
--- a/engine/lib/upgrades/2011010101.php
+++ b/engine/lib/upgrades/2011010101.php
@@ -72,4 +72,4 @@ elgg_filepath_cache_reset();
remove_metadata($site->guid, 'pluginorder');
remove_metadata($site->guid, 'enabled_plugins');
-elgg_set_ignore_access($old_id); \ No newline at end of file
+elgg_set_ignore_access($old_id);
diff --git a/engine/lib/users.php b/engine/lib/users.php
index be7399a44..4d388d574 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -1100,7 +1100,7 @@ function elgg_get_user_validation_status($user_guid) {
*/
function collections_submenu_items() {
- $user = get_loggedin_user();
+ $user = elgg_get_logged_in_user_entity();
elgg_register_menu_item('page', array(
'name' => 'friends:collections',
@@ -1126,7 +1126,7 @@ function friends_page_handler($page_elements) {
if (isset($page_elements[0]) && $user = get_user_by_username($page_elements[0])) {
set_page_owner($user->getGUID());
}
- if (get_loggedin_userid() == elgg_get_page_owner_guid()) {
+ if (elgg_get_logged_in_user_guid() == elgg_get_page_owner_guid()) {
// disabled for now as we no longer use friends collections (replaced by shared access)
// collections_submenu_items();
}
@@ -1145,7 +1145,7 @@ function friends_of_page_handler($page_elements) {
if (isset($page_elements[0]) && $user = get_user_by_username($page_elements[0])) {
set_page_owner($user->getGUID());
}
- if (get_loggedin_userid() == elgg_get_page_owner_guid()) {
+ if (elgg_get_logged_in_user_guid() == elgg_get_page_owner_guid()) {
// disabled for now as we no longer use friends collections (replaced by shared access)
// collections_submenu_items();
}
@@ -1162,13 +1162,13 @@ function friends_of_page_handler($page_elements) {
function collections_page_handler($page_elements) {
if (isset($page_elements[0])) {
if ($page_elements[0] == "add") {
- set_page_owner(get_loggedin_userid());
+ set_page_owner(elgg_get_logged_in_user_guid());
collections_submenu_items();
require_once(dirname(dirname(dirname(__FILE__))) . "/pages/friends/add.php");
} else {
if ($user = get_user_by_username($page_elements[0])) {
set_page_owner($user->getGUID());
- if (get_loggedin_userid() == elgg_get_page_owner_guid()) {
+ if (elgg_get_logged_in_user_guid() == elgg_get_page_owner_guid()) {
collections_submenu_items();
}
require_once(dirname(dirname(dirname(__FILE__))) . "/pages/friends/collections.php");
@@ -1293,8 +1293,8 @@ function user_avatar_hook($hook, $entity_type, $returnvalue, $params) {
function elgg_user_hover_menu($hook, $type, $return, $params) {
$user = $params['entity'];
- if (isloggedin()) {
- if (get_loggedin_userid() != $user->guid) {
+ if (elgg_is_logged_in()) {
+ if (elgg_get_logged_in_user_guid() != $user->guid) {
if ($user->isFriend()) {
$url = "action/friends/remove?friend={$user->guid}";
$text = elgg_echo('friend:remove');
@@ -1320,11 +1320,11 @@ function elgg_user_hover_menu($hook, $type, $return, $params) {
}
// prevent admins from banning or deleting themselves
- if (get_loggedin_userid() == $user->guid) {
+ if (elgg_get_logged_in_user_guid() == $user->guid) {
return $return;
}
- if (isadminloggedin()) {
+ if (elgg_is_admin_logged_in()) {
$actions = array();
if (!$user->isBanned()) {
$actions[] = 'ban';
@@ -1517,7 +1517,7 @@ function users_init() {
$item = new ElggMenuItem('members', elgg_echo('members'), 'pg/members');
elgg_register_menu_item('site', $item);
- $user = get_loggedin_user();
+ $user = elgg_get_logged_in_user_entity();
if ($user) {
$params = array(
'name' => 'edit_avatar',
@@ -1610,4 +1610,4 @@ function users_test($hook, $type, $value, $params) {
elgg_register_event_handler('init', 'system', 'users_init', 0);
elgg_register_event_handler('init', 'system', 'elgg_profile_fields_setup', 10000); // Ensure this runs after other plugins
elgg_register_event_handler('pagesetup', 'system', 'users_pagesetup', 0);
-elgg_register_plugin_hook_handler('unit_test', 'system', 'users_test'); \ No newline at end of file
+elgg_register_plugin_hook_handler('unit_test', 'system', 'users_test');
diff --git a/engine/lib/usersettings.php b/engine/lib/usersettings.php
index a7181626d..f74c01975 100644
--- a/engine/lib/usersettings.php
+++ b/engine/lib/usersettings.php
@@ -13,8 +13,8 @@
* @return void
*/
function usersettings_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' => '1_account',
@@ -68,7 +68,7 @@ function usersettings_page_handler($page) {
$user = get_user_by_username($page[1]);
elgg_set_page_owner_guid($user->guid);
} else {
- elgg_set_page_owner_guid(get_loggedin_userid());
+ elgg_set_page_owner_guid(elgg_get_logged_in_user_guid());
}
require($path);
@@ -86,4 +86,4 @@ function usersettings_init() {
/// Register init function
elgg_register_event_handler('init', 'system', 'usersettings_init');
-elgg_register_event_handler('pagesetup', 'system', 'usersettings_pagesetup'); \ No newline at end of file
+elgg_register_event_handler('pagesetup', 'system', 'usersettings_pagesetup');
diff --git a/engine/lib/views.php b/engine/lib/views.php
index 21409bab4..9ad8fc347 100644
--- a/engine/lib/views.php
+++ b/engine/lib/views.php
@@ -323,7 +323,7 @@ function elgg_view_exists($view, $viewtype = '', $recurse = true) {
* recommend that you do not use them:
* - $vars['config'] The $CONFIG global. (Use {@link elgg_get_config()} instead).
* - $vars['url'] The site URL. (use {@link elgg_get_site_url()} instead).
- * - $vars['user'] The logged in user. (use {@link get_loggedin_user()} instead).
+ * - $vars['user'] The logged in user. (use {@link elgg_get_logged_in_user_entity()} instead).
*
* Custom template handlers can be set with {@link set_template_handler()}.
*
@@ -382,10 +382,10 @@ function elgg_view($view, $vars = array(), $bypass = false, $debug = false, $vie
}
// @warning - plugin authors: do not expect user, config, and url to be
- // set by elgg_view() in the future. Instead, use get_loggedin_user(),
+ // set by elgg_view() in the future. Instead, use elgg_get_logged_in_user_entity(),
// elgg_get_config(), and elgg_get_site_url() in your views.
if (!isset($vars['user'])) {
- $vars['user'] = get_loggedin_user();
+ $vars['user'] = elgg_get_logged_in_user_entity();
}
if (!isset($vars['config'])) {
$vars['config'] = $CONFIG;
@@ -1658,4 +1658,4 @@ function elgg_views_boot() {
}
}
-elgg_register_event_handler('boot', 'system', 'elgg_views_boot', 1000); \ No newline at end of file
+elgg_register_event_handler('boot', 'system', 'elgg_views_boot', 1000);
diff --git a/engine/lib/web_services.php b/engine/lib/web_services.php
index e70359fa8..8e312209b 100644
--- a/engine/lib/web_services.php
+++ b/engine/lib/web_services.php
@@ -825,7 +825,7 @@ function pam_auth_usertoken() {
* @return bool
*/
function pam_auth_session() {
- return isloggedin();
+ return elgg_is_logged_in();
}
// user token functions
diff --git a/engine/lib/widgets.php b/engine/lib/widgets.php
index c96c1967a..1b0bc207b 100644
--- a/engine/lib/widgets.php
+++ b/engine/lib/widgets.php
@@ -11,7 +11,7 @@
* Get widgets for a particular context
*
* The widgets are ordered for display and grouped in columns.
- * $widgets = elgg_get_widgets(get_loggedin_userid(), 'dashboard');
+ * $widgets = elgg_get_widgets(elgg_get_logged_in_user_guid(), 'dashboard');
* $first_column_widgets = $widgets[1];
*
* @param int $user_guid The owner user GUID
@@ -103,11 +103,11 @@ function elgg_can_edit_widget_layout($context, $user_guid = 0) {
$user = get_entity((int)$user_guid);
if (!$user) {
- $user = get_loggedin_user();
+ $user = elgg_get_logged_in_user_entity();
}
$return = false;
- if (isadminloggedin()) {
+ if (elgg_is_admin_logged_in()) {
$return = true;
}
if (elgg_get_page_owner_guid() == $user->guid) {