예제 #1
0
 public function is_unique()
 {
     $result = array('is_ok' => true, 'message' => 'Record is unique!');
     if (Record::find('first', array('conditions' => 'name = ' . Record::quote($this->name) . ' AND type = ' . Record::quote($this->type) . ' AND content = ' . Record::quote($this->content)))) {
         $result['is_ok'] = false;
         $result['message'] = "Record already exists!";
         return $result;
     }
     /*
      * Consistany check for SOA records, only allowed once at a domain
      */
     if ($this->type === SOA) {
         if (Record::find('first', array('conditions' => 'domain_id = ' . Record::quote($this->domain_id) . ' AND type = ' . Record::quote($this->type)))) {
             $result['is_ok'] = false;
             $result['message'] = "Soa record only allowed once at a domain!";
             return $result;
         }
     }
     return $result;
 }
예제 #2
0
    $start = $_GET["start"];
}
print $display->header();
if (!preg_match('/^\\d+$/', $_GET['id'])) {
    print $display->error("You hacker!");
    print $display->footer();
    exit(1);
}
try {
    $d = Domain::find($_GET['id']);
    $result = ActiveRecord::query("SELECT COUNT(*) AS count FROM records WHERE domain_id={$d->id}");
    $rCount = (int) $result[0]['count'];
    if ($rCount > $rowamount) {
        $findResult = Record::find('all', array('limit' => "{$rowamount}", 'offset' => "{$offset}", 'conditions' => 'domain_id = ' . Record::quote($d->id), 'order' => 'name'));
    } else {
        $findResult = Record::find('all', array('conditions' => 'domain_id = ' . Record::quote($d->id), 'order' => 'name'));
    }
} catch (Exception $e) {
    print $e->getMessage();
    print $display->footer();
    exit(0);
}
?>

<script language="JavaScript" src="http://www.mattkruse.com/javascript/datadumper/datadumper.js"></script>

<script type="text/javascript">

	function queue_record_edit_all() { 
		$$('form').each(function(form) {
				if(form.disabled == undefined) { 
예제 #3
0
<input type="text" name="query" value="<?php 
echo isset($_GET['query']) ? $_GET['query'] : '';
?>
">
<input type="submit" name="submit" value="Search">
</form>

<?php 
if ($_GET["query"]) {
    $dFindResult = Domain::get_all(array('conditions' => 'd.name LIKE ' . Domain::quote($_GET['query'])));
    if (is_array($dFindResult) && count($dFindResult) > 0) {
        print '<h2>Domains (' . count($dFindResult) . ')</h2>';
        print $display->domains_header();
        foreach ($dFindResult as $domain) {
            print $display->domain($domain);
        }
        print $display->domains_footer();
        print '<br>';
    }
    flush();
    $rFindResult = Record::find('all', array('conditions' => 'name LIKE ' . Record::quote($_GET['query']) . ' OR ' . 'content LIKE ' . Record::quote($_GET['query']), 'order' => 'name'));
    if (is_array($rFindResult) && count($rFindResult) > 0) {
        print '<h2>Records (' . count($rFindResult) . ')</h2>';
        print $display->records_header();
        foreach ($rFindResult as $record) {
            print $display->record($record);
        }
        print $display->records_footer();
    }
}
print $display->footer();