X-Git-Url: https://git.rohieb.name/iserv-mod-error-reporter.git/blobdiff_plain/ae87133905d183987eb75369fe94bb739a2b1cb9..00f745bf3765e88988b8ea1f6fe91119a6be1a3a:/src/detail.php diff --git a/src/detail.php b/src/detail.php index d4b1ee2..1dfbcf3 100644 --- a/src/detail.php +++ b/src/detail.php @@ -1,38 +1,40 @@ userHasAccess()) { +if(!erConfig::userHasAccess()) { printf("

%s

\n", ER_ERROR_ACCESS_DENIED); _PageBlue(); die(); @@ -42,7 +44,7 @@ $getAction = @$_GET["action"]; $getUid = @intval($_GET["uid"]); $postSubmit = @$_POST["submit"]; -isset($getUid) or die(); +isset($getUid) or die(); // Check if the specified report exists if(!is_object($doc->getErrorReportByID($getUid))) { @@ -53,8 +55,9 @@ if(!is_object($doc->getErrorReportByID($getUid))) { } // Only admins or owners can view this page -if(!($cfgErrors->userIsAdmin() or $doc->userIsOwner($getUid))) { - echo sprintf("

%s", _c("error-reporter:You are not allowed to edit this report.")); +if(!(erConfig::userIsAdmin() or $doc->userIsOwner($getUid))) { + echo sprintf("

%s", _c("error-reporter:You are not ". + "allowed to edit this report.")); _PageBlue(); die(); } @@ -64,61 +67,67 @@ $er = $doc->getErrorReportByID($getUid); $strOldComment = $er->getComment(); // Probably we have to update an error report -if($getAction == "update" and $postSubmit == _c("Change")) +if($getAction == "update" and $postSubmit == _("Change")) { - if($cfgErrors->userIsAdmin()) { + if(erConfig::userIsAdmin()) { $postComment = stripslashes(@$_POST["comment"]); $postCommentOld = stripslashes(@$_POST["comment_old"]); } - // change the fields of the old dataset - $er->setMachine(stripslashes(@$_POST["machine"])); - $er->setText(stripslashes(@$_POST["text"])); - $er->setVisibility(isset($_POST["hidden"]) ? true : false); + // change the fields of the old dataset + $er->setMachine(stripslashes(@$_POST["machine"])); + $er->setText(stripslashes(@$_POST["text"])); + $er->setVisibility(isset($_POST["hidden"]) ? true : false); - // Do we have to change the comment and his owner? - if($cfgErrors->userIsAdmin()) { + // Do we have to change the comment and his owner? + if(erConfig::userIsAdmin()) { if(@$_POST["comment_old"] != @$_POST["comment"]) { $er->setComment(stripslashes(@$_POST["comment"]), $_SESSION["act"]); } } // write into database, reload parent and close window - if($doc->writeErrorReport($er) != -1) { + if($doc->writeErrorReport($er) != -1) { js_try("opener.location.href = 'index.php';"); js_close(500); - } else { - printLastError(); - _PageBlue(); - die(); - } + } else { + printLastError(); + _PageBlue(); + die(); + } } // output form $hidctrl = "input type='hidden'"; Title(_c("error-reporter:Change an error report")); -echo sprintf("

\n", $getUid); +echo sprintf("\n", + $getUid); echo "\n"; -echo sprintf("\n", _c("error-reporter:Reported by:"), - q(erGetRealUserName($er->getOwner()))); -echo sprintf("\n", _c("error-reporter:Date:"), SmartDate($er->getDate())); -echo sprintf("\n", - _c("error-reporter:Affected machine:"), q($er->getMachine())); +echo sprintf("\n", + _c("error-reporter:Reported by:"), q(erGetRealUserName($er->getOwner()))); +echo sprintf("\n", _c("error-reporter:Date:"), + SmartDate($er->getDate())); +echo sprintf("\n", _c("error-reporter:Affected machine:"), + q($er->getMachine())); echo sprintf("\n", _c("error-reporter:Text:"), $er->getText()); -echo sprintf("\n", _c("error-reporter:Hidden:"), - $er->isHidden() ? " checked='checked'" : ""); -if($cfgErrors->userIsAdmin()) { - echo sprintf("". + "\n", _c("error-reporter:Hidden:"), $er->isHidden() ? + " checked='checked'" : ""); +if(erConfig::userIsAdmin()) { + echo sprintf("\n", $strOldComment); - echo sprintf("\n", _c("error-reporter:Comment written by:"), - erGetRealUserName($er->getCommentOwner())); + echo sprintf("". + "\n", $strOldComment); + echo sprintf("\n", _c("error-reporter:". + "Comment written by:"), erGetRealUserName($er->getCommentOwner())); } } -echo sprintf("\n", _("Change")); +echo sprintf("\n", _("Change")); echo "
%s%s
%s%s
%s<{$GLOBALS["stdedt"]} name='machine' value='%s' />
%s%s
%s%s
%s<{$GLOBALS["stdedt"]} name='machine' ". + "value='%s' />
%s
%s", - _c("error-reporter:Comment:"), $er->getComment()); +echo sprintf("
". + "
%s", _c("error-reporter:Comment:"), $er->getComment()); if($er->getComment() != "") { - echo sprintf("
%s%s
%s%s
<{$GLOBALS["smlbtn"]} value='%s' />
<{$GLOBALS["smlbtn"]} name='submit' value='%s' ". + "/>

\n"; _PageBlue(); ?>