HOR-3017
This commit is contained in:
@@ -2916,13 +2916,15 @@ class processMap
|
|||||||
if ($archivo != '..') {
|
if ($archivo != '..') {
|
||||||
$one = 0;
|
$one = 0;
|
||||||
$two = 0;
|
$two = 0;
|
||||||
|
$three = 0;
|
||||||
|
|
||||||
$alink = $link . $archivo;
|
$alink = $link . $archivo;
|
||||||
|
|
||||||
$one = count(explode('wsClient.php', $archivo));
|
$one = count(explode('wsClient.php', $archivo));
|
||||||
$two = count(explode('Post.php', $archivo));
|
$two = count(explode('Post.php', $archivo));
|
||||||
|
$three = count(explode('Info.php', $archivo));
|
||||||
|
|
||||||
if ($one == 1 && $two == 1) {
|
if ($one == 1 && $two == 1 && $three == 1) {
|
||||||
$arlink = "<a href='" . $alink . "' target='blank'><font color='#9999CC'>" . $alink . "</font></a>";
|
$arlink = "<a href='" . $alink . "' target='blank'><font color='#9999CC'>" . $alink . "</font></a>";
|
||||||
$linkdelete = sprintf("<a href='javascript:webEntry_delete(\"%s\",\"%s\",\"%s\");'><font color='red'>delete</font></a>", $alink, $archivo, $sProcessUID);
|
$linkdelete = sprintf("<a href='javascript:webEntry_delete(\"%s\",\"%s\",\"%s\");'><font color='red'>delete</font></a>", $alink, $archivo, $sProcessUID);
|
||||||
$row[] = array('W_LINK' => $arlink, 'W_FILENAME' => $archivo, 'W_PRO_UID' => $sProcessUID );
|
$row[] = array('W_LINK' => $arlink, 'W_FILENAME' => $archivo, 'W_PRO_UID' => $sProcessUID );
|
||||||
|
|||||||
@@ -60,7 +60,28 @@ try {
|
|||||||
$sContent .= "\$G_PUBLISH->AddContent('dynaform', 'xmlform', '" . $sPRO_UID . '/' . $sDYNAFORM . "', '', array(), '" . $dynTitle . 'Post.php' . "');\n";
|
$sContent .= "\$G_PUBLISH->AddContent('dynaform', 'xmlform', '" . $sPRO_UID . '/' . $sDYNAFORM . "', '', array(), '" . $dynTitle . 'Post.php' . "');\n";
|
||||||
$sContent .= "G::RenderPage('publish', 'blank');";
|
$sContent .= "G::RenderPage('publish', 'blank');";
|
||||||
file_put_contents( $pathProcess . $dynTitle . '.php', $sContent );
|
file_put_contents( $pathProcess . $dynTitle . '.php', $sContent );
|
||||||
//creating the second file, the post file who receive the post form.
|
|
||||||
|
//Create file to display information and prevent resubmission data (Post/Redirect/Get).
|
||||||
|
$fileNamePreventResubmission = $pathProcess . $dynTitle . "Info.php";
|
||||||
|
$filePreventResubmission = ""
|
||||||
|
. "<?php\n"
|
||||||
|
. "\n"
|
||||||
|
. "\$G_PUBLISH = new Publisher();\n"
|
||||||
|
. "\$show = \"login/showMessage\";\n"
|
||||||
|
. "\$message = \"\";\n"
|
||||||
|
. "if (isset(\$_SESSION[\"__webEntrySuccess__\"])) {\n"
|
||||||
|
. " \$show = \"login/showInfo\";\n"
|
||||||
|
. " \$message = \$_SESSION[\"__webEntrySuccess__\"];\n"
|
||||||
|
. "} else {\n"
|
||||||
|
. " \$show = \"login/showMessage\";\n"
|
||||||
|
. " \$message = \$_SESSION[\"__webEntryError__\"];\n"
|
||||||
|
. "}\n"
|
||||||
|
. "\$G_PUBLISH->AddContent(\"xmlform\", \"xmlform\", \$show, \"\", \$message);\n"
|
||||||
|
. "G::RenderPage(\"publish\", \"blank\");\n"
|
||||||
|
. "\n";
|
||||||
|
file_put_contents($fileNamePreventResubmission, $filePreventResubmission);
|
||||||
|
|
||||||
|
//creating the second file, the post file who receive the post form.
|
||||||
$pluginTpl = PATH_CORE . 'templates' . PATH_SEP . 'processes' . PATH_SEP . 'webentryPost.tpl';
|
$pluginTpl = PATH_CORE . 'templates' . PATH_SEP . 'processes' . PATH_SEP . 'webentryPost.tpl';
|
||||||
$template = new TemplatePower( $pluginTpl );
|
$template = new TemplatePower( $pluginTpl );
|
||||||
$template->prepare();
|
$template->prepare();
|
||||||
@@ -72,6 +93,7 @@ try {
|
|||||||
$template->assign( 'wsUser', $sWS_USER );
|
$template->assign( 'wsUser', $sWS_USER );
|
||||||
$template->assign( 'wsPass', Bootstrap::hashPassword($sWS_PASS, '', true) );
|
$template->assign( 'wsPass', Bootstrap::hashPassword($sWS_PASS, '', true) );
|
||||||
$template->assign( 'wsRoundRobin', $sWS_ROUNDROBIN );
|
$template->assign( 'wsRoundRobin', $sWS_ROUNDROBIN );
|
||||||
|
$template->assign( 'weTitle', $dynTitle);
|
||||||
|
|
||||||
G::auditLog('WebEntry','Generate web entry with web services ('.$dynTitle.'.php) in process "'.$resultProcess['PRO_TITLE'].'"');
|
G::auditLog('WebEntry','Generate web entry with web services ('.$dynTitle.'.php) in process "'.$resultProcess['PRO_TITLE'].'"');
|
||||||
|
|
||||||
|
|||||||
@@ -398,27 +398,46 @@ class WebEntry
|
|||||||
$weTitle = $this->sanitizeFilename($arrayWebEntryData["WE_TITLE"]);
|
$weTitle = $this->sanitizeFilename($arrayWebEntryData["WE_TITLE"]);
|
||||||
$fileName = $weTitle;
|
$fileName = $weTitle;
|
||||||
|
|
||||||
$fileContent = "<?php\n";
|
$fileContent = "<?php\n\n";
|
||||||
$fileContent .= "global \$_DBArray;\n";
|
$fileContent .= "global \$_DBArray;\n";
|
||||||
$fileContent .= "if (!isset(\$_DBArray)) {\n";
|
$fileContent .= "if (!isset(\$_DBArray)) {\n";
|
||||||
$fileContent .= " \$_DBArray = array();\n";
|
$fileContent .= " \$_DBArray = array();\n";
|
||||||
$fileContent .= "}\n";
|
$fileContent .= "}\n";
|
||||||
$fileContent .= "\$_SESSION[\"PROCESS\"] = \"" . $processUid . "\";\n";
|
$fileContent .= "\$_SESSION[\"PROCESS\"] = \"" . $processUid . "\";\n";
|
||||||
$fileContent .= "\$_SESSION[\"CURRENT_DYN_UID\"] = \"" . $dynaFormUid . "\";\n";
|
$fileContent .= "\$_SESSION[\"CURRENT_DYN_UID\"] = \"" . $dynaFormUid . "\";\n";
|
||||||
$fileContent .= "\$G_PUBLISH = new Publisher();\n";
|
$fileContent .= "\$G_PUBLISH = new Publisher();\n";
|
||||||
$fileContent .= "\$_SESSION[\"__submitFormWebEntry__\"] = false;\n";
|
|
||||||
|
|
||||||
$fileContent .= "G::LoadClass(\"pmDynaform\");\n";
|
$fileContent .= "G::LoadClass(\"pmDynaform\");\n";
|
||||||
$fileContent .= "\$a = new pmDynaform(array(\"CURRENT_DYNAFORM\" => \"" . $arrayWebEntryData["DYN_UID"] . "\"));\n";
|
$fileContent .= "\$a = new pmDynaform(array(\"CURRENT_DYNAFORM\" => \"" . $arrayWebEntryData["DYN_UID"] . "\"));\n";
|
||||||
$fileContent .= "if (\$a->isResponsive()) {";
|
$fileContent .= "if (\$a->isResponsive()) {\n";
|
||||||
$fileContent .= " \$a->printWebEntry(\"" . $fileName . "Post.php\");";
|
$fileContent .= " \$a->printWebEntry(\"" . $fileName . "Post.php\");\n";
|
||||||
$fileContent .= "} else {";
|
$fileContent .= "} else {\n";
|
||||||
$fileContent .= " \$G_PUBLISH->AddContent(\"dynaform\", \"xmlform\", \"" . $processUid . PATH_SEP . $dynaFormUid . "\", \"\", array(), \"" . $fileName . "Post.php\");\n";
|
$fileContent .= " \$G_PUBLISH->AddContent(\"dynaform\", \"xmlform\", \"" . $processUid . PATH_SEP . $dynaFormUid . "\", \"\", array(), \"" . $fileName . "Post.php\");\n";
|
||||||
$fileContent .= " G::RenderPage(\"publish\", \"blank\");";
|
$fileContent .= " G::RenderPage(\"publish\", \"blank\");\n";
|
||||||
$fileContent .= "}";
|
$fileContent .= "}\n";
|
||||||
|
|
||||||
file_put_contents($pathDataPublicProcess . PATH_SEP . $fileName . ".php", $fileContent);
|
file_put_contents($pathDataPublicProcess . PATH_SEP . $fileName . ".php", $fileContent);
|
||||||
|
|
||||||
|
//Create file to display information and prevent resubmission data (Post/Redirect/Get).
|
||||||
|
$fileNamePreventResubmission = $pathDataPublicProcess . PATH_SEP . $weTitle . "Info.php";
|
||||||
|
$filePreventResubmission = ""
|
||||||
|
. "<?php\n"
|
||||||
|
. "\n"
|
||||||
|
. "\$G_PUBLISH = new Publisher();\n"
|
||||||
|
. "\$show = \"login/showMessage\";\n"
|
||||||
|
. "\$message = \"\";\n"
|
||||||
|
. "if (isset(\$_SESSION[\"__webEntrySuccess__\"])) {\n"
|
||||||
|
. " \$show = \"login/showInfo\";\n"
|
||||||
|
. " \$message = \$_SESSION[\"__webEntrySuccess__\"];\n"
|
||||||
|
. "} else {\n"
|
||||||
|
. " \$show = \"login/showMessage\";\n"
|
||||||
|
. " \$message = \$_SESSION[\"__webEntryError__\"];\n"
|
||||||
|
. "}\n"
|
||||||
|
. "\$G_PUBLISH->AddContent(\"xmlform\", \"xmlform\", \$show, \"\", \$message);\n"
|
||||||
|
. "G::RenderPage(\"publish\", \"blank\");\n"
|
||||||
|
. "\n";
|
||||||
|
file_put_contents($fileNamePreventResubmission, $filePreventResubmission);
|
||||||
|
|
||||||
//Creating the second file, the post file who receive the post form.
|
//Creating the second file, the post file who receive the post form.
|
||||||
$pluginTpl = PATH_TPL . "processes" . PATH_SEP . "webentryPost.tpl";
|
$pluginTpl = PATH_TPL . "processes" . PATH_SEP . "webentryPost.tpl";
|
||||||
|
|
||||||
@@ -433,6 +452,7 @@ class WebEntry
|
|||||||
$template->assign("wsUser", $usrUsername);
|
$template->assign("wsUser", $usrUsername);
|
||||||
$template->assign("wsPass", \Bootstrap::getPasswordHashType() . ':' . $usrPassword);
|
$template->assign("wsPass", \Bootstrap::getPasswordHashType() . ':' . $usrPassword);
|
||||||
$template->assign("wsRoundRobin", $wsRoundRobin);
|
$template->assign("wsRoundRobin", $wsRoundRobin);
|
||||||
|
$template->assign("weTitle", $weTitle);
|
||||||
|
|
||||||
if ($webEntryInputDocumentAccess == 0) {
|
if ($webEntryInputDocumentAccess == 0) {
|
||||||
//Restricted to process permissions
|
//Restricted to process permissions
|
||||||
|
|||||||
@@ -16,13 +16,6 @@ define("WS_USER_PASS", "{wsPass}");
|
|||||||
define("WS_ROUNDROBIN", "{wsRoundRobin}");
|
define("WS_ROUNDROBIN", "{wsRoundRobin}");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (isset($_SESSION["__submitFormWebEntry__"]) && $_SESSION["__submitFormWebEntry__"] === true) {
|
|
||||||
$G_PUBLISH = new Publisher();
|
|
||||||
$G_PUBLISH->AddContent("xmlform", "xmlform", "login/showInfo", "", $_SESSION["__submitFormWebEntryData__"]);
|
|
||||||
G::RenderPage("publish", "blank");
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
@include_once ("wsClient.php");
|
@include_once ("wsClient.php");
|
||||||
|
|
||||||
if (!function_exists("ws_open")){
|
if (!function_exists("ws_open")){
|
||||||
@@ -200,15 +193,11 @@ try {
|
|||||||
exit( 0 );
|
exit( 0 );
|
||||||
}
|
}
|
||||||
/*----------------------------------********---------------------------------*/
|
/*----------------------------------********---------------------------------*/
|
||||||
$G_PUBLISH = new Publisher();
|
$_SESSION["__webEntrySuccess__"] = $aMessage;
|
||||||
$G_PUBLISH->AddContent("xmlform", "xmlform", "login/showInfo", "", $aMessage);
|
header("location:{weTitle}Info.php");
|
||||||
G::RenderPage("publish", "blank");
|
|
||||||
$_SESSION["__submitFormWebEntry__"] = true;
|
|
||||||
$_SESSION["__submitFormWebEntryData__"] = $aMessage;
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$G_PUBLISH = new Publisher();
|
|
||||||
$suggest_message = "This web entry should be regenerated, please contact to your system administrator.";
|
$suggest_message = "This web entry should be regenerated, please contact to your system administrator.";
|
||||||
$aMessage["MESSAGE"] = "<font color=\"red\"><pre>" . $e->getMessage() . "</pre>" . $suggest_message . "</font>";
|
$aMessage["MESSAGE"] = "<font color=\"red\"><pre>" . $e->getMessage() . "</pre>" . $suggest_message . "</font>";
|
||||||
$G_PUBLISH->AddContent("xmlform", "xmlform", "login/showMessage", "", $aMessage);
|
$_SESSION["__webEntryError__"] = $aMessage;
|
||||||
G::RenderPage("publish", "blank");
|
header("location:{weTitle}Info.php");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user