Merge remote branch 'upstream/master'
This commit is contained in:
@@ -1213,7 +1213,7 @@ function G_Text(form, element, name)
|
||||
if (me.validate == 'Any' && me.mask == '') return true;
|
||||
|
||||
var pressKey = (window.event)? window.event.keyCode : event.which;
|
||||
if (pressKey == 107 || pressKey == 187 || pressKey == 192 || pressKey == 172 || pressKey == 171 || pressKey == 226 || pressKey == 220 || pressKey == 226 || pressKey == 0 || pressKey == 221 || pressKey == 222 || pressKey == 186) {
|
||||
if (pressKey == 107 || pressKey == 187 || pressKey == 191 || pressKey == 192 || pressKey == 172 || pressKey == 171 || pressKey == 226 || pressKey == 220 || pressKey == 226 || pressKey == 0 || pressKey == 221 || pressKey == 222 || pressKey == 186) {
|
||||
pressKey = 43;
|
||||
}
|
||||
|
||||
@@ -1386,13 +1386,9 @@ function G_Text(form, element, name)
|
||||
keyValid = patron.test(key);
|
||||
break;
|
||||
case 'AlphaNum':
|
||||
patron =/[a-zA-Z0-9\sáéÃÂÂÂÂóúäëïöüñçÇÑ�É�ÓÚÄË�ÖÜ]/;
|
||||
patron =/[A-Za-z0-9\sáéíóúäëïöüñçÇÑÁÉÍÓÚÄËÏÖÜ]/;
|
||||
key = String.fromCharCode(pressKey);
|
||||
keyValid = patron.test(key);
|
||||
if (pressKey == 220 || pressKey == 189 || pressKey == 8364 || pressKey == 182 || pressKey == 172 || pressKey == 33 || pressKey == 35 || pressKey == 63 || pressKey == 123 || pressKey == 124 || pressKey == 125 || pressKey == 126 || pressKey == 162 || pressKey == 171 || pressKey == 8220 ) {
|
||||
keyValid = false;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 'NodeName': case 'Login':
|
||||
updateOnChange = false;
|
||||
@@ -1422,7 +1418,6 @@ function G_Text(form, element, name)
|
||||
keyValid = k.result();
|
||||
if (pressKey == 220 || pressKey == 189 || pressKey == 8364 || pressKey == 182 || pressKey == 172 || pressKey == 33 || pressKey == 35 || pressKey == 63 || pressKey == 123 || pressKey == 124 || pressKey == 125 || pressKey == 126 || pressKey == 162 || pressKey == 171 || pressKey == 8220) {
|
||||
keyValid = false;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -1024,7 +1024,7 @@ switch(action){case'mask':case'move':dataNewMask=me.replaceMasks(newValue,newCur
|
||||
break;case 256:newValue=currentValue.substring(0,cursorStart);newValue+='.';newValue+=currentValue.substring(cursorEnd,currentValue.length);newCursor=cursorStart+1;break;case 35:case 36:case 37:case 38:case 39:case 40:newValue=currentValue;switch(keyCode){case 36:newCursor=0;break;case 35:newCursor=currentValue.length;break;case 37:newCursor=cursorStart-1;break;case 39:newCursor=cursorStart+1;break;}
|
||||
break;default:newKey=String.fromCharCode(keyCode);newValue=currentValue.substring(0,cursorStart);newValue+=newKey;newValue+=currentValue.substring(cursorEnd,currentValue.length);newCursor=cursorStart+1;break;}
|
||||
if(newCursor<0)newCursor=0;me.element.value=newValue;me.setSelectionRange(newCursor,newCursor);}};this.sendOnChange=function(){if(me.element.fireEvent){me.element.fireEvent("onchange");}else{var evObj=document.createEvent('HTMLEvents');evObj.initEvent('change',true,true);me.element.dispatchEvent(evObj);}};this.handleKeyDown=function(event){if(me.element.readOnly){return true;}
|
||||
if(me.validate=='Any'&&me.mask=='')return true;var pressKey=(window.event)?window.event.keyCode:event.which;if(pressKey==107||pressKey==187||pressKey==192||pressKey==172||pressKey==171||pressKey==226||pressKey==220||pressKey==226||pressKey==0||pressKey==221||pressKey==222||pressKey==186){pressKey=43;}
|
||||
if(me.validate=='Any'&&me.mask=='')return true;var pressKey=(window.event)?window.event.keyCode:event.which;if(pressKey==107||pressKey==187||pressKey==191||pressKey==192||pressKey==172||pressKey==171||pressKey==226||pressKey==220||pressKey==226||pressKey==0||pressKey==221||pressKey==222||pressKey==186){pressKey=43;}
|
||||
switch(pressKey){case 8:case 46:case 35:case 36:case 37:case 38:case 39:case 40:case 43:if((pressKey==8||pressKey==46)&&me.validate=="NodeName"){return true;}
|
||||
if(pressKey==46&&me.validate=="Email"){return true;}
|
||||
if(me.validate=="Email"&&pressKey!=8&&(me.element.value.length>me.element.maxLength-1)){return false;}
|
||||
@@ -1048,10 +1048,9 @@ else{var pressKey=(window.event)?window.event.keyCode:event.which;keyValid=true;
|
||||
else{patron=/[0-9,\.]/;}
|
||||
key=String.fromCharCode(pressKey);keyValid=patron.test(key);keyValid=keyValid||(pressKey==45);if(typeof me.comma_separator!='undefined'){if(me.comma_separator=='.'){if(me.element.value.indexOf('.')==-1){keyValid=keyValid||(pressKey==46);}}
|
||||
else{if(me.element.value.indexOf(',')==-1){keyValid=keyValid||(pressKey==44);}}}
|
||||
break;case'Alpha':patron=/[a-zA-Z]/;key=String.fromCharCode(pressKey);keyValid=patron.test(key);break;case'AlphaNum':patron=/[a-zA-Z0-9\sáéÃÂÂÂÂóúäëïöüñçÇÑ�É�ÓÚÄË�ÖÜ]/;key=String.fromCharCode(pressKey);keyValid=patron.test(key);if(pressKey==220||pressKey==189||pressKey==8364||pressKey==182||pressKey==172||pressKey==33||pressKey==35||pressKey==63||pressKey==123||pressKey==124||pressKey==125||pressKey==126||pressKey==162||pressKey==171||pressKey==8220){keyValid=false;return false;}
|
||||
break;case'NodeName':case'Login':updateOnChange=false;if(me.getCursorPos()==0){if((pressKey>=48)&&(pressKey<=57)){keyValid=false;break;}}
|
||||
break;case'Alpha':patron=/[a-zA-Z]/;key=String.fromCharCode(pressKey);keyValid=patron.test(key);break;case'AlphaNum':patron=/[A-Za-z0-9\sáéíóúäëïöüñçÇÑÁÉÍÓÚÄËÏÖÜ]/;key=String.fromCharCode(pressKey);keyValid=patron.test(key);break;case'NodeName':case'Login':updateOnChange=false;if(me.getCursorPos()==0){if((pressKey>=48)&&(pressKey<=57)){keyValid=false;break;}}
|
||||
if((keyCode==8)&&(me.validate=='NodeName')){keyValid=true;}else{var k=new leimnud.module.validator({valid:['Login'],key:(window.event)?window.event:event,lang:(typeof(me.language)!=='undefined')?me.language:"en"});keyValid=k.result();}
|
||||
break;case'Email':var k=new leimnud.module.validator({valid:[me.validate],key:(window.event)?window.event:event,lang:(typeof(me.language)!=='undefined')?me.language:"en"});keyValid=k.result();if(pressKey==220||pressKey==189||pressKey==8364||pressKey==182||pressKey==172||pressKey==33||pressKey==35||pressKey==63||pressKey==123||pressKey==124||pressKey==125||pressKey==126||pressKey==162||pressKey==171||pressKey==8220){keyValid=false;return false;}
|
||||
break;case'Email':var k=new leimnud.module.validator({valid:[me.validate],key:(window.event)?window.event:event,lang:(typeof(me.language)!=='undefined')?me.language:"en"});keyValid=k.result();if(pressKey==220||pressKey==189||pressKey==8364||pressKey==182||pressKey==172||pressKey==33||pressKey==35||pressKey==63||pressKey==123||pressKey==124||pressKey==125||pressKey==126||pressKey==162||pressKey==171||pressKey==8220){keyValid=false;}
|
||||
break;default:var k=new leimnud.module.validator({valid:[me.validate],key:(window.event)?window.event:event,lang:(typeof(me.language)!=='undefined')?me.language:"en"});keyValid=k.result();break;}
|
||||
if(keyValid){if(me.mask==""&&(me.validate=='Real'||me.validate=='Int')&&me.mType=='text'){if(key=='-'){currentValue=me.element.value;if(currentValue.charAt(0)=='-'){currentValue=currentValue.substring(1,currentValue.length);me.element.value=currentValue;}else{me.element.value='-'+currentValue;}}}
|
||||
if((me.validate=="Login"||me.validate=="NodeName")&&me.mask==""){return true;}
|
||||
|
||||
@@ -103,6 +103,7 @@ class Logger
|
||||
{
|
||||
$this->renameFile();
|
||||
$file = fopen($this->filePath, "a+");
|
||||
$message = date('Y-m-d H:i:s') . " " . $message;
|
||||
fwrite($file, $message);
|
||||
fclose($file);
|
||||
}
|
||||
|
||||
@@ -913,7 +913,7 @@ function saveLog($sSource, $sType, $sDescription)
|
||||
}
|
||||
|
||||
G::verifyPath(PATH_DATA . "log" . PATH_SEP, true);
|
||||
G::log(date("Y-m-d H:i:s") . " | $sObject | " . $sSource . " | $sType | " . $sDescription . "\n", PATH_DATA);
|
||||
G::log("| $sObject | " . $sSource . " | $sType | " . $sDescription . "\n", PATH_DATA);
|
||||
} catch (Exception $e) {
|
||||
//CONTINUE
|
||||
}
|
||||
|
||||
@@ -338,7 +338,7 @@ function saveLog($sSource, $sType, $sDescription)
|
||||
print date ('H:i:s') . " ($sSource) $sType $sDescription <br>\n";
|
||||
|
||||
G::verifyPath (PATH_DATA . 'log' . PATH_SEP, true);
|
||||
$message = date ('Y-m-d H:i:s') . '(' . $sSource . ') ' . $sDescription . "\n";
|
||||
$message = '(' . $sSource . ') ' . $sDescription . "\n";
|
||||
if ($sType == 'action') {
|
||||
G::log($message, PATH_DATA);
|
||||
}
|
||||
|
||||
@@ -517,7 +517,7 @@ function saveLog($sSource, $sType, $sDescription)
|
||||
print date ('H:i:s') . " ($sSource) $sType $sDescription <br>\n";
|
||||
|
||||
G::verifyPath (PATH_DATA . 'log' . PATH_SEP, true);
|
||||
$message = date ('Y-m-d H:i:s') . '(' . $sSource . ') ' . $sDescription . "\n";
|
||||
$message = '(' . $sSource . ') ' . $sDescription . "\n";
|
||||
if ($sType == 'action') {
|
||||
G::log($message, PATH_DATA);
|
||||
}
|
||||
|
||||
@@ -3970,7 +3970,7 @@ class Cases
|
||||
if (SubApplicationPeer::doCount($oCriteria2) > 0) {
|
||||
G::LoadClass('derivation');
|
||||
$oDerivation = new Derivation();
|
||||
$oDerivation->verifyIsCaseChild($sApplicationUID);
|
||||
$oDerivation->verifyIsCaseChild($sApplicationUID, $iIndex);
|
||||
}
|
||||
|
||||
//update searchindex
|
||||
|
||||
@@ -638,7 +638,7 @@ class Derivation
|
||||
//Close case
|
||||
$appFields["APP_STATUS"] = "COMPLETED";
|
||||
$appFields["APP_FINISH_DATE"] = "now";
|
||||
$this->verifyIsCaseChild( $currentDelegation["APP_UID"] );
|
||||
$this->verifyIsCaseChild($currentDelegation["APP_UID"], $currentDelegation["DEL_INDEX"]);
|
||||
|
||||
$sw = 1;
|
||||
}
|
||||
@@ -793,7 +793,7 @@ class Derivation
|
||||
* @param string $sApplicationUID
|
||||
* @return void
|
||||
*/
|
||||
function verifyIsCaseChild ($sApplicationUID)
|
||||
function verifyIsCaseChild ($sApplicationUID, $delIndex = 0)
|
||||
{
|
||||
//Obtain the related row in the table SUB_APPLICATION
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
@@ -814,7 +814,7 @@ class Derivation
|
||||
$oDataset->next();
|
||||
$aSP = $oDataset->getRow();
|
||||
if ($aSP['SP_SYNCHRONOUS'] == 1) {
|
||||
$appFields = $oCase->loadCase( $sApplicationUID );
|
||||
$appFields = $oCase->loadCase($sApplicationUID, $delIndex);
|
||||
//Copy case variables to parent case
|
||||
$aFields = unserialize( $aSP['SP_VARIABLES_IN'] );
|
||||
$aNewFields = array ();
|
||||
@@ -853,6 +853,27 @@ class Derivation
|
||||
$currentDelegation2 = array ('APP_UID' => $aSA['APP_PARENT'],'DEL_INDEX' => $aSA['DEL_INDEX_PARENT'],'APP_STATUS' => 'TO_DO','TAS_UID' => $aParentCase['TAS_UID'],'ROU_TYPE' => $aDeriveTasks[1]['ROU_TYPE']
|
||||
);
|
||||
$this->derivate( $currentDelegation2, $nextDelegations2 );
|
||||
|
||||
if($delIndex > 0 ) {
|
||||
// Send notifications - Start
|
||||
$oUser = new Users();
|
||||
$aUser = $oUser->load($appFields["CURRENT_USER_UID"]);
|
||||
|
||||
$sFromName = $aUser["USR_FIRSTNAME"] . " " . $aUser["USR_LASTNAME"] . ($aUser["USR_EMAIL"] != "" ? " <" . $aUser["USR_EMAIL"] . ">" : "");
|
||||
|
||||
try {
|
||||
$oCase->sendNotifications($appFields["TAS_UID"],
|
||||
$nextDelegations2,
|
||||
$appFields["APP_DATA"],
|
||||
$sApplicationUID,
|
||||
$delIndex,
|
||||
$sFromName);
|
||||
|
||||
} catch (Exception $e) {
|
||||
G::SendTemporalMessage(G::loadTranslation("ID_NOTIFICATION_ERROR") . " - " . $e->getMessage(), "warning", "string", null, "100%");
|
||||
}
|
||||
// Send notifications - End
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,6 +131,20 @@ try {
|
||||
}
|
||||
}
|
||||
|
||||
//LOG Filed authentications
|
||||
$filedTimes = (defined(PPP_FAILED_LOGINS)) ? PPP_FAILED_LOGINS : 3;
|
||||
|
||||
if($_SESSION['FAILED_LOGINS'] > $filedTimes){
|
||||
$ip = G::getIpAddress();
|
||||
$browser = $_SERVER['HTTP_USER_AGENT'];
|
||||
|
||||
$path = PATH_DATA;
|
||||
$message = "| Many failed authentication attempts for USER: " . $usr . " | IP: " . $ip . " | WS: " . SYS_SYS . " | BROWSER: " .$browser ." | \n" ;
|
||||
$file = "loginFailed.log";
|
||||
|
||||
G::log($message, $path, $file);
|
||||
}
|
||||
|
||||
G::header("location: $loginUrl");
|
||||
die;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user