Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fusiondirectory
fusiondirectory
Commits
bd5b45bb
Commit
bd5b45bb
authored
Mar 16, 2016
by
Côme Chilliet
Browse files
Fixes
#4610
Respect RFC4517 for postalAddress syntax
parent
aa41144b
Changes
2
Hide whitespace changes
Inline
Side-by-side
plugins/admin/departments/class_department.inc
View file @
bd5b45bb
...
...
@@ -99,7 +99,7 @@ class department extends simplePlugin
new
StringAttribute
(
_
(
'Country'
),
_
(
'Country'
),
'co'
,
FALSE
),
new
TextArea
Attribute
(
new
PostalAddress
Attribute
(
_
(
'Address'
),
sprintf
(
_
(
'A postal address for this %s'
),
$name
),
'postalAddress'
,
FALSE
),
...
...
plugins/personal/generic/class_user.inc
View file @
bd5b45bb
...
...
@@ -233,6 +233,42 @@ class UserPasswordAttribute extends CompositeAttribute
}
}
class
PostalAddressAttribute
extends
TextAreaAttribute
{
function
inputValue
(
$ldapValue
)
{
$string
=
$ldapValue
;
$offset
=
0
;
$lastslash
=
NULL
;
while
(
preg_match
(
'/[\\\$]/'
,
$string
,
$m
,
PREG_OFFSET_CAPTURE
,
$offset
))
{
$offset
=
$m
[
0
][
1
]
+
1
;
if
(
$m
[
0
][
0
]
==
'\\'
)
{
if
(
$lastslash
==
$m
[
0
][
1
]
-
1
)
{
$string
=
substr_replace
(
$string
,
'\\'
,
$m
[
0
][
1
]
-
1
,
2
);
$offset
=
$m
[
0
][
1
];
$lastslash
=
NULL
;
}
else
{
$lastslash
=
$m
[
0
][
1
];
}
}
elseif
(
$m
[
0
][
0
]
==
'$'
)
{
if
(
$lastslash
==
$m
[
0
][
1
]
-
1
)
{
$string
=
substr_replace
(
$string
,
'$'
,
$m
[
0
][
1
]
-
1
,
2
);
$offset
=
$m
[
0
][
1
];
}
else
{
$string
=
substr_replace
(
$string
,
"
\n
"
,
$m
[
0
][
1
],
1
);
$offset
=
$m
[
0
][
1
];
}
}
}
return
$string
;
}
function
computeLdapValue
()
{
return
preg_replace
(
"/
\n
/"
,
'$'
,
addcslashes
(
$this
->
getValue
(),
'$\\'
));
}
}
class
user
extends
simplePlugin
{
var
$objectclasses
=
array
(
'inetOrgPerson'
,
'organizationalPerson'
,
'person'
);
...
...
@@ -308,7 +344,7 @@ class user extends simplePlugin
_
(
'State'
),
_
(
'State'
),
'st'
,
FALSE
),
new
TextArea
Attribute
(
new
PostalAddress
Attribute
(
_
(
'Address'
),
_
(
'Business postal address'
),
'postalAddress'
,
FALSE
),
...
...
@@ -362,7 +398,7 @@ class user extends simplePlugin
_
(
'Display name'
),
_
(
'Name this user should appear as. Used by Exchange.'
),
'displayName'
,
FALSE
),
new
TextArea
Attribute
(
new
PostalAddress
Attribute
(
_
(
'Home address'
),
_
(
'Home postal address'
),
'homePostalAddress'
,
FALSE
),
...
...
mhamant
@mhamant
mentioned in issue
#1470 (closed)
·
Sep 02, 2017
mentioned in issue
#1470 (closed)
mentioned in issue #1470
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment