77 lines
2.2 KiB
PHP
77 lines
2.2 KiB
PHP
<?php
|
|
/*
|
|
Author: Riccardo Di Dato
|
|
Creation Date: 27/gen/2016
|
|
*/
|
|
|
|
require_once(dirname(__FILE__)."/../load.php");
|
|
|
|
GUIHandler::generateHtmlHeaders(array(),true);
|
|
|
|
if (!AdminLoginManager::isLogged()){
|
|
GUIHandler::redirect("admin/login.php");
|
|
}
|
|
else if (!AdminLoginManager::getLogged()->hasRole(AdminModel::ADMIN_TYPE_SUPERADMIN)){
|
|
GUIHandler::redirect("admin/index.php");
|
|
}
|
|
|
|
MenuGenerator::generateMenu();
|
|
|
|
HTMLHelper::generateAdminHead();
|
|
|
|
$error = "";
|
|
try {
|
|
$id = PostHandler::get("id");
|
|
|
|
if (is_null($id) || strcmp("", $id)==0){
|
|
GUIHandler::redirect("admin/logs.php");
|
|
}
|
|
|
|
$logMsg = GlobalVariables::get("dao")->getFirst("LogModel",array("id"=>$id));
|
|
if (is_null($logMsg)){
|
|
GUIHandler::redirect("admin/logs.php");
|
|
}
|
|
|
|
$action = PostHandler::get("action");
|
|
if (!is_null($action) && strcmp("", $action)!=0){
|
|
if (strcmp("cancel", $action)==0){
|
|
GUIHandler::redirect("admin/logs.php");
|
|
}
|
|
}
|
|
}catch(GUIException $ex){
|
|
$error = $ex->getMessage();
|
|
}catch (Exception $exec){
|
|
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_ERROR, $exec->getMessage());
|
|
$error = "UNEXPECTED - ".$error = $ex->getMessage();;
|
|
}
|
|
|
|
?>
|
|
<div>
|
|
<?php
|
|
if(strcmp($error, "")!=0){
|
|
echo '<div style="font-size: 16px; color:red;">'.$error.'</div>';
|
|
}
|
|
?>
|
|
<div class="formBtns" style="text-align:center;">
|
|
<a href="#" id="mailForm_annulla">Indietro</a>
|
|
</div>
|
|
<div><span class="label"><b>Code</b></span><?php echo $logMsg->getCode(); ?> </div>
|
|
<div><span class="label"><b>Data</b></span><?php echo date("d-m-Y H:i",$logMsg->date->toDateTime()->getTimestamp()); ?> </div>
|
|
<div><span class="label"><b>Message</b></span><?php echo $logMsg->message; ?> </div>
|
|
<div>
|
|
<span class="label"><b>Trace</b></span>
|
|
<div style="white-space:pre; padding-left:200px;"><?php echo $logMsg->trace; ?></div>
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
$(document).ready(function(event){
|
|
$("#mailForm_annulla").click(function(event){
|
|
$("form#mailForm input[type=hidden][name=action]").val("cancel");
|
|
$("form#mailForm").submit();
|
|
});
|
|
});
|
|
</script>
|
|
<form id="mailForm" method="POST" action="">
|
|
<input type="hidden" name="action" value="" />
|
|
<input type="hidden" name="id" value="<?php echo $id;?>" />
|
|
</form>
|