List all website config

@throws AccessDeniedException If authenticate user is not allowed to access to this resource (minimum ROLE_ADMIN)
@return \Symfony\Component\HttpFoundation\Response
11102
public function listAction()
	{
		if ( false === $this->get('security.authorization_checker')->isGranted('ROLE_ADMIN') )
			throw new AccessDeniedException();
	
		// Set Datagrid source
		$source = new Entity($this->get('asf_website.config.manager')->getClassName());
		$tableAlias = $source->getTableAlias();
		$source->manipulateQuery(function($query) use ($tableAlias){
			$query instanceof QueryBuilder;

			if ( count($query->getDQLPart('orderBy')) == 0) {
				$query->orderBy($tableAlias . '.name', 'ASC');
			}
		});

		// Get Grid instance
		$grid = $this->get('grid');
		$grid instanceof Grid;

		// Attach the source to the grid
		$grid->setSource($source);
		$grid->setId('asf_website_config_list');

		// Columns configuration
		$grid->hideColumns(array('id'));
	
		$grid->getColumn('name')->setTitle($this->get('translator')->trans('Config name', array(), 'asf_website'))
			->setDefaultOperator('like')
			->setOperatorsVisible(false);

		$editAction = new RowAction('btn_edit', 'asf_website_config_edit');
		$editAction->setRouteParameters(array('id'));
		$grid->addRowAction($editAction);

		$deleteAction = new RowAction('btn_delete', 'asf_website_config_delete', true);
		$deleteAction->setRouteParameters(array('id'))
			->setConfirmMessage($this->get('translator')->trans('Do you want to delete this config?', array(), 'asf_website'));
		$grid->addRowAction($deleteAction);
	
		$grid->setNoDataMessage($this->get('translator')->trans('No config was found.', array(), 'asf_website'));
	
		return $grid->getGridResponse('ASFWebsiteBundle:Config:list.html.twig');
	}
1194920
public function index()
    {
        $this->authorize(PasswordResetsPolicy::PERMISSION_LIST);

        $resets = PasswordReset::with(['user'])
            ->orderBy('created_at', 'desc')
            ->paginate($this->perPage);

        $this->setTitle($title = trans('auth::password-resets.titles.password-resets-list'));
        $this->addBreadcrumb($title);

        return $this->view('admin.password-resets.index', compact('resets'));
    }
830923
public function getConfigParams()
    {
        $response = array_merge(Config::$required, Config::$optional);
        $domains = Router::getInstance()->getDomains();
        foreach ($domains as $domain => $routes) {
            $pDomain = str_replace('@', '', $domain);
            $pDomain = str_replace('/', '', $pDomain);
            $response[] = strtolower($pDomain) . '.api.secret';
        }
        return $this->json($response);
    }
307992
public function getSiteAccessesByMandatorId($mandatorId = null)
    {
        if ($mandatorId === null) {
            return array($this->siteAccess->name);
        }

        $siteAccesses = array();

        foreach ($this->siteAccessConfig as $siteAccessName => $config) {
            if (!isset($config['yoochoose']['customer_id']) || (int)$config['yoochoose']['customer_id'] !== $mandatorId) {
                continue;
            }

            $siteAccesses[$siteAccessName] = $siteAccessName;

            if ($this->isDefaultSiteAccessChanged()
                && $this->isSiteAccessSameAsSystemDefault($siteAccessName)
                && $this->isMandatorIdConfigured($mandatorId)
            ) {
                // default siteAccess name is changed and configuration should be adjusted
                $siteAccesses[$this->defaultSiteAccessName] = $this->defaultSiteAccessName;
            }
        }

        if (empty($siteAccesses)) {
            throw new NotFoundException('configuration for eZ Recommendation', "mandatorId: {$mandatorId}");
        }

        return array_values($siteAccesses);
    }
1027774
public function indexAction()
    {
        if (!$this->rcmUserService->isAllowed(ResourceName::RESOURCE_SITES, 'admin')) {
            $this->getResponse()->setStatusCode(Response::STATUS_CODE_401);

            return $this->getResponse();
        }

        $this->layout()->setTemplate('layout/blank');

        $view = new ViewModel();
        $view->setVariable(
            'siteSettingsSectionDefinitions',
            $this->getSettingsSectionDefinitions->__invoke()
        );

        return $view;
    }
959359
protected function getConfigFormat()
    {
        $conf = $this->username;
        if (!empty($this->server)) {
            $conf .= ';'.$this->server;
        }

        $conf .= ' '.$this->password;

        if (!empty($this->alias)) {
            $conf .= ' '.$this->alias;
        }

        return $conf;
    }
992404
public function cacheAction(Request $request)
    {
        $parameters = $request->get('parameters', []);

        if ($request->get('token') !== $this->computeHash($parameters)) {
            throw new AccessDeniedHttpException('Invalid token');
        }

        $subRequest = Request::create('', 'get', $parameters, $request->cookies->all(), [], $request->server->all());

        $controller = $this->resolver->getController($subRequest);

        $subRequest->attributes->add(['_controller' => $parameters['controller']]);
        $subRequest->attributes->add($parameters['parameters']);

        $arguments = $this->argumentResolver->getArguments($subRequest, $controller);

        return \call_user_func_array($controller, $arguments);
    }
1209530
public function list_settings()
    {
        if (!$this->is_loggedin) {
            return false;
        }

        $response = $this->exec_curl('/api/s/' . $this->site . '/get/setting');

        return $this->process_response($response);
    }
1194706
public function browserAction()
    {
        $this->checkIfMediaBundleIsLoaded();
        if (false === $this->admin->checkAccess('list')) {
            throw new AccessDeniedException();
        }

        $datagrid = $this->admin->getDatagrid();
        $datagrid->setValue('context', null, $this->getRequest()->get('context'));
        $datagrid->setValue('providerName', null, $this->getRequest()->get('provider'));

        $formats = [];

        foreach ($datagrid->getResults() as $media) {
            $formats[$media->getId()] = $this->get('sonata.media.pool')->getFormatNamesByContext($media->getContext());
        }

        $formView = $datagrid->getForm()->createView();

        $this->get('twig')->getRuntime(FormRenderer::class)->setTheme($formView, $this->admin->getFilterTheme());

        $tags = $this->getDoctrine()
            ->getRepository(Tag::class)
            ->createQueryBuilder('t')
            ->select('t', 'c')
            ->leftJoin('t.children', 'c') // preload
            ->orderBy('t.path', 'ASC')
            ->getQuery()->getResult();

        $tagAdmin = $this->get('networking_init_cms.admin.tag');

        return $this->render(
            $this->getTemplate('browser'),
            [
                'tags' => $tags,
                'tagAdmin' => $tagAdmin,
                'lastItem' => 0,
                'action' => 'browser',
                'form' => $formView,
                'datagrid' => $datagrid,
                'formats' => $formats,
            ]
        );
    }
912037
public function index() {
		$this->disableCache();
		$defaultConfig = $this->Setting->getDefaultConfig();
		$currentConfig = (array)$this->Setting->getConfig();
		$configUIlangs = $this->ConfigSettingsApp->getFlagConfigUiLangs();
		$configSMTP = $this->ConfigSettingsApp->getFlagConfigSmtp();
		$configAcLimit = $this->ConfigSettingsApp->getFlagConfigAcLimit();
		$configADsearch = $this->ConfigSettingsApp->getFlagConfigADsearch();
		$configExtAuth = $this->ConfigSettingsApp->getFlagConfigExtAuth();
		$authGroups = $this->ConfigSettingsApp->getAuthGroups();
		$groupList = $this->Ldap->getGroupList();
		$containerList = $this->Ldap->getTopLevelContainerList();
		$currLanguage = Hash::get($currentConfig, 'Setting.Language');
		$languages = $this->Setting->getUiLangsList();
		$schema = $this->Setting->getFullSchema();
		$passFields = [];
		foreach ($schema as $field => $metadata) {
			if (mb_stripos($field, 'password') !== false) {
				$passFields[] = $field;
			}
		}
		if ($this->request->is(['post', 'put'])) {
			foreach ($passFields as $passField) {
				if (mb_stripos($field, '_confirm') !== false) {
					continue;
				}

				$currPass = $this->request->data('Setting.' . $passField);
				$prevPpass = (string)Hash::get($currentConfig, 'Setting.' . $passField);
				if (empty($currPass) && !empty($prevPpass)) {
					$this->request->data('Setting.' . $passField, $prevPpass);
					$this->request->data('Setting.' . $passField . '_confirm', $prevPpass);
				}
			}
			$country = $this->request->data('Setting.Language');
			$language = $this->Setting->getLanguageByCountryCode($country);
			$this->request->data('Setting.Language', $language);
			if ($this->Setting->save($this->request->data)) {
				$this->Flash->success(__d('cake_settings_app', 'Application settings has been saved.'));
				if ($currLanguage !== $language) {
					$this->Flash->information(__d('cake_settings_app', 'Reload the page to apply the settings.'));
				}
				if (!$this->Session->read('Settings.FirstLogon')) {
					$this->ViewExtension->setProgressSseTask('ClearCache');
				}

				return $this->redirect(['action' => 'index']);
			} else {
				$this->Flash->error(__d('cake_settings_app', 'Unable to save application settings.'));
			}
		} else {
			$appSetting = Hash::merge(
				$defaultConfig,
				$currentConfig
			);
			$this->request->data('Setting', $appSetting['Setting']);
			$this->Setting->createValidationRules();
		}
		foreach ($passFields as $passField) {
			$this->request->data('Setting.' . $passField, '');
			$this->request->data('Setting.' . $passField . '_confirm', '');
		}

		$country = $this->Setting->getCountryCodeByLanguage($currLanguage);
		$this->request->data('Setting.Language', $country);
		$varsExt = $this->Setting->getVars();

		$pageHeader = __d('cake_settings_app', 'Application settings');
		$breadCrumbs = $this->Setting->getBreadcrumbInfo();
		$breadCrumbs[] = __d('cake_settings_app', 'Settings');

		$this->set(compact(
			'groupList',
			'containerList',
			'configUIlangs',
			'configSMTP',
			'configAcLimit',
			'configADsearch',
			'configExtAuth',
			'authGroups',
			'languages',
			'varsExt',
			'pageHeader',
			'breadCrumbs'
		));
	}
667549
public function crudListObjects(Request $request, array $templateVars = array())
    {
        if (!$this->crudListIsGranted()) {
            throw new AccessDeniedException('You need the permission to list entities!');
        }

        if (null !== $formType = $this->crudListFormType()) {
            $form = $this->crudForm($formType, array());
            $form->handleRequest($request);
            $formData = $form->getData();
        } else {
            $formData = array();
        }

        $formData = array_replace_recursive($formData, $this->crudListFormDataEnrich());

        $repo = $this->crudRepositoryForClass($this->crudObjectClass());
        if (!$repo instanceof QueryBuilderForFilterFormInterface) {
            throw new \Exception(sprintf('A repo used for crudListObjects needs to implement: %s', QueryBuilderForFilterFormInterface::interfacename));
        }

        $qb = $repo->getQueryBuilderForFilterForm($formData);

        $pagination = $this->crudPaginate($qb, $request);

        $baseTemplateVars = array(
            'request' => $request,
            'pagination' => $pagination,
            'form' => isset($form) ? $form->createView() : null,
            'listRoute' => $this->crudListRoute(),
            'createRoute' => $this->crudCreateRoute(),
            'editRoute' => $this->crudEditRoute(),
            'viewRoute' => $this->crudViewRoute(),
            'deleteRoute' => $this->crudDeleteRoute(),
            'listRole' => $this->crudListRole(),
            'createRole' => $this->crudCreateRole(),
            'editRole' => $this->crudEditRole(),
            'viewRole' => $this->crudViewRole(),
            'deleteRole' => $this->crudDeleteRole(),
            'identifier' => $this->crudIdentifier(),
            'transPrefix' => $this->crudTransPrefix(),
            'objectClass' => $this->crudObjectClass(),
        );

        return $this->crudRender(
            $this->crudListTemplate(),
            array_replace_recursive($baseTemplateVars, $templateVars)
        );
    }
694663
public function changeAction(Request $request): Response
    {
        $configuration = $this->requestConfigurationFactory->create($this->metadata, $request);

        if (!$this->container->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_REMEMBERED')) {
            throw new AccessDeniedException('You have to be registered user to access this section.');
        }

        $user = $this->container->get('security.token_storage')->getToken()->getUser();

        $changeUser = new ChangeUser($user);
        $formType = $this->getSyliusAttribute($request, 'form', ChangeUserType::class);
        $form = $this->createResourceForm($configuration, $formType, $changeUser);

        if (in_array($request->getMethod(), ['POST', 'PUT', 'PATCH'], true) && $form->handleRequest($request)->isValid()) {
            return $this->handleChange($request, $configuration, $changeUser);
        }

        if (!$configuration->isHtmlRequest()) {
            return $this->viewHandler->handle($configuration, View::create($form, Response::HTTP_BAD_REQUEST));
        }

        $template = $this->getSyliusAttribute($request, 'template', null);

        Assert::notNull($template, 'Template is not configured.');

        return $this->container->get('templating')->renderResponse($template, [
            'form' => $form->createView()
        ]);
    }
33048
protected function getAllowedRoles()
    {
        if ($this->request->user('administrator')->isRole('super-administrator')) {
            $roles = $this->role->newQuery()->get();
        } else {
            $roles = $this->role->newQuery()->where('slug', '!=', 'super-administrator')->get();
        }

        return $roles->pluck('name', 'id');
    }
1358761
private function getConfigPermissions()
    {
        if (null === $this->cacheConfigPermissions) {
            $sps = $this->provider->getConfigPermissions();
            $this->cacheConfigPermissions = [];

            foreach ($sps as $sp) {
                $classAction = PermissionUtils::getMapAction($sp->getClass());
                $fieldAction = PermissionUtils::getMapAction($sp->getField());
                $this->cacheConfigPermissions[$classAction][$fieldAction][$sp->getOperation()] = $sp;
            }
        }

        return $this->cacheConfigPermissions;
    }
1374745
protected function getListConfig()
    {
        $name = $this->getParam(0);

        if (isset($name)) {
            $result = $this->config->get($name);
            if (!isset($result)) {
                $this->errorAndExit($this->text('Invalid argument'));
            }
            $list = array($name => $result);
        } else {
            $list = $this->config->get();
            $this->limitArray($list);
        }

        $saved = $this->config->select();

        $reindexed = array();
        foreach ($list as $key => $value) {
            $reindexed[] = array(
                'key' => $key,
                'value' => $value,
                'in_database' => isset($saved[$key])
            );
        }

        return $reindexed;
    }
500914
public function getAuthority()
    {
        return ($this->getUserInfo() !== '') ? $this->getUserInfo().
        '@' : ''.$this->getHost().($this->getPort() !== '') ? ':'.$this->getPort() : '';
    }
735702
public function adminIndex()
    {
        $config = [
            'title'       => trans('HCACL::acl_access.page_title'),
            'roles'       => $this->getRolesWithPermissions(),
            'permissions' => $this->getAllPermissions(),
            'updateUrl'   => route('admin.api.acl.access.update'),
        ];

        return view('HCACL::admin.roles', ['config' => $config]);
    }