2015-02-08 14:36:13 +00:00
|
|
|
<?php
|
|
|
|
|
2016-01-30 20:43:57 +00:00
|
|
|
/**
|
|
|
|
* Update to version 3.0.0
|
|
|
|
*/
|
2015-02-08 14:36:13 +00:00
|
|
|
|
2016-01-30 22:07:59 +00:00
|
|
|
use Lychee\Modules\Database;
|
|
|
|
|
2015-02-08 14:36:13 +00:00
|
|
|
if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
|
|
|
|
|
2016-01-30 20:43:57 +00:00
|
|
|
// Remove login
|
|
|
|
// Login now saved as crypt without md5. Legacy code has been removed.
|
2016-01-31 14:44:54 +00:00
|
|
|
$query = Database::prepare($connection, "UPDATE `?` SET `value` = '' WHERE `key` = 'username' LIMIT 1", array(LYCHEE_TABLE_SETTINGS));
|
2016-01-31 17:49:31 +00:00
|
|
|
$result = Database::execute($connection, $query, 'update_030000', __LINE__);
|
|
|
|
|
|
|
|
if ($result===false) return false;
|
|
|
|
|
2016-01-31 14:44:54 +00:00
|
|
|
$query = Database::prepare($connection, "UPDATE `?` SET `value` = '' WHERE `key` = 'password' LIMIT 1", array(LYCHEE_TABLE_SETTINGS));
|
2016-01-31 17:49:31 +00:00
|
|
|
$result = Database::execute($connection, $query, 'update_030000', __LINE__);
|
|
|
|
|
|
|
|
if ($result===false) return false;
|
2015-02-08 14:36:13 +00:00
|
|
|
|
2016-01-30 20:43:57 +00:00
|
|
|
// Make public albums private and reset password
|
|
|
|
// Password now saved as crypt without md5. Legacy code has been removed.
|
2016-01-31 14:44:54 +00:00
|
|
|
$query = Database::prepare($connection, "UPDATE `?` SET `public` = 0, `password` = NULL", array(LYCHEE_TABLE_ALBUMS));
|
2016-01-31 17:49:31 +00:00
|
|
|
$result = Database::execute($connection, $query, 'update_030000', __LINE__);
|
|
|
|
|
|
|
|
if ($result===false) return false;
|
2015-02-08 14:36:13 +00:00
|
|
|
|
2016-01-30 20:43:57 +00:00
|
|
|
// Set version
|
2016-01-24 21:14:20 +00:00
|
|
|
if (Database::setVersion($connection, '030000')===false) return false;
|
2015-02-08 14:36:13 +00:00
|
|
|
|
|
|
|
?>
|