lychee-webroot
lychee-webroot copied to clipboard
Not working for Albums with password
This plugin works fine when photos are set public/private. It will not work proper when albums are password protected. For example a password protected public album will check for password but the photos are accessible directly without logging in nor entering the correct password:
Check if public (as is)
if ($isAdmin=== true||$photo->public==='1') {
# Photo public
return $photo;
} else {
# Check if album public
$album = new Album($database, null, null, $photo->album);
$agP = $album->getPublic();
if ($agP===true) return $photo;
}
It tried to solve it by my own but I'm not sure how to pass the entered password to this getPhoto.php.
Check if public (with password check)
if ($isAdmin === true || $photo->public == 1 ) {
# Photo public
return $photo;
} else {
# Check if album public
$album = new Album($photo->album);
$agP = $album->getPublic();
#Where to get the password? $_GET['password'] isn't working.
$acP = $album->checkPassword($password);
if ($agP===true&&$acP===true) return $photo;
}