Merge code from github to bitbucket 2014-08-14
This commit is contained in:
@@ -334,6 +334,7 @@ class Ajax
|
||||
$processData['PRO_AUTHOR'] = '(USER DELETED)';
|
||||
}
|
||||
|
||||
G::LoadClass('configuration');
|
||||
$conf = new Configurations();
|
||||
$conf->getFormats();
|
||||
$processData['PRO_CREATE_DATE'] = $conf->getSystemDate($processData['PRO_CREATE_DATE']);
|
||||
@@ -809,7 +810,7 @@ class Ajax
|
||||
public function dynaformViewFromHistory()
|
||||
{
|
||||
?>
|
||||
<link rel="stylesheet" type="text/css" href="/css/classic.css" />
|
||||
<link rel="stylesheet" type="text/css" href="/css/<?php echo SYS_SKIN; ?>.css" />
|
||||
|
||||
<script type="text/javascript">
|
||||
//!Code that simulated reload library javascript maborak
|
||||
|
||||
@@ -47,6 +47,12 @@ try {
|
||||
}
|
||||
$applicationFields = $case->loadCase( $_REQUEST['APP_UID'], $_REQUEST['DEL_INDEX'] );
|
||||
|
||||
$respView = $case->getAllObjectsFrom( $applicationFields['PRO_UID'], $_REQUEST['APP_UID'], $applicationFields['TAS_UID'], $_SESSION['USER_LOGGED'], 'VIEW' );
|
||||
|
||||
if ($respView['SUMMARY_FORM'] == 0) {
|
||||
throw new Exception( G::LoadTranslation( 'ID_SUMMARY_FORM_NO_PERMISSIONS' ) );
|
||||
}
|
||||
|
||||
if (file_exists( PATH_DYNAFORM . $applicationFields['PRO_UID'] . PATH_SEP . $_REQUEST['DYN_UID'] . '.xml' )) {
|
||||
$applicationFields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = '';
|
||||
$applicationFields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP'] = '#';
|
||||
|
||||
@@ -93,7 +93,7 @@ try {
|
||||
}
|
||||
|
||||
if (!isset($uid) || $uid < 0) {
|
||||
if (isset($_SESSION['FAILED_LOGINS'])) {
|
||||
if (isset($_SESSION['FAILED_LOGINS']) && ($uid == -1 || $uid == -2)) {
|
||||
$_SESSION['FAILED_LOGINS']++;
|
||||
}
|
||||
if (!defined('PPP_FAILED_LOGINS')) {
|
||||
@@ -113,8 +113,13 @@ try {
|
||||
$oStatement = $oConnection->prepareStatement("UPDATE USERS SET USR_STATUS = 'INACTIVE' WHERE USR_UID = '" . $sUserUID . "'");
|
||||
$oStatement->executeQuery();
|
||||
unset($_SESSION['FAILED_LOGINS']);
|
||||
G::SendMessageText(G::LoadTranslation('ID_ACCOUNT') . ' "' . $usr . '" ' . G::LoadTranslation('ID_ACCOUNT_DISABLED_CONTACT_ADMIN'), 'warning');
|
||||
$errLabel = G::LoadTranslation('ID_ACCOUNT') . ' "' . $usr . '" ' . G::LoadTranslation('ID_ACCOUNT_DISABLED_CONTACT_ADMIN');
|
||||
}
|
||||
//Log failed authentications
|
||||
$message = "| Many failed authentication attempts for USER: " . $usr . " | IP: " . G::getIpAddress() . " | WS: " . SYS_SYS;
|
||||
$message .= " | BROWSER: " . $_SERVER['HTTP_USER_AGENT'] ." | \n" ;
|
||||
|
||||
G::log($message, PATH_DATA, 'loginFailed.log');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,20 +136,6 @@ 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;
|
||||
}
|
||||
@@ -200,7 +191,7 @@ try {
|
||||
$lang = $frm['USER_LANG'];
|
||||
}
|
||||
} else {
|
||||
if (defined('SYS_LANG')) {
|
||||
if (defined("SYS_LANG") && SYS_LANG != "") {
|
||||
$lang = SYS_LANG;
|
||||
} else {
|
||||
$lang = 'en';
|
||||
@@ -319,6 +310,12 @@ try {
|
||||
|
||||
$oHeadPublisher->addExtJsScript('login/init', false); //adding a javascript file .js
|
||||
$oHeadPublisher->assign('uriReq', $sLocation);
|
||||
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
if ($oPluginRegistry->existsTrigger ( PM_AFTER_LOGIN )) {
|
||||
$oPluginRegistry->executeTriggers ( PM_AFTER_LOGIN , $_SESSION['USER_LOGGED'] );
|
||||
}
|
||||
|
||||
G::RenderPage('publish', 'extJs');
|
||||
//G::header('Location: ' . $sLocation);
|
||||
die;
|
||||
|
||||
@@ -149,9 +149,14 @@ G::LoadClass('configuration');
|
||||
|
||||
$oConf = new Configurations();
|
||||
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
|
||||
$aFields['USER_LANG'] = isset($oConf->aConfig['login_defaultLanguage'])
|
||||
? $oConf->aConfig['login_defaultLanguage']
|
||||
: 'en';
|
||||
|
||||
$myUrl = explode("/", $_SERVER["REQUEST_URI"]);
|
||||
|
||||
if (isset($myUrl) && $myUrl != "") {
|
||||
$aFields["USER_LANG"] = $myUrl[2];
|
||||
} else {
|
||||
$aFields["USER_LANG"] = isset($oConf->aConfig["login_defaultLanguage"])? $oConf->aConfig["login_defaultLanguage"] : SYS_LANG;
|
||||
}
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/login', '', $aFields, SYS_URI . 'login/authentication.php');
|
||||
|
||||
@@ -488,6 +488,22 @@ try {
|
||||
// ';
|
||||
// $oHeadPublisher->addScriptCode($jscriptCode);
|
||||
$_REQUEST['fcontent'] = $fcontent;
|
||||
|
||||
preg_match_all('/\@(?:([\>])([a-zA-Z\_]\w*)|([a-zA-Z\_][\w\-\>\:]*)\(((?:[^\\\\\)]*(?:[\\\\][\w\W])?)*)\))((?:\s*\[[\'"]?\w+[\'"]?\])+)?/',$fcontent,$matches);
|
||||
foreach ($matches[0] as $key => $value) {
|
||||
preg_match('/(\!--)'.$value.'(-->)/',$fcontent, $match);
|
||||
if (count($match)==0) {
|
||||
$fcontent = preg_replace ('/'.$value.'/i','<!--'.$value.'-->',$fcontent);
|
||||
}
|
||||
}
|
||||
preg_match_all('/\@(?:([\<])([a-zA-Z\_]\w*)|([a-zA-Z\_][\w\-\>\:]*)\(((?:[^\\\\\)]*(?:[\\\\][\w\W])?)*)\))((?:\s*\[[\'"]?\w+[\'"]?\])+)?/',$fcontent,$matches);
|
||||
foreach ($matches[0] as $key => $value) {
|
||||
preg_match('/(\!--)'.$value.'(-->)/',$fcontent, $match);
|
||||
if (count($match)==0) {
|
||||
$fcontent = preg_replace ('/'.$value.'/i','<!--'.$value.'-->',$fcontent);
|
||||
}
|
||||
}
|
||||
|
||||
//if($extion[count($extion)-1]=='html' || $extion[count($extion)-1]=='txt'){
|
||||
$aData = Array('pro_uid' => $_REQUEST['pro_uid'], 'fcontent' => $fcontent, 'filename' => $_REQUEST['filename']);
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'processes/processes_FileEdit', '', $aData);
|
||||
@@ -695,6 +711,21 @@ try {
|
||||
//$json = new Services_JSON();
|
||||
$sOutput = Bootstrap::json_encode($response);
|
||||
break;
|
||||
case "verifyNameFile":
|
||||
$response = array();
|
||||
$status = "OK";
|
||||
|
||||
$filename = $_POST["filename"];
|
||||
|
||||
$pathDirectory = PATH_DATA_MAILTEMPLATES . $_REQUEST["pro_uid"] . PATH_SEP;
|
||||
|
||||
if (file_exists($pathDirectory . PATH_SEP . $filename)) {
|
||||
$status = "ERROR";
|
||||
}
|
||||
|
||||
$response["status"] = $status;
|
||||
echo Bootstrap::json_encode($response);
|
||||
break;
|
||||
}
|
||||
if (isset($sOutput)) {
|
||||
die($sOutput);
|
||||
|
||||
@@ -152,17 +152,25 @@ try {
|
||||
$oContent = new Content();
|
||||
$aRow = $oDataset->getRow();
|
||||
|
||||
//THERE IS NO ANY CASE STARTED FROM THES LANGUAGE
|
||||
if ($aRow[0] == 0) { //so we can delete this language
|
||||
try {
|
||||
Content::removeLanguageContent( $locale );
|
||||
$trn->removeTranslationEnvironment( $locale );
|
||||
echo G::LoadTranslation( 'ID_LANGUAGE_DELETED_SUCCESSFULLY' );
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
if($locale != "en"){ //Default Lengage 'en'
|
||||
if($locale != SYS_LANG){ //Current lenguage
|
||||
//THERE IS NO ANY CASE STARTED FROM THES LANGUAGE
|
||||
if ($aRow[0] == 0) { //so we can delete this language
|
||||
try {
|
||||
Content::removeLanguageContent( $locale );
|
||||
$trn->removeTranslationEnvironment( $locale );
|
||||
echo G::LoadTranslation( 'ID_LANGUAGE_DELETED_SUCCESSFULLY' );
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
} else {
|
||||
echo str_replace( '{0}', $aRow[0], G::LoadTranslation( 'ID_LANGUAGE_CANT_DELETE' ) );
|
||||
}
|
||||
} else {
|
||||
echo str_replace( '{0}', $aRow[0], G::LoadTranslation( 'ID_LANGUAGE_CANT_DELETE_CURRENTLY' ) );
|
||||
}
|
||||
} else {
|
||||
echo str_replace( '{0}', $aRow[0], G::LoadTranslation( 'ID_LANGUAGE_CANT_DELETE' ) );
|
||||
echo str_replace( '{0}', $aRow[0], G::LoadTranslation( 'ID_LANGUAGE_CANT_DELETE_DEFAULT' ) );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ switch ($request) {
|
||||
);
|
||||
}
|
||||
|
||||
$result->rows[] = array ("LAN_ID" => "", "LAN_NAME" => G::LoadTranslation("ID_USE_LANGUAGE_URL"));
|
||||
|
||||
print (G::json_encode( $result )) ;
|
||||
break;
|
||||
case 'saveSettings':
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
global $RBAC;
|
||||
$RBAC->requirePermissions( 'PM_USERS' );
|
||||
|
||||
//calculating the max upload file size;
|
||||
$POST_MAX_SIZE = ini_get( 'post_max_size' );
|
||||
|
||||
Reference in New Issue
Block a user