<?php
/**
- * @file class_erConfig.inc
+ * @file class_erConfig.inc
* Class that handles the configuration
* @author Roland Hieber (roland.hieber@wilhelm-gym.net)
* @date 21.10.2007
- *
+ *
* Copyright © 2007 Roland Hieber
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
require_once("sec/secure.inc");
require_once("mod_error-reporter/functions.inc");
-
-/**
- * Determines if a privilege has been assigned
- * @param $sPriv (string) Privilege to test
- * @return bool
- */
-function erPrivilegeAssigned($sPriv) {
- $h = db_query("SELECT act FROM privileges_assign WHERE privilege = $1;",
- $sPriv);
- return pg_num_rows($h) > 0;
-}
-
-/**
- * Retrieve all groups that have a privilege assigned
- * @param $strPriv (string) Privilege to test
- * @return array
- */
-function erPrivilegedGroups($strPriv) {
- $aReturn = array();
- $h = db_query("SELECT act FROM privileges_assign WHERE privilege = $1 ".
- "ORDER BY act;", $strPriv);
- if(pg_num_rows($h) > 0) {
- while($a = pg_fetch_array($h)) {
- $aReturn[] = $a["act"];
- }
- }
- return $aReturn;
-}
-
-define("ER_CONFIGFILE_HEADER", "<?php
-/**
- * config.inc -- configuration file for iserv-mod-error-reporter
- * This file is written by the configuration script.
- */\n");
+require_once("db.inc");
/** @todo document */
class erConfig {
- /** (bool) Status of mail notification */
- protected $bMailNotify;
- /** (string) Address to send the notification mails to */
- protected $strMailNotifyAddr;
-
- /**
- * @name Constructor
- * @{
- */
+
/**
- * Constructor. Sets default values.
- * @return erConfig
+ * Determine if a privilege has been assigned
+ * @param $sPriv (string) Privilege to test
+ * @return bool
*/
- public function __construct() {
- $this->setMailNotify(true);
- $this->setMailNotifyAddr("admins, win-admins");
+ public static function privilegeAssigned($sPriv) {
+ $h = db_query("SELECT act FROM privileges_assign WHERE privilege = $1;",
+ $sPriv);
+ return pg_num_rows($h) > 0;
}
-
- /**
- * @}
- * @name Operations
- * @{
- */
-
+
/**
- * Write the current state of this instance to the config file.
- * @return (bool) If the function fails, it returns <tt>false</tt>. Call
- * getLastError() to get more information about the error.
+ * Retrieve all groups that have a privilege assigned
+ * @param $strPriv (string) Privilege to test
+ * @return array
*/
- public function writeConfig() {
- // Open config file
- $hFile = fopen("mod_error-reporter/config.inc", "w", true);
- if(!is_resource($hFile)) {
- setLastError(ER_ERROR_OPEN_FILE);
- return false;
- }
- // Try to lock file repeatedly
- for($n = 0; !flock($hFile, LOCK_EX); $n++) {
- if($n > 10) {
- setLastError(ER_ERROR_LOCK_FILE);
- return false; // Give up
- } else {
- sleep(0.1); // Retry after 100 ms
+ public static function privilegedGroups($strPriv) {
+ $aReturn = array();
+ $h = db_query("SELECT act FROM privileges_assign WHERE privilege = $1 ".
+ "ORDER BY act;", $strPriv);
+ if(pg_num_rows($h) > 0) {
+ while($a = pg_fetch_array($h)) {
+ $aReturn[] = $a["act"];
}
}
-
- // Create text for config file
- $strFile = ER_CONFIGFILE_HEADER;
-
- // Mail notification
- $strFile .= sprintf("\$cfgErrors->setMailNotify(%s);\n",
- $this->isMailNotify() ? "true" : "false");
- $strFile .= sprintf("\$cfgErrors->setMailNotifyAddr('%s');\n",
- $this->getMailNotifyAddr());
-
- $strFile .= "?>";
-
- // Write to config file and unlock it
- if(fwrite($hFile, $strFile) == false) {
- setLastError(ER_ERROR_WRITE_FILE);
- return false;
- }
- if(!flock($hFile, LOCK_UN)) {
- setLastError(ER_ERROR_UNLOCK_FILE);
- return false;
- }
- return true;
+ return $aReturn;
}
-
- public function readConfig() {
- global $cfgErrors;
- require("error-reporter/config.inc");
- }
-
- /**
- * @}
- * @name Setting options
- * @{
- */
-
- /**
- * Enable or disable mail notification
- * @param $b (bool) <tt>true</tt> to enable mail notification, <tt>false</tt>
- * to disable it.
- */
- public function setMailNotify($b) { $this->bMailNotify = ($b == true); }
-
- /**
- * Set the mail address(es) for mail notification
- * @param $str (string) The adresses to send the notofication mails to,
- * comma-separated
- */
- public function setMailNotifyAddr($str) { $this->strMailNotifyAddr = $str; }
-
- /**
- * @}
- * @name Retrieving options
- * @{
- */
-
- /**
- * Determine if mail notification is enabled
- * @return (bool) <tt>true</tt> if mail notification is enabled, otherwise
- * <tt>false</tt>
- */
- public function isMailNotify() { return $this->bMailNotify; }
-
- /**
- * Get the mail adress(es) for mail notification
- * @return string
- */
- public function getMailNotifyAddr() { return $this->strMailNotifyAddr; }
/**
* Determine if the current user is allowed to see and report errors. This
* function tests if the user is member of a group which has the
* <tt>mod-errorreporter_access</tt> privilege.
- * @return bool
+ * @return bool
*/
- public function userHasAccess() {
- if($this->userIsAdmin() ||
- !erPrivilegeAssigned("mod_errorreporter_access")) {
+ public static function userHasAccess() {
+ if(erConfig::userIsAdmin() ||
+ !erConfig::privilegeAssigned("mod_errorreporter_access")) {
// user is admin or privilege is not assigned
return true;
} else {
return secure_privilege("mod_errorreporter_access");
}
}
-
- /* legacy */
- public function userIsAllowed() { return $this->userHasAccess(); }
-
+
/**
- * Determine if the current user has admin rights. This function tests if
- * the user is member of a group which has the
+ * Determine if the current user has admin rights. This function tests if
+ * the user is member of a group which has the
* <tt>mod-errorreporter_access</tt> privilege
- * @return bool
+ * @return bool
*/
- public function userIsAdmin() {
+ public static function userIsAdmin() {
return secure_privilege("mod_errorreporter_admin");
}
-
+
/** @} */
}
?>
* A container class for an error report
* @author Roland Hieber (roland.hieber@wilhelm-gym.net)
* @date 18.10.2007
- *
+ *
* Copyright © 2007 Roland Hieber
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
var $strCommentOwner;
/** (bool) Indicate if the report can be seen by non-administrators */
var $bHidden;
-
+
/**
* @publicsection
* @name Constructor
* non-administrators
* @return erError
*/
- function erErrorReport($tsDate = null, $strOwner = null, $strMachine = null, $strText = null,
- $bHidden = false) {
+ function erErrorReport($tsDate = null, $strOwner = null, $strMachine = null,
+ $strText = null, $bHidden = false) {
$this->nUid = null;
$this->tsDate = intval($tsDate);
$this->strOwner = $strOwner;
$this->strCommentOwner = null;
$this->bHidden = ($bHidden == true);
}
-
+
////////////////////////////// SETTER FUNCTIONS //////////////////////////////
-
+
/**
* @}
* @name Setter functions
* @{
*/
-
+
/**
* Set the unique ID
* @param $value (int)
* administrators
*/
function setVisibility($value) { $this->bHidden = $value; }
-
+
////////////////////////////// GETTER FUNCTIONS //////////////////////////////
-
+
/**
* @}
* @name Getter functions
* @{
*/
-
+
/**
* Get the unique ID in the database
* @return (int)
*/
function getDate() { return intval($this->tsDate); }
/**
- * Get the account name of the creator
+ * Get the account name of the creator
* @return (string)
*/
function getOwner() { return $this->strOwner; }
* @return (bool)
*/
function isHidden() { return ($this->bHidden == true); }
-
+
/**@}*/
}
?>
require_once("mod_error-reporter/class_erErrorReport.inc");
require_once("mod_error-reporter/class_erConfig.inc");
require_once("mod_error-reporter/functions.inc");
+require_once("cfg.inc");
require_once("db.inc");
require_once("user.inc");
*/
class erErrorReportManager {
-
-
- /**
- * (object of type erConfig) pointer to the configuration class
- */
- protected $objcfg;
-
- /**
- * Constructor
- * @param $objcfg (object of type erConfig) Pointer to the configuration
- * class for retrieving the
- * configuration data
- * @return erErrorReportManager
- */
- public function __construct(&$objcfg) {
- $this->objcfg = &$objcfg;
- }
/////////////////////////////////// QUERYING /////////////////////////////////
// only allow visible reports for non-admins, but all reports for
// admins and owners
- if($this->objcfg->userIsAdmin()) {
+ if(erConfig::userIsAdmin()) {
$strWhereClause = (trim($strWhere) == "") ? "" : "WHERE $strWhere";
} else {
$strWhereClause = "WHERE ".((trim($strWhere) == "") ? "" :
* @throws Exception
*/
public function writeErrorReport(erErrorReport $er) {
- if(!$this->objcfg->userHasAccess() and (!$this->userIsOwner($er->nUid) or
- ($er->getUid() == null and !($this->objcfg->userIsAdmin())))) {
+ if(!erConfig::userHasAccess() and (!$this->userIsOwner($er->nUid) or
+ ($er->getUid() == null and !(erConfig::userIsAdmin())))) {
throw new Exception(ER_ERROR_ACCESS_DENIED);
}
erInsertLog($strLog);
// send notification mail, but only if the message is new
- if($this->objcfg->isMailNotify() and $er->getUid() == null) {
+ if(cfg("errorreportermailnotify") and $er->getUid() == null) {
$strMailText = sprintf("<html><body>\nEin Benutzer hat eine ".
"Fehlermeldung mit dem Fehlermeldungs-Assistenten abgeschickt. ".
"Nachfolgend finden sich Angaben über den Fehler.\n".
$strMailHeader = sprintf("From: %s <%s>\n".
"Content-Type: text/html; charset=utf-8",
q(erGetRealUserName($er->getOwner())), user_mail_addr($er->getOwner()));
- mail($this->objcfg->getMailNotifyAddr(), $strMailSubject, $strMailText,
+ mail(cfg("errorreportermailaddress"), $strMailSubject, $strMailText,
$strMailHeader);
}
* information.
*/
public function deleteErrorReport($nErrorReportID) {
- if(!($this->objcfg->userIsAdmin() or $this->userIsOwner($nErrorReportID))) {
+ if(!(erConfig::userIsAdmin() or $this->userIsOwner($nErrorReportID))) {
setLastError(ER_ERROR_ACCESS_DENIED);
return -1;
}
/** @todo document */
class erErrorReportView {
- /** (erConfig) pointer to the configuration class */
- protected $objcfg;
/** (erErrorReportManager) pointer to a erErrorReportManager instance */
protected $objManager;
/**
/**
* Constructor
- * @param $objcfg (erConfig) Pointer to an instance of the erConfig class for
- * retrieving the configuration data
* @param $objemm (erErrorReportManager) Pointer to a instance of the
* erErrorReportManager class for retrieving the document data
* @return erErrorReportView
*/
- public function __construct(erConfig &$objcfg, erErrorReportManager &$objemm) {
- $this->objcfg = $objcfg;
+ public function __construct(erErrorReportManager &$objemm) {
$this->objManager = $objemm;
html_header("<style type='text/css'>
table.errors-view-table { width:100%; border:2px solid #5276AB; }
$sColor = sprintf("rgb(%d,%d,%d)", ($nColor >> 16) % 256,
($nColor >> 8) % 256, $nColor % 256);
echo "<tr style='background-color:$sColor'>";
- if($this->objcfg->userIsAdmin() or
+ if(erConfig::userIsAdmin() or
$this->objManager->userIsOwner($objem->getUid())) {
// user is admin or owner
echo "<td style='padding:3px'><{$GLOBALS["invtbl"]} width='100%'>\n";
// this includes all the other things
require_once("mod_error-reporter/class_erErrorReportView.inc");
+require_once("share.inc");
-$cfgErrors = new erConfig();
-require_once("mod_error-reporter/config.inc");
-
-$doc = new erErrorReportManager($cfgErrors);
-$view = new erErrorReportView($cfgErrors, $doc);
+$doc = new erErrorReportManager();
+$view = new erErrorReportView($doc);
$view->setDeleteURL("index.php?action=delete");
$view->setEditURL("detail.php");
?>
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-require_once("mod_error-reporter/init.inc");
-if($cfgErrors->userHasAccess()) {
+require_once("mod_error-reporter/class_erConfig.inc");
+
+if(erConfig::userHasAccess()) {
TreeNode(_c("error-reporter:Report an error"), "mod_error-reporter/index.php",
"mod_error-reporter");
}
+++ /dev/null
-<?php
-/**
- * @file 99error-reporter-cfg.mod -- menu item for configuration
- * @author Roland Hieber (roland.hieber@wilhelm-gym.net)
- * @date 27.10.2007
- *
- * Copyright © 2007 Roland Hieber
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-TreeNode(_c("error-reporter:Error Report Wizard"),
- "mod_error-reporter/config.php", "mod_error-reporter");
-?>
+++ /dev/null
-<?php
-/**
- * @file config.php
- * Configuration page
- * @author Roland Hieber (roland.hieber@wilhelm-gym.net)
- * @date 22.10.2007
- *
- * Copyright © 2007 Roland Hieber
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-require_once("mod_error-reporter/class_erConfig.inc");
-require_once("mod_error-reporter/functions.inc");
-require_once("share.inc");
-require_once("ctrl.inc");
-require_once("db.inc");
-require_once("sec/admsecure.inc");
-
-db_user("errorreporter");
-
-html_header("<style type='text/css'>
-td.errors-cfg-field {
- padding: 1em;
- width: 50%;
- vertical-align: top;
-}
-td.errors-cfg-field input {
- margin: 0;
-}
-.errors-cfg-field-heading {
- font-weight: bold;
-}
-</style>");
-
-$cfgErrors = new erConfig();
-require_once("mod_error-reporter/config.inc");
-
-PageBlue(_c("error-reporter-cfg:Error Report Wizard – Configuration"),
- "mod_error-reporter");
-
-if(@$_POST["submit"] == _("Save")) {
- $bMailNotify = (@$_POST["mailnotify"] == "true");
- $strMailNotifyAddr = @$_POST["mailnotifyaddr"];
- $bLog = (@$_POST["log"] == "true");
-
- if($bMailNotify != $cfgErrors->isMailNotify()) {
- $cfgErrors->setMailNotify($bMailNotify);
- echo sprintf("<p>%s</p>\n", _c("error-reporter-cfg:Set mail ".
- "notification."));
- }
- if($strMailNotifyAddr != $cfgErrors->getMailNotifyAddr()) {
- if(!erIsMailAddress($strMailNotifyAddr)) {
- echo sprintf("<p class='err'>%s</p>", _c("error-reporter-cfg:The ".
- "specified string is not a valid e-mail address!"));
- } else {
- $cfgErrors->setMailNotifyAddr($strMailNotifyAddr);
- echo sprintf("<p>%s</p>\n", _c("error-reporter-cfg:Set mail ".
- "notification address."));
- }
- }
- $cfgErrors->writeConfig();
-}
-
-// two columns
-echo "<table border='0' cellspacing='10' cellpadding='0'><tr>".
- "<td width='50%'>\n";
-
-// Mail notification
-GroupBox(_c("error-reporter-cfg:Mail notification"), "mail");
-echo "<form method='post'>\n";
-echo "<table class='errors-cfg-table'>\n";
-echo sprintf("<tr><td class='errors-cfg-field'><label for='mailnotify' ".
- "class='errors-cfg-field-heading'>%s</label><br />%s</td><td ".
- "class='errors-cfg-field'><input type='checkbox' name='mailnotify' ".
- "id='mailnotify' value='true'%s /></td></tr>",
- _c("error-reporter-cfg:Enable mail notification"),
- _c("error-reporter-cfg:If this option is enabled, everytime an error report ".
- "is submitted, an e-mail with information about the report will be sent to ".
- "the address specified below."), $cfgErrors->isMailNotify() ?
- " checked='checked'" : "");
-echo sprintf("<tr><td class='errors-cfg-field'><label for='mailnotifyaddr'".
- "class='errors-cfg-field-heading'>%s</label><br />%s</td>".
- "<td class='errors-cfg-field'><input type='text' name='mailnotifyaddr' ".
- "id='mailnotifyaddr' size='30' value='%s' /></td></tr>",
- _c("error-reporter-cfg:Mail address to send the notification mail to"),
- _c("error-reporter-cfg:If mail notifications are enabled, any notification ".
- "mails are sent to the address specified here. You can give more than one ".
- "address by separating them with a comma."),
- q($cfgErrors->getMailNotifyAddr()));
-echo sprintf("<tr><td class='errors-cfg-field'><$stdbtn name='submit' ".
- "value='%s' /></td></tr>\n", _("Save"));
-echo "</table>\n</form>\n";
-_GroupBox();
-
-echo "</td><td>\n";
-
-// Privileges
-GroupBox(_("Privileges"), "keys");
-$asAccessGroups = erPrivilegedGroups("mod_errorreporter_access");
-$asAdminGroups = erPrivilegedGroups("mod_errorreporter_admin");
-echo sprintf("<p>%s</p>\n<p>%s</p>\n<p>%s</p>", _c("error-reporter:This is ".
- "a short summary of the privileges related to the error report assistant ".
- "and the groups which have them assigned."),
- sprintf(_c("error-reporter:If one of these privileges is not assigned to ".
- "any group, all users on this server are allowed to perform the specified ".
- "action. Please use the %sgroup administration%s to assign and revoke ".
- "privileges."), "<a href='/idesk/admin/act/groups.php'>", "</a>"),
- _c("error-reporter:Please note that every group with the administration ".
- "privilege can also implicitly report errors and see the reported ".
- "messages."));
-echo "<p><table style='width:100%'><tr>\n";
-echo sprintf("<td>%s%s</td><td>%s</td>\n", icon("keys"),
- _("View error reports and report errors").":", $asAccessGroups == array() ?
- _c("error-reporter:all users") : icon("act-group") . join(", ",
- array_map("erGetGroupName", $asAccessGroups)));
-echo "</tr><tr>\n";
-echo sprintf("<td>%s%s</td><td>%s</td>\n", icon("keys"),
- _("Administration of the error report wizard"),
- $asAdminGroups == array() ? _c("error-reporter:no users") :
- icon("act-group") . join(", ", array_map("erGetGroupName", $asAdminGroups)));
-echo "</tr></table></p>\n";
-_GroupBox();
-
-echo "</td></tr></table>\n";
-
-_PageBlue();
-?>
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();
}
// 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();
// Probably we have to update an error report
if($getAction == "update" and $postSubmit == _("Change"))
{
- if($cfgErrors->userIsAdmin()) {
+ if(erConfig::userIsAdmin()) {
$postComment = stripslashes(@$_POST["comment"]);
$postCommentOld = stripslashes(@$_POST["comment_old"]);
}
$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"]);
}
"<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() != "") {
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();
_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 ".
} 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) {