remove redundant file

This commit is contained in:
Squidly271 2022-02-20 13:14:22 -05:00
parent 52b1d9eadc
commit 9697233c3c
4 changed files with 4 additions and 61 deletions

View File

@ -3,7 +3,7 @@ e09e3baad003519ebba28645b59c818c ./Apps.page
c7c6da0a4a4a7ac33f387ea178319bae ./ca_settings.page
ed2883d6c44c19304c431079596a1731 ./default.cfg
cb6953e87dbe2fecef6c47e390ed8722 ./include/exec.php
704316b2f2734b2f8d99526194e1290f ./include/helpers.php
d8d73b3a280f3d1dc173a5315f15433c ./include/helpers.php
d827ebdf8c29aa6a9818df043a37721e ./include/paths.php
532fffdf939594c143e679da02bd841e ./javascript/libraries.js
b398273cf7daa62ab00d2de2336ca25f ./README.md
@ -14,7 +14,6 @@ be74e770cdc8938200fc29580be4e3a1 ./scripts/installMultiPlugin.php
f1e435bc2543dd7a9f6495fbc2533f2b ./scripts/installUpdate.php
5846421e95b475e1156c3f68164ccc4f ./scripts/languageInstall.sh
d4770cba925e913500e0085b79267d3e ./scripts/notices.php
c9503c1e9a5e96c0f6023ecfdf4ffe7e ./scripts/PluginAPI.php
a1401a0bed89c182b69f0c7508282c1f ./scripts/pluginInstall.php
36556fb8fcd17118600d3d226c50567d ./scripts/showStatistics.php
4425f8fd4ef662a7dc65cee01de3e419 ./scripts/updatePLG.sh

View File

@ -43,7 +43,9 @@ function randomFile() {
function readJsonFile($filename) {
global $caSettings, $caPaths;
debug("Read JSON file $filename");
debug("CA Read JSON file $filename");
debug(print_r(debug_backtrace(),true));
$json = json_decode(@file_get_contents($filename),true);
if ( $json === false ) {

View File

@ -1,58 +0,0 @@
<?PHP
###############################################################
# #
# Community Applications copyright 2015-2022, Andrew Zawadzki #
# Licenced under GPLv2 #
# #
###############################################################
$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: "/usr/local/emhttp";
require_once "$docroot/plugins/community.applications/include/paths.php";
require_once "$docroot/plugins/community.applications/include/helpers.php";
require_once "$docroot/plugins/dynamix.plugin.manager/include/PluginHelpers.php";
switch ($_POST['action']) {
case 'checkPlugin':
$options = getPostArray("options");
$plugin = $options['plugin'];
if ( ! $plugin ) {
echo json_encode(array("updateAvailable"=>false));
return;
}
exec("mkdir -p /tmp/plugins");
@unlink("/tmp/plugins/$plugin");
$url = @plugin("pluginURL","/boot/config/plugins/$plugin");
download_url($url,"/tmp/plugins/$plugin");
$changes = @plugin("changes","/tmp/plugins/$plugin");
$version = @plugin("version","/tmp/plugins/$plugin");
$installedVersion = @plugin("version","/boot/config/plugins/$plugin");
$min = @plugin("min","/tmp/plugins/$plugin") ?: "6.4.0";
if ( $changes ) {
file_put_contents("/tmp/plugins/".pathinfo($plugin, PATHINFO_FILENAME).".txt",$changes);
} else {
@unlink("/tmp/plugins/".pathinfo($plugin, PATHINFO_FILENAME).".txt");
}
$update = false;
if ( strcmp($version,$installedVersion) > 0 ) {
$unraid = parse_ini_file($caPaths['unRaidVersion']);
$update = (version_compare($min,$unraid['version'],">")) ? false : true;
}
echo json_encode(array("updateAvailable" => $update,"version" => $version,"min"=>$min,"changes"=>$changes,"installedVersion"=>$installedVersion));
break;
case 'addRebootNotice':
$message = getPost("message",null);
if (!trim($message)) break;
$existing = @file("/tmp/reboot_notifications",FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) ?: array();
$existing[] = htmlspecialchars(trim($message));
file_put_contents("/tmp/reboot_notifications",implode("\n",array_unique($existing)));
break;
}
?>