Commit 8d587a0e authored by Tobias Reich's avatar Tobias Reich
Browse files

Disable download php-side

parent 0cf8e971
......@@ -29,8 +29,8 @@ class Guest extends Access {
case 'logout': $this->logout(); break;
# $_GET functions
case 'getAlbumArchive': $this->getAlbumArchive(); break;
case 'getPhotoArchive': $this->getPhotoArchive(); break;
case 'getAlbumArchive': $this->getAlbumArchive(); break;
case 'getPhotoArchive': $this->getPhotoArchive(); break;
# Error
default: exit('Error: Function not found! Please check the spelling of the called function.');
......@@ -136,7 +136,7 @@ class Guest extends Access {
Module::dependencies(isset($_GET['albumID'], $_GET['password']));
$album = new Album($this->database, $this->plugins, $this->settings, $_GET['albumID']);
if ($album->getPublic()) {
if ($album->getPublic()&&$album->getDownloadable()) {
# Album Public
if ($album->checkPassword($_GET['password'])) $album->getArchive();
......
......@@ -441,6 +441,28 @@ class Album extends Module {
}
public function getDownloadable() {
# Check dependencies
self::dependencies(isset($this->database, $this->albumIDs));
# Call plugins
$this->plugins(__METHOD__, 0, func_get_args());
if ($this->albumIDs==='0'||$this->albumIDs==='s'||$this->albumIDs==='f') return false;
# Execute query
$albums = $this->database->query("SELECT downloadable FROM lychee_albums WHERE id = '$this->albumIDs' LIMIT 1;");
$album = $albums->fetch_object();
# Call plugins
$this->plugins(__METHOD__, 1, func_get_args());
if ($album->downloadable==1) return true;
return false;
}
public function setPublic($password, $visible, $downloadable) {
# Check dependencies
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment