Merge branch 'master' of bitbucket.org:marcoAntonioNina/processmaker into dashboards2

This commit is contained in:
Marco Antonio Nina Mena
2015-04-13 16:28:21 -04:00
45 changed files with 647 additions and 151 deletions

View File

@@ -2868,4 +2868,30 @@ function PMFRemoveMask ($field, $separator = '.', $currency = '')
$field = floatval(trim($field));
return $field;
}
/**
*@method
*
* Sends an array of case variables to a specified case.
*
* @name PMFSaveCurrentData
* @label PMF Save Current Data
*
* @return int | $result | Result of send variables | Returns 1 if the variables were sent successfully to the case; otherwise, returns 0 if an error occurred.
*
*/
function PMFSaveCurrentData ()
{
global $oPMScript;
$result = 0;
if (isset($_SESSION['APPLICATION']) && isset($oPMScript->aFields)) {
G::LoadClass( 'wsBase' );
$ws = new wsBase();
$result = $ws->sendVariables( $_SESSION['APPLICATION'], $oPMScript->aFields );
}
return $result;
}

View File

@@ -1012,9 +1012,11 @@ class wsBase
*
* @param string $caseId
* @param string $iDelIndex
* @param bool $flagUseDelIndex
*
* @return $result will return an object
*/
public function getCaseInfo ($caseId, $iDelIndex)
public function getCaseInfo($caseId, $iDelIndex, $flagUseDelIndex = false)
{
try {
$oCase = new Cases();
@@ -1057,8 +1059,15 @@ class wsBase
$oCriteria->addSelectColumn( AppDelegationPeer::DEL_THREAD );
$oCriteria->addSelectColumn( AppDelegationPeer::DEL_THREAD_STATUS );
$oCriteria->addSelectColumn( AppDelegationPeer::DEL_FINISH_DATE );
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE);
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE);
$oCriteria->add( AppDelegationPeer::APP_UID, $caseId );
$oCriteria->add( AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL );
if ($flagUseDelIndex) {
$oCriteria->add(AppDelegationPeer::DEL_INDEX, $iDelIndex, Criteria::EQUAL);
} else {
$oCriteria->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL);
}
$oCriteria->addAscendingOrderByColumn( AppDelegationPeer::DEL_INDEX );
$oDataset = AppDelegationPeer::doSelectRS( $oCriteria );
@@ -1096,6 +1105,8 @@ class wsBase
$currentUser->delIndex = $aAppDel['DEL_INDEX'];
$currentUser->delThread = $aAppDel['DEL_THREAD'];
$currentUser->delThreadStatus = $aAppDel['DEL_THREAD_STATUS'];
$currentUser->delInitDate = $aAppDel["DEL_INIT_DATE"];
$currentUser->delTaskDueDate = $aAppDel["DEL_TASK_DUE_DATE"];
$aCurrentUsers[] = $currentUser;
}

View File

@@ -431,40 +431,51 @@ class Cases
throw (new \Exception($arrayData));
}
} else {
\G::LoadClass("wsBase");
//Verify data
$this->throwExceptionIfNotExistsCase($applicationUid, $this->getFieldNameByFormatFieldName("APP_UID"));
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\AppCacheViewPeer::DEL_INDEX);
$criteria->add(\AppCacheViewPeer::USR_UID, $userUid);
$criteria->add(\AppCacheViewPeer::APP_UID, $applicationUid);
$criteria->add(
//ToDo - getToDo()
$criteria->getNewCriterion(\AppCacheViewPeer::APP_STATUS, "TO_DO", \CRITERIA::EQUAL)->addAnd(
$criteria->getNewCriterion(\AppCacheViewPeer::DEL_FINISH_DATE, null, \Criteria::ISNULL))->addAnd(
$criteria->getNewCriterion(\AppCacheViewPeer::APP_THREAD_STATUS, "OPEN"))->addAnd(
$criteria->getNewCriterion(\AppCacheViewPeer::DEL_THREAD_STATUS, "OPEN"))
)->addOr(
//Draft - getDraft()
$criteria->getNewCriterion(\AppCacheViewPeer::APP_STATUS, "DRAFT", \CRITERIA::EQUAL)->addAnd(
$criteria->getNewCriterion(\AppCacheViewPeer::APP_THREAD_STATUS, "OPEN"))->addAnd(
$criteria->getNewCriterion(\AppCacheViewPeer::DEL_THREAD_STATUS, "OPEN"))
);
$criteria->addDescendingOrderByColumn(\AppCacheViewPeer::APP_NUMBER);
$rsCriteria = \AppCacheViewPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$row["DEL_INDEX"] = '';
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$criteria->addSelectColumn(\AppDelegationPeer::APP_UID);
$criteria->add(\AppDelegationPeer::APP_UID, $applicationUid);
$criteria->add(\AppDelegationPeer::USR_UID, $userUid);
$rsCriteria = \AppDelegationPeer::doSelectRS($criteria);
if (!$rsCriteria->next()) {
throw new \Exception(\G::LoadTranslation("ID_NO_PERMISSION_NO_PARTICIPATED"));
}
\G::LoadClass('wsBase');
//Get data
$arrayStatusInfo = $this->getStatusInfo($applicationUid);
$applicationStatus = "";
$delIndex = 0;
$flagUseDelIndex = false;
if (count($arrayStatusInfo) > 0) {
$applicationStatus = $arrayStatusInfo["APP_STATUS"];
$delIndex = $arrayStatusInfo["DEL_INDEX"];
if (in_array($applicationStatus, array("DRAFT", "PAUSED", "CANCELLED"))) {
$flagUseDelIndex = true;
}
}
$ws = new \wsBase();
$fields = $ws->getCaseInfo($applicationUid, $row["DEL_INDEX"]);
$fields = $ws->getCaseInfo($applicationUid, $delIndex, $flagUseDelIndex);
$array = json_decode(json_encode($fields), true);
if ($array ["status_code"] != 0) {
throw (new \Exception($array ["message"]));
} else {
$array['app_uid'] = $array['caseId'];
$array['app_number'] = $array['caseNumber'];
$array['app_name'] = $array['caseName'];
$array['app_status'] = $array['caseStatus'];
$array["app_status"] = ($applicationStatus != "")? $applicationStatus : $array["caseStatus"];
$array['app_init_usr_uid'] = $array['caseCreatorUser'];
$array['app_init_usr_username'] = trim($array['caseCreatorUserName']);
$array['pro_uid'] = $array['processId'];
@@ -472,6 +483,9 @@ class Cases
$array['app_create_date'] = $array['createDate'];
$array['app_update_date'] = $array['updateDate'];
$array['current_task'] = $array['currentUsers'];
$aCurrent_task = array();
for ($i = 0; $i<=count($array['current_task'])-1; $i++) {
$current_task = $array['current_task'][$i];
$current_task['usr_uid'] = $current_task['userId'];
@@ -481,6 +495,8 @@ class Cases
$current_task['del_index'] = $current_task['delIndex'];
$current_task['del_thread'] = $current_task['delThread'];
$current_task['del_thread_status'] = $current_task['delThreadStatus'];
$current_task["del_init_date"] = $current_task["delInitDate"] . "";
$current_task["del_task_due_date"] = $current_task["delTaskDueDate"];
unset($current_task['userId']);
unset($current_task['userName']);
unset($current_task['taskId']);
@@ -551,6 +567,8 @@ class Cases
$del = \DBAdapter::getStringDelimiter();
$oCriteria->addSelectColumn( \AppDelegationPeer::DEL_INDEX );
$oCriteria->addSelectColumn( \AppDelegationPeer::TAS_UID );
$oCriteria->addSelectColumn(\AppDelegationPeer::DEL_INIT_DATE);
$oCriteria->addSelectColumn(\AppDelegationPeer::DEL_TASK_DUE_DATE);
$oCriteria->addAsColumn( 'TAS_TITLE', 'C1.CON_VALUE' );
$oCriteria->addAlias( "C1", 'CONTENT' );
$tasTitleConds = array ();
@@ -568,7 +586,9 @@ class Cases
while ($aRow = $oDataset->getRow()) {
$result = array ('tas_uid' => $aRow['TAS_UID'],
'tas_title' => $aRow['TAS_TITLE'],
'del_index' => $aRow['DEL_INDEX']);
'del_index' => $aRow['DEL_INDEX'],
"del_init_date" => $aRow["DEL_INIT_DATE"] . "",
"del_task_due_date" => $aRow["DEL_TASK_DUE_DATE"]);
$oDataset->next();
}
//Return
@@ -811,6 +831,12 @@ class Cases
}
Validator::isInteger($del_index, '$del_index');
$oDelay = new \AppDelay();
if (!$oDelay->isPaused($app_uid, $del_index)) {
throw (new \Exception(\G::LoadTranslation("ID_CASE_NOT_PAUSED", array($app_uid))));
}
$case = new \Cases();
$case->unpauseCase( $app_uid, $del_index, $usr_uid );
}
@@ -2205,5 +2231,108 @@ class Cases
throw $e;
}
}
/**
* Get status info Case
*
* @param string $applicationUid Unique id of Case
*
* return array Return an array with status info Case, array empty otherwise
*/
public function getStatusInfo($applicationUid)
{
try {
//Verify data
$this->throwExceptionIfNotExistsCase($applicationUid, $this->getFieldNameByFormatFieldName("APP_UID"));
//Get data
//Status is PAUSED
$delimiter = \DBAdapter::getStringDelimiter();
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn($delimiter . "PAUSED" . $delimiter . " AS APP_STATUS");
$criteria->addSelectColumn(\AppDelayPeer::APP_DEL_INDEX . " AS DEL_INDEX");
$criteria->add(\AppDelayPeer::APP_UID, $applicationUid, \Criteria::EQUAL);
$criteria->add(\AppDelayPeer::APP_TYPE, "PAUSE", \Criteria::EQUAL);
$criteria->add(
$criteria->getNewCriterion(\AppDelayPeer::APP_DISABLE_ACTION_USER, null, \Criteria::ISNULL)->addOr(
$criteria->getNewCriterion(\AppDelayPeer::APP_DISABLE_ACTION_USER, 0, \Criteria::EQUAL))
);
$rsCriteria = \AppDelayPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
if ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
//Return
return array("APP_STATUS" => $row["APP_STATUS"], "DEL_INDEX" => $row["DEL_INDEX"]);
}
//Status is TO_DO, DRAFT
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\ApplicationPeer::APP_STATUS);
$criteria->addSelectColumn(\AppDelegationPeer::DEL_INDEX);
$arrayCondition = array();
$arrayCondition[] = array(\ApplicationPeer::APP_UID, \AppDelegationPeer::APP_UID, \Criteria::EQUAL);
$arrayCondition[] = array(\ApplicationPeer::APP_UID, \AppThreadPeer::APP_UID, \Criteria::EQUAL);
$arrayCondition[] = array(\ApplicationPeer::APP_UID, $delimiter . $applicationUid . $delimiter, \Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
$criteria->add(
$criteria->getNewCriterion(\ApplicationPeer::APP_STATUS, "TO_DO", \Criteria::EQUAL)->addAnd(
$criteria->getNewCriterion(\AppDelegationPeer::DEL_FINISH_DATE, null, \Criteria::ISNULL))->addAnd(
$criteria->getNewCriterion(\AppDelegationPeer::DEL_THREAD_STATUS, "OPEN"))->addAnd(
$criteria->getNewCriterion(\AppThreadPeer::APP_THREAD_STATUS, "OPEN"))
)->addOr(
$criteria->getNewCriterion(\ApplicationPeer::APP_STATUS, "DRAFT", \Criteria::EQUAL)->addAnd(
$criteria->getNewCriterion(\AppDelegationPeer::DEL_THREAD_STATUS, "OPEN"))->addAnd(
$criteria->getNewCriterion(\AppThreadPeer::APP_THREAD_STATUS, "OPEN"))
);
$rsCriteria = \ApplicationPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
if ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
//Return
return array("APP_STATUS" => $row["APP_STATUS"], "DEL_INDEX" => $row["DEL_INDEX"]);
}
//Status is CANCELLED, COMPLETED
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\ApplicationPeer::APP_STATUS);
$criteria->addSelectColumn(\AppDelegationPeer::DEL_INDEX);
$arrayCondition = array();
$arrayCondition[] = array(\ApplicationPeer::APP_UID, \AppDelegationPeer::APP_UID, \Criteria::EQUAL);
$arrayCondition[] = array(\ApplicationPeer::APP_UID, $delimiter . $applicationUid . $delimiter, \Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
$criteria->add(\ApplicationPeer::APP_STATUS, array("CANCELLED", "COMPLETED"), \Criteria::IN);
$criteria->add(\AppDelegationPeer::DEL_LAST_INDEX, 1, \Criteria::EQUAL);
$rsCriteria = \ApplicationPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
if ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
//Return
return array("APP_STATUS" => $row["APP_STATUS"], "DEL_INDEX" => $row["DEL_INDEX"]);
}
//Return
return array();
} catch (\Exception $e) {
throw $e;
}
}
}

View File

@@ -24,7 +24,6 @@ class User
"USR_STATUS" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array("ACTIVE", "INACTIVE", "VACATION"), "fieldNameAux" => "usrStatus"),
"USR_ROLE" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "usrRole"),
"USR_NEW_PASS" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "usrNewPass"),
"USR_CNF_PASS" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "usrCnfPass"),
"USR_UX" => array("type" => "string", "required" => false, "empty" => false, "defaultValues" => array("NORMAL", "SIMPLIFIED", "SWITCHABLE", "SINGLE"), "fieldNameAux" => "usrUx"),
"DEP_UID" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "depUid"),
"USR_BIRTHDAY" => array("type" => "date", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "usrBirthday"),
@@ -216,14 +215,6 @@ class User
if (isset($arrayData["USR_NEW_PASS"])) {
$this->throwExceptionIfPasswordIsInvalid($arrayData["USR_NEW_PASS"], $this->arrayFieldNameForException["usrNewPass"]);
if (!isset($arrayData["USR_CNF_PASS"])) {
throw new \Exception(\G::LoadTranslation("ID_UNDEFINED_VALUE_IS_REQUIRED", array($this->arrayFieldNameForException["usrCnfPass"])));
}
if ($arrayData["USR_NEW_PASS"] != $arrayData["USR_CNF_PASS"]) {
throw new \Exception($this->arrayFieldNameForException["usrNewPass"] . ", " . $this->arrayFieldNameForException["usrCnfPass"] . ": " . \G::LoadTranslation("ID_NEW_PASS_SAME_OLD_PASS"));
}
}
if (isset($arrayData["USR_REPLACED_BY"]) && $arrayData["USR_REPLACED_BY"] != "") {
@@ -609,13 +600,13 @@ class User
$userProperty = new \UsersProperties();
$aUserProperty = $userProperty->loadOrCreateIfNotExists($userUid, array("USR_PASSWORD_HISTORY" => serialize(array(\Bootstrap::hashPassword($arrayData["USR_PASSWORD"])))));
//$memKey = "rbacSession" . session_id();
//$memcache = & \PMmemcached::getSingleton(defined("SYS_SYS")? SYS_SYS : "");
//
//if (($rbac->aUserInfo = $memcache->get($memKey)) == false) {
// $rbac->loadUserRolePermission("PROCESSMAKER", $userUidLogged);
// $memcache->set($memKey, $rbac->aUserInfo, \PMmemcached::EIGHT_HOURS);
//}
$memKey = "rbacSession" . session_id();
$memcache = & \PMmemcached::getSingleton(defined("SYS_SYS")? SYS_SYS : "");
if (($rbac->aUserInfo = $memcache->get($memKey)) == false) {
$rbac->loadUserRolePermission("PROCESSMAKER", $userUidLogged);
$memcache->set($memKey, $rbac->aUserInfo, \PMmemcached::EIGHT_HOURS);
}
if ($rbac->aUserInfo["PROCESSMAKER"]["ROLE"]["ROL_CODE"] == "PROCESSMAKER_ADMIN") {
$aUserProperty["USR_LAST_UPDATE_DATE"] = date("Y-m-d H:i:s");
@@ -651,7 +642,7 @@ class User
$sDescription = $sDescription . " - " . G::LoadTranslation("PASSWORD_HISTORY") . ": " . PPP_PASSWORD_HISTORY . "\n";
$sDescription = $sDescription . "\n" . G::LoadTranslation("ID_PLEASE_CHANGE_PASSWORD_POLICY") . "";
throw new \Exception($this->arrayFieldNameForException["usrNewPass"] . ", " . $this->arrayFieldNameForException["usrCnfPass"] . ": " . $sDescription);
throw new \Exception($this->arrayFieldNameForException["usrNewPass"] . ": " . $sDescription);
}
if (count($aHistory) >= PPP_PASSWORD_HISTORY) {

View File

@@ -599,12 +599,12 @@ class Cases extends Api
public function doGetCaseInfo($app_uid)
{
try {
$userUid = $this->getUserId();
$cases = new \ProcessMaker\BusinessModel\Cases();
$oData = $cases->getCaseInfo($app_uid, $userUid);
return $oData;
$case = new \ProcessMaker\BusinessModel\Cases();
$case->setFormatFieldNameInUppercase(false);
return $case->getCaseInfo($app_uid, $this->getUserId());
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}

View File

@@ -75,8 +75,6 @@ class User extends Api
$userLoggedUid = $this->getUserId();
$user = new \ProcessMaker\BusinessModel\User();
$arrayData = $user->update($usr_uid, $request_data, $userLoggedUid);
$response = $arrayData;
return $response;
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
@@ -113,4 +111,3 @@ class User extends Api
}
}
}

View File

@@ -204,7 +204,7 @@ class Server implements iAuthenticate
$clientId = $_GET['client_id'];
$requestedScope = isset($_GET['scope']) ? $_GET['scope'] : '*';
$requestedScope = empty($requestedScope) ? array() : explode(' ', $requestedScope);
$client = $this->storage->getClientDetails($clientId);;
$client = $this->storage->getClientDetails($clientId);
if (empty($client)) {
// throw error, client does not exist.
@@ -309,7 +309,17 @@ class Server implements iAuthenticate
if ($returnResponse) {
return $response;
} else {
$response->send();
if ($response->getStatusCode() == 400) {
$msg = $response->getParameter("error_description", "");
$msg = ($msg != "")? $msg : $response->getParameter("error", "");
$rest = new \Maveriks\Extension\Restler();
$rest->setMessage(new \Luracast\Restler\RestException(\ProcessMaker\Services\Api::STAT_APP_EXCEPTION, $msg));
exit(0);
} else {
$response->send();
}
}
}

View File

@@ -3,10 +3,10 @@
<TITLE type="title">
<en><![CDATA[I forgot my password]]></en>
</TITLE>
<USR_USERNAME type="text" size="30" maxlength="50" required="true" validate="Any">
<USR_USERNAME type="text" size="30" maxlength="50" required="true" validate="Any" autocomplete="0">
<en><![CDATA[User]]></en>
</USR_USERNAME>
<USR_EMAIL type="text" size="30" required="true" maxlength="32">
<USR_EMAIL type="text" size="30" required="true" maxlength="32" autocomplete="0">
<en><![CDATA[Email]]></en>
</USR_EMAIL>
<URL type="hidden"/>

View File

@@ -6,6 +6,7 @@
<td valign='top'>
<input type="hidden" class="notValidateThisFields" name="__notValidateThisFields__" id="__notValidateThisFields__" value="{$form_objectRequiredFields}" />
<input type="hidden" name="DynaformRequiredFields" id="DynaformRequiredFields" value="{$form_objectRequiredFields}" />
<div style="display: none;"> {$form.USR_PASSWORD}</div>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td class='FormTitle' colspan="2" align="">{$form.TITLE}</td>
@@ -15,8 +16,8 @@
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.USR_USERNAME}</td>
</tr>
<tr>
<td class='FormLabel' width="{$form_labelWidth}">{$USR_PASSWORD}</td>
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.USR_PASSWORD}</td>
<td class='FormLabel' width="{$form_labelWidth}">{$USR_PASSWORD_MASK}</td>
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.USR_PASSWORD_MASK}</td>
</tr>
<tr>
<td class='FormLabel' width="{$form_labelWidth}">{$USER_LANG}</td>
@@ -37,12 +38,10 @@
</table>
</div>
<div class="boxBottom"><div class="a"></div><div class="b"></div><div class="c"></div></div>
</div>
<script type="text/javascript">
</div></form>
<script type="text/javascript">
{$form.JS}
</script>
</form>
<script type="text/javascript">
try {literal}{{/literal} dynaformSetFocus();}catch(e){literal}{{/literal}}
</script>
</script>

View File

@@ -3,19 +3,22 @@
<TITLE type="title">
<en><![CDATA[Login]]></en>
</TITLE>
<USR_USERNAME type="text" size="30" maxlength="50" validate="Any">
<USR_USERNAME type="text" size="30" maxlength="50" validate="Any" autocomplete="0">
<en><![CDATA[User]]></en>
</USR_USERNAME>
<USR_PASSWORD type="password" size="30" maxlength="32" autocomplete="0">
<USR_PASSWORD type="text" size="30" maxlength="32" autocomplete="0">
<en><![CDATA[Password]]></en>
</USR_PASSWORD>
<USR_PASSWORD_MASK type="password" size="30" maxlength="32" autocomplete="0">
<en><![CDATA[Password]]></en>
</USR_PASSWORD_MASK>
<USER_LANG type="dropdown" sqlconnection="dbarray">
SELECT LANG_ID, LANG_NAME FROM langOptions
<en><![CDATA[Language]]></en>
</USER_LANG>
<URL type="hidden"/>
<LOGIN_VERIFY_MSG type="private" showInTable="0"/>
<BSUBMIT type="submit">
<BSUBMIT type="button">
<en><![CDATA[Login]]></en>
</BSUBMIT>
<FORGOT_PASWORD_LINK type="link" link="forgotPassword" onclick="" colAlign="right" colWidth="135" style="display:none;">
@@ -84,14 +87,11 @@ var dynaformOnload = function() {
};
leimnud.event.add(document.getElementById('form[BSUBMIT]'), 'click', function() {
setNestedProperty(this, Array('disabled'), 'true');
setNestedProperty(this, Array('value'), @@LOGIN_VERIFY_MSG);
var client = getBrowserClient();
if (client.browser != "firefox") {
document.login.submit();
}
document.getElementById('form[USR_PASSWORD]').value = document.getElementById('form[USR_PASSWORD_MASK]').value;
document.getElementById('form[USR_PASSWORD_MASK]').value = '';
document.getElementById('form[USR_PASSWORD_MASK]').setAttribute('type', 'text');
document.login.submit();
//return true;
}.extend(document.getElementById('form[BSUBMIT]')));
]]></JS>

View File

@@ -3,20 +3,23 @@
<TITLE type="title">
<en><![CDATA[Login]]></en>
</TITLE>
<USR_USERNAME type="text" size="30" maxlength="50" validate="Any">
<USR_USERNAME type="text" size="30" maxlength="50" validate="Any" autocomplete="0">
<en><![CDATA[User]]></en>
</USR_USERNAME>
<USR_PASSWORD type="password" size="30" maxlength="32" autocomplete="0">
<USR_PASSWORD type="hidden" size="30" maxlength="32" autocomplete="0">
<en><![CDATA[Password]]></en>
</USR_PASSWORD>
<USER_ENV type="text" size="30" maxlength="50">
<USR_PASSWORD_MASK type="password" size="30" maxlength="32" autocomplete="0">
<en><![CDATA[Password]]></en>
</USR_PASSWORD_MASK>
<USER_ENV type="text" size="30" maxlength="50" autocomplete="0">
<en><![CDATA[Workspace]]></en>
</USER_ENV>
<USER_LANG type="dropdown" sqlconnection="dbarray">
SELECT LANG_ID, LANG_NAME FROM langOptions
<en><![CDATA[Language]]></en>
</USER_LANG>
<BSUBMIT type="submit">
<BSUBMIT type="button">
<en><![CDATA[Login]]></en>
</BSUBMIT>
<JS type="javascript"><![CDATA[
@@ -28,10 +31,17 @@ leimnud.event.add(document.getElementById('form[BSUBMIT]'), 'click', function()
ws = getField('USER_ENV').value;
createCookie('pmos_generik2', '{"ws":"'+ws+'"}', 365);
/*
var client = getBrowserClient();
if (client.browser == "msie" || client.browser == "safari"){
document.sysLogin.submit();
}
*/
document.getElementById('form[USR_PASSWORD]').value = document.getElementById('form[USR_PASSWORD_MASK]').value;
document.getElementById('form[USR_PASSWORD_MASK]').value = '';
document.getElementById('form[USR_PASSWORD_MASK]').setAttribute('type', 'text');
document.sysLogin.submit();
}.extend(document.getElementById('form[BSUBMIT]')));
try{

View File

@@ -266,6 +266,10 @@
G::LoadSystem('headPublisher');
$oHeadPublisher =& headPublisher::getSingleton();
//Load filter class
G::LoadSystem('inputfilter');
$filter = new InputFilter();
// Installer, redirect to install if we don't have a valid shared data folder
if ( !defined('PATH_DATA') || !file_exists(PATH_DATA)) {
@@ -314,7 +318,8 @@
if ( defined('SYS_TEMP') && SYS_TEMP != '') {
//this is the default, the workspace db.php file is in /shared/workflow/sites/SYS_SYS
if ( file_exists( PATH_DB . SYS_TEMP . '/db.php' ) ) {
require_once( PATH_DB . SYS_TEMP . '/db.php' );
$pathFile = $filter->validateInput(PATH_DB . SYS_TEMP . '/db.php','path');
require_once( $pathFile );
define ( 'SYS_SYS' , SYS_TEMP );
// defining constant for workspace shared directory
@@ -331,17 +336,21 @@
else { //when we are in global pages, outside any valid workspace
if (SYS_TARGET==='newSite') {
$phpFile = G::ExpandPath('methods') . SYS_COLLECTION . "/" . SYS_TARGET.'.php';
$phpFile = $filter->validateInput($phpFile,'path');
require_once($phpFile);
die();
}
else {
if(SYS_TARGET=="dbInfo"){ //Show dbInfo when no SYS_SYS
require_once( PATH_METHODS . "login/dbInfo.php" );
$pathFile = PATH_METHODS . "login/dbInfo.php";
$pathFile = $filter->validateInput($pathFile,'path');
require_once($pathFile);
}
else{
if (substr(SYS_SKIN, 0, 2) === 'ux' && SYS_TARGET != 'sysLoginVerify') { // new ux sysLogin - extjs based form
require_once PATH_CONTROLLERS . 'main.php';
$pathFile = $filter->validateInput(PATH_CONTROLLERS . 'main.php','path');
require_once $pathFile;
$controllerClass = 'Main';
$controllerAction = SYS_TARGET == 'sysLoginVerify' ? SYS_TARGET : 'sysLogin';
//if the method exists
@@ -352,7 +361,9 @@
}
}
else { // classic sysLogin interface
require_once( PATH_METHODS . "login/sysLogin.php" ) ;
$pathFile = PATH_METHODS . "login/sysLogin.php";
$pathFile = $filter->validateInput($pathFile,'path');
require_once($pathFile) ;
die();
}
}
@@ -543,7 +554,8 @@
//erik: verify if it is a Controller Class or httpProxyController Class
if (is_file(PATH_CONTROLLERS . SYS_COLLECTION . '.php')) {
require_once PATH_CONTROLLERS . SYS_COLLECTION . '.php';
$pathFile = $filter->validateInput(PATH_CONTROLLERS . SYS_COLLECTION . '.php','path');
require_once $pathFile;
$controllerClass = SYS_COLLECTION;
//if the method name is empty set default to index method
$controllerAction = SYS_TARGET != '' ? SYS_TARGET : 'index';

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -340,6 +340,9 @@ Bootstrap::LoadThirdParty("smarty/libs", "Smarty.class");
//Loading the autoloader libraries feature
Bootstrap::registerSystemClasses();
//Load filter class
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$skinPathErrors = G::skinGetPathToSrcByVirtualUri("errors", $config);
$skinPathUpdate = G::skinGetPathToSrcByVirtualUri("update", $config);
@@ -485,8 +488,9 @@ if (defined( 'PATH_DATA' ) && file_exists( PATH_DATA )) {
Bootstrap::LoadClass( 'serverConfiguration' );
$oServerConf = & serverConf::getSingleton();
}
require_once PATH_THIRDPARTY . '/pear/PEAR.php';
$pathFile = PATH_THIRDPARTY . '/pear/PEAR.php';
$pathFile = $filter->validateInput($pathFile,'path');
require_once $pathFile;
//Bootstrap::LoadSystem( 'pmException' );
@@ -500,7 +504,9 @@ if (! defined( 'PATH_DATA' ) || ! file_exists( PATH_DATA )) {
define( 'PATH_DATA', PATH_C );
//NewRelic Snippet - By JHL
transactionLog(PATH_CONTROLLERS.'installer.php');
require_once (PATH_CONTROLLERS . 'installer.php');
$pathFile = PATH_CONTROLLERS . 'installer.php';
$pathFile = $filter->validateInput($pathFile,'path');
require_once ($pathFile);
$controller = 'Installer';
// if the method name is empty set default to index method
@@ -544,8 +550,10 @@ if ($oServerConf->isWSDisabled( SYS_TEMP )) {
// if SYS_TEMP exists, the URL has a workspace, now we need to verify if exists their db.php file
if (defined( 'SYS_TEMP' ) && SYS_TEMP != '') {
//this is the default, the workspace db.php file is in /shared/workflow/sites/SYS_SYS
if (file_exists( PATH_DB . SYS_TEMP . '/db.php' )) {
require_once (PATH_DB . SYS_TEMP . '/db.php');
$pathFile = PATH_DB . SYS_TEMP . '/db.php';
$pathFile = $filter->validateInput($pathFile,'path');
if (file_exists( $pathFile )) {
require_once ($pathFile);
define( 'SYS_SYS', SYS_TEMP );
// defining constant for workspace shared directory
@@ -564,17 +572,21 @@ if (defined( 'SYS_TEMP' ) && SYS_TEMP != '') {
} else { //when we are in global pages, outside any valid workspace
if (SYS_TARGET === 'newSite') {
$phpFile = G::ExpandPath( 'methods' ) . SYS_COLLECTION . "/" . SYS_TARGET . '.php';
$phpFile = $filter->validateInput($phpFile,'path');
//NewRelic Snippet - By JHL
transactionLog($phpFile);
require_once ($phpFile);
die();
} else {
if (SYS_TARGET == "dbInfo") { //Show dbInfo when no SYS_SYS
require_once (PATH_METHODS . "login/dbInfo.php");
$pathFile = PATH_METHODS . "login/dbInfo.php";
$pathFile = $filter->validateInput($pathFile,'path');
require_once ($pathFile);
} else {
if (substr( SYS_SKIN, 0, 2 ) === 'ux' && SYS_TARGET != 'sysLoginVerify') { // new ux sysLogin - extjs based form
require_once PATH_CONTROLLERS . 'main.php';
$pathFile = $filter->validateInput(PATH_CONTROLLERS . 'main.php','path');
require_once $pathFile;
$controllerClass = 'Main';
$controllerAction = SYS_TARGET == 'sysLoginVerify' ? SYS_TARGET : 'sysLogin';
//if the method exists
@@ -585,7 +597,8 @@ if (defined( 'SYS_TEMP' ) && SYS_TEMP != '') {
$controller->call( $controllerAction );
}
} else { // classic sysLogin interface
require_once (PATH_METHODS . "login/sysLogin.php");
$pathFile = $filter->validateInput(PATH_METHODS . "login/sysLogin.php",'path');
require_once ($pathFile);
die();
}
}
@@ -679,13 +692,15 @@ ob_start();
// Rebuild the base Workflow translations if not exists
if (! is_file( PATH_LANGUAGECONT . 'translation.en' )) {
require_once ("classes/model/Translation.php");
$pathFile = $filter->validateInput("classes/model/Translation.php",'path');
require_once ($pathFile);
$fields = Translation::generateFileTranslation( 'en' );
}
// TODO: Verify if the language set into url is defined in translations env.
if (SYS_LANG != 'en' && ! is_file( PATH_LANGUAGECONT . 'translation.' . SYS_LANG )) {
require_once ("classes/model/Translation.php");
$pathFile = $filter->validateInput("classes/model/Translation.php",'path');
require_once ($pathFile);
$fields = Translation::generateFileTranslation( SYS_LANG );
}
@@ -755,7 +770,8 @@ if (substr( SYS_COLLECTION, 0, 8 ) === 'gulliver') {
//erik: verify if it is a Controller Class or httpProxyController Class
if (is_file( PATH_CONTROLLERS . SYS_COLLECTION . '.php' )) {
Bootstrap::LoadSystem( 'controller' );
require_once PATH_CONTROLLERS . SYS_COLLECTION . '.php';
$pathFile = $filter->validateInput(PATH_CONTROLLERS . SYS_COLLECTION . '.php','path');
require_once $pathFile;
$controllerClass = SYS_COLLECTION;
//if the method name is empty set default to index method
$controllerAction = SYS_TARGET != '' ? SYS_TARGET : 'index';
@@ -786,14 +802,16 @@ if (substr( SYS_COLLECTION, 0, 8 ) === 'gulliver') {
$pluginControllerPath = PATH_PLUGINS . $pluginName . PATH_SEP . 'controllers' . PATH_SEP;
if (is_file($pluginControllerPath. $controllerClass . '.php')) {
require_once $pluginControllerPath. $controllerClass . '.php';
$pathFile = $pluginControllerPath. $controllerClass . '.php';
$pathFile = $filter->validateInput($pathFile,'path');
if (is_file($pathFile)) {
require_once $pathFile;
} elseif (is_file($pluginControllerPath. ucfirst($controllerClass) . '.php')) {
$controllerClass = ucfirst($controllerClass);
require_once $pluginControllerPath. $controllerClass . '.php';
require_once $pathFile;
} elseif (is_file($pluginControllerPath. ucfirst($controllerClass) . 'Controller.php')) {
$controllerClass = ucfirst($controllerClass) . 'Controller';
require_once $pluginControllerPath. $controllerClass . '.php';
require_once $pathFile;
}
//if the method exists
@@ -906,7 +924,8 @@ if (! defined( 'EXECUTE_BY_CRON' )) {
Bootstrap::LoadClass( 'sessions' );
$oSessions = new Sessions();
if ($aSession = $oSessions->verifySession( $_GET['sid'] )) {
require_once 'classes/model/Users.php';
$pathFile = $filter->validateInput('classes/model/Users.php','path');
require_once $pathFile;
$oUser = new Users();
$aUser = $oUser->load( $aSession['USR_UID'] );
$_SESSION['USER_LOGGED'] = $aUser['USR_UID'];