After more 2 000 000 (two million) views on forum for 1.5.0.x development versions... and 1.6.1.0, 1.6.3.0-dev versions
A new stable version, UltraVNC 1.6.4.0 and UltraVNC SC 1.6.4.0 have been released: https://forum.uvnc.com/viewtopic.php?t=38095
Feedback is always welcome

2025-12-05: Celebrating the 23th anniversary of the UltraVNC (26th anniversary since the laying of the foundation stone): https://forum.uvnc.com/viewtopic.php?t=38130

2025-12-03: Could you please complete our poll/survey? Renaming UltraVNC files and service to be more clear: https://forum.uvnc.com/viewtopic.php?t=38128
There was a problem to vote, it is solved now! Thanks in advance!

2025-12-02: We need help: English Wikipedia UltraVNC page has been requested to deletion: https://forum.uvnc.com/viewtopic.php?t=38127
Any help is welcome to improve the UltraVNC page and/or to comment on the Wikipedia Talk page

2025-05-06: Forum password change request: https://forum.uvnc.com/viewtopic.php?t=38078

2023-09-21: Important: Please update to latest version before to create a reply, a topic or an issue: https://forum.uvnc.com/viewtopic.php?t=37864

Development: UltraVNC development is always here... Any help is welcome
Feedback is welcome

Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Bluesky/AT Protocol: https://bsky.app/profile/ultravnc.bsky.social
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://x.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

integrating chunkvnc repeater with a db

Simple, Free, Open Source UltraVNC Wrapper Supporting Windows and Mac OSX
Post Reply
elicro
Posts: 4
Joined: 2012-06-19 18:02

integrating chunkvnc repeater with a db

Post by elicro »

i have implemented a version of ChunkVNC for some company and i have added IP to the log file.
the purpose was to maintain a log of who has connected to the client.
i wanted to take it two steps forward and to integrate it with a db.
for that couple of purposes:
1. have full detailed log stored on db.
2. to have for the supporter the option to get the ID of the client by his ip.
(the ip already known to the supporter)

then using a php form it will be searchable and the supporter can get the id without bothering the client to get the id.
the php script forces ssl connection
the improved repeater with ID + IP log and also + ID + IP sql log is here:
https://www1.ngtech.co.il/uvnc_rpt.tar.bz2
(this is not the perfect log and wasnt ment to log in mysql the supporter ip yet)


the code is here:
(to allow only ssl access and with username and password
.htaccess

Code: Select all

AuthName "Lrpt Server - Server Access"
AuthType Basic
AuthUserFile /etc/uvnc/htpasswd
Require valid-user

IndexIgnore *
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
index.html

Code: Select all

<html>
<title>Search Test</title>
<head>
</head>
<body>

<form action="showlrpt.php" method="POST" onsubmit="classChange('buttonSubmitHide',submit);   return true;">
<input name="send" type="submit" value="Show Last IPs and IDs!">
</form>

</body>
</html>
showlrpt.php

Code: Select all

<html>
<body>

<?php
if(isset($_POST['send']))
{
$con = mysql_connect("localhost","rpt","password");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("rpt", $con);
#$search_string = addslashes($_POST['search']);
$result = mysql_query("SELECT * FROM rptlog where time < TIMESTAMPADD(MINUTE, -5 , NOW())");
#echo $search_string;
echo "<table border='1'>
<tr>
<th>ID</th>
<th>IP</th>
<th>TimeStamp</th>

</tr>";

while($row = mysql_fetch_array($result))
  {
  echo "<tr>";
  echo "<td>" . $row['id'] . "</td>";
  echo "<td>" . $row['ip'] . "</td>";
  echo "<td>" . $row['time'] . "</td>";
  echo "</tr>";
  }
echo "</table>";

mysql_close($con);
}
?>
</body>
</html>
rpt.sql (for the table)

Code: Select all

-- MySQL dump 10.13  Distrib 5.1.61, for pc-linux-gnu (x86_64)
--
-- Host: localhost    Database: rpt
-- ------------------------------------------------------
-- Server version       5.1.61-log

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `temp`
--

DROP TABLE IF EXISTS `temp`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `temp` (
  `id` varchar(128) NOT NULL,
  `ip` varchar(128) NOT NULL,
  `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2012-06-19 22:11:28
User avatar
supercoe
400
400
Posts: 1732
Joined: 2009-07-20 21:27
Location: Walker, MN

Re: integrating chunkvnc repeater with a db

Post by supercoe »

Great stuff! Glad to see some other developers on here playing around. :)

I've mirrored the file here: http://chunkvnc.com/archive/extras/elicro/

Thanks for sharing!
ChunkVNC - Free PC Remote control with the Open Source UltraVNC wrapper InstantSupport!
Post Reply