1 | <?php
|
---|
2 |
|
---|
3 | $tpl->output['form_email'] = $posted['email'];
|
---|
4 | $tpl->output['form_name'] = $posted['name'];
|
---|
5 | $tpl->output['name'] = $text['name'];
|
---|
6 | $tpl->output['pass'] = $text['pass'];
|
---|
7 | $tpl->output['pass_again'] = $text['pass_again'];
|
---|
8 |
|
---|
9 | if (isset($posted['name']))
|
---|
10 | {
|
---|
11 | $register = check_registr();
|
---|
12 | if ($register['error'])
|
---|
13 | {
|
---|
14 | $tpl->output['blok_1'] = 'block';
|
---|
15 | $tpl->output['blok_2'] = 'none';
|
---|
16 | $tpl->output['blok_error'] = 'block';
|
---|
17 | $tpl->output['error_msg'] = $text[$register['error_key']];
|
---|
18 | }
|
---|
19 | else
|
---|
20 | {
|
---|
21 | $tpl->output['blok_1'] = 'none';
|
---|
22 | $tpl->output['blok_2'] = 'block';
|
---|
23 | $tpl->output['blok_error'] = 'none';
|
---|
24 | $db->insert('users', array('name'=>$posted['name'], 'password' => sha1($posted['pass1']), 'email'=>$posted['email']));
|
---|
25 | $headers = "MIME-Version: 1.0 \r\n";
|
---|
26 | $headers .= "From: registration@wowresource.eu \r\n";
|
---|
27 | $headers .= 'Content-type: text/html; charset=utf-8 \r\n';
|
---|
28 | $subject = $text['subject'];
|
---|
29 | $id = $db->insert_id();
|
---|
30 | $body = $text['email_body'].'<br />'.$config['base_url'].'action.php?do=confirm&id='.($id*$config['nasobitel']);
|
---|
31 | mail($posted['email'], $subject, $body, $headers);
|
---|
32 | $tpl->output['regiter_success'] = $text['regiter_success'];
|
---|
33 | }
|
---|
34 |
|
---|
35 |
|
---|
36 | }
|
---|
37 | else
|
---|
38 | {
|
---|
39 | $tpl->output['blok_1'] = 'block';
|
---|
40 | $tpl->output['blok_2'] = 'none';
|
---|
41 | $tpl->output['blok_error'] = 'none';
|
---|
42 | }
|
---|
43 | ?>
|
---|