Fixed (file) comments.
This commit is contained in:
		| @@ -1,6 +1,7 @@ | ||||
| <?PHP | ||||
| /** | ||||
|  * The main display file for standalone pages. | ||||
|  * This file directly mirrors data from the MD api. | ||||
|  * In some cases, links are rewritten, to allow navigation on site. | ||||
|  * | ||||
|  * @author Joshua Ramon Enslin <joshua@jrenslin.de> | ||||
|  */ | ||||
|   | ||||
| @@ -1,6 +1,7 @@ | ||||
| <?PHP | ||||
| /** | ||||
|  * This file displays object detail pages as fetched from museum-digital. | ||||
|  * This script offers detail pages for collections | ||||
|  * based on data fetched from museum-digital. | ||||
|  * | ||||
|  * @author Joshua Ramon Enslin <joshua@jrenslin.de> | ||||
|  */ | ||||
| @@ -21,6 +22,8 @@ if (!isset($_GET['id']) or !is_numeric($_GET['id'])) { | ||||
| ensureEnvironment(); | ||||
| $pages = loadPublicPages();           // Load overview of pages. | ||||
|  | ||||
| // Load data | ||||
|  | ||||
| $contents = json_decode(queryCachePage($settings['mdVersion'] . "?t=sammlung&gesusa=" . urlencode($_GET['id']) . "&output=json", "institution", $settings), true); | ||||
|  | ||||
| if (!$contents || (isset($contents[0]) and $contents[0] == "There is no collection with this ID yet.")) { | ||||
|   | ||||
| @@ -1,6 +1,12 @@ | ||||
| <?PHP | ||||
| /** | ||||
|  * This page offers the opportunity to edit static page elements: the side bar and the footer. | ||||
|  * This page offers the opportunity to edit static page elements: | ||||
|  * - the side bar, | ||||
|  * - the footer, | ||||
|  * - the banner, | ||||
|  * - the welcome message for the backend. | ||||
|  * | ||||
|  * @author Joshua Ramon Enslin <joshua@jrenslin.de> | ||||
|  */ | ||||
|  | ||||
| /* | ||||
|   | ||||
| @@ -1,7 +1,9 @@ | ||||
| <?PHP | ||||
| /** | ||||
|  * Start page of the backend. | ||||
|  * Offers a dashboard. | ||||
|  * Offers the welcome message (if there is one), | ||||
|  * a description of the CMS and some basic data | ||||
|  * on the contents of the current page. | ||||
|  * | ||||
|  * @author Joshua Ramon Enslin <joshua@jrenslin.de> | ||||
|  */ | ||||
|   | ||||
| @@ -1,6 +1,8 @@ | ||||
| <?PHP | ||||
| /** | ||||
|  * This page offers the opportunity to edit static pages. | ||||
|  * | ||||
|  * @author Joshua Ramon Enslin <joshua@jrenslin.de> | ||||
|  */ | ||||
|  | ||||
| /* | ||||
|   | ||||
| @@ -1,7 +1,6 @@ | ||||
| <?PHP | ||||
| /** | ||||
|  * Start page of the backend. | ||||
|  * Offers a dashboard. | ||||
|  * Overview page for all pages. | ||||
|  * | ||||
|  * @author Joshua Ramon Enslin <joshua@jrenslin.de> | ||||
|  */ | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| <?PHP | ||||
| /** | ||||
|  * Login script | ||||
|  * Login script. | ||||
|  * | ||||
|  * @author Joshua Ramon Enslin <joshua@jrenslin.de> | ||||
|  */ | ||||
|   | ||||
| @@ -1,7 +1,6 @@ | ||||
| <?PHP | ||||
| /** | ||||
|  * Start page of the backend. | ||||
|  * Offers a dashboard. | ||||
|  * Settings page. | ||||
|  * | ||||
|  * @author Joshua Ramon Enslin <joshua@jrenslin.de> | ||||
|  */ | ||||
| @@ -28,7 +27,11 @@ if (!$_SESSION['admin']) { | ||||
| // Check for vars. | ||||
| loadHttpToGlobals(["task", "startPage", "pageTitle", "logo", "url", "css", "hideInstitution", "mdVersion", "mdImgFolder", "cacheRefreshInterval", "limitToInstitutions", "maxFileSize", "sendHTTPHeaders", "CSPimageSources", "CSPobjectSources", "defaultLang"]); | ||||
|  | ||||
| if (isset($task) and $task == "update") { // Adding new users. | ||||
| /** | ||||
|  * Part for editing settings. | ||||
|  */ | ||||
|  | ||||
| if (isset($task) and $task == "update") { | ||||
|  | ||||
|     if (isset($defaultLang) and !in_array("$defaultLang.php", scanDirConts(__DIR__ . "/translations"))) { | ||||
|         $_SESSION["editHistory"] = ["changesAborted", $translations['languageUnavailable']]; | ||||
|   | ||||
| @@ -1,7 +1,6 @@ | ||||
| <?PHP | ||||
| /** | ||||
|  * Start page of the backend. | ||||
|  * Offers a dashboard. | ||||
|  * This script lists all users and offers the option to add new ones. | ||||
|  * | ||||
|  * @author Joshua Ramon Enslin <joshua@jrenslin.de> | ||||
|  */ | ||||
| @@ -32,7 +31,10 @@ if (!isset($users)) { | ||||
|     $users = json_decode(file_get_contents(__DIR__ . "/../data/users.json"), true); | ||||
| } | ||||
|  | ||||
| if (isset($task) and $task == "insert") { // Adding new users. | ||||
| /** | ||||
|  * Adding new users. | ||||
|  */ | ||||
| if (isset($task) and $task == "insert") { | ||||
|  | ||||
|     $redirectURL = "./users.php?" . write_common_vars(["username", "realName", "email", "admin"]) . "#addUser"; | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,7 @@ | ||||
| <?PHP | ||||
| /** | ||||
|  * This file displays object detail pages as fetched from museum-digital. | ||||
|  * This script offers detail pages for events | ||||
|  * based on data fetched from museum-digital. | ||||
|  * | ||||
|  * @author Joshua Ramon Enslin <joshua@jrenslin.de> | ||||
|  */ | ||||
|   | ||||
| @@ -1,6 +1,7 @@ | ||||
| <?PHP | ||||
| /** | ||||
|  * This file displays object detail pages as fetched from museum-digital. | ||||
|  * This script offers detail pages for exhibitions | ||||
|  * based on data fetched from museum-digital. | ||||
|  * | ||||
|  * @author Joshua Ramon Enslin <joshua@jrenslin.de> | ||||
|  */ | ||||
|   | ||||
| @@ -30,7 +30,7 @@ function ensureDir(string $filepath) { | ||||
|  */ | ||||
| function ensureJson(string $filepath) { | ||||
|  | ||||
|     if (!file_exists($filepath) or filesize($filepath) < 2) { | ||||
|     if (!file_exists($filepath) or filesize($filepath) < 2) { // If file exists, but is smaller than 2 byte, it is not valid JSON. | ||||
|         file_put_contents($filepath, "[]"); | ||||
|     } | ||||
|  | ||||
| @@ -90,6 +90,8 @@ function ensureEnvironment() { | ||||
|  | ||||
|     $GLOBALS['settings'] = $settings; | ||||
|  | ||||
|     // Send headers for increased security | ||||
|  | ||||
|     if ($settings['sendHTTPHeaders']) { | ||||
|         header('X-Content-Type-Options: nosniff'); | ||||
|         header('X-XSS-Protection: 1; mode=block'); | ||||
| @@ -145,7 +147,7 @@ function queryCachePage(string $url, string $area = "", array $settings = ['cach | ||||
|     $fileName = md5($url); | ||||
|     $filePath = "$fileDir/$fileName.json"; | ||||
|  | ||||
|     // Load from cache. | ||||
|     // Load from cache if appropriate. | ||||
|     if (file_exists($filePath) && time() - filemtime($filePath) < $settings['cacheRefreshInterval']) { | ||||
|         return file_get_contents($filePath); | ||||
|     } | ||||
| @@ -379,8 +381,8 @@ function checkPreviewAccess($sessionStarted = false) { | ||||
|  * @return boolean | ||||
|  */ | ||||
| function startswith(string $haystack, string $needle):bool { | ||||
|     if (substr($haystack, 0, strlen($needle)) == $needle) return (true); | ||||
|     else return (false); | ||||
|     if (substr($haystack, 0, strlen($needle)) == $needle) return true; | ||||
|     else return false; | ||||
| } | ||||
|  | ||||
| /** | ||||
|   | ||||
| @@ -1,6 +1,7 @@ | ||||
| <?PHP | ||||
| /** | ||||
|  * This file displays object detail pages as fetched from museum-digital. | ||||
|  * This script offers detail pages for institutions | ||||
|  * based on data fetched from museum-digital. | ||||
|  * | ||||
|  * @author Joshua Ramon Enslin <joshua@jrenslin.de> | ||||
|  */ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user