subdomain->enabled) { $protocol = $this->_actionController->getProtocol(); preg_match('#(.*)\.'.$config->subdomain->hostname.'#', $currentUrl, $matches); return "$protocol://" . ($config->subdomain->use_www? 'www.' : '') . $config->subdomain->hostname . '/openid/provider'; } else { preg_match('#(.*)/(identity|openid)?/#', $currentUrl, $matches); return $matches[1] . '/openid/provider'; } } }