Commit | Line | Data |
---|---|---|
3aab90bd | 1 | <?php |
2 | require_once 'CiviTest/CiviUnitTestCase.php'; | |
aba1cd8b EM |
3 | |
4 | /** | |
5 | * Class CRM_Group_Page_AjaxTest | |
6 | */ | |
3aab90bd | 7 | class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { |
8 | /** | |
9 | * Permissioned group is used both as an active group the contact can see and as a group that allows | |
10 | * logged in user to see contacts | |
11 | * @var integer | |
12 | */ | |
13 | protected $_permissionedGroup; | |
14 | /** | |
15 | * AS disabled group the contact has permission to | |
16 | * @var unknown | |
17 | */ | |
18 | protected $_permissionedDisabledGroup; | |
19 | ||
5c2ad8fb EM |
20 | protected $hookClass; |
21 | ||
aaac0e0b EM |
22 | protected $_params = array(); |
23 | ||
e9479dcf EM |
24 | /** |
25 | * @return array | |
26 | */ | |
3aab90bd | 27 | function get_info() { |
28 | return array( | |
29 | 'name' => 'Contact BAOs', | |
30 | 'description' => 'Test all Contact_BAO_Contact methods.', | |
31 | 'group' => 'CiviCRM BAO Tests', | |
32 | ); | |
33 | } | |
34 | ||
35 | function setUp() { | |
36 | parent::setUp(); | |
37 | $this->_params = array( | |
38 | 'sEcho' => '1', | |
39 | 'page' => 1, | |
40 | 'rp' => 50, | |
41 | 'offset' => 0, | |
42 | 'rowCount' => 50, | |
43 | 'sort' => NULL, | |
44 | 'is_unit_test' => TRUE, | |
45 | ); | |
46 | $this->hookClass = CRM_Utils_Hook::singleton(); | |
47 | $this->createLoggedInUser(); | |
48 | $this->_permissionedDisabledGroup = $this->groupCreate(array('title' => 'pick-me-disabled', 'is_active' => 0, 'name' => 'pick-me-disabled')); | |
49 | $this->_permissionedGroup = $this->groupCreate(array('title' => 'pick-me-active', 'is_active' => 1, 'name' => 'pick-me-active')); | |
50 | $this->groupCreate(array('title' => 'not-me-disabled', 'is_active' => 0, 'name' => 'not-me-disabled')); | |
51 | $this->groupCreate(array('title' => 'not-me-active', 'is_active' => 1, 'name' => 'not-me-active')); | |
52 | } | |
53 | ||
54 | function tearDown() { | |
55 | CRM_Utils_Hook::singleton()->reset(); | |
56 | $this->quickCleanup(array('civicrm_group')); | |
57 | $config = CRM_Core_Config::singleton(); | |
58 | unset($config->userPermissionClass->permissions); | |
59 | parent::tearDown(); | |
60 | } | |
61 | ||
62 | /** | |
aaac0e0b | 63 | * @param $permission |
3aab90bd | 64 | */ |
aaac0e0b EM |
65 | function setPermissionAndRequest($permission) { |
66 | CRM_Core_Config::singleton()->userPermissionClass->permissions = array($permission); | |
67 | CRM_Contact_BAO_Group::getPermissionClause(TRUE); | |
68 | global $_REQUEST; | |
69 | $_REQUEST = $this->_params; | |
70 | } | |
71 | ||
72 | /** | |
73 | * @param $permission | |
74 | * @param $hook | |
75 | */ | |
76 | function setHookAndRequest($permission, $hook) { | |
77 | CRM_Core_Config::singleton()->userPermissionClass->permissions = array($permission); | |
78 | $this->hookClass->setHook('civicrm_aclGroup', array($this, $hook)); | |
79 | CRM_Contact_BAO_Group::getPermissionClause(TRUE); | |
3aab90bd | 80 | global $_REQUEST; |
81 | $_REQUEST = $this->_params; | |
aaac0e0b EM |
82 | } |
83 | /** | |
84 | * retrieve groups as 'view all contacts' | |
85 | */ | |
86 | function testGroupListViewAllContacts() { | |
87 | $this->setPermissionAndRequest('view all contacts'); | |
3aab90bd | 88 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
89 | $this->assertEquals(2, $total); | |
90 | $this->assertEquals('pick-me-active', $groups[2]['group_name']); | |
91 | $this->assertEquals('not-me-active', $groups[4]['group_name']); | |
92 | } | |
93 | ||
94 | /** | |
95 | * retrieve groups as 'view all contacts' permissioned user | |
96 | * Without setting params the default is both enabled & disabled | |
97 | * (if you do set default it is enabled only) | |
98 | */ | |
99 | function testGroupListViewAllContactsFoundTitle() { | |
aaac0e0b EM |
100 | $this->_params['title'] = 'p'; |
101 | $this->setPermissionAndRequest('view all contacts'); | |
3aab90bd | 102 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
103 | $this->assertEquals(2, $total); | |
104 | $this->assertEquals('pick-me-active', $groups[2]['group_name']); | |
105 | $this->assertEquals('pick-me-disabled', $groups[1]['group_name']); | |
106 | } | |
107 | ||
108 | /** | |
109 | * retrieve groups as 'view all contacts' | |
110 | */ | |
111 | function testGroupListViewAllContactsNotFoundTitle() { | |
aaac0e0b EM |
112 | $this->_params['title'] = 'z'; |
113 | $this->setPermissionAndRequest('view all contacts'); | |
3aab90bd | 114 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
115 | $this->assertEquals(0, $total); | |
116 | } | |
117 | /** | |
118 | * retrieve groups as 'edit all contacts' | |
119 | */ | |
120 | function testGroupListEditAllContacts() { | |
aaac0e0b | 121 | $this->setPermissionAndRequest('edit all contacts'); |
3aab90bd | 122 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
123 | $this->assertEquals(2, $total); | |
124 | $this->assertEquals('pick-me-active', $groups[2]['group_name']); | |
125 | $this->assertEquals('not-me-active', $groups[4]['group_name']); | |
126 | } | |
127 | ||
128 | /** | |
129 | * retrieve groups as 'view all contacts' | |
130 | */ | |
131 | function testGroupListViewAllContactsEnabled() { | |
aaac0e0b EM |
132 | $this->_params['status'] = 1; |
133 | $this->setPermissionAndRequest('view all contacts'); | |
3aab90bd | 134 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
135 | $this->assertEquals(2, $total); | |
136 | $this->assertEquals('pick-me-active', $groups[2]['group_name']); | |
137 | $this->assertEquals('not-me-active', $groups[4]['group_name']); | |
138 | } | |
139 | ||
140 | /** | |
141 | * retrieve groups as 'view all contacts' | |
142 | */ | |
143 | function testGroupListViewAllContactsDisabled() { | |
aaac0e0b EM |
144 | $this->_params['status'] = 2; |
145 | $this->setPermissionAndRequest('view all contacts'); | |
3aab90bd | 146 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
147 | $this->assertEquals(2, $total); | |
148 | $this->assertEquals('pick-me-disabled', $groups[1]['group_name']); | |
149 | $this->assertEquals('not-me-disabled', $groups[3]['group_name']); | |
150 | } | |
151 | ||
152 | /** | |
153 | * retrieve groups as 'view all contacts' | |
154 | */ | |
155 | function testGroupListViewAllContactsDisabledNotFoundTitle() { | |
aaac0e0b EM |
156 | $this->_params['status'] = 2; |
157 | $this->_params['title'] = 'n'; | |
158 | $this->setPermissionAndRequest('view all contacts'); | |
3aab90bd | 159 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
160 | $this->assertEquals(1, $total); | |
161 | $this->assertEquals('not-me-disabled', $groups[3]['group_name']); | |
162 | } | |
163 | ||
164 | /** | |
165 | * retrieve groups as 'view all contacts' | |
166 | */ | |
167 | function testGroupListViewAllContactsDisabledFoundTitle() { | |
aaac0e0b EM |
168 | $this->_params['status'] = 2; |
169 | $this->_params['title'] = 'p'; | |
170 | $this->setPermissionAndRequest('view all contacts'); | |
3aab90bd | 171 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
172 | $this->assertEquals(1, $total); | |
173 | $this->assertEquals('pick-me-disabled', $groups[1]['group_name']); | |
174 | } | |
175 | ||
176 | /** | |
177 | * retrieve groups as 'view all contacts' | |
178 | */ | |
179 | function testGroupListViewAllContactsAll() { | |
aaac0e0b EM |
180 | $this->_params['status'] = 3; |
181 | $this->setPermissionAndRequest('view all contacts'); | |
3aab90bd | 182 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
183 | $this->assertEquals(4, $total); | |
184 | $this->assertEquals('pick-me-disabled', $groups[1]['group_name']); | |
185 | $this->assertEquals('not-me-disabled', $groups[3]['group_name']); | |
186 | $this->assertEquals('pick-me-active', $groups[2]['group_name']); | |
187 | $this->assertEquals('not-me-active', $groups[4]['group_name']); | |
188 | } | |
189 | ||
190 | ||
191 | /** | |
192 | * retrieve groups as 'view all contacts' | |
193 | */ | |
194 | function testGroupListAccessCiviCRM() { | |
aaac0e0b EM |
195 | $this->setPermissionAndRequest('access CiviCRM'); |
196 | $permissionClause = CRM_Contact_BAO_Group::getPermissionClause(TRUE); | |
197 | $this->assertEquals('1 = 0', $permissionClause); | |
3aab90bd | 198 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
199 | $this->assertEquals(0, count($groups)); | |
3aab90bd | 200 | $this->assertEquals(0, $total, 'Total returned should be accurate based on permissions'); |
201 | } | |
202 | /** | |
203 | * retrieve groups as 'view all contacts' | |
204 | */ | |
205 | function testGroupListAccessCiviCRMEnabled() { | |
aaac0e0b EM |
206 | $this->_params['status'] = 1; |
207 | $this->setPermissionAndRequest('access CiviCRM'); | |
3aab90bd | 208 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
209 | $this->assertEquals(0, count($groups)); | |
3aab90bd | 210 | $this->assertEquals(0, $total, 'Total returned should be accurate based on permissions'); |
211 | } | |
212 | /** | |
213 | * retrieve groups as 'view all contacts' | |
214 | */ | |
215 | function testGroupListAccessCiviCRMDisabled() { | |
aaac0e0b EM |
216 | $this->_params['status'] = 2; |
217 | $this->setPermissionAndRequest('access CiviCRM'); | |
3aab90bd | 218 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
219 | $this->assertEquals(0, count($groups)); | |
3aab90bd | 220 | $this->assertEquals(0, $total, 'Total returned should be accurate based on permissions'); |
221 | } | |
222 | ||
223 | /** | |
224 | * retrieve groups as 'view all contacts' | |
225 | */ | |
226 | function testGroupListAccessCiviCRMAll() { | |
aaac0e0b EM |
227 | $this->_params['status'] = 2; |
228 | $this->setPermissionAndRequest('access CiviCRM'); | |
3aab90bd | 229 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
230 | $this->assertEquals(0, count($groups)); | |
3aab90bd | 231 | $this->assertEquals(0, $total, 'Total returned should be accurate based on permissions'); |
232 | } | |
233 | ||
234 | /** | |
235 | * retrieve groups as 'view all contacts' | |
236 | */ | |
237 | function testGroupListAccessCiviCRMFound() { | |
aaac0e0b EM |
238 | $this->_params['title'] = 'p'; |
239 | $this->setPermissionAndRequest('access CiviCRM'); | |
3aab90bd | 240 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
241 | $this->assertEquals(0, count($groups)); | |
242 | $this->assertEquals(0, $total, 'Total returned should be accurate based on permissions'); | |
243 | } | |
244 | ||
245 | /** | |
246 | * retrieve groups as 'view all contacts' | |
247 | */ | |
248 | function testGroupListAccessCiviCRMNotFound() { | |
aaac0e0b EM |
249 | $this->_params['title'] = 'z'; |
250 | $this->setPermissionAndRequest('access CiviCRM'); | |
3aab90bd | 251 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
252 | $this->assertEquals(0, count($groups)); | |
253 | $this->assertEquals(0, $total, 'Total returned should be accurate based on permissions'); | |
254 | } | |
255 | ||
256 | function testTraditionalACL () { | |
257 | $this->setupACL(); | |
3aab90bd | 258 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
259 | $this->assertEquals(1, count($groups), 'Returned groups should exclude disabled by default'); | |
260 | $this->assertEquals(1, $total, 'Total needs to be set correctly'); | |
261 | $this->assertEquals('pick-me-active', $groups[2]['group_name']); | |
262 | } | |
263 | ||
264 | function testTraditionalACLNotFoundTitle () { | |
aaac0e0b | 265 | $this->_params['title'] = 'n'; |
3aab90bd | 266 | $this->setupACL(); |
3aab90bd | 267 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
268 | $this->assertEquals(0, count($groups), 'Returned groups should exclude disabled by default'); | |
269 | $this->assertEquals(0, $total, 'Total needs to be set correctly'); | |
270 | } | |
271 | ||
272 | function testTraditionalACLFoundTitle () { | |
aaac0e0b | 273 | $this->_params['title'] = 'p'; |
3aab90bd | 274 | $this->setupACL(); |
3aab90bd | 275 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
276 | $this->assertEquals(2, count($groups), 'Returned groups should exclude disabled by default'); | |
277 | $this->assertEquals(2, $total, 'Total needs to be set correctly'); | |
278 | $this->assertEquals('pick-me-active', $groups[2]['group_name']); | |
279 | $this->assertEquals('pick-me-disabled', $groups[1]['group_name']); | |
280 | } | |
281 | ||
282 | function testTraditionalACLDisabled () { | |
aaac0e0b | 283 | $this->_params['status'] = 2; |
3aab90bd | 284 | $this->setupACL(); |
3aab90bd | 285 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
286 | $this->assertEquals(1, count($groups), 'Returned groups should exclude disabled by default'); | |
287 | $this->assertEquals(1, $total, 'Total needs to be set correctly'); | |
288 | $this->assertEquals('pick-me-disabled', $groups[1]['group_name']); | |
289 | } | |
290 | ||
291 | function testTraditionalACLDisabledFoundTitle () { | |
aaac0e0b EM |
292 | $this->_params['status'] = 2; |
293 | $this->_params['title'] = 'p'; | |
3aab90bd | 294 | $this->setupACL(); |
3aab90bd | 295 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
296 | $this->assertEquals(1, count($groups), 'Returned groups should exclude disabled by default'); | |
297 | $this->assertEquals(1, $total, 'Total needs to be set correctly'); | |
298 | $this->assertEquals('pick-me-disabled', $groups[1]['group_name']); | |
299 | } | |
300 | ||
301 | function testTraditionalACLDisabledNotFoundTitle () { | |
aaac0e0b EM |
302 | $this->_params['status'] = 2; |
303 | $this->_params['title'] = 'n'; | |
3aab90bd | 304 | $this->setupACL(); |
3aab90bd | 305 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
306 | $this->assertEquals(0, count($groups), 'Returned groups should exclude disabled by default'); | |
307 | $this->assertEquals(0, $total, 'Total needs to be set correctly'); | |
308 | } | |
309 | ||
310 | function testTraditionalACLEnabled () { | |
aaac0e0b | 311 | $this->_params['status'] = 1; |
3aab90bd | 312 | $this->setupACL(); |
3aab90bd | 313 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
314 | $this->assertEquals(1, count($groups), 'Returned groups should exclude disabled by default'); | |
315 | $this->assertEquals(1, $total, 'Total needs to be set correctly'); | |
316 | $this->assertEquals('pick-me-active', $groups[2]['group_name']); | |
317 | } | |
318 | ||
319 | function testTraditionalACLAll () { | |
aaac0e0b | 320 | $this->_params['status'] = 3; |
3aab90bd | 321 | $this->setupACL(); |
3aab90bd | 322 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
323 | $this->assertEquals(2, count($groups), 'Returned groups should exclude disabled by default'); | |
324 | $this->assertEquals(2, $total, 'Total needs to be set correctly'); | |
325 | $this->assertEquals('pick-me-active', $groups[2]['group_name']); | |
326 | $this->assertEquals('pick-me-disabled', $groups[1]['group_name']); | |
327 | } | |
328 | ||
329 | /** | |
330 | * ACL Group hook | |
331 | */ | |
332 | function testGroupListAclGroupHookDisabled() { | |
aaac0e0b EM |
333 | $this->_params['status'] = 2; |
334 | $this->setHookAndRequest('access CiviCRM', 'hook_civicrm_aclGroup'); | |
3aab90bd | 335 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
336 | $this->assertEquals(1, count($groups), 'Returned groups should exclude disabled by default'); | |
337 | $this->assertEquals(1, $total, 'Total needs to be set correctly'); | |
338 | $this->assertEquals('pick-me-disabled', $groups[1]['group_name']); | |
339 | } | |
340 | ||
341 | /** | |
342 | * ACL Group hook | |
343 | */ | |
344 | function testGroupListAclGroupHookDisabledFound() { | |
aaac0e0b EM |
345 | $this->_params['status'] = 2; |
346 | $this->_params['title'] = 'p'; | |
347 | $this->setHookAndRequest('access CiviCRM', 'hook_civicrm_aclGroup'); | |
3aab90bd | 348 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
349 | $this->assertEquals(1, count($groups), 'Returned groups should exclude disabled by default'); | |
350 | $this->assertEquals(1, $total, 'Total needs to be set correctly'); | |
351 | $this->assertEquals('pick-me-disabled', $groups[1]['group_name']); | |
352 | } | |
353 | ||
354 | /** | |
355 | * ACL Group hook | |
356 | */ | |
357 | function testGroupListAclGroupHookDisabledNotFound() { | |
aaac0e0b EM |
358 | $this->_params['status'] = 2; |
359 | $this->_params['title'] = 'n'; | |
360 | $this->setHookAndRequest('access CiviCRM', 'hook_civicrm_aclGroup'); | |
3aab90bd | 361 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
362 | $this->assertEquals(0, count($groups), 'Returned groups should exclude disabled by default'); | |
363 | $this->assertEquals(0, $total, 'Total needs to be set correctly'); | |
364 | } | |
365 | ||
366 | ||
367 | /** | |
368 | * ACL Group hook | |
369 | */ | |
370 | function testGroupListAclGroupHook() { | |
aaac0e0b | 371 | $this->setHookAndRequest('access CiviCRM', 'hook_civicrm_aclGroup'); |
3aab90bd | 372 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
373 | $this->assertEquals(1, count($groups), 'Returned groups should exclude disabled by default'); | |
374 | $this->assertEquals(1, $total, 'Total needs to be set correctly'); | |
375 | $this->assertEquals('pick-me-active', $groups[2]['group_name']); | |
376 | } | |
377 | ||
378 | /** | |
379 | * ACL Group hook | |
380 | */ | |
381 | function testGroupListAclGroupHookTitleNotFound() { | |
aaac0e0b EM |
382 | $this->_params['title'] = 'n'; |
383 | $this->setHookAndRequest('access CiviCRM', 'hook_civicrm_aclGroup'); | |
3aab90bd | 384 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
385 | $this->assertEquals(0, $total, 'Total needs to be set correctly'); | |
386 | $this->assertEquals(0, count($groups), 'Returned groups should exclude disabled by default'); | |
387 | } | |
388 | ||
389 | /** | |
390 | * ACL Group hook | |
391 | */ | |
392 | function testGroupListAclGroupHookTitleFound() { | |
aaac0e0b EM |
393 | $this->_params['title'] = 'p'; |
394 | $this->setHookAndRequest('access CiviCRM', 'hook_civicrm_aclGroup'); | |
3aab90bd | 395 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
396 | $this->assertEquals(2, count($groups), 'Returned groups should exclude disabled by default'); | |
397 | $this->assertEquals(2, $total, 'Total needs to be set correctly'); | |
398 | $this->assertEquals('pick-me-active', $groups[2]['group_name']); | |
399 | $this->assertEquals('pick-me-disabled', $groups[1]['group_name']); | |
400 | } | |
401 | ||
402 | /** | |
403 | * ACL Group hook | |
404 | */ | |
405 | function testGroupListAclGroupHookAll() { | |
aaac0e0b EM |
406 | $this->_params['status'] = 3; |
407 | $this->setHookAndRequest('access CiviCRM', 'hook_civicrm_aclGroup'); | |
3aab90bd | 408 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
409 | $this->assertEquals(2, count($groups), 'Returned groups should exclude disabled by default'); | |
410 | $this->assertEquals(2, $total, 'Total needs to be set correctly'); | |
411 | $this->assertEquals('pick-me-active', $groups[2]['group_name']); | |
412 | $this->assertEquals('pick-me-disabled', $groups[1]['group_name']); | |
413 | } | |
414 | ||
415 | /** | |
416 | * ACL Group hook | |
417 | */ | |
418 | function testGroupListAclGroupHookEnabled() { | |
aaac0e0b EM |
419 | $this->_params['status'] = 1; |
420 | $this->setHookAndRequest('access CiviCRM', 'hook_civicrm_aclGroup'); | |
3aab90bd | 421 | list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); |
422 | $this->assertEquals(1, count($groups), 'Returned groups should exclude disabled by default'); | |
423 | $this->assertEquals(1, $total, 'Total needs to be set correctly'); | |
424 | $this->assertEquals('pick-me-active', $groups[2]['group_name']); | |
425 | } | |
426 | ||
427 | /** | |
428 | * Implements ACLGroup hook | |
429 | * aclGroup function returns a list of permitted groups | |
430 | * @param string $type | |
431 | * @param integer $contactID | |
432 | * @param string $tableName | |
433 | * @param array $allGroups | |
434 | * @param array $currentGroups | |
435 | */ | |
436 | function hook_civicrm_aclGroup($type, $contactID, $tableName, &$allGroups, &$currentGroups) { | |
aaac0e0b | 437 | //don't use api - you will get a loop |
3aab90bd | 438 | $sql = " SELECT * FROM civicrm_group WHERE name LIKE '%pick%'"; |
439 | $groups = array(); | |
440 | $dao = CRM_Core_DAO::executeQuery($sql); | |
441 | while ($dao->fetch()) { | |
442 | $groups[] = $dao->id; | |
443 | } | |
444 | ||
445 | if(!empty($allGroups)) { | |
446 | //all groups is empty if we really mean all groups but if a filter like 'is_disabled' is already applied | |
447 | // it is populated, ajax calls from Manage Groups will leave empty but calls from New Mailing pass in a filtered list | |
448 | $currentGroups = array_intersect($groups, array_flip($allGroups)); | |
449 | } | |
450 | else { | |
451 | $currentGroups = $groups; | |
452 | } | |
453 | } | |
454 | } |