commit | author | age
|
601f79
|
1 |
<?php |
G |
2 |
|
|
3 |
require './framework/bootstrap.inc.php'; |
|
4 |
|
|
5 |
$host = $_SERVER['HTTP_HOST']; |
|
6 |
if (!empty($host)) { |
|
7 |
$bindhost = pdo_fetch("SELECT * FROM ".tablename('site_multi')." WHERE bindhost = :bindhost", array(':bindhost' => $host)); |
|
8 |
if (!empty($bindhost)) { |
|
9 |
header("Location: ". $_W['siteroot'] . 'app/index.php?i='.$bindhost['uniacid'].'&t='.$bindhost['id']); |
|
10 |
exit; |
|
11 |
} |
|
12 |
|
|
13 |
$pc_bind = pdo_get('uni_settings', array('bind_domain IN ' => array('http://' . $host, 'https://' . $host), 'default_module <>' => ''), array('uniacid', 'default_module', 'bind_domain')); |
|
14 |
if (!empty($pc_bind)) { |
|
15 |
$account_type = pdo_getcolumn('account', array('uniacid' => $pc_bind['uniacid']), 'type'); |
|
16 |
if ($account_type == ACCOUNT_TYPE_WEBAPP_NORMAL) { |
|
17 |
$_W['uniacid'] = $pc_bind['uniacid']; |
|
18 |
$_W['account'] = array('type' => $account_type); |
|
19 |
$url = module_app_entries($pc_bind['default_module'], array('cover')); |
|
20 |
header('Location: ' . $pc_bind['bind_domain'] . '/app/' . $url['cover'][0]['url']); |
|
21 |
exit; |
|
22 |
} |
|
23 |
} |
|
24 |
|
|
25 |
} |
|
26 |
if($_W['os'] == 'mobile' && (!empty($_GPC['i']) || !empty($_SERVER['QUERY_STRING']))) { |
|
27 |
header('Location: ./app/index.php?' . $_SERVER['QUERY_STRING']); |
|
28 |
} else { |
|
29 |
header('Location: ./web/index.php?' . $_SERVER['QUERY_STRING']); |
|
30 |
} |