Prevent Multiple Login with the same account.
Posted: Sat Aug 08, 2015 5:57 am
Hello i have VPN panel and scripted on PHP and the authentication of VPN is via mysql/remote on the server database but the problem is i want an single login script it is possible with freeradius but i dont know how to setup it? anyone can help me?... ready to pay and also there is is_connected structure there maybe we can use it so if the client connect the is_connected turn to 1 and if disconnected turn to 0 if 1 can't connect? is it possible?
Here's the script
Im willing to donate for someone who can help me.
Here's the script
Code: Select all
#!/bin/bash
### Database Informations
### OpenVPN get's send the filename to the script, with the script's first parameter = $1
### The file contains 2 lines, Username and Password what the client sent to the server ( --auth-user-pass )
### When the script finished, the file will be removed
vpnnev=`head -n1 $1 | tail -1` # Get the First line -> Username
vpnjelszo=`head -n2 $1 | tail -1 ` # Get the Second line -> Password
user_name=`mysql -u username -ppassword-D database -h host --skip-column-name -e "SELECT users.user_name FROM users WHERE users.user_name='$vpnnev' AND users.user_pass='$vpnjelszo' AND users.is_active=1 AND users.duration > 0"`
if [ "$user_name" == "$vpnnev" ]; then
exit 0
else
exit 1
fi