Added: Ability to clear plugin pending flag

This commit is contained in:
Squidly271 2024-11-11 09:45:55 -05:00
parent dd0d66da9b
commit 80ef05e04d
4 changed files with 32 additions and 5 deletions

View File

@ -1317,11 +1317,20 @@ function installPlugin(pluginURL,update=false,comment="",requires="") {
text: "<?tr("Another plugin installation or update is already in progress, and this one cannot start. Wait until the current installation or update is completed and try again")?>",
allowOutsideClick: false,
showConfirmButton: true,
showCancelButton: false,
showCancelButton: true,
confirmButtonText: "<?tr("OK")?>",
type: "error"
cancelButtonText: "<?tr("Clear Flag")?>",
type: "warning"
},function(isConfirm) {
enableSearch();
if ( isConfirm ) {
enableSearch();
} else {
post({action:"clearPluginInstallFlag"},function(){
setTimeout(function() {
installPlugin(pluginURL,update,comment,requires);
},1000);
});
}
});
} else {
if ( update && requires ) {

View File

@ -1,8 +1,8 @@
897f3aed48c029ce4699330a1a31af87 ./Apps.page
fbc8133a4cb94472f246a0f05780b23c ./Apps.page
2defe45163697e40c813a57ae9a50231 ./CA_notices.page
c12622d8281346d37398e96cbb6b8b69 ./ca_settings.page
01ed7990078dee7cecfeda9a4e49377e ./default.cfg
c4c7f4bd169af5da08163723b14e62ca ./include/exec.php
378c35a992fed165cc420f4c6837ad31 ./include/exec.php
becfd5ed96c03d27d4f031d7db3546f2 ./include/helpers.php
a96f198a1b13229f8728e1ca1da8ee62 ./include/paths.php
7234caf6800479df03abb222aaedaca5 ./javascript/libraries.js

View File

@ -201,6 +201,9 @@ switch ($_POST['action']) {
case 'checkPluginInProgress':
checkPluginInProgress();
break;
case 'clearPluginInstallFlag':
clearPluginInstallFlag();
break;
###############################################
# Return an error if the action doesn't exist #
###############################################
@ -2678,6 +2681,21 @@ function checkPluginInProgress() {
postReturn(['inProgress'=>empty($pluginsPending)? "" : "true"]);
}
###################################
# Clears any plugin pending flags #
###################################
function clearPluginInstallFlag() {
global $caPaths;
$pluginsPending = glob("{$caPaths['pluginPending']}/*");
file_put_contents("/tmp/blah",print_r($pluginsPending,true));
array_walk($pluginsPending,function($val,$key) {
@unlink($val);
});
postreturn(['done']);
}
#######################################
# Logs Javascript errors being caught #