예제 #1
0
function handdl($username, $password, $fs = 1, $rid = 2)
{
    require_once "../global.php";
    $username = str_safe_e($username);
    $password = str_safe_e($password);
    //yixiagaiziyuanwen
    $loginAccount = strtolower(stripslashes(trim($username)));
    $loginPassword = stripslashes($password);
    if (strlen($loginAccount) < 2) {
        return "账号无效";
    }
    if (strlen($loginPassword) < 6 || strlen($loginPassword) > 26 || substr_count($loginPassword, " ") > 0) {
        return "密码无效";
    }
    $loginType = "nickname";
    if (emailCheck($loginAccount)) {
        $loginType = "email";
    } else {
        if (checkNickname($loginAccount) != "") {
            return "账号不合法";
        }
    }
    $DB = database();
    $userInfo = PHPSay::getMemberInfo($DB, $loginType, $loginAccount);
    if (empty($userInfo['uid'])) {
        return "账号不存在";
    } else {
        if ($fs == 1) {
            if (md5($loginPassword) == $userInfo['password']) {
                loginCookie($PHPSayConfig['ppsecure'], $userInfo['uid'], $userInfo['nickname'], $userInfo['groupid']);
                if ($rid != 1) {
                    return "TRUE";
                } else {
                    $remsg["jg"] = "TRUE";
                    $remsg["uid"] = $userInfo['uid'];
                    return $remsg;
                }
            } else {
                if ($userInfo['password'] == "") {
                    return "该账号不支持密码登录";
                } else {
                    return "账号与密码不匹配";
                }
            }
        } else {
            if ($fs == 2) {
                loginCookie($PHPSayConfig['ppsecure'], $userInfo['uid'], $userInfo['nickname'], $userInfo['groupid']);
                if ($rid != 1) {
                    return "TRUE";
                } else {
                    $remsg["jg"] = "TRUE";
                    $remsg["uid"] = $userInfo['uid'];
                    return $remsg;
                }
            } else {
                if ($fs == 3) {
                    $reid = $userInfo['uid'];
                    if ($rid != 1) {
                        return $userInfo['uid'];
                    } else {
                        $remsg["jg"] = "TRUE";
                        $remsg["uid"] = $userInfo['uid'];
                        return $remsg;
                    }
                }
            }
        }
    }
    $DB->close();
}
<?php

require_once "../global.php";
include_once "hand.php";
$btsuconnectto = $_GET["to"];
if ($loginInfo['uid'] > 0) {
    $DB = database();
    $Iuid = $loginInfo['uid'];
    $userInfo = PHPSay::getMemberInfo($DB, "uid", $Iuid);
    $email = $userInfo['email'];
    $BtsuConnectUrl = $btsuconnectto . '/btsuser/btsudo.php?doid=1&liuser='******'@@' . $HWdoamin;
    ?>
	<script language="javascript" type="text/javascript">
           window.location.href="<?php 
    echo 'http://' . $BtsuConnectUrl;
    ?>
"; 
    </script>
	<?php 
} else {
    ?>
	<script language="javascript" type="text/javascript">
           window.location.href="<?php 
    echo 'http://' . $btsuconnectto;
    ?>
"; 
    </script>
	<?php 
}