|
|
|
@ -53,17 +53,22 @@ Class Common {
@@ -53,17 +53,22 @@ Class Common {
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//判断用户数据目录是否存在 |
|
|
|
|
public static function getUserDataDir($cellphone) { |
|
|
|
|
$rootDir = __DIR__ . '/../www/' . FSC::$app['config']['content_directory']; |
|
|
|
|
|
|
|
|
|
//根据手机号码获取映射的用户名 |
|
|
|
|
public static function getMappedUsername($cellphone){ |
|
|
|
|
$username = $cellphone; |
|
|
|
|
|
|
|
|
|
//账号映射,手机号码转换成4位数字的短账号 |
|
|
|
|
|
|
|
|
|
if (!empty(FSC::$app['config']['tajia_user_map']) && !empty(FSC::$app['config']['tajia_user_map'][$username])) { |
|
|
|
|
$username = FSC::$app['config']['tajia_user_map'][$username]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $username; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//判断用户数据目录是否存在 |
|
|
|
|
public static function getUserDataDir($cellphone) { |
|
|
|
|
$rootDir = __DIR__ . '/../www/' . FSC::$app['config']['content_directory']; |
|
|
|
|
|
|
|
|
|
$username = self::getMappedUsername($cellphone); |
|
|
|
|
$userDir = "{$rootDir}{$username}"; |
|
|
|
|
return is_dir($userDir) ? $userDir : false; |
|
|
|
|
} |
|
|
|
@ -90,17 +95,12 @@ Class Common {
@@ -90,17 +95,12 @@ Class Common {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$login_time = time(); |
|
|
|
|
$username = $cellphone; |
|
|
|
|
$username = self::getMappedUsername($cellphone); |
|
|
|
|
|
|
|
|
|
if (empty($friends_code) && !empty($_COOKIE['friends_code'])) { |
|
|
|
|
$friends_code = $_COOKIE['friends_code']; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//账号映射,手机号码转换成4位数字的短账号 |
|
|
|
|
if (!empty(FSC::$app['config']['tajia_user_map']) && !empty(FSC::$app['config']['tajia_user_map'][$username])) { |
|
|
|
|
$username = FSC::$app['config']['tajia_user_map'][$username]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$_SESSION['login_time'] = $login_time; |
|
|
|
|
$_SESSION['username'] = $username; |
|
|
|
|
$_SESSION['friends_code'] = $friends_code; |
|
|
|
|