April 2023

HNAP PHP script #

Saturday, April 8, 2023 at 12:11 PM

I recently made a webpage that lists every device connected to our six Wi-Fi routers.

I worked for two days on the PHP script that extracts the list from the first router (the others where much easier).

http://code.philippe97.ca/HNAP1/

Download the base.xml and soap.php files and edit the password and IP address in soap.php.

I use it like this :

$names = $ips = array();
$one24 = $one5 = $one5g = $onelan = array();
foreach (soap('GetClientInfo')->ClientInfoLists->ClientInfo as $client) {
	$mac = strtoupper($client->MacAddress);
	if ($ip = $client->IPv4Address)
		$ips[$mac] = $ip;
	if ($name = $client->DeviceName and $name != '*')
		$names[$mac] = $name;
	$key = '';
	if ($client->Type == 'WiFi_2.4G')
		$key = '24';
	if ($client->Type == 'WiFi_5G')
		$key = '5';
	if ($client->Type == 'WiFi_5G_Guest')
		$key = '5g';
	if ($client->Type == 'LAN')
		$key = 'lan';
	if (!$key)
		continue;
	${'one' . $key}[$mac] = array($mac, null, null);
}

Comment

No more HTTPS #

Monday, April 10, 2023 at 11:55 AM

Yesterday, I disabled HTTPS for www.philippe97.ca.

That simplified my main apache configuration file a lot (000-default.conf).

I also simplified my other configuration files.

I also changed how I supported HTTPS on my other subdomains.

I used to use separate folders and Alias rules to redirect the /.well-known/ URL to another folder (/var/www/wellssl...).

I now put the .well-known folder in the document root (/var/www/subdomains/*/.well-known/).

I also made sure that the /.well-known/ is not redirected to the HTTPS version of the domain.

Comment