當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PageModel::getUserByEmail方法代碼示例

本文整理匯總了PHP中PageModel::getUserByEmail方法的典型用法代碼示例。如果您正苦於以下問題:PHP PageModel::getUserByEmail方法的具體用法?PHP PageModel::getUserByEmail怎麽用?PHP PageModel::getUserByEmail使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PageModel的用法示例。


在下文中一共展示了PageModel::getUserByEmail方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: regsAction

 public function regsAction()
 {
     $model = new PageModel();
     if (isPost()) {
         $regCode = $model->getRegCode(post('code'));
         if ($regCode->id or true) {
             // TODO забрати "OR true"
             $data['nickname'] = post('nickname');
             if (checkLenght(post('nickname'), 3, 16) && !$model->getUserByNickname(post('nickname'))) {
                 $data['nickname'] = post('nickname');
             } else {
                 $this->view->error = 'Incorrect "Nickname" or exist';
             }
             if (checkEmail(post('email')) && !$model->getUserByEmail(post('email'))) {
                 $data['email'] = post('email');
             } else {
                 $this->view->error = 'Incorrect "E-mail" or exist';
             }
             if (checkLenght(post('password'), 6, 20)) {
                 $data['password'] = md5(post('password'));
             } else {
                 $this->view->error = 'Incorrect "Password"';
             }
             if (checkLenght(post('password_re'), 6, 20)) {
                 if (post('password') != post('password_re')) {
                     $this->view->error = 'Passwords do not match';
                 }
             } else {
                 $this->view->error = 'Incorrect "Repeat password"';
             }
             if (post('rules') != 'yes') {
                 $this->view->error = 'You must agree to Rules';
             }
             if (post('terms') != 'yes') {
                 $this->view->error = 'You must accept Terms and Conditions';
             }
             //$data['referral'] = $regCode->uid; // TODO ref system
             $data['dateLast'] = time();
             $data['dateReg'] = time();
             if (!$this->view->error) {
                 $uid = $model->insert('users', $data);
                 if ($uid) {
                     setSession('user', $uid, false);
                     //$model->deleteRegCode($regCode->id);
                     redirect(url($uid));
                 } else {
                     $this->view->error = 'Error Registration';
                 }
             }
         } else {
             $this->view->error = 'Incorrect "Registration code"';
         }
     }
     $code = Request::getUriOptions()[0];
     if ($code) {
         $_POST['code'] = $code;
     }
     $this->view->title = Lang::translate('REG_TITLE');
 }
開發者ID:terrasystems,項目名稱:csgobattlecom,代碼行數:59,代碼來源:Controller.php


注:本文中的PageModel::getUserByEmail方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。