Viewing File server/web/testrun.php of 1.14.2a
|
1: <?php 2: /* ------------------------------------------------------------- 3: This file is part of FreeNATS 4: 5: FreeNATS is (C) Copyright 2008-2010 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 FreeNATS. 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<9) UL_Error($NATS->Lang->Item("test.run")); 32: 33: 34: 35: ob_end_flush(); 36: Screen_Header($NATS->Lang->Item("test.run").": test/".$_REQUEST['trid'],1); 37: 38: if (isset($_REQUEST['message'])) echo "<b>".$_REQUEST['message']."</b><br>"; 39: if (isset($amsg)) echo "<b>".$amsg."</b><br>"; 40: 41: if ( (isset($_REQUEST['action'])) && ($_REQUEST['action']=="finish") ) 42: { 43: if (!isset($_REQUEST['confirmed'])) 44: { 45: echo "<b>".$NATS->Lang->Item("testrun.manual.close")."</b><br>"; 46: echo $NATS->Lang->Item("testrun.manual.close.detail"); 47: echo "<br><br>"; 48: echo "<b>".$NATS->Lang->Item("confirm.action").":</b> "; 49: echo "<a href=testrun.php?trid=".$_REQUEST['trid']."&action=finish&confirmed=1>".$NATS->Lang->Item("testrun.del.yes")."</a> | <a href=main.php>".$NATS->Lang->Item("testrun.del.cancel")."</a>"; 50: echo "<br><br>"; 51: } 52: else 53: { 54: $q="UPDATE fntestrun SET finishx=".time()." WHERE trid=".ss($_REQUEST['trid']); 55: $NATS->DB->Query($q); 56: echo "<b>".$NATS->Lang->Item("testrun.session.closed")."</b><br><Br>"; 57: } 58: } 59: 60: echo "<br><b class=\"minortitle\">".$NATS->Lang->Item("test.run")." test/".$_REQUEST['trid']."</b><br><br>"; 61: 62: $q="SELECT * FROM fntestrun WHERE trid=".ss($_REQUEST['trid'])." LIMIT 0,1"; 63: $r=$NATS->DB->Query($q); 64: if (!$row=$NATS->DB->Fetch_Array($r)) 65: { 66: echo "<b>".$NATS->Lang->Item("testrun.fetch.error")."</b><br><br>"; 67: Screen_Footer(); 68: exit(); 69: } 70: $NATS->DB->Free($r); 71: 72: echo "<table border=0>"; 73: echo "<tr><td>".$NATS->Lang->Item("started")." : </td>"; 74: echo "<td>".nicedt($row['startx'])." (".dtago($row['startx']).")</td></tr>"; 75: echo "<tr><td>".$NATS->Lang->Item("finished")." : </td>"; 76: echo "<td>"; 77: if ($row['finishx']>0) echo nicedt($row['finishx'])." (".dtago($row['finishx']).")"; 78: else echo $NATS->Lang->Item("sessions.stillrunning")." (<a href=testrun.php?trid=".$_REQUEST['trid']."&action=finish>".$NATS->Lang->Item("testrun.manual.close")."</a>)"; 79: echo "</td>"; 80: echo "<tr><td>".$NATS->Lang->Item("node.filter")." :</td>"; 81: echo "<td>"; 82: if ($row['fnode']=="") echo $NATS->Lang->Item("allnodes"); 83: else echo "<a href=node.php?nodeid=".$row['fnode'].">".$row['fnode']."</a>"; 84: echo "</td></tr>"; 85: 86: echo "<tr><td>".$NATS->Lang->Item("event.log")." :</td>"; 87: echo "<td><a href=log.php?f_entry=Tester+".$row['trid'].">Log Events for Tester ".$row['trid']."</a>"; 88: echo "</td></tr>"; 89: 90: echo "<tr><td align=left valign=top>Output : </td>"; 91: echo "<td align=left valign=top>"; 92: echo $row['routput']; 93: echo "</td></tr>"; 94: 95: echo "</table>"; 96: ?> 97: 98: 99: <?php 100: Screen_Footer(); 101: ?> 102: