Review main Merged

77638[TASK] Avoid backend.user request attribute

Christian Kuhn CR +2 V +2 Easy +16 −23 updated 02/01/23, 17:49

Commit message

The user authentication classes are still pretty messy.
A subset of properties and information of backend user
state is intitialized by middlewares and set as aspect
to the context object.

However, we do not want to add the entire backend user
as $request attribute object, to not surface another usage
of this object. Instead, it is set as $GLOBALS['BE_USER']
throughout the core, which will eventually vanish at
some point, by being substituted by something better.

ext:reactions currently violates this. The patch sets
$GLOBALS['BE_USER'], consuming reactions should retrieve
it from there if needed, just like any other backend
related class does it currently.

FormProtectionFactory had a similar flaw, it accessed
the attribute even though no middleware ever set this.

Finally, .phpstorm.meta.php is cleaned up, to not
declare this request attribute any longer.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 6