Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.

Commit

Permalink
Use site action to determine checkbox processing
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Gipetto committed Aug 17, 2015
1 parent 53a4ffb commit 0ea5c68
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions OpenVBX/controllers/settings/site.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0ea5c68

Please sign in to comment.