webcontextmanager IsIPRegistered

This commit is contained in:
Astrologies 2021-12-01 21:12:30 -05:00
parent 7d51370742
commit 9a68dbf7ba
3 changed files with 13 additions and 13 deletions

View File

@ -110,5 +110,17 @@ namespace Alphaland\Web {
}
return false;
}
public static function IsIpRegistered(string $ip)
{
$userip = $GLOBALS['pdo']->prepare('SELECT * FROM `users` WHERE ip = :ipaddy');
$userip->bindParam(':ipaddy', $ip, PDO::PARAM_STR);
$userip->execute();
if ($userip->rowCount() > 0)
{
return true;
}
return false;
}
}
}

View File

@ -6820,16 +6820,4 @@ function adminPanelStats() {
';
}
function isIPAssociatedWithAccount($ip)
{
$userip = $GLOBALS['pdo']->prepare('SELECT * FROM `users` WHERE ip = :ipaddy');
$userip->bindParam(':ipaddy', $ip, PDO::PARAM_STR);
$userip->execute();
if ($userip->rowCount() > 0)
{
return true;
}
return false;
}
//end utility }

View File

@ -81,7 +81,7 @@ else
$ip = getIP();
if (isIPAssociatedWithAccount($ip))
if (WebContextManager::IsIpRegistered($ip))
{
$error = "Please contact an Administrator if possible.";
}