Merge branch 'master' of bitbucket.org:colosa/processmaker
This commit is contained in:
@@ -22,6 +22,11 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
$arrayToTranslation = array(
|
||||
"TRIGGER" => G::LoadTranslation("ID_TRIGGER_DB"),
|
||||
"DERIVATION" => G::LoadTranslation("ID_DERIVATION_DB")
|
||||
);
|
||||
|
||||
$actionAjax = isset( $_REQUEST['actionAjax'] ) ? $_REQUEST['actionAjax'] : null;
|
||||
|
||||
if ($actionAjax == 'messageHistoryGridList_JXP') {
|
||||
@@ -110,6 +115,8 @@ if ($actionAjax == 'messageHistoryGridList_JXP') {
|
||||
$r->data = $aProcesses;
|
||||
$r->totalCount = $totalCount;
|
||||
|
||||
$r->data[0]["APP_MSG_TYPE"] = (array_key_exists($r->data[0]["APP_MSG_TYPE"], $arrayToTranslation))? $arrayToTranslation[$r->data[0]["APP_MSG_TYPE"]] : $r->data[0]["APP_MSG_TYPE"];
|
||||
|
||||
echo G::json_encode( $r );
|
||||
}
|
||||
if ($actionAjax == 'showHistoryMessage') {
|
||||
|
||||
@@ -533,6 +533,12 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
|
||||
G::LoadClass( "BasePeer" );
|
||||
global $G_PUBLISH;
|
||||
|
||||
$arrayToTranslation = array(
|
||||
"INPUT" => G::LoadTranslation("ID_INPUT_DB"),
|
||||
"OUTPUT" => G::LoadTranslation("ID_OUTPUT_DB"),
|
||||
"ATTACHED" => G::LoadTranslation("ID_ATTACHED_DB")
|
||||
);
|
||||
|
||||
$oCase = new Cases();
|
||||
$aProcesses = Array ();
|
||||
$G_PUBLISH = new Publisher();
|
||||
@@ -551,6 +557,7 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
|
||||
|
||||
for ($j = 0; $j < $rs->getRecordCount(); $j ++) {
|
||||
$result = $rs->getRow();
|
||||
$result["TYPE"] = (array_key_exists($result["TYPE"], $arrayToTranslation))? $arrayToTranslation[$result["TYPE"]] : $result["TYPE"];
|
||||
$aProcesses[] = $result;
|
||||
$rs->next();
|
||||
$totalCount ++;
|
||||
@@ -929,6 +936,17 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
|
||||
$Fields['APP_DOC_UID'] = $_POST['appDocId'];
|
||||
$Fields['actionType'] = $_POST['actionType'];
|
||||
$Fields['docVersion'] = $_POST['docVersion'];
|
||||
$oInputDocument = new InputDocument();
|
||||
$InpDocData = $oInputDocument->load( $Fields['DOC_UID'] );
|
||||
|
||||
$inpDocMaxFilesize = $InpDocData["INP_DOC_MAX_FILESIZE"];
|
||||
$inpDocMaxFilesizeUnit = $InpDocData["INP_DOC_MAX_FILESIZE_UNIT"];
|
||||
$inpDocMaxFilesize = $inpDocMaxFilesize * (($inpDocMaxFilesizeUnit == "MB")? 1024 *1024 : 1024); //Bytes
|
||||
|
||||
$Fields["INP_DOC_MAX_FILESIZE"] = $inpDocMaxFilesize;
|
||||
$Fields["INP_DOC_MAX_FILESIZE_LABEL"] = ($inpDocMaxFilesize > 0)? "[" . $InpDocData["INP_DOC_MAX_FILESIZE"] . " " . $InpDocData["INP_DOC_MAX_FILESIZE_UNIT"] . "]" : "";
|
||||
$Fields['fileTypes'] = $InpDocData['INP_DOC_TYPE_FILE'];
|
||||
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_AttachInputDocumentGeneral', '', $Fields, 'cases_SupervisorSaveDocument?UID=' . $_POST['docID'] . '&APP_UID=' . $_POST['appDocId'] );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
|
||||
@@ -49,6 +49,149 @@ $aData['APP_STATUS'] = $Fields['APP_STATUS'];
|
||||
$oCase->updateCase( $_SESSION['APPLICATION'], $aData );
|
||||
G::SendTemporalMessage( 'ID_SAVED_SUCCESSFULLY', 'info' );
|
||||
|
||||
//Save files
|
||||
if (isset( $_FILES["form"]["name"] ) && count( $_FILES["form"]["name"] ) > 0) {
|
||||
$arrayField = array ();
|
||||
$arrayFileName = array ();
|
||||
$arrayFileTmpName = array ();
|
||||
$arrayFileError = array ();
|
||||
$i = 0;
|
||||
|
||||
foreach ($_FILES["form"]["name"] as $fieldIndex => $fieldValue) {
|
||||
if (is_array( $fieldValue )) {
|
||||
foreach ($fieldValue as $index => $value) {
|
||||
if (is_array( $value )) {
|
||||
foreach ($value as $grdFieldIndex => $grdFieldValue) {
|
||||
$arrayField[$i]["grdName"] = $fieldIndex;
|
||||
$arrayField[$i]["grdFieldName"] = $grdFieldIndex;
|
||||
$arrayField[$i]["index"] = $index;
|
||||
|
||||
$arrayFileName[$i] = $_FILES["form"]["name"][$fieldIndex][$index][$grdFieldIndex];
|
||||
$arrayFileTmpName[$i] = $_FILES["form"]["tmp_name"][$fieldIndex][$index][$grdFieldIndex];
|
||||
$arrayFileError[$i] = $_FILES["form"]["error"][$fieldIndex][$index][$grdFieldIndex];
|
||||
$i = $i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$arrayField[$i] = $fieldIndex;
|
||||
|
||||
$arrayFileName[$i] = $_FILES["form"]["name"][$fieldIndex];
|
||||
$arrayFileTmpName[$i] = $_FILES["form"]["tmp_name"][$fieldIndex];
|
||||
$arrayFileError[$i] = $_FILES["form"]["error"][$fieldIndex];
|
||||
$i = $i + 1;
|
||||
}
|
||||
}
|
||||
if (count( $arrayField ) > 0) {
|
||||
for ($i = 0; $i <= count( $arrayField ) - 1; $i ++) {
|
||||
if ($arrayFileError[$i] == 0) {
|
||||
$indocUid = null;
|
||||
$fieldName = null;
|
||||
$fileSizeByField = 0;
|
||||
|
||||
if (is_array( $arrayField[$i] )) {
|
||||
if (isset( $_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]] ) && ! empty( $_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]] )) {
|
||||
$indocUid = $_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]];
|
||||
}
|
||||
|
||||
$fieldName = $arrayField[$i]["grdName"] . "_" . $arrayField[$i]["index"] . "_" . $arrayField[$i]["grdFieldName"];
|
||||
|
||||
if (isset($_FILES["form"]["size"][$arrayField[$i]["grdName"]][$arrayField[$i]["index"]][$arrayField[$i]["grdFieldName"]])) {
|
||||
$fileSizeByField = $_FILES["form"]["size"][$arrayField[$i]["grdName"]][$arrayField[$i]["index"]][$arrayField[$i]["grdFieldName"]];
|
||||
}
|
||||
} else {
|
||||
if (isset( $_POST["INPUTS"][$arrayField[$i]] ) && ! empty( $_POST["INPUTS"][$arrayField[$i]] )) {
|
||||
$indocUid = $_POST["INPUTS"][$arrayField[$i]];
|
||||
}
|
||||
|
||||
$fieldName = $arrayField[$i];
|
||||
|
||||
if (isset($_FILES["form"]["size"][$fieldName])) {
|
||||
$fileSizeByField = $_FILES["form"]["size"][$fieldName];
|
||||
}
|
||||
}
|
||||
|
||||
if ($indocUid != null) {
|
||||
//require_once ("classes/model/AppFolder.php");
|
||||
//require_once ("classes/model/InputDocument.php");
|
||||
|
||||
$oInputDocument = new InputDocument();
|
||||
$aID = $oInputDocument->load( $indocUid );
|
||||
|
||||
//Get the Custom Folder ID (create if necessary)
|
||||
$oFolder = new AppFolder();
|
||||
|
||||
//***Validating the file allowed extensions***
|
||||
$res = G::verifyInputDocExtension($aID['INP_DOC_TYPE_FILE'], $arrayFileName[$i], $arrayFileTmpName[$i]);
|
||||
if($res->status == 0){
|
||||
$message = $res->message;
|
||||
G::SendMessageText( $message, "ERROR" );
|
||||
$backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
|
||||
G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
|
||||
die();
|
||||
}
|
||||
|
||||
//--- Validate Filesize of $_FILE
|
||||
$inpDocMaxFilesize = $aID["INP_DOC_MAX_FILESIZE"];
|
||||
$inpDocMaxFilesizeUnit = $aID["INP_DOC_MAX_FILESIZE_UNIT"];
|
||||
|
||||
$inpDocMaxFilesize = $inpDocMaxFilesize * (($inpDocMaxFilesizeUnit == "MB")? 1024 *1024 : 1024); //Bytes
|
||||
|
||||
if ($inpDocMaxFilesize > 0 && $fileSizeByField > 0) {
|
||||
if ($fileSizeByField > $inpDocMaxFilesize) {
|
||||
G::SendMessageText(G::LoadTranslation("ID_SIZE_VERY_LARGE_PERMITTED"), "ERROR");
|
||||
$arrayAux1 = explode("sys" . SYS_SYS, $_SERVER["HTTP_REFERER"]);
|
||||
G::header("location: /sys" . SYS_SYS . $arrayAux1[1]);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
$aFields = array ("APP_UID" => $_SESSION["APPLICATION"],"DEL_INDEX" => $_SESSION["INDEX"],"USR_UID" => $_SESSION["USER_LOGGED"],"DOC_UID" => $indocUid,"APP_DOC_TYPE" => "INPUT","APP_DOC_CREATE_DATE" => date( "Y-m-d H:i:s" ),"APP_DOC_COMMENT" => "","APP_DOC_TITLE" => "","APP_DOC_FILENAME" => $arrayFileName[$i],"FOLDER_UID" => $oFolder->createFromPath( $aID["INP_DOC_DESTINATION_PATH"] ),"APP_DOC_TAGS" => $oFolder->parseTags( $aID["INP_DOC_TAGS"] ),"APP_DOC_FIELDNAME" => $fieldName);
|
||||
} else {
|
||||
$aFields = array ("APP_UID" => $_SESSION["APPLICATION"],"DEL_INDEX" => $_SESSION["INDEX"],"USR_UID" => $_SESSION["USER_LOGGED"],"DOC_UID" => - 1,"APP_DOC_TYPE" => "ATTACHED","APP_DOC_CREATE_DATE" => date( "Y-m-d H:i:s" ),"APP_DOC_COMMENT" => "","APP_DOC_TITLE" => "","APP_DOC_FILENAME" => $arrayFileName[$i],"APP_DOC_FIELDNAME" => $fieldName);
|
||||
}
|
||||
|
||||
$oAppDocument = new AppDocument();
|
||||
$oAppDocument->create( $aFields );
|
||||
|
||||
$iDocVersion = $oAppDocument->getDocVersion();
|
||||
$sAppDocUid = $oAppDocument->getAppDocUid();
|
||||
$aInfo = pathinfo( $oAppDocument->getAppDocFilename() );
|
||||
$sExtension = ((isset( $aInfo["extension"] )) ? $aInfo["extension"] : "");
|
||||
$pathUID = G::getPathFromUID($_SESSION["APPLICATION"]);
|
||||
$sPathName = PATH_DOCUMENT . $pathUID . PATH_SEP;
|
||||
$sFileName = $sAppDocUid . "_" . $iDocVersion . "." . $sExtension;
|
||||
G::uploadFile( $arrayFileTmpName[$i], $sPathName, $sFileName );
|
||||
|
||||
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document
|
||||
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
|
||||
if ($oPluginRegistry->existsTrigger( PM_UPLOAD_DOCUMENT ) && class_exists( "uploadDocumentData" )) {
|
||||
$triggerDetail = $oPluginRegistry->getTriggerInfo( PM_UPLOAD_DOCUMENT );
|
||||
$documentData = new uploadDocumentData( $_SESSION["APPLICATION"], $_SESSION["USER_LOGGED"], $sPathName . $sFileName, $aFields["APP_DOC_FILENAME"], $sAppDocUid, $iDocVersion );
|
||||
$uploadReturn = $oPluginRegistry->executeTriggers( PM_UPLOAD_DOCUMENT, $documentData );
|
||||
|
||||
if ($uploadReturn) {
|
||||
$aFields["APP_DOC_PLUGIN"] = $triggerDetail->sNamespace;
|
||||
|
||||
if (! isset( $aFields["APP_DOC_UID"] )) {
|
||||
$aFields["APP_DOC_UID"] = $sAppDocUid;
|
||||
}
|
||||
|
||||
if (! isset( $aFields["DOC_VERSION"] )) {
|
||||
$aFields["DOC_VERSION"] = $iDocVersion;
|
||||
}
|
||||
|
||||
$oAppDocument->update( $aFields );
|
||||
|
||||
unlink( $sPathName . $sFileName );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//go to the next step
|
||||
$aNextStep = $oCase->getNextSupervisorStep( $_SESSION['PROCESS'], $_SESSION['STEP_POSITION'] );
|
||||
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
|
||||
|
||||
@@ -49,7 +49,7 @@ try {
|
||||
$aData['SCH_UID'] = G::generateUniqueID();
|
||||
$aData['SCH_NAME'] = $_POST['form']['SCH_NAME'];
|
||||
$aData['SCH_DEL_USER_NAME'] = $_POST['form']['SCH_USER_NAME'];
|
||||
$aData['SCH_DEL_USER_PASS'] = md5( $_POST['form']['SCH_USER_PASSWORD'] );
|
||||
$aData['SCH_DEL_USER_PASS'] = Bootstrap::hashPassword($_POST['form']['SCH_USER_PASSWORD']);
|
||||
$aData['SCH_DEL_USER_UID'] = $_POST['form']['SCH_USER_UID'];
|
||||
$aData['PRO_UID'] = $_POST['form']['PRO_UID'];
|
||||
$aData['TAS_UID'] = $_POST['form']['TAS_UID'];
|
||||
|
||||
@@ -54,7 +54,7 @@ try {
|
||||
|
||||
$aData['SCH_DEL_USER_NAME'] = $_POST['form']['SCH_USER_NAME'];
|
||||
if ($_POST['form']['SCH_USER_PASSWORD'] != 'DefaultPM') {
|
||||
$aData['SCH_DEL_USER_PASS'] = md5( $_POST['form']['SCH_USER_PASSWORD'] );
|
||||
$aData['SCH_DEL_USER_PASS'] = Bootstrap::hashPassword($_POST['form']['SCH_USER_PASSWORD']);
|
||||
}
|
||||
$aData['SCH_DEL_USER_UID'] = $_POST['form']['SCH_USER_UID'];
|
||||
|
||||
|
||||
@@ -631,6 +631,27 @@ function fieldSave()
|
||||
|
||||
$conf->saveObject($result, "casesList", $action, "", "", "");
|
||||
|
||||
$msgLog = '';
|
||||
|
||||
if($action == 'todo') {
|
||||
$list = 'Inbox';
|
||||
} elseif ($action == 'sent') {
|
||||
$list = 'Participated';
|
||||
} else {
|
||||
$list = ucwords($action);
|
||||
}
|
||||
|
||||
for ($i=4; $i<count( $arrayNewSecond ); $i++) {
|
||||
if ($i == count( $arrayNewSecond )-1) {
|
||||
$msgLog .= $arrayNewSecond[$i]['label'];
|
||||
} else {
|
||||
$msgLog .= $arrayNewSecond[$i]['label'].'-';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
G::auditLog("SetColumns", "Set ".$list." List Columns".$msgLog);
|
||||
|
||||
echo G::json_encode($result);
|
||||
}
|
||||
|
||||
|
||||
@@ -224,6 +224,8 @@ switch ($_POST['action']) {
|
||||
$dep_uid = $_REQUEST['uid'];
|
||||
$dep_manager = $_REQUEST['manager'];
|
||||
$dep_status = $_REQUEST['status'];
|
||||
$dep_parent = $_REQUEST['parent'];
|
||||
$editDepartment['DEP_PARENT'] = $dep_parent;
|
||||
$editDepartment['DEP_UID'] = $dep_uid;
|
||||
$editDepartment['DEPO_TITLE'] = $dep_name;
|
||||
$editDepartment['DEP_STATUS'] = $dep_status;
|
||||
@@ -231,6 +233,13 @@ switch ($_POST['action']) {
|
||||
$oDept = new Department();
|
||||
$oDept->update( $editDepartment );
|
||||
$oDept->updateDepartmentManager( $dep_uid );
|
||||
|
||||
if ($dep_parent == '') {
|
||||
G::auditLog("UpdateDepartament", "Departament Name: ".$dep_name." (".$dep_uid.") ");
|
||||
} else {
|
||||
G::auditLog("UpdateSubDepartament", "Sub Departament Name: ".$dep_name." (".$dep_uid.") ");
|
||||
}
|
||||
|
||||
echo '{success: true}';
|
||||
} catch (exception $e) {
|
||||
echo '{success: false}';
|
||||
|
||||
@@ -177,6 +177,13 @@ try {
|
||||
}
|
||||
|
||||
$result["success"] = $addon->setEnabled(($action == "enable"));
|
||||
|
||||
if ($action == "enable") {
|
||||
G::auditLog("EnablePlugin", "Plugin Name: ".$_REQUEST['addon']);
|
||||
} else {
|
||||
G::auditLog("DisablePlugin", "Plugin Name: ".$_REQUEST['addon']);
|
||||
}
|
||||
|
||||
break;
|
||||
case "install":
|
||||
$status = 1;
|
||||
@@ -340,7 +347,9 @@ try {
|
||||
exit(0);
|
||||
break;
|
||||
case "addonslist":
|
||||
$result = AddonsStore::addonList();
|
||||
$type = (isset($_REQUEST['type'])) ? $_REQUEST['type']: 'plugin';
|
||||
$result = AddonsStore::addonList($type);
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
throw (new Exception("Action \"$action\" is not valid"));
|
||||
|
||||
@@ -21,8 +21,8 @@ class enterprisePlugin extends PMPlugin
|
||||
$VERSION = System::getVersion();
|
||||
|
||||
$res = parent::PMPlugin($sNamespace, $sFilename);
|
||||
$this->sFriendlyName = "ProcessMaker Enterprise Edition";
|
||||
$this->sDescription = "ProcessMaker Enterprise Edition $VERSION";
|
||||
$this->sFriendlyName = "ProcessMaker Enterprise Core Edition";
|
||||
$this->sDescription = "ProcessMaker Enterprise Core Edition $VERSION";
|
||||
$this->sPluginFolder = "enterprise";
|
||||
$this->sSetupPage = "../enterprise/addonsStore.php";
|
||||
$this->iVersion = $VERSION;
|
||||
|
||||
@@ -270,6 +270,7 @@ switch ($option) {
|
||||
if ($result["status"] == "OK") {
|
||||
$response["status"] = $result["status"]; //OK
|
||||
$response["message"] = $result["message"];
|
||||
G::auditLog("InstallPlugin", "Plugin Name: ".$file);
|
||||
} else {
|
||||
throw (new Exception($result["message"]));
|
||||
}
|
||||
|
||||
@@ -149,7 +149,10 @@ switch ($_POST['action']) {
|
||||
unset( $newGroup['GRP_UID'] );
|
||||
$group = new Groupwf();
|
||||
$group->create( $newGroup );
|
||||
G::auditLog("CreateGroup", "Group Name: ".$newGroup['GRP_TITLE']);
|
||||
|
||||
echo '{success: true}';
|
||||
|
||||
break;
|
||||
case 'saveEditGroup':
|
||||
G::LoadClass( 'groups' );
|
||||
@@ -158,6 +161,7 @@ switch ($_POST['action']) {
|
||||
$editGroup['GRP_TITLE'] = trim( $_POST['name'] );
|
||||
$group = new Groupwf();
|
||||
$group->update( $editGroup );
|
||||
G::auditLog("UpdateGroup", "Group Name: ".$editGroup['GRP_TITLE']." Group ID: (".$_POST['grp_uid'].") ");
|
||||
echo '{success: true}';
|
||||
break;
|
||||
case 'deleteGroup':
|
||||
@@ -167,6 +171,7 @@ switch ($_POST['action']) {
|
||||
return;
|
||||
}
|
||||
$group->remove( urldecode( $_POST['GRP_UID'] ) );
|
||||
G::auditLog("DeleteGroup", "Group Name: ".$_POST['GRP_NAME']." Group ID: (".$_POST['GRP_UID'].") ");
|
||||
require_once 'classes/model/TaskUser.php';
|
||||
$oProcess = new TaskUser();
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
|
||||
@@ -104,6 +104,7 @@ if (isset( $_REQUEST['action'] )) {
|
||||
$pcat->setCategoryUid( G::GenerateUniqueID() );
|
||||
$pcat->setCategoryName( $catName );
|
||||
$pcat->save();
|
||||
G::auditLog("CreateCategory", "Category Name: ".$catName);
|
||||
echo '{success: true}';
|
||||
} catch (Exception $ex) {
|
||||
echo '{success: false, error: ' . $ex->getMessage() . '}';
|
||||
@@ -134,6 +135,7 @@ if (isset( $_REQUEST['action'] )) {
|
||||
$pcat->setCategoryUid( $catUID );
|
||||
$pcat->setCategoryName( $catName );
|
||||
$pcat->save();
|
||||
g::auditLog("UpdateCategory", "Category Name: ".$catName." Category ID: (".$catUID.") ");
|
||||
echo '{success: true}';
|
||||
} catch (Exception $ex) {
|
||||
echo '{success: false, error: ' . $ex->getMessage() . '}';
|
||||
@@ -153,7 +155,9 @@ if (isset( $_REQUEST['action'] )) {
|
||||
$catUID = $_REQUEST['cat_uid'];
|
||||
$cat = new ProcessCategory();
|
||||
$cat->setCategoryUid( $catUID );
|
||||
$catName = $cat->loadByCategoryId( $catUID );
|
||||
$cat->delete();
|
||||
G::auditLog("DeleteCategory", "Category Name: ".$catName." Category ID: (".$catUID.") ");
|
||||
echo '{success: true}';
|
||||
} catch (Exception $ex) {
|
||||
echo '{success: false, error: ' . $ex->getMessage() . '}';
|
||||
|
||||
@@ -26,6 +26,10 @@ $response = new StdClass();
|
||||
$outputDir = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP;
|
||||
|
||||
try {
|
||||
if(empty($_GET)){
|
||||
$proUid = Bootstrap::json_decode( $_POST['data']);
|
||||
$_GET["pro_uid"] = $proUid->pro_uid;
|
||||
}
|
||||
if (\BpmnProject::exists($_GET["pro_uid"])) {
|
||||
$exporter = new ProcessMaker\Exporter\XmlExporter($_GET["pro_uid"]);
|
||||
|
||||
@@ -40,16 +44,26 @@ try {
|
||||
|
||||
rename($outputDir . $outputFilename . "tpm", $outputDir . $outputFilename);
|
||||
}
|
||||
|
||||
$response->file_hash = base64_encode($outputFilename);
|
||||
$response->success = true;
|
||||
|
||||
/* Render page */
|
||||
if (isset( $_REQUEST["processMap"] ) && $_REQUEST["processMap"] == 1) {
|
||||
$link = parse_url($result['FILENAME_LINK']);
|
||||
$result['FILENAME_LINK'] = $link['path'] . '?file_hash=' . $response->file_hash;
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( "xmlform", "xmlform", "processes/processes_Export", "", $result );
|
||||
|
||||
G::RenderPage( "publish", "raw" );
|
||||
} else{
|
||||
echo json_encode($response);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$response->message = $e->getMessage();
|
||||
$response->success = false;
|
||||
}
|
||||
|
||||
echo json_encode($response);
|
||||
|
||||
|
||||
// ************* DEPRECATED (it will be removed soon) *********************************
|
||||
|
||||
|
||||
@@ -260,7 +260,7 @@ switch ($request) {
|
||||
$result = new StdClass();
|
||||
$result->success = true;
|
||||
$result->msg = G::LoadTranslation('ID_TITLE_COMPLETED');
|
||||
|
||||
G::auditLog("BuildCache");
|
||||
echo G::json_encode( $result );
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
96
workflow/engine/methods/setup/auditLog.php
Normal file
96
workflow/engine/methods/setup/auditLog.php
Normal file
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
global $RBAC;
|
||||
|
||||
if ($RBAC->userCanAccess("PM_SETUP") != 1) {
|
||||
G::SendTemporalMessage("ID_USER_HAVENT_RIGHTS_PAGE", "error", "labels");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
$c = new Configurations();
|
||||
$configPage = $c->getConfiguration( "auditLogList", "pageSize", null, $_SESSION["USER_LOGGED"] );
|
||||
|
||||
$config = array ();
|
||||
$config["pageSize"] = (isset( $configPage["pageSize"] )) ? $configPage["pageSize"] : 20;
|
||||
|
||||
$arrayAction = array (array ("ALL", G::LoadTranslation( "ID_ALL" )),
|
||||
array ("CreateUser", G::LoadTranslation( "ID_CREATE_USER" )),
|
||||
array ("UpdateUser", G::LoadTranslation( "ID_UPDATE_USER" )),
|
||||
array ("DeleteUser", G::LoadTranslation( "ID_DELETE_USER" )),
|
||||
array ("EnableUser", G::LoadTranslation( "ID_ENABLE_USER" )),
|
||||
array ("DisableUser", G::LoadTranslation( "ID_DISABLE_USER" )),
|
||||
array ("AssignAuthenticationSource", G::LoadTranslation( "ID_ASSIGN_AUTHENTICATION_SOURCE" )),
|
||||
array ("AssignUserToGroup", G::LoadTranslation( "ID_ASSIGN_USER_TO_GROUP" )),
|
||||
array ("CreateAuthSource", G::LoadTranslation( "ID_CREATE_AUTH_SOURCE" )),
|
||||
array ("UpdateAuthSource", G::LoadTranslation( "ID_UPDATE_AUTH_SOURCE" )),
|
||||
array ("DeleteAuthSource", G::LoadTranslation( "ID_DELETE_AUTH_SOURCE" )),
|
||||
array ("CreateRole", G::LoadTranslation( "ID_CREATE_ROLE" )),
|
||||
array ("UpdateRole", G::LoadTranslation( "ID_UPDATE_ROLE" )),
|
||||
array ("DeleteRole", G::LoadTranslation( "ID_DELETE_ROLE" )),
|
||||
array ("AssignUserToRole", G::LoadTranslation( "ID_ASSIGN_USER_TO_ROLE" )),
|
||||
array ("DeleteUserToRole", G::LoadTranslation( "ID_DELETE_USER_TO_ROLE" )),
|
||||
array ("AddPermissionToRole", G::LoadTranslation( "ID_ADD_PERMISSION_TO_ROLE" )),
|
||||
array ("DeletePermissionToRole", G::LoadTranslation( "ID_DELETE_PERMISSION_TO_ROLE" )),
|
||||
array ("CreateSkin", G::LoadTranslation( "ID_CREATE_SKIN" )),
|
||||
array ("ImportSkin", G::LoadTranslation( "ID_IMPORT_SKIN" )),
|
||||
array ("ExportSkin", G::LoadTranslation( "ID_EXPORT_SKIN" )),
|
||||
array ("DeleteSkin", G::LoadTranslation( "ID_DELETE_SKIN" )),
|
||||
array ("CreateGroup", G::LoadTranslation( "ID_CREATE_GROUP" )),
|
||||
array ("UpdateGroup", G::LoadTranslation( "ID_UPDATE_GROUP" )),
|
||||
array ("DeleteGroup", G::LoadTranslation( "ID_DELETE_GROUP" )),
|
||||
array ("CreateCategory", G::LoadTranslation( "ID_CREATE_CATEGORY" )),
|
||||
array ("UpdateCategory", G::LoadTranslation( "ID_UPDATE_CATEGORY" )),
|
||||
array ("DeleteCategory", G::LoadTranslation( "ID_DELETE_CATEGORY" )),
|
||||
array ("BuildCache", G::LoadTranslation( "ID_BUILD_CACHE" )),
|
||||
array ("ClearCache", G::LoadTranslation( "ID_CLEAR_CACHE" )),
|
||||
array ("ClearCron", G::LoadTranslation( "ID_CLEAR_CRON" )),
|
||||
array ("UpdateEnvironmentSettings", G::LoadTranslation( "ID_UPDATE_ENVIRONMENT_SETTINGS" )),
|
||||
array ("UpdateLoginSettings", G::LoadTranslation( "ID_UPDATE_LOGIN_SETTINGS" )),
|
||||
array ("EnableHeartBeat", G::LoadTranslation( "ID_ENABLE_HEART_BEAT" )),
|
||||
array ("DisableHeartBeat", G::LoadTranslation( "ID_DISABLE_HEART_BEAT" )),
|
||||
array ("CreatePmtable", G::LoadTranslation( "ID_CREATE_PMTABLE" )),
|
||||
array ("UpdatePmtable", G::LoadTranslation( "ID_UPDATE_PMTABLE" )),
|
||||
array ("DeletePmtable", G::LoadTranslation( "ID_DELETE_PMTABLE" )),
|
||||
array ("AddDataPmtable", G::LoadTranslation( "ID_ADD_DATA_PMTABLE" )),
|
||||
array ("UpdateDataPmtable", G::LoadTranslation( "ID_UPDATE_DATA_PMTABLE" )),
|
||||
array ("DeleteDataPmtable", G::LoadTranslation( "ID_DELETE_DATA_PMTABLE" )),
|
||||
array ("ImportTable", G::LoadTranslation( "ID_IMPORT_TABLE" )),
|
||||
array ("ExportTable", G::LoadTranslation( "ID_EXPORT_TABLE" )),
|
||||
array ("CreateCalendar", G::LoadTranslation( "ID_CREATE_CALENDAR" )),
|
||||
array ("UpdateCalendar", G::LoadTranslation( "ID_UPDATE_CALENDAR" )),
|
||||
array ("DeleteCalendar", G::LoadTranslation( "ID_DELETE_CALENDAR" )),
|
||||
array ("CreateDashletInstance", G::LoadTranslation( "ID_CREATE_DASHLET_INSTANCE" )),
|
||||
array ("UpdateDashletInstance", G::LoadTranslation( "ID_UPDATE_DASHLET_INSTANCE" )),
|
||||
array ("DeleteDashletInstance", G::LoadTranslation( "ID_DELETE_DASHLET_INSTANCE" )),
|
||||
array ("CreateDepartament", G::LoadTranslation( "ID_CREATE_DEPARTAMENT" )),
|
||||
array ("CreateSubDepartament", G::LoadTranslation( "ID_CREATE_SUB_DEPARTAMENT" )),
|
||||
array ("UpdateDepartament", G::LoadTranslation( "ID_UPDATE_DEPARTAMENT" )),
|
||||
array ("UpdateSubDepartament", G::LoadTranslation( "ID_UPDATE_SUB_DEPARTAMENT" )),
|
||||
array ("DeleteDepartament", G::LoadTranslation( "ID_DELETE_DEPARTAMENT" )),
|
||||
array ("AssignManagerToDepartament", G::LoadTranslation( "ID_ASSIGN_MANAGER_TO_DEPARTAMENT" )),
|
||||
array ("AssignUserToDepartament", G::LoadTranslation( "ID_ASSIGN_USER_TO_DEPARTAMENT" )),
|
||||
array ("RemoveUsersFromDepartament", G::LoadTranslation( "ID_REMOVE_USERS_FROM_DEPARTAMENT" )),
|
||||
array ("AssignUserToGroup", G::LoadTranslation( "ID_ASSIGN_USER_TO_GROUP" )),
|
||||
array ("UploadLanguage", G::LoadTranslation( "ID_UPLOAD_LANGUAGE" )),
|
||||
array ("ExportLanguage", G::LoadTranslation( "ID_EXPORT_LANGUAGE" )),
|
||||
array ("DeleteLanguage", G::LoadTranslation( "ID_DELETE_LAGUAGE" )),
|
||||
array ("UploadSystemSettings", G::LoadTranslation( "ID_UPLOAD_SYSTEM_SETTINGS" )),
|
||||
array ("UpdateEmailSettings", G::LoadTranslation( "ID_UPDATE_EMAIL_SETTINGS" )),
|
||||
array ("CreateEmailSettings", G::LoadTranslation( "ID_CREATE_EMAIL_SETTINGS" )),
|
||||
array ("UploadLogo", G::LoadTranslation( "ID_UPLOAD_LOGO" )),
|
||||
array ("DeleteLogo", G::LoadTranslation( "ID_DELETE_LOGO" )),
|
||||
array ("RestoreLogo", G::LoadTranslation( "ID_RESTORE_LOGO" )),
|
||||
array ("ReplaceLogo", G::LoadTranslation( "ID_REPLACE_LOGO" )),
|
||||
array ("InstallPlugin", G::LoadTranslation( "ID_INSTALL_PLUGIN" )),
|
||||
array ("EnablePlugin", G::LoadTranslation( "ID_ENABLE_PLUGIN" )),
|
||||
array ("DisablePlugin", G::LoadTranslation( "ID_DISABLE_PLUGIN" )),
|
||||
array ("RemovePlugin", G::LoadTranslation( "ID_REMOVE_PLUGIN" )),
|
||||
array ("SetColumns", G::LoadTranslation( "ID_SET_COLUMNS" )),
|
||||
array ("EnableAuditLog", G::LoadTranslation( "ID_ENABLE_AUDIT_LOG" )),
|
||||
array ("DisableAuditLog", G::LoadTranslation( "ID_DISABLE_AUDIT_LOG" )),
|
||||
);
|
||||
|
||||
$oHeadPublisher = &headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript( "setup/auditLog", true );
|
||||
$oHeadPublisher->assign( "CONFIG", $config );
|
||||
$oHeadPublisher->assign( "ACTION", $arrayAction );
|
||||
G::RenderPage( "publish", "extJs" );
|
||||
151
workflow/engine/methods/setup/auditLogAjax.php
Normal file
151
workflow/engine/methods/setup/auditLogAjax.php
Normal file
@@ -0,0 +1,151 @@
|
||||
<?php
|
||||
|
||||
function mktimeDate ($date)
|
||||
{
|
||||
$arrayAux = getdate( strtotime( $date ) );
|
||||
$mktDate = mktime( $arrayAux["hours"], $arrayAux["minutes"], $arrayAux["seconds"], $arrayAux["mon"], $arrayAux["mday"], $arrayAux["year"] );
|
||||
return $mktDate;
|
||||
}
|
||||
|
||||
function auditLogArraySet ($str, $filter)
|
||||
{
|
||||
$arrayAux = explode( "|", $str );
|
||||
$date = "";
|
||||
$workspace = "";
|
||||
$action = "";
|
||||
$ip = "";
|
||||
$user = "";
|
||||
$description = "";
|
||||
|
||||
if (count( $arrayAux ) > 1) {
|
||||
$date = (isset( $arrayAux[0] )) ? trim( $arrayAux[0] ) : "";
|
||||
$workspace = (isset( $arrayAux[1] )) ? trim( $arrayAux[1] ) : "";
|
||||
$ip = (isset( $arrayAux[2] )) ? trim( $arrayAux[2] ) : "";
|
||||
$user = (isset( $arrayAux[4] )) ? trim( $arrayAux[4] ) : "";
|
||||
$action = (isset( $arrayAux[5] )) ? trim( $arrayAux[5] ) : "";
|
||||
$description = (isset( $arrayAux[6] )) ? trim( $arrayAux[6] ) : "";
|
||||
}
|
||||
|
||||
$mktDate = (! empty( $date )) ? mktimeDate( $date ) : 0;
|
||||
|
||||
//Filter
|
||||
$sw = 1;
|
||||
if ($workspace != $filter["workspace"]) {
|
||||
$sw = 0;
|
||||
}
|
||||
|
||||
if ($filter["action"] != "ALL") {
|
||||
if ($action != $filter["action"]) {
|
||||
$sw = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filter["dateFrom"] && $mktDate > 0) {
|
||||
if (! (mktimeDate( $filter["dateFrom"] ) <= $mktDate)) {
|
||||
$sw = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filter["dateTo"] && $mktDate > 0) {
|
||||
if (! ($mktDate <= mktimeDate( $filter["dateTo"] . " 23:59:59" ))) {
|
||||
$sw = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filter["description"]) {
|
||||
$sw = 0;
|
||||
$string = $filter["description"];
|
||||
|
||||
if ( (stristr($date, $string) !== false) || (stristr($ip, $string) !== false) || (stristr($user, $string) !== false) || (stristr($action, $string) !== false) || (stristr($description, $string) !== false) ) {
|
||||
$sw = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$arrayData = array ();
|
||||
$newAction = preg_replace('/([A-Z])/', '_$1', $action);
|
||||
$newAction = "ID".strtoupper($newAction);
|
||||
|
||||
if ($sw == 1) {
|
||||
$arrayData = array ("DATE" => $date, "USER" => $user, "IP" =>$ip, "ACTION" => G::LoadTranslation($newAction), "DESCRIPTION" => $description);
|
||||
}
|
||||
|
||||
return $arrayData;
|
||||
}
|
||||
|
||||
function getAuditLogData ($filter, $r, $i)
|
||||
{
|
||||
$arrayData = array ();
|
||||
$strAux = null;
|
||||
$count = 0;
|
||||
|
||||
$file = PATH_DATA . "log" . PATH_SEP . "audit.log";
|
||||
|
||||
if (file_exists($file)) {
|
||||
$arrayFileData = file($file);
|
||||
|
||||
for ($k = 0; $k < count($arrayFileData); $k++) {
|
||||
|
||||
$strAux = $arrayFileData[$k];
|
||||
|
||||
if ($strAux) {
|
||||
$arrayAux = auditLogArraySet($strAux, $filter);
|
||||
if (count($arrayAux) > 0) {
|
||||
$count = $count + 1;
|
||||
|
||||
if ($count > $i && count($arrayData) < $r) {
|
||||
$arrayData[] = $arrayAux;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return array($count, $arrayData);
|
||||
}
|
||||
|
||||
$option = (isset( $_REQUEST["option"] )) ? $_REQUEST["option"] : null;
|
||||
|
||||
$response = array ();
|
||||
|
||||
switch ($option) {
|
||||
case "LST":
|
||||
$pageSize = $_REQUEST["pageSize"];
|
||||
$workspace = SYS_SYS;
|
||||
$action = $_REQUEST["action"];
|
||||
$description = $_REQUEST["description"];
|
||||
$dateFrom = $_REQUEST["dateFrom"];
|
||||
$dateTo = $_REQUEST["dateTo"];
|
||||
|
||||
$arrayFilter = array ("workspace" => $workspace, "action" => $action, "description" => $description,"dateFrom" => str_replace( "T00:00:00", null, $dateFrom ),"dateTo" => str_replace( "T00:00:00", null, $dateTo )
|
||||
);
|
||||
|
||||
$limit = isset( $_REQUEST["limit"] ) ? $_REQUEST["limit"] : $pageSize;
|
||||
$start = isset( $_REQUEST["start"] ) ? $_REQUEST["start"] : 0;
|
||||
|
||||
list ($count, $data) = getAuditLogData( $arrayFilter, $limit, $start );
|
||||
$response = array ("success" => true,"resultTotal" => $count,"resultRoot" => $data
|
||||
);
|
||||
break;
|
||||
case "EMPTY":
|
||||
$status = 1;
|
||||
|
||||
try {
|
||||
$file = PATH_DATA . "log" . PATH_SEP . "cron.log";
|
||||
|
||||
if (file_exists( $file )) {
|
||||
unlink( $file );
|
||||
}
|
||||
|
||||
$response["status"] = "OK";
|
||||
} catch (Exception $e) {
|
||||
$response["message"] = $e->getMessage();
|
||||
$status = 0;
|
||||
}
|
||||
|
||||
if ($status == 0) {
|
||||
$response["status"] = "ERROR";
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
echo G::json_encode( $response );
|
||||
16
workflow/engine/methods/setup/auditLogConfig.php
Normal file
16
workflow/engine/methods/setup/auditLogConfig.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
global $RBAC;
|
||||
$RBAC->requirePermissions( 'PM_SETUP' );
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
G::LoadClass( 'serverConfiguration' );
|
||||
|
||||
$oServerConf = & serverConf::getSingleton();
|
||||
|
||||
$sflag = $oServerConf->getAuditLogProperty( 'AL_OPTION', SYS_SYS );
|
||||
$auditLogChecked = $sflag == 1 ? true : false;
|
||||
|
||||
$oHeadPublisher->addExtJsScript( 'setup/auditLogConfig', true ); //adding a javascript file .js
|
||||
$oHeadPublisher->assign( 'auditLogChecked', $auditLogChecked );
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
33
workflow/engine/methods/setup/auditLogConfigAjax.php
Normal file
33
workflow/engine/methods/setup/auditLogConfigAjax.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
global $G_TMP_MENU;
|
||||
|
||||
switch ($_GET['action']) {
|
||||
case 'saveOption':
|
||||
try {
|
||||
G::LoadClass( 'serverConfiguration' );
|
||||
$oServerConf = & serverConf::getSingleton();
|
||||
$response = new $oServerConf;
|
||||
/*you can use SYS_TEMP or SYS_SYS ON AUDIT_LOG_CONF to save for each workspace*/
|
||||
$oServerConf->unsetAuditLogProperty( 'AL_TYPE', SYS_SYS );
|
||||
if (isset( $_POST['acceptAL'] )) {
|
||||
$oServerConf->setAuditLogProperty( 'AL_OPTION', 1, SYS_SYS );
|
||||
$oServerConf->unsetAuditLogProperty( 'AL_NEXT_DATE', SYS_SYS );
|
||||
$response->enable = true;
|
||||
G::auditLog("EnableAuditLog");
|
||||
} else {
|
||||
G::auditLog("DisableAuditLog");
|
||||
$oServerConf->setAuditLogProperty( 'AL_OPTION', 0, SYS_SYS );
|
||||
$oServerConf->unsetAuditLogProperty( 'AL_NEXT_DATE', SYS_SYS );
|
||||
$oServerConf->setAuditLogProperty( 'AL_TYPE', 'endaudit', SYS_SYS );
|
||||
$response->enable = false;
|
||||
}
|
||||
$response->success = true;
|
||||
|
||||
} catch (Exception $e) {
|
||||
$response->success = false;
|
||||
$response->msg = $e->getMessage();
|
||||
}
|
||||
echo G::json_encode( $response );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3,22 +3,28 @@ try {
|
||||
$response = new stdClass;
|
||||
if (isset( $_POST['javascriptCache'] ) || isset( $_POST['metadataCache'] ) || isset( $_POST['htmlCache'] )) {
|
||||
|
||||
$msgLog = '';
|
||||
if (isset( $_POST['javascriptCache'] )) {
|
||||
G::rm_dir( PATH_C . 'ExtJs' );
|
||||
$response->javascript = true;
|
||||
$msgLog .= 'Javascript cache ';
|
||||
}
|
||||
|
||||
if (isset( $_POST['metadataCache'] )) {
|
||||
G::rm_dir( PATH_C . 'xmlform' );
|
||||
$response->xmlform = true;
|
||||
$msgLog .= 'Forms Metadata cache ';
|
||||
}
|
||||
|
||||
if (isset( $_POST['htmlCache'] )) {
|
||||
G::rm_dir( PATH_C . 'smarty' );
|
||||
$response->smarty = true;
|
||||
$msgLog .= 'Forms Html Templates cache ';
|
||||
}
|
||||
|
||||
$response->success = true;
|
||||
|
||||
G::auditLog("ClearCache", $msgLog);
|
||||
} else {
|
||||
$response->success = false;
|
||||
}
|
||||
|
||||
@@ -144,6 +144,7 @@ switch ($option) {
|
||||
}
|
||||
|
||||
$response["status"] = "OK";
|
||||
G::auditLog("ClearCron");
|
||||
} catch (Exception $e) {
|
||||
$response["message"] = $e->getMessage();
|
||||
$status = 0;
|
||||
|
||||
@@ -46,6 +46,8 @@ switch ($request) {
|
||||
$conf->aConfig = $config;
|
||||
$conf->saveConfig( "ENVIRONMENT_SETTINGS", "" );
|
||||
|
||||
G::auditLog("UpdateEnvironmentSettings", "UserNameDisplayFormat -> ".$_POST["userFormat"]." GlobalDateFormat -> ".$_POST["dateFormat"]." HideProcessInformation -> ".$_POST["hideProcessInf"]." DateFormat -> ".$_POST["casesListDateFormat"]." NumberOfRowsPerPage -> ".$_POST["casesListRowNumber"]." RefreshTimeSeconds -> ".$_POST["txtCasesRefreshTime"]);
|
||||
|
||||
$response = new stdclass();
|
||||
$response->success = true;
|
||||
$response->msg = G::LoadTranslation( "ID_SAVED_SUCCESSFULLY" );
|
||||
|
||||
@@ -30,10 +30,13 @@ switch ($request) {
|
||||
|
||||
$conf->saveConfig( 'ENVIRONMENT_SETTINGS', '' );
|
||||
|
||||
$lang = isset( $_REQUEST['lang'] ) ? $_REQUEST['lang'] : 'en';
|
||||
//remove from memcache when this value is updated/created
|
||||
$memcache->delete( 'flagForgotPassword' );
|
||||
|
||||
$response->success = true;
|
||||
G::auditLog("UpdateLoginSettings", "DefaultLanguage->".$lang." EnableForgotPassword->".$_REQUEST['forgotPasswd']);
|
||||
|
||||
echo G::json_encode( $response );
|
||||
|
||||
break;
|
||||
|
||||
@@ -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>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'];
|
||||
@@ -168,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));
|
||||
//}
|
||||
|
||||
@@ -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" ) );
|
||||
|
||||
|
||||
@@ -12,11 +12,13 @@ switch ($_GET['action']) {
|
||||
$oServerConf->setHeartbeatProperty( 'HB_OPTION', 1, 'HEART_BEAT_CONF' );
|
||||
$oServerConf->unsetHeartbeatProperty( 'HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF' );
|
||||
$response->enable = true;
|
||||
G::auditLog("EnableHeartBeat");
|
||||
} else {
|
||||
$oServerConf->setHeartbeatProperty( 'HB_OPTION', 0, 'HEART_BEAT_CONF' );
|
||||
$oServerConf->unsetHeartbeatProperty( 'HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF' );
|
||||
$oServerConf->setHeartbeatProperty( 'HB_BEAT_TYPE', 'endbeat', 'HEART_BEAT_CONF' );
|
||||
$response->enable = false;
|
||||
G::auditLog("DisableHeartBeat");
|
||||
}
|
||||
$response->success = true;
|
||||
|
||||
|
||||
@@ -34,4 +34,4 @@ CREATE TABLE `APP_CACHE_VIEW`
|
||||
PRIMARY KEY (`APP_UID`,`DEL_INDEX`),
|
||||
KEY `indexAppNumber`(`APP_NUMBER`),
|
||||
KEY `indexAppUser`(`USR_UID`, `APP_STATUS`)
|
||||
)ENGINE=MyISAM DEFAULT CHARSET='utf8' COMMENT='Application cache view';
|
||||
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Application cache view';
|
||||
|
||||
@@ -170,6 +170,7 @@ function newSkin ($baseSkin = 'classic')
|
||||
file_put_contents( $configFileFinal, $xmlConfiguration );
|
||||
$response['success'] = true;
|
||||
$response['message'] = G::LoadTranslation( 'ID_SKIN_SUCCESS_CREATE' );
|
||||
G::auditLog("CreateSkin", "Skin Name: ".$skinName);
|
||||
print_r( G::json_encode( $response ) );
|
||||
} catch (Exception $e) {
|
||||
$response['success'] = false;
|
||||
@@ -285,6 +286,7 @@ function importSkin ()
|
||||
|
||||
$response['success'] = true;
|
||||
$response['message'] = G::LoadTranslation( 'ID_SKIN_SUCCESSFUL_IMPORTED' );
|
||||
G::auditLog("ImportSkin", "Skin Name: ".$skinName);
|
||||
print_r( G::json_encode( $response ) );
|
||||
} catch (Exception $e) {
|
||||
$response['success'] = false;
|
||||
@@ -329,7 +331,7 @@ function exportSkin ($skinToExport = "")
|
||||
|
||||
$response['success'] = true;
|
||||
$response['message'] = $skinTar;
|
||||
|
||||
G::auditLog("ExportSkin", "Skin Name: ".$skinName);
|
||||
print_r( G::json_encode( $response ) );
|
||||
} catch (Exception $e) {
|
||||
$response['success'] = false;
|
||||
@@ -355,6 +357,7 @@ function deleteSkin ()
|
||||
G::rm_dir( PATH_CUSTOM_SKINS . $folderId );
|
||||
$response['success'] = true;
|
||||
$response['message'] = "$folderId deleted";
|
||||
G::auditLog("DeleteSkin", "Skin Name: ".$folderId);
|
||||
} catch (Exception $e) {
|
||||
$response['success'] = false;
|
||||
$response['error'] = $response['message'] = $e->getMessage();
|
||||
|
||||
@@ -187,6 +187,7 @@ switch ($_POST['action']) {
|
||||
require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$oUser->create($aData);
|
||||
G::auditLog("CreateUser", "User Name: ". $aData['USR_USERNAME']);
|
||||
|
||||
if ($_FILES['USR_PHOTO']['error'] != 1) {
|
||||
//print (PATH_IMAGES_ENVIRONMENT_USERS);
|
||||
@@ -363,6 +364,7 @@ switch ($_POST['action']) {
|
||||
require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$oUser->update($aData);
|
||||
G::auditLog("UpdateUser", "User Name: ". $aData['USR_USERNAME']." User ID: (".$aData['USR_UID'].") ");
|
||||
if ($_FILES['USR_PHOTO']['error'] != 1) {
|
||||
if ($_FILES['USR_PHOTO']['tmp_name'] != '') {
|
||||
$aAux = explode('.', $_FILES['USR_PHOTO']['name']);
|
||||
|
||||
@@ -201,6 +201,7 @@ try {
|
||||
$oUser = new Users();
|
||||
$aFields = $oUser->load($UID);
|
||||
$aFields['USR_STATUS'] = 'CLOSED';
|
||||
$userName = $aFields['USR_USERNAME'];
|
||||
$aFields['USR_USERNAME'] = '';
|
||||
$oUser->update($aFields);
|
||||
|
||||
@@ -216,8 +217,8 @@ try {
|
||||
|
||||
$criteria->add(ProcessUserPeer::USR_UID, $UID, Criteria::EQUAL);
|
||||
$criteria->add(ProcessUserPeer::PU_TYPE, "SUPERVISOR", Criteria::EQUAL);
|
||||
|
||||
ProcessUserPeer::doDelete($criteria);
|
||||
G::auditLog("DeleteUser", "User Name: ". $userName." User ID: (".$UID.") ");
|
||||
break;
|
||||
case 'changeUserStatus':
|
||||
$response = new stdclass();
|
||||
@@ -228,6 +229,9 @@ try {
|
||||
$userData = $userInstance->load($_REQUEST['USR_UID']);
|
||||
$userData['USR_STATUS'] = $_REQUEST['NEW_USR_STATUS'];
|
||||
$userInstance->update($userData);
|
||||
|
||||
$msg = $_REQUEST['NEW_USR_STATUS'] == 'ACTIVE'? "EnableUser" : "DisableUser";
|
||||
G::auditLog($msg, "User Name: ".$userData['USR_USERNAME']." User ID: (".$userData['USR_UID'].") ");
|
||||
$response->status = 'OK';
|
||||
} else {
|
||||
$response->status = 'ERROR';
|
||||
@@ -353,6 +357,7 @@ try {
|
||||
}
|
||||
$aData['USR_AUTH_USER_DN'] = $auth_dn;
|
||||
$RBAC->updateUser($aData);
|
||||
G::auditLog("AssignAuthenticationSource", "User Name: ".$aData['USR_USERNAME'].' User ID: ('.$aData['USR_UID'].') assign to '.$aData['USR_AUTH_TYPE']);
|
||||
echo '{success: true}';
|
||||
break;
|
||||
case 'usersList':
|
||||
|
||||
Reference in New Issue
Block a user