dev
This commit is contained in:
+1
-1
@@ -27,7 +27,7 @@
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Authentication;
|
||||
namespace Espo\Core\Authentication;
|
||||
|
||||
use Espo\Entities\{
|
||||
User,
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Authentication;
|
||||
namespace Espo\Core\Authentication;
|
||||
|
||||
use Espo\Entities\{
|
||||
User,
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Authentication;
|
||||
namespace Espo\Core\Authentication;
|
||||
|
||||
use Espo\Entities\{
|
||||
User,
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Authentication;
|
||||
namespace Espo\Core\Authentication;
|
||||
|
||||
use Espo\Core\Exceptions\Error;
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Authentication\LDAP;
|
||||
namespace Espo\Core\Authentication\LDAP;
|
||||
|
||||
class Client extends \Laminas\Ldap\Ldap
|
||||
{
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Authentication\LDAP;
|
||||
namespace Espo\Core\Authentication\LDAP;
|
||||
|
||||
use Espo\Core\Utils\Config;
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Authentication;
|
||||
namespace Espo\Core\Authentication;
|
||||
|
||||
use Espo\Entities\{
|
||||
User,
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Authentication\TwoFA;
|
||||
namespace Espo\Core\Authentication\TwoFA;
|
||||
|
||||
use Espo\Entities\User;
|
||||
|
||||
+2
-2
@@ -27,12 +27,12 @@
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Authentication\TwoFA;
|
||||
namespace Espo\Core\Authentication\TwoFA;
|
||||
|
||||
use Espo\Entities\User;
|
||||
|
||||
use Espo\ORM\EntityManager;
|
||||
use Espo\Core\Utils\Authentication\TwoFA\Utils\Totp as TotpUtils;
|
||||
use Espo\Core\Authentication\TwoFA\Utils\Totp as TotpUtils;
|
||||
|
||||
class Totp implements CodeVerify
|
||||
{
|
||||
+3
-3
@@ -27,7 +27,7 @@
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Authentication\TwoFA\Utils;
|
||||
namespace Espo\Core\Authentication\TwoFA\Utils;
|
||||
|
||||
use Espo\Core\InjectableFactory;
|
||||
use Espo\Core\Utils\Metadata;
|
||||
@@ -52,9 +52,9 @@ class Factory
|
||||
if (!$className) {
|
||||
$sanitizedName = preg_replace('/[^a-zA-Z0-9]+/', '', $method);
|
||||
|
||||
$className = "\\Espo\\Custom\\Core\\Utils\\Authentication\\TwoFA\\" . $sanitizedName;
|
||||
$className = "Espo\\Custom\\Core\\\Authentication\\TwoFA\\" . $sanitizedName;
|
||||
if (!class_exists($className)) {
|
||||
$className = "\\Espo\\Core\\Utils\\Authentication\\TwoFA\\" . $sanitizedName;
|
||||
$className = "Espo\\Core\\Authentication\\TwoFA\\" . $sanitizedName;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-12
@@ -27,28 +27,21 @@
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Authentication\TwoFA\Utils;
|
||||
namespace Espo\Core\Authentication\TwoFA\Utils;
|
||||
|
||||
use RobThree\Auth\TwoFactorAuth;
|
||||
|
||||
class Totp
|
||||
{
|
||||
protected $config;
|
||||
|
||||
public function __construct(\Espo\Core\Utils\Config $config)
|
||||
{
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
public function verifyCode(string $secret, string $code)
|
||||
{
|
||||
$impl = new \RobThree\Auth\TwoFactorAuth();
|
||||
|
||||
$impl = new TwoFactorAuth();
|
||||
return $impl->verifyCode($secret, $code);
|
||||
}
|
||||
|
||||
public function createSecret()
|
||||
{
|
||||
$impl = new \RobThree\Auth\TwoFactorAuth();
|
||||
|
||||
$impl = new TwoFactorAuth();
|
||||
return $impl->createSecret();
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -27,7 +27,7 @@
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Authentication\TwoFA\Utils;
|
||||
namespace Espo\Core\Authentication\TwoFA\Utils;
|
||||
|
||||
use Espo\Core\InjectableFactory;
|
||||
use Espo\Core\Utils\Metadata;
|
||||
@@ -52,9 +52,9 @@ class UserFactory
|
||||
if (!$className) {
|
||||
$sanitizedName = preg_replace('/[^a-zA-Z0-9]+/', '', $method);
|
||||
|
||||
$className = "\\Espo\\Custom\\Core\\Utils\\Authentication\\TwoFA\\User\\" . $sanitizedName;
|
||||
$className = "Espo\\Custom\\Core\\Authentication\\TwoFA\\User\\" . $sanitizedName;
|
||||
if (!class_exists($className)) {
|
||||
$className = "\\Espo\\Core\\Utils\\Authentication\\TwoFA\\User\\" . $sanitizedName;
|
||||
$className = "Espo\\Core\\Authentication\\TwoFA\\User\\" . $sanitizedName;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -27,11 +27,11 @@
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Authentication\Utils;
|
||||
namespace Espo\Core\Authentication\Utils;
|
||||
|
||||
use Espo\Core\InjectableFactory;
|
||||
use Espo\Core\Utils\Metadata;
|
||||
use Espo\Core\Utils\Authentication\Login;
|
||||
use Espo\Core\Authentication\Login;
|
||||
|
||||
class AuthenticationFactory
|
||||
{
|
||||
@@ -51,9 +51,9 @@ class AuthenticationFactory
|
||||
if (!$className) {
|
||||
$sanitizedName = preg_replace('/[^a-zA-Z0-9]+/', '', $method);
|
||||
|
||||
$className = "Espo\\Custom\\Core\\Utils\\Authentication\\" . $sanitizedName;
|
||||
$className = "Espo\\Custom\\Core\\Authentication\\" . $sanitizedName;
|
||||
if (!class_exists($className)) {
|
||||
$className = "Espo\\Core\\Utils\\Authentication\\" . $sanitizedName;
|
||||
$className = "Espo\\Core\\Authentication\\" . $sanitizedName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ use Espo\Entities\{
|
||||
AuthLogRecord,
|
||||
};
|
||||
|
||||
use Espo\Core\Utils\Authentication\{
|
||||
use Espo\Core\Authentication\{
|
||||
Login,
|
||||
TwoFA\СodeVerify as TwoFACodeVerify,
|
||||
Utils\AuthenticationFactory,
|
||||
|
||||
@@ -81,16 +81,16 @@
|
||||
"className": "Espo\\Core\\Utils\\Hasher"
|
||||
},
|
||||
"authenticationFactory": {
|
||||
"className": "Espo\\Core\\Utils\\Authentication\\Utils\\AuthenticationFactory"
|
||||
"className": "Espo\\Core\\Authentication\\Utils\\AuthenticationFactory"
|
||||
},
|
||||
"auth2FAFactory": {
|
||||
"className": "Espo\\Core\\Utils\\Authentication\\TwoFA\\Utils\\Factory"
|
||||
"className": "Espo\\Core\\Authentication\\TwoFA\\Utils\\Factory"
|
||||
},
|
||||
"auth2FAUserFactory": {
|
||||
"className": "Espo\\Core\\Utils\\Authentication\\TwoFA\\Utils\\UserFactory"
|
||||
"className": "Espo\\Core\\Authentication\\TwoFA\\Utils\\UserFactory"
|
||||
},
|
||||
"totp": {
|
||||
"className": "Espo\\Core\\Utils\\Authentication\\TwoFA\\Utils\\Totp"
|
||||
"className": "Espo\\Core\\Authentication\\TwoFA\\Utils\\Totp"
|
||||
},
|
||||
"emailFilterManager": {
|
||||
"className": "Espo\\Core\\Utils\\EmailFilterManager"
|
||||
|
||||
@@ -44,8 +44,8 @@ use Espo\Core\{
|
||||
Utils\Config,
|
||||
};
|
||||
|
||||
use Espo\Core\Utils\Authentication\Utils\AuthenticationFactory;
|
||||
use Espo\Core\Utils\Authentication\TwoFA\Utils\UserFactory as Auth2FAUserFactory;
|
||||
use Espo\Core\Authentication\Utils\AuthenticationFactory;
|
||||
use Espo\Core\Authentication\TwoFA\Utils\UserFactory as Auth2FAUserFactory;
|
||||
|
||||
class UserSecurity
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user