Variable substitution for logged in user for action, possible?

This does the same in PHP:

<?php

if ( $_REQUEST["host"] && $_REQUEST["user"] ) {
  header("Content-Type: application/rdp");
  header("Content-disposition: attachment;filename=".$_REQUEST["host"].".rdp");

  printf("redirectclipboard:i:1\nredirectposdevices:i:0\nredirectprinters:i:1\nredirectcomports:i:1\n");
  printf("full address:s:%s\n", $_REQUEST["host"]);
  printf("username:s:%s\n", $_REQUEST["user"]);
} else {
  printf("Hostname or Username not set\n");
}
?>

You can put that as rdp.php in the document root folder of the system apache instance on your monitoring server. On Debian that would be /var/www/html.

1 Like