Generate identifier when creating the database, not on update
This fixes the broken 'setLogin' when using Lychee for the first time.
This commit is contained in:
parent
e36fd87f5a
commit
f925e118c2
@ -54,14 +54,6 @@ 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
|
||||
|
@ -198,6 +198,14 @@ if(!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
|
||||
return false;
|
||||
}
|
||||
|
||||
# Generate identifier
|
||||
$identifier = md5(microtime(true));
|
||||
$query = Database::prepare($database, "UPDATE `?` SET `value` = '?' WHERE `key` = 'identifier' LIMIT 1", array(LYCHEE_TABLE_SETTINGS, $identifier));
|
||||
if (!$database->query($query)) {
|
||||
Log::error($database, __METHOD__, __LINE__, $database->error);
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
# Create albums
|
||||
|
Loading…
Reference in New Issue
Block a user