aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-02 09:44:44 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-02 09:44:44 +0000
commite976f9d6bb16b0c64767ce2aee82b332e7ecfc98 (patch)
treed54c48cf7695f3c14fe1dd4d7811092a5c84c3e7 /engine/lib
parente0d9fa933f8e33ff65492876c4bbbe7c93e9e2f4 (diff)
downloadelgg-e976f9d6bb16b0c64767ce2aee82b332e7ecfc98.tar.gz
elgg-e976f9d6bb16b0c64767ce2aee82b332e7ecfc98.tar.bz2
Smaller version of previous
git-svn-id: https://code.elgg.org/elgg/trunk@329 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/pageowner.php46
1 files changed, 5 insertions, 41 deletions
diff --git a/engine/lib/pageowner.php b/engine/lib/pageowner.php
index 9d6231082..4ab3d2334 100644
--- a/engine/lib/pageowner.php
+++ b/engine/lib/pageowner.php
@@ -54,28 +54,11 @@
function page_owner_entity() {
global $CONFIG;
- if ($username = get_input("username")) {
- if ($user = get_user_by_username($username)) {
- return $user;
- } else {
- return false;
- }
- }
- if ($owner = get_input("owner_id")) {
- if ($user = get_user($owner)) {
- return $user;
- } else {
- return false;
- }
- }
- if (!empty($CONFIG->page_owner_entity_handlers) && is_array($CONFIG->page_owner_entity_handlers)) {
- foreach($CONFIG->page_owner_entity_handlers as $handler) {
- if ($user = $handler()) {
- return $user;
- }
- }
- }
- return false;
+ $page_owner = page_owner();
+ if ($page_owner > 0)
+ return get_user($page_owner);
+
+ return false;
}
@@ -99,23 +82,4 @@
}
- /**
- * Adds a page owner entity handler - a function that will
- * return the page owner ElggUser if required
- * (Such functions are required to return false if they don't know)
- * @uses $CONFIG
- * @param string $functionname The name of the function to call
- */
- function add_page_owner_entity_handler($functionname) {
-
- global $CONFIG;
- if (empty($CONFIG->page_owner_entity_handlers)) {
- $CONFIG->page_owner_entity_handlers = array();
- }
- if (is_callable($functionname)) {
- $CONFIG->page_owner_entity_handlers[] = $functionname;
- }
-
- }
-
?> \ No newline at end of file