v2.6.1c (Lyra): Admin gebruikersbeheer opnieuw ontworpen + CLI reset
Nieuwe features: - Admin gebruikerslijst met zoeken/filter op gebruikersnaam en rol - Profiel bewerken pagina met wachtwoord wijzigen en rol wijzigen - Nieuwe gebruiker aanmaken via aparte pagina - CLI commando cli/reset-admin-password.php voor admin wachtword reset + lockout reset Architectuur: - /admin/users: lijst met zoekveld, rol filter, bewerk/verwijder acties - /admin/users-edit?user=<naam>: profiel, wachtwoord, rol, verwijderen - /admin/users-new: nieuwe gebruiker aanmaken - AdminAuth::clearLockout() public methode voor CLI gebruik Documentatie: - guide/nl/en/admin-beheerder/gebruikers.md herschreven - 15 nieuwe admin vertaalkeys in NL/EN/DE - Release notes: docs/release-notes/v2.6.1c.md Tests: - Pentest: 30/30 geslaagd, 0 vulnerabilities - WCAG 2.1 AA: 25/25 geslaagd, 100% compliance
This commit is contained in:
@@ -15,23 +15,63 @@ CodePress has four roles, defined in `AdminAuth::ROLE_PERMISSIONS`:
|
||||
|
||||
Roles are displayed with their label via `AdminAuth::ROLE_LABELS`.
|
||||
|
||||
## Adding a user
|
||||
## Users list (`/admin/users`)
|
||||
|
||||
1. Go to **Users**
|
||||
2. Enter username
|
||||
3. Choose password (stored as bcrypt hash)
|
||||
4. Select a role
|
||||
5. Click **Add**
|
||||
The users list shows all users with their username, role, login email and creation date.
|
||||
|
||||
## Editing a user
|
||||
### Search and filter
|
||||
|
||||
- Change password (new bcrypt hash)
|
||||
- Change role (immediately affects visible routes and sidebar items)
|
||||
- **Search field**: search by username, email or author name
|
||||
- **Role filter**: filter by a specific role via the dropdown
|
||||
- Click **Filter** to apply the results
|
||||
|
||||
## Deleting a user
|
||||
### Adding a new user
|
||||
|
||||
- Not possible for own account
|
||||
- Confirm with password
|
||||
1. Click **New user** (top right of the list)
|
||||
2. Enter username, password (minimum 8 characters), email, author name and author email
|
||||
3. Select a role
|
||||
4. Click **Add user**
|
||||
5. You will be automatically redirected to the profile page of the new user
|
||||
|
||||
## Editing a profile (`/admin/users-edit?user=<name>`)
|
||||
|
||||
Click on a user in the list to edit their profile. The profile page contains three sections:
|
||||
|
||||
### Profile information
|
||||
- Login email, author name and author email can be changed
|
||||
- The username cannot be changed
|
||||
|
||||
### Change password
|
||||
- Enter a new password (minimum 8 characters)
|
||||
- Confirm the password
|
||||
- The password is stored as a bcrypt hash
|
||||
|
||||
### Change role
|
||||
- Shows the current role with a colored badge
|
||||
- Select a new role from the dropdown
|
||||
- The change immediately affects the visible admin routes and sidebar items
|
||||
|
||||
### Delete user (Danger zone)
|
||||
- Only visible for other users (not for your own account)
|
||||
- Confirmation via JavaScript dialog
|
||||
- After deletion you return to the users list
|
||||
|
||||
## Admin password reset via CLI
|
||||
|
||||
If the admin is locked out (e.g. due to brute-force lockout or forgotten password), the password can be reset via the CLI:
|
||||
|
||||
```bash
|
||||
# Reset with a specific password
|
||||
php cli/reset-admin-password.php admin NewPassword123
|
||||
|
||||
# Reset with an automatically generated password
|
||||
php cli/reset-admin-password.php admin
|
||||
```
|
||||
|
||||
The command:
|
||||
- Changes the password (as a bcrypt hash)
|
||||
- Clears the brute-force lockout for the user
|
||||
- Displays the new password in the terminal
|
||||
|
||||
## Access control
|
||||
|
||||
|
||||
@@ -15,23 +15,63 @@ CodePress kent vier rollen, gedefinieerd in `AdminAuth::ROLE_PERMISSIONS`:
|
||||
|
||||
Rollen worden getoond met hun label via `AdminAuth::ROLE_LABELS`.
|
||||
|
||||
## Gebruiker toevoegen
|
||||
## Gebruikerslijst (`/admin/users`)
|
||||
|
||||
1. Ga naar **Gebruikers**
|
||||
2. Vul gebruikersnaam in
|
||||
3. Kies wachtwoord (opgeslagen als bcrypt hash)
|
||||
4. Selecteer een rol
|
||||
5. Klik **Toevoegen**
|
||||
De gebruikerslijst toont alle gebruikers met hun gebruikersnaam, rol, login e-mail en aanmaakdatum.
|
||||
|
||||
## Gebruiker bewerken
|
||||
### Zoeken en filteren
|
||||
|
||||
- Wachtwoord wijzigen (nieuwe bcrypt hash)
|
||||
- Rol wijzigen (beïnvloedt direct zichtbare routes en sidebar items)
|
||||
- **Zoekveld**: zoek op gebruikersnaam, e-mail of auteur naam
|
||||
- **Rol filter**: filter op een specifieke rol via de dropdown
|
||||
- Klik op **Filteren** om de resultaten toe te passen
|
||||
|
||||
## Gebruiker verwijderen
|
||||
### Nieuwe gebruiker aanmaken
|
||||
|
||||
- Kan niet voor eigen account
|
||||
- Bevestig met wachtwoord
|
||||
1. Klik op **Nieuwe gebruiker** (rechtsboven in de lijst)
|
||||
2. Vul gebruikersnaam, wachtwoord (minimaal 8 tekens), e-mail, auteur naam en auteur e-mail in
|
||||
3. Selecteer een rol
|
||||
4. Klik **Gebruiker toevoegen**
|
||||
5. Je wordt automatisch doorgestuurd naar de profiel pagina van de nieuwe gebruiker
|
||||
|
||||
## Profiel bewerken (`/admin/users-edit?user=<naam>`)
|
||||
|
||||
Klik op een gebruiker in de lijst om het profiel te bewerken. De profiel pagina bevat drie secties:
|
||||
|
||||
### Profiel gegevens
|
||||
- Login e-mail, auteur naam en auteur e-mail kunnen worden gewijzigd
|
||||
- De gebruikersnaam kan niet worden gewijzigd
|
||||
|
||||
### Wachtwoord wijzigen
|
||||
- Vul een nieuw wachtwoord in (minimaal 8 tekens)
|
||||
- Bevestig het wachtwoord
|
||||
- Het wachtwoord wordt opgeslagen als bcrypt hash
|
||||
|
||||
### Rol wijzigen
|
||||
- Toont de huidige rol met een gekleurde badge
|
||||
- Selecteer een nieuwe rol uit de dropdown
|
||||
- De wijziging beïnvloedt direct de zichtbare admin routes en sidebar items
|
||||
|
||||
### Gebruiker verwijderen (Gevarenzone)
|
||||
- Alleen zichtbaar voor andere gebruikers (niet voor je eigen account)
|
||||
- Bevestiging via JavaScript dialog
|
||||
- Na verwijderen keer je terug naar de gebruikerslijst
|
||||
|
||||
## Admin wachtwoord reset via CLI
|
||||
|
||||
Als de admin is uitgesloten (bijv. door brute-force lockout of vergeten wachtwoord), kan het wachtwoord via de CLI worden gereset:
|
||||
|
||||
```bash
|
||||
# Reset met een specifiek wachtwoord
|
||||
php cli/reset-admin-password.php admin NieuwWachtwoord123
|
||||
|
||||
# Reset met een automatisch gegenereerd wachtwoord
|
||||
php cli/reset-admin-password.php admin
|
||||
```
|
||||
|
||||
Het commando:
|
||||
- Wijzigt het wachtwoord (als bcrypt hash)
|
||||
- Wist de brute-force lockout voor de gebruiker
|
||||
- Toont het nieuwe wachtwoord in de terminal
|
||||
|
||||
## Toegangscontrole
|
||||
|
||||
|
||||
Reference in New Issue
Block a user