make send-report an option for admin and customer (section: security)

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2013-12-02 20:26:39 +01:00
parent ede732417e
commit 30f7d0a070
12 changed files with 166 additions and 9 deletions

View File

@@ -294,7 +294,7 @@ class Database {
* @param bool $showerror if set to false, the error will be logged but we go on
*/
private static function _showerror($error, $showerror = true) {
global $theme, $linker;
global $userinfo, $theme, $linker;
/**
* log to a file, so we can actually ask people for the error
@@ -330,7 +330,17 @@ class Database {
// replace values
$err_hint = str_replace("<TEXT>", $error->getMessage(), $err_hint);
$err_hint = str_replace("<DEBUG>", $error->getTraceAsString(), $err_hint);
$err_hint = str_replace("<LINK>", $linker->getLink(array('section' => 'index', 'page' => 'send_error_report', 'errorid' => $errid)), $err_hint);
$err_report_html = '';
if (is_array($userinfo) && (
($userinfo['adminsession'] == '1' && $settings['system']['allow_error_report_admin'] == '1')
|| ($userinfo['adminsession'] == '0' && $settings['system']['allow_error_report_customer'] == '1'))
) {
$err_report_html = '<a href="<LINK>" title="Click here to report error">Report error</a>';
$err_report_html = str_replace("<LINK>", $linker->getLink(array('section' => 'index', 'page' => 'send_error_report', 'errorid' => $errid)), $err_report_html);
}
$err_hint = str_replace("<REPORT>", $err_report_html, $err_hint);
// show
die($err_hint);
}