aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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();