File:
1.17.2a/server/web/eval.action.php (
View as Code)
1: 2: /* -------------------------------------------------------------
3: This file is part of FreeNATS
4:
5: FreeNATS is (C) Copyright 2008 PurplePixie Systems
6:
7: FreeNATS is free software: you can redistribute it and/or modify
8: it under the terms of the GNU General Public License as published by
9: the Free Software Foundation, either version 3 of the License, or
10: (at your option) any later version.
11:
12: FreeNATS is distributed in the hope that it will be useful,
13: but WITHOUT ANY WARRANTY; without even the implied warranty of
14: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: GNU General Public License for more details.
16:
17: You should have received a copy of the GNU General Public License
18: along with Foobar. If not, see www.gnu.org/licenses
19:
20: For more information see www.purplepixie.org/freenats
21: -------------------------------------------------------------- */
22:
23: ob_start();
24: require("include.php");
25: $NATS->Start();
26: if (!$NATS_Session->Check($NATS->DB))
27: {
28: header("Location: ./?login_msg=Invalid+Or+Expired+Session");
29: exit();
30: }
31: if ($NATS_Session->userlevel<5) UL_Error("Action Test Eval");
32:
33: function BackIfSet()
34: {
35: if (isset($_REQUEST['back']))
36: {
37: header("Location: ".$_REQUEST['back']);
38: exit();
39: }
40: }
41:
42: switch ($_REQUEST['action'])
43: {
44: case "create":
45: // screw this for the moment
46: // get the highest weight for this testid
47: //$q="SELECT weight FROM fneval WHERE testid=\"".ss($_REQUEST['testid'])."
48: $q="INSERT INTO fneval(testid,eoperator,evalue,eoutcome) VALUES(\"".ss($_REQUEST['testid'])."\",";
49: $q.="\"".ss($_REQUEST['eoperator'])."\",\"".ss($_REQUEST['evalue'])."\",\"".ss($_REQUEST['eoutcome'])."\")";
50: $NATS->DB->Query($q);
51: //echo $q;
52: //exit();
53: if ($_REQUEST['testid'][0]=="L")
54: {
55: $ltid=substr($_REQUEST['testid'],1,128);
56: header("Location: localtest.edit.php?localtestid=".$ltid);
57: exit();
58: }
59: BackIfSet();
60: header("Location: main.php");
61: exit();
62: case "delete":
63: $q="DELETE FROM fneval WHERE evalid=".ss($_REQUEST['evalid']);
64: $NATS->DB->Query($q);
65: BackIfSet();
66: if (isset($_REQUEST['back'])) header("Location: ".$_REQUEST['back']);
67: else header("Location: main.php?message=Evaluator+Deleted");
68: exit();
69: default:
70: header("Location: main.php?message=Unknown+Test+Eval+Action");
71: exit();
72: }
73:
74: ?>
75: