commit fad06deb4758bbecb4d140531b0e867946e53fcb
parent 38219cdeb3a7f034396bcd9ad7003d27b83d98dc
Author: René Wagner <rwa@clttr.info>
Date: Sat, 27 May 2023 12:17:24 +0200
fix first login to admin panel
Diffstat:
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
@@ -29,8 +29,8 @@ The devShort URL shortener is the perfect choice for web developers, admins and
## 1-2-3 Step installation
1. Download the latest [release](https://git.sr.ht/~rwa/devshort/refs) and upload it to the desired installation place
-2. Move `admin/config.json.example` to `admin/config.json` and `admin/stats.json.example` to `admin/stats.json`
-3. Adjust the configuration in `admin/config.json`, especially **insert a admin password**
+2. Move `data/config.json.example` to `data/config.json` and `data/stats.json.example` to `data/stats.json`
+3. Adjust the configuration in `data/config.json`, especially **insert a admin password**
The passwort will be securely hashed at the first login on the admin page.
4. Start using devShort!
diff --git a/admin-auth.php b/admin-auth.php
@@ -16,7 +16,7 @@ if (!$config_content["admin_password"]) {
// First run: Hash password if it's in the config.json as clear text
$admin_password = $config_content["admin_password"];
-if (password_get_info($admin_password)["algo"] === 0) {
+if (password_get_info($admin_password)["algo"] == 0) {
$hash = password_hash($admin_password, PASSWORD_DEFAULT);
} else {
$hash = $admin_password;