drago-ex / project-account
Account management for Drago Project.
Package info
github.com/drago-ex/project-account
Type:drago-tools-resource
pkg:composer/drago-ex/project-account
Requires
- php: >=8.3 <9
- drago-ex/application: ^5.0
- drago-ex/component: ^4.0
- drago-ex/form: ^4.0
- drago-ex/permission: ^2.0
- drago-ex/project-auth: ^2.0
- drago-ex/translator: ^4.0.1
- drago-ex/utils: ^2.0
Requires (Dev)
- drago-ex/project-tools: ^1.0
- nette/tester: ^2.5
- phpstan/phpstan-nette: ^2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
The account page of the signed-in user in Drago Project: changing the name, the email address and the password.
Requirements
- PHP >= 8.3, < 9
- Drago Project
- Project Auth
Installation
composer require drago-ex/project-account
Project Tools copies the files of the package into the project,
where you adapt them. The page has its own entry point assets/account.js; its npm dependencies
(compostrap, Bootstrap Icons) are installed by npm install of the
project, then build the assets again (npm run vite:build).
Usage
The page is at /account (/en/account in English). Backend UI
and Front UI link it from their user menus; without them, link it
in your layout:
<a n:href=":Account:">{_'Account'}</a>
The Account presenter is outside the front and backend modules, so both can link it. The page shows who is
signed in (name, roles, email address) and two forms next to each other: the profile (name and email) and the
password change, where a new password shows its strength while it is typed. The menu of the navbar leads to the
website and to the administration (for users who may open it), switches the theme and signs out.
- Changing the email address requires the current password; the new address applies after it is confirmed by a link, and the previous address gets a notice.
- Wrong current passwords are limited to 5 per user in 15 minutes.
- New passwords follow the rules of Project Auth; changing the password signs out all other sessions.
Permissions
The rules are in Account/acl.neon: the resource Account, for signed-in users.
The same file describes the privileges (permissionLabels) for the permissions page of Project Permission.