Exemple #1
0
 /**
  * Record Type
  */
 public function executeRecordtype()
 {
     if (!$this->isPOST()) {
         $output = array();
         if (!($record_type = SettingPeer::getValue('record_type'))) {
             return $this->renderJson(array("success" => false));
         }
         foreach (unserialize($record_type) as $type => $state) {
             $output[] = array("id" => $type, "state" => $state);
         }
         return $this->renderStore("RecordType", $output);
     } else {
         $record_type = array();
         foreach ($this->getRequestParameter('record_type') as $type => $state) {
             if ($state) {
                 $record_type[$type] = 1;
             } else {
                 $record_type[$type] = 0;
             }
         }
         SettingPeer::setValue('record_type', serialize($record_type));
         return $this->renderJson(array("success" => true, "info" => "Record types updated."));
     }
 }
Exemple #2
0
 /**
  * Gets last commit timestamp
  * 
  * @return int
  */
 public static function getLastCommit()
 {
     return SettingPeer::getValue('last_commit', 0);
 }
Exemple #3
0
        echo "Table {$table} engine is InnoDB - OK\n";
    } else {
        echo "Table {$table} - changing engine to InnoDB...\n";
        $sql = "ALTER TABLE `{$db_name}`.`{$table}` ENGINE = InnoDB";
        try {
            $statement = $connection->prepareStatement($sql);
            $statement->executeQuery();
        } catch (Exception $e) {
            innoDBError($sql, $e);
            break;
        }
        $upgraded = true;
    }
}
// set record_type setting
if (!SettingPeer::getValue('record_type')) {
    echo "Settings->record_type missing, updating...\n";
    $types = array("A" => 1, "AAAA" => 0, "AFSDB" => 0, "CERT" => 0, "CNAME" => 1, "DNSKEY" => 0, "DS" => 0, "HINFO" => 0, "KEY" => 0, "LOC" => 0, "MX" => 1, "NAPTR" => 1, "NS" => 1, "NSEC" => 0, "PTR" => 1, "RP" => 0, "RRSIG" => 0, "SOA" => 1, "SPF" => 1, "SSHFP" => 0, "SRV" => 1, "TXT" => 1);
    SettingPeer::setValue('record_type', serialize($types));
    $upgraded = true;
}
if ($upgraded) {
    echo "Clearing cache...\n";
    passthru(SF_ROOT_DIR . "/symfony cc");
    echo "Done.\n";
} else {
    echo "Your Power DNS GUI is up to date. Nothing to upgrade.\n";
}
function innoDBError($sql, $e)
{
    echo $e->getMessage() . "\n\n";