From 52e5e543af5787350bf9d4e428249ae4cc8cc574 Mon Sep 17 00:00:00 2001
From: mcramer <m.cramer@pixcept.de>
Date: Wed, 07 Aug 2013 11:42:22 -0400
Subject: [PATCH] - Fixed: php compile fatal errors
---
server/plugins-available/aps_plugin.inc.php | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/server/plugins-available/aps_plugin.inc.php b/server/plugins-available/aps_plugin.inc.php
index 26ae9be..dbbbfb9 100644
--- a/server/plugins-available/aps_plugin.inc.php
+++ b/server/plugins-available/aps_plugin.inc.php
@@ -28,7 +28,7 @@
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-require_once(ISPC_ROOT_PATH.'/lib/classes/aps_installer.inc.php');
+if(defined('ISPC_ROOT_PATH')) include_once(ISPC_ROOT_PATH.'/lib/classes/aps_installer.inc.php');
//require_once(ISPC_ROOT_PATH.'/lib/classes/class.installer.php');
class aps_plugin
@@ -57,7 +57,7 @@
global $app;
// Register the available events
- $app->plugins->registerEvent('aps_instance_install', $this->plugin_name, 'install');
+ $app->plugins->registerEvent('aps_instance_insert', $this->plugin_name, 'install');
$app->plugins->registerEvent('aps_instance_update', $this->plugin_name, 'install');
$app->plugins->registerEvent('aps_instance_delete', $this->plugin_name, 'delete');
}
@@ -69,6 +69,10 @@
{
global $app, $conf;
+ //* dont run the installer on a mirror server to prevent
+ // that the pplication gets installed twice.
+ if($conf['mirror_server_id'] > 0) return true;
+
$app->log("Starting APS install",LOGLEVEL_DEBUG);
if(!isset($data['new']['id'])) return false;
$instanceid = $data['new']['id'];
@@ -78,6 +82,12 @@
$app->log("Running installHandler",LOGLEVEL_DEBUG);
$aps->installHandler($instanceid, 'install');
}
+
+ if($data['new']['instance_status'] == INSTANCE_REMOVE) {
+ $aps = new ApsInstaller($app);
+ $app->log("Running installHandler",LOGLEVEL_DEBUG);
+ $aps->installHandler($instanceid, 'delete');
+ }
}
/**
--
Gitblit v1.9.1