From 53aa167e7914cd552e655d20ea3c785b43e0fba2 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Wed, 12 Jun 2019 15:47:51 -0600 Subject: [PATCH] Make version check API that doesn't require login --- api/.htaccess | 2 +- api/actions/version.php | 9 --------- api/apisettings.php | 3 --- api/version.php | 20 ++++++++++++++++++++ minclientversion.php | 11 ----------- 5 files changed, 21 insertions(+), 24 deletions(-) delete mode 100644 api/actions/version.php create mode 100644 api/version.php delete mode 100644 minclientversion.php diff --git a/api/.htaccess b/api/.htaccess index 9a4efe4..cb2bd83 100644 --- a/api/.htaccess +++ b/api/.htaccess @@ -1,5 +1,5 @@ -# Rewrite for Nextcloud Notes API RewriteEngine on + RewriteRule version version.php [PT] RewriteRule ([a-zA-Z0-9]+) index.php?action=$1 [PT] \ No newline at end of file diff --git a/api/actions/version.php b/api/actions/version.php deleted file mode 100644 index 5128092..0000000 --- a/api/actions/version.php +++ /dev/null @@ -1,9 +0,0 @@ - "OK", "version" => $SETTINGS["minimum_client_version"]]); \ No newline at end of file diff --git a/api/apisettings.php b/api/apisettings.php index 319ceaf..5b7029b 100644 --- a/api/apisettings.php +++ b/api/apisettings.php @@ -10,9 +10,6 @@ $APIS = [ "ping" => [ "load" => "ping.php" ], - "version" => [ - "load" => "version.php" - ], "inventory" => [ "load" => "inventory.php" ], diff --git a/api/version.php b/api/version.php new file mode 100644 index 0000000..ac10358 --- /dev/null +++ b/api/version.php @@ -0,0 +1,20 @@ + $SETTINGS["minimum_client_version"]]); + break; + case "txt": + default: + header("Content-Type: text/plain"); + echo $SETTINGS["minimum_client_version"]; + break; + +} \ No newline at end of file diff --git a/minclientversion.php b/minclientversion.php deleted file mode 100644 index ebf5241..0000000 --- a/minclientversion.php +++ /dev/null @@ -1,11 +0,0 @@ - "OK", "version" => "2.0.0"]);