Store in GIT

This commit is contained in:
2026-06-17 15:46:26 +02:00
parent 47150cc7ca
commit 876ad89e72
134 changed files with 31034 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
<?php
require("../../../inc/connect.php");
require("../../../inc/session.php");
$device = $_POST['device'];
//Validate Device ID
if(strlen($device) != 6)
{
error("devices", "Device ID invalid");
}
$sql = "SELECT `id` FROM `device` WHERE `dev_id`='" . $device . "' AND `user`=0";
$query = ExecQuery($mysqli, $sql);
if($query->num_rows < 1)
{
error("devices", "Device ID invalid");
}
$code = $email . "~" . $device . "~";
$code .= RandomString(96 - strlen($code));
$code = str_rot13($code);
$sql = "UPDATE user SET `code`='$code' WHERE `id`=$userid";
ExecQuery($mysqli, $sql);
$msg = "Hello " . $username . ",\n\n";
$msg .= "Please verify your new device by clicking the link below.\n";
$msg .= "<a href='http://lipa.kvewijk.nl/manage/php/session/verify.php?code=" . urlencode($code) . "'>Verify</a>";
sendMail($email, "Verify Device", $msg);
success("devices", "An email has been sent to " . $email . " for verification");
?>