Skip to content

Commit

Permalink
Support for dots in subdomain
Browse files Browse the repository at this point in the history
  • Loading branch information
remdex committed Jun 12, 2015
1 parent 68a0c50 commit da00d99
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions instance/doc/updateview.log
@@ -1,4 +1,4 @@
# Finished at 2015-06-07 08:30:02
# Finished at 2015-06-12 22:00:02
# Last updated entry:
78.63.130.245 test1.livehelperchat.com - [07/Jun/2015:02:27:01 -0400] "GET /site_admin/chat/syncadmininterface/(limita)/10/(limitu)/10/(limitp)/10/(limito)/10/(limitc)/10/(limitd)/10 HTTP/1.1" 200 634 "http://test1.livehelperchat.com/site_admin/xmppservice/operators" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36" "-"
95.85.55.134 test1.new.livehelperchat.com - [12/Jun/2015:16:00:01 -0400] "POST /xmppservice/operatorstatus HTTP/1.1" 200 5 "-" "-" "-"

9 changes: 4 additions & 5 deletions instancecustomer/classes/erlhcoreclassinstance.php
Expand Up @@ -21,16 +21,15 @@ public static function getSession()

public static function setupInstance($db)
{
$parts = explode('.', $_SERVER['HTTP_HOST']);
$subdomain = array_shift($parts);
$cfg = erConfigClassLhConfig::getInstance();

$subdomain = str_replace('.'.$cfg->getSetting( 'site', 'seller_domain'), '', $_SERVER['HTTP_HOST']);
$items = erLhcoreClassModelInstance::getList(array('filter' => array('address' => $subdomain)));

if ( !empty($items) ) {
erLhcoreClassInstance::$instanceChat = array_shift($items);
$cfg = erConfigClassLhConfig::getInstance();
$db->query('USE '.$cfg->getSetting( 'db', 'database_user_prefix').erLhcoreClassInstance::$instanceChat->id);
} else {
$cfg = erConfigClassLhConfig::getInstance();
header('Location: '.$cfg->getSetting( 'site', 'seller_url'));
exit;
}
Expand Down

0 comments on commit da00d99

Please sign in to comment.