aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-01 16:08:11 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-01 16:08:11 +0000
commit1568ff4b4e0c6e7f57a41f2d7da6f4a79cedb291 (patch)
tree7273595fe6b779036e4c4554a96eb375a4cbb48e
parent465e692b8736181c1f7ff61c5828698976c24457 (diff)
downloadelgg-1568ff4b4e0c6e7f57a41f2d7da6f4a79cedb291.tar.gz
elgg-1568ff4b4e0c6e7f57a41f2d7da6f4a79cedb291.tar.bz2
page_owner() now returns an ElggUser or false
git-svn-id: https://code.elgg.org/elgg/trunk@319 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/pageowner.php12
-rw-r--r--engine/lib/users.php2
2 files changed, 7 insertions, 7 deletions
diff --git a/engine/lib/pageowner.php b/engine/lib/pageowner.php
index af158db88..e6dfbad8b 100644
--- a/engine/lib/pageowner.php
+++ b/engine/lib/pageowner.php
@@ -22,20 +22,20 @@
global $CONFIG;
if ($username = get_input("username")) {
- $user = user_from_username($username);
- return $user->id;
+ $user = get_user_by_username($username);
+ return $user;
}
if ($owner = get_input("owner_id")) {
- return (int) $owner;
+ return get_user($owner);
}
if (!empty($CONFIG->page_owner_handlers) && is_array($CONFIG->page_owner_handlers)) {
foreach($CONFIG->page_owner_handlers as $handler) {
- if ($id = $handler()) {
- return $id;
+ if ($user = $handler()) {
+ return $user;
}
}
}
- return -1;
+ return false;
}
diff --git a/engine/lib/users.php b/engine/lib/users.php
index c371a7db2..a48170ce2 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -431,7 +431,6 @@
$username = sanitise_string($username);
$row = get_data_row("SELECT * from {$CONFIG->dbprefix}users_entity where username='$username'");
-
if ($row)
return new ElggUser($row);
@@ -490,6 +489,7 @@
$user->password = md5($password);
$user->email = $email;
$user->name = $name;
+ $register->access_id = 2;
$user->save();
return $user->getGUID();