diff --git a/php/Access/Guest.php b/php/Access/Guest.php index 84e3f69..cab6f56 100644 --- a/php/Access/Guest.php +++ b/php/Access/Guest.php @@ -34,12 +34,43 @@ final class Guest extends Access { case 'Album::getArchive': self::getAlbumArchiveAction(); break; case 'Photo::getArchive': self::getPhotoArchiveAction(); break; + // Admin functions + case 'Album::add': + case 'Album::setTitle': + case 'Album::setDescription': + case 'Album::setPublic': + case 'Album::delete': + case 'Album::merge': + case 'Photo::setTitle': + case 'Photo::setDescription': + case 'Photo::setStar': + case 'Photo::setPublic': + case 'Photo::setAlbum': + case 'Photo::setTags': + case 'Photo::duplicate': + case 'Photo::delete': + case 'Photo::add': + case 'Import::url': + case 'Import::server': + case 'search': + case 'Settings::setLogin': + case 'Settings::setSorting': + case 'Settings::setDropboxKey': + self::adminAction(); + break; + } self::fnNotFound(); } + private static function adminAction() { + + Response::error('Function not available for guests.'); + + } + // Albums functions private static function getAlbumsAction() { diff --git a/src/scripts/lychee.js b/src/scripts/lychee.js index 2c4b4e5..46ec85b 100644 --- a/src/scripts/lychee.js +++ b/src/scripts/lychee.js @@ -424,8 +424,8 @@ lychee.html = function(literalSections, ...substs) { lychee.error = function(errorThrown, params, data) { - // if the requested function was not found, our cookie has probably expired - if (data.startsWith('Error: Function not found!')) { + // in this case, our cookie has probably expired + if (data.startsWith('Error: Function not available for guests.')) { lychee.restart() return }