VCL
  1. VCL
  2. VCL-444

time delay the display of the Get RDP File button to allow vcld to grant access

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3
    • Component/s: web gui (frontend)
    • Labels:
      None

      Description

      If a user clicks the Connect button and then the Get RDP File button too quickly, vcld will not have a chance to actually grant the user access through the host firewall. Having javascript delay the display of the Get RDP File button would help users not be confused about why they were not able to connect to the machine.

      Gerhard Hartl from ODU contributed the following code to make this happen:

      Roughly around line 2217 (v2.2.1) on requests.php replace the Get RDP File form section with:

      print "<style type=\"text/css\">\n";
      print " .off

      {\n"; print " visibility: hidden;\n"; print " }

      .on

      {\n"; print " visibility: visible;\n"; print " }

      \n";
      print "</style>\n";
      print "<script type=\"text/javascript\">\n";
      print " window.onload = function() {\n";
      print " var timeInterval = 5;\n";
      print " if (typeof timeInterval === 'undefined' || parseInt(timeInterval) <= 0)

      {\n"; print " timeInterval = 1\n"; print " }

      \n";
      print "document.getElementById('counter').innerHTML = \" Ready to connect in \" + timeInterval + \" seconds\";\n";
      print "var si = setInterval(function() {\n";
      print "if (timeInterval === 0)

      {\n"; print " clearInterval(si);\n"; print " }

      else {\n";
      print "--timeInterval;\n";
      print "if (timeInterval !== 0)

      {\n"; print " document.getElementById('counter').innerHTML = \" Ready to connect in \" + timeInterval + \" seconds\";\n"; print "}

      else

      {\n"; print " document.getElementById('counter').className = 'off'; //Hiding the counter area.\n"; print " document.getElementById('submit').className = 'on'; //Unhide the Submit button\n"; print "}

      \n";
      print "}\n";
      print "}, 1000);\n";
      print "setTimeout(function()

      {\n"; print "}

      , timeInterval * 1000);\n";
      print "}\n";
      print "</script>\n";

      print "For automatic connection, you can download an RDP file that can ";
      print "be opened by the Remote Desktop Connection program.<br><br>\n";
      print "<b id=counter></b>";
      print "<table summary=\"\">\n";
      print " <TR>\n";
      print " <TD>\n";
      print " <FORM action=\"" . BASEURL . SCRIPT . "\" method=post id=\"connect\">\n";
      $cdata = array('requestid' => $requestid,
      'resid' => $requestData['reservations'][0]['reservationid']);
      $expire = datetimeToUnix($requestData['end']) -
      datetimeToUnix($requestData['start']) + 1800; # reservation time plus 30 min
      $cont = addContinuationsEntry('sendRDPfile', $cdata, $expire);
      print " <INPUT type=hidden name=continuation value=\"$cont\">\n";
      print " <INPUT type=submit value=\"Get RDP File\" class=\"off\" id=\"submit\">\n";
      print " </FORM>\n";
      print " </TD>\n";
      print " </TR>\n";
      print "</table>\n";

        Activity

        Josh Thompson made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Josh Thompson made changes -
        Field Original Value New Value
        Assignee Josh Thompson [ jfthomps ]
        Josh Thompson created issue -

          People

          • Assignee:
            Josh Thompson
            Reporter:
            Josh Thompson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development