-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
auth/ldap: add commandline script #315
Conversation
here's interesting problem i encountered. appears Zend\Config approach of merging array's key integer values means append whatever is merged into: src/Config.php:334-335 this resulted each time when ldap preferences were saved 'default_role' =>
array (
1 => '2',
2 => '2',
3 => '2',
4 => '2',
5 => '2',
6 => '2',
), src/Controller/Manage/LdapController.php:79 even if data what was actually saved was just two entries. so i came up with this method, to have string type of array keys. unfortunately that only did not solve the problem, so the method not committed, but saving here for future times. /**
* ensure keys are type string,
* as Zend\Config would otherwise append values when merging
*
* @param array $array
* @return array
* @link https://stackoverflow.com/a/35180513/2314626
*/
private function stringifyKeys($array)
{
$obj = (object)[];
foreach ($array as $key => $value) {
$obj->{(string)$key} = $value;
}
return (array)$obj;
} |
12ad0c6
to
d2be1c6
Compare
No description provided.