Skip to content

Commit

Permalink
See comments in #248
Browse files Browse the repository at this point in the history
  • Loading branch information
ntadmin committed May 14, 2015
1 parent e01585b commit f28c061
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Superfecta.class.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ public function execute($scheme='ALL', $request, $debug=0, $keepGoing=false) {
include __DIR__ . '/includes/processors/superfecta_multi.php';
include __DIR__ . '/includes/processors/superfecta_single.php';



global $db, $amp_conf, $astman;
$options = array(
'db' => $db,
'db' => $this->db,
'amp_conf' => $amp_conf,
'astman' => $astman,
'debug' => 0,
Expand Down Expand Up @@ -453,10 +455,12 @@ public function ajaxHandler() {
$scheme = $_REQUEST['scheme'];
$source = $_REQUEST['source'];

$sql = "REPLACE INTO superfectaconfig (source,field,value) VALUES (?, ?, ?)";
$sth = $this->db->prepare($sql);
foreach($params as $key => $data) {
$sql = "REPLACE INTO superfectaconfig (source,field,value) VALUES (?, ?, ?)";
$sth = $this->db->prepare($sql);
$sth->execute(array($scheme . "_" . $source, $key, $_POST[$key]));
if (strcmp($data['type'], 'internal') != 0) {
$sth->execute(array($scheme . "_" . $source, $key, $_POST[$key]));
}
}
return array("status" => true);
break;
Expand Down
8 changes: 8 additions & 0 deletions includes/superfecta_base.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,14 @@ function settings() {
return($settings);
}

function updateParameter($param_name, $new_value) {
$source = str_replace("base_", "", $_REQUEST['scheme']) . "_" . get_class($this);
$sql = "REPLACE INTO superfectaconfig (source,field,value) VALUES (?, ?, ?)";
$sth = $this->db->prepare($sql);
$sth->execute(array($source, $param_name, $new_value));
return true;
}

function out($message) {
if ($this->isDebug()) {
if (!$this->cli) {
Expand Down

0 comments on commit f28c061

Please sign in to comment.