Commit 34e72f78 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Merge branch '6015-add-support-for-supann-cms-carte-multi-service' into '1.4-dev'

Resolve "Add support for SupAnn CMS (Carte Multi Service)"

See merge request fusiondirectory/fd-plugins!707
parents a456f9db 5b483b61
...@@ -74,19 +74,21 @@ class SupannCMSAffectationAttribute extends SupannCompositeAttribute ...@@ -74,19 +74,21 @@ class SupannCMSAffectationAttribute extends SupannCompositeAttribute
if ($attrname == 'none') { if ($attrname == 'none') {
continue; continue;
} }
$value = $attribute->getValue();
if (!isset($values[$attrname])) { if (!isset($values[$attrname])) {
$values[$attrname] = []; $values[$attrname] = [];
} }
if ($value == '') { if (!$this->isTemplate()) {
continue; $value = $attribute->getValue();
} if ($value == '') {
if ($this->isValid()) { continue;
$values[$attrname][$value] = $value; }
if ($this->isValid()) {
$values[$attrname][$value] = $value;
}
} }
} }
unset($attribute); unset($attribute);
if ($this->isValid()) { if ($this->isValid() && !$this->isTemplate()) {
$format = $this->attributes[1]->getValue(); $format = $this->attributes[1]->getValue();
$id = $this->attributes[2]->getValue(); $id = $this->attributes[2]->getValue();
$supannCMSIdEtiquette = '{'.$format.'}'.$id; $supannCMSIdEtiquette = '{'.$format.'}'.$id;
......
...@@ -84,19 +84,21 @@ class SupannCMSAppAffectationAttribute extends SupannCompositeAttribute ...@@ -84,19 +84,21 @@ class SupannCMSAppAffectationAttribute extends SupannCompositeAttribute
if ($attrname == 'none') { if ($attrname == 'none') {
continue; continue;
} }
$value = $attribute->getValue();
if (!isset($values[$attrname])) { if (!isset($values[$attrname])) {
$values[$attrname] = []; $values[$attrname] = [];
} }
if ($value == '') { if (!$this->isTemplate()) {
continue; $value = $attribute->getValue();
} if ($value == '') {
if ($this->isValid()) { continue;
$values[$attrname][$value] = $value; }
if ($this->isValid()) {
$values[$attrname][$value] = $value;
}
} }
} }
unset($attribute); unset($attribute);
if ($this->isValid()) { if ($this->isValid() && !$this->isTemplate()) {
$domains = array_column($this->getConfigAppDomains(), 0, 1); $domains = array_column($this->getConfigAppDomains(), 0, 1);
$domain = $this->attributes[2]->getValue(); $domain = $this->attributes[2]->getValue();
$id = $this->attributes[3]->getValue(); $id = $this->attributes[3]->getValue();
......
...@@ -33,7 +33,7 @@ class SupannCompositeAttribute extends CompositeAttribute ...@@ -33,7 +33,7 @@ class SupannCompositeAttribute extends CompositeAttribute
$m = []; $m = [];
foreach ($this->attributes as &$attribute) { foreach ($this->attributes as &$attribute) {
list(, $shortname) = explode('_', $attribute->getLdapName()); list(, $shortname) = explode('_', $attribute->getLdapName());
if (preg_match("/\\[$shortname=([^\\]]+)\\]/", $value, $m)) { if (preg_match('/\\['.preg_quote($shortname, '/').'=(.+?)(\\]\\[|\\]$)/', $value, $m)) {
$values[] = $m[1]; $values[] = $m[1];
} else { } else {
$values[] = ''; $values[] = '';
...@@ -63,14 +63,16 @@ class SupannCompositeAttribute extends CompositeAttribute ...@@ -63,14 +63,16 @@ class SupannCompositeAttribute extends CompositeAttribute
{ {
foreach ($this->attributes as &$attribute) { foreach ($this->attributes as &$attribute) {
list($attrname, ) = explode('_', $attribute->getLdapName()); list($attrname, ) = explode('_', $attribute->getLdapName());
$value = $attribute->getValue();
if (!isset($values[$attrname])) { if (!isset($values[$attrname])) {
$values[$attrname] = []; $values[$attrname] = [];
} }
if ($value == '') { if (!$this->isTemplate()) {
continue; $value = $attribute->getValue();
if ($value == '') {
continue;
}
$values[$attrname][$value] = $value;
} }
$values[$attrname][$value] = $value;
} }
unset($attribute); unset($attribute);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment