Révision 32700c57
Ajouté par Assos Assos il y a environ 5 ans
drupal7/sites/all/modules/ldap/ldap_authorization/LdapAuthorizationConsumerConf.class.php | ||
---|---|---|
28 | 28 |
|
29 | 29 |
public $useFirstAttrAsGroupId = FALSE; |
30 | 30 |
|
31 |
public $mappings = array();
|
|
31 |
public $mappings = [];
|
|
32 | 32 |
public $useMappingsAsFilter = TRUE; |
33 | 33 |
|
34 | 34 |
public $synchToLdap = FALSE; |
... | ... | |
65 | 65 |
$this->inDatabase = TRUE; |
66 | 66 |
$exists = $this->loadFromDb(); |
67 | 67 |
if (!$exists) { |
68 |
watchdog('ldap_authorization', 'failed to load existing %consumer object', array('%consumer' => $consumer->consumerType), WATCHDOG_ERROR);
|
|
68 |
watchdog('ldap_authorization', 'failed to load existing %consumer object', ['%consumer' => $consumer->consumerType], WATCHDOG_ERROR);
|
|
69 | 69 |
} |
70 | 70 |
} |
71 | 71 |
// Default value for deriveFromEntryAttrMatchingUserAttr set up this way for backward compatibility in 1.0 branch, |
... | ... | |
78 | 78 |
protected function loadFromDb() { |
79 | 79 |
if (module_exists('ctools')) { |
80 | 80 |
ctools_include('export'); |
81 |
$result = ctools_export_load_object('ldap_authorization', 'names', array($this->consumerType));
|
|
81 |
$result = ctools_export_load_object('ldap_authorization', 'names', [$this->consumerType]);
|
|
82 | 82 |
|
83 | 83 |
// @todo, this is technically wrong, but I don't quite grok what we're doing in the non-ctools case - justintime |
84 | 84 |
$server_record = array_pop($result); |
... | ... | |
117 | 117 |
* Direct mapping of db to object properties. |
118 | 118 |
*/ |
119 | 119 |
public static function field_to_properties_map() { |
120 |
return array(
|
|
120 |
return [
|
|
121 | 121 |
'sid' => 'sid', |
122 | 122 |
'consumer_type' => 'consumerType', |
123 |
'numeric_consumer_conf_id' => 'numericConsumerConfId' ,
|
|
123 |
'numeric_consumer_conf_id' => 'numericConsumerConfId', |
|
124 | 124 |
'status' => 'status', |
125 | 125 |
'only_ldap_authenticated' => 'onlyApplyToLdapAuthenticated', |
126 | 126 |
'use_first_attr_as_groupid' => 'useFirstAttrAsGroupId', |
... | ... | |
131 | 131 |
'regrant_ldap_provisioned' => 'regrantLdapProvisioned', |
132 | 132 |
'revoke_ldap_provisioned' => 'revokeLdapProvisioned', |
133 | 133 |
'create_consumers' => 'createConsumers', |
134 |
);
|
|
134 |
];
|
|
135 | 135 |
} |
136 | 136 |
|
137 | 137 |
/** |
138 | 138 |
* |
139 | 139 |
*/ |
140 | 140 |
public static function field_to_properties_serialized() { |
141 |
return array('mappings');
|
|
141 |
return ['mappings'];
|
|
142 | 142 |
} |
143 | 143 |
|
144 | 144 |
/** |
... | ... | |
164 | 164 |
} |
165 | 165 |
} |
166 | 166 |
else { |
167 |
$array = array();
|
|
167 |
$array = [];
|
|
168 | 168 |
} |
169 | 169 |
return $array; |
170 | 170 |
} |
... | ... | |
173 | 173 |
* |
174 | 174 |
*/ |
175 | 175 |
protected function pipeListToArray($mapping_list_txt, $make_item0_lowercase = FALSE) { |
176 |
$result_array = array();
|
|
176 |
$result_array = [];
|
|
177 | 177 |
$mappings = preg_split('/[\n\r]+/', $mapping_list_txt); |
178 | 178 |
foreach ($mappings as $line) { |
179 | 179 |
if (count($mapping = explode('|', trim($line))) == 2) { |
180 | 180 |
$item_0 = ($make_item0_lowercase) ? drupal_strtolower(trim($mapping[0])) : trim($mapping[0]); |
181 |
$result_array[] = array($item_0, trim($mapping[1]));
|
|
181 |
$result_array[] = [$item_0, trim($mapping[1])];
|
|
182 | 182 |
} |
183 | 183 |
} |
184 | 184 |
return $result_array; |
Formats disponibles : Unified diff
Weekly update of contrib modules