コード例 #1
0
ファイル: user.php プロジェクト: lz1988/stourwebcms
 public function action_doreg()
 {
     $mobile = Arr::get($_POST, 'mobile');
     $pwd = Arr::get($_POST, 'password');
     $checkcode = Arr::get($_POST, 'checkcode');
     $backurl = Arr::get($_POST, 'backurl');
     //验证码
     $checkcode = strtolower($checkcode);
     $flag = Model_Member::checkExist('mobile', $mobile);
     if (!$flag) {
         Common::showMsg('手机号码重复,请重新填写', '-1');
     }
     if (!Captcha::valid($checkcode)) {
         Common::showMsg('验证码错误', '-1');
     }
     $model = ORM::factory('member');
     $model->mobile = $mobile;
     $model->pwd = md5($pwd);
     $model->logintime = time();
     $model->nickname = substr_replace($mobile, '***', 3, 3);
     $model->save();
     if ($model->saved()) {
         Model_Member::login($mobile, $pwd);
         Common::showMsg('注册成功', $backurl);
     } else {
         //Common::showMsg('注册失败,请联系网站管理员','-1');
     }
 }
コード例 #2
0
ファイル: supplier.php プロジェクト: lz1988/stourwebcms
 public function action_ajax_check()
 {
     $field = $this->params['type'];
     $val = ARR::get($_POST, 'val');
     //值
     $mid = ARR::get($_POST, 'mid');
     //会员id
     $flag = Model_Member::checkExist($field, $val, $mid);
     echo $flag;
 }