Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $errors = '';
- if($_POST){
- include_once(SP.'src/core/lib/captcha/3DCaptcha.php');
- if(captcha3D::check($_POST['captcha'])){
- $ops = array(
- 'string' => array(
- 'login' => array(
- 'min' => 6,
- 'max' => 20
- ),
- 'password' => array(
- 'min' => 6,
- 'max' => 20
- ),
- 'question' => array(
- 'min' => 3,
- 'max' => 20
- ),
- 'answer' => array(
- 'min' => 3,
- 'max' => 20
- )
- ),
- 'mail' => array(
- 'mail'
- ),
- 'overlap' => array(
- 'password' => 'password2',
- 'mail' => 'mail2'
- ),
- 'binding' => array(
- 'login' => 'Логин не заполнен',
- 'password' => 'Пароль не заполнен',
- 'mail' => 'E-mail не заполнен',
- 'question' => 'Вопрос не заполнен',
- 'answer' => 'Ответ не заполнен'
- ),
- 'db' => array(
- 'login' => array('User', 'login'),
- 'mail' => array('User', 'mail')
- )
- );
- $validate = new Validate($ops, $_POST, $this->r['map']);
- if($validate->isValid()){
- $date = date('d.m.Y');
- $user = new User();
- $user->login = $_POST['login'];
- $user->password = md5("thiIs".$_POST['password']."salt");
- $user->mail = $_POST['mail'];
- $user->answer = $_POST['answer'];
- $user->question = $_POST['question'];
- $user->date = $date;
- $user->purse = 0;
- $user->access = 0;
- $id = $this->r['map']->add($user);
- $accString = md5($_POST['login']."salt".$_POST['mail'].$date);
- mail($_POST['mail'],
- "Подтверждение регистрации",
- "Перейдите по ссылке \n ".DN."/auth/accept/&id=$id&s=$accString");
- $text = "На вашу почту выслано письмо с подтверждением регистрации";
- $this->r['tpl']->setOps(array('text' => $text),'accept/accept');
- $this->buildPage($this->r['tpl']->compile());
- exit;
- } else {
- foreach ($validate->getErrors() as $field => $error) {
- $errors .= $error.'<br/>';
- }
- }
- } else {
- $errors = 'Не верный код с картинки';
- }
- $this->r['tpl']->setOps(array('error' => $errors),'error/user_error');
- $errors = $this->r['tpl']->compile();
- }
- $this->r['tpl']->setOps(array('error' => $errors),'auth/register_panel');
- $this->buildPage($this->r['tpl']->compile());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement