コード例 #1
0
ファイル: rsreg.ctrl.php プロジェクト: randyli/redstar
    $mobile = trim($_GPC['phone']) ? trim($_GPC['phone']) : message('请填写手机号!', '', 'error');
    $code = trim($_GPC['checkCode']) ? trim($_GPC['checkCode']) : message('请填写验证码!', '', 'error');
    if (!isset($_SESSION['sms']) || $code != $_SESSION['sms']['code']) {
        message('请填写正确验证码!', '', 'error');
    }
    $u = array("openid" => $openid, "mobile" => $mobile);
    rs_reg($u);
    header('Location:' . url('rsactivity', array('do' => 'order')));
    exit;
}
if ($do == "checkcode") {
    $mobile = trim($_GPC['phone']);
    if (!$mobile) {
        message('手机号不能为空', '', 'error');
    }
    $sms = $_SESSION['sms'];
    $code = rand(1000, 9999);
    if ($sms) {
        if (time() - $sms['time'] < 90) {
            message('发送验证码小于90秒', '', 'error');
        }
        if (time() - $sms['time'] < 600) {
            $code = $sms['code'];
        }
    }
    require IA_ROOT . "/framework/library/sms/checkCode.php";
    sendCode($mobile, $code);
    $_SESSION['sms'] = array('code' => $code, 'mobile' => $mobile, 'time' => time());
    echo $code;
    exit;
}
コード例 #2
0
ファイル: adminuser.php プロジェクト: kirstenko/oc-server3
$tpl->menuitem = MNU_ADMIN_USER;
$login->verify();
if ($login->userid == 0) {
    $tpl->redirect_login();
}
if (($login->admin & ADMIN_USER) != ADMIN_USER) {
    $tpl->error(ERROR_NO_ACCESS);
}
if (isset($_REQUEST['success']) && $_REQUEST['success']) {
    $tpl->assign('success', '1');
}
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'display';
if ($action == 'searchuser') {
    searchUser();
} elseif ($action == 'sendcode') {
    sendCode();
} elseif ($action == 'formaction') {
    formAction();
} elseif ($action == 'display') {
    $tpl->display();
}
$tpl->error(ERROR_UNKNOWN);
function sendCode()
{
    global $tpl;
    $userid = isset($_REQUEST['userid']) ? $_REQUEST['userid'] + 0 : 0;
    $user = new user($userid);
    if ($user->exist() == false) {
        $tpl->error(ERROR_UNKNOWN);
    }
    // send a new confirmation
コード例 #3
0
function save_and_send_email($email, $verification_code)
{
    global $connection;
    $query = "INSERT INTO email_verification (\n                            email,verification_code\n                        ) VALUES (\n                            '{$email}', '{$verification_code}'\n                            )";
    $result = mysql_query($query, $connection);
    if ($result) {
        return sendCode($email, $verification_code);
    } else {
        return NULL;
    }
}
コード例 #4
0
ファイル: shop.ajax.php プロジェクト: piapro/AIRestaurant
            $worksheet->write($i, 9, $getvalue);
            $i += 1;
        }
        $worksheet->write($i, 0, '总计');
        $worksheet->write($i, 1, '');
        $worksheet->write($i, 2, '');
        $worksheet->write($i, 3, '');
        $worksheet->write($i, 4, '');
        $worksheet->write($i, 5, $orderDeliverTotal);
        $worksheet->write($i, 6, $orderALLTotal1);
        $worksheet->write($i, 7, $orderMoneyTotal1);
        $worksheet->write($i, 8, $spendvalueTotal1);
        $worksheet->write($i, 9, $getvalueTotal1);
        $workbook->close();
        $str = "S";
        break;
    case "sendcode":
        $phone = sqlReplace(trim($_POST['phone']));
        $vercodePhone = getRndCode_r(6);
        $content = "验证码是" . $vercodePhone;
        $sql = "update qiyu_shop set shop_code='" . $vercodePhone . "' where shop_id=" . $QIYU_ID_SHOP;
        if (mysql_query($sql)) {
            //发送验证码
            sendCode($phone, $content);
            $str = "S";
        } else {
            $str = "E";
        }
        break;
}
echo $str;
コード例 #5
0
function set_weibo($phone1, $sinaUid, $sinaNick, $QIYU_ID_USER, $password)
{
    $sql_select = "select * from qiyu_user where user_phone='" . $phone1 . "'";
    $rs_select = mysql_query($sql_select);
    $row_select = mysql_fetch_assoc($rs_select);
    if ($row_select) {
        $sqls = "select user_id from qiyu_user where user_password='******'user_salt'])) . "' and user_phone=" . $phone1 . " and user_id=" . $row_select['user_id'];
        $rss = mysql_query($sqls);
        $rows = mysql_fetch_assoc($rss);
        if (!$rows) {
            return "E";
            exit;
        }
        //修改这个用户的新浪信息
        updateUserSina($row_select['user_id'], $sinaUid, $sinaNick);
        //修改喜欢
        updateUserLike($row_select['user_id'], $QIYU_ID_USER);
        //修改地址
        updateUserADDUser($row_select['user_id'], $QIYU_ID_USER);
        //删除临时账号
        deleteUserByID($QIYU_ID_USER);
        $QIYU_ID_USER = $row_select['user_id'];
        $_SESSION['qiyu_uid'] = $QIYU_ID_USER;
    } else {
        $pw1 = getRndCode_r(6);
        //随即生成的密码
        $vercode = getRndCode(6);
        $pw = md5(md5($pw1 . $vercode));
        //发送短信
        $content = '感谢您使用<?php echo $SHOP_NAME?>网站,您今后登陆<?php echo $SHOP_NAME?>网站的帐号为您的手机号,登陆密码为' . $pw1 . '. 可在网站个人中心页面修改您的密码。稍后您将收到订单进程的短信提醒。';
        $sql_update = "update qiyu_user set user_phone='" . $phone1 . "',user_salt='" . $vercode . "',user_password='******',user_account='" . $phone1 . "' where user_id=" . $QIYU_ID_USER;
        mysql_query($sql_update) or die('插入出错');
        sendCode($phone1, $content);
    }
    $_SESSION['qiyu_temporary'] = '';
    $_SESSION['sinaNick'] = '';
}