migrate from zend-ldap to laminas-ldap (#1530)
This commit is contained in:
committed by
GitHub
parent
e7458e76e1
commit
e4610af235
@@ -125,7 +125,7 @@
|
||||
},
|
||||
"suggest": {
|
||||
"ext-mbstring": "If ext-mbstring is not available you MUST install symfony/polyfill-mbstring",
|
||||
"zendframework/zend-ldap": "For LDAP authentication with Kimai"
|
||||
"laminas/laminas-ldap": "For LDAP authentication with Kimai"
|
||||
},
|
||||
"scripts": {
|
||||
"auto-scripts": {
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
namespace App\Ldap;
|
||||
|
||||
use App\Configuration\LdapConfiguration;
|
||||
use Laminas\Ldap\Exception\LdapException;
|
||||
use Laminas\Ldap\Ldap;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
use Zend\Ldap\Exception\LdapException;
|
||||
use Zend\Ldap\Ldap;
|
||||
|
||||
/**
|
||||
* Inspired by https://github.com/Maks3w/FR3DLdapBundle @ MIT License
|
||||
@@ -57,9 +57,9 @@ class LdapDriver
|
||||
protected function getDriver()
|
||||
{
|
||||
if (null === $this->driver) {
|
||||
if (!class_exists('Zend\Ldap\Ldap')) {
|
||||
if (!class_exists('Laminas\Ldap\Ldap')) {
|
||||
throw new \Exception(
|
||||
'Zend\Ldap\Ldap is missing, install it with "composer require zendframework/zend-ldap" ' .
|
||||
'Laminas\Ldap\Ldap is missing, install it with "composer require laminas/laminas-ldap" ' .
|
||||
'or deactivate LDAP, see https://www.kimai.org/documentation/ldap.html'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,9 +12,9 @@ namespace App\Tests\Ldap;
|
||||
use App\Entity\User;
|
||||
use App\Ldap\LdapDriver;
|
||||
use App\Ldap\LdapDriverException;
|
||||
use Laminas\Ldap\Exception\LdapException;
|
||||
use Laminas\Ldap\Ldap;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Zend\Ldap\Exception\LdapException;
|
||||
use Zend\Ldap\Ldap;
|
||||
|
||||
/**
|
||||
* @covers \App\Ldap\LdapDriver
|
||||
@@ -24,7 +24,7 @@ class LdapDriverTest extends TestCase
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
if (!class_exists('Zend\Ldap\Ldap')) {
|
||||
if (!class_exists('Laminas\Ldap\Ldap')) {
|
||||
$this->markTestSkipped('LDAP is not installed');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user