diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2009-01-06 13:30:48 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2009-01-06 13:30:48 +0000 |
commit | 3a8648ba285491f67c75c92e5e532f2b6e74ad8b (patch) | |
tree | cbac62bd563e58f2205a2c60b9fd0145c22a0cc0 /gui | |
parent | 48421749c15ba7e2e527b91cf3c5cffee3465b5e (diff) |
Move rapid-tunneling-gui package into the main source package.
git-svn-id: svn+ssh://xorcom/home/svn/debs/components/rapid-tunneling@6557 283159da-0705-0410-b60c-f2062b4bb6ad
Diffstat (limited to 'gui')
-rw-r--r-- | gui/XPP_logo_watermark.gif | bin | 0 -> 2995 bytes | |||
-rw-r--r-- | gui/Xorcom_logo2.jpg | bin | 0 -> 14452 bytes | |||
-rw-r--r-- | gui/checkra.php | 43 | ||||
-rw-r--r-- | gui/index.php | 76 |
4 files changed, 119 insertions, 0 deletions
diff --git a/gui/XPP_logo_watermark.gif b/gui/XPP_logo_watermark.gif Binary files differnew file mode 100644 index 0000000..62c597c --- /dev/null +++ b/gui/XPP_logo_watermark.gif diff --git a/gui/Xorcom_logo2.jpg b/gui/Xorcom_logo2.jpg Binary files differnew file mode 100644 index 0000000..a078c9e --- /dev/null +++ b/gui/Xorcom_logo2.jpg diff --git a/gui/checkra.php b/gui/checkra.php new file mode 100644 index 0000000..40f8f37 --- /dev/null +++ b/gui/checkra.php @@ -0,0 +1,43 @@ +<html> +<head> +<meta http-equiv="refresh" content="1; url=checkra.php"> +</head> +<body> +<?php +function get_status() +{ + exec("sudo -H -u rapid-tunneling /usr/sbin/rapid-tunneling-status -p", $pid, $status); + if (count($pid) > 0) + $pid = trim($pid[0]); + else + $pid = ""; + return array($pid, $status); + // $status = 0 if connected, 1 if connecting, 2 if not connected +} + +$res = get_status(); +$pid = $res[0]; +$status = $res[1]; +if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "disconnect" && $pid != "" && ($status == 0 || $status == 1)) { + // stop it + exec("sudo -H -u rapid-tunneling /usr/sbin/rapid-tunneling-status -s"); + $res = get_status(); + $pid = $res[0]; + $status = $res[1]; +} + +if ($status == 0) + $netstat = "<span style='color: green'>Connected</span>"; +elseif ($status == 1) + $netstat = "<span style='color: orange'>Connecting</span>"; +else + $netstat = "<span style='color: red'>Not connected</span>"; + +echo "Connection status:<br>\n"; +echo date("r") . " <b>$netstat</b><br>\n"; +if ($status == 0 || $status == 1) { + echo "<br><button onclick='location.href += \"?action=disconnect\"'>Disconnect</button>"; +} +?> +</body> +</html> diff --git a/gui/index.php b/gui/index.php new file mode 100644 index 0000000..aede7c7 --- /dev/null +++ b/gui/index.php @@ -0,0 +1,76 @@ +<?php +/* + * Written by Alex Landau <alex.landau@xorcom.com> + * Copyright (C) 2008 Xorcom + * + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ +?> +<title>Xorcom RapidTunneling</title> +<style> +.clsErrors +{ + background: pink; + border: 1px solid red; + padding: 5px; + text-align: center; +} +</style> +<?php +if (isset($_REQUEST["submit"])) +{ + $error = ""; + // Not a true while due to the break at the end. A handy way to use goto... + while (true) { + if (!is_uploaded_file($_FILES["filename"]["tmp_name"])) { + $error = "Bad file uploaded: " . $_FILES['filename']['name']; + break; + } + if (!move_uploaded_file($_FILES["filename"]["tmp_name"], "/tmp/remote-access.tar.gz")) { + $error = "Bad file uploaded: " . $_FILES['filename']['name']; + break; + } + system("sudo -H -u rapid-tunneling rapid-tunneling /tmp/remote-access.tar.gz >/tmp/ra.log 2>&1", $ret); + if ($ret != 0) { + $error = "Invalid or corrupt file. Please try again."; + if ( $ret == 7) { + $error = "Invalid GPG signature. Please try again."; + } + break; + } + break; + } +} +if ($error != "") { +?> +<div class="clsErrors"><?php echo $error ?></div> +<?php +} +?> +<img src="Xorcom_logo2.jpg"> +<br> +Click Browse and select the file 'remote-access.tar.gz' that you received from the Technical Support Service.<br> +Then click the "Connect" button to initiate the <b>RapidTunneling™</b> secure communication.<br><br> +<form id=form action="" method=post enctype="multipart/form-data"> + <input type=file name=filename><br><br> + <input class="splbutton" type=submit name=submit value="Connect"> +</form> +<p> +<iframe src="checkra.php" width=500 height=100 frameborder=0 scrolling=no></iframe> +<br> +<img src="XPP_logo_watermark.gif"> |