TestAccounts
MMO\admin\helpers · 1 symbole · générée le 27 Oct 2026
TestAccounts
TestAccounts.php:26The test accounts of a checklist's recipe (recipe.accounts): as whom a check is done, and the account of this machine's database that fills the condition -- « an account limited to a group », « a consultant ».
- Espace de noms
MMO\admin\helpers
Index
| KEY | a profile's key | |
| MENTION | A text that says as whom a check is done -- but no profile may know it: connecté en compte limité, avec un compte sans admin, en administrateur, as an account limited to a group, `logged in… | |
| USERNAME | what a test account's username is: test. and a name | |
| DatabaseRefusal($mode, $uri, $database, $config) static | Why test accounts may not be made in a database: only on a development instance, in a database of this machine, the one configs/config.json declares -- never a copy of a client's (local.json po… | |
| Find($profiles, $text) static | ||
| IsLocalUri($uri) static | ||
| Mentions($text) static | ||
| Profiles($accounts, $errors) static | ||
| SiteRelative($url, $bases) static | An address a page opens, made relative to the site: an absolute one of another site, a scheme (javascript:), a protocol-relative one, a backslash or a .. are refused -- never a redirection else… |
Constantes3
KEY
a profile's key
MENTION
A text that says as whom a check is done -- but no profile may know it: connecté en compte limité, avec un compte sans admin, en administrateur, as an account limited to a group, logged in as a consultant.
USERNAME
what a test account's username is: test. and a name
Méthodes6
DatabaseRefusal($mode, $uri, $database, $config)
staticTestAccounts.php:106Why test accounts may not be made in a database: only on a development instance, in a database of this machine, the one configs/config.json declares -- never a copy of a client's (local.json pointing elsewhere).
| $mode | string | the instance's (MMO_MODE) |
| $uri | null | string | the database server's address (mongodb://127.0.0.1/), never shown: it may hold a password |
| $database | null | string | the database's name |
| $config | string | configs/config.json, as it is written |
| retourne | null | string | the refusal, null when it may |
Find($profiles, $text)
staticTestAccounts.php:81| $profiles | array | |
| $text | string | a check's text |
| retourne | null | string | the key of the profile whose match is found first in $text (the first declared on a tie); null for none |
IsLocalUri($uri)
staticTestAccounts.php:127Mentions($text)
staticTestAccounts.php:92Profiles($accounts, $errors)
staticTestAccounts.php:49| $accounts | mixed | a recipe's accounts |
| $errors = null | null | array | what was refused, and why |
| retourne | array | array{username: string, label: string, match: ?string, roles: list<string>, groups: list<string>, description: string, self: bool}> the valid profiles, by key: a username that is not a test account's, or a match that is no regular expression, leaves the profile out; a self one (the account logged in) has no username |
SiteRelative($url, $bases)
staticTestAccounts.php:146An address a page opens, made relative to the site: an absolute one of another site, a scheme (javascript:), a protocol-relative one, a backslash or a .. are refused -- never a redirection elsewhere.
| $url | string | as an item gives it: relative to the site, or absolute |
| $bases | array | the site's own absolute addresses (the recipe's site, the application's url) |
| retourne | null | string | the address relative to the site (gestion/accidents?id=1), null when it is not one of the site's |