Merge branch 'ent-9045-mensaje-de-error-por-falta-de-acceso-fallos-de-formato' into 'develop'

Ent 9045 mensaje de error por falta de acceso fallos de formato

#9045 https://brutus.artica.es:8081/artica/pandora_enterprise/-/issues/9045

See merge request artica/pandorafms!5004
This commit is contained in:
Jimmy Olano 2022-07-22 14:39:18 +00:00
commit 7b411ae0de
2 changed files with 124 additions and 111 deletions

View File

@ -1,98 +1,115 @@
<html>
<head>
<style>
<link rel="stylesheet" href="<?php echo $config['homeurl']; ?>include/styles/pandora_minimal.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $config['homeurl']; ?>include/styles/js/jquery-ui.min.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $config['homeurl']; ?>include/styles/js/jquery-ui_custom.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $config['homeurl']; ?>include/styles/select2.min.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $config['homeurl']; ?>include/styles/pandora.css" type="text/css" />
<script type='text/javascript' src='<?php echo $config['homeurl']; ?>include/javascript/jquery.current.js'></script>
<script type='text/javascript' src='<?php echo $config['homeurl']; ?>include/javascript/jquery.pandora.js'></script>
<script type='text/javascript' src='<?php echo $config['homeurl']; ?>include/javascript/jquery-ui.min.js'></script>
<script type='text/javascript' src='<?php echo $config['homeurl']; ?>include/javascript/select2.min.js'></script>
<script type='text/javascript' src='<?php echo $config['homeurl']; ?>include/javascript/pandora.js'></script>
<script type='text/javascript' src='<?php echo $config['homeurl']; ?>include/javascript/pandora_ui.js'></script>
#alert_messages_na{
z-index:2;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
width:650px;
height: 400px;
background:white;
background-image:url('images/imagen-no-acceso.jpg');
background-repeat:no-repeat;
justify-content: center;
display: flex;
flex-direction: column;
box-shadow:4px 5px 10px 3px rgba(0, 0, 0, 0.4);
}
<style>
#alert_messages_na {
z-index: 2;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
width: 650px;
height: 400px;
background: white;
background-repeat: no-repeat;
justify-content: center;
display: flex;
flex-direction: column;
box-shadow: 4px 5px 10px 3px rgba(0, 0, 0, 0.4);
}
.modalheade{
text-align:center;
width:100%;
position:absolute;
top:0;
}
.modalheadertex{
color:#000;
line-height: 40px;
font-size: 23pt;
margin-bottom:30px;
}
.modalclose{
cursor:pointer;
display:inline;
float:right;
margin-right:10px;
margin-top:10px;
}
.modalconten{
color:black;
width:300px;
margin-left: 30px;
}
.modalcontenttex{
text-align:left;
color:black;
font-size: 11pt;
line-height:13pt;
margin-bottom:30px;
}
.modalokbutto{
cursor:pointer;
text-align:center;
display: inline-block;
padding: 6px 45px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
background-color:white;
border: 1px solid #82b92e;
}
.modalokbuttontex{
color:#82b92e;
font-size:13pt;
}
.modalgobutto{
cursor:pointer;
text-align:center;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
background-color:white;
border: 1px solid #82b92e;
}
.modalgobuttontex{
color:#82b92e;
font-size:10pt;
}
.modalheade {
text-align: center;
width: 100%;
position: absolute;
top: 0;
}
.modalheadertex {
color: #000;
line-height: 40px;
font-size: 23pt;
margin-bottom: 30px;
}
.modalclose {
cursor: pointer;
display: inline;
float: right;
margin-right: 10px;
margin-top: 10px;
}
.modalconten {
color: black;
width: 300px;
margin-left: 30px;
}
.modalcontenttex {
text-align: left;
color: black;
font-size: 11pt;
line-height: 13pt;
margin-bottom: 30px;
}
.modalokbutto {
cursor: pointer;
text-align: center;
display: inline-block;
padding: 6px 45px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
background-color: white;
border: 1px solid #82b92e;
}
.modalokbuttontex {
color: #82b92e;
font-size: 13pt;
}
.modalgobutto {
cursor: pointer;
text-align: center;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
background-color: white;
border: 1px solid #82b92e;
}
.modalgobuttontex {
color: #82b92e;
font-size: 10pt;
}
#opacidad{
position:fixed;
background:black;
opacity:0.6;
z-index:-1;
left:0px;
top:0px;
width:100%;
height:100%;
}
/*
#opacidad {
position: fixed;
background: black;
opacity: 0.6;
z-index: -1;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
/*
.textodialog{
margin-left: 0px;
color:#333;
@ -118,16 +135,16 @@ font-size:10pt;
</style>
</head>
<body>
<div id="alert_messages_na">
<div id="alert_messages_na" style='background-image: url(<?php echo ui_get_full_url('images/imagen-no-acceso.jpg', false, false, false); ?>)'>
<div class='modalheade'>
<img class='modalclose cerrar' src='<?php echo $config['homeurl']; ?>images/input_cross.png'>
<img class='modalclose cerrar' src='<?php echo $config['homeurl']; ?>images/input_cross.png'>
</div>
<div class='modalconten'>
<div class='modalheadertex'>
<?php echo __("You don't have access to this page"); ?>
<div class='modalheadertex' style='font-size: 23pt'>
<?php echo __('You do not have access to this page'); ?>
</div>
<div class='modalcontenttex'>
@ -141,7 +158,6 @@ font-size:10pt;
}
}
?>
</div>
<div class='modalokbutto cerrar'>
@ -149,18 +165,14 @@ font-size:10pt;
</div>
</div>
</div>
<div id="opacidad"></div>
</body>
</html>
<script>
$(".cerrar").click(function(){
window.location=".";
$(".cerrar").click(function() {
window.location = "<?php echo $config['homeurl']; ?>";
});
$('div#page').css('background-color','#d3d3d3');
</script>
$('div#page').css('background-color', '#d3d3d3');
</script>

View File

@ -46,6 +46,12 @@ $hash = get_parameter('hash');
$file_raw = get_parameter('file');
$file = base64_decode(urldecode($file_raw));
// Avoid possible inifite loop with referer.
if (isset($_SERVER['HTTP_ORIGIN']) === false || (isset($_SERVER['HTTP_ORIGIN']) === true && $_SERVER['HTTP_REFERER'] === $_SERVER['HTTP_ORIGIN'].$_SERVER['REQUEST_URI'])) {
$refererPath = ui_get_full_url('index.php');
} else {
$refererPath = $_SERVER['HTTP_REFERER'];
}
if (empty($file) === true || empty($hash) === true || $hash !== md5($file_raw.$config['server_unique_identifier']) || isset($_SERVER['HTTP_REFERER']) === false) {
$errorMessage = __('Security error. Please contact the administrator.');
@ -84,12 +90,6 @@ if (empty($file) === true || empty($hash) === true || $hash !== md5($file_raw.$c
if (empty($downloadable_file) === true || file_exists($downloadable_file) === false) {
$errorMessage = __('File is missing in disk storage. Please contact the administrator.');
// Avoid possible inifite loop with referer.
if (isset($_SERVER['HTTP_ORIGIN']) === true && $_SERVER['HTTP_REFERER'] === $_SERVER['HTTP_ORIGIN'].$_SERVER['REQUEST_URI']) {
$refererPath = ui_get_full_url('index.php');
} else {
$refererPath = $_SERVER['HTTP_REFERER'];
}
} else {
// Everything went well.
header('Content-type: aplication/octet-stream;');
@ -106,11 +106,12 @@ if (empty($file) === true || empty($hash) === true || $hash !== md5($file_raw.$c
document.addEventListener('DOMContentLoaded', function () {
var refererPath = '<?php echo $refererPath; ?>';
var errorFileOutput = '<?php echo $errorMessage; ?>';
if(refererPath != ''){
document.body.innerHTML = `<form action="` + refererPath + `" name="failedReturn" method="post" style="display:none;">
<input type="hidden" name="errorFileOutput" value="` + errorFileOutput + `" />
</form>`;
document.forms['failedReturn'].submit();
}
}, false);
</script>