Move methods getIpAddress() and getUserAgent() to the Request class
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace Auth;
|
||||
|
||||
use Model\User;
|
||||
use Core\Request;
|
||||
|
||||
/**
|
||||
* Database authentication
|
||||
@@ -40,8 +41,8 @@ class Database extends Base
|
||||
$this->lastLogin->create(
|
||||
self::AUTH_NAME,
|
||||
$user['id'],
|
||||
$this->user->getIpAddress(),
|
||||
$this->user->getUserAgent()
|
||||
Request::getIpAddress(),
|
||||
Request::getUserAgent()
|
||||
);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace Auth;
|
||||
|
||||
require __DIR__.'/../../vendor/OAuth/bootstrap.php';
|
||||
|
||||
use Core\Request;
|
||||
use OAuth\Common\Storage\Session;
|
||||
use OAuth\Common\Consumer\Credentials;
|
||||
use OAuth\Common\Http\Uri\UriFactory;
|
||||
@@ -44,8 +45,8 @@ class GitHub extends Base
|
||||
$this->lastLogin->create(
|
||||
self::AUTH_NAME,
|
||||
$user['id'],
|
||||
$this->user->getIpAddress(),
|
||||
$this->user->getUserAgent()
|
||||
Request::getIpAddress(),
|
||||
Request::getUserAgent()
|
||||
);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace Auth;
|
||||
|
||||
require __DIR__.'/../../vendor/OAuth/bootstrap.php';
|
||||
|
||||
use Core\Request;
|
||||
use OAuth\Common\Storage\Session;
|
||||
use OAuth\Common\Consumer\Credentials;
|
||||
use OAuth\Common\Http\Uri\UriFactory;
|
||||
@@ -45,8 +46,8 @@ class Google extends Base
|
||||
$this->lastLogin->create(
|
||||
self::AUTH_NAME,
|
||||
$user['id'],
|
||||
$this->user->getIpAddress(),
|
||||
$this->user->getUserAgent()
|
||||
Request::getIpAddress(),
|
||||
Request::getUserAgent()
|
||||
);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace Auth;
|
||||
|
||||
use Core\Request;
|
||||
|
||||
/**
|
||||
* LDAP model
|
||||
*
|
||||
@@ -58,8 +60,8 @@ class Ldap extends Base
|
||||
$this->lastLogin->create(
|
||||
self::AUTH_NAME,
|
||||
$user['id'],
|
||||
$this->user->getIpAddress(),
|
||||
$this->user->getUserAgent()
|
||||
Request::getIpAddress(),
|
||||
Request::getUserAgent()
|
||||
);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Auth;
|
||||
|
||||
use Core\Request;
|
||||
use Core\Security;
|
||||
use Core\Tool;
|
||||
|
||||
@@ -107,8 +108,8 @@ class RememberMe extends Base
|
||||
$this->lastLogin->create(
|
||||
self::AUTH_NAME,
|
||||
$this->acl->getUserId(),
|
||||
$this->user->getIpAddress(),
|
||||
$this->user->getUserAgent()
|
||||
Request::getIpAddress(),
|
||||
Request::getUserAgent()
|
||||
);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Auth;
|
||||
|
||||
use Core\Request;
|
||||
use Core\Security;
|
||||
|
||||
/**
|
||||
@@ -44,8 +45,8 @@ class ReverseProxy extends Base
|
||||
$this->lastLogin->create(
|
||||
self::AUTH_NAME,
|
||||
$user['id'],
|
||||
$this->user->getIpAddress(),
|
||||
$this->user->getUserAgent()
|
||||
Request::getIpAddress(),
|
||||
Request::getUserAgent()
|
||||
);
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user