diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-06-15 13:34:52 -0700 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-06-15 13:34:52 -0700 |
commit | d6ff702d7f0937451c8595c7b3cbfb9f2813a07b (patch) | |
tree | ed88dc51dd98344b775392e87016c12423f8d8a5 /classes/Status_network.php | |
parent | c077ad0775218e6aa8660ba97129ad74b5d54773 (diff) |
Return network from network setup function
Return the network from the network setup function. Also, special-case
for when we get a server name the same as the wildcard.
Diffstat (limited to 'classes/Status_network.php')
-rw-r--r-- | classes/Status_network.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/classes/Status_network.php b/classes/Status_network.php index d2b942bfb..96b6d9a05 100644 --- a/classes/Status_network.php +++ b/classes/Status_network.php @@ -43,12 +43,19 @@ class Status_network extends DB_DataObject { global $config; + $sn = null; + // XXX I18N, probably not crucial for hostnames // XXX This probably needs a tune up if (0 == strncasecmp(strrev($wildcard), strrev($servername), strlen($wildcard))) { - $parts = explode('.', $servername); - $sn = Status_network::staticGet('nickname', strtolower($parts[0])); + // special case for exact match + if (0 == strncmp($servername, $wildcard)) { + $sn = Status_network::staticGet('nickname', ''); + } else { + $parts = explode('.', $servername); + $sn = Status_network::staticGet('nickname', strtolower($parts[0])); + } } else { $sn = Status_network::staticGet('hostname', strtolower($servername)); } @@ -70,9 +77,9 @@ class Status_network extends DB_DataObject $config['site']['logo'] = $sn->logo; } - return true; + return $sn; } else { - return false; + return null; } } } |