forked from GNUsocial/gnu-social
only load user once, reload settings in admin panel
This commit is contained in:
parent
144f817109
commit
dd9fa0e683
@ -75,6 +75,10 @@ class AdminPanelAction extends Action
|
|||||||
|
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
|
|
||||||
|
// ...because they're logged in
|
||||||
|
|
||||||
|
assert(!empty($user));
|
||||||
|
|
||||||
// It must be a "real" login, not saved cookie login
|
// It must be a "real" login, not saved cookie login
|
||||||
|
|
||||||
if (!common_is_real_login()) {
|
if (!common_is_real_login()) {
|
||||||
@ -88,8 +92,6 @@ class AdminPanelAction extends Action
|
|||||||
|
|
||||||
// User must have the right to change admin settings
|
// User must have the right to change admin settings
|
||||||
|
|
||||||
$user = common_current_user();
|
|
||||||
|
|
||||||
if (!$user->hasRight(Right::CONFIGURESITE)) {
|
if (!$user->hasRight(Right::CONFIGURESITE)) {
|
||||||
$this->clientError(_('You cannot make changes to this site.'));
|
$this->clientError(_('You cannot make changes to this site.'));
|
||||||
return;
|
return;
|
||||||
@ -116,6 +118,10 @@ class AdminPanelAction extends Action
|
|||||||
try {
|
try {
|
||||||
$this->saveSettings();
|
$this->saveSettings();
|
||||||
|
|
||||||
|
// Reload settings
|
||||||
|
|
||||||
|
Config::loadSettings();
|
||||||
|
|
||||||
$this->success = true;
|
$this->success = true;
|
||||||
$this->msg = _('Settings saved.');
|
$this->msg = _('Settings saved.');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user