* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ require_once 'modules/msc/includes/scheduler_xmlrpc.php'; require_once 'modules/msc/includes/mscoptions_xmlrpc.php'; $proxy_headers = explode(',', "HTTP_VIA,HTTP_X_FORWARDED_FOR,HTTP_FORWARDED_FOR,HTTP_X_FORWARDED,HTTP_FORWARDED,HTTP_CLIENT_IP,HTTP_FORWARDED_FOR_IP,HTTP_X_SURFCACHE_FOR,VIA,X_FORWARDED_FOR,FORWARDED_FOR,X_FORWARDED,FORWARDED,CLIENT_IP,FORWARDED_FOR_IP,HTTP_PROXY_CONNECTION"); $proxyActive = False; foreach ($proxy_headers as $header) { if (array_key_exists($header, $_SERVER)) { $proxyActive = True; } } # FIXME: I'm not really proud of this piece of code :/ if (isset($_GET['establishproxy']) and $_GET['establishproxy'] == "yes") { // Check if we're here thru a proxy defining HTTP_X_FORWARDED_FOR $remoteaddr = isset($_SERVER["HTTP_X_FORWARDED_FOR"]) ? $_SERVER["HTTP_X_FORWARDED_FOR"] : $_SERVER["REMOTE_ADDR"]; $result = scheduler_establish_vnc_proxy('', $_GET['objectUUID'], $remoteaddr); # $result is expected to be an array containing host, port, let's check it: if ($result == False) { // Connection refused case echo "\n <HTML>\n <head>\n <title>Mandriva Management Console</title>\n <link href='/mmc/graph/master.css' rel='stylesheet' media='screen' type='text/css' />\n \n </head>\n <BODY style='background-color: #FFFFFF;'>\n <center>\n <div class='popup' style='position: relative;'>\n <div class='__popup_container'>\n <h2 style='color: red;'>" . _T("Connection Failed !", "msc") . "</h2>\n <br/>\n " . _T("Connection was refused by the other side.", "msc") . "<br/>\n \n <br/>\n <button id='btnPrimary' onclick='window.close();'>Close window</button>\n </div>\n </div>\n </center>\n </BODY>\n </HTML>"; } else { // Successful connection, showing VNC plugin $host = $result[0]; $port = $result[1]; $auth_key = $result[2]; //web_vnc_allow_user_control() //web_vnc_view_only() //web_vnc_network_connectivity() = fiber|lan|cable|dsl[isdn ?> <!DOCTYPE html>
* MMC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with MMC; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ require('modules/msc/includes/scheduler_xmlrpc.php'); require('modules/msc/includes/mscoptions_xmlrpc.php'); # FIXME: I'm not really proud of this piece of code :/ if(isset($_GET['establishproxy']) and $_GET['establishproxy'] == "yes") { $result = scheduler_establish_vnc_proxy('', $_GET['objectUUID'], $_SERVER["REMOTE_ADDR"]); # $result is expected to be an array containing host, port, let's check it: if ($result == False) { new NotifyWidgetFailure(_T("Connection was refused by the other side.", "msc")); } else { $host = $result[0]; $port = $result[1]; # see http://www.tightvnc.com/doc/java/README.txt echo " <HTML> <head> <title>Mandriva Management Console</title> <link href='/mmc/graph/master.css' rel='stylesheet' media='screen' type='text/css' /> </head> <BODY style='background-color: #FFFFFF;'>