Skip to content
Snippets Groups Projects
Commit 1bdf9dca authored by Jared Hancock's avatar Jared Hancock
Browse files

Accept subdomains in the organization domain box

Use .domain.tld to accept all subdomains of a parent
parent daa40aa1
Branches
Tags
No related merge requests found
......@@ -159,7 +159,14 @@ class Organization extends OrganizationModel {
function isMappedToDomain($domain) {
foreach (explode(',', $this->domain) as $d) {
if (strcasecmp($domain, trim($d)) === 0) {
$d = trim($d);
if ($d[0] == '.') {
// Subdomain syntax (.osticket.com accepts all subdomains of
// osticket.com)
if (strcasecmp(mb_substr($domain, -mb_strlen($d)), $d) === 0)
return true;
}
elseif (strcasecmp($domain, $d) === 0) {
return true;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment