Don't allow edits if template doesn't exist

This commit is contained in:
Squidly271 2022-09-06 07:01:49 -04:00
parent f9d9460c53
commit ce15764941
3 changed files with 8 additions and 6 deletions

Binary file not shown.

View File

@ -7,8 +7,6 @@ f25b1ed0b1cddfb4ff95a10ced212a0d ./include/helpers.php
116042a918060278e77379b0dd73482c ./include/paths.php 116042a918060278e77379b0dd73482c ./include/paths.php
532fffdf939594c143e679da02bd841e ./javascript/libraries.js 532fffdf939594c143e679da02bd841e ./javascript/libraries.js
71f911a818d88d3d567f8a2898094ee2 ./README.md 71f911a818d88d3d567f8a2898094ee2 ./README.md
ff1fa32f5bc288631673066da4a36ebe ./scripts/caPostHook.php
981bc776ea83d2f15387e29870554e3f ./scripts/caPreHook.php
d3d8286046cc7d6edf8f596067c163a2 ./scripts/checkForUpdates.php d3d8286046cc7d6edf8f596067c163a2 ./scripts/checkForUpdates.php
99a9d58a49a7f6812f18bd4be2b563b9 ./scripts/checkForUpdates.sh 99a9d58a49a7f6812f18bd4be2b563b9 ./scripts/checkForUpdates.sh
677ac9a29993ec57e09ec6a1856f1a11 ./scripts/dockerConvert.php 677ac9a29993ec57e09ec6a1856f1a11 ./scripts/dockerConvert.php
@ -24,4 +22,4 @@ da3b4f9b73c5c3bf65be6c42d68b51f9 ./scripts/showStatistics.php
34554a56611dfe625889c82afd5138de ./scripts/updatePluginSupport.php 34554a56611dfe625889c82afd5138de ./scripts/updatePluginSupport.php
25bdaed6f62ac73f9ef7c3ce0c125ef7 ./skins/Narrow/css.php 25bdaed6f62ac73f9ef7c3ce0c125ef7 ./skins/Narrow/css.php
7eb021a105e2f7a15675ec8a14e6f05e ./skins/Narrow/skin.html 7eb021a105e2f7a15675ec8a14e6f05e ./skins/Narrow/skin.html
360f985a0e0e789a02eb66d7d24a6742 ./skins/Narrow/skin.php 30432b07beef03988cb3828f81d5ae0b ./skins/Narrow/skin.php

View File

@ -164,7 +164,9 @@ function my_display_apps($file,$pageNumber=1,$selectedApps=false,$startup=false)
$actionsContext[] = array("icon"=>"ca_fa-install","text"=>tr("Install second instance"),"action"=>"popupInstallXML('".addslashes($template['Path'])."','second','".str_replace(" "," ",htmlspecialchars($installComment))."','".portsUsed($template)."');"); $actionsContext[] = array("icon"=>"ca_fa-install","text"=>tr("Install second instance"),"action"=>"popupInstallXML('".addslashes($template['Path'])."','second','".str_replace(" "," ",htmlspecialchars($installComment))."','".portsUsed($template)."');");
} }
} }
$actionsContext[] = array("icon"=>"ca_fa-edit","text"=>tr("Edit"),"action"=>"popupInstallXML('".addslashes($info[$ind]['template'])."','edit');"); if ( is_file($info[$ind]['template']) )
$actionsContext[] = array("icon"=>"ca_fa-edit","text"=>tr("Edit"),"action"=>"popupInstallXML('".addslashes($info[$ind]['template'])."','edit');");
$actionsContext[] = array("divider"=>true); $actionsContext[] = array("divider"=>true);
if ($info[$ind]['template']) if ($info[$ind]['template'])
$actionsContext[] = array("icon"=>"ca_fa-delete","text"=>tr("Uninstall"),"action"=>"uninstallDocker('".addslashes($info[$ind]['template'])."','{$template['Name']}');"); $actionsContext[] = array("icon"=>"ca_fa-delete","text"=>tr("Uninstall"),"action"=>"uninstallDocker('".addslashes($info[$ind]['template'])."','{$template['Name']}');");
@ -574,7 +576,7 @@ function getPopupDescriptionSkin($appNumber) {
if ( $template['Plugin'] ) { if ( $template['Plugin'] ) {
$templateURL = $template['PluginURL']; $templateURL = $template['PluginURL'];
download_url($templateURL."1",$caPaths['pluginTempDownload'],"",5); download_url($templateURL,$caPaths['pluginTempDownload'],"",5);
$template['Changes'] = @plugin("changes",$caPaths['pluginTempDownload']) ?: $template['Changes']; $template['Changes'] = @plugin("changes",$caPaths['pluginTempDownload']) ?: $template['Changes'];
$template['pluginVersion'] = @plugin("version",$caPaths['pluginTempDownload']) ?: $template['pluginVersion']; $template['pluginVersion'] = @plugin("version",$caPaths['pluginTempDownload']) ?: $template['pluginVersion'];
@ -631,7 +633,9 @@ function getPopupDescriptionSkin($appNumber) {
else else
$actionsContext[] = array("icon"=>"ca_fa-install","text"=>tr("Install second instance"),"action"=>"popupInstallXML('".addslashes($template['Path'])."','second','','".portsUsed($template)."');"); $actionsContext[] = array("icon"=>"ca_fa-install","text"=>tr("Install second instance"),"action"=>"popupInstallXML('".addslashes($template['Path'])."','second','','".portsUsed($template)."');");
} }
$actionsContext[] = array("icon"=>"ca_fa-edit","text"=>tr("Edit"),"action"=>"popupInstallXML('".addslashes($info[$name]['template'])."','edit');"); if ( is_file($info[$name]['template']) )
$actionsContext[] = array("icon"=>"ca_fa-edit","text"=>tr("Edit"),"action"=>"popupInstallXML('".addslashes($info[$name]['template'])."','edit');");
$actionsContext[] = array("divider"=>true); $actionsContext[] = array("divider"=>true);
if ( $info[$name]['template'] ) if ( $info[$name]['template'] )
$actionsContext[] = array("icon"=>"ca_fa-delete","text"=>"<span class='ca_red'>".tr("Uninstall")."</span>","action"=>"uninstallDocker('".addslashes($info[$name]['template'])."','{$template['Name']}');"); $actionsContext[] = array("icon"=>"ca_fa-delete","text"=>"<span class='ca_red'>".tr("Uninstall")."</span>","action"=>"uninstallDocker('".addslashes($info[$name]['template'])."','{$template['Name']}');");