Exemplo n.º 1
0
function validatePhone()
{
    global $dsql, $mobile, $password, $repassword, $checkcode, $msgcode;
    $msgInfo = Helper_Archive::getDefineMsgInfo2('reg_msgcode');
    if ($msgInfo['isopen'] == 1) {
        if ($_SESSION['mobilecode_' . $mobile] != $msgcode) {
            return '验证码1错误';
        }
    } else {
        if (strtolower(GetCkVdValue()) != strtolower($checkcode) || empty($checkcode)) {
            return '验证码错误';
        }
    }
    $phonePattern = '/^1[3-8]+\\d{9}$/';
    if (!preg_match($phonePattern, $mobile)) {
        return '手机号码格式错误';
    }
    $row = $dsql->GetOne("select count(*) as num from #@__member where mobile='{$mobile}'");
    if ($row['num'] > 0) {
        return '该手机号已经被注册';
    }
    if (strlen($password) < 6) {
        return '密码长度不得小于6位';
    }
    if ($password != $repassword) {
        return '密码确认错误';
    }
    return true;
}
Exemplo n.º 2
0
 $row['memberlitpic'] = $memberinfo['litpic'] ? $memberinfo['litpic'] : $GLOBALS['cfg_templets_skin'] . '/images/member_default.gif';
 $row['url'] = $GLOBALS['cfg_cmsurl'] . '/jieban/show_' . $row['id'] . '.html';
 $row['attrlist'] = JieBan::getAttrList($row['attrid']);
 $row['joinnum'] = JieBan::getJoinNumber($row['id']);
 $row['memo'] = $row['memo'] == 'null' ? '' : $row['memo'];
 $row['vartime'] = empty($row['vartime']) ? 0 : $row['vartime'];
 $row['pkname'] = get_par_value($row['kindlist'], $typeid);
 $row['destid'] = array_remove_value($row['kindlist']);
 $row['pinyin'] = Helper_Archive::getDestPinyin($row['destid']);
 $row['kindid'] = $row['destid'];
 if (!empty($row['lineid'])) {
     $row['lineinfo'] = JieBan::getLineInfo($row['lineid']);
     $GLOBALS['condition']['_hasline'] = 1;
 }
 //短信状态判断
 $msgInfo = Helper_Archive::getDefineMsgInfo2('reg_msgcode');
 if ($msgInfo['isopen'] == 1) {
     $GLOBALS['condition']['_msgcode'] = 1;
     $row['msgtype'] = 'msg';
 } else {
     $GLOBALS['condition']['_txtcode'] = 1;
     $row['msgtype'] = 'txt';
 }
 @session_start();
 if (!isset($_SESSION['last_access']) || time() - $_SESSION['last_access'] > 120) {
     $_SESSION['last_access'] = time();
     $token = md5(time());
     $_SESSION['csrf_token_jb2'] = $token;
 }
 foreach ($row as $k => $v) {
     $pv->Fields[$k] = $v;
Exemplo n.º 3
0
    if (isset($ip_list[$ip]) && intval($ip_list[$ip]) <= 3) {
        $num = intval($ip_list[$ip]) + 1;
        $_SESSION['findpwdipnum'][$ip] = $num;
    } else {
        if (!isset($ip_list[$ip])) {
            $_SESSION['findpwdipnum'][$ip] = 1;
        } else {
            exit;
        }
    }
    $userinfo = Helper_Archive::getMemberInfo($_GET['uid']);
    $status = 'false';
    if (!empty($userinfo)) {
        $code = getRandCode(5);
        //验证码
        $msgInfo = Helper_Archive::getDefineMsgInfo2('reg_findpwd');
        //$content = "尊敬的会员,请您在{$GLOBALS['cfg_webname']}中输入以下验证码:{$code},完成密码找回验证.";
        $content = $msgInfo['msg'];
        $content = str_replace('{#CODE#}', $code, $content);
        $content = str_replace('{#WEBNAME#}', $GLOBALS['cfg_webname'], $content);
        $content = str_replace('{#PHONE#}', $GLOBALS['cfg_phone'], $content);
        $flag = Helper_Archive::sendMsg($userinfo['mobile'], '', $content);
        if ($flag->Success) {
            $status = 'ok';
        }
        $status = 'ok';
    }
    echo $status;
}
//检测短信验证码是否正确
if ($step == 'ckcode') {