blob: ae27c3c9a4b5ad9b9036414794c4c50fc025e311 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
<?php
function init_configurations_verifier() {
global $S, $request;
if (!isset($S['user'])) {
return 'login';
}
if (!(isset($request['configuration']) && strlen($request['configuration']) == 6 && ctype_alnum($request['configuration']))) {
return '404';
}
$r=$S['pdo']->query('SELECT * FROM `configurations` WHERE `id`=\''.$request['configuration'].'\'');
if ($r->rowCount() == 0) {
return '404';
}
$S['verifier']['configuration']=new sql_configuration($r->fetch(PDO::FETCH_ASSOC));
if ($S['verifier']['configuration']->owner != $S['user']->id) {
return '404';
}
return array('title' => 'Verify');
}
function body_configurations_verifier() {
global $S;
$c=&$S['verifier']['configuration'];
wizard::set_configuration($c);
$module=new module($c->module);
$status=true;
echo '<ol>';
for ($i=1; $i<=$module->steps; $i++) {
echo '<li>';
if ($status) {
$step=new wizard_step($c->module, $i);
$status=$status && ($r=$step->verify());
echo $r?'Valid':'INVALID';
} else {
echo 'Unavailable';
}
echo '</li>';
}
}
?>
|