Projet

Général

Profil

« Précédent | Suivant » 

Révision fa7855f3

Ajouté par Colin Fleming il y a presque 10 ans

Tidy up "exec.php" XHTM

Add "closehead" PHP variable
Add CDATA sections to SCRIPTS and STYLES
Add TYPE to STYLES
Add hard space to closing PRE tag, otherwise if the PRE tag is empty it
will error
Add SUMMARY to TABLE
Close INPUT tags
Move closing FORM tag into DIV tag

Voir les différences:

usr/local/www/exec.php
90 90
$arrDT   = localtime();
91 91
$intYear = $arrDT[5] + 1900;
92 92

  
93
$closehead = false;
93 94
$pgtitle = array(gettext("Diagnostics"),gettext("Execute command"));
94 95
include("head.inc");
95 96
?>
96 97

  
97 98
<script type="text/javascript">
98
<!--
99
//<![CDATA[
99 100

  
100 101
   // Create recall buffer array (of encoded strings).
101 102

  
......
182 183

  
183 184
      return true;
184 185
   }
185
//-->
186
//]]>
186 187
</script>
187
<style>
188
<!--
188
<style type="text/css">
189
/*<![CDATA[*/
189 190

  
190 191
input {
191 192
   font-family: courier new, courier;
......
215 216
   font-size: 11px;
216 217
}
217 218

  
218
-->
219
/*]]>*/
219 220
</style>
220 221
</head>
221 222
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
......
235 236
   $ph = popen($_POST['txtCommand'] . ' 2>&1', "r" );
236 237
   while ($line = fgets($ph)) echo htmlspecialchars($line);
237 238
   pclose($ph);
238
   puts("</pre>");
239
   puts("&nbsp;</pre>");
239 240
}
240 241

  
241 242

  
......
244 245
   require_once("config.inc");
245 246
   require_once("functions.inc");
246 247
   echo eval($_POST['txtPHPCommand']);
247
   puts("</pre>");
248
   puts("&nbsp;</pre>");
248 249
}
249 250

  
250 251
?>
251 252
<div id="niftyOutter">
252
<form action="exec.php" method="post" enctype="multipart/form-data" name="frmExecPlus" onSubmit="return frmExecPlus_onSubmit( this );">
253
  <table>
253
<form action="exec.php" method="post" enctype="multipart/form-data" name="frmExecPlus" onsubmit="return frmExecPlus_onSubmit( this );">
254
  <table summary="exec">
254 255
	<tr>
255 256
	  <td colspan="2" valign="top" class="vnsepcell"><?=gettext("Execute Shell command"); ?></td>
256 257
	</tr>  
257 258
    <tr>
258 259
      <td class="label" align="right"><?=gettext("Command"); ?>:</td>
259
      <td class="type"><input id="txtCommand" name="txtCommand" type="text" class="formfld unknown" size="80" value="<?=htmlspecialchars($_POST['txtCommand']);?>"></td>
260
      <td class="type"><input id="txtCommand" name="txtCommand" type="text" class="formfld unknown" size="80" value="<?=htmlspecialchars($_POST['txtCommand']);?>" /></td>
260 261
    </tr>
261 262
    <tr>
262 263
      <td valign="top">&nbsp;&nbsp;&nbsp;</td>
263 264
      <td valign="top" class="label">
264
         <input type="hidden" name="txtRecallBuffer" value="<?=htmlspecialchars($_POST['txtRecallBuffer']) ?>">
265
         <input type="button" class="button" name="btnRecallPrev" value="<" onClick="btnRecall_onClick( this.form, -1 );">
266
         <input type="submit" class="button" value="<?=gettext("Execute"); ?>">
267
         <input type="button" class="button" name="btnRecallNext" value=">" onClick="btnRecall_onClick( this.form,  1 );">
268
         <input type="button"  class="button" value="<?=gettext("Clear"); ?>" onClick="return Reset_onClick( this.form );">
265
         <input type="hidden" name="txtRecallBuffer" value="<?=htmlspecialchars($_POST['txtRecallBuffer']) ?>" />
266
         <input type="button" class="button" name="btnRecallPrev" value="<" onclick="btnRecall_onClick( this.form, -1 );" />
267
         <input type="submit" class="button" value="<?=gettext("Execute"); ?>" />
268
         <input type="button" class="button" name="btnRecallNext" value=">" onclick="btnRecall_onClick( this.form,  1 );" />
269
         <input type="button"  class="button" value="<?=gettext("Clear"); ?>" onclick="return Reset_onClick( this.form );" />
269 270
      </td>
270 271
    </tr>
271 272
	<tr>
......
277 278
    <tr>
278 279
      <td align="right"><?=gettext("File to download"); ?>:</td>
279 280
      <td>
280
        <input name="dlPath" type="text" class="formfld file" id="dlPath" size="50">
281
        <input name="dlPath" type="text" class="formfld file" id="dlPath" size="50" />
281 282
	</td></tr>
282 283
    <tr>
283 284
      <td valign="top">&nbsp;&nbsp;&nbsp;</td>
284 285
      <td valign="top" class="label">	
285
        <input name="submit" type="submit"  class="button" id="download" value="<?=gettext("Download"); ?>">
286
        <input name="submit" type="submit"  class="button" id="download" value="<?=gettext("Download"); ?>" />
286 287
        </td>
287 288
    </tr>
288 289
	<tr>
......
294 295
    <tr>
295 296
      <td align="right"><?=gettext("File to upload"); ?>:</td>
296 297
      <td valign="top" class="label">
297
	<input name="ulfile" type="file" class="formfld file" id="ulfile">
298
	<input name="ulfile" type="file" class="formfld file" id="ulfile" />
298 299
	</td></tr>
299 300
    <tr>
300 301
      <td valign="top">&nbsp;&nbsp;&nbsp;</td>
301 302
      <td valign="top" class="label">	
302
        <input name="submit" type="submit"  class="button" id="upload" value="<?=gettext("Upload"); ?>"></td>
303
        <input name="submit" type="submit"  class="button" id="upload" value="<?=gettext("Upload"); ?>" /></td>
303 304
    </tr>
304 305
	<tr>
305 306
	  <td colspan="2" valign="top" height="16"></td>
......
309 310
	</tr>
310 311
	<tr>
311 312
		<td align="right"><?=gettext("Command"); ?>:</td>
312
		<td class="type"><textarea id="txtPHPCommand" name="txtPHPCommand" type="text" rows="9" cols="80"><?=htmlspecialchars($_POST['txtPHPCommand']);?></textarea></td>
313
		<td class="type"><textarea id="txtPHPCommand" name="txtPHPCommand" rows="9" cols="80"><?=htmlspecialchars($_POST['txtPHPCommand']);?></textarea></td>
313 314
	</tr>
314 315
    <tr>
315 316
      <td valign="top">&nbsp;&nbsp;&nbsp;</td>
316 317
      <td valign="top" class="label">
317
         <input type="submit" class="button" value="<?=gettext("Execute"); ?>">
318
         <input type="submit" class="button" value="<?=gettext("Execute"); ?>" />
318 319
	 <p>
319 320
	 <strong><?=gettext("Example"); ?>:</strong>   interfaces_carp_setup();
321
	 </p>
320 322
      </td>
321 323
    </tr>
322 324
    
323 325
  </table>
326
</form>
324 327
</div>
325 328
<?php include("fend.inc"); ?>
326
</form>
327
<script language="Javascript">
329
<script type="text/javascript">
330
//<![CDATA[
328 331
document.forms[0].txtCommand.focus();
332
//]]>
329 333
</script>
330 334
</body>
331 335
</html>

Formats disponibles : Unified diff