Skip to content

Commit

Permalink
Merge pull request #919 from ltb-project/909-fix-smarty-warnings
Browse files Browse the repository at this point in the history
remove smarty messages in error logs unless $smarty_debug is set to true (#909)
  • Loading branch information
coudot committed Jun 19, 2024
2 parents 08129c4 + 3d09783 commit a568547
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions conf/config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@
#$smarty_cache_dir = "/var/cache/self-service-password/cache";

# Smarty debug mode - will popup debug information on web interface
# and add many smarty debug messages in error logs
$smarty_debug = false;

## Custom Password Fields
Expand Down
3 changes: 2 additions & 1 deletion docs/config_general.rst
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ This is also possible to enable Smarty debug, for web interface issues:
$smarty_debug = true;
.. tip:: Debug messages will appear on web interface.
.. tip:: Debug messages will appear on web interface as a popup.
You will also have many more messages in error logs.

.. _security:

Expand Down
9 changes: 9 additions & 0 deletions htdocs/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,15 @@
$smarty->setCompileDir($compile_dir);
$smarty->setCacheDir($cache_dir);
$smarty->debugging = $smarty_debug;
if(isset($smarty_debug) && $smarty_debug == true )
{
$smarty->error_reporting = E_ALL;
}
else
{
# Do not report smarty stuff unless $smarty_debug == true
$smarty->error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED & ~E_WARNING;
}

# Assign configuration variables
$smarty->assign('ldap_params',array('ldap_url' => $ldap_url, 'ldap_starttls' => $ldap_starttls, 'ldap_binddn' => $ldap_binddn, 'ldap_bindpw' => $ldap_bindpw));
Expand Down

0 comments on commit a568547

Please sign in to comment.