aboutsummaryrefslogtreecommitdiff
path: root/mod/pages
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/pages
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/pages')
-rw-r--r--mod/pages/actions/pages/edit.php8
-rw-r--r--mod/pages/edit.php2
-rw-r--r--mod/pages/new.php2
-rw-r--r--mod/pages/start.php6
-rw-r--r--mod/pages/welcome.php2
-rw-r--r--mod/pages/world.php2
6 files changed, 11 insertions, 11 deletions
diff --git a/mod/pages/actions/pages/edit.php b/mod/pages/actions/pages/edit.php
index 396dd7e42..db308b5d7 100644
--- a/mod/pages/actions/pages/edit.php
+++ b/mod/pages/actions/pages/edit.php
@@ -49,7 +49,7 @@ if ($pages_guid) {
}
// New instance, so set container_guid
- $container_guid = get_input('container_guid', $_SESSION['user']->getGUID());
+ $container_guid = get_input('container_guid', get_loggedin_userid());
$page->container_guid = $container_guid;
// cache data in session in case data from form does not validate
@@ -77,7 +77,7 @@ if ($page instanceof ElggObject) {
$page->access_id = (int)get_input('access_id', ACCESS_PRIVATE);
$page->write_access_id = (int)get_input('write_access_id', ACCESS_PRIVATE);
$page->parent_guid = $parent_guid;
- $page->owner_guid = ($page->owner_guid ? $page->owner_guid : $_SESSION['user']->guid);
+ $page->owner_guid = ($page->owner_guid ? $page->owner_guid : get_loggedin_userid());
if ($page->save()) {
@@ -94,9 +94,9 @@ if ($page instanceof ElggObject) {
//add to river
if ($which_river == 'new') {
- add_to_river('river/object/page/create','create',$_SESSION['user']->guid,$page->guid);
+ add_to_river('river/object/page/create','create',get_loggedin_userid(),$page->guid);
} else {
- add_to_river('river/object/page/update','update',$_SESSION['user']->guid,$page->guid);
+ add_to_river('river/object/page/update','update',get_loggedin_userid(),$page->guid);
}
// Forward to the user's profile
diff --git a/mod/pages/edit.php b/mod/pages/edit.php
index e7ce48e54..cc9955bc9 100644
--- a/mod/pages/edit.php
+++ b/mod/pages/edit.php
@@ -18,7 +18,7 @@ if ($container = $pages->container_guid) {
$page_owner = page_owner_entity();
if ($page_owner === false || is_null($page_owner)) {
- $page_owner = $_SESSION['user'];
+ $page_owner = get_loggedin_user();
set_page_owner($page_owner->getGUID());
}
diff --git a/mod/pages/new.php b/mod/pages/new.php
index 7c3f12e36..bf2640301 100644
--- a/mod/pages/new.php
+++ b/mod/pages/new.php
@@ -15,7 +15,7 @@ if ($container = (int) get_input('container_guid')) {
}
$page_owner = page_owner_entity();
if ($page_owner === false || is_null($page_owner)) {
- $page_owner = $_SESSION['user'];
+ $page_owner = get_loggedin_user();
set_page_owner($page_owner->getGUID());
}
diff --git a/mod/pages/start.php b/mod/pages/start.php
index 1deaec76b..80c1607a2 100644
--- a/mod/pages/start.php
+++ b/mod/pages/start.php
@@ -133,7 +133,7 @@ function pages_page_handler($page) {
$entity = get_entity($page[1]);
add_submenu_item(elgg_echo('pages:label:view'), $CONFIG->url . "pg/pages/view/{$page[1]}", 'pageslinks');
- // add_submenu_item(elgg_echo('pages:user'), $CONFIG->wwwroot . "pg/pages/owned/" . $_SESSION['user']->username, 'pageslinksgeneral');
+ // add_submenu_item(elgg_echo('pages:user'), $CONFIG->wwwroot . "pg/pages/owned/" . get_loggedin_user()->username, 'pageslinksgeneral');
if (($entity) && ($entity->canEdit())) {
add_submenu_item(elgg_echo('pages:label:edit'), $CONFIG->url . "pg/pages/edit/{$page[1]}", 'pagesactions');
}
@@ -311,7 +311,7 @@ function pages_container_permission_check($hook, $entity_type, $returnvalue, $pa
if (get_context() == "pages") {
if (page_owner()) {
- if (can_write_to_container($_SESSION['user']->guid, page_owner())) return true;
+ if (can_write_to_container(get_loggedin_userid(), page_owner())) return true;
}
if ($page_guid = get_input('page_guid',0)) {
$entity = get_entity($page_guid);
@@ -320,7 +320,7 @@ function pages_container_permission_check($hook, $entity_type, $returnvalue, $pa
}
if ($entity instanceof ElggObject) {
if (
- can_write_to_container($_SESSION['user']->guid, $entity->container_guid)
+ can_write_to_container(get_loggedin_userid(), $entity->container_guid)
|| in_array($entity->write_access_id,get_access_list())
) {
return true;
diff --git a/mod/pages/welcome.php b/mod/pages/welcome.php
index f486f646d..10628b175 100644
--- a/mod/pages/welcome.php
+++ b/mod/pages/welcome.php
@@ -17,7 +17,7 @@ if ($container = (int) get_input('container_guid')) {
$page_owner = page_owner_entity();
if ($page_owner === false || is_null($page_owner)) {
- $page_owner = $_SESSION['user'];
+ $page_owner = get_loggedin_user();
set_page_owner($page_owner->getGUID());
}
diff --git a/mod/pages/world.php b/mod/pages/world.php
index 7f32fbdec..8a8ede68d 100644
--- a/mod/pages/world.php
+++ b/mod/pages/world.php
@@ -12,7 +12,7 @@ global $CONFIG;
// Get the current page's owner
$page_owner = page_owner_entity();
if ($page_owner === false || is_null($page_owner)) {
- $page_owner = $_SESSION['user'];
+ $page_owner = get_loggedin_user();
set_page_owner($_SESSION['guid']);
}