From 0ea5c68a9a7ed67b8c816b463573fc553ec26e8e Mon Sep 17 00:00:00 2001 From: Shawn Parker Date: Mon, 17 Aug 2015 10:40:55 -0700 Subject: [PATCH] Use site action to determine checkbox processing Properly set and use the route action to help us determine what settings page we are processing and use it to gate the handling of checkboxes on the site settings page. --- OpenVBX/controllers/settings/site.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/OpenVBX/controllers/settings/site.php b/OpenVBX/controllers/settings/site.php index 3f133979..694f58fe 100644 --- a/OpenVBX/controllers/settings/site.php +++ b/OpenVBX/controllers/settings/site.php @@ -38,7 +38,7 @@ function __construct() $this->admin_only($this->section); } - public function index($action = '', $id = false) + public function index($action = 'site', $id = false) { return $this->site($action, $id); } @@ -311,18 +311,15 @@ private function update_site() $this->settings->add($name, trim($value), $this->tenant->id); } } - - // rewrite enabled is a marker to detect which group of settings - // we're currently saving - // @todo - include a 'section' or 'group' param in the submitted - // data to do this instead and make it more clear to what's happening - if (isset($site['rewrite_enabled'])) + + if ($this->form_action == 'site') { foreach ($notification_settings as $name) { $value = (!empty($site[$name]) ? 1 : 0); $this->settings->add($name, $value, $this->tenant->id); } + } // Connect App (if applicable)