Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Maarch
MaarchCourrier
Commits
9ac132ac
Commit
9ac132ac
authored
Oct 21, 2021
by
Guillaume Heurtier
Browse files
FIX #18428 TIME 0:50 set correct sender url when login/password are separated
parent
3f8e7443
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/app/external/messageExchange/controllers/SendMessageExchangeController.php
View file @
9ac132ac
...
...
@@ -600,6 +600,22 @@ class SendMessageExchangeController
$aDefaultConfig
=
ReceiveMessageExchangeController
::
readXmlConfig
();
// If communication_type is an url, and there is a separate field for login and password, we recreate the url with the login and password
if
(
filter_var
(
$aDefaultConfig
[
'm2m_communication_type'
][
$aArgs
[
'ChannelType'
]],
FILTER_VALIDATE_URL
))
{
if
(
!
empty
(
$aDefaultConfig
[
'm2m_login'
])
&&
!
empty
(
$aDefaultConfig
[
'm2m_password'
]))
{
$prefix
=
''
;
if
(
strrpos
(
$aDefaultConfig
[
'm2m_communication_type'
][
$aArgs
[
'ChannelType'
]],
"http://"
)
!==
false
)
{
$prefix
=
"http://"
;
}
elseif
(
strrpos
(
$aDefaultConfig
[
'm2m_communication_type'
][
$aArgs
[
'ChannelType'
]],
"https://"
)
!==
false
)
{
$prefix
=
"https://"
;
}
$url
=
str_replace
(
$prefix
,
''
,
$aDefaultConfig
[
'm2m_communication_type'
][
$aArgs
[
'ChannelType'
]]);
$login
=
$aDefaultConfig
[
'm2m_login'
][
0
]
??
''
;
$password
=
$aDefaultConfig
[
'm2m_password'
][
0
]
??
''
;
$aDefaultConfig
[
'm2m_communication_type'
][
$aArgs
[
'ChannelType'
]]
=
$prefix
.
$login
.
':'
.
$password
.
'@'
.
$url
;
}
}
$traCommunicationObject
->
Channel
=
$aArgs
[
'ChannelType'
];
$traCommunicationObject
->
value
=
rtrim
(
$aDefaultConfig
[
'm2m_communication_type'
][
$aArgs
[
'ChannelType'
]],
"/"
);
...
...
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