mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-11-05 04:02:56 -05:00
UsersController::view() and edit() assigned their permission check with `$canX = A or B;`. `=` binds tighter than `or`, so only A was stored and the self check was dropped: with ZM_USER_SELF_EDIT on, a user without System=Edit got 401 on PUT users/<own id>.json. beforeFilter() also refused every user with System=None before view() or edit() ran. Let beforeFilter() through view and edit of the user's own record while ZM_USER_SELF_EDIT is on, use || in both checks, and limit what such a user saves to the fields the web UI allows for self edit (includes/actions/user.php): Password, Language and HomeView. The request data is rebuilt from those three fields, so Id, System, permissions and the rest are never saved; a Language without a lang file is refused as in the UI. Users with System=Edit save as before. Self view follows the web UI too: a user without System permission sees their own record only while ZM_USER_SELF_EDIT is on. fixes #5242 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ZoneMinder API
This is the ZoneMinder API. It should be, for now, installed under the webroot e.g. /api.
app/Config/database.php.default must be configured and copied to app/Config/database.php
In addition, Security.salt and Security.cipherSeed in app/Config/core.php should be changed.
The API can run on a dedicated / separate instance, so long as it can access the database as configured in app/Config/database.php