[
https://issues.apache.org/jira/browse/VCL-444?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Josh Thompson resolved VCL-444.
-------------------------------
Resolution: Fixed
> time delay the display of the Get RDP File button to allow vcld to grant
> access
> -------------------------------------------------------------------------------
>
> Key: VCL-444
> URL: https://issues.apache.org/jira/browse/VCL-444
> Project: VCL
> Issue Type: Improvement
> Components: web gui (frontend)
> Reporter: Josh Thompson
> Assignee: Josh Thompson
> Fix For: 2.3
>
>
> 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";
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira