mirror of https://github.com/MISP/MISP
chg: [update] Actually reset `UpdateFailNumber` when manually unlocking
parent
e058c7a302
commit
b87ee19146
|
@ -2181,6 +2181,7 @@ misp.direct_call(relative_path, body)
|
|||
throw new MethodNotAllowedException(__('Site admin accounts cannot be used to release the update lock.'));
|
||||
}
|
||||
$this->Server->changeLockState(false);
|
||||
$this->Server->resetUpdateFailNumber();
|
||||
$this->redirect(array('action' => 'updateProgress'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1718,7 +1718,7 @@ class AppModel extends Model
|
|||
if ($db_update_success) {
|
||||
$db_version['AdminSetting']['value'] = $update;
|
||||
$this->AdminSetting->save($db_version);
|
||||
$this->__resetUpdateFailNumber();
|
||||
$this->resetUpdateFailNumber();
|
||||
} else {
|
||||
$this->__increaseUpdateFailNumber();
|
||||
}
|
||||
|
@ -1889,7 +1889,7 @@ class AppModel extends Model
|
|||
return ($update_fail_number !== false && $update_fail_number !== '') ? $update_fail_number : 0;
|
||||
}
|
||||
|
||||
public function __resetUpdateFailNumber()
|
||||
public function resetUpdateFailNumber()
|
||||
{
|
||||
$this->AdminSetting = ClassRegistry::init('AdminSetting');
|
||||
$this->AdminSetting->changeSetting('update_fail_number', 0);
|
||||
|
|
|
@ -30,7 +30,6 @@ if (isset($updateProgress['preTestSuccess']) && $updateProgress['preTestSuccess'
|
|||
<span>
|
||||
<?php if ($updateFailNumberReached): ?>
|
||||
<h5 style="margin: 5px 0px; display: inline-block"><?php echo __('Update are locked due to to many update fails'); ?></h5>
|
||||
<i>(<?php echo sprintf(__('unlock in %smin %ssec'), '<span id="unlock_remaining_time_min">-</span>', '<span id="unlock_remaining_time_sec">-</span>'); ?>)</i>
|
||||
<?php else: ?>
|
||||
<h5 style="margin: 5px 0px; display: inline-block"><?php echo __('Update are locked due to an ongoing update process. Release lock only if you know what you are doing'); ?></h5>
|
||||
<i>(<?php echo sprintf(__('automatically unlock in %smin %ssec'), '<span id="unlock_remaining_time_min">-</span>', '<span id="unlock_remaining_time_sec">-</span>'); ?>)</i>
|
||||
|
|
Loading…
Reference in New Issue