mirror of
https://github.com/espocrm/espocrm.git
synced 2026-03-11 03:47:00 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a7b782309 | ||
|
|
9d080d7dca | ||
|
|
2582dfe3c4 | ||
|
|
295411a5d2 | ||
|
|
453589de92 | ||
|
|
f42c33d77a | ||
|
|
0d202499bc | ||
|
|
be6896f34c | ||
|
|
e5a3a0637d |
@@ -30,7 +30,6 @@
|
||||
namespace Espo\Core\Authentication;
|
||||
|
||||
use Espo\Core\Exceptions\{
|
||||
Error,
|
||||
Forbidden,
|
||||
ServiceUnavailable,
|
||||
};
|
||||
@@ -39,7 +38,7 @@ use Espo\Entities\{
|
||||
Portal,
|
||||
User,
|
||||
AuthLogRecord,
|
||||
AuthToken,
|
||||
AuthToken as AuthTokenEntity,
|
||||
};
|
||||
|
||||
use Espo\Core\Authentication\{
|
||||
@@ -48,6 +47,7 @@ use Espo\Core\Authentication\{
|
||||
TwoFactor\Factory as TwoFAFactory,
|
||||
AuthToken\AuthTokenManager,
|
||||
AuthToken\AuthTokenData,
|
||||
AuthToken\AuthToken,
|
||||
};
|
||||
|
||||
use Espo\Core\{
|
||||
@@ -59,7 +59,6 @@ use Espo\Core\{
|
||||
Api\Request,
|
||||
};
|
||||
|
||||
use StdClass;
|
||||
use DateTime;
|
||||
|
||||
/**
|
||||
@@ -136,7 +135,7 @@ class Authentication
|
||||
* @return Result if success or second step required. NULL if failed.
|
||||
*/
|
||||
public function login(
|
||||
?string $username, ?string $password = null, Request $request, ?string $authenticationMethod = null
|
||||
?string $username, ?string $password, Request $request, ?string $authenticationMethod = null
|
||||
) : ?Result {
|
||||
$isByTokenOnly = false;
|
||||
|
||||
@@ -474,13 +473,14 @@ class Authentication
|
||||
$this->setSecretInCookie($authToken->getSecret());
|
||||
}
|
||||
|
||||
if ($this->config->get('authTokenPreventConcurrent')) {
|
||||
if ($this->config->get('authTokenPreventConcurrent') && $authToken instanceof AuthTokenEntity) {
|
||||
$concurrentAuthTokenList = $this->entityManager
|
||||
->getRepository('AuthToken')
|
||||
->select(['id'])
|
||||
->where([
|
||||
'userId' => $user->id,
|
||||
'isActive' => true,
|
||||
'id!=' => $authToken->get('id'),
|
||||
])
|
||||
->find();
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ use Monolog\{
|
||||
};
|
||||
|
||||
use ReflectionClass;
|
||||
use ReflectionMethod;
|
||||
use RuntimeException;
|
||||
|
||||
class DefaultHandlerLoader
|
||||
|
||||
@@ -31,6 +31,7 @@ namespace Espo\Core\Log;
|
||||
|
||||
use Espo\Core\{
|
||||
Log\Handler\EspoRotatingFileHandler,
|
||||
Utils\Config,
|
||||
};
|
||||
|
||||
use Monolog\{
|
||||
@@ -40,11 +41,18 @@ use Monolog\{
|
||||
|
||||
class EspoRotatingFileHandlerLoader implements HandlerLoader
|
||||
{
|
||||
private $config;
|
||||
|
||||
public function __construct(Config $config)
|
||||
{
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
public function load(array $params) : HandlerInterface
|
||||
{
|
||||
$filename = $params['filename'] ?? 'data/logs/espo.log';
|
||||
$level = $params['level'] ?? Logger::NOTICE;
|
||||
|
||||
return new EspoRotatingFileHandler($filename, 0, $level);
|
||||
return new EspoRotatingFileHandler($this->config, $filename, 0, $level);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
},
|
||||
"userId": {
|
||||
"type": "varchar",
|
||||
"maxLength": 11
|
||||
"maxLength": 24
|
||||
}
|
||||
},
|
||||
"links": {
|
||||
|
||||
@@ -46,6 +46,8 @@ use Espo\{
|
||||
|
||||
class TcpdfCollectionPrinter implements CollectionPrinter
|
||||
{
|
||||
protected $entityProcessor;
|
||||
|
||||
protected $config;
|
||||
protected $htmlizerFactory;
|
||||
|
||||
|
||||
@@ -45,6 +45,8 @@ use Espo\{
|
||||
|
||||
class TcpdfEntityPrinter implements EntityPrinter
|
||||
{
|
||||
protected $entityProcessor;
|
||||
|
||||
protected $config;
|
||||
protected $htmlizerFactory;
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ define('views/notification/badge', 'view', function (Dep) {
|
||||
.then(
|
||||
function (result) {
|
||||
for (const type in result) {
|
||||
const list = result[name];
|
||||
const list = result[type];
|
||||
|
||||
list.forEach(function (item) {
|
||||
this.showPopupNotification(type, item);
|
||||
|
||||
@@ -26,16 +26,22 @@
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
Espo.define('views/user/fields/user-name', 'views/fields/varchar', function (Dep) {
|
||||
define('views/user/fields/user-name', 'views/fields/varchar', function (Dep) {
|
||||
|
||||
return Dep.extend({
|
||||
|
||||
setup: function () {
|
||||
Dep.prototype.setup.call(this);
|
||||
|
||||
this.validations.push('userName');
|
||||
},
|
||||
|
||||
afterRender: function () {
|
||||
Dep.prototype.afterRender.call(this);
|
||||
|
||||
var userNameRegularExpression = this.getConfig().get('userNameRegularExpression') || '[^a-z0-9\-@_\.\s]';
|
||||
var userNameRegularExpression = this.getUserNameRegularExpression();
|
||||
|
||||
if (this.mode == 'edit') {
|
||||
if (this.mode === 'edit') {
|
||||
this.$element.on('change', function () {
|
||||
var value = this.$element.val();
|
||||
var re = new RegExp(userNameRegularExpression, 'gi');
|
||||
@@ -44,8 +50,33 @@ Espo.define('views/user/fields/user-name', 'views/fields/varchar', function (Dep
|
||||
this.trigger('change');
|
||||
}.bind(this));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
getUserNameRegularExpression: function () {
|
||||
return this.getConfig().get('userNameRegularExpression') || '[^a-z0-9\-@_\.\s]';
|
||||
},
|
||||
|
||||
validateUserName: function () {
|
||||
var value = this.model.get(this.name);
|
||||
|
||||
if (!value) {
|
||||
return;
|
||||
}
|
||||
|
||||
var userNameRegularExpression = this.getUserNameRegularExpression();
|
||||
|
||||
var re = new RegExp(userNameRegularExpression, 'gi');
|
||||
|
||||
if (!re.test(value)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var msg = this.translate('fieldInvalid', 'messages').replace('{field}', this.getLabelText());
|
||||
|
||||
this.showValidationMessage(msg);
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "espocrm",
|
||||
"version": "6.1.0",
|
||||
"version": "6.1.2",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "espocrm",
|
||||
"version": "6.1.0",
|
||||
"version": "6.1.2",
|
||||
"description": "",
|
||||
"main": "index.php",
|
||||
"repository": {
|
||||
|
||||
Reference in New Issue
Block a user