示例#1
0
 case 'emailcode':
     $value = trim($value);
     if (!preg_match("/[0-9]{6}/", $value)) {
         exit(' ');
     }
     $session = new dsession();
     if ($_SESSION['email_code'] != md5($_SESSION['email'] . '|' . $value)) {
         exit(' ');
     }
     break;
 case 'mobile':
     $value = trim($value);
     if (!is_mobile($value)) {
         exit($L['member_mobile_null']);
     }
     if ($do->mobile_exists($value)) {
         exit($L['member_mobile_reg']);
     }
     break;
 case 'mobilecode':
     $value = trim($value);
     if (!preg_match("/[0-9]{6}/", $value)) {
         exit(' ');
     }
     $session = new dsession();
     if ($_SESSION['mobile_code'] != md5($_SESSION['mobile'] . '|' . $value)) {
         exit(' ');
     }
     break;
 case 'company':
     if (!$value) {
示例#2
0
        $title = $L['register_msg_emailcode'];
        $content = ob_template('emailcode', 'mail');
        send_mail($email, $title, stripslashes($content));
        exit('1');
    }
}
$could_mobilecode = $MOD['mobilecode_register'] && $DT['sms'];
$action_sendscode = crypt_action('sendscode');
if ($could_mobilecode) {
    if ($action == $action_sendscode) {
        $mobile = isset($value) ? trim($value) : '';
        if (!is_mobile($mobile)) {
            exit('2');
        }
        isset($_SESSION['mobile_send']) or $_SESSION['mobile_send'] = 0;
        if ($do->mobile_exists($mobile)) {
            exit('3');
        }
        if ($_SESSION['mobile_time'] && $DT_TIME - $_SESSION['mobile_time'] < 180) {
            exit('5');
        }
        if ($_SESSION['mobile_send'] > 4) {
            exit('6');
        }
        if (max_sms($mobile)) {
            exit('6');
        }
        $mobilecode = random(6, '0123456789');
        $_SESSION['mobile'] = $mobile;
        $_SESSION['mobile_code'] = md5($mobile . '|' . $mobilecode);
        $_SESSION['mobile_time'] = $DT_TIME;