diff --git a/bonfire/Libraries/Widgets/Charts/ChartsItem.php b/bonfire/Libraries/Widgets/Charts/ChartsItem.php index 038fd719..810b0b8d 100644 --- a/bonfire/Libraries/Widgets/Charts/ChartsItem.php +++ b/bonfire/Libraries/Widgets/Charts/ChartsItem.php @@ -274,14 +274,14 @@ public function getScript(): string } return ' - const data_' . $this->chartName() . ' = ' . json_encode($this->data()) . '; - const labels_' . $this->chartName() . ' = ' . json_encode($this->label()) . '; - ' . $backgroundColor . ' - ' . $borderColor . ' - const Chart_' . $this->chartName() . " = new Chart( - document.getElementById('" . $this->chartName() . "'), - drawChart( data_" . $this->chartName() . ', labels_' . $this->chartName() . ", '" . $this->title() . "', '" . $this->type() . "', " . $line_tension . ', backgroundColor_' . $this->chartName() . ' , borderColor_' . $this->chartName() . ', ' . $borderWidth . ', ' . $enableAnimation . ', ' . $showTitle . ', ' . $showSubTitle . ', ' . $showLegend . ', ' . $legendPosition . ') - );'; + const data_' . $this->chartName() . ' = ' . json_encode($this->data()) . '; + const labels_' . $this->chartName() . ' = ' . json_encode($this->label()) . '; + ' . $backgroundColor . ' + ' . $borderColor . ' + const Chart_' . $this->chartName() . " = new Chart( + document.getElementById('" . $this->chartName() . "'), + drawChart( data_" . $this->chartName() . ', labels_' . $this->chartName() . ", '" . $this->title() . "', '" . $this->type() . "', " . $line_tension . ', backgroundColor_' . $this->chartName() . ' , borderColor_' . $this->chartName() . ', ' . $borderWidth . ', ' . $enableAnimation . ', ' . $showTitle . ', ' . $showSubTitle . ', ' . $showLegend . ', ' . $legendPosition . ') + );'; } /** diff --git a/bonfire/Modules/Users/Controllers/UserSettingsController.php b/bonfire/Modules/Users/Controllers/UserSettingsController.php index b7360d09..63b00d97 100644 --- a/bonfire/Modules/Users/Controllers/UserSettingsController.php +++ b/bonfire/Modules/Users/Controllers/UserSettingsController.php @@ -61,25 +61,25 @@ public function save() return redirect()->back()->withInput()->with('errors', $this->validator->getErrors()); } - setting('Auth.allowRegistration', $this->request->getPost('allowRegistration') === 1); + setting('Auth.allowRegistration', $this->request->getPost('allowRegistration') ?? false); setting('Auth.minimumPasswordLength', (int) $this->request->getPost('minimumPasswordLength')); setting('Auth.passwordValidators', $this->request->getPost('validators')); setting('AuthGroups.defaultGroup', $this->request->getPost('defaultGroup')); // Actions $actions = setting('Auth.actions'); - $actions['login'] = (bool) $this->request->getPost('email2FA'); - $actions['register'] = (bool) $this->request->getPost('emailActivation'); + $actions['login'] = $this->request->getPost('email2FA') ?? false; + $actions['register'] = $this->request->getPost('emailActivation') ?? false; setting('Auth.actions', $actions); // Remember Me $sessionConfig = setting('Auth.sessionConfig'); - $sessionConfig['allowRemembering'] = $this->request->getPost('allowRemember') === 1; + $sessionConfig['allowRemembering'] = $this->request->getPost('allowRemember') ?? false; $sessionConfig['rememberLength'] = $this->request->getPost('rememberLength'); setting('Auth.sessionConfig', $sessionConfig); // Avatars - setting('Users.useGravatar', $this->request->getPost('useGravatar') === 1); + setting('Users.useGravatar', $this->request->getPost('useGravatar') ?? false); setting('Users.gravatarDefault', $this->request->getPost('gravatarDefault')); alert('success', lang('Bonfire.resourcesSaved', ['settings'])); diff --git a/bonfire/Modules/Users/Views/user_settings.php b/bonfire/Modules/Users/Views/user_settings.php index f8e4b1fc..71d1b19b 100644 --- a/bonfire/Modules/Users/Views/user_settings.php +++ b/bonfire/Modules/Users/Views/user_settings.php @@ -39,7 +39,7 @@ checked > -