Ejemplo n.º 1
0
 public function testRequest()
 {
     $username = '******';
     for ($i = 0; $i < 4000; $i++) {
         $userInfo['account'] = $username . $i;
         $userInfo['password'] = '******';
         $userInfo['pwd_confirm'] = 'demo123';
         $userId = userAuth::signUp($userInfo['account'], $userInfo['password'], $userInfo['pwd_confirm']);
         echo "注册{$userInfo['account']},成功!\n";
     }
 }
Ejemplo n.º 2
0
 /**
  * @brief 创建企业会员
  *
  * @return json
  */
 public function create()
 {
     if (input::get('license') != 'on') {
         $msg = $this->app->_('同意注册条款后才能注册');
         throw new \LogicException($msg);
     }
     try {
         shopAuth::signupSeller(input::get());
         userAuth::signUp(input::get('login_account'), input::get('login_password'), input::get('psw_confirm'));
     } catch (Exception $e) {
         $msg = $e->getMessage();
     }
     if (pamAccount::check()) {
         $url = url::action('topshop_ctl_index@index');
         $msg = app::get('topshop')->_('注册成功');
         return $this->splash('success', $url, $msg, true);
     } else {
         return $this->splash('error', null, $msg, true);
     }
 }
Ejemplo n.º 3
0
 public function bindSignupUser()
 {
     $params = input::get();
     $verifyCode = $params['verifycode'];
     $verifyKey = $params['vcodekey'];
     $loginName = $params['pam_account']['login_name'];
     $password = $params['pam_account']['login_password'];
     $confirmedPassword = $params['pam_account']['psw_confirm'];
     if (!$verifyKey || empty($verifyCode) || !base_vcode::verify($verifyKey, $verifyCode)) {
         $msg = app::get('topc')->_('验证码填写错误');
         return $this->splash('error', null, $msg, true);
     }
     try {
         $userId = userAuth::signUp($loginName, $password, $confirmedPassword);
         userAuth::login($userId, $loginName);
         kernel::single('pam_trust_user')->bind(userAuth::id());
         $url = url::action('topc_ctl_default@index');
         return $this->splash('success', $url, $msg, true);
     } catch (\Exception $e) {
         $msg = $e->getMessage();
         return $this->splash('error', null, $msg, true);
     }
 }
Ejemplo n.º 4
0
 public function create()
 {
     $data = utils::_filter_input(input::get());
     $vcode = $data['vcode'];
     $codyKey = $data['key'];
     $verifycode = $data['verifycode'];
     $userInfo = $data['pam_user'];
     try {
         $accountType = kernel::single('pam_tools')->checkLoginNameType($userInfo['account']);
         if ($accountType == "mobile") {
             $vcodeData = userVcode::verify($vcode, $userInfo['account'], 'signup');
             if (!$vcodeData) {
                 throw new \LogicException(app::get('topm')->_('手机验证码错误'));
             }
         } else {
             if (empty($verifycode) || !base_vcode::verify($codyKey, $verifycode)) {
                 throw new \LogicException(app::get('topm')->_('验证码填写错误'));
             }
         }
         //检测注册协议是否被阅读选中
         if (!input::get('license')) {
             throw new \LogicException(app::get('topm')->_('请阅读并接受会员注册协议'));
         }
         $userId = userAuth::signUp($userInfo['account'], $userInfo['password'], $userInfo['pwd_confirm']);
         userAuth::login($userId, $userInfo['account']);
     } catch (Exception $e) {
         $msg = $e->getMessage();
         return $this->splash('error', $url, $msg, true);
     }
     $url = $this->__getFromUrl();
     return $this->splash('success', $url, null, true);
 }
Ejemplo n.º 5
0
 public function create()
 {
     $data = utils::_filter_input(input::get());
     $codyKey = $data['key'];
     $verifycode = $data['verifycode'];
     $userInfo = $data['pam_user'];
     $vcode = $data['vcode'];
     //数据检测
     $validator = validator::make(['loginAccount' => $userInfo['account'], 'license' => input::get('license'), 'password' => $userInfo['password'], 'password_confirmation' => $userInfo['pwd_confirm']], ['loginAccount' => 'required', 'license' => 'required', 'password' => 'min:6|max:20|confirmed', 'password_confirmation' => 'required'], ['loginAccount' => '请输入用户名!', 'license' => '请阅读并接受会员注册协议!', 'password' => '密码长度不能小于6位!|密码长度不能大于20位!|输入的密码不一致!', 'password_confirmation' => '确认密码不能为空!']);
     if ($validator->fails()) {
         $messages = $validator->messagesInfo();
         foreach ($messages as $error) {
             throw new LogicException($error[0]);
         }
     }
     try {
         $accountType = kernel::single('pam_tools')->checkLoginNameType($userInfo['account']);
         if ($accountType == "mobile") {
             $vcodeData = userVcode::verify($vcode, $userInfo['account'], 'signup');
             if (!$vcodeData) {
                 throw new \LogicException(app::get('topc')->_('手机验证码错误'));
             }
         } else {
             if (empty($verifycode) || !base_vcode::verify($codyKey, $verifycode)) {
                 throw new \LogicException(app::get('topc')->_('验证码填写错误'));
             }
         }
         $userId = userAuth::signUp($userInfo['account'], $userInfo['password'], $userInfo['pwd_confirm']);
         userAuth::login($userId, $userInfo['account']);
     } catch (Exception $e) {
         $msg = $e->getMessage();
         return $this->splash('error', $url, $msg, true);
     }
     // 跳成功页
     $url = url::action('topc_ctl_passport@signupSuccess', ['next_page' => $this->__getFromUrl()]);
     return $this->splash('success', $url, null, true);
 }
Ejemplo n.º 6
0
 /**
  * 自生成用户名注册并绑定
  *
  * @return int
  */
 public function bindDefaultCreateUser()
 {
     //$userFlag = $_SESSION['TRUST']['user_flag'];
     $userFlag = $this->storage->get('user_flag');
     $loginName = $userFlag;
     $password = time();
     $userId = userAuth::signUp($loginName, $password, $password);
     $this->bind($userId);
     return $userId;
 }
Ejemplo n.º 7
0
 public function createc()
 {
     $data = utils::_filter_input(input::get());
     $a = $data['pam_user'];
     $codyKey = $data['key'];
     $verifycode = $data['verifycode'];
     $userInfo = $data['pam_user'];
     $vcode = $data['vcode'];
     $seller_type = $data["seller_type"];
     if ($seller_type != "1" && $seller_type != "2" && $seller_type != "0") {
         return $this->splash('error', null, "请选择企业类型");
     }
     try {
         // $accountType = kernel::single('pam_tools')->checkLoginNameType($userInfo['account']);
         // if($accountType == "mobile")
         // {
         //     $vcodeData=userVcode::verify($vcode,$userInfo['account'],'signup');
         //     if(!$vcodeData)
         //     {
         //         throw new \LogicException(app::get('topc')->_('手机验证码错误'));
         //     }
         // }
         // else
         // {
         //     if( empty($verifycode) || !base_vcode::verify($codyKey,$verifycode) )
         //     {
         //         throw new \LogicException(app::get('topc')->_('验证码填写错误'));
         //     }
         // }
         $shopInfo = array("login_account" => $userInfo['account'], "login_password" => $userInfo['password'], "psw_confirm" => $userInfo['pwd_confirm'], "name" => $userInfo['con_name'], "mobile" => $userInfo["phone"], "email" => $userInfo["email"], "license" => "on");
         $a = 1;
         shopAuth::signupSeller($shopInfo);
         $userId = userAuth::signUp($userInfo['account'], $userInfo['password'], $userInfo['pwd_confirm']);
         //shopAuth::signupSeller($shopInfo);
         userAuth::login($userId, $userInfo['account']);
         $sql = "UPDATE sysshop_seller set seller_type=" . $seller_type . " where seller_id in  (select seller_id from sysshop_account where login_account = '" . $userInfo['account'] . "' )";
         $result = app::get('sysshop')->database()->executeUpdate($sql);
     } catch (Exception $e) {
         $msg = $e->getMessage();
         return $this->splash('error', $url, $msg, true);
     }
     $url = url::action('topc_ctl_passport@signupSuccess', ['next_page' => $this->__getFromUrl()]);
     return $this->splash('success', $url, null, true);
 }