Merge remote branch 'upstream/master' into PM-2654

This commit is contained in:
dheeyi
2015-05-22 15:29:43 -04:00
12 changed files with 71 additions and 13 deletions

View File

@@ -5353,12 +5353,14 @@ class G
$sflagAudit = $oServerConf->getAuditLogProperty( 'AL_OPTION', $workspace ); $sflagAudit = $oServerConf->getAuditLogProperty( 'AL_OPTION', $workspace );
$ipClient = G::getIpAddress(); $ipClient = G::getIpAddress();
/*----------------------------------********---------------------------------*/
$licensedFeatures = PMLicensedFeatures::getSingleton(); $licensedFeatures = PMLicensedFeatures::getSingleton();
if ($sflagAudit && $licensedFeatures->verifyfeature('vtSeHNhT0JnSmo1bTluUVlTYUxUbUFSVStEeXVqc1pEUG5EeXc0MGd2Q3ErYz0=')) { if ($sflagAudit && $licensedFeatures->verifyfeature('vtSeHNhT0JnSmo1bTluUVlTYUxUbUFSVStEeXVqc1pEUG5EeXc0MGd2Q3ErYz0=')) {
$username = isset($_SESSION['USER_LOGGED']) && $_SESSION['USER_LOGGED'] != '' ? $_SESSION['USER_LOGGED'] : 'Unknow User'; $username = isset($_SESSION['USER_LOGGED']) && $_SESSION['USER_LOGGED'] != '' ? $_SESSION['USER_LOGGED'] : 'Unknow User';
$fullname = isset($_SESSION['USR_FULLNAME']) && $_SESSION['USR_FULLNAME'] != '' ? $_SESSION['USR_FULLNAME'] : '-'; $fullname = isset($_SESSION['USR_FULLNAME']) && $_SESSION['USR_FULLNAME'] != '' ? $_SESSION['USR_FULLNAME'] : '-';
G::log("|". $workspace ."|". $ipClient ."|". $username . "|" . $fullname ."|" . $actionToLog . "|" . $valueToLog, PATH_DATA, "audit.log"); G::log("|". $workspace ."|". $ipClient ."|". $username . "|" . $fullname ."|" . $actionToLog . "|" . $valueToLog, PATH_DATA, "audit.log");
} }
/*----------------------------------********---------------------------------*/
} }
/** /**

View File

@@ -450,5 +450,14 @@ class CalendarDefinition extends BaseCalendarDefinition
$oDataset->next(); $oDataset->next();
return $oDataset->getRow(); return $oDataset->getRow();
} }
public function calendarName ($calendarUid)
{
$tr = CalendarDefinitionPeer::retrieveByPK( $calendarUid );
if ((is_object( $tr ) && get_class( $tr ) == 'CalendarDefinition')) {
return $tr->getCalendarName();
}
return false;
}
} }

View File

@@ -287,10 +287,21 @@ class Users extends BaseUsers
$arrayData["birthday"] = $aFields["USR_BIRTHDAY"]; $arrayData["birthday"] = $aFields["USR_BIRTHDAY"];
$arrayData["position"] = $aFields["USR_POSITION"]; $arrayData["position"] = $aFields["USR_POSITION"];
$arrayData["replacedby"] = $aFields["USR_REPLACED_BY"]; $arrayData["replacedby"] = $aFields["USR_REPLACED_BY"];
if(strlen($arrayData["replacedby"] != 0)){
$oUser = UsersPeer::retrieveByPK( $arrayData["replacedby"] );
$arrayData["replacedbyfullname"] = $oUser->getUsrFirstname() . ' ' . $oUser->getUsrLastname();
}
$arrayData["duedate"] = $aFields["USR_DUE_DATE"]; $arrayData["duedate"] = $aFields["USR_DUE_DATE"];
$arrayData["calendar"] = $aFields["USR_CALENDAR"]; $arrayData["calendar"] = $aFields["USR_CALENDAR"];
if(strlen($aFields["USR_CALENDAR"] != 0)){
$arrayData["calendarname"] = $calendar->calendarName( $aFields["USR_CALENDAR"] );
}
$arrayData["status"] = $aFields["USR_STATUS"]; $arrayData["status"] = $aFields["USR_STATUS"];
$arrayData["department"] = $aFields["DEP_UID"]; $arrayData["department"] = $aFields["DEP_UID"];
if (strlen($arrayData["department"]) != 0) {
$oDepart = DepartmentPeer::retrieveByPk( $arrayData["department"] );
$arrayData["departmentname"] = $oDepart->getDepTitle();
}
$arrayData["reportsto"] = $aFields["USR_REPORTS_TO"]; $arrayData["reportsto"] = $aFields["USR_REPORTS_TO"];
$arrayData["userexperience"] = $aFields["USR_UX"]; $arrayData["userexperience"] = $aFields["USR_UX"];
$arrayData["photo"] = $pathPhoto; $arrayData["photo"] = $pathPhoto;

View File

@@ -42,9 +42,15 @@ if ($access != 1) {
//$oProcessMap = new ProcessMap(); //$oProcessMap = new ProcessMap();
$uids = explode(',', $_POST['PRO_UIDS']); $uids = explode(',', $_POST['PRO_UIDS']);
try { try {
foreach ($uids as $uid) { foreach ($uids as $uid) {
//Add Audit Log
$oProcess = new Process();
$process=$oProcess->load($uid);
$nameProcess=$process['PRO_TITLE'];
G::auditLog("DeleteProcess", $nameProcess. ' ('.$uid.')' .' Deleted');
//$oProcessMap->deleteProcess($uid); //$oProcessMap->deleteProcess($uid);
ProcessMaker\Project\Workflow::removeIfExists($uid); ProcessMaker\Project\Workflow::removeIfExists($uid);
ProcessMaker\Project\Bpmn::removeIfExists($uid); ProcessMaker\Project\Bpmn::removeIfExists($uid);

View File

@@ -303,6 +303,13 @@ if ($action == "uploadFileNewProcess") {
//!data ouput //!data ouput
$result->sNewProUid = $sProUid; $result->sNewProUid = $sProUid;
$result->proFileName = $Fields['PRO_FILENAME']; $result->proFileName = $Fields['PRO_FILENAME'];
//Add Audit Log
$ogetProcess = new Process();
$getprocess=$ogetProcess->load($oData->process['PRO_UID']);
$nameProcess=$getprocess['PRO_TITLE'];
G::auditLog("ImportProcess", 'PM File Imported '.$nameProcess. ' ('.$oData->process['PRO_UID'].')');
} catch (Exception $e) { } catch (Exception $e) {
$result->response = $e->getMessage(); $result->response = $e->getMessage();
$result->catchMessage = $e->getMessage(); $result->catchMessage = $e->getMessage();

View File

@@ -150,7 +150,9 @@ $arrayAction = array(
"AssignUserTask" => G::LoadTranslation("ID_ASSIGN_USER_TASK"), "AssignUserTask" => G::LoadTranslation("ID_ASSIGN_USER_TASK"),
"AssignGroupTask" => G::LoadTranslation("ID_ASSIGN_GROUP_TASK"), "AssignGroupTask" => G::LoadTranslation("ID_ASSIGN_GROUP_TASK"),
"DeleteUserTask" => G::LoadTranslation("ID_DELETE_USER_TASK"), "DeleteUserTask" => G::LoadTranslation("ID_DELETE_USER_TASK"),
"DeleteGroupTask" => G::LoadTranslation("ID_DELETE_GROUP_TASK") "DeleteGroupTask" => G::LoadTranslation("ID_DELETE_GROUP_TASK"),
"ImportProcess" => G::LoadTranslation("ID_IMPORT_PROCESS"),
"DeleteProcess" => G::LoadTranslation("ID_DELETE_PROCESS")
); );
asort($arrayAction); asort($arrayAction);

View File

@@ -77,6 +77,12 @@ class BpmnWorkflow extends Project\Bpmn
$this->wp = new Project\Workflow(); $this->wp = new Project\Workflow();
$this->wp->create($wpData); $this->wp->create($wpData);
//Add Audit Log
$ogetProcess = new \Process();
$getprocess=$ogetProcess->load($this->getUid());
$nameProcess=$getprocess['PRO_TITLE'];
\G::auditLog("ImportProcess", 'PMX File Imported '.$nameProcess. ' ('.$this->getUid().')');
} catch (\Exception $e) { } catch (\Exception $e) {
$prjUid = $this->getUid(); $prjUid = $this->getUid();
//$this->remove(); //$this->remove();

View File

@@ -64,6 +64,13 @@ class WorkflowBpmn extends Project\Workflow
// At this time we will add a default diagram and process // At this time we will add a default diagram and process
$this->bp->addDiagram(); $this->bp->addDiagram();
$this->bp->addProcess(); $this->bp->addProcess();
//Add Audit Log
$ogetProcess = new \Process();
$getprocess=$ogetProcess->load($this->getUid());
$nameProcess=$getprocess['PRO_TITLE'];
\G::auditLog("ImportProcess", 'BPMN Imported '.$nameProcess. ' ('.$this->getUid().')');
} catch (\Exception $e) { } catch (\Exception $e) {
$prjUid = $this->getUid(); $prjUid = $this->getUid();
$this->remove(); $this->remove();

View File

@@ -111,7 +111,7 @@ class Project extends Api
$outputDir = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP; $outputDir = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP;
$version = \ProcessMaker\Util\Common::getLastVersion($outputDir . $exporter->getProjectName() . "-*.pmx") + 1; $version = \ProcessMaker\Util\Common::getLastVersion($outputDir . $exporter->getProjectName() . "-*.pmx") + 1;
$outputFilename = $outputDir . sprintf("%s-%s.%s", $exporter->getProjectName(), $version, "pmx"); $outputFilename = $outputDir . sprintf("%s-%s.%s", str_replace(" ", "_", $exporter->getProjectName()), $version, "pmx");
$exporter->setMetadata("export_version", $version); $exporter->setMetadata("export_version", $version);
$exporter->saveExport($outputFilename); $exporter->saveExport($outputFilename);

View File

@@ -64,6 +64,7 @@ class System extends Api
{ {
try { try {
$enabledFeatures = array(); $enabledFeatures = array();
/*----------------------------------********---------------------------------*/
$keys = array ('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0='); $keys = array ('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=');
foreach ($keys as $key) { foreach ($keys as $key) {
if (\PMLicensedFeatures if (\PMLicensedFeatures
@@ -72,6 +73,7 @@ class System extends Api
$enabledFeatures[] = $key; $enabledFeatures[] = $key;
} }
} }
/*----------------------------------********---------------------------------*/
return $enabledFeatures; return $enabledFeatures;
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));

View File

@@ -190,8 +190,14 @@ class PmPdo implements \OAuth2\Storage\AuthorizationCodeInterface,
/* OAuth2_Storage_UserCredentialsInterface */ /* OAuth2_Storage_UserCredentialsInterface */
public function checkUserCredentials($username, $password) public function checkUserCredentials($username, $password)
{ {
if ($user = $this->getUser($username)) { $RBAC = \RBAC::getSingleton();
return $this->checkPassword($user, $password); $RBAC->initRBAC();
$uid = $RBAC->VerifyLogin($username , $password);
if($uid < 0){
return false;
}
if($uid != ''){
return true;
} }
return false; return false;
} }

View File

@@ -5,7 +5,7 @@
<rules> <rules>
<rule name="ProcessMaker Rule" stopProcessing="true"> <rule name="ProcessMaker Rule" stopProcessing="true">
<match url="^.*/(.*)$" ignoreCase="true" /> <match url="^.*/(.*)$" ignoreCase="true" />
<action type="Rewrite" url="sysGeneric.php" /> <action type="Rewrite" url="app.php" />
</rule> </rule>
</rules> </rules>
</rewrite> </rewrite>