From 16225a373ffa1c83ace7008c6ab1b11dc4ae57cb Mon Sep 17 00:00:00 2001
From: Dennis Ahrens <dennis.ahrens@hs-hannover.de>
Date: Thu, 25 Aug 2022 17:23:25 +0200
Subject: [PATCH] Log the user before it gets deleted to see why it dies

---
 auth.php | 1 +
 1 file changed, 1 insertion(+)

diff --git a/auth.php b/auth.php
index e91c781..7a44d33 100644
--- a/auth.php
+++ b/auth.php
@@ -389,6 +389,7 @@ class auth_plugin_ldap_syncplus extends auth_plugin_ldap {
                     $graceperiod = max(intval($this->config->removeuser_graceperiod), 0);
                             // Fix problems if grace period setting was negative or no number.
                     if (time() - $user->timemodified >= $graceperiod * 24 * 3600) {
+                        mtrace(sprintf("\t try to delete user: %s (%d)", $user->username, $user->id));
                         if (delete_user($user)) {
                             mtrace("\t".get_string('auth_dbdeleteuser', 'auth_db', array('name'=>$user->username, 'id'=>$user->id)));
                         } else {
-- 
GitLab