chg: [update] Actually reset `UpdateFailNumber` when manually unlocking

pull/5002/head
mokaddem 2019-10-15 11:44:34 +02:00
parent e058c7a302
commit b87ee19146
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
3 changed files with 3 additions and 3 deletions

View File

@ -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'));
}
}

View File

@ -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);

View File

@ -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>