Commit eab1f62e authored by Mathieu's avatar Mathieu
Browse files

FIX #18428 7:00

parent b6e37338
......@@ -28,6 +28,7 @@ use Note\models\NoteModel;
use Resource\controllers\ResController;
use Resource\models\ResModel;
use Respect\Validation\Validator;
use SrcCore\models\PasswordModel;
use SrcCore\models\TextFormatModel;
use Status\models\StatusModel;
use User\models\UserModel;
......@@ -237,6 +238,18 @@ class SendMessageExchangeController
} else {
$ArchivalAgencyCommunicationType['type'] = 'url';
$ArchivalAgencyCommunicationType['value'] = rtrim($aArchivalAgencyCommunicationType['uri'], "/");
if (strrpos($ArchivalAgencyCommunicationType['value'], "http://") !== false) {
$url = str_replace("http://", "", $ArchivalAgencyCommunicationType['value']);
$prefix = "http://";
} elseif (strrpos($ArchivalAgencyCommunicationType['value'], "https://") !== false) {
$url = str_replace("https://", "", $ArchivalAgencyCommunicationType['value']);
$prefix = "https://";
} else {
return $response->withStatus(403)->withJson(['errors' => 'http or https missing']);
}
$login = $aArchivalAgencyCommunicationType['login'];
$password = PasswordModel::decrypt(['cryptedPassword' => $aArchivalAgencyCommunicationType['password']]);
$ArchivalAgencyCommunicationType['value'] = $prefix . $login . ':' . $password . '@' . $url;
}
}
$ArchivalAgencyContactInformations = ContactModel::getById(['select' => ['*'], 'id' => $contactId]);
......
Supports Markdown
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