Skip to content

Commit

Permalink
Merge pull request #913 from maichouni-mitek/912-php-notices
Browse files Browse the repository at this point in the history
fix: hide php notices from the end user in the web ui
  • Loading branch information
coudot authored Jun 12, 2024
2 parents cf1bcd8 + f240685 commit 4a94732
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions htdocs/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,13 @@
# Ensure requested action is available, or fall back to default
if ( ! in_array($action, $available_actions) ) { $action = $default_action; }

error_reporting(0);
if ($debug) {
error_reporting(E_ALL);
# Set debug for LDAP
ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
}

if (file_exists($action.".php")) { require_once($action.".php"); }

#==============================================================================
Expand All @@ -217,13 +224,6 @@
$smarty->setCacheDir($cache_dir);
$smarty->debugging = $smarty_debug;

error_reporting(0);
if ($debug) {
error_reporting(E_ALL);
# Set debug for LDAP
ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
}

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

0 comments on commit 4a94732

Please sign in to comment.