Generate identifier even when db entry exists #344

This commit is contained in:
Tobias Reich 2015-05-14 21:34:25 +02:00
parent ed3418058e
commit 275e653b1a
2 changed files with 9 additions and 0 deletions

View File

@ -14,4 +14,5 @@ VALUES
('medium','1'),
('imagick','1'),
('dropboxKey',''),
('identifier',''),
('plugins','');

View File

@ -54,6 +54,14 @@ if ($result->num_rows===0) {
Log::error($database, 'update_030001', __LINE__, 'Could not update database (' . $database->error . ')');
return false;
}
} else {
$identifier = md5(microtime(true));
$query = Database::prepare($database, "UPDATE `?` SET `value` = '?' WHERE `key` = 'identifier' LIMIT 1", array(LYCHEE_TABLE_SETTINGS, $identifier));
$result = $database->query($query);
if (!$result) {
Log::error($database, 'update_030001', __LINE__, 'Could not reset public albums (' . $database->error . ')');
return false;
}
}
# Set version