added php5-cli to Depends
[iserv-mod-error-reporter.git] / src / index.php
index a2a5ece..0bae2b6 100644 (file)
@@ -31,6 +31,8 @@
 require_once("mod_error-reporter/init.inc");
 require_once("sec/secure.inc");
 
+db_user("errorreporter");
+
 html_header("<style type='text/css'>
 td.errors-form-description {
   width: 12em;
@@ -49,7 +51,7 @@ $strError = "";
 
 PageBlue(_c("error-reporter:Report an error"), "mod_error-reporter");
 
-if(!$cfgErrors->userHasAccess()) {
+if(!erConfig::userHasAccess()) {
   printf("<p class='err'>%s</p>\n", ER_ERROR_ACCESS_DENIED);
   _PageBlue();
   exit();
@@ -73,7 +75,7 @@ if($getAction == "delete" and isset($getUid)) {
         _c("error-reporter:The specified error report does not exist!"));
       Option(_("Back"), null, "href='".$_SERVER["PHP_SELF"]."'", "back");
     } else {
-      if($cfgErrors->userIsAdmin() or $doc->userIsOwner($getUid)) {
+      if(erConfig::userIsAdmin() or $doc->userIsOwner($getUid)) {
         echo sprintf("<form action='%s' method='post'>\n", 
           $view->getDeleteURL($getUid));
         echo sprintf("<p>%s</p>", _c("error-reporter:You are about to delete ".
@@ -98,7 +100,7 @@ if($getAction == "delete" and isset($getUid)) {
 echo sprintf("<form action='%s' method='get'></form>\n", $_SERVER["PHP_SELF"]);
 
 // probably we have to insert an error report
-if(($getAction == "submit" and $postSubmit == _("Insert")))
+if(($getAction == "submit" and $postSubmit == _c("error-reporter:Submit")))
 {
   // All fields must be filled out
   if((trim($postMachine) == "") or (trim($postText) == "")) {
@@ -107,7 +109,8 @@ if(($getAction == "submit" and $postSubmit == _("Insert")))
   } else {
     // Write to database
     $nNewUid = null;
-    $er = new erErrorReport(time(), $_SESSION["act"], $postMachine, $postText, $postHidden == "true");
+    $er = new erErrorReport(time(), $_SESSION["act"], $postMachine, $postText,
+      $postHidden == "true");
     try {
       $nNewUid = $doc->writeErrorReport($er); 
     } catch(Exception $e) {
@@ -165,7 +168,7 @@ echo sprintf("<tr><td /><td><input type='hidden' name='hidden' ".
   "Visible only for administrators (use this if your report is about security ".
   "issues)"));
 echo sprintf("<tr><td /><td><input type='submit' name='submit' value='%s' />".
-  "d></tr>\n", _("Insert"));
+  "</td></tr>\n", _c("error-reporter:Submit"));
 echo "</table></form><p />\n";
 
 _PageBlue();
This page took 0.023043 seconds and 4 git commands to generate.