Source of file LDAPFakeGateway.php
Size: 2,546 Bytes - Last Modified: 2021-12-23T10:27:14+00:00
/var/www/docs.ssmods.com/process/src/tests/model/LDAPFakeGateway.php
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 | <?php class LDAPFakeGateway extends LDAPGateway implements TestOnly { public function __construct() { // do nothing } private static $data = [ 'groups' => [ 'CN=Users,DC=playpen,DC=local' => [ ['dn' => 'CN=Group1,CN=Users,DC=playpen,DC=local'], ['dn' => 'CN=Group2,CN=Users,DC=playpen,DC=local'], ['dn' => 'CN=Group3,CN=Users,DC=playpen,DC=local'], ['dn' => 'CN=Group4,CN=Users,DC=playpen,DC=local'], ['dn' => 'CN=Group5,CN=Users,DC=playpen,DC=local'] ], 'CN=Others,DC=playpen,DC=local' => [ ['dn' => 'CN=Group6,CN=Others,DC=playpen,DC=local'], ['dn' => 'CN=Group7,CN=Others,DC=playpen,DC=local'], ['dn' => 'CN=Group8,CN=Others,DC=playpen,DC=local'] ] ], 'users' => [ '123' => [ 'distinguishedname' => 'CN=Joe,DC=playpen,DC=local', 'objectguid' => '123', 'cn' => 'jbloggs', 'useraccountcontrol' => '1', 'givenname' => 'Joe', 'sn' => 'Bloggs', 'mail' => 'joe@bloggs.com' ] ] ]; public function authenticate($username, $password) { } public function getNodes($baseDn = null, $scope = Zend\Ldap\Ldap::SEARCH_SCOPE_SUB, $attributes = [], $sort = '') { } public function getGroups($baseDn = null, $scope = Zend\Ldap\Ldap::SEARCH_SCOPE_SUB, $attributes = [], $sort = '') { if (isset($baseDn)) { return !empty(self::$data['groups'][$baseDn]) ? self::$data['groups'][$baseDn] : null; } } public function getNestedGroups($dn, $baseDn = null, $scope = Zend\Ldap\Ldap::SEARCH_SCOPE_SUB, $attributes = []) { } public function getGroupByGUID($guid, $baseDn = null, $scope = Zend\Ldap\Ldap::SEARCH_SCOPE_SUB, $attributes = []) { } public function getUsers($baseDn = null, $scope = Zend\Ldap\Ldap::SEARCH_SCOPE_SUB, $attributes = [], $sort = '') { } public function getUserByGUID($guid, $baseDn = null, $scope = Zend\Ldap\Ldap::SEARCH_SCOPE_SUB, $attributes = []) { return [self::$data['users'][$guid]]; } public function update($dn, array $attributes) { } public function delete($dn, $recursively = false) { } public function move($fromDn, $toDn, $recursively = false) { } public function add($dn, array $attributes) { } } |