protected function unicodePwdHack(AddOperation $operation)
{
if (!$this->isUnicodePwdHackNeeded()) {
return;
}
$attributes = $operation->getAttributes();
foreach ($attributes as $attribute => $value) {
if (strtolower($attribute) !== 'unicodepwd') {
continue;
}
$value = is_array($value) ? reset($value) : $value;
$attributes[$attribute] = base64_encode($value);
}
$operation->setAttributes($attributes);
}