Skip to content

Commit

Permalink
clear cache after changing active authentication methods, fixed #3936
Browse files Browse the repository at this point in the history
  • Loading branch information
Guite authored Nov 11, 2018
1 parent 5efb38f commit b4fe3ae
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/system/UsersModule/Controller/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,17 @@ public function authenticationMethodsAction(Request $request)
if ($form->get('save')->isClicked()) {
$data = $form->getData();
if (!in_array(true, $data['authenticationMethodsStatus'])) {
$data['authenticationMethodsStatus']['native_uname'] = true; // do not allow all methods to be inactive.
// do not allow all methods to be inactive.
$data['authenticationMethodsStatus']['native_uname'] = true;
$this->addFlash('info', $this->__f('All methods cannot be inactive. At least one methods must be enabled. (%m has been enabled).', ['%m' => $allMethods['native_uname']->getDisplayName()]));
}
$this->get('zikula_extensions_module.api.variable')->set(VariableApi::CONFIG, 'authenticationMethodsStatus', $data['authenticationMethodsStatus']);
$this->addFlash('status', $this->__('Done! Configuration updated.'));

// clear cache to reflect the updated state (#3936)
$this->get('zikula.cache_clearer')->clear('symfony');
$this->get('zikula.cache_clearer')->clear('twig');

return $this->redirectToRoute('zikulausersmodule_config_authenticationmethods');
}
if ($form->get('cancel')->isClicked()) {
Expand Down

0 comments on commit b4fe3ae

Please sign in to comment.