BUG-12021 Plugins Audit Log

Plugins Audit Log
This commit is contained in:
norahmollo
2014-10-10 17:08:15 -04:00
parent a2681f82ed
commit 3e5e48b6db
3 changed files with 5 additions and 1 deletions

View File

@@ -42,6 +42,7 @@ if ($handle = opendir( PATH_PLUGINS )) {
$details = $oPluginRegistry->getPluginDetails( $pluginFile );
$oPluginRegistry->disablePlugin( $details->sNamespace );
$size = file_put_contents( PATH_DATA_SITE . 'plugin.singleton', $oPluginRegistry->serializeInstance() );
G::auditLog("DisablePlugin", "Plugin Name: ".$details->sNamespace);
print "size saved : $size <br>";
} else {
//print "change to ENABLED";
@@ -50,6 +51,7 @@ if ($handle = opendir( PATH_PLUGINS )) {
$oPluginRegistry->enablePlugin( $details->sNamespace );
$oPluginRegistry->setupPlugins(); //get and setup enabled plugins
$size = file_put_contents( PATH_DATA_SITE . 'plugin.singleton', $oPluginRegistry->serializeInstance() );
G::auditLog("EnablePlugin", "Plugin Name: ".$details->sNamespace);
print "size saved : $size <br>";
}
}

View File

@@ -239,6 +239,8 @@ try {
$size = file_put_contents( PATH_DATA_SITE . "plugin.singleton", $oPluginRegistry->serializeInstance() );
$response = $oPluginRegistry->verifyTranslation( $details->sNamespace);
G::auditLog("InstallPlugin", "Plugin Name: ".$details->sNamespace );
//if ($response->recordsCountSuccess <= 0) {
//throw (new Exception( 'The plugin ' . $details->sNamespace . ' couldn\'t verify any translation item. Verified Records:' . $response->recordsCountSuccess));
//}

View File

@@ -49,6 +49,6 @@ if (file_exists( PATH_PLUGINS . $pluginName . ".php" )) {
$pluginRegistry->unSerializeInstance( file_get_contents( PATH_DATA_SITE . "plugin.singleton" ) );
}
G::auditLog("RemovePlugin","Plugin Name: ".$pluginName);
echo $pluginName . " " . nl2br( G::LoadTranslation( "ID_MSG_REMOVE_PLUGIN_SUCCESS" ) );