Audit Log Correction
This commit is contained in:
@@ -49,6 +49,9 @@ pake_task('new-project', 'project_exists');
|
||||
pake_desc("build new plugin \n args: <name>");
|
||||
pake_task('new-plugin', 'project_exists');
|
||||
|
||||
pake_desc("Update the plugin attributes in all workspaces\n args: <plugin-name>");
|
||||
pake_task("update-plugin-attributes", "project_exists");
|
||||
|
||||
pake_desc("pack plugin in .tar file \n args: <plugin>");
|
||||
pake_task('pack-plugin', 'project_exists');
|
||||
|
||||
@@ -2613,3 +2616,28 @@ function run_check_standard_code ( $task, $options) {
|
||||
pakeColor::colorize($val['dos'] ? 'dos' : ' ', 'INFO'), $val['file'] );
|
||||
}
|
||||
}
|
||||
|
||||
function run_update_plugin_attributes($task, $args)
|
||||
{
|
||||
try {
|
||||
G::LoadClass("plugin");
|
||||
|
||||
//Verify data
|
||||
if (!isset($args[0])) {
|
||||
throw new Exception("Error: You must specify the name of a plugin");
|
||||
}
|
||||
|
||||
//Set variables
|
||||
$pluginName = $args[0];
|
||||
|
||||
//Update plugin attributes
|
||||
$pmPluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
|
||||
$pmPluginRegistry->updatePluginAttributesInAllWorkspaces($pluginName);
|
||||
|
||||
echo "Done!\n";
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage() . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -524,9 +524,11 @@ class DataBaseMaintenance
|
||||
}
|
||||
}
|
||||
|
||||
if (count ($sqlTablesBpmn) > 0) {
|
||||
foreach ($tablesBpmn as $table) {
|
||||
fwrite( $file, $sqlTablesBpmn[$table] );
|
||||
}
|
||||
}
|
||||
|
||||
fclose( $file );
|
||||
}
|
||||
|
||||
@@ -197,7 +197,17 @@ function listFiles($dir) {
|
||||
|
||||
function run_unify_database($args)
|
||||
{
|
||||
$workspaces = get_workspaces_from_args($args);
|
||||
$workspaces = array();
|
||||
|
||||
if (sizeof($args) > 2) {
|
||||
$filename = array_pop($args);
|
||||
foreach ($args as $arg) {
|
||||
$workspaces[] = new workspaceTools($arg);
|
||||
}
|
||||
} else if (sizeof($args) > 0) {
|
||||
$workspace = new workspaceTools($args[0]);
|
||||
$workspaces[] = $workspace;
|
||||
}
|
||||
|
||||
CLI::logging("UPGRADE", PROCESSMAKER_PATH . "upgrade.log");
|
||||
CLI::logging("Checking workspaces...\n");
|
||||
@@ -214,7 +224,14 @@ function run_unify_database($args)
|
||||
}
|
||||
}
|
||||
|
||||
$first = true;
|
||||
$errors = false;
|
||||
$countWorkspace = 0;
|
||||
$buildCacheView = array_key_exists("buildACV", $args);
|
||||
|
||||
foreach ($workspaces as $workspace) {
|
||||
try {
|
||||
$countWorkspace++;
|
||||
|
||||
if (! $workspace->workspaceExists()) {
|
||||
echo "Workspace {$workspace->name} not found\n";
|
||||
@@ -229,16 +246,6 @@ function run_unify_database($args)
|
||||
} else {
|
||||
$workspace->onedb = true;
|
||||
}
|
||||
}
|
||||
|
||||
$first = true;
|
||||
$errors = false;
|
||||
$countWorkspace = 0;
|
||||
$buildCacheView = array_key_exists("buildACV", $args);
|
||||
|
||||
foreach ($workspaces as $workspace) {
|
||||
try {
|
||||
$countWorkspace++;
|
||||
|
||||
if ($workspace->onedb) {
|
||||
CLI::logging("Workspace $workspace->name already one Database...\n");
|
||||
@@ -262,23 +269,28 @@ function run_unify_database($args)
|
||||
list ($dbHost, $dbUser, $dbPass) = @explode( SYSTEM_HASH, G::decrypt( HASH_INSTALLATION, SYSTEM_HASH ) );
|
||||
$link = mysql_connect( $dbHost, $dbUser, $dbPass );
|
||||
|
||||
foreach ($metadata->databases as $db) {
|
||||
foreach ($metadata['databases'] as $db) {
|
||||
$dbName = 'wf_'.$workspace->name;
|
||||
CLI::logging( "+> Restoring {$db->name} to $dbName database\n" );
|
||||
$restore = $workspace->executeSQLScript( $dbName, "$tempDirectory/{$db->name}.sql" );
|
||||
CLI::logging( "+> Restoring {$db['name']} to $dbName database\n" );
|
||||
|
||||
CLI::logging( "+> Remove {$db->name} database\n" );
|
||||
$aParameters = array('dbHost'=>$dbHost,'dbUser'=>$dbUser,'dbPass'=>$dbPass);
|
||||
|
||||
$sql = "DROP DATABASE IF EXISTS {$db->name};";
|
||||
$restore = $workspace->executeScript( $dbName, "$tempDirectory/{$db['name']}.sql", $aParameters);
|
||||
|
||||
if ($restore) {
|
||||
CLI::logging( "+> Remove {$db['name']} database\n" );
|
||||
|
||||
$sql = "DROP DATABASE IF EXISTS {$db['name']};";
|
||||
if (! @mysql_query( $sql )) {
|
||||
throw new Exception( mysql_error() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CLI::logging( "Removing temporary files\n" );
|
||||
G::rm_dir( $tempDirectory );
|
||||
|
||||
$newDBNames = $workspace->resetDBInfo( $dbHost, true );
|
||||
$newDBNames = $workspace->resetDBInfo( $dbHost, true, true );
|
||||
|
||||
CLI::logging( CLI::info( "Done restoring databases" ) . "\n" );
|
||||
}
|
||||
|
||||
@@ -33,6 +33,9 @@ class enterpriseClass extends PMPlugin
|
||||
|
||||
public function enterpriseSystemUpdate($data) //$data = $oData
|
||||
{
|
||||
if (count(glob(PATH_DATA_SITE . 'license/*.dat')) == 0) {
|
||||
return;
|
||||
}
|
||||
require_once ("classes/model/Users.php");
|
||||
$user = $data;
|
||||
$criteria = new Criteria("workflow");
|
||||
|
||||
@@ -1513,5 +1513,88 @@ class PMPluginRegistry
|
||||
{
|
||||
return $this->_aCronFiles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the plugin attributes in all workspaces
|
||||
*
|
||||
* @param string $pluginName Plugin name
|
||||
*
|
||||
* return void
|
||||
*/
|
||||
public function updatePluginAttributesInAllWorkspaces($pluginName)
|
||||
{
|
||||
try {
|
||||
G::LoadClass("system");
|
||||
G::LoadClass("wsTools");
|
||||
|
||||
//Set variables
|
||||
$pluginFileName = $pluginName . ".php";
|
||||
|
||||
//Verify data
|
||||
if (!file_exists(PATH_PLUGINS . $pluginFileName)) {
|
||||
throw new Exception("Error: The plugin not exists");
|
||||
}
|
||||
|
||||
//Update plugin attributes
|
||||
require_once(PATH_PLUGINS . $pluginFileName);
|
||||
|
||||
$pmPluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
|
||||
$pluginDetails = $pmPluginRegistry->getPluginDetails($pluginFileName);
|
||||
|
||||
if (isset($pluginDetails->aWorkspaces) && is_array($pluginDetails->aWorkspaces) && count($pluginDetails->aWorkspaces) > 0) {
|
||||
$arrayWorkspace = array();
|
||||
|
||||
foreach (System::listWorkspaces() as $value) {
|
||||
$workspaceTools = $value;
|
||||
|
||||
$arrayWorkspace[] = $workspaceTools->name;
|
||||
}
|
||||
|
||||
$arrayWorkspaceAux = array_diff($arrayWorkspace, $pluginDetails->aWorkspaces); //Workspaces to update
|
||||
$strWorkspaceNoWritable = "";
|
||||
|
||||
$arrayWorkspace = array();
|
||||
|
||||
foreach ($arrayWorkspaceAux as $value) {
|
||||
$workspace = $value;
|
||||
|
||||
$workspacePathDataSite = PATH_DATA . "sites" . PATH_SEP . $workspace . PATH_SEP;
|
||||
|
||||
if (file_exists($workspacePathDataSite . "plugin.singleton")) {
|
||||
$pmPluginRegistry = PMPluginRegistry::loadSingleton($workspacePathDataSite . "plugin.singleton");
|
||||
|
||||
if (isset($pmPluginRegistry->_aPluginDetails[$pluginName])) {
|
||||
if (!is_writable($workspacePathDataSite . "plugin.singleton")) {
|
||||
$strWorkspaceNoWritable .= (($strWorkspaceNoWritable != "")? ", " : "") . $workspace;
|
||||
}
|
||||
|
||||
$arrayWorkspace[] = $workspace;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Verify data
|
||||
if ($strWorkspaceNoWritable != "") {
|
||||
throw new Exception("Error: The workspaces \"$strWorkspaceNoWritable\" has problems of permissions of write in file \"plugin.singleton\", solve this problem");
|
||||
}
|
||||
|
||||
//Update plugin attributes
|
||||
foreach ($arrayWorkspace as $value) {
|
||||
$workspace = $value;
|
||||
|
||||
$workspacePathDataSite = PATH_DATA . "sites" . PATH_SEP . $workspace . PATH_SEP;
|
||||
|
||||
$pmPluginRegistry = PMPluginRegistry::loadSingleton($workspacePathDataSite . "plugin.singleton");
|
||||
|
||||
$pmPluginRegistry->disablePlugin($pluginName);
|
||||
|
||||
file_put_contents($workspacePathDataSite . "plugin.singleton", $pmPluginRegistry->serializeInstance());
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1260,7 +1260,10 @@ class processMap
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
$oCriteria->add(UsersPeer::USR_STATUS, 'ACTIVE');
|
||||
$oCriteria->add(
|
||||
$oCriteria->getNewCriterion(UsersPeer::USR_STATUS, "ACTIVE", Criteria::EQUAL)->addOr(
|
||||
$oCriteria->getNewCriterion(UsersPeer::USR_STATUS, "VACATION", Criteria::EQUAL))
|
||||
);
|
||||
$oCriteria->add(UsersPeer::USR_UID, $aUIDS2, Criteria::NOT_IN);
|
||||
$oDataset = UsersPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
@@ -233,9 +233,10 @@ class workspaceTools
|
||||
$value = isset($matches['value']) ? $matches['value'] : $matches[3];
|
||||
|
||||
if($this->onedb){
|
||||
$dbInfo = $this->getDBInfo();
|
||||
$dbPrefix = array('DB_NAME' => 'wf_', 'DB_USER' => 'wf_', 'DB_RBAC_NAME' => 'wf_', 'DB_RBAC_USER' => 'wf_', 'DB_REPORT_NAME' => 'wf_', 'DB_REPORT_USER' => 'wf_');
|
||||
if (array_search($key, array('DB_PASS', 'DB_RBAC_PASS', 'DB_REPORT_PASS'))) {
|
||||
$value = $this->dbInfo['DB_PASS'];
|
||||
$value = $dbInfo['DB_PASS'];
|
||||
}
|
||||
} else{
|
||||
$dbPrefix = array('DB_NAME' => 'wf_', 'DB_USER' => 'wf_', 'DB_RBAC_NAME' => 'rb_', 'DB_RBAC_USER' => 'rb_', 'DB_REPORT_NAME' => 'rp_', 'DB_REPORT_USER' => 'rp_');
|
||||
@@ -272,7 +273,7 @@ class workspaceTools
|
||||
* @param bool $resetDBNames if true, also reset all database names
|
||||
* @return array contains the new database names as values
|
||||
*/
|
||||
public function resetDBInfo($newHost, $resetDBNames = true)
|
||||
public function resetDBInfo($newHost, $resetDBNames = true, $onedb = false)
|
||||
{
|
||||
if (count(explode(":", $newHost)) < 2) {
|
||||
$newHost .= ':3306';
|
||||
@@ -280,7 +281,7 @@ class workspaceTools
|
||||
$this->newHost = $newHost;
|
||||
$this->resetDBNames = $resetDBNames;
|
||||
$this->resetDBDiff = array();
|
||||
$this->onedb = false;
|
||||
$this->onedb = $onedb;
|
||||
|
||||
if (!$this->workspaceExists()) {
|
||||
throw new Exception("Could not find db.php in the workspace");
|
||||
@@ -289,14 +290,7 @@ class workspaceTools
|
||||
|
||||
if ($sDbFile === false) {
|
||||
throw new Exception("Could not read database information from db.php");
|
||||
} else {
|
||||
if (strpos($sDbFile, 'rb_')) {
|
||||
$this->onedb = false;
|
||||
} else {
|
||||
$this->onedb = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* Match all defines in the config file. Check updateDBCallback to know what
|
||||
* keys are changed and what groups are matched.
|
||||
* This regular expression will match any "define ('<key>', '<value>');"
|
||||
@@ -847,6 +841,7 @@ class workspaceTools
|
||||
if (!empty($changes['tablesToAdd'])) {
|
||||
CLI::logging("-> " . count($changes['tablesToAdd']) . " tables to add\n");
|
||||
}
|
||||
|
||||
foreach ($changes['tablesToAdd'] as $sTable => $aColumns) {
|
||||
$oDataBase->executeQuery($oDataBase->generateCreateTableSQL($sTable, $aColumns));
|
||||
if (isset($changes['tablesToAdd'][$sTable]['INDEXES'])) {
|
||||
@@ -859,6 +854,7 @@ class workspaceTools
|
||||
if (!empty($changes['tablesToAlter'])) {
|
||||
CLI::logging("-> " . count($changes['tablesToAlter']) . " tables to alter\n");
|
||||
}
|
||||
|
||||
foreach ($changes['tablesToAlter'] as $sTable => $aActions) {
|
||||
foreach ($aActions as $sAction => $aAction) {
|
||||
foreach ($aAction as $sColumn => $vData) {
|
||||
@@ -974,6 +970,9 @@ class workspaceTools
|
||||
$dbNetView = new NET($this->dbHost);
|
||||
$dbNetView->loginDbServer($this->dbUser, $this->dbPass);
|
||||
try {
|
||||
if (!defined('DB_ADAPTER')) {
|
||||
require_once($this->dbPath);
|
||||
}
|
||||
$sMySQLVersion = $dbNetView->getDbServerVersion('mysql');
|
||||
} catch (Exception $oException) {
|
||||
$sMySQLVersion = 'Unknown';
|
||||
@@ -1315,6 +1314,12 @@ class workspaceTools
|
||||
}
|
||||
}
|
||||
|
||||
public function executeScript($database, $filename, $parameters)
|
||||
{
|
||||
$this->executeSQLScript($database, $filename, $parameters);
|
||||
return true;
|
||||
}
|
||||
|
||||
static public function restoreLegacy($directory)
|
||||
{
|
||||
throw new Exception("Use gulliver to restore backups from old versions");
|
||||
@@ -1435,6 +1440,13 @@ class workspaceTools
|
||||
throw new Exception("Backup version {$metadata->version} not supported");
|
||||
}
|
||||
$backupWorkspace = $metadata->WORKSPACE_NAME;
|
||||
|
||||
if (strpos($metadata->DB_RBAC_NAME, 'rb_') === false) {
|
||||
$onedb = true;
|
||||
} else {
|
||||
$onedb = false;
|
||||
}
|
||||
|
||||
if (isset($dstWorkspace)) {
|
||||
$workspaceName = $dstWorkspace;
|
||||
$createWorkspace = true;
|
||||
@@ -1492,15 +1504,18 @@ class workspaceTools
|
||||
throw new Exception('Could not connect to system database: ' . mysql_error());
|
||||
}
|
||||
|
||||
$newDBNames = $workspace->resetDBInfo($dbHost, $createWorkspace);
|
||||
$dbName = '';
|
||||
$newDBNames = $workspace->resetDBInfo($dbHost, $createWorkspace, $onedb);
|
||||
|
||||
foreach ($metadata->databases as $db) {
|
||||
if ($dbName != $newDBNames[$db->name]) {
|
||||
$dbName = $newDBNames[$db->name];
|
||||
CLI::logging("+> Restoring database {$db->name} to $dbName\n");
|
||||
$workspace->executeSQLScript($dbName, "$tempDirectory/{$db->name}.sql",$aParameters);
|
||||
$workspace->createDBUser($dbName, $db->pass, "localhost", $dbName);
|
||||
$workspace->createDBUser($dbName, $db->pass, "%", $dbName);
|
||||
}
|
||||
}
|
||||
|
||||
$version = explode('-', $metadata->PM_VERSION);
|
||||
$versionOld = ( isset($version[0])) ? $version[0] : '';
|
||||
@@ -1508,7 +1523,7 @@ class workspaceTools
|
||||
|
||||
$start = microtime(true);
|
||||
CLI::logging("> Verify enterprise old...\n");
|
||||
$this->verifyEnterprise($workSpace);
|
||||
$workspace->verifyEnterprise($workspaceName);
|
||||
$stop = microtime(true);
|
||||
$final = $stop - $start;
|
||||
CLI::logging("<*> Verify took $final seconds.\n");
|
||||
@@ -1516,7 +1531,7 @@ class workspaceTools
|
||||
if ( $versionOld < $versionPresent || strpos($versionPresent, "Branch")) {
|
||||
$start = microtime(true);
|
||||
CLI::logging("> Updating database...\n");
|
||||
$workspace->upgradeDatabase();
|
||||
$workspace->upgradeDatabase($onedb);
|
||||
$stop = microtime(true);
|
||||
$final = $stop - $start;
|
||||
CLI::logging("<*> Database Upgrade Process took $final seconds.\n");
|
||||
|
||||
@@ -410,7 +410,7 @@ class pmTablesProxy extends HttpProxyController
|
||||
if ($errors == '') {
|
||||
$result->success = true;
|
||||
$result->message = $count.G::LoadTranslation( 'ID_TABLES_REMOVED_SUCCESSFULLY' );
|
||||
G::auditLog("DeletePmtable", "Table Name: ".$table['ADD_TAB_NAME']." Table ID: (".$table['ADD_TAB_UID'].") ");
|
||||
G::auditLog("DeletePMTable", $table['ADD_TAB_NAME']." (".$table['ADD_TAB_UID'].") ");
|
||||
} else {
|
||||
$result->success = false;
|
||||
$result->message = $count. G::LoadTranslation( 'ID_TABLES_REMOVED_WITH_ERRORS' ) .$errors;
|
||||
@@ -509,7 +509,7 @@ class pmTablesProxy extends HttpProxyController
|
||||
if ($obj->validate()) {
|
||||
$obj->save();
|
||||
$toSave = true;
|
||||
G::auditLog("AddDataInPMTable", "Table Name: "$table['ADD_TAB_NAME']." Table ID: (".$table['ADD_TAB_UID'].") ");
|
||||
G::auditLog("AddDataInPMTable", $table['ADD_TAB_NAME']." (".$table['ADD_TAB_UID'].") ");
|
||||
$primaryKeysValues = array ();
|
||||
foreach ($primaryKeys as $primaryKey) {
|
||||
$method = 'get' . AdditionalTables::getPHPName( $primaryKey['FLD_NAME'] );
|
||||
@@ -528,6 +528,7 @@ class pmTablesProxy extends HttpProxyController
|
||||
$toSave = false;
|
||||
}
|
||||
|
||||
$result = new stdclass();
|
||||
if ($toSave) {
|
||||
$result->success = true;
|
||||
$result->message = G::LoadTranslation('ID_RECORD_SAVED_SUCCESFULLY');
|
||||
@@ -582,7 +583,7 @@ class pmTablesProxy extends HttpProxyController
|
||||
}
|
||||
|
||||
if ($result) {
|
||||
G::auditLog("UpdateDataInPMTable", "Table Name: ".$table['ADD_TAB_NAME']." Table ID: (".$table['ADD_TAB_UID'].") ");
|
||||
G::auditLog("UpdateDataInPMTable", $table['ADD_TAB_NAME']." (".$table['ADD_TAB_UID'].") ");
|
||||
}
|
||||
|
||||
$this->success = $result;
|
||||
@@ -609,7 +610,7 @@ class pmTablesProxy extends HttpProxyController
|
||||
|
||||
require_once $sPath . $this->className . '.php';
|
||||
|
||||
G::auditLog("DeleteDataInPMTable", "Table Name: ".$table['ADD_TAB_NAME']." Table ID: (".$table['ADD_TAB_UID'].") ");
|
||||
G::auditLog("DeleteDataInPMTable", $table['ADD_TAB_NAME']." (".$table['ADD_TAB_UID'].") ");
|
||||
|
||||
$this->success = $this->_dataDestroy( $httpData->rows );
|
||||
$this->message = $this->success ? G::loadTranslation( 'ID_DELETED_SUCCESSFULLY' ) : G::loadTranslation( 'ID_DELETE_FAILED' );
|
||||
@@ -685,7 +686,7 @@ class pmTablesProxy extends HttpProxyController
|
||||
$this->success = true;
|
||||
$this->message = G::loadTranslation( 'ID_FILE_IMPORTED_SUCCESSFULLY', array ($filename
|
||||
) );
|
||||
G::auditLog("ImportTable", "Table Name: ".$filename);
|
||||
G::auditLog("ImportTable", $filename);
|
||||
}
|
||||
} else {
|
||||
$sMessage = G::LoadTranslation( 'ID_UPLOAD_VALID_CSV_FILE' );
|
||||
@@ -927,7 +928,7 @@ class pmTablesProxy extends HttpProxyController
|
||||
// is a report table, try populate it
|
||||
$additionalTable->populateReportTable( $table['ADD_TAB_NAME'], pmTable::resolveDbSource( $table['DBS_UID'] ), $table['ADD_TAB_TYPE'], $table['PRO_UID'], $table['ADD_TAB_GRID'], $table['ADD_TAB_UID'] );
|
||||
}
|
||||
G::auditLog("ImportTable", "Table Name: ".$table['ADD_TAB_NAME']." Table ID: (".$table['ADD_TAB_UID'].") ");
|
||||
G::auditLog("ImportTable", $table['ADD_TAB_NAME']." (".$table['ADD_TAB_UID'].") ");
|
||||
break;
|
||||
case '@DATA':
|
||||
$fstName = intval( fread( $fp, 9 ) );
|
||||
@@ -1113,7 +1114,7 @@ class pmTablesProxy extends HttpProxyController
|
||||
$bytesSaved += fwrite( $fp, $fsData ); //writing the size of xml file
|
||||
$bytesSaved += fwrite( $fp, $SDATA ); //writing the xmlfile
|
||||
}
|
||||
G::auditLog("ExportTable", "Table Name: ".$table->ADD_TAB_NAME." Table ID: (".$table->ADD_TAB_UID.") ");
|
||||
G::auditLog("ExportTable", $table->ADD_TAB_NAME." (".$table->ADD_TAB_UID.") ");
|
||||
}
|
||||
|
||||
fclose( $fp );
|
||||
|
||||
@@ -34,6 +34,77 @@ try {
|
||||
throw (new Exception( G::loadTranslation( 'ID_ERROR_UPLOADING_PLUGIN_FILENAME' ) ));
|
||||
}
|
||||
|
||||
//save the files Enterprise
|
||||
if ($_FILES['form']['error']['PLUGIN_FILENAME'] == 0) {
|
||||
$filename = $_FILES['form']['name']['PLUGIN_FILENAME'];
|
||||
$path = PATH_DOCUMENT . 'input' . PATH_SEP;
|
||||
if (strpos($filename, 'enterprise') !== false) {
|
||||
|
||||
G::LoadThirdParty( 'pear/Archive', 'Tar' );
|
||||
$tar = new Archive_Tar( $path . $filename );
|
||||
$sFileName = substr( $filename, 0, strrpos( $filename, '.' ) );
|
||||
$sClassName = substr( $filename, 0, strpos( $filename, '-' ) );
|
||||
|
||||
$files = $tar->listContent();
|
||||
$licenseName = '';
|
||||
$listFiles = array();
|
||||
foreach ($files as $key => $val) {
|
||||
if (strpos(trim($val['filename']), 'enterprise/data/') !== false) {
|
||||
$listFiles[] = trim($val['filename']);
|
||||
}
|
||||
if (strpos(trim($val['filename']), 'license_') !== false) {
|
||||
$licenseName = trim($val['filename']);
|
||||
}
|
||||
}
|
||||
$tar->extractList( $listFiles, PATH_PLUGINS . 'data');
|
||||
$tar->extractList( $licenseName, PATH_PLUGINS);
|
||||
|
||||
$pluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
$autoPlugins = glob(PATH_PLUGINS . "data/enterprise/data/*.tar");
|
||||
$autoPluginsA = array();
|
||||
|
||||
foreach ($autoPlugins as $filePath) {
|
||||
$plName = basename($filePath);
|
||||
//if (!(in_array($plName, $def))) {
|
||||
if (strpos($plName, 'enterprise') === false) {
|
||||
$autoPluginsA[]["sFilename"] = $plName;
|
||||
}
|
||||
}
|
||||
|
||||
$aPlugins = $autoPluginsA;
|
||||
foreach ($aPlugins as $key=>$aPlugin) {
|
||||
$sClassName = substr($aPlugin["sFilename"], 0, strpos($aPlugin["sFilename"], "-"));
|
||||
|
||||
$oTar = new Archive_Tar(PATH_PLUGINS . "data/enterprise/data/" . $aPlugin["sFilename"]);
|
||||
$oTar->extract(PATH_PLUGINS);
|
||||
|
||||
if (!(class_exists($sClassName))) {
|
||||
require_once (PATH_PLUGINS . $sClassName . ".php");
|
||||
}
|
||||
|
||||
$pluginDetail = $pluginRegistry->getPluginDetails($sClassName . ".php");
|
||||
$pluginRegistry->installPlugin($pluginDetail->sNamespace); //error
|
||||
}
|
||||
|
||||
file_put_contents(PATH_DATA_SITE . "plugin.singleton", $pluginRegistry->serializeInstance());
|
||||
$licfile = glob(PATH_PLUGINS . "*.dat");
|
||||
|
||||
if ((isset($licfile[0])) && ( is_file($licfile[0]) )) {
|
||||
$licfilename = basename($licfile[0]);
|
||||
@copy($licfile[0], PATH_DATA_SITE . $licfilename);
|
||||
@unlink($licfile[0]);
|
||||
}
|
||||
|
||||
require_once ('classes/model/AddonsStore.php');
|
||||
AddonsStore::checkLicenseStore();
|
||||
$licenseManager = &pmLicenseManager::getSingleton();
|
||||
AddonsStore::updateAll(false);
|
||||
|
||||
$message = G::loadTranslation( 'ID_ENTERPRISE_INSTALLED') . ' ' . G::loadTranslation( 'ID_LOG_AGAIN');
|
||||
G::SendMessageText($message, "INFO");
|
||||
die('<script type="text/javascript">parent.parent.location = "../login/login";</script>');
|
||||
}
|
||||
}
|
||||
//save the file
|
||||
if ($_FILES['form']['error']['PLUGIN_FILENAME'] == 0) {
|
||||
$filename = $_FILES['form']['name']['PLUGIN_FILENAME'];
|
||||
|
||||
@@ -367,7 +367,7 @@ Ext.onReady(function(){
|
||||
frameConfig:{name:'openCaseFrame', id:'openCaseFrame'},
|
||||
defaultSrc : uri,
|
||||
loadMask:{msg: _('ID_LOADING_GRID') },
|
||||
bodyStyle:{height: (PMExt.getBrowser().screen.height-60) + 'px', overflow:'auto'},
|
||||
bodyStyle:{height: (PMExt.getBrowser().screen.height-60) + 'px', overflow:'hidden'},
|
||||
width:screenWidth
|
||||
|
||||
}
|
||||
|
||||
@@ -1518,6 +1518,7 @@ Ext.onReady(function() {
|
||||
colspan: 2,
|
||||
flex: 1,
|
||||
padding: 5,
|
||||
disabled: !licensed,
|
||||
columns: [
|
||||
{
|
||||
id : 'icon-column-feature',
|
||||
|
||||
@@ -59,6 +59,15 @@ leimnud.event.add(getField('TASKS'), 'change', function() {
|
||||
}
|
||||
});
|
||||
/**/
|
||||
|
||||
leimnud.event.add(getField("WS_USER"), "keypress", function() {
|
||||
hideRowById("SEARCH");
|
||||
});
|
||||
|
||||
leimnud.event.add(getField("WS_PASS"), "keypress", function() {
|
||||
hideRowById("SEARCH");
|
||||
});
|
||||
|
||||
leimnud.event.add(getField('WE_TYPE'), 'change', function() {
|
||||
if (getField('WE_TYPE').value=='WS') {
|
||||
hideRowById("SEARCH");
|
||||
|
||||
@@ -44,12 +44,12 @@
|
||||
<td class="FormTitle" colspan="2" align="">{$form.PME_SUBTITLE3}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="FormLabel" width="{$form_labelWidth}">{$PME_STARTDATE}</td>
|
||||
<td class="FormLabel" width="{$form_labelWidth}"><font color="red">* </font>{$PME_STARTDATE}</td>
|
||||
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.PME_STARTDATE} </td> //-->
|
||||
<td class="FormFieldContent" width="{$form_fieldContentWidth}">{$form.PME_STARTDATE}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="FormLabel" width="{$form_labelWidth}">{$PME_ENDDATE}</td>
|
||||
<td class="FormLabel" width="{$form_labelWidth}"><font color="red">* </font>{$PME_ENDDATE}</td>
|
||||
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.PME_ENDDATE} </td> //-->
|
||||
<td class="FormFieldContent" width="{$form_fieldContentWidth}">{$form.PME_ENDDATE}</td>
|
||||
</tr>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<INP_DOC_TAGS type="textpm" size="30" maxlength="200" showVars="1" process="@#PRO_UID" symbol="@#" validate="Tag">
|
||||
<en><![CDATA[Tags]]></en>
|
||||
</INP_DOC_TAGS>
|
||||
<INP_DOC_TYPE_FILE type="text" defaultvalue="*.*" maxlength="200" size="37" colWidth="200" titleAlign="left" align="left" hint="To verify that the content of the file is the correct according to its extension, it is necessary to enable the FILEINFO extension, if this is not enabled only the extension will be verified." dataCompareField="T.CON_VALUE" dataCompareType="contains">
|
||||
<INP_DOC_TYPE_FILE type="text" defaultvalue="*.*" maxlength="200" size="37" colWidth="200" titleAlign="left" align="left" hint="Configure many extensions separated by comas. e.g *.jpg,*.png,*.bmp. Enable the FILEINFO module to verify the content and the extension of a file. If this is not enabled, the content won\'t be verified." dataCompareField="T.CON_VALUE" dataCompareType="contains">
|
||||
<en><![CDATA[Allowed file extensions (Use *.* to allow any extension)]]></en>
|
||||
</INP_DOC_TYPE_FILE>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user