Skip to content

Commit

Permalink
getByData set exists to true if record found in SimpleTable
Browse files Browse the repository at this point in the history
Check if logkey is not null and not '' in User.
  • Loading branch information
Alxarafe committed Mar 13, 2019
1 parent 2af840d commit 5c90566
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/Alxarafe/Core/Base/FlatTable.php
Expand Up @@ -261,7 +261,6 @@ private function updateRecord(array $data): bool

$idField = Database::getInstance()->getSqlHelper()->quoteFieldName($this->idField);
$sql = "UPDATE {$this->getQuotedTableName()} SET {$fieldList} WHERE {$idField} = :id;";

$vars['id'] = $this->id;

return Database::getInstance()->getDbEngine()->exec($sql, $vars);
Expand Down
1 change: 1 addition & 0 deletions src/Alxarafe/Core/Base/SimpleTable.php
Expand Up @@ -144,6 +144,7 @@ private function getDataBy(string $key, $value): bool
$this->newData = $data[0];
$this->oldData = $this->newData;
$this->id = $this->newData[$this->idField];
$this->exists = true;
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Alxarafe/Core/Models/User.php
Expand Up @@ -80,7 +80,7 @@ public function verifyPassword(string $password): bool
*/
public function generateLogKey(string $ip = '', bool $unique = true): string
{
if (!$unique && $this->logkey !== null) {
if (!$unique && $this->logkey !== null && $this - logkey !== '') {
return $this->logkey;
}

Expand Down

0 comments on commit 5c90566

Please sign in to comment.