Révision 32700c57
Ajouté par Assos Assos il y a environ 5 ans
drupal7/sites/all/modules/ldap/ldap_query/ldap_query.inc | ||
---|---|---|
2 | 2 |
|
3 | 3 |
/** |
4 | 4 |
* @file |
5 |
* |
|
6 | 5 |
*/ |
7 | 6 |
|
8 | 7 |
/** |
9 |
* see ldap_query_get_servers()
|
|
8 |
* See ldap_query_get_servers()
|
|
10 | 9 |
*/ |
11 | 10 |
function _ldap_query_get_queries($qid, $type, $flatten, $reset) { |
12 | 11 |
ldap_servers_module_load_include('php', 'ldap_query', 'LdapQueryAdmin.class'); |
13 | 12 |
static $queries; |
14 | 13 |
|
15 | 14 |
if ($reset) { |
16 |
$queries = array();
|
|
15 |
$queries = [];
|
|
17 | 16 |
} |
18 | 17 |
if (!isset($queries['all'])) { |
19 | 18 |
$queries['all'] = LdapQueryAdmin::getLdapQueryObjects('all', 'all'); |
20 | 19 |
} |
21 | 20 |
if (!isset($queries['enabled'])) { |
22 |
$queries['enabled'] = array();
|
|
21 |
$queries['enabled'] = [];
|
|
23 | 22 |
foreach ($queries['all'] as $_qid => $ldap_query) { |
24 | 23 |
if ($ldap_query->status == 1) { |
25 | 24 |
$queries['enabled'][$_qid] = $ldap_query; |
... | ... | |
27 | 26 |
} |
28 | 27 |
} |
29 | 28 |
|
30 |
|
|
31 | 29 |
if ($qid) { |
32 | 30 |
if (!isset($queries[$type][$qid])) { |
33 | 31 |
return FALSE; |
... | ... | |
39 | 37 |
return $queries[$type]; |
40 | 38 |
} |
41 | 39 |
} |
42 |
|
|
43 |
/** |
|
44 |
* see ldap_query_get_servers() |
|
45 |
*/ |
|
46 |
function _ldap_query_get_simpletest_queries($qid, $type, $flatten, $reset = TRUE) { |
|
47 |
require_once('tests/LdapQueryTest.class.php'); |
|
48 |
|
|
49 |
$queries['all'] = LdapQueryTest::getLdapQueryObjects('all', 'all'); |
|
50 |
|
|
51 |
foreach ($queries['all'] as $_sid => $ldap_query) { |
|
52 |
if ($ldap_query->status == 1) { |
|
53 |
$queries['enabled'][$_qid] = $ldap_query; |
|
54 |
} |
|
55 |
} |
|
56 |
|
|
57 |
|
|
58 |
if ($sid) { |
|
59 |
if (!isset($queries[$type][$qid])) { |
|
60 |
return FALSE; |
|
61 |
} |
|
62 |
return ($flatten) ? $queries[$type][$qid] : $queries[$type]; |
|
63 |
} |
|
64 |
|
|
65 |
if (isset($queries[$type])) { |
|
66 |
return $queries[$type]; |
|
67 |
} |
|
68 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules