check($_POST['function']); exit(); } # Define the table prefix defineTablePrefix(@$dbTablePrefix); # Connect to database $database = Database::connect($dbHost, $dbUser, $dbPassword, $dbName); # Load settings $settings = new Settings($database); $settings = $settings->get(); # Init plugins $plugins = explode(';', $settings['plugins']); $plugins = new Plugins($plugins, $database, $settings); # Check if user is logged if ((isset($_SESSION['login'])&&$_SESSION['login']===true)&& (isset($_SESSION['identifier'])&&$_SESSION['identifier']===$settings['identifier'])) { ### # Admin Access # Full access to Lychee. Only with correct password/session. ### define('LYCHEE_ACCESS_ADMIN', true); $admin = new Admin($database, $plugins, $settings); $admin->check($fn); } else { ### # Guest Access # Access to view all public folders and photos in Lychee. ### define('LYCHEE_ACCESS_GUEST', true); $guest = new Guest($database, $plugins, $settings); $guest->check($fn); } } else { exit('Error: No API function specified!'); } ?>