Mark given area as configured.

@param UserConfigurationListener $listener
@param AreaContract $area
@return type
169558
public function markAsConfigured(UserConfigurationListener $listener, AreaContract $area)
    {

        $service    = app(TwoFactorProvidersService::class);
        $service->bind();
        $provider   = $service->getEnabledInArea($area);
        $userConfig = $this->userConfigService->getSettingsByArea($area);
        $secretKey  = $userConfig->settings['secret_key'];
        $form       = app(\Antares\Modules\TwoFactorAuth\Http\Presenters\AuthPresenter::class)->verify($userConfig, $area, $provider, $secretKey);


        return $listener->afterConfiguration($form);
    }
1307568
public function create(RuleListener $listener)
    {
        $rule = new Rule();
        $form = $this->presenter->form($rule);

        return $listener->showCreateForm(compact('rule', 'form'));
    }
369871
function GrantAddContentToLayoutArea(Area $area)
    {
        $result = $this->Grant(BackendAction::Create(), $area);
        if (!$result->ToBool())
        {
            return $result;
        }
        return $this->GrantAddContentToLayout($area->GetLayout());
    }
780421
public function addCountry()
    {
        // Check current user authorization
        if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE)) {
            return $response;
        }

        $areaCountryForm = $this->createForm(AdminForm::AREA_COUNTRY);
        $error_msg = null;
        try {
            $form = $this->validateForm($areaCountryForm);

            $event = new AreaAddCountryEvent($form->get('area_id')->getData(), $form->get('country_id')->getData());

            $this->dispatch(TheliaEvents::AREA_ADD_COUNTRY, $event);

            if (! $this->eventContainsObject($event)) {
                throw new \LogicException(
                    $this->getTranslator()->trans("No %obj was updated.", array('%obj', $this->objectName))
                );
            }

            // Log object modification
            if (null !== $changedObject = $this->getObjectFromEvent($event)) {
                $this->adminLogAppend(
                    $this->resourceCode,
                    AccessManager::UPDATE,
                    sprintf(
                        "%s %s (ID %s) modified, new country added",
                        ucfirst($this->objectName),
                        $this->getObjectLabel($changedObject),
                        $this->getObjectId($changedObject)
                    ),
                    $this->getObjectId($changedObject)
                );
            }

            // Redirect to the success URL
            return $this->generateSuccessRedirect($areaCountryForm);
        } catch (FormValidationException $ex) {
            // Form cannot be validated
            $error_msg = $this->createStandardFormValidationErrorMessage($ex);
        } catch (\Exception $ex) {
            // Any other error
            $error_msg = $ex->getMessage();
        }

        $this->setupFormErrorContext(
            $this->getTranslator()->trans("%obj modification", array('%obj' => $this->objectName)),
            $error_msg,
            $areaCountryForm
        );

        // At this point, the form has errors, and should be redisplayed.
        return $this->renderEditionTemplate();
    }
510373
def register_area(self, area_code, index, userdata):
        
        size = ctypes.sizeof(userdata)
        logger.info("registering area %s, index %s, size %s" % (area_code,
                                                                index, size))
        size = ctypes.sizeof(userdata)
        return self.library.Srv_RegisterArea(self.pointer, area_code, index,
                                             ctypes.byref(userdata), size)
481622
public static function configure(EventManagerInterface $eventManager, ServiceLocatorInterface $serviceLocator, array $listeners)
    {
        if (!empty($listeners)) {
            foreach ($listeners as $key => $value) {
        
                if ($value instanceof ListenerAggregateInterface) {
                    $listener = $value;
                } elseif(is_string($value) && $serviceLocator->has($value)) {
                    $listener = $serviceLocator->get($value);
                } elseif(is_string($value) && class_exists($value)) {
                    $listener = new $value();
                } else {
                    $listener = $value;
                }
        
                if ($listener instanceof ListenerAggregateInterface) {
                    $eventManager->attachAggregate($listener);
                } elseif (isset($listener['event']) && isset($listener['callback'])) {
                    $eventManager->attach($listener['event'], $listener['callback']);
                } else {
                    throw new InvalidListenerException(
                            sprintf("Listener for service ID %s doesn't implement ListenerAggregateInterface", $value));
                }
            }
        }
    }
1352779
public void registerListener(ConfigurationListener<T> listener) {
        Util.notNull(listener, "Configuration listener");
        listeners.add(listener);
    }
540677
public function update(ConfigurationListener $listener, array $input)
    {
        try {
            $this->providersRepository->update($input);
            $msg = trans('antares/two_factor_auth::configuration.responses.update.success');

            return $listener->updateSuccess($msg);
        } catch (Exception $e) {
            Log::emergency($e);

            $msg = trans('antares/two_factor_auth::configuration.responses.update.fail');
            return $listener->updateFailed($msg);
        }
    }
1101214
public static <PS, SEG, S> Consumer<PlainTextChange> applyPlainTextChange(GenericStyledArea<PS, SEG, S> area) {
        return change -> area.replaceText(change.getPosition(), change.getRemovalEnd(), change.getInserted());
    }
539951
private function configureListeners(array $listenersConfig, ContainerBuilder $container): void
    {
        $container->getDefinition('fivelab.resource.event_listener.exception')
            ->replaceArgument(3, $listenersConfig['exception']['debug_parameter']);

        if ($this->isConfigEnabled($container, $listenersConfig['validation'])) {
            if (!interface_exists(ValidatorInterface::class)) {
                throw new \RuntimeException('The validation listener is enabled but the Symfony/Validator not installed. Please install Symfony/Validator package.');
            }
        } else {
            $container->removeDefinition('fivelab.resource.event_listener.validate_resource');
        }

        if ($this->isConfigEnabled($container, $listenersConfig['symfony_security'])) {
            if (!interface_exists(AuthorizationCheckerInterface::class)) {
                throw new \RuntimeException('The security listener is enabled but the Symfony/Security not installed. Please install Symfony/Security package.');
            }
        } else {
            $container->removeDefinition('fivelab.resource.serializer.event_listener.symfony_granted_relation');
            $container->removeDefinition('fivelab.resource.serializer.event_listener.symfony_granted_action');
        }
    }
99342
public void addConfigurationListener(NodeConfigListener listener) {
        StanzaListener conListener = new NodeConfigTranslator(listener);
        configEventToListenerMap.put(listener, conListener);
        pubSubManager.getConnection().addSyncStanzaListener(conListener, new EventContentFilter(EventElementType.configuration.toString()));
    }
469217
public function execute(ConnectUser $listener, $type, $hasCode = false)
    {
        $provider = $this->socialite->with($type);

        if (! $hasCode) {
            return $this->getAuthorizationFirst($provider);
        }

        $data = $this->getUserData($provider, $type);

        $this->session->put('orchestra.oneauth', $data);

        return $listener->userHasConnected($data, $this->auth);
    }
387512
public function edit(SettingUpdateListener $listener)
    {
        $memory = $this->memory;

        $eloquent = new Fluent([
            'mode' => $memory->get('site.mode', 'development')
        ]);

        $form = $this->presenter->form($eloquent);
        return $listener->showSettingChanger(compact('eloquent', 'form'));
    }
227470
public function setEventListener($listener)
	{
		$this->ensureEventListeners();
		
		$this->_eventListeners[Ioc::resolveClassName($listener)] =  $listener;
		
		return $this;
	}
1229759
public function index(SyncListener $listener, $area, $locale = null)
    {
        $lang = is_null($locale) ? app()->getLocale() : $locale;
        try {
            if (Translation::where('area', $area)->where('locale', $locale)->count()) {
                return redirect(handles('antares::translations/index/' . $area . '/' . $lang));
            }
            if (!is_null($locale)) {
                $this->synchronizer->synchronize(lang($locale), $area);
            } else {
                DB::transaction(function() use($area) {
                    $langs = app('languages')->langs();
                    foreach ($langs as $lang) {
                        $this->synchronizer->synchronize($lang, $area);
                    }
                });
            }
            return $listener->syncSuccess($area, $lang);
        } catch (Exception $e) {
            Log::warning($e);
            return $listener->syncFailed($area, $lang);
        }
    }
28080
public function edit(UserUpdaterListener $listener, $id)
    {
        $eloquent = Foundation::make('orchestra.user')->findOrFail($id);
        $form = $this->presenter->form($eloquent, 'update');

        $this->fireEvent('form', [$eloquent, $form]);

        return $listener->showUserChanger(\compact('eloquent', 'form'));
    }
1013160
public void registerListener(ConfigurationListener<?> listener) {
    if(!listeners.contains(listener)) {
      listeners.add(listener);
      Set<ConfigurationListener<?>> newListener = new HashSet<ConfigurationListener<?>>();
      newListener.add(listener);
      notifyListeners(newListener, liveConfigParser, log);
    }
  }