diff --git a/htdocs/user/ldap.php b/htdocs/user/ldap.php index ab95f1ad25e..328e14910ae 100644 --- a/htdocs/user/ldap.php +++ b/htdocs/user/ldap.php @@ -1,6 +1,7 @@ - * Copyright (C) 2006-2021 Regis Houssin +/* Copyright (C) 2006-2012 Laurent Destailleur + * Copyright (C) 2006-2021 Regis Houssin + * Copyright (C) 2024 William Mead * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,7 +34,7 @@ $langs->loadLangs(array('users', 'admin', 'companies', 'ldap')); $id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09'); -$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'userldap'; // To manage different context of search +$contextpage = GETPOST('contextpage', 'aZ') ?: 'userldap'; // To manage different context of search // Security check $socid = 0; @@ -125,6 +126,7 @@ print ''; if (getDolGlobalString('LDAP_SERVER_TYPE') == "activedirectory") { $ldap = new Ldap(); $result = $ldap->connectBind(); + $userSID = ''; if ($result > 0) { $userSID = $ldap->getObjectSid($object->login); } @@ -204,6 +206,7 @@ if ($result > 0) { $ldap->unbind(); } else { + print ''.$langs->trans("ErrorFailedToReadLDAP").''; setEventMessages($ldap->error, $ldap->errors, 'errors'); }