예제 #1
0
 public function update()
 {
     global $db;
     global $auth_session;
     $domain_id = $auth_session->domain_id;
     //dont worry about checking db if were using the core extension
     if ($this->extension_name != "core") {
         $extension_id = getExtensionID($extension_name);
     } else {
         $extension_id = 0;
     }
     if (!($extension_id >= 0)) {
         die(htmlsafe("Invalid extension name: " . $extension));
     }
     $sql = "INSERT INTO \n\t\t\t`" . TB_PREFIX . "system_defaults`\n\t\t\t(\n\t\t\t\t`name`, `value`, domain_id, extension_id\n\t\t\t)\n\t\t\tVALUES \n\t\t\t(\n\t\t\t\t:name, :value, :domain_id, :extension_id\n\t\t\t) \n\t\t\tON DUPLICATE KEY UPDATE\n\t\t\t\t`value` =  :value";
     if ($db->query($sql, ':value', $value, ':domain_id', $domain_id, ':name', $name, ':extension_id', $extension_id)) {
         return true;
     }
     return false;
 }
예제 #2
0
 public function update()
 {
     global $db;
     $sql = "UPDATE " . TB_PREFIX . "system_defaults SET value =  :value WHERE name = :name";
     //dont worry about checking db if were using the core extension
     if ($this->extension_name != "core") {
         $extension_id = getExtensionID($extension_name);
     } else {
         $extension_id = 0;
     }
     if ($extension_id >= 0) {
         $sql .= " AND extension_id = :extension_id";
     } else {
         die(htmlsafe("Invalid extension name: " . $extension));
     }
     if ($db->query($sql, ':value', $this->value, ':name', $this->name, ':extension_id', $extension_id)) {
         return true;
     }
     return false;
 }
function updateDefault($name, $value, $extension_name = "core")
{
    $domain_id = domain_id::get();
    $extension_id = getExtensionID($extension_name);
    if (!($extension_id >= 0)) {
        die(htmlsafe("Invalid extension name: " . $extension));
    }
    $sql = "INSERT INTO \n\t\t`" . TB_PREFIX . "system_defaults`\n\t\t(\n\t\t\t`name`, `value`, domain_id, extension_id\n\t\t)\n\t\tVALUES \n\t\t(\n\t\t\t:name, :value, :domain_id, :extension_id\n\t\t) \n\t\tON DUPLICATE KEY UPDATE\n\t\t\t`value` =  :value";
    if (dbQuery($sql, ':value', $value, ':domain_id', $domain_id, ':name', $name, ':extension_id', $extension_id)) {
        return true;
    }
    return false;
}
예제 #4
0
function updateDefault($name, $value, $extension_name = "core")
{
    global $auth_session;
    $sql = "UPDATE " . TB_PREFIX . "system_defaults SET value =  :value WHERE name = :name";
    $extension_id = getExtensionID($extension_name);
    if ($extension_id >= 0) {
        $sql .= " AND extension_id = :extension_id";
    } else {
        die(htmlsafe("Invalid extension name: " . $extension));
    }
    if (dbQuery($sql, ':value', $value, ':name', $name, ':extension_id', $extension_id)) {
        return true;
    }
    return false;
}