Merge pull request #24539 from frederic34/patch-4

use isModEnabled
This commit is contained in:
Laurent Destailleur 2023-04-18 17:13:12 +02:00 committed by GitHub
commit c80921345e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -459,7 +459,7 @@ class Translate
// Enable caching of lang file in memory (not by default)
$usecachekey = '';
// Using a memcached server
if (!empty($conf->memcached->enabled) && !empty($conf->global->MEMCACHED_SERVER)) {
if (isModEnabled('memcached') && !empty($conf->global->MEMCACHED_SERVER)) {
$usecachekey = $newdomain.'_'.$langofdir; // Should not contains special chars
} elseif (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02)) {
// Using cache with shmop. Speed gain: 40ms - Memory overusage: 200ko (Size of session cache file)

View File

@ -12,7 +12,7 @@
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 charlene Benke <charlie@patas-monkey.com>
* Copyright (C) 2018-2021 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2019-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019-2023 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019 Abbes Bahfir <dolipar@dolipar.org>
*
* This program is free software; you can redistribute it and/or modify
@ -2453,7 +2453,7 @@ class User extends CommonObject
//print $password.'-'.$this->id.'-'.$dolibarr_main_instance_unique_id;
$url = $urlwithroot.'/user/passwordforgotten.php?action=validatenewpassword';
$url .= '&username='.urlencode($this->login)."&passworduidhash=".urlencode(dol_hash($password.'-'.$this->id.'-'.$dolibarr_main_instance_unique_id));
if (!empty($conf->multicompany->enabled)) {
if (isModEnabled('multicompany')) {
$url .= '&entity='.(!empty($this->entity) ? $this->entity : 1);
}