1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-08 15:57:01 +02:00

Add support for an experimental $config->userOutputFormatting setting and update ProcessProfile to support.

This commit is contained in:
Ryan Cramer
2024-07-05 15:48:25 -04:00
parent 18084dd8ef
commit e08fa2e957
4 changed files with 23 additions and 2 deletions

View File

@@ -156,6 +156,7 @@
*
* @property string $userAuthSalt Salt generated at install time to be used as a secondary/non-database salt for the password system. #pw-group-session
* @property string $userAuthHashType Default is 'sha1' - used only if Blowfish is not supported by the system. #pw-group-session
* @property bool $userOutputFormatting Enable output formatting for current $user API variable at boot? (default=false) #pw-group-session @since 3.0.241
* @property string $tableSalt Additional hash for other (non-authentication) purposes. #pw-group-system @since 3.0.164
*
* @property bool $internal This is automatically set to FALSE when PW is externally bootstrapped. #pw-group-runtime

View File

@@ -601,7 +601,9 @@ class ProcessWire extends Wire {
// the current user can only be determined after the session has been initiated
$session = $this->wire('session', new Session($this), true);
$this->initVar('session', $session);
$this->wire('user', $users->getCurrentUser());
$user = $users->getCurrentUser();
if($config->userOutputFormatting) $user->of(true);
$this->wire('user', $user);
$input = $this->wire('input', new WireInput(), true);
if($config->wireInputLazy) $input->setLazy(true);