webcontextmanager IsIPRegistered
This commit is contained in:
parent
7d51370742
commit
9a68dbf7ba
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ else
|
|||
|
||||
$ip = getIP();
|
||||
|
||||
if (isIPAssociatedWithAccount($ip))
|
||||
if (WebContextManager::IsIpRegistered($ip))
|
||||
{
|
||||
$error = "Please contact an Administrator if possible.";
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue