Skip to main content

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

  1. Go to Settings > Users
  2. Click New user
  3. Fill in the form:
    • Email: Unique email address
    • Full name: First and last name
    • Role: Select the appropriate role
    • Password: Minimum 8 characters
  4. 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

EmailRolePasswordDescription
admin@pch-sig.snAdminAdmin123!Main administrator account
makhtar.gueye@axone-sn.comAdminAdmin123!Technical administrator
Security

Change default passwords after first login.


Modify a user

Via interface

  1. Go to Settings > Users
  2. Click on the user to modify
  3. Modify the information
  4. Click Save

Modifiable fields

FieldDescriptionModifiable
EmailLogin identifierYes
Full nameDisplayed nameYes
RoleGranted permissionsYes
PasswordAuthenticationYes
ActiveActive/inactive accountYes

Deactivate a user

Via interface

  1. Go to Settings > Users
  2. Click on the user
  3. Uncheck Active account
  4. 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)

  1. Go to Settings > Users
  2. Click on the user
  3. Click Reset password
  4. Enter the new password
  5. 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:

  1. On the login page, click Forgot password
  2. Enter their email address
  3. Receive an email with a reset link
  4. Set a new password

Delete a user

Warning

User deletion is irreversible. Prefer deactivation.

Via interface

  1. Go to Settings > Users
  2. Click on the user
  3. Click Delete
  4. 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

FilterDescription
EmailSearch by email
NameSearch by name
RoleFilter by role
StatusActive / Inactive

API search example

curl -X GET "http://localhost:8000/api/users?search=makhtar" \
-H "Authorization: Bearer $TOKEN"

Export users

Via interface

  1. Go to Settings > Users
  2. Click Export
  3. Select format (CSV, Excel)
  4. Download the file

Exported fields

  • Email
  • Full name
  • Role
  • Creation date
  • Last login
  • Status (active/inactive)

Login history

View history

  1. Go to Settings > Users
  2. Click on a user
  3. History tab

Recorded information

FieldDescription
Date/TimeLogin time
IP AddressClient IP
BrowserUser-Agent
ResultSuccess / 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

Next steps