User Management
This guide explains how to manage PCH-SIG users.
Overview
Users are managed via:
- Administration interface (Settings > Users)
- Symfony console commands
- REST API
Create a user
Via interface
- Go to Settings > Users
- Click New user
- Fill in the form:
- Email: Unique email address
- Full name: First and last name
- Role: Select the appropriate role
- Password: Minimum 8 characters
- Click Save
Via console
# Create an administrator
docker exec -it pch_backend php bin/console app:create-admin email@example.com Password123!
# Create a user with a specific role
docker exec -it pch_backend php bin/console app:create-user email@example.com Password123! ROLE_DATA_ENTRY
Via fixtures
# Load test users
docker exec -it pch_backend php bin/console doctrine:fixtures:load --group=users --no-interaction
Default users
| Role | Password | Description | |
|---|---|---|---|
| admin@pch-sig.sn | Admin | Admin123! | Main administrator account |
| makhtar.gueye@axone-sn.com | Admin | Admin123! | Technical administrator |
Security
Change default passwords after first login.
Modify a user
Via interface
- Go to Settings > Users
- Click on the user to modify
- Modify the information
- Click Save
Modifiable fields
| Field | Description | Modifiable |
|---|---|---|
| Login identifier | Yes | |
| Full name | Displayed name | Yes |
| Role | Granted permissions | Yes |
| Password | Authentication | Yes |
| Active | Active/inactive account | Yes |
Deactivate a user
Via interface
- Go to Settings > Users
- Click on the user
- Uncheck Active account
- Save
Effect of deactivation
- User can no longer log in
- Active sessions are invalidated
- History is preserved
- Account can be reactivated
Reset a password
Via interface (administrator)
- Go to Settings > Users
- Click on the user
- Click Reset password
- Enter the new password
- Communicate the password to the user
Via console
docker exec -it pch_backend php bin/console app:reset-password email@example.com NewPassword123!
Via user interface
The user can reset their password:
- On the login page, click Forgot password
- Enter their email address
- Receive an email with a reset link
- Set a new password
Delete a user
Warning
User deletion is irreversible. Prefer deactivation.
Via interface
- Go to Settings > Users
- Click on the user
- Click Delete
- Confirm deletion
Deletion constraints
A user cannot be deleted if:
- They created households
- They validated payments
- They have associated audit actions
In this case, deactivate the account instead.
Search users
Available filters
| Filter | Description |
|---|---|
| Search by email | |
| Name | Search by name |
| Role | Filter by role |
| Status | Active / Inactive |
API search example
curl -X GET "http://localhost:8000/api/users?search=makhtar" \
-H "Authorization: Bearer $TOKEN"
Export users
Via interface
- Go to Settings > Users
- Click Export
- Select format (CSV, Excel)
- Download the file
Exported fields
- Full name
- Role
- Creation date
- Last login
- Status (active/inactive)
Login history
View history
- Go to Settings > Users
- Click on a user
- History tab
Recorded information
| Field | Description |
|---|---|
| Date/Time | Login time |
| IP Address | Client IP |
| Browser | User-Agent |
| Result | Success / Failure |
Best practices
Account security
- Use strong passwords (8+ characters, uppercase, numbers, symbols)
- Change passwords regularly
- Do not share accounts between users
- Deactivate unused accounts
Role management
- Assign minimum necessary role
- Regularly verify permissions
- Document role assignments
Audit
- Regularly check failed logins
- Verify long-inactive accounts
- Monitor unusual activities