From f19b623bd915e25d83a64e2fd11ef64d6a70573d Mon Sep 17 00:00:00 2001
From: Petr Skoda <skodak@moodle.org>
Date: Sat, 31 Oct 2009 22:55:17 +0000
Subject: [PATCH] MDL-20695 do not use trigger_error together with echo, it
 just duplicates info when debugdisplay on

---
 enrol/enrol.class.php | 6 ++----
 enrol/ldap/enrol.php  | 5 ++---
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/enrol/enrol.class.php b/enrol/enrol.class.php
index 50e719efa7..8ff8afd605 100644
--- a/enrol/enrol.class.php
+++ b/enrol/enrol.class.php
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 
 /**
 * enrolment_factory is used to "manufacture" an instance of required enrolment plugin.
@@ -15,10 +15,8 @@ class enrolment_factory {
             $class = "enrolment_plugin_$enrol";
             return new $class;
         } else {
-            trigger_error("$CFG->dirroot/enrol/$enrol/enrol.php does not exist");
+            error_log("$CFG->dirroot/enrol/$enrol/enrol.php does not exist");
             echo $OUTPUT->notification("Enrolment file $enrol/enrol.php does not exist");
         }
     }
 }
-
-?>
diff --git a/enrol/ldap/enrol.php b/enrol/ldap/enrol.php
index a886d5663d..7a1d6e815b 100755
--- a/enrol/ldap/enrol.php
+++ b/enrol/ldap/enrol.php
@@ -1,4 +1,4 @@
-<?php  // $Id$
+<?php
 
 require_once("$CFG->dirroot/enrol/enrol.class.php");
 
@@ -431,7 +431,7 @@ function enrol_ldap_connect(){
                                  $CFG->enrol_ldap_bind_pw );
             if (!$bind) {
                 echo $OUTPUT->notification("Error in binding to LDAP server");
-                trigger_error("Error in binding to LDAP server $!");
+                error_log("Error in binding to LDAP server $!");
             }
 
         }
@@ -655,4 +655,3 @@ function check_legacy_config () {
 
 } // end of class
 
-?>
-- 
2.39.5