portal url fix
This commit is contained in:
@@ -676,8 +676,22 @@ class User extends Record
|
||||
$subjectTpl = $templateFileManager->getTemplate('passwordChangeLink', 'subject', 'User');
|
||||
$bodyTpl = $templateFileManager->getTemplate('passwordChangeLink', 'body', 'User');
|
||||
|
||||
$siteUrl = $this->getConfig()->getSiteUrl();
|
||||
|
||||
if ($user->isPortal()) {
|
||||
$portal = $this->getEntityManager()->getRepository('Portal')->distinct()->join('users')->where([
|
||||
'isActive' => true,
|
||||
'users.id' => $user->id,
|
||||
])->findOne();
|
||||
if ($portal) {
|
||||
if ($portal->get('customUrl')) {
|
||||
$siteUrl = $portal->get('customUrl');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$data = [];
|
||||
$link = $this->getConfig()->getSiteUrl() . '?entryPoint=changePassword&id=' . $requestId;
|
||||
$link = $siteUrl . '?entryPoint=changePassword&id=' . $requestId;
|
||||
$data['link'] = $link;
|
||||
|
||||
$htmlizer = new \Espo\Core\Htmlizer\Htmlizer($this->getFileManager(), $this->getDateTime(), $this->getNumber(), null);
|
||||
|
||||
@@ -39,6 +39,10 @@ $requestUri = $url;
|
||||
|
||||
$portalId = explode('/', $url)[count(explode('/', $_SERVER['SCRIPT_NAME'])) - 1];
|
||||
|
||||
if (strpos($requestUri, '=') !== false) {
|
||||
$portalId = null;
|
||||
}
|
||||
|
||||
if (!isset($portalId)) {
|
||||
$url = $_SERVER['REDIRECT_URL'];
|
||||
$portalId = explode('/', $url)[count(explode('/', $_SERVER['SCRIPT_NAME'])) - 1];
|
||||
|
||||
Reference in New Issue
Block a user