From 275e653b1a5757ff9980218d46154708ced621d1 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Thu, 14 May 2015 21:34:25 +0200 Subject: [PATCH] Generate identifier even when db entry exists #344 --- php/database/settings_content.sql | 1 + php/database/update_030001.php | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/php/database/settings_content.sql b/php/database/settings_content.sql index 6a1595c..60d178f 100644 --- a/php/database/settings_content.sql +++ b/php/database/settings_content.sql @@ -14,4 +14,5 @@ VALUES ('medium','1'), ('imagick','1'), ('dropboxKey',''), + ('identifier',''), ('plugins',''); \ No newline at end of file diff --git a/php/database/update_030001.php b/php/database/update_030001.php index 3147255..24a0191 100644 --- a/php/database/update_030001.php +++ b/php/database/update_030001.php @@ -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