Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1047120
D513.id1323.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Jun 29, 6:14 PM
Size
2 KB
Mime Type
text/x-diff
Expires
Mon, Jun 30, 6:14 PM (14 m, 22 s)
Engine
blob
Format
Raw Data
Handle
676985
Attached To
D513: INP-1904 - Support opening an Admin Console from a Site Domain
D513.id1323.diff
View Options
Index: core/kernel/application.php
===================================================================
--- core/kernel/application.php
+++ core/kernel/application.php
@@ -667,11 +667,6 @@
*/
public function siteDomainField($field, $formatted = false, $format = null)
{
- if ( $this->isAdmin ) {
- // don't apply any filtering in administrative console
- return false;
- }
-
if ( !$this->siteDomain ) {
$this->siteDomain = $this->recallObject('site-domain.current', null, Array ('live_table' => true));
/** @var kDBItem $site_domain */
@@ -1818,15 +1813,20 @@
*/
public function getSecureDomain()
{
- $ret = $this->isAdmin ? $this->ConfigValue('AdminSSLDomain') : false;
+ // Dynamically detected site domain wins over any statically defined domain.
+ $site_domain = $this->siteDomainField('SSLDomainName');
+
+ if ( $site_domain ) {
+ return $site_domain;
+ }
- if ( !$ret ) {
- $ssl_domain = $this->siteDomainField('SSLDomainName');
+ $admin_domain = $this->isAdmin ? $this->ConfigValue('AdminSSLDomain') : false;
- return strlen($ssl_domain) ? $ssl_domain : $this->ConfigValue('SSLDomain');
+ if ( $admin_domain ) {
+ return $admin_domain;
}
- return $ret;
+ return $this->ConfigValue('SSLDomain');
}
/**
Index: core/units/site_domains/site_domain_eh.php
===================================================================
--- core/units/site_domains/site_domain_eh.php
+++ core/units/site_domains/site_domain_eh.php
@@ -44,14 +44,9 @@
public function getPassedID(kEvent $event)
{
if ( $event->Special == 'current' ) {
- if ( $this->Application->isAdmin ) {
- $event->setEventParam('raise_warnings', 0);
- }
- else {
- $domain_field = PROTOCOL == 'https://' ? 'SSLDomainName' : 'DomainName';
+ $domain_field = PROTOCOL == 'https://' ? 'SSLDomainName' : 'DomainName';
- return $this->querySiteDomain($domain_field, $_SERVER['HTTP_HOST']);
- }
+ return $this->querySiteDomain($domain_field, $_SERVER['HTTP_HOST']);
}
return parent::getPassedID($event);
Event Timeline
Log In to Comment