1 | <?php |
||
12 | class LDAPFakeGateway extends LDAPGateway implements TestOnly |
||
13 | { |
||
14 | public function __construct() |
||
18 | |||
19 | private static $data = [ |
||
20 | 'groups' => [ |
||
21 | 'CN=Users,DC=playpen,DC=local' => [ |
||
22 | ['dn' => 'CN=Group1,CN=Users,DC=playpen,DC=local'], |
||
23 | ['dn' => 'CN=Group2,CN=Users,DC=playpen,DC=local'], |
||
24 | ['dn' => 'CN=Group3,CN=Users,DC=playpen,DC=local'], |
||
25 | ['dn' => 'CN=Group4,CN=Users,DC=playpen,DC=local'], |
||
26 | ['dn' => 'CN=Group5,CN=Users,DC=playpen,DC=local'] |
||
27 | ], |
||
28 | 'CN=Others,DC=playpen,DC=local' => [ |
||
29 | ['dn' => 'CN=Group6,CN=Others,DC=playpen,DC=local'], |
||
30 | ['dn' => 'CN=Group7,CN=Others,DC=playpen,DC=local'], |
||
31 | ['dn' => 'CN=Group8,CN=Others,DC=playpen,DC=local'] |
||
32 | ] |
||
33 | ], |
||
34 | 'users' => [ |
||
35 | '123' => [ |
||
36 | 'distinguishedname' => 'CN=Joe,DC=playpen,DC=local', |
||
37 | 'objectguid' => '123', |
||
38 | 'cn' => 'jbloggs', |
||
39 | 'useraccountcontrol' => '1', |
||
40 | 'givenname' => 'Joe', |
||
41 | 'sn' => 'Bloggs', |
||
42 | 'mail' => '[email protected]' |
||
43 | ] |
||
44 | ] |
||
45 | ]; |
||
46 | |||
47 | public function authenticate($username, $password) |
||
50 | |||
51 | public function getNodes($baseDn = null, $scope = Ldap::SEARCH_SCOPE_SUB, $attributes = [], $sort = '') |
||
54 | |||
55 | public function getGroups($baseDn = null, $scope = Ldap::SEARCH_SCOPE_SUB, $attributes = [], $sort = '') |
||
61 | |||
62 | public function getNestedGroups($dn, $baseDn = null, $scope = Ldap::SEARCH_SCOPE_SUB, $attributes = []) |
||
65 | |||
66 | public function getGroupByGUID($guid, $baseDn = null, $scope = Ldap::SEARCH_SCOPE_SUB, $attributes = []) |
||
69 | |||
70 | public function getUsers($baseDn = null, $scope = Ldap::SEARCH_SCOPE_SUB, $attributes = [], $sort = '') |
||
73 | |||
74 | public function getUserByGUID($guid, $baseDn = null, $scope = Ldap::SEARCH_SCOPE_SUB, $attributes = []) |
||
78 | |||
79 | public function update($dn, array $attributes) |
||
82 | |||
83 | public function delete($dn, $recursively = false) |
||
86 | |||
87 | public function move($fromDn, $toDn, $recursively = false) |
||
90 | |||
91 | public function add($dn, array $attributes) |
||
94 | } |
||
95 |