Add note if integrity check is disabled

Our issue template states that users should post the output of `/index.php/settings/integrity/failed`, at the moment it displays that all passes have been passed if the integrity checker has been disabled.

This is however a wrong approach considering that some distributions are gonna package Frankenstein releases and makes it harder for us to detect such issues. Thus if the integrity code checker is disabled (using the config switch)  it displays now: `Appcode checker has been disabled. Integrity cannot be verified.`

This is not displayed anywhere else in the UI except these URL used for us for debugging purposes.
This commit is contained in:
Lukas Reschke 2016-02-12 11:11:39 +01:00
parent f8607ac132
commit 4b90429178
3 changed files with 23 additions and 2 deletions

View File

@ -87,8 +87,6 @@ class Checker {
* @return bool
*/
public function isCodeCheckEnforced() {
// FIXME: Once the signing server is instructed to sign daily, beta and
// RCs as well these need to be included also.
$signedChannels = [
'daily',
'testing',

View File

@ -271,6 +271,10 @@ class CheckSetupController extends Controller {
* @return DataResponse
*/
public function getFailedIntegrityCheckFiles() {
if(!$this->checker->isCodeCheckEnforced()) {
return new DataDisplayResponse('Integrity checker has been disabled. Integrity cannot be verified.');
}
$completeResults = $this->checker->getResults();
if(!empty($completeResults)) {

View File

@ -618,7 +618,22 @@ class CheckSetupControllerTest extends TestCase {
$this->assertEquals($expected, $this->checkSetupController->rescanFailedIntegrityCheck());
}
public function testGetFailedIntegrityCheckDisabled() {
$this->checker
->expects($this->once())
->method('isCodeCheckEnforced')
->willReturn(false);
$expected = new DataDisplayResponse('Integrity checker has been disabled. Integrity cannot be verified.');
$this->assertEquals($expected, $this->checkSetupController->getFailedIntegrityCheckFiles());
}
public function testGetFailedIntegrityCheckFilesWithNoErrorsFound() {
$this->checker
->expects($this->once())
->method('isCodeCheckEnforced')
->willReturn(true);
$this->checker
->expects($this->once())
->method('getResults')
@ -635,6 +650,10 @@ class CheckSetupControllerTest extends TestCase {
}
public function testGetFailedIntegrityCheckFilesWithSomeErrorsFound() {
$this->checker
->expects($this->once())
->method('isCodeCheckEnforced')
->willReturn(true);
$this->checker
->expects($this->once())
->method('getResults')