-
Notifications
You must be signed in to change notification settings - Fork 443
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1097 from ChurchCRM/self-update
Self update
- Loading branch information
Showing
13 changed files
with
482 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,35 @@ | ||
#Vagrant | ||
.vagrant/ | ||
|
||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm | ||
*.iml | ||
## Directory-based project format: | ||
.idea/ | ||
|
||
## File-based project format: | ||
*.ipr | ||
*.iws | ||
|
||
#Exclude composer vendor folders | ||
vendor | ||
composer.lock | ||
|
||
# Uploaded Images | ||
thumbnails | ||
|
||
# SASS | ||
.sass-cache | ||
|
||
#skins | ||
adminlte | ||
font-awesome | ||
ionicons | ||
|
||
# Configuration files with passwords | ||
src/Include/Config.php | ||
|
||
target | ||
/src/orm/model/ChurchCRM/Base/ | ||
/src/orm/model/ChurchCRM/Map/ | ||
#Vagrant | ||
.vagrant/ | ||
|
||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm | ||
*.iml | ||
## Directory-based project format: | ||
.idea/ | ||
|
||
## File-based project format: | ||
*.ipr | ||
*.iws | ||
|
||
#Exclude composer vendor folders | ||
vendor | ||
composer.lock | ||
|
||
# Uploaded Images | ||
thumbnails | ||
|
||
# SASS | ||
.sass-cache | ||
|
||
#skins | ||
adminlte | ||
font-awesome | ||
ionicons | ||
|
||
# Configuration files with passwords | ||
src/Include/Config.php | ||
|
||
target | ||
/src/orm/model/ChurchCRM/Base/ | ||
/src/orm/model/ChurchCRM/Map/ | ||
/src/signatures.json | ||
/src/integrityCheck.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
$CRMRoot = $argv[1]; | ||
$CRMRootLen = strlen($CRMRoot); | ||
$signatureFile = $CRMRoot."/signatures.json"; | ||
$composerFile = file_get_contents(__DIR__. "/src/composer.json"); | ||
$composerJson = json_decode($composerFile, true); | ||
|
||
echo "Creating Signature Definition at: ".$signatureFile."\r\n"; | ||
|
||
$signatureData = new stdClass(); | ||
$signatureData->version = $composerJson["version"]; | ||
$signatureData->files = array(); | ||
|
||
$projectFiles = new RecursiveDirectoryIterator($CRMRoot); | ||
$Iterator = new RecursiveIteratorIterator($projectFiles); | ||
$Regex = new RegexIterator($Iterator, '/^.+\.(php|js)$/i', RecursiveRegexIterator::GET_MATCH); | ||
foreach ($Regex as $obj ) | ||
{ | ||
$file = new stdClass(); | ||
$file->filename = substr($obj[0], $CRMRootLen+1); | ||
$file->sha1 = sha1_file($CRMRoot."/".$file->filename); | ||
array_push($signatureData->files, $file); | ||
} | ||
|
||
ksort($signatureData->files); | ||
|
||
$signatureData->sha1 = sha1(json_encode($signatureData->files)); | ||
file_put_contents($signatureFile, json_encode($signatureData)); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?php | ||
|
||
//Include the function library | ||
require 'Include/Config.php'; | ||
require 'Include/Functions.php'; | ||
|
||
//Set the page title | ||
$sPageTitle = gettext('Integrity Check Results'); | ||
if (!$_SESSION['bAdmin']) | ||
{ | ||
Redirect("index.php"); | ||
exit; | ||
} | ||
require 'Include/Header.php'; | ||
$integrityCheckFile = __DIR__ ."/integrityCheck.json"; | ||
$IntegrityCheckDetails = json_decode(file_get_contents($integrityCheckFile)); | ||
|
||
if ($IntegrityCheckDetails->status == "failure") | ||
{ | ||
?> | ||
<div class="callout callout-danger"> | ||
<h4><?= gettext("Integrity Check Failure") ?> </h4> | ||
<p><?= gettext("The previous integrity check failed") ?></p> | ||
<p><?= gettext("Details:")?> <?= $IntegrityCheckDetails->message ?></p> | ||
<?php | ||
if(count($IntegrityCheckDetails->files) > 0 ) | ||
{ | ||
?> | ||
<p><?= gettext("Files failing integrity check:") ?> | ||
<ul> | ||
<?php | ||
foreach ($IntegrityCheckDetails->files as $file) | ||
{ | ||
?> | ||
<li>FileName: <?= $file->filename ?> | ||
<?php | ||
if($file->status == "File Missing") | ||
{ | ||
?> | ||
<ul> | ||
<li><?= gettext("File Missing")?></li> | ||
</ul> | ||
<?php | ||
} | ||
else | ||
{ | ||
?> | ||
<ul> | ||
<li><?= gettext("Expected Hash:")?> <?= $file->expectedhash ?></li> | ||
<li><?= gettext("Actual Hash:") ?> <?= $file->actualhash ?></li> | ||
</ul> | ||
<?php | ||
} | ||
?> | ||
</li> | ||
<?php | ||
} | ||
?> | ||
</ul> | ||
<?php | ||
} | ||
?> | ||
</div> | ||
<?php | ||
} | ||
else | ||
{ | ||
?> | ||
<div class="callout callout-success"> | ||
<h4><?= gettext("Integrity Check Passed") ?> </h4> | ||
<p><?= gettext("The previous integrity check passed") ?></p> | ||
</div> | ||
<?php | ||
} | ||
?> | ||
|
||
<?php | ||
require 'Include/Footer.php'; | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.