FIX #33424 Create cronjob security key not posible (#33677)

* FIX #33424 Create cronjob security key not posible

FIX Create cronjob security key not posible because constant CRON_DISABLE_KEY_CHANGE does not exist

* Update cron.php

using getDolGlobalInt() is better than using getDolGlobalString because the default value is 0; then the refresh button works fine
This commit is contained in:
PsyCrow 2025-04-01 02:57:46 -06:00 committed by GitHub
parent 0aea1709f7
commit a6f2001f43
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -104,13 +104,13 @@ if (getDolGlobalInt('CRON_DISABLE_KEY_CHANGE') > 0) {
$disabled = ' disabled="disabled"';
}
print '<td>';
if (getDolGlobalString('CRON_DISABLE_KEY_CHANGE') != 1) {
if (getDolGlobalInt('CRON_DISABLE_KEY_CHANGE') != 1) {
print '<input type="text" class="flat minwidth300 widthcentpercentminusx"'.$disabled.' id="CRON_KEY" name="CRON_KEY" value="'.(GETPOST('CRON_KEY') ? GETPOST('CRON_KEY') : getDolGlobalString('CRON_KEY')).'">';
if (getDolGlobalString('CRON_DISABLE_KEY_CHANGE') == 0) {
if (getDolGlobalInt('CRON_DISABLE_KEY_CHANGE') == 0) {
if (!empty($conf->use_javascript_ajax)) {
print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
}
} elseif (getDolGlobalString('CRON_DISABLE_KEY_CHANGE') == -1) {
} elseif (getDolGlobalInt('CRON_DISABLE_KEY_CHANGE') == -1) {
$langs->load("errors");
print '&nbsp;'.img_picto($langs->trans("WarningChangingThisMayBreakStopTaskScheduler"), 'info');
}
@ -126,7 +126,7 @@ print '</table>';
print dol_get_fiche_end();
if (!getDolGlobalString('CRON_DISABLE_KEY_CHANGE')) {
if (!getDolGlobalInt('CRON_DISABLE_KEY_CHANGE')) {
print $form->buttonsSaveCancel("Save", '');
}