mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
use isModEnabled
This commit is contained in:
parent
7ce079a2fe
commit
f06f2ff6f7
|
|
@ -186,7 +186,7 @@ class Utils
|
|||
}
|
||||
|
||||
// Recreate temp dir that are not automatically recreated by core code for performance purpose, we need them
|
||||
if (!empty($conf->api->enabled)) {
|
||||
if (isModEnabled('api')) {
|
||||
dol_mkdir($conf->api->dir_temp);
|
||||
}
|
||||
dol_mkdir($conf->user->dir_temp);
|
||||
|
|
|
|||
|
|
@ -1092,7 +1092,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|||
print $valuetoshow;
|
||||
print '</td></tr>';
|
||||
|
||||
if (!empty($conf->api->enabled)) {
|
||||
if (isModEnabled('api')) {
|
||||
// API key
|
||||
//$generated_password = getRandomPassword(false);
|
||||
print '<tr><td>'.$langs->trans("ApiKey").'</td>';
|
||||
|
|
@ -1890,7 +1890,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|||
}
|
||||
|
||||
// API key
|
||||
if (!empty($conf->api->enabled) && ($user->id == $id || $user->admin || $user->hasRight("api", "apikey", "generate"))) {
|
||||
if (isModEnabled('api') && ($user->id == $id || $user->admin || $user->hasRight("api", "apikey", "generate"))) {
|
||||
print '<tr class="nooddeven"><td>'.$langs->trans("ApiKey").'</td>';
|
||||
print '<td>';
|
||||
if (!empty($object->api_key)) {
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ $fieldstosearchall = array(
|
|||
'u.note_public'=>"NotePublic",
|
||||
'u.note_private'=>"NotePrivate"
|
||||
);
|
||||
if (!empty($conf->api->enabled)) {
|
||||
if (isModEnabled('api')) {
|
||||
$fieldstosearchall['u.api_key'] = "ApiKey";
|
||||
}
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ $arrayfields = array(
|
|||
'u.office_phone'=>array('label'=>"PhonePro", 'checked'=>1, 'position'=>31),
|
||||
'u.user_mobile'=>array('label'=>"PhoneMobile", 'checked'=>1, 'position'=>32),
|
||||
'u.email'=>array('label'=>"EMail", 'checked'=>1, 'position'=>35),
|
||||
'u.api_key'=>array('label'=>"ApiKey", 'checked'=>0, 'position'=>40, "enabled"=>(!empty($conf->api->enabled) && $user->admin)),
|
||||
'u.api_key'=>array('label'=>"ApiKey", 'checked'=>0, 'position'=>40, "enabled"=>(isModEnabled('api') && $user->admin)),
|
||||
'u.fk_soc'=>array('label'=>"Company", 'checked'=>($contextpage == 'employeelist' ? 0 : 1), 'position'=>45),
|
||||
'u.ref_employee'=>array('label'=>"RefEmployee", 'checked'=>-1, 'position'=>60, 'enabled'=>(isModEnabled('hrm') && $permissiontoreadhr)),
|
||||
'u.national_registration_number'=>array('label'=>"NationalRegistrationNumber", 'checked'=>-1, 'position'=>61, 'enabled'=>(isModEnabled('hrm') && $permissiontoreadhr)),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user