trivial fix for PHP >= 5.3, thanks to Martin von Wittich
[iserv-mod-error-reporter.git] / src / detail.php
index 6561b8f..1dfbcf3 100644 (file)
@@ -30,9 +30,11 @@ require_once("mod_error-reporter/init.inc");
 require_once("sec/secure.inc");
 require_once("js.inc");
 
+db_user("errorreporter");
+
 PageBlue(_c("error-reporter:Change an error report"), "mod_error-reporter");
 
-if(!$cfgErrors->userHasAccess()) {
+if(!erConfig::userHasAccess()) {
   printf("<p class='err'>%s</p>\n", ER_ERROR_ACCESS_DENIED);
   _PageBlue();
   die();
@@ -53,7 +55,7 @@ if(!is_object($doc->getErrorReportByID($getUid))) {
 }
 
 // Only admins or owners can view this page
-if(!($cfgErrors->userIsAdmin() or $doc->userIsOwner($getUid))) {
+if(!(erConfig::userIsAdmin() or $doc->userIsOwner($getUid))) {
   echo sprintf("<p class='err'>%s</div>", _c("error-reporter:You are not ".
     "allowed to edit this report."));
   _PageBlue();
@@ -65,9 +67,9 @@ $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"]);
   }
@@ -78,7 +80,7 @@ if($getAction == "update" and $postSubmit == _c("Change"))
   $er->setVisibility(isset($_POST["hidden"]) ? true : false);
   
   // Do we have to change the comment and his owner?
-  if($cfgErrors->userIsAdmin()) {
+  if(erConfig::userIsAdmin()) {
     if(@$_POST["comment_old"] != @$_POST["comment"]) {
       $er->setComment(stripslashes(@$_POST["comment"]), $_SESSION["act"]);
     }
@@ -114,7 +116,7 @@ echo sprintf("<tr><td><label for='hidden'>%s</label></td><td>".
   "<input type='checkbox' id='hidden' name='hidden' value='true'%s /></td>".
   "</tr>\n", _c("error-reporter:Hidden:"), $er->isHidden() ? 
   " checked='checked'" : "");
-if($cfgErrors->userIsAdmin()) {
+if(erConfig::userIsAdmin()) {
   echo sprintf("<tr><td>%s</td><td><textarea name='comment' cols='40' ".
   "rows='3'>%s</textarea>", _c("error-reporter:Comment:"), $er->getComment());
   if($er->getComment() != "") {
@@ -124,8 +126,8 @@ if($cfgErrors->userIsAdmin()) {
       "Comment written by:"), erGetRealUserName($er->getCommentOwner()));
   }
 }
-echo sprintf("<tr><td /><td><{$GLOBALS["smlbtn"]} value='%s' /></td></tr>\n",
-  _("Change"));
+echo sprintf("<tr><td /><td><{$GLOBALS["smlbtn"]} name='submit' value='%s' ".
+  "/></td></tr>\n", _("Change"));
 echo "</table></form><p />\n";
 _PageBlue();
 ?>
This page took 0.030347 seconds and 4 git commands to generate.