File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,7 +76,8 @@ public function __construct(
7676 private IEventDispatcher $ dispatcher ,
7777 $ emitter = null ,
7878 ?IConfig $ config = null ,
79- $ urlGenerator = null ,
79+ ?IURLGenerator $ urlGenerator = null ,
80+ ?IAssertion $ assertion = null ,
8081 ) {
8182 $ this ->emitter = $ emitter ;
8283 $ this ->config = $ config ?? \OCP \Server::get (IConfig::class);
@@ -484,6 +485,11 @@ public function setEnabled(bool $enabled = true) {
484485 $ this ->config ->setUserValue ($ this ->uid , 'core ' , 'enabled ' , $ enabled ? 'true ' : 'false ' );
485486 $ this ->enabled = $ enabled ;
486487 };
488+
489+ if ($ oldStatus === false && $ enabled === true ) {
490+ $ this ->assertion ->createUserIsLegit ();
491+ }
492+
487493 if ($ this ->backend instanceof IProvideEnabledStateBackend) {
488494 $ queryDatabaseValue = function (): bool {
489495 if ($ this ->enabled === null ) {
You can’t perform that action at this time.
0 commit comments