forked from gburton/CE-Phoenix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_account.php
More file actions
108 lines (78 loc) · 3.16 KB
/
create_account.php
File metadata and controls
108 lines (78 loc) · 3.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
/*
$Id$
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2020 osCommerce
Released under the GNU General Public License
*/
require 'includes/application_top.php';
// needs to be included earlier to set the success message in the messageStack
require "includes/languages/$language/create_account.php";
$message_stack_area = 'create_account';
if (tep_validate_form_action_is('process')) {
$customer_details = $customer_data->process();
$OSCOM_Hooks->call('siteWide', 'injectFormVerify');
if (tep_form_processing_is_valid()) {
$customer_data->create($customer_details);
$OSCOM_Hooks->call('siteWide', 'postAccountCreation');
$OSCOM_Hooks->call('siteWide', 'postLogin');
if (SESSION_RECREATE == 'True') {
tep_session_recreate();
}
$customer = new customer($customer_data->get('id', $customer_details));
$_SESSION['customer_id'] = $customer->get_id();
$customer_id =& $_SESSION['customers_id'];
tep_reset_session_token();
$_SESSION['cart']->restore_contents();
tep_notify('create_account', $customer);
tep_redirect(tep_href_link('create_account_success.php', '', 'SSL'));
}
}
$grouped_modules = $customer_data->get_grouped_modules();
$customer_data_group_query = tep_db_query(<<<'EOSQL'
SELECT customer_data_groups_id, customer_data_groups_name
FROM customer_data_groups
WHERE language_id =
EOSQL
. (int)$languages_id . ' ORDER BY cdg_vertical_sort_order, cdg_horizontal_sort_order');
$breadcrumb->add(NAVBAR_TITLE, tep_href_link('create_account.php', '', 'SSL'));
require 'includes/template_top.php';
?>
<h1 class="display-4"><?php echo HEADING_TITLE; ?></h1>
<?php
if ($messageStack->size($message_stack_area) > 0) {
echo $messageStack->output($message_stack_area);
}
?>
<div class="alert alert-warning" role="alert">
<div class="row">
<div class="col-sm-9"><?php echo sprintf(TEXT_ORIGIN_LOGIN, tep_href_link('login.php', tep_get_all_get_params(), 'SSL')); ?></div>
<div class="col-sm-3 text-left text-sm-right"><span class="text-danger"><?php echo FORM_REQUIRED_INFORMATION; ?></span></div>
</div>
</div>
<?php echo tep_draw_form('create_account', tep_href_link('create_account.php', '', 'SSL'), 'post', '', true) . tep_draw_hidden_field('action', 'process'); ?>
<div class="contentContainer">
<?php
while ($customer_data_group = tep_db_fetch_array($customer_data_group_query)) {
if (empty($grouped_modules[$customer_data_group['customer_data_groups_id']])) {
continue;
}
?>
<h4><?php echo $customer_data_group['customer_data_groups_name']; ?></h4>
<?php
foreach ((array)$grouped_modules[$customer_data_group['customer_data_groups_id']] as $module) {
$module->display_input($customer_details);
}
}
echo $OSCOM_Hooks->call('siteWide', 'injectFormDisplay');
?>
<div class="buttonSet">
<div class="text-right"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'fas fa-user', null, 'primary', null, 'btn-success btn-block btn-lg'); ?></div>
</div>
</div>
</form>
<?php
require 'includes/template_bottom.php';
require 'includes/application_bottom.php';
?>