From: Evan Prodromou Date: Sun, 8 Nov 2009 04:16:34 +0000 (-0500) Subject: only load user once, reload settings in admin panel X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=dd9fa0e6833432b1936a6375e4cb411fe340dec8;p=quix0rs-gnu-social.git only load user once, reload settings in admin panel --- diff --git a/lib/adminpanelaction.php b/lib/adminpanelaction.php index 2e9261711b..fa3272f8aa 100644 --- a/lib/adminpanelaction.php +++ b/lib/adminpanelaction.php @@ -75,6 +75,10 @@ class AdminPanelAction extends Action $user = common_current_user(); + // ...because they're logged in + + assert(!empty($user)); + // It must be a "real" login, not saved cookie login if (!common_is_real_login()) { @@ -88,8 +92,6 @@ class AdminPanelAction extends Action // User must have the right to change admin settings - $user = common_current_user(); - if (!$user->hasRight(Right::CONFIGURESITE)) { $this->clientError(_('You cannot make changes to this site.')); return; @@ -116,6 +118,10 @@ class AdminPanelAction extends Action try { $this->saveSettings(); + // Reload settings + + Config::loadSettings(); + $this->success = true; $this->msg = _('Settings saved.'); } catch (Exception $e) {