Skip to content

Commit

Permalink
Capture and display Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
ocdtrekkie committed Jun 17, 2024
1 parent 96dd181 commit afc5adc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .sandstorm/sandstorm-pkgdef.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ const pkgdef :Spk.PackageDefinition = (

appTitle = (defaultText = "XRF Sync"),

appVersion = 3, # Increment this for every release.
appVersion = 4, # Increment this for every release.

appMarketingVersion = (defaultText = "0.0.4"),
appMarketingVersion = (defaultText = "0.0.5"),
# Human-readable representation of appVersion. Should match the way you
# identify versions of your app in documentation and marketing.

Expand Down
5 changes: 3 additions & 2 deletions api/v1.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
$message=mysqli_real_escape_string($xrf_db, $_GET['message'] ?? ''); //ciphertext
$user_agent=mysqli_real_escape_string($xrf_db, $_GET['user_agent']);
$new_ip_addr=mysqli_real_escape_string($xrf_db, $_GET['ip_address'] ?? '');
$new_winver=mysqli_real_escape_string($xrf_db, $_GET['windows_version'] ?? '');

$identifysender = mysqli_prepare($xrf_db, "SELECT pool_id, descr, static, last_ip_addr FROM y_nodes WHERE access_key=?");
mysqli_stmt_bind_param($identifysender, "s", $access_key);
Expand All @@ -26,9 +27,9 @@
mysqli_stmt_execute($logipchange) or die(mysqli_error($xrf_db));
}

$updatenode = mysqli_prepare($xrf_db, "UPDATE y_nodes SET last_seen = NOW(), last_ip_addr = ?, user_agent = ? WHERE access_key = ?");
$updatenode = mysqli_prepare($xrf_db, "UPDATE y_nodes SET last_seen = NOW(), last_ip_addr = ?, last_winver = ?, user_agent = ? WHERE access_key = ?");
if ($user_agent == "") { $user_agent = mysqli_real_escape_string($xrf_db, $_SERVER['HTTP_USER_AGENT']); }
mysqli_stmt_bind_param($updatenode, "sss", $new_ip_addr, $user_agent, $access_key);
mysqli_stmt_bind_param($updatenode, "ssss", $new_ip_addr, $new_winver, $user_agent, $access_key);
mysqli_stmt_execute($updatenode) or die(mysqli_error($xrf_db));

if ($message_type == "fetch" && $destination == "server") {
Expand Down
6 changes: 4 additions & 2 deletions modules/sync/acpm_nodelist.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

$num=mysqli_num_rows($result);

echo "<table><tr><td width=40><b>ID</b></td><td width=160><b>Friendly Name</b></td><td width=50><b>Pool</b></td><td width=220><b>Last Seen</b><td width=180><b>Last IP Address</b></td><td width=200><b>User Agent</b></td></tr>";
echo "<table><tr><td width=40><b>ID</b></td><td width=160><b>Friendly Name</b></td><td width=50><b>Pool</b></td><td width=220><b>Last Seen</b><td width=180><b>Last IP Address</b></td><td width=180><b>Windows Build</b></td><td width=200><b>User Agent</b></td></tr>";
$qq=0;
while ($qq < $num) {

Expand All @@ -17,11 +17,13 @@
$pool_id=xrf_mysql_result($result,$qq,"pool_id");
$last_seen=xrf_mysql_result($result,$qq,"last_seen");
$last_ip_addr=xrf_mysql_result($result,$qq,"last_ip_addr");
$last_winver=xrf_mysql_result($result,$qq,"last_winver");
if ($last_winver != '') { $winbuild=substr($last_winver, 5); }
$user_agent=xrf_mysql_result($result,$qq,"user_agent");
$static=xrf_mysql_result($result,$qq,"static");
// TODO: If static, last seen should be green or red based on how long since it's checked in

echo "<tr><td>$id</td><td>$descr</td><td>$pool_id</td><td>$last_seen</td><td>$last_ip_addr</td><td>$user_agent</td></tr>";
echo "<tr><td>$id</td><td>$descr</td><td>$pool_id</td><td>$last_seen</td><td>$last_ip_addr</td><td>$winbuild</td><td>$user_agent</td></tr>";
$qq++;
}

Expand Down

0 comments on commit afc5adc

Please sign in to comment.