Merge branch 'multi-server' into storageareas
This commit is contained in:
commit
b9f17a18d6
|
@ -34,7 +34,11 @@ class Server {
|
|||
}
|
||||
|
||||
public function Url() {
|
||||
return ZM_BASE_PROTOCOL . '://'. $this->Hostname();
|
||||
if ( $this->Id() ) {
|
||||
return ZM_BASE_PROTOCOL . '://'. $this->Hostname();
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
public function Hostname() {
|
||||
if ( isset( $this->{'Hostname'} ) and ( $this->{'Hostname'} != '' ) ) {
|
||||
|
|
|
@ -99,6 +99,11 @@ function CORSHeaders() {
|
|||
|
||||
# The following is left for future reference/use.
|
||||
$valid = false;
|
||||
$servers = dbFetchAll( 'SELECT * FROM Servers' );
|
||||
if ( sizeof($servers) <= 1 ) {
|
||||
# Only need CORSHeaders in the event that there are multiple servers in use.
|
||||
return;
|
||||
}
|
||||
foreach( dbFetchAll( 'SELECT * FROM Servers' ) as $row ) {
|
||||
$Server = new Server( $row );
|
||||
if ( $_SERVER['HTTP_ORIGIN'] == $Server->Url() ) {
|
||||
|
|
Loading…
Reference in New Issue