修复:新用户注册失败

This commit is contained in:
Jackson Dou 2023-05-29 18:30:40 +08:00
parent 9eee69b7fc
commit a7f7814e74
7 changed files with 42 additions and 18 deletions

View file

@ -8,17 +8,41 @@ if (isset($_COOKIE['UIISC_MEMBER']) && $_COOKIE['UIISC_MEMBER'] != 'NULL') {
}
if (isset($_POST['signup'])) {
if (!post('first')) {
setMessage('need field: ' . $lang->I18N('First Name'), 'danger');
redirect('clientarea/signup');
}
if (!post('last')) {
setMessage('need field: ' . $lang->I18N('Last Name'), 'danger');
redirect('clientarea/signup');
}
if (!post('email')) {
setMessage('need field: ' . $lang->I18N('Email Address'), 'danger');
redirect('clientarea/signup');
}
if (!post('password')) {
setMessage('need field: ' . $lang->I18N('Password'), 'danger');
redirect('clientarea/signup');
}
if (!post('cpassword')) {
setMessage('need field: ' . $lang->I18N('Confirm Password'), 'danger');
redirect('clientarea/signup');
}
if (post('password') != post('cpassword')) {
setMessage($lang->I18N('Password not match.'), 'danger');
redirect('clientarea/signup');
}
$FormData = array(
'client_fname' => post('first'),
'client_lname' => post('last'),
'client_email' => post('email'),
'client_company' => '',
'client_country' => '',
'client_city' => '',
'client_address' => '',
'client_pcode' => '',
'client_phone' => '',
'client_state' => '',
// 'client_company' => 'NULL',
// 'client_country' => 'null',
// 'client_city' => 'null',
// 'client_address' => 'null',
// 'client_pcode' => 'null',
// 'client_phone' => 'null',
// 'client_state' => 'null',
'client_password' => hash('sha256', post('password')),
'client_date' => date('Y-m-d H:i:s'),
'client_key' => substr(str_shuffle('qwertyuioplkjhgfdsazxcvbnm012345789QWERTYUIOPLKJHGFDSAZXCVBNM'), 0, 8),

View file

@ -15,8 +15,8 @@ if (isset($_POST['validate'])) {
$client_key = $ClientInfo['client_key'];
if (password_verify($client_key, $token)) {
$resault = $DB->update('clients', array('client_status' => '1'), array('client_key' => $client_key));
if ($resault) {
$result = $DB->update('clients', array('client_status' => '1'), array('client_key' => $client_key));
if ($result) {
setMessage('validated <b>successfully</b> !', 'success');
redirect('clientarea/index');
} else {

View file

@ -8,9 +8,9 @@ if (!$ticket_id) {
exit('Access Denied');
}
$resault = $DB->update('tickets', array('ticket_status' => 3), array('ticket_id' => $ticket_id));
$result = $DB->update('tickets', array('ticket_status' => 3), array('ticket_id' => $ticket_id));
if ($resault) {
if ($result) {
$TicketInfo = $DB->find('tickets', 'ticket_email', $where, null, 1);
$TicketUrl = setURL('clientarea/tickets', '', array('action' => 'view', 'ticket_id' => $ticket_id));
$EmailContent = '<p>You have closed a ticket(' . $ticket_id . ') .</p>';

View file

@ -13,17 +13,17 @@ if (!$ticket_id) {
}
// update status
$resault = $DB->update('tickets', array('ticket_status' => '2'), array('ticket_id' => $ticket_id));
$result = $DB->update('tickets', array('ticket_status' => '2'), array('ticket_id' => $ticket_id));
if ($resault) {
if ($result) {
$FormData = array(
'reply_for' => $ticket_id,
'reply_from' => $ClientInfo['client_id'],
'reply_content' => post('editor'),
'reply_date' => date('Y-m-d H:i:s'),
);
$resault_insert = $DB->insert('ticket_replies', $FormData);
if ($resault_insert) {
$result_insert = $DB->insert('ticket_replies', $FormData);
if ($result_insert) {
$ticket_url = setURL('clientarea/tickets', '', array('action' => 'view', 'ticket_id' => $ticket_id));
$email_content = '<p>You have received a reply from ' . $ClientInfo['client_fname'] . '.</p>';

View file

@ -40,7 +40,7 @@
</div>
</form>
<div class="px-5 nav-links">
<a href="login.php"><?php echo $lang->I18N('login'); ?></a> or <a href="forgetpassword.php">Recover Password</a>
<a href="login.php"><?php echo $lang->I18N('login'); ?></a> or <a href="forgetpassword.php"><?php echo $lang->I18N('Reset Password'); ?></a>
</div>
</div>
</div>

View file

@ -36,7 +36,7 @@ $avatar_path = $ClientInfo['client_email'] ? md5($ClientInfo['client_email']) :
<?php echo $lang->I18N('Knowledgebase'); ?>
</a>
<a href="tickets.php" class="sidebar-link sidebar-link-with-icon">
<span class="sidebar-icon bg-transparent"><i class="fa fa-bullhorn" aria-hidden="true"></i></span>
<span class="sidebar-icon bg-transparent"><i class="fa fa-ticket-alt" aria-hidden="true"></i></span>
<?php echo $lang->I18N('Tickets'); ?>
</a>
<a href="tools.php" class="sidebar-link sidebar-link-with-icon">

View file

@ -26,7 +26,7 @@
<div class="card text-center bg-matrix-3 m-20 p-0 border-0">
<div class="mx-20 my-15 d-flex justify-content-between align-items-center">
<h3 class="my-0 pt-0 text-white"><?php echo $count_tic; ?></h3>
<i class="fa fa-bullhorn fa-3x pt-10 text-white"></i>
<i class="fa fa-ticket-alt fa-3x pt-10 text-white"></i>
</div>
<div class="py-5" style="background: rgba(0,0,0,0.05); border-radius: 0px 0px 10px 10px;">
<a href="tickets.php" class="text-white">View Ticket <i class="fa fa-forward"></i></a>