Skip to content
Snippets Groups Projects
Commit c2837a94 authored by Jaime Pérez Crespo's avatar Jaime Pérez Crespo
Browse files

Fix for issue #584.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3314 44740490-163a-0410-bde0-09ae8108e29a
parent f1a00265
No related branches found
No related tags found
No related merge requests found
......@@ -46,8 +46,15 @@ $config = array (
*/
'debug' => FALSE,
/*
* When showerrors is enabled, all error messages and stack traces will be output
* to the browser.
*
* When errorreporting is enabled, a form will be presented for the user to report
* the error to technicalcontact_email.
*/
'showerrors' => TRUE,
'errorreporting' => TRUE,
/**
* Custom error show function called from SimpleSAML_Error_Error::show.
......
......@@ -263,7 +263,8 @@ class SimpleSAML_Error_Error extends SimpleSAML_Error_Exception {
$data['includeTemplate'] = $this->includeTemplate;
/* Check if there is a valid technical contact email address. */
if($config->getString('technicalcontact_email', 'na@example.org') !== 'na@example.org') {
if($config->getBoolean('errorreporting', TRUE) &&
$config->getString('technicalcontact_email', 'na@example.org') !== 'na@example.org') {
/* Enable error reporting. */
$baseurl = SimpleSAML_Utilities::getBaseURL();
$data['errorReportAddress'] = $baseurl . 'errorreport.php';
......
......@@ -91,7 +91,7 @@ if (!preg_match('/\s/', $email) && strpos($email, '@') !== FALSE) {
/* Send the email. */
$toAddress = $config->getString('technicalcontact_email', 'na@example.org');
if ($toAddress !== 'na@example.org') {
if ($config->getBoolean('errorreporting', TRUE) && $toAddress !== 'na@example.org') {
$email = new SimpleSAML_XHTML_EMail($toAddress, 'simpleSAMLphp error report', $from);
$email->setBody($message);
$email->send();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment