Added direct access protection to database updates
This commit is contained in:
parent
16871aa753
commit
0c97151f4f
@ -5,6 +5,8 @@
|
||||
# @copyright 2015 by Tobias Reich
|
||||
###
|
||||
|
||||
if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
|
||||
|
||||
$query = Database::prepare($database, "SELECT `tags` FROM `?` LIMIT 1", array(LYCHEE_TABLE_PHOTOS));
|
||||
if(!$database->query($query)) {
|
||||
$query = Database::prepare($database, "ALTER TABLE `?` ADD `tags` VARCHAR( 1000 ) NULL DEFAULT ''", array(LYCHEE_TABLE_PHOTOS));
|
||||
|
@ -5,6 +5,8 @@
|
||||
# @copyright 2015 by Tobias Reich
|
||||
###
|
||||
|
||||
if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
|
||||
|
||||
$query = Database::prepare($database, "ALTER TABLE `?` CHANGE `value` `value` VARCHAR( 200 ) NULL DEFAULT ''", array(LYCHEE_TABLE_SETTINGS));
|
||||
$result = $database->query($query);
|
||||
if (!$result) {
|
||||
|
@ -5,6 +5,8 @@
|
||||
# @copyright 2015 by Tobias Reich
|
||||
###
|
||||
|
||||
if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
|
||||
|
||||
$query = Database::prepare($database, "SELECT `visible` FROM `?` LIMIT 1", array(LYCHEE_TABLE_ALBUMS));
|
||||
if (!$database->query($query)) {
|
||||
$query = Database::prepare($database, "ALTER TABLE `?` ADD `visible` TINYINT(1) NOT NULL DEFAULT 1", array(LYCHEE_TABLE_ALBUMS));
|
||||
|
@ -5,6 +5,8 @@
|
||||
# @copyright 2015 by Tobias Reich
|
||||
###
|
||||
|
||||
if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
|
||||
|
||||
# Add `plugins`
|
||||
$query = Database::prepare($database, "SELECT `key` FROM `?` WHERE `key` = 'plugins' LIMIT 1", array(LYCHEE_TABLE_SETTINGS));
|
||||
$result = $database->query($query);
|
||||
|
@ -5,6 +5,8 @@
|
||||
# @copyright 2015 by Tobias Reich
|
||||
###
|
||||
|
||||
if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
|
||||
|
||||
# Add `checksum`
|
||||
$query = Database::prepare($database, "SELECT `checksum` FROM `?` LIMIT 1", array(LYCHEE_TABLE_PHOTOS));
|
||||
if (!$database->query($query)) {
|
||||
|
@ -5,6 +5,8 @@
|
||||
# @copyright 2015 by Tobias Reich
|
||||
###
|
||||
|
||||
if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
|
||||
|
||||
# Add `downloadable`
|
||||
$query = Database::prepare($database, "SELECT `downloadable` FROM `?` LIMIT 1", array(LYCHEE_TABLE_ALBUMS));
|
||||
if (!$database->query($query)) {
|
||||
|
@ -5,6 +5,8 @@
|
||||
# @copyright 2015 by Tobias Reich
|
||||
###
|
||||
|
||||
if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
|
||||
|
||||
# Add a checksum
|
||||
$query = Database::prepare($database, "SELECT `id`, `url` FROM `?` WHERE `checksum` IS NULL", array(LYCHEE_TABLE_PHOTOS));
|
||||
$result = $database->query($query);
|
||||
|
@ -5,6 +5,8 @@
|
||||
# @copyright 2015 by Tobias Reich
|
||||
###
|
||||
|
||||
if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
|
||||
|
||||
# Add medium to photos
|
||||
$query = Database::prepare($database, "SELECT `medium` FROM `?` LIMIT 1", array(LYCHEE_TABLE_PHOTOS));
|
||||
if (!$database->query($query)) {
|
||||
|
Loading…
Reference in New Issue
Block a user