Good morning,
currently I'm experiencing issues with my website (almost hitting 96% of Physical Memory Usage) and I'm trying to resolve the issue.
Given that I have a need to do external authentication of users from a PHP form, I suppose there is an incorrect method of calling some XenForo functions.
These are the function I use to authenticate the user given his username and password, and I'm asking if there is something missing, e.g. closing the connection to database or maybe some PHP destructor, which makes the server using a lot of its resources constantly.
Code:
$fileDir = '/home/.../public_html';
require($fileDir . '/src/XF.php');
XF::start($fileDir);
$app = XF::setupAPP('XF\App');
$username = $_POST['uname'];
$password = $_POST['password'];
$ip = $app->request->getIp();
$loginService = $app->service('XF:User\Login', $username, $ip);
$userValidate = $loginService->validate($password, $error);
if(!$userValidate){
//Negative check authentication
else
//Positive check authentication
currently I'm experiencing issues with my website (almost hitting 96% of Physical Memory Usage) and I'm trying to resolve the issue.
Given that I have a need to do external authentication of users from a PHP form, I suppose there is an incorrect method of calling some XenForo functions.
These are the function I use to authenticate the user given his username and password, and I'm asking if there is something missing, e.g. closing the connection to database or maybe some PHP destructor, which makes the server using a lot of its resources constantly.
Code:
$fileDir = '/home/.../public_html';
require($fileDir . '/src/XF.php');
XF::start($fileDir);
$app = XF::setupAPP('XF\App');
$username = $_POST['uname'];
$password = $_POST['password'];
$ip = $app->request->getIp();
$loginService = $app->service('XF:User\Login', $username, $ip);
$userValidate = $loginService->validate($password, $error);
if(!$userValidate){
//Negative check authentication
else
//Positive check authentication