Odyssey
applianceSettings.prg
1 <?php
2 
3 $monLibrary= dirname(__FILE__) . "/../library";
4 require_once("$monLibrary/cu_top.i");
5 require_once("$monLibrary/ck_hticket.i");
6 
7 dms_import(array("operation" => "string", "rowid" => "string"));
8 $operation= isset($operation) ? trim($operation) : "";
9 $cu= trim($rowid);
10 $self= trim($_SERVER['PHP_SELF']);
11 
12 switch($operation)
13 {
14  case "pre":
15  case "":
16  cu_header("Appliance Settings");
17 ?>
18  <center>
19  <form action="<?php echo $self; ?>" method="post">
20  <table border=0 width="90%" cellpadding=3 cellspacing=0 class='dmsbg'>
21  <tr>
22  <td>
23  <table border=0 width="100%" cellpadding=2 cellspacing=0 bgcolor="white">
24  <tr>
25  <td class="bar" align="center">Appliance Settings</td>
26  </tr>
27  <tr>
28  <td class="dtl">
29  <input type="submit" value="Show Settings">
30  <input type="hidden" name="operation" value="show">
31  <input type="hidden" name="rowid" value="<?php echo $cu; ?>">
32  </td>
33  </tr>
34  </table>
35  </td>
36  </tr>
37  </table>
38  </form>
39  </center>
40  </body>
41 </html>
42 
43 <?php break;
44  case "show":
45 $referer= trim($_SERVER['HTTP_REFERER']);
46 $referer= explode("?", $referer);
47 $referer= $referer[0];
48 $referer= preg_replace('/(http[s]+:\/\/)+www[0-9]+.homecu.net/i', '', $referer);
49 if ($referer != $self)
50 { ?>
51 
52 You are trying to do something this application is not designed for.
53 
54 <?php }
55 else
56 {
57  cu_header("Appliance Settings");
58 ?>
59 
60  <center>
61  <table border=0 width="90%" cellpadding=3 cellspacing=0 class='dmsbg'>
62  <tr>
63  <td>
64  <table border=0 width="100%" cellpadding=2 cellspacing=0 bgcolor="white">
65  <tr>
66  <td class="bar" align="center">Appliance Settings</td>
67  </tr>
68  <tr>
69  <td>
70  <pre style="padding:5px;">
71  <?php $execLine= "/usr/local/bin/ia_extract_quickref.pl " . escapeshellarg($cu);
72  exec($execLine, $execOutput);
73  print implode("\n", $execOutput);
74  ?>
75  </pre>
76  </td>
77  </tr>
78  </table>
79  </td>
80  </tr>
81  </table>
82  </center>
83  </body>
84 </html>
85 
86 <?php }
87  break;
88  default: ?>
89 
90 You are trying to do something this application is not designed for.
91 
92 <?php } ?>