aboutsummaryrefslogtreecommitdiff
path: root/mod/bookmarks
diff options
context:
space:
mode:
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-30 21:32:54 +0000
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-30 21:32:54 +0000
commitf49fdf4e1c80fe5bde922c25bdd6ca0e2c912ddb (patch)
treeeb2fdb272ba76e83af60378d05602a26a265be36 /mod/bookmarks
parent9ebb6cff1cf22d4fb708c4ced37604c6cf5bbfae (diff)
downloadelgg-f49fdf4e1c80fe5bde922c25bdd6ca0e2c912ddb.tar.gz
elgg-f49fdf4e1c80fe5bde922c25bdd6ca0e2c912ddb.tar.bz2
Refs #2124: Using get_loggedin_user functions instead of $vars['user'], $_SESSION['user'], etc.
git-svn-id: http://code.elgg.org/elgg/trunk@7139 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/bookmarks')
-rw-r--r--mod/bookmarks/actions/add.php8
-rw-r--r--mod/bookmarks/bookmarklet.php4
-rw-r--r--mod/bookmarks/views/default/bookmarks/form.php2
3 files changed, 7 insertions, 7 deletions
diff --git a/mod/bookmarks/actions/add.php b/mod/bookmarks/actions/add.php
index 5b0ce91c4..e633244c1 100644
--- a/mod/bookmarks/actions/add.php
+++ b/mod/bookmarks/actions/add.php
@@ -23,8 +23,8 @@ if (!$title || !$address) {
//create a new bookmark object
$entity = new ElggObject;
$entity->subtype = "bookmarks";
-$entity->owner_guid = get_loggedin_user()->getGUID();
-$entity->container_guid = (int)get_input('container_guid', get_loggedin_user()->getGUID());
+$entity->owner_guid = get_loggedin_userid();
+$entity->container_guid = (int)get_input('container_guid', get_loggedin_userid());
$entity->title = $title;
$entity->description = $notes;
$entity->address = $address;
@@ -35,9 +35,9 @@ $entity->tags = $tagarray;
if ($entity->save()) {
system_message(elgg_echo('bookmarks:save:success'));
//add to river
- add_to_river('river/object/bookmarks/create','create',$_SESSION['user']->guid,$entity->guid);
+ add_to_river('river/object/bookmarks/create','create',get_loggedin_userid(),$entity->guid);
} else {
register_error(elgg_echo('bookmarks:save:failed'));
}
-$account = get_entity((int)get_input('container_guid', get_loggedin_user()->getGUID()));
+$account = get_entity((int)get_input('container_guid', get_loggedin_userid()));
forward("pg/bookmarks/" . $account->username); \ No newline at end of file
diff --git a/mod/bookmarks/bookmarklet.php b/mod/bookmarks/bookmarklet.php
index e71797026..e1ff3c6df 100644
--- a/mod/bookmarks/bookmarklet.php
+++ b/mod/bookmarks/bookmarklet.php
@@ -13,8 +13,8 @@ gatekeeper();
// Get the current page's owner
$page_owner = page_owner_entity();
-if ($page_owner === false || is_null($page_owner) && ($_SESSION['user'])) {
- $page_owner = $_SESSION['user'];
+if ($page_owner === false || is_null($page_owner) && (get_loggedin_user())) {
+ $page_owner = get_loggedin_user();
set_page_owner($page_owner->getGUID());
}
diff --git a/mod/bookmarks/views/default/bookmarks/form.php b/mod/bookmarks/views/default/bookmarks/form.php
index a49fcc088..b779116fd 100644
--- a/mod/bookmarks/views/default/bookmarks/form.php
+++ b/mod/bookmarks/views/default/bookmarks/form.php
@@ -31,7 +31,7 @@ if(isset($vars['entity'])){
}else{
$access_id = get_default_access(get_loggedin_user());
}
- $owner = $vars['user'];
+ $owner = get_loggedin_user();
$url = "action/bookmarks/add";
}
?>