소스 검색

Updating README.md

sebastian 1 개월 전
부모
커밋
7896f57702
1개의 변경된 파일18개의 추가작업 그리고 4개의 파일을 삭제
  1. 18 4
      README.md

+ 18 - 4
README.md

@@ -38,13 +38,27 @@ PackIt is a smart packing list generator for outdoor activities. Select the acti
 3. Serve the project with any PHP-capable web server (Apache, Nginx, PHP built-in server).
 4. Open the site in a browser and start selecting activities.
 
-### Default admin credentials
+### Admin password
 
-| Username | Password      |
-|----------|---------------|
+Admin credentials live in the `admin_users` table, not in `config.php`. The `password_hash` column stores a bcrypt hash produced by PHP's `password_hash()`; `admin/login.php` verifies the submitted password against it with `password_verify()`.
+
+`schema.sql` seeds a default account:
+
+| Username | Password       |
+|----------|----------------|
 | `admin`  | `packit-admin` |
 
-**Change the password after first login.**
+**Change it after first login.** There is no UI for this yet, so update the row directly — generate a new hash and replace it in the database:
+
+```
+php -r "echo password_hash('your-new-password', PASSWORD_BCRYPT), PHP_EOL;"
+```
+
+```sql
+UPDATE admin_users
+SET password_hash = '<paste-hash-here>'
+WHERE username = 'admin';
+```
 
 ## Project structure