Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions OjtPageHandler.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ public function getPluginGalleryList($args, $request)

public function getExclusivePlugins($args, $request)
{


// Reset array keys if needed
return showJson([]);
Expand Down Expand Up @@ -437,7 +437,14 @@ public function installPlugin($args, $request)
if ($update && $fileManager->fileExists($indexFile)) {
$pluginInstance = include($indexFile);

$license = $pluginInstance->getSetting($this->contextId, 'licenseMain');

// licenseMain is old version validation
// the updated one is license
$license = $pluginInstance->getSetting($this->contextId, 'license');

if(!$license) {
$license = $pluginInstance->getSetting($this->contextId, 'licenseMain');
}
}

$downloadLink = $ojtPlugin->getPluginDownloadLink($pluginToInstall->token, $license, $this->baseUrl);
Expand Down Expand Up @@ -505,7 +512,7 @@ protected function simulateRegisterModules($pluginToInstall)
} catch (\Throwable $deleteError) {
// Log the error
error_log("Error in recursiveDelete: " . $deleteError->getMessage());

// Use the plugin's method to send Discord notification
$ojtPlugin->sendDiscordNotificationForDeleteError($pluginToInstall->folder, $deleteError);
}
Expand Down Expand Up @@ -553,9 +560,11 @@ public function uninstallPlugin($args, $request)
$this->resetSetting($removePlugin->class, false);
}

$dataPlugin = findPluginByClass($removePlugin->className);

// trying to remove plugin
try {
$plugin->uninstallPlugin($removePlugin);
$plugin->uninstallPlugin($dataPlugin);
} catch (Exception $e) {
$json['error'] = 1;
$json['msg'] = $e->getMessage();
Expand Down Expand Up @@ -592,8 +601,5 @@ public function checkPluginInstalled($args, $request)
}

// TODO: this function purposes to delete certain plugins inside the modules
public function deteleModules()
{

}
public function deteleModules() {}
}
4 changes: 2 additions & 2 deletions OjtPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ public static function reportToServicePanel($plugin, $isGlobalPlugin = false, $p

try {
$response = $apiService->registerClient($params, $headers);

$plugin->updateSetting(CONTEXT_SITE, 'service_panel_data', $response['journal_data']);

return true;
Expand Down Expand Up @@ -712,7 +712,7 @@ public function getActions($request, $actionArgs)
*/
public function uninstallPlugin($plugin)
{
$path = $this->getModulesPath($plugin->product);
$path = $plugin->pluginPath;
try {
if (!is_dir($path)) {
throw new \Exception("$plugin->name not Found");
Expand Down
Loading