当前位置: 首页>>代码示例>>PHP>>正文


PHP PageModel::getUserByNickname方法代码示例

本文整理汇总了PHP中PageModel::getUserByNickname方法的典型用法代码示例。如果您正苦于以下问题:PHP PageModel::getUserByNickname方法的具体用法?PHP PageModel::getUserByNickname怎么用?PHP PageModel::getUserByNickname使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PageModel的用法示例。


在下文中一共展示了PageModel::getUserByNickname方法的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::getUserByNickname方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。