new setup script (Google Summer of Code 2008), work in progress

This commit is contained in:
Piotr Przybylski
2008-08-28 18:02:18 +00:00
parent fb54cddd1d
commit 5c658310aa
21 changed files with 4721 additions and 0 deletions

20
setup/validate.php Normal file
View File

@@ -0,0 +1,20 @@
<?php
require './lib/common.inc.php';
$validators = array();
require './setup/lib/validate.lib.php';
header('Content-type: application/json');
$vids = explode(',', filter_input(INPUT_POST, 'id'));
$values = json_decode(filter_input(INPUT_POST, 'values'));
if (!($values instanceof stdClass)) {
die('Wrong data');
}
$values = (array)$values;
$result = validate($vids, $values, true);
if ($result === false) {
$result = 'Wrong data or no validation for ' . $vids;
}
echo $result !== true ? json_encode($result) : '';
?>