From f7c0c141634da83bf200b842f113f57e82af2276 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Sun, 20 Nov 2022 21:48:23 -0500 Subject: [PATCH] [fix] Yet more fallout from the PHP8.1 stuff --- src/admin.volume.edit.php | 1 - src/album.del.2.php | 3 ++- src/album.edit.2.php | 3 ++- src/bulk.update.php | 3 ++- src/camera.add.2.php | 1 - src/film.add.2.php | 1 - src/folder.content.php | 3 ++- src/folder.del.2.php | 3 ++- src/folder.edit.2.php | 3 ++- src/location.add.2.php | 1 - src/location.del.2.php | 4 ++-- src/location.edit.2.php | 4 ++-- src/manufacturer.add.2.php | 1 - src/manufacturer.del.2.php | 5 ++--- src/manufacturer.del.php | 2 +- src/manufacturer.edit.2.php | 4 ++-- src/manufacturer.edit.php | 2 +- 17 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/admin.volume.edit.php b/src/admin.volume.edit.php index 8865177..af7e0fe 100644 --- a/src/admin.volume.edit.php +++ b/src/admin.volume.edit.php @@ -21,7 +21,6 @@ include_once "include/config.php"; include_once "include/admin.php"; include_once "include/site.php"; -; include_once "include/common.php"; $database = site_prolog(PO_USER_TYPE_ADMIN); diff --git a/src/album.del.2.php b/src/album.del.2.php index 0abbe52..66bba0d 100644 --- a/src/album.del.2.php +++ b/src/album.del.2.php @@ -20,9 +20,10 @@ include_once "include/config.php"; include_once "include/site.php"; +$database = site_prolog(PO_USER_TYPE_CLIENT); + $album_id = pg_escape_string($database, $_REQUEST['album']); -$database = site_prolog(PO_USER_TYPE_CLIENT); $go = TRUE; /* Ensure mere users don't erase an album that isn't theirs! */ diff --git a/src/album.edit.2.php b/src/album.edit.2.php index 433ec88..a1c115a 100644 --- a/src/album.edit.2.php +++ b/src/album.edit.2.php @@ -20,6 +20,8 @@ include_once "include/config.php"; include_once "include/site.php"; +$database = site_prolog(PO_USER_TYPE_CLIENT); + $album_id = pg_escape_string($database, $_REQUEST['album']); $album_name = pg_escape_string($database, $_REQUEST['album_caption']); $album_description = pg_escape_string($database, $_REQUEST['album_description']); @@ -32,7 +34,6 @@ $keep_thumb = $_REQUEST['keep_thumb']; if ($event != "null") $event = "'$event'"; -$database = site_prolog(PO_USER_TYPE_CLIENT); $go = TRUE; /* Ensure mere users don't edit an album that isn't theirs! */ diff --git a/src/bulk.update.php b/src/bulk.update.php index 2376ba6..f0f96da 100644 --- a/src/bulk.update.php +++ b/src/bulk.update.php @@ -24,6 +24,8 @@ include_once "include/common.php"; include_once "include/site.php"; include_once "include/import.php"; +$database = site_prolog(PO_USER_TYPE_USER); + $select_folder = pg_escape_string($database, $_REQUEST['select_folder']); $select_album = pg_escape_string($database, $_REQUEST['select_album']); $type = isset($_REQUEST['type']) ? $_REQUEST['type'] : FALSE; @@ -35,7 +37,6 @@ $set_generate_images = $_REQUEST['set_generate_images']; $compress_pages = false; /* Explicitly disable it here */ set_time_limit(0); /* Explicitly disable timeouts here */ -$database = site_prolog(PO_USER_TYPE_USER); if (!sizeof($to_update) && ($set_generate_images != 't')) { site_push_error($strings['errors_invalid_options']); diff --git a/src/camera.add.2.php b/src/camera.add.2.php index cbf7996..58974d8 100644 --- a/src/camera.add.2.php +++ b/src/camera.add.2.php @@ -22,7 +22,6 @@ include_once "include/config.php"; include_once "include/profile.php"; include_once "include/calendar.php"; include_once "include/site.php"; -; function add_camera($database, $user_id, $camera_type_id, $camera_manufacturer_id, $camera_model, $camera_variation, diff --git a/src/film.add.2.php b/src/film.add.2.php index 98a56d5..9f5e184 100644 --- a/src/film.add.2.php +++ b/src/film.add.2.php @@ -21,7 +21,6 @@ include_once "include/config.php"; include_once "include/profile.php"; include_once "include/site.php"; -; function add_film($database, $user_id, $film_type_id, $film_manufacturer_id, $film_model, $film_iso, $film_format_id, $film_access_rights) { diff --git a/src/folder.content.php b/src/folder.content.php index acacdb8..d2c36ff 100644 --- a/src/folder.content.php +++ b/src/folder.content.php @@ -21,9 +21,10 @@ include_once "include/config.php"; include_once "include/site.php"; include_once "include/import.php"; +$database = site_prolog(); + $return_path = isset($_REQUEST['return']) ? $_REQUEST['return'] : ""; -$database = site_prolog(); $owner_id = isset($_REQUEST['user']) ? $_REQUEST['user'] : 0; $destination_folder = pg_escape_string($database, isset($_REQUEST['destination_folder']) ? $_REQUEST['destination_folder'] : ""); diff --git a/src/folder.del.2.php b/src/folder.del.2.php index 0cb687f..7270e08 100644 --- a/src/folder.del.2.php +++ b/src/folder.del.2.php @@ -20,10 +20,11 @@ include_once "include/config.php"; include_once "include/site.php"; +$database = site_prolog(PO_USER_TYPE_USER); + $folder_id = pg_escape_string($database, $_REQUEST['folder']); $parent_folder = $_REQUEST['parent']; -$database = site_prolog(PO_USER_TYPE_USER); $go = TRUE; /* Ensure mere users don't erase an folder that isn't theirs! */ diff --git a/src/folder.edit.2.php b/src/folder.edit.2.php index e198231..5674f16 100644 --- a/src/folder.edit.2.php +++ b/src/folder.edit.2.php @@ -20,6 +20,8 @@ include_once "include/config.php"; include_once "include/site.php"; +$database = site_prolog(PO_USER_TYPE_USER); + $folder_id = pg_escape_string($database, $_REQUEST['folder']); $folder_name = pg_escape_string($database, $_REQUEST['folder_caption']); $folder_description = pg_escape_string($database, $_REQUEST['folder_description']); @@ -32,7 +34,6 @@ $keep_thumb = $_REQUEST['keep_thumb']; if ($event != "null") $event = "'$event'"; -$database = site_prolog(PO_USER_TYPE_USER); /* Ensure mere users don't edit an folder that isn't theirs! */ if ($po_user['type'] != PO_USER_TYPE_ADMIN) { diff --git a/src/location.add.2.php b/src/location.add.2.php index a1a4b99..0d6e7d8 100644 --- a/src/location.add.2.php +++ b/src/location.add.2.php @@ -21,7 +21,6 @@ include_once "include/config.php"; include_once "include/profile.php"; include_once "include/site.php"; -; $database = site_prolog(PO_USER_TYPE_USER); diff --git a/src/location.del.2.php b/src/location.del.2.php index 80d5a16..a446b30 100644 --- a/src/location.del.2.php +++ b/src/location.del.2.php @@ -21,10 +21,10 @@ include_once "include/config.php"; include_once "include/profile.php"; include_once "include/site.php"; -$location_id = pg_escape_string($database, $_REQUEST['location']); - $database = site_prolog(PO_USER_TYPE_USER); +$location_id = pg_escape_string($database, $_REQUEST['location']); + if ($location_id!="") { /* Ensure the user owns it !*/ if ($po_user['type'] != PO_USER_TYPE_ADMIN) { diff --git a/src/location.edit.2.php b/src/location.edit.2.php index d27303f..d7b5853 100644 --- a/src/location.edit.2.php +++ b/src/location.edit.2.php @@ -21,6 +21,8 @@ include_once "include/config.php"; include_once "include/profile.php"; include_once "include/site.php"; +$database = site_prolog(PO_USER_TYPE_USER); + $location_id = $_REQUEST['location']; $location_name = pg_escape_string($database, $_REQUEST['location_name']); $location_city = pg_escape_string($database, $_REQUEST['location_city']); @@ -30,8 +32,6 @@ $location_latitude = pg_escape_string($database, parse_latitude($_REQUEST['loca $location_longitude = pg_escape_string($database, parse_latitude($_REQUEST['location_longitude'])); $location_private = pg_escape_string($database, $_REQUEST['private']); -$database = site_prolog(PO_USER_TYPE_USER); - if ($location_id!="") { /* Ensure the user owns it !*/ if ($po_user['type'] != PO_USER_TYPE_ADMIN) { diff --git a/src/manufacturer.add.2.php b/src/manufacturer.add.2.php index fde294a..96b02c6 100644 --- a/src/manufacturer.add.2.php +++ b/src/manufacturer.add.2.php @@ -21,7 +21,6 @@ include_once "include/config.php"; include_once "include/profile.php"; include_once "include/site.php"; -; $database = site_prolog(PO_USER_TYPE_USER); diff --git a/src/manufacturer.del.2.php b/src/manufacturer.del.2.php index 6f52852..8ad2581 100644 --- a/src/manufacturer.del.2.php +++ b/src/manufacturer.del.2.php @@ -21,12 +21,11 @@ include_once "include/config.php"; include_once "include/profile.php"; include_once "include/site.php"; -; - -$manufacturer_id = pg_escape_string($database, $_REQUEST['manufacturer']); $database = site_prolog(PO_USER_TYPE_USER); +$manufacturer_id = pg_escape_string($database, $_REQUEST['manufacturer']); + if ($manufacturer_id!="") { /* Ensure the user owns it !*/ if ($po_user['type'] != PO_USER_TYPE_ADMIN) { diff --git a/src/manufacturer.del.php b/src/manufacturer.del.php index a20b885..19ba09b 100644 --- a/src/manufacturer.del.php +++ b/src/manufacturer.del.php @@ -24,7 +24,7 @@ include_once "include/common.php"; $database = site_prolog(PO_USER_TYPE_USER); -$manufacturer_id=pg_escape_string($database, $_REQUEST['item']); +$manufacturer_id = pg_escape_string($database, $_REQUEST['item']); /* Ensure the user owns it !*/ if ($po_user['type'] != PO_USER_TYPE_ADMIN) { diff --git a/src/manufacturer.edit.2.php b/src/manufacturer.edit.2.php index 9790d8e..48d7087 100644 --- a/src/manufacturer.edit.2.php +++ b/src/manufacturer.edit.2.php @@ -22,12 +22,12 @@ include_once "include/config.php"; include_once "include/profile.php"; include_once "include/site.php"; +$database = site_prolog(PO_USER_TYPE_USER); + $manufacturer_id = pg_escape_string($database, $_REQUEST['manufacturer']); $manufacturer_name = pg_escape_string($database, $_REQUEST['manufacturer_name']); $manufacturer_url = pg_escape_string($database, $_REQUEST['manufacturer_url']); -$database = site_prolog(PO_USER_TYPE_USER); - if (($manufacturer_id!="") && ($manufacturer_name!="")) { if ($po_user['type'] != PO_USER_TYPE_ADMIN) { $result = pg_fetch_row(pg_query($database, "select count(identifier) from manufacturer where identifier=$manufacturer_id and last_modifying_users=$po_user[id]")); diff --git a/src/manufacturer.edit.php b/src/manufacturer.edit.php index 13b3af6..10a9b72 100644 --- a/src/manufacturer.edit.php +++ b/src/manufacturer.edit.php @@ -24,7 +24,7 @@ include_once "include/common.php"; $database = site_prolog(PO_USER_TYPE_USER); -$manufacturer_id=pg_escape_string($database, $_REQUEST['item']); +$manufacturer_id = pg_escape_string($database, $_REQUEST['item']); $manufacturer = pg_fetch_row(pg_query($database, "select name, url, last_modifying_users from manufacturer where identifier=$manufacturer_id")); /* Ensure the user owns it !*/