This is a php script that accesses data from the unifi controller through the "art of wifi" API, searching for connected users and thereby generating a log with information such as mac, ip, 802.1x address, among others. This kind of log is not automatically generated by the unifi controller and therefore the use of this script is justified.
The script also fetches the user's email by accessing the LDAP base that users are connected via wireless (unifi) and sends email to those logged in from more than 3 different devices at same time.
Please check and edit config.sample.php as needed. For future versions we can implement user logoff on older device if he authenticates on more than 3 devices at the same time.
- Art of Wifi from https://github.com/Art-of-WiFi/UniFi-API-client
- PHP Mailer from https://github.com/PHPMailer/PHPMailer
- PHP >= 7
- Linux/debian libs:
- php-ldap
- php-curl
- git clone https://github.com/dcc6fvo/php-unifi-8021x-log
- cp config.sample.php config.php
- edit config.php
php unifi-8021x-log.php