Disable download php-side
This commit is contained in:
parent
0cf8e97190
commit
8d587a0ea0
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user