summaryrefslogtreecommitdiffstatshomepage
path: root/src/SemanticScuttle/Service
diff options
context:
space:
mode:
authorGravatar Tom Willemse2024-06-10 21:09:15 -0700
committerGravatar Tom Willemse2024-06-10 21:09:15 -0700
commitb5ac1fa2a33ae046fa785d9938dcd0d5274b7ce1 (patch)
tree6397c4fbcd147c7715f231f336107f8e13802cec /src/SemanticScuttle/Service
parent53b174a3236d89e1528ea663584f6bbca3c24c53 (diff)
downloadscuttle-b5ac1fa2a33ae046fa785d9938dcd0d5274b7ce1.tar.gz
scuttle-b5ac1fa2a33ae046fa785d9938dcd0d5274b7ce1.zip
Make sure to check users for being false
Diffstat (limited to 'src/SemanticScuttle/Service')
-rw-r--r--src/SemanticScuttle/Service/AuthUser.php12
-rw-r--r--src/SemanticScuttle/Service/User.php7
2 files changed, 13 insertions, 6 deletions
diff --git a/src/SemanticScuttle/Service/AuthUser.php b/src/SemanticScuttle/Service/AuthUser.php
index 9447ee4..f0bc908 100644
--- a/src/SemanticScuttle/Service/AuthUser.php
+++ b/src/SemanticScuttle/Service/AuthUser.php
@@ -168,10 +168,12 @@ class SemanticScuttle_Service_AuthUser extends SemanticScuttle_Service_User
//user must have changed password in external auth.
//we need to update the local database.
$user = $this->getUserByUsername($username);
- $this->_updateuser(
- $user['uId'], $this->getFieldName('password'),
- $this->sanitisePassword($password)
- );
+ if ($user) {
+ $this->_updateuser(
+ $user['uId'], $this->getFieldName('password'),
+ $this->sanitisePassword($password)
+ );
+ }
return parent::login($username, $password, $remember);
}
@@ -229,4 +231,4 @@ class SemanticScuttle_Service_AuthUser extends SemanticScuttle_Service_User
}
}
-?> \ No newline at end of file
+?>
diff --git a/src/SemanticScuttle/Service/User.php b/src/SemanticScuttle/Service/User.php
index 917c7c9..675c4fb 100644
--- a/src/SemanticScuttle/Service/User.php
+++ b/src/SemanticScuttle/Service/User.php
@@ -395,7 +395,12 @@ class SemanticScuttle_Service_User extends SemanticScuttle_DbService
{
if (is_numeric($user)) {
$user = $this->getUser($user);
- $user = $user['username'];
+ if ($user) {
+ $user = $user['username'];
+ }
+ else {
+ $user = 'unknown';
+ }
} else if (is_array($user)) {
$user = $user['username'];
}