Example #1
0
        $nunchecked++;
        if ($results === NULL) {
            $nomatch[] = "string '<code>@EXPECTED_RESULTS@:</code>' not found in " . "<a href=\"submission.php?id=" . $sid . "\">s{$sid}</a>, leaving submission unchecked";
        } else {
            $earlier[] = "<a href=\"submission.php?id=" . $sid . "\">s{$sid}</a> already verified earlier";
        }
    }
}
echo "{$nchecked} submissions checked: " . count($unexpected) . " unexpected results, " . count($multiple) . ($verify_multiple ? " automatically verified (multiple outcomes), " : " to check manually, ") . count($verified) . " automatically verified<br/>\n";
echo "{$nunchecked} submissions not checked: " . count($earlier) . " verified earlier, " . count($nomatch) . " without magic string<br/>\n";
if (count($unexpected)) {
    flushresults("Unexpected results", $unexpected);
}
if (count($multiple)) {
    if ($verify_multiple) {
        flushresults("Automatically verified (multiple outcomes)", $multiple, TRUE);
    } else {
        flushresults("Check manually", $multiple);
        echo "<div class=\"details\" id=\"detail{$section}\">\n" . addForm($pagename) . "<p>Verify all multiple outcome submissions: " . addHidden('verify_multiple', '1') . addSubmit('verify') . addEndForm() . "</p>\n</div>\n\n";
    }
}
if (count($verified)) {
    flushresults("Automatically verified", $verified, TRUE);
}
if (count($earlier)) {
    flushresults("Verified earlier", $earlier, TRUE);
}
if (count($nomatch)) {
    flushresults("Without magic string", $nomatch, TRUE);
}
require LIBWWWDIR . '/footer.php';
Example #2
0
        }
        $fields = implode(', ', array_keys($foreign_keys));
        $res = $DB->q('SELECT ' . $fields . ' FROM ' . $table . ' ORDER BY ' . implode(',', $KEYS[$table]));
        while ($row = $res->next()) {
            foreach ($foreign_keys as $foreign_key => $val) {
                list($target, $action) = explode('&', $val);
                if (empty($row[$foreign_key]) || $action == 'NOCONSTRAINT') {
                    continue;
                }
                $f = explode('.', $target);
                if ($DB->q("VALUE SELECT count(*) FROM {$f['0']} WHERE {$f['1']} = %s", $row[$foreign_key]) < 1) {
                    $details .= "foreign key constraint fails for {$table}.{$foreign_key} = \"" . $row[$foreign_key] . "\" (not found in {$target})\n";
                }
            }
        }
    }
    // problems found are of level warning, because the severity may be different depending
    // on which table it is.
    result('referential integrity', 'Inter-table relationships', $details == '' ? 'O' : 'W', $details);
} else {
    result('referential integrity', 'Inter-table relationships', 'R', 'Not checked.', '<a href="?refint">check now</a> (potentially slow operation)');
}
flushresults();
echo "</table>\n\n";
// collapse all details; they are not collapsed in the default
// style sheet to keep things working with JavaScript disabled.
echo "<script type=\"text/javascript\">\n<!--\nfor (var i = 0; i < {$resultno}; i++) {\n    collapse(i);\n}\n// -->\n</script>\n\n";
$time_end = microtime(TRUE);
echo "<p>Config checker completed in " . round($time_end - $time_start, 2) . " seconds.</p>\n\n";
echo "<p>Legend:\n<img src=\"../images/s_okay.png\"      alt=\"O\" class=\"picto\" /> OK\n<img src=\"../images/s_warn.png\"      alt=\"W\" class=\"picto\" /> Warning\n<img src=\"../images/s_error.png\"     alt=\"E\" class=\"picto\" /> Error\n</p>\n";
require LIBWWWDIR . '/footer.php';