fixed case of no longer existing user
This commit is contained in:
parent
63532c54ea
commit
47f82afcb5
1 changed files with 3 additions and 3 deletions
|
@ -32,7 +32,8 @@ class User
|
|||
openssl_pkey_export($private_key, $private);
|
||||
try {
|
||||
$sql = 'insert into users (id, externalid, rsapublic, rsaprivate, validuntil)';
|
||||
$sql .= ' values (?, ?, ?, ?, now() + interval 1 day) on duplicate key update validuntil=now() + interval 1 day';
|
||||
$sql .= ' values (?, ?, ?, ?, now() + interval 1 day)';
|
||||
$sql .= ' on duplicate key update validuntil=now() + interval 1 day';
|
||||
$stmt = $dbh->prepare($sql);
|
||||
if ($stmt === false) {
|
||||
throw new \Federator\Exceptions\ServerError();
|
||||
|
@ -119,8 +120,7 @@ class User
|
|||
}
|
||||
}
|
||||
if ($cache !== null) {
|
||||
print_r($user);
|
||||
if ($user->id === null) {
|
||||
if ($user->id === null && $user->externalid !== null) {
|
||||
self::addLocalUser($dbh, $user, $_name);
|
||||
}
|
||||
$cache->saveRemoteUserByName($_name, $user);
|
||||
|
|
Loading…
Reference in a new issue