From 242662fd830e237f38e4b6a255e54111ccd049e5 Mon Sep 17 00:00:00 2001 From: Jackson Dou Date: Mon, 12 Dec 2022 08:34:28 +0800 Subject: [PATCH 1/2] Squashed commit of the following: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 63cc6c5fcbd449875cba4ab497683ed4382983e5 Author: Jackson Dou Date: Sun Dec 11 23:16:17 2022 +0800 update commit 78197bce95a197d5b9c4e018c5ab60ec2a988c0b Author: Jackson Dou Date: Sun Dec 11 22:43:10 2022 +0800 update: 调整数据表结构 --- src/admin/controllers/accounts/deactivate.php | 6 +- src/admin/controllers/accounts/edit.php | 2 +- src/admin/controllers/accounts/reactivate.php | 6 +- src/admin/controllers/clients/activate.php | 2 +- src/admin/controllers/clients/login.php | 6 +- src/admin/controllers/clients/suspend.php | 2 +- src/admin/controllers/clients/view.php | 10 +-- src/admin/controllers/tickets/close.php | 14 ++-- src/admin/views/accounts/edit.php | 8 +- src/admin/views/clients/list.php | 20 +++-- src/admin/views/clients/view.php | 24 +++--- src/admin/views/common/header.php | 4 +- src/callback/myownfreehost/activate.php | 6 +- src/callback/myownfreehost/suspend.php | 6 +- src/clientarea/controllers/accounts/add.php | 8 +- .../controllers/accounts/deactivate.php | 6 +- src/clientarea/controllers/accounts/edit.php | 2 +- src/clientarea/controllers/accounts/goftp.php | 2 +- src/clientarea/controllers/accounts/list.php | 6 +- src/clientarea/controllers/accounts/login.php | 2 +- .../controllers/accounts/password.php | 2 +- src/clientarea/controllers/accounts/view.php | 2 +- .../controllers/clients/forgetpassword.php | 6 +- src/clientarea/controllers/clients/login.php | 10 +-- .../controllers/clients/profile.php | 2 +- .../controllers/clients/resendcode.php | 8 +- .../controllers/clients/resetpassword.php | 8 +- src/clientarea/controllers/clients/signup.php | 38 ++++----- .../controllers/clients/validate.php | 6 +- src/clientarea/controllers/dashboard/view.php | 10 +-- src/clientarea/controllers/myssl/list.php | 4 +- src/clientarea/controllers/myssl/new.php | 78 +++++++++---------- src/clientarea/controllers/settings/edit.php | 20 ++--- .../controllers/settings/password.php | 18 ++--- src/clientarea/controllers/tickets/add.php | 8 +- src/clientarea/controllers/tickets/close.php | 2 +- src/clientarea/controllers/tickets/list.php | 4 +- src/clientarea/controllers/tickets/reply.php | 4 +- src/clientarea/controllers/tickets/view.php | 2 +- src/clientarea/views/accounts/add.php | 8 +- src/clientarea/views/accounts/edit.php | 8 +- src/clientarea/views/clients/profile.php | 16 ++-- src/clientarea/views/clients/suspended.php | 4 +- src/clientarea/views/clients/validate.php | 4 +- src/clientarea/views/common/sidebar.php | 4 +- src/clientarea/views/csr/decode.php | 8 +- src/clientarea/views/csr/new.php | 14 ++-- src/clientarea/views/myssl/add.php | 8 +- src/clientarea/views/settings.php | 20 ++--- src/clientarea/views/tickets/add.php | 4 +- src/clientarea/views/tickets/view.php | 6 +- src/clientarea/views/tools/dnslookup.php | 8 +- src/clientarea/views/tools/whois.php | 8 +- src/core/clientarea.php | 8 +- src/core/library/lib/MailSMTP.class.php | 2 +- src/install/function/Database.php | 32 ++++---- 56 files changed, 268 insertions(+), 268 deletions(-) diff --git a/src/admin/controllers/accounts/deactivate.php b/src/admin/controllers/accounts/deactivate.php index 0b39195..59a4c06 100755 --- a/src/admin/controllers/accounts/deactivate.php +++ b/src/admin/controllers/accounts/deactivate.php @@ -59,13 +59,13 @@ if ($Result['status'] == 0 && !is_array($Result['message'])) { $sql = $DB->update('account', array('account_status' => '0'), array('account_id' => $account_id)); if ($sql) { // 本地同步成功 - $ClientInfo = $DB->find('clients', 'hosting_client_email, hosting_client_fname', array('hosting_client_id' => $AccountInfo['account_client_id']), null, 1); + $ClientInfo = $DB->find('clients', 'client_email, client_fname', array('client_id' => $AccountInfo['account_client_id']), null, 1); $EmailContent = '

We had a good time with you while you were with us.

'; $EmailDescription = 'Your account(# ' . $account_id . ') have been deactivate successfully and all files and database will be deleted within 30 days.'; - $email_body = email_build_body('Hosting Account Deactivated', $ClientInfo['hosting_client_fname'], $EmailContent, $EmailDescription); + $email_body = email_build_body('Hosting Account Deactivated', $ClientInfo['client_fname'], $EmailContent, $EmailDescription); send_mail(array( - 'to' => $ClientInfo['hosting_client_email'], + 'to' => $ClientInfo['client_email'], 'message' => $email_body, 'subject' => 'Hosting Account Deactivated' )); diff --git a/src/admin/controllers/accounts/edit.php b/src/admin/controllers/accounts/edit.php index 424afda..a60f344 100755 --- a/src/admin/controllers/accounts/edit.php +++ b/src/admin/controllers/accounts/edit.php @@ -4,6 +4,6 @@ $account_id = get('account_id'); $AccountInfo = $DB->find('account', '*', array('account_id' => $account_id), null, 1); -$ClientInfo = $DB->find('clients', '*', array('hosting_client_id' => $AccountInfo['account_client_id']), null, 1); +$ClientInfo = $DB->find('clients', '*', array('client_id' => $AccountInfo['account_client_id']), null, 1); $PageInfo['title'] = 'Edit Account #' . $account_id; diff --git a/src/admin/controllers/accounts/reactivate.php b/src/admin/controllers/accounts/reactivate.php index 46eb4ce..6097064 100755 --- a/src/admin/controllers/accounts/reactivate.php +++ b/src/admin/controllers/accounts/reactivate.php @@ -51,13 +51,13 @@ if ($Result['status'] == 0 && !is_array($Result['message'])) { $sql = $DB->update('account', array('account_status' => '1'), array('account_id' => $account_id)); if ($sql) { // 本地同步成功 - $ClientInfo = $DB->find('clients', 'hosting_client_email, hosting_client_fname', array('hosting_client_id' => $AccountInfo['account_client_id']), null, 1); + $ClientInfo = $DB->find('clients', 'client_email, client_fname', array('client_id' => $AccountInfo['account_client_id']), null, 1); $EmailContent = 'Your account(# ' . $account_id . ') have been activated successfully.'; $EmailDescription = '

Login to Clientarea

'; - $email_body = email_build_body('Hosting Account Activated', $ClientInfo['hosting_client_fname'], $EmailContent, $EmailDescription); + $email_body = email_build_body('Hosting Account Activated', $ClientInfo['client_fname'], $EmailContent, $EmailDescription); send_mail(array( - "to" => $ClientInfo['hosting_client_email'], + "to" => $ClientInfo['client_email'], "message" => $email_body, "subject" => 'Activate Hosting Account', )); diff --git a/src/admin/controllers/clients/activate.php b/src/admin/controllers/clients/activate.php index 2a55edd..efce17e 100755 --- a/src/admin/controllers/clients/activate.php +++ b/src/admin/controllers/clients/activate.php @@ -8,7 +8,7 @@ if (!$client_id) { exit('Access Denied'); } -$resault = $DB->update('clients', array('hosting_client_status' => 1), array('hosting_client_id' => $client_id)); +$resault = $DB->update('clients', array('client_status' => 1), array('client_id' => $client_id)); if ($resault) { setMessage('Client activated successfully !'); diff --git a/src/admin/controllers/clients/login.php b/src/admin/controllers/clients/login.php index ef71597..6188a65 100755 --- a/src/admin/controllers/clients/login.php +++ b/src/admin/controllers/clients/login.php @@ -8,11 +8,11 @@ if (empty($client_id)) { redirect('admin/clients'); } -$ClientInfo = $DB->find('clients', '*', array('hosting_client_id' => $client_id), null, 1); +$ClientInfo = $DB->find('clients', '*', array('client_id' => $client_id), null, 1); $key = rand(000000, 999999); -$email = $ClientInfo['hosting_client_email']; -$token = hash('sha256', json_encode([$email, $ClientInfo['hosting_client_key'], $key])); +$email = $ClientInfo['client_email']; +$token = hash('sha256', json_encode([$email, $ClientInfo['client_key'], $key])); $times = 1; setcookie('UIISC_MEMBER', base64_encode(gzcompress(json_encode(array('email' => $email, 'token' => $token, 'key' => $key)))), time() + $times * 86400, '/'); diff --git a/src/admin/controllers/clients/suspend.php b/src/admin/controllers/clients/suspend.php index 9cd7d96..175f9ec 100755 --- a/src/admin/controllers/clients/suspend.php +++ b/src/admin/controllers/clients/suspend.php @@ -8,7 +8,7 @@ if (!$client_id) { exit('Access Denied'); } -$resault = $DB->update('clients', array('hosting_client_status' => 2), array('hosting_client_id' => $client_id)); +$resault = $DB->update('clients', array('client_status' => 2), array('client_id' => $client_id)); if ($resault) { setMessage('Client suspended successfully !'); diff --git a/src/admin/controllers/clients/view.php b/src/admin/controllers/clients/view.php index 2c3dde4..0824898 100755 --- a/src/admin/controllers/clients/view.php +++ b/src/admin/controllers/clients/view.php @@ -13,17 +13,17 @@ if (empty($client_id)) { $PageInfo['title'] = 'View client (' . $client_id . ')'; -$ClientInfo = $DB->find('clients', '*', array('hosting_client_id' => $client_id), null, 1); +$ClientInfo = $DB->find('clients', '*', array('client_id' => $client_id), null, 1); $CountryName = 'Not Defined'; foreach ($countries as $country) { - if ($ClientInfo['hosting_client_country'] == $country['code']) { + if ($ClientInfo['client_country'] == $country['code']) { $CountryName = $country['name']; break; } } -$count_account = $DB->count('account', array('account_client_id' => $ClientInfo['hosting_client_id'])); -$count_ssl = $DB->count('ssl', array('ssl_for' => $ClientInfo['hosting_client_id'])); -$count_tickets = $DB->count('tickets', array('ticket_for' => $ClientInfo['hosting_client_id'])); +$count_account = $DB->count('account', array('account_client_id' => $ClientInfo['client_id'])); +$count_ssl = $DB->count('ssl', array('ssl_for' => $ClientInfo['client_id'])); +$count_tickets = $DB->count('tickets', array('ticket_for' => $ClientInfo['client_id'])); diff --git a/src/admin/controllers/tickets/close.php b/src/admin/controllers/tickets/close.php index 5486372..8e323bc 100755 --- a/src/admin/controllers/tickets/close.php +++ b/src/admin/controllers/tickets/close.php @@ -9,18 +9,18 @@ if (!$ticket_id) { } // 查找工单信息 -$TicketInfo = $DB->find('tickets', 'ticket_email', array('ticket_id' => $ticket_id)); +$TicketInfo = $DB->find('tickets', 'ticket_email, ticket_for', array('ticket_id' => $ticket_id), null, 1); if (!$TicketInfo) { - setMessage('Not Found !'); + setMessage('Ticket Not Found !'); redirect('admin/tickets'); } // 查找客户信息 -$ClientInfo = $DB->find('clients', 'hosting_client_email, hosting_client_fname', array('hosting_client_id' => $TicketInfo['ticket_for'])); +$ClientInfo = $DB->find('clients', 'client_email, client_fname', array('client_id' => $TicketInfo['ticket_for'])); if (!$ClientInfo) { - setMessage('Not Found !'); + setMessage('Client Not Found !'); redirect('admin/tickets'); } @@ -29,15 +29,15 @@ $resault = $DB->update('tickets', array('ticket_status' => 3), array('ticket_id' if ($resault) { $ticket_url = setURL('admin/tickets', '', array('action' => 'view', 'ticket_id' => $ticket_id)); $email_body = email_build_body('Ticket Closed', - $ClientInfo['hosting_client_fname'], - '

The ticket ("' . $ticket_id . '") had been closed.

', + $ClientInfo['client_fname'], + '

The ticket ("ID: ' . $ticket_id . '") had been closed.

', '

Click here for details.

' ); send_mail(array( 'to' => $TicketInfo['ticket_email'], 'message' => $email_body, - 'subject' => 'Ticket Closed', + 'subject' => 'Ticket Closed ("ID: ' . $ticket_id . '")', )); setMessage('Ticket closed successfully !'); diff --git a/src/admin/views/accounts/edit.php b/src/admin/views/accounts/edit.php index 2f6fdd1..9e6906c 100755 --- a/src/admin/views/accounts/edit.php +++ b/src/admin/views/accounts/edit.php @@ -12,25 +12,25 @@
- +
- +
- +
- +
diff --git a/src/admin/views/clients/list.php b/src/admin/views/clients/list.php index 4239c74..4c8e753 100755 --- a/src/admin/views/clients/list.php +++ b/src/admin/views/clients/list.php @@ -19,23 +19,27 @@ 0): ?> - # - - - + # + + + Inactive'; -} elseif ($value['hosting_client_status'] == '1') { +} elseif ($value['client_status'] == '1') { $btn = ['success', 'globe']; echo 'Active'; -} elseif ($value['hosting_client_status'] == '2') { +} elseif ($value['client_status'] == '2') { $btn = ['danger', 'lock']; echo 'Suspended'; } ?> - Manage + + + Manage + + diff --git a/src/admin/views/clients/view.php b/src/admin/views/clients/view.php index 4476419..21cf2da 100755 --- a/src/admin/views/clients/view.php +++ b/src/admin/views/clients/view.php @@ -10,31 +10,31 @@
-
I18N('First Name'); ?>:
+
I18N('First Name'); ?>:
-
I18N('Last Name'); ?>:
+
I18N('Last Name'); ?>:
-
I18N('Email Address'); ?>:
+
I18N('Email Address'); ?>:
-
Phone Number:
+
Phone Number:
-
I18N('Billing Address'); ?>:
+
I18N('Billing Address'); ?>:
-
I18N('Company'); ?>:
+
I18N('Company'); ?>:
I18N('Country'); ?>:
-
I18N('City'); ?>:
+
I18N('City'); ?>:
-
Postal Code:
+
Postal Code:
I18N('Hosting Accounts'); ?>:
@@ -46,11 +46,11 @@
Support Tickets:
diff --git a/src/admin/views/common/header.php b/src/admin/views/common/header.php index 703f25f..c508d2c 100755 --- a/src/admin/views/common/header.php +++ b/src/admin/views/common/header.php @@ -29,5 +29,5 @@ var ifastnet_aff = ""; - - + + diff --git a/src/callback/myownfreehost/activate.php b/src/callback/myownfreehost/activate.php index ef5858f..7a202c4 100755 --- a/src/callback/myownfreehost/activate.php +++ b/src/callback/myownfreehost/activate.php @@ -19,11 +19,11 @@ if ($AccountInfo) { $res = $DB->update('account', array('account_sql' => $status, 'account_status' => '1'), array('account_id' => $AccountInfo['account_id'])); // 查找客户信息 - $ClientInfo = $DB->find('clients', 'hosting_client_email, hosting_client_fname', array('hosting_client_id' => $AccountInfo['account_client_id'])); + $ClientInfo = $DB->find('clients', 'client_email, client_fname', array('client_id' => $AccountInfo['account_client_id'])); if ($ClientInfo) { - $EmailTo = $ClientInfo['hosting_client_email']; + $EmailTo = $ClientInfo['client_email']; $EmailSubject = 'New Hosting Account'; - $EmailToPeople = $ClientInfo['hosting_client_fname']; + $EmailToPeople = $ClientInfo['client_fname']; } else { $EmailTo = $SiteConfig['site_email']; $EmailToPeople = 'Administrator'; diff --git a/src/callback/myownfreehost/suspend.php b/src/callback/myownfreehost/suspend.php index 9866ea8..0128258 100755 --- a/src/callback/myownfreehost/suspend.php +++ b/src/callback/myownfreehost/suspend.php @@ -17,14 +17,14 @@ $DB->update('account', array('account_status' => '2'), array('account_id' => $Ac // $DB->query("CREATE EVENT " . $username . "_delete ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 30 DAY DO DELETE FROM `hosting_account` WHERE `account_id`='" . $AccountInfo['account_id'] . "'"); // 查找客户信息 -$ClientInfo = $DB->find('clients', 'hosting_client_email, hosting_client_fname', array('hosting_client_id' => $AccountInfo['account_client_id'])); +$ClientInfo = $DB->find('clients', 'client_email, client_fname', array('client_id' => $AccountInfo['account_client_id'])); $EmailContent = '

We had a good time with you while you were with us.

'; $EmailDescription = '

Your account(' . $username . ') have been deactivate successfully and all files and database will be deleted within 30 days.


'; -$email_body = email_build_body('Hosting Account Deactivated', $ClientInfo['hosting_client_fname'], $EmailContent, $EmailDescription); +$email_body = email_build_body('Hosting Account Deactivated', $ClientInfo['client_fname'], $EmailContent, $EmailDescription); send_mail(array( - 'to' => $ClientInfo['hosting_client_email'], + 'to' => $ClientInfo['client_email'], 'message' => $email_body, 'subject' => 'Hosting Account Deactivated' )); diff --git a/src/clientarea/controllers/accounts/add.php b/src/clientarea/controllers/accounts/add.php index 7b71145..695cf77 100755 --- a/src/clientarea/controllers/accounts/add.php +++ b/src/clientarea/controllers/accounts/add.php @@ -16,14 +16,14 @@ if (isset($_POST['submit'])) { 'username' => substr(str_shuffle('qwertyuioplkjhgfdsazxcvbnm012345789QWERTYUIOPLKJHGFDSAZXCVBNM'), 0, 8), 'password' => substr(str_shuffle('qwertyuioplkjhgfdsazxcvbnm012345789QWERTYUIOPLKJHGFDSAZXCVBNM'), 0, 16), 'account_domain' => post('domain'), - 'email' => $ClientInfo['hosting_client_email'], + 'email' => $ClientInfo['client_email'], 'plan' => post('package'), ); if (empty($FormData['account_domain'])) { setMessage('Domain cannot be empty !', 'danger'); redirect('clientarea/accounts', '', array('action' => 'add')); } else { - $AccountList = $DB->findAll('account', '*', array('account_client_id' => $ClientInfo['hosting_client_id'])); + $AccountList = $DB->findAll('account', '*', array('account_client_id' => $ClientInfo['client_id'])); if (count($AccountList) < 3) { $client = Client::create($HostingApiConfig); $request = $client->createAccount(array( @@ -53,7 +53,7 @@ if (isset($_POST['submit'])) { 'account_domain' => $Result['account_domain'], 'account_status' => '1', 'account_date' => $Result['date'], - 'account_client_id' => $ClientInfo['hosting_client_id'], + 'account_client_id' => $ClientInfo['client_id'], 'account_sql' => 'NULL', )); if ($account_id) { @@ -78,7 +78,7 @@ if (isset($_POST['submit'])) {

Next,


'; $EmailDescription .= '

Login to Clientarea

'; - $email_body = email_build_body('New Hosting Account', $ClientInfo['hosting_client_fname'], $EmailContent, $EmailDescription); + $email_body = email_build_body('New Hosting Account', $ClientInfo['client_fname'], $EmailContent, $EmailDescription); send_mail(array( 'to' => $EmailTo, diff --git a/src/clientarea/controllers/accounts/deactivate.php b/src/clientarea/controllers/accounts/deactivate.php index 4504863..b182303 100755 --- a/src/clientarea/controllers/accounts/deactivate.php +++ b/src/clientarea/controllers/accounts/deactivate.php @@ -20,7 +20,7 @@ if (strlen($reason) < 8) { redirect('clientarea/accounts', '', array('action' => 'edit', 'account_id' => $account_id)); } -$AccountInfo = $DB->find('account', '*', array('account_id' => $account_id, 'account_client_id' => $ClientInfo['hosting_client_id']), null, 1); +$AccountInfo = $DB->find('account', '*', array('account_id' => $account_id, 'account_client_id' => $ClientInfo['client_id']), null, 1); if (empty($AccountInfo)) { setMessage('Account not found', 'danger'); @@ -61,10 +61,10 @@ if ($Result['status'] == 0 && !is_array($Result['message'])) { // 本地同步成功 $EmailContent = '

We had a good time with you while you were with us.

'; $EmailDescription = 'Your account(# ' . $account_id . ') have been deactivate successfully and all files and database will be deleted within 30 days.'; - $email_body = email_build_body('Hosting Account Deactivated', $ClientInfo['hosting_client_fname'], $EmailContent, $EmailDescription); + $email_body = email_build_body('Hosting Account Deactivated', $ClientInfo['client_fname'], $EmailContent, $EmailDescription); send_mail(array( - 'to' => $ClientInfo['hosting_client_email'], + 'to' => $ClientInfo['client_email'], 'message' => $email_body, 'subject' => 'Hosting Account Deactivated' )); diff --git a/src/clientarea/controllers/accounts/edit.php b/src/clientarea/controllers/accounts/edit.php index 25a767f..b5f7024 100755 --- a/src/clientarea/controllers/accounts/edit.php +++ b/src/clientarea/controllers/accounts/edit.php @@ -9,7 +9,7 @@ if (empty($account_id)) { redirect('clientarea/accounts'); } -$AccountInfo = $DB->find('account', '*', array('account_id' => $account_id, 'account_client_id' => $ClientInfo['hosting_client_id']), null, 1); +$AccountInfo = $DB->find('account', '*', array('account_id' => $account_id, 'account_client_id' => $ClientInfo['client_id']), null, 1); if (empty($AccountInfo)) { setMessage('not found', 'danger'); diff --git a/src/clientarea/controllers/accounts/goftp.php b/src/clientarea/controllers/accounts/goftp.php index efc4da5..6ef01e1 100755 --- a/src/clientarea/controllers/accounts/goftp.php +++ b/src/clientarea/controllers/accounts/goftp.php @@ -9,7 +9,7 @@ if (empty($account_id)) { redirect('clientarea/accounts'); } -$AccountInfo = $DB->find('account', '*', array('account_id' => $account_id, 'account_client_id' => $ClientInfo['hosting_client_id']), null, 1); +$AccountInfo = $DB->find('account', '*', array('account_id' => $account_id, 'account_client_id' => $ClientInfo['client_id']), null, 1); if (empty($AccountInfo)) { setMessage('Account not found', 'danger'); diff --git a/src/clientarea/controllers/accounts/list.php b/src/clientarea/controllers/accounts/list.php index 7ce0d47..46a17e2 100755 --- a/src/clientarea/controllers/accounts/list.php +++ b/src/clientarea/controllers/accounts/list.php @@ -8,7 +8,7 @@ require_once __DIR__ . '/../../application.php'; $PageInfo['title'] = $lang->I18N('Hosting Accounts'); -$total_count = $DB->count('account', array('account_client_id' => $ClientInfo['hosting_client_id'])); -$active_count = $DB->count('account', array('account_client_id' => $ClientInfo['hosting_client_id'], 'account_status' => '1')); +$total_count = $DB->count('account', array('account_client_id' => $ClientInfo['client_id'])); +$active_count = $DB->count('account', array('account_client_id' => $ClientInfo['client_id'], 'account_status' => '1')); -$rows = $DB->findAll('account', '*', array('account_client_id' => $ClientInfo['hosting_client_id']), "`account_id` DESC"); +$rows = $DB->findAll('account', '*', array('account_client_id' => $ClientInfo['client_id']), "`account_id` DESC"); diff --git a/src/clientarea/controllers/accounts/login.php b/src/clientarea/controllers/accounts/login.php index 2bb0d3c..9d3af38 100755 --- a/src/clientarea/controllers/accounts/login.php +++ b/src/clientarea/controllers/accounts/login.php @@ -9,7 +9,7 @@ if (empty($account_id)) { redirect('clientarea/accounts'); } -$AccountInfo = $DB->find('account', '*', array('account_id' => $account_id, 'account_client_id' => $ClientInfo['hosting_client_id']), null, 1); +$AccountInfo = $DB->find('account', '*', array('account_id' => $account_id, 'account_client_id' => $ClientInfo['client_id']), null, 1); if (empty($AccountInfo)) { setMessage('not found', 'danger'); diff --git a/src/clientarea/controllers/accounts/password.php b/src/clientarea/controllers/accounts/password.php index 877c1e6..6ea2cb7 100755 --- a/src/clientarea/controllers/accounts/password.php +++ b/src/clientarea/controllers/accounts/password.php @@ -13,7 +13,7 @@ if (empty($account_id)) { redirect('clientarea/accounts'); } -$AccountInfo = $DB->find('account', '*', array('account_id' => $account_id, 'account_client_id' => $ClientInfo['hosting_client_id']), null, 1); +$AccountInfo = $DB->find('account', '*', array('account_id' => $account_id, 'account_client_id' => $ClientInfo['client_id']), null, 1); if (empty($AccountInfo)) { setMessage('Account not found', 'danger'); diff --git a/src/clientarea/controllers/accounts/view.php b/src/clientarea/controllers/accounts/view.php index 454f63d..ade27c9 100755 --- a/src/clientarea/controllers/accounts/view.php +++ b/src/clientarea/controllers/accounts/view.php @@ -10,7 +10,7 @@ if (empty($account_id)) { $_where = array( 'account_id' => $account_id, - 'account_client_id' => $ClientInfo['hosting_client_id'], + 'account_client_id' => $ClientInfo['client_id'], ); $AccountInfo = $DB->find('account', '*', $_where, null, 1); diff --git a/src/clientarea/controllers/clients/forgetpassword.php b/src/clientarea/controllers/clients/forgetpassword.php index bb97692..ddd57cc 100755 --- a/src/clientarea/controllers/clients/forgetpassword.php +++ b/src/clientarea/controllers/clients/forgetpassword.php @@ -14,16 +14,16 @@ if (isset($_POST['reset'])) { redirect('clientarea/forgetpassword'); } - $ClientInfo = $DB->find('clients', 'hosting_client_key, hosting_client_fname', array('hosting_client_email' => $post_mail), null, 1); + $ClientInfo = $DB->find('clients', 'client_key, client_fname', array('client_email' => $post_mail), null, 1); if ($ClientInfo) { - $TokenId = password_hash($ClientInfo['hosting_client_key'], PASSWORD_DEFAULT); + $TokenId = password_hash($ClientInfo['client_key'], PASSWORD_DEFAULT); $TokenData = [['token' => str_replace('$2y$10$', '', $TokenId), 'email' => $post_mail]]; $Token = base64_encode(json_encode($TokenData)); $EmailContent = '

You have requested a password reset. If you have not requested a password reset please let us know by opening a support ticket in the clientarea.

'; $EmailDescription = '
' . $Token . '
'; $EmailDescription .= '

Reset Password

'; - $email_body = email_build_body('Reset Password', $ClientInfo['hosting_client_fname'], $EmailContent, $EmailDescription); + $email_body = email_build_body('Reset Password', $ClientInfo['client_fname'], $EmailContent, $EmailDescription); send_mail(array( 'to' => $post_mail, diff --git a/src/clientarea/controllers/clients/login.php b/src/clientarea/controllers/clients/login.php index 19015e8..6578fb5 100755 --- a/src/clientarea/controllers/clients/login.php +++ b/src/clientarea/controllers/clients/login.php @@ -23,9 +23,9 @@ if (isset($_POST['login'])) { $password_hash = hash('sha256', $password); - $ClientInfo = $DB->find('clients', 'hosting_client_id, hosting_client_password, hosting_client_key', array( - 'hosting_client_email' => $email, - 'hosting_client_password' => $password_hash, + $ClientInfo = $DB->find('clients', 'client_id, client_password, client_key', array( + 'client_email' => $email, + 'client_password' => $password_hash, ), null, 1); if (!$ClientInfo || empty($ClientInfo)) { @@ -33,9 +33,9 @@ if (isset($_POST['login'])) { redirect('clientarea/login'); } - if ($password_hash == $ClientInfo['hosting_client_password']) { + if ($password_hash == $ClientInfo['client_password']) { $key = rand(000000, 999999); - $token = hash('sha256', json_encode([$email, $ClientInfo['hosting_client_key'], $key])); + $token = hash('sha256', json_encode([$email, $ClientInfo['client_key'], $key])); $times = isset($_POST['remember']) ? 30 : 1; $token2 = ['email' => $email, 'token' => $token, 'key' => $key]; setcookie('UIISC_MEMBER', base64_encode(gzcompress(json_encode($token2))), time() + $times * 86400, '/'); diff --git a/src/clientarea/controllers/clients/profile.php b/src/clientarea/controllers/clients/profile.php index b481612..a4458cc 100644 --- a/src/clientarea/controllers/clients/profile.php +++ b/src/clientarea/controllers/clients/profile.php @@ -6,7 +6,7 @@ require_once ROOT . '/core/library/countries.php'; $CountryName = 'Not Defined'; foreach ($countries as $country) { - if ($ClientInfo['hosting_client_country'] == $country['code']) { + if ($ClientInfo['client_country'] == $country['code']) { $CountryName = $country['name']; break; } diff --git a/src/clientarea/controllers/clients/resendcode.php b/src/clientarea/controllers/clients/resendcode.php index bb32694..7de392a 100755 --- a/src/clientarea/controllers/clients/resendcode.php +++ b/src/clientarea/controllers/clients/resendcode.php @@ -3,18 +3,18 @@ $current_route = 'clientarea/validate'; // TODO: make it automation require_once __DIR__ . '/../../application.php'; -if ($ClientInfo['hosting_client_status'] == 1) { +if ($ClientInfo['client_status'] == 1) { setMessage('Your account has been verified !'); redirect('clientarea/index'); } if (isset($_POST['resendcode'])) { - $Token = str_replace('$2y$10$', '', password_hash($ClientInfo['hosting_client_key'], PASSWORD_DEFAULT)); + $Token = str_replace('$2y$10$', '', password_hash($ClientInfo['client_key'], PASSWORD_DEFAULT)); $EmailContent = '

We\'ll like you to be a member of our service. Please copy the code from below in order to verify your account.

'; $EmailDescription = '
' . $Token . '
'; - $email_body = email_build_body('Verify Email', $ClientInfo['hosting_client_fname'], $EmailContent, $EmailDescription); + $email_body = email_build_body('Verify Email', $ClientInfo['client_fname'], $EmailContent, $EmailDescription); send_mail(array( - 'to' => $ClientInfo['hosting_client_email'], + 'to' => $ClientInfo['client_email'], 'message' => $email_body, 'subject' => 'Verify Email' )); diff --git a/src/clientarea/controllers/clients/resetpassword.php b/src/clientarea/controllers/clients/resetpassword.php index b1162ed..d882bfe 100755 --- a/src/clientarea/controllers/clients/resetpassword.php +++ b/src/clientarea/controllers/clients/resetpassword.php @@ -20,7 +20,7 @@ if (isset($_POST['reset'])) { $ClientEmail = $TokenInfo[0]->email; - $ClientInfo = $DB->find('clients', 'hosting_client_id, hosting_client_key, hosting_client_fname', array('hosting_client_email' => $ClientEmail), null, 1); + $ClientInfo = $DB->find('clients', 'client_id, client_key, client_fname', array('client_email' => $ClientEmail), null, 1); if (!$ClientInfo) { setMessage('Invalid reset token !', 'danger'); @@ -29,14 +29,14 @@ if (isset($_POST['reset'])) { $Key = '$2y$10$' . $TokenInfo[0]->token; - if (password_verify($ClientInfo['hosting_client_key'], $Key)) { + if (password_verify($ClientInfo['client_key'], $Key)) { $hashed_password = hash('sha256', $new_password); - $result = $DB->update('clients', array('hosting_client_password' => $hashed_password), array('hosting_client_id' => $ClientInfo['hosting_client_id'])); + $result = $DB->update('clients', array('client_password' => $hashed_password), array('client_id' => $ClientInfo['client_id'])); if ($result) { $EmailContent = '

Your account password has been reset successfully. Please login to clientarea to use our services again.

'; $EmailDescription = '

Click here to login.

'; - $email_body = email_build_body('Reset Password', $ClientInfo['hosting_client_fname'], $EmailContent, $EmailDescription); + $email_body = email_build_body('Reset Password', $ClientInfo['client_fname'], $EmailContent, $EmailDescription); send_mail(array( 'to' => $ClientEmail, diff --git a/src/clientarea/controllers/clients/signup.php b/src/clientarea/controllers/clients/signup.php index 61c1a32..032d438 100755 --- a/src/clientarea/controllers/clients/signup.php +++ b/src/clientarea/controllers/clients/signup.php @@ -9,39 +9,39 @@ if (isset($_COOKIE['UIISC_MEMBER']) && $_COOKIE['UIISC_MEMBER'] != 'NULL') { if (isset($_POST['signup'])) { $FormData = array( - 'hosting_client_fname' => post('first'), - 'hosting_client_lname' => post('last'), - 'hosting_client_email' => post('email'), - 'hosting_client_company' => '', - 'hosting_client_country' => '', - 'hosting_client_city' => '', - 'hosting_client_address' => '', - 'hosting_client_pcode' => '', - 'hosting_client_phone' => '', - 'hosting_client_state' => '', - 'hosting_client_password' => hash('sha256', post('password')), - 'hosting_client_date' => date('Y-m-d H:i:s'), - 'hosting_client_key' => substr(str_shuffle('qwertyuioplkjhgfdsazxcvbnm012345789QWERTYUIOPLKJHGFDSAZXCVBNM'), 0, 8), - 'hosting_client_status' => 0, + '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_password' => hash('sha256', post('password')), + 'client_date' => date('Y-m-d H:i:s'), + 'client_key' => substr(str_shuffle('qwertyuioplkjhgfdsazxcvbnm012345789QWERTYUIOPLKJHGFDSAZXCVBNM'), 0, 8), + 'client_status' => 0, ); - $where = "`hosting_client_email`='" . $FormData['hosting_client_email'] . "' OR `hosting_client_key`='" . $FormData['hosting_client_key'] . "'"; + $where = "`client_email`='" . $FormData['client_email'] . "' OR `client_key`='" . $FormData['client_key'] . "'"; - $has = $DB->find('clients', 'hosting_client_id', $where); + $has = $DB->find('clients', 'client_id', $where); if ($has) { setMessage('Account already exsits! or invalid token', 'danger'); redirect('clientarea/login'); } $result = $DB->insert('clients', $FormData); - $Token = str_replace('$2y$10$', '', password_hash($FormData['hosting_client_key'], PASSWORD_DEFAULT)); + $Token = str_replace('$2y$10$', '', password_hash($FormData['client_key'], PASSWORD_DEFAULT)); $EmailContent = '

Your new account has been registered.

Please copy the code below to verify your account.

'; $EmailDescription = '
' . $Token . '
'; - $email_body = email_build_body('Verify Email', $FormData['hosting_client_fname'], $EmailContent, $EmailDescription); + $email_body = email_build_body('Verify Email', $FormData['client_fname'], $EmailContent, $EmailDescription); send_mail(array( - 'to' => $FormData['hosting_client_email'], + 'to' => $FormData['client_email'], 'message' => $email_body, 'subject' => 'Verify Account' )); diff --git a/src/clientarea/controllers/clients/validate.php b/src/clientarea/controllers/clients/validate.php index c6b6348..7fb5917 100755 --- a/src/clientarea/controllers/clients/validate.php +++ b/src/clientarea/controllers/clients/validate.php @@ -12,10 +12,10 @@ if (isset($_POST['validate'])) { } $token = '$2y$10$' . post('validation_code'); - $client_key = $ClientInfo['hosting_client_key']; + $client_key = $ClientInfo['client_key']; if (password_verify($client_key, $token)) { - $resault = $DB->update('clients', ['hosting_client_status' => '1'], ['hosting_client_key' => $client_key]); + $resault = $DB->update('clients', array('client_status' => '1'), array('client_key' => $client_key)); if ($resault) { setMessage('validated successfully !', 'success'); redirect('clientarea/index'); @@ -28,7 +28,7 @@ if (isset($_POST['validate'])) { redirect('clientarea/validate'); } -if ($ClientInfo['hosting_client_status'] == 1) { +if ($ClientInfo['client_status'] == 1) { setMessage('Your account has been verified !'); redirect('clientarea/index'); } diff --git a/src/clientarea/controllers/dashboard/view.php b/src/clientarea/controllers/dashboard/view.php index e0c8408..f7aeb7a 100755 --- a/src/clientarea/controllers/dashboard/view.php +++ b/src/clientarea/controllers/dashboard/view.php @@ -1,12 +1,12 @@ count('account', array('account_client_id' => $ClientInfo['hosting_client_id'], 'account_status' => 1)); -$count_ssl = $DB->count('ssl', array('ssl_for' => $ClientInfo['hosting_client_id'])); +$count_acc = $DB->count('account', array('account_client_id' => $ClientInfo['client_id'], 'account_status' => 1)); +$count_ssl = $DB->count('ssl', array('ssl_for' => $ClientInfo['client_id'])); -// $count_tic1 = $DB->count('tickets', array('ticket_for' => $ClientInfo['hosting_client_id'], 'ticket_status' => 0)); -// $count_tic2 = $DB->count('tickets', array('ticket_for' => $ClientInfo['hosting_client_id'], 'ticket_status' => 1)); +// $count_tic1 = $DB->count('tickets', array('ticket_for' => $ClientInfo['client_id'], 'ticket_status' => 0)); +// $count_tic2 = $DB->count('tickets', array('ticket_for' => $ClientInfo['client_id'], 'ticket_status' => 1)); // $count_tic = $count_tic1 + $count_tic2; -$count_tic = $DB->getColumn("SELECT COUNT(*) FROM `pre_tickets` WHERE `ticket_for`='" . $ClientInfo['hosting_client_id'] . "' AND `ticket_status`=0 OR `ticket_for`='" . $ClientInfo['hosting_client_id'] . "' AND `ticket_status`=1"); +$count_tic = $DB->getColumn("SELECT COUNT(*) FROM `pre_tickets` WHERE `ticket_for`='" . $ClientInfo['client_id'] . "' AND `ticket_status`=0 OR `ticket_for`='" . $ClientInfo['client_id'] . "' AND `ticket_status`=1"); $PageInfo['title'] = 'Dashboard'; diff --git a/src/clientarea/controllers/myssl/list.php b/src/clientarea/controllers/myssl/list.php index bc56e71..fb62f25 100755 --- a/src/clientarea/controllers/myssl/list.php +++ b/src/clientarea/controllers/myssl/list.php @@ -2,10 +2,10 @@ require ROOT . '/core/library/userinfo.class.php'; -$count = $DB->count('ssl', array('ssl_for' => $ClientInfo['hosting_client_id'])); +$count = $DB->count('ssl', array('ssl_for' => $ClientInfo['client_id'])); if ($count > 0) { - $rows = $DB->findAll('ssl', '*', array('ssl_for' => $ClientInfo['hosting_client_id']), "`ssl_id` DESC"); + $rows = $DB->findAll('ssl', '*', array('ssl_for' => $ClientInfo['client_id']), "`ssl_id` DESC"); require_once ROOT . '/core/handler/SSLHandler.php'; require_once ROOT . '/modules/GoGetSSL/GoGetSSLApi.php'; diff --git a/src/clientarea/controllers/myssl/new.php b/src/clientarea/controllers/myssl/new.php index 0545474..6f18d4f 100755 --- a/src/clientarea/controllers/myssl/new.php +++ b/src/clientarea/controllers/myssl/new.php @@ -6,65 +6,65 @@ if (!isset($_POST['submit'])) { exit(); } -if ($ClientInfo['hosting_client_country'] == 'NULL') { +if (empty($ClientInfo['client_country'])) { $Country = 'CN'; } else { - $Country = ucwords($ClientInfo['hosting_client_country']); + $Country = ucwords($ClientInfo['client_country']); } -if ($ClientInfo['hosting_client_company'] == 'NULL') { +if (empty($ClientInfo['client_company'])) { $Company = 'UIISC'; } else { - $Company = $ClientInfo['hosting_client_company']; + $Company = $ClientInfo['client_company']; } -if ($ClientInfo['hosting_client_phone'] == 'NULL') { - $Phone = '02151351888'; +if (empty($ClientInfo['client_phone'])) { + $Phone = '021-51351888'; } else { - $Phone = $ClientInfo['hosting_client_phone']; + $Phone = $ClientInfo['client_phone']; } -if ($ClientInfo['hosting_client_city'] == 'NULL') { +if (empty($ClientInfo['client_city'])) { $City = 'Lahore'; } else { - $City = $ClientInfo['hosting_client_city']; + $City = $ClientInfo['client_city']; } -if ($ClientInfo['hosting_client_pcode'] == 'NULL') { +if (empty($ClientInfo['client_pcode'])) { $Postal = '200000'; } else { - $Postal = $ClientInfo['hosting_client_pcode']; + $Postal = $ClientInfo['client_pcode']; } $FormData = array( - 'product_id' => 65, // the GoGetSSL® 90-day Trial SSL ID: 65 - 'csr' => $_POST['csr'], - 'server_count' => "-1", - 'period' => 3, - 'approver_email' => 'uiisc@qq.com', - 'webserver_type' => "1", - 'admin_firstname' => $ClientInfo['hosting_client_fname'], - 'admin_lastname' => $ClientInfo['hosting_client_lname'], - 'admin_phone' => $Phone, - 'admin_title' => "Mr", - 'admin_email' => $ClientInfo['hosting_client_email'], - 'tech_firstname' => $ClientInfo['hosting_client_fname'], - 'tech_lastname' => $ClientInfo['hosting_client_lname'], - 'tech_phone' => $Phone, - 'tech_title' => "Mr", - 'tech_email' => $ClientInfo['hosting_client_email'], - 'org_name' => $Company, - 'org_division' => "Hosting", - 'org_addressline1' => $ClientInfo['hosting_client_address'], - 'org_city' => $City, - 'org_country' => $Country, - 'org_phone' => $Phone, - 'org_postalcode' => $Postal, - 'org_region' => "None", - 'dcv_method' => "dns", + 'product_id' => 65, // the GoGetSSL® 90-day Trial SSL ID: 65 + 'csr' => $_POST['csr'], + 'server_count' => '-1', + 'period' => 3, + 'approver_email' => 'uiisc@qq.com', + 'webserver_type' => '1', + 'admin_firstname' => $ClientInfo['client_fname'], + 'admin_lastname' => $ClientInfo['client_lname'], + 'admin_phone' => $Phone, + 'admin_title' => 'Mr', + 'admin_email' => $ClientInfo['client_email'], + 'tech_firstname' => $ClientInfo['client_fname'], + 'tech_lastname' => $ClientInfo['client_lname'], + 'tech_phone' => $Phone, + 'tech_title' => 'Mr', + 'tech_email' => $ClientInfo['client_email'], + 'org_name' => $Company, + 'org_division' => 'Hosting', + 'org_addressline1' => $ClientInfo['client_address'], + 'org_city' => $City, + 'org_country' => $Country, + 'org_phone' => $Phone, + 'org_postalcode' => $Postal, + 'org_region' => 'None', + 'dcv_method' => 'dns', ); -echo "
";
+echo '
';
 print_r($FormData);
 
 $SSLApi = $DB->find('ssl_api', '*', array('api_key' => 'FREESSL'), null, 1);
@@ -78,7 +78,7 @@ $result = $apiClient->addSSLOrder($FormData);
 if (count($result) > 4) {
     $data = array(
         'ssl_key' => $result['order_id'],
-        'ssl_for' => $ClientInfo['hosting_client_id'],
+        'ssl_for' => $ClientInfo['client_id'],
     );
     $res = $DB->insert('ssl', $data);
 
@@ -87,7 +87,7 @@ if (count($result) > 4) {
 
         $EmailContent = '

You have successfully created a new ssl and you need to verify your domain using dns record in order to issue an ssl certificate.

'; $EmailDescription = 'View SSL'; - $email_body = email_build_body('New SSL', $ClientInfo['hosting_client_fname'], $EmailContent, $EmailDescription); + $email_body = email_build_body('New SSL', $ClientInfo['client_fname'], $EmailContent, $EmailDescription); send_mail(array( 'to' => $FormData['email'], diff --git a/src/clientarea/controllers/settings/edit.php b/src/clientarea/controllers/settings/edit.php index af13360..828ef25 100755 --- a/src/clientarea/controllers/settings/edit.php +++ b/src/clientarea/controllers/settings/edit.php @@ -7,18 +7,18 @@ if (!isset($_POST['submit'])) { } $form_data = array( - 'hosting_client_fname' => post('fname'), - 'hosting_client_lname' => post('lname'), - 'hosting_client_phone' => post('phone'), - 'hosting_client_company' => post('company'), - 'hosting_client_address' => post('address'), - 'hosting_client_country' => post('country'), - 'hosting_client_city' => post('city'), - 'hosting_client_pcode' => post('postal'), - 'hosting_client_state' => post('state') + 'client_fname' => post('fname'), + 'client_lname' => post('lname'), + 'client_phone' => post('phone'), + 'client_company' => post('company'), + 'client_address' => post('address'), + 'client_country' => post('country'), + 'client_city' => post('city'), + 'client_pcode' => post('postal'), + 'client_state' => post('state') ); -$where_data = array('hosting_client_key' => $ClientInfo['hosting_client_key']); +$where_data = array('client_id' => $ClientInfo['client_id']); $data = $DB->update('clients', $form_data, $where_data); diff --git a/src/clientarea/controllers/settings/password.php b/src/clientarea/controllers/settings/password.php index 02354d7..0afd415 100755 --- a/src/clientarea/controllers/settings/password.php +++ b/src/clientarea/controllers/settings/password.php @@ -6,18 +6,14 @@ if (!isset($_POST['submit'])) { redirect('clientarea/settings'); } -$form_data = array( - 'old_password' => post('old_password'), - 'new_password' => post('new_password'), - 'hashed_password' => hash('sha256', post('new_password')), - 'user_key' => $ClientInfo['hosting_client_key'], - 'user_password' => $ClientInfo['hosting_client_password'], -); +$old_password = post('old_password'); +$old_password = hash('sha256', $old_password); +$new_password = post('new_password'); +$new_password = hash('sha256', $new_password); -if (hash('sha256', $form_data['old_password']) == $form_data['user_password']) { - - $update_data = array('hosting_client_password' => $form_data['hashed_password']); - $where_data = array('hosting_client_key' => $form_data['user_key']); +if ($old_password == $ClientInfo['client_password']) { + $update_data = array('client_password' => $new_password); + $where_data = array('client_id' => $ClientInfo['client_id']); $result = $DB->update('clients', $update_data, $where_data); if ($result) { diff --git a/src/clientarea/controllers/tickets/add.php b/src/clientarea/controllers/tickets/add.php index 7ae24da..485d9a0 100755 --- a/src/clientarea/controllers/tickets/add.php +++ b/src/clientarea/controllers/tickets/add.php @@ -8,7 +8,7 @@ if (isset($_POST['submit'])) { 'ticket_email' => post('email'), 'ticket_content' => post('editor'), 'ticket_department' => post('department'), - 'ticket_for' => $ClientInfo['hosting_client_id'], + 'ticket_for' => $ClientInfo['client_id'], 'ticket_date' => date('Y-m-d H:i:s'), 'ticket_status' => 0, ); @@ -20,9 +20,9 @@ if (isset($_POST['submit'])) { // to customer send_mail(array( 'to' => $FormData['ticket_email'], - 'subject' => 'New Ticket (#' . $ClientInfo['hosting_client_id'] . ')', + 'subject' => 'New Ticket (#' . $ClientInfo['client_id'] . ')', 'message' => email_build_body('New Ticket', - $ClientInfo['hosting_client_fname'], + $ClientInfo['client_fname'], '

You have opened a support ticket which will be processed soon. It can take up to 2 hours.

', '

Click here for details.

' ), @@ -31,7 +31,7 @@ if (isset($_POST['submit'])) { // to Administrator send_mail(array( 'to' => $SiteConfig['site_email'], - 'subject' => 'New Ticket (#' . $ClientInfo['hosting_client_id'] . ')', + 'subject' => 'New Ticket (#' . $ClientInfo['client_id'] . ')', 'message' => email_build_body('New Ticket', 'Administrator', '

We have received a new support ticket request, please handle it in time.

', diff --git a/src/clientarea/controllers/tickets/close.php b/src/clientarea/controllers/tickets/close.php index 8e51a80..15b5934 100755 --- a/src/clientarea/controllers/tickets/close.php +++ b/src/clientarea/controllers/tickets/close.php @@ -15,7 +15,7 @@ if ($resault) { $TicketUrl = setURL('clientarea/tickets', '', array('action' => 'view', 'ticket_id' => $ticket_id)); $EmailContent = '

You have closed a ticket(' . $ticket_id . ') .

'; $EmailDescription = '

Click here for details.

'; - $email_body = email_build_body('Ticket Closed', $ClientInfo['hosting_client_fname'], $EmailContent, $EmailDescription); + $email_body = email_build_body('Ticket Closed', $ClientInfo['client_fname'], $EmailContent, $EmailDescription); send_mail(array( 'to' => $TicketInfo['ticket_email'], diff --git a/src/clientarea/controllers/tickets/list.php b/src/clientarea/controllers/tickets/list.php index ff6ba95..a7d10ec 100755 --- a/src/clientarea/controllers/tickets/list.php +++ b/src/clientarea/controllers/tickets/list.php @@ -4,8 +4,8 @@ $PageInfo['title'] = 'My Tickets'; require_once ROOT . '/core/library/userinfo.class.php'; -$count = $DB->count('tickets', array('ticket_for' => $ClientInfo['hosting_client_id'])); +$count = $DB->count('tickets', array('ticket_for' => $ClientInfo['client_id'])); if ($count > 0) { - $rows = $DB->findAll('tickets', '*', array('ticket_for' => $ClientInfo['hosting_client_id']), "`ticket_id` DESC"); + $rows = $DB->findAll('tickets', '*', array('ticket_for' => $ClientInfo['client_id']), "`ticket_id` DESC"); } diff --git a/src/clientarea/controllers/tickets/reply.php b/src/clientarea/controllers/tickets/reply.php index 51207b2..bc3f087 100755 --- a/src/clientarea/controllers/tickets/reply.php +++ b/src/clientarea/controllers/tickets/reply.php @@ -18,7 +18,7 @@ $resault = $DB->update('tickets', array('ticket_status' => '2'), array('ticket_i if ($resault) { $FormData = array( 'reply_for' => $ticket_id, - 'reply_from' => $ClientInfo['hosting_client_id'], + 'reply_from' => $ClientInfo['client_id'], 'reply_content' => post('editor'), 'reply_date' => date('Y-m-d H:i:s'), ); @@ -26,7 +26,7 @@ if ($resault) { if ($resault_insert) { $ticket_url = setURL('clientarea/tickets', '', array('action' => 'view', 'ticket_id' => $ticket_id)); - $email_content = '

You have received a reply from ' . $ClientInfo['hosting_client_fname'] . '.

'; + $email_content = '

You have received a reply from ' . $ClientInfo['client_fname'] . '.

'; $email_description = '
View Ticket
'; $email_body = email_build_body('Ticket Reply', 'there', $email_content, $email_description); diff --git a/src/clientarea/controllers/tickets/view.php b/src/clientarea/controllers/tickets/view.php index 2cf3d05..069bd54 100755 --- a/src/clientarea/controllers/tickets/view.php +++ b/src/clientarea/controllers/tickets/view.php @@ -11,7 +11,7 @@ if (!$ticket_id) { $where = array( 'ticket_id' => $ticket_id, - 'ticket_for' => $ClientInfo['hosting_client_id'], + 'ticket_for' => $ClientInfo['client_id'], ); $TicketInfo = $DB->find('tickets', '*', $where, null, 1); diff --git a/src/clientarea/views/accounts/add.php b/src/clientarea/views/accounts/add.php index b13a1c1..ba7bf7e 100755 --- a/src/clientarea/views/accounts/add.php +++ b/src/clientarea/views/accounts/add.php @@ -11,25 +11,25 @@
- +
- +
- +
- +
diff --git a/src/clientarea/views/accounts/edit.php b/src/clientarea/views/accounts/edit.php index 314bb59..f579556 100755 --- a/src/clientarea/views/accounts/edit.php +++ b/src/clientarea/views/accounts/edit.php @@ -13,25 +13,25 @@
- +
- +
- +
- +
diff --git a/src/clientarea/views/clients/profile.php b/src/clientarea/views/clients/profile.php index f5d11de..71200d2 100755 --- a/src/clientarea/views/clients/profile.php +++ b/src/clientarea/views/clients/profile.php @@ -7,31 +7,31 @@
-
I18N('First Name'); ?>:
+
I18N('First Name'); ?>:
-
I18N('Last Name'); ?>:
+
I18N('Last Name'); ?>:
-
I18N('Email Address'); ?>:
+
I18N('Email Address'); ?>:
-
Phone Number:
+
Phone Number:
-
I18N('Billing Address'); ?>:
+
I18N('Billing Address'); ?>:
-
I18N('Company'); ?>:
+
I18N('Company'); ?>:
I18N('Country'); ?>:
-
I18N('City'); ?>:
+
I18N('City'); ?>:
-
Postal Code:
+
Postal Code:
I18N('IP Address'); ?>:
diff --git a/src/clientarea/views/clients/suspended.php b/src/clientarea/views/clients/suspended.php index cc7fb84..85867cd 100755 --- a/src/clientarea/views/clients/suspended.php +++ b/src/clientarea/views/clients/suspended.php @@ -31,10 +31,10 @@ diff --git a/src/clientarea/views/clients/validate.php b/src/clientarea/views/clients/validate.php index 9538c3f..aa4ac1c 100755 --- a/src/clientarea/views/clients/validate.php +++ b/src/clientarea/views/clients/validate.php @@ -31,7 +31,7 @@ - + @@ -51,7 +51,7 @@
I18N('Validate Account'); ?>

-

Note: You need to verify this account in order to use our free hosting and ssl services. An email has been sent to your submitted email address() with validation code.

+

Note: You need to verify this account in order to use our free hosting and ssl services. An email has been sent to your submitted email address() with validation code.

diff --git a/src/clientarea/views/common/sidebar.php b/src/clientarea/views/common/sidebar.php index 02e5f26..d4c720a 100755 --- a/src/clientarea/views/common/sidebar.php +++ b/src/clientarea/views/common/sidebar.php @@ -1,5 +1,5 @@ @@ -13,7 +13,7 @@ $avatar_path = $ClientInfo['hosting_client_email'] ? md5($ClientInfo['hosting_cl - + diff --git a/src/clientarea/views/csr/decode.php b/src/clientarea/views/csr/decode.php index 9e90711..2203fb4 100755 --- a/src/clientarea/views/csr/decode.php +++ b/src/clientarea/views/csr/decode.php @@ -12,25 +12,25 @@
- +
- +
- +
- +
diff --git a/src/clientarea/views/csr/new.php b/src/clientarea/views/csr/new.php index 46ad57d..4197a05 100755 --- a/src/clientarea/views/csr/new.php +++ b/src/clientarea/views/csr/new.php @@ -12,21 +12,21 @@
- +
- +
- +
- +
- +
diff --git a/src/clientarea/views/myssl/add.php b/src/clientarea/views/myssl/add.php index 2b0ac3d..889b08d 100755 --- a/src/clientarea/views/myssl/add.php +++ b/src/clientarea/views/myssl/add.php @@ -16,25 +16,25 @@ if (!defined('IN_CRONLITE')) {
- +
- +
- +
- +
diff --git a/src/clientarea/views/settings.php b/src/clientarea/views/settings.php index 7fcbfbf..5186bbe 100755 --- a/src/clientarea/views/settings.php +++ b/src/clientarea/views/settings.php @@ -12,37 +12,37 @@
- +
- +
- +
- +
- +
- +
@@ -51,7 +51,7 @@ +
- +
- +
diff --git a/src/clientarea/views/tickets/add.php b/src/clientarea/views/tickets/add.php index ef19b3f..4ab5a26 100755 --- a/src/clientarea/views/tickets/add.php +++ b/src/clientarea/views/tickets/add.php @@ -13,13 +13,13 @@
- +
- +
diff --git a/src/clientarea/views/tickets/view.php b/src/clientarea/views/tickets/view.php index 6538b9a..d90e948 100755 --- a/src/clientarea/views/tickets/view.php +++ b/src/clientarea/views/tickets/view.php @@ -39,7 +39,7 @@
- +

@@ -51,8 +51,8 @@
- diff --git a/src/clientarea/views/tools/dnslookup.php b/src/clientarea/views/tools/dnslookup.php index 288b67b..ea6b58e 100755 --- a/src/clientarea/views/tools/dnslookup.php +++ b/src/clientarea/views/tools/dnslookup.php @@ -12,25 +12,25 @@
- +
- +
- +
- +
diff --git a/src/clientarea/views/tools/whois.php b/src/clientarea/views/tools/whois.php index c9a2dc9..f1035eb 100755 --- a/src/clientarea/views/tools/whois.php +++ b/src/clientarea/views/tools/whois.php @@ -10,25 +10,25 @@
- +
- +
- +
- +
diff --git a/src/core/clientarea.php b/src/core/clientarea.php index 90bb6f5..85db3f1 100755 --- a/src/core/clientarea.php +++ b/src/core/clientarea.php @@ -9,22 +9,22 @@ if ($SiteConfig['site_status'] != 1) { $token = $data['token']; $email = $data['email']; $key = $data['key']; - $ClientInfo = $DB->find('clients', '*', array('hosting_client_email' => $email), null, 1); + $ClientInfo = $DB->find('clients', '*', array('client_email' => $email), null, 1); if ($ClientInfo) { - if ($ClientInfo['hosting_client_status'] == '0') { + if ($ClientInfo['client_status'] == '0') { if (empty($current_route) || $current_route != 'clientarea/validate') { // redirect to clientarea/validate redirect('clientarea/validate'); } - } elseif ($ClientInfo['hosting_client_status'] == '2') { + } elseif ($ClientInfo['client_status'] == '2') { if (empty($current_route) || $current_route != 'clientarea/suspended') { // redirect to clientarea/suspended redirect('clientarea/suspended'); } } - $verify = hash('sha256', json_encode([$email, $ClientInfo['hosting_client_key'], $key])); + $verify = hash('sha256', json_encode([$email, $ClientInfo['client_key'], $key])); if (trim($token) !== trim($verify)) { setcookie('UIISC_MEMBER', '', -1, '/'); setMessage('Login to continue!', 'danger'); diff --git a/src/core/library/lib/MailSMTP.class.php b/src/core/library/lib/MailSMTP.class.php index 3010805..073e7f8 100755 --- a/src/core/library/lib/MailSMTP.class.php +++ b/src/core/library/lib/MailSMTP.class.php @@ -30,7 +30,7 @@ class MailSMTP * @param bool $debug 是否调试模式显示发送的调试信息 * @return void */ - public function __construct($smtp_host, $smtp_user, $smtp_pass, $smtp_port = 25, $auth = false, $debug = false) + public function __construct($smtp_host, $smtp_user, $smtp_pass, $smtp_port = 25, $auth = true, $debug = false) { $this->debug = $debug; $this->smtp_host = $smtp_host; diff --git a/src/install/function/Database.php b/src/install/function/Database.php index 03dcdd4..ee14327 100755 --- a/src/install/function/Database.php +++ b/src/install/function/Database.php @@ -45,22 +45,22 @@ $sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_builder_api` ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;'); $sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_clients` ( - `hosting_client_id` INT(11) unsigned NOT NULL AUTO_INCREMENT, - `hosting_client_fname` VARCHAR(30) NOT NULL, - `hosting_client_lname` VARCHAR(30) NOT NULL, - `hosting_client_email` VARCHAR(70) NOT NULL, - `hosting_client_phone` VARCHAR(30) NOT NULL, - `hosting_client_address` VARCHAR(50) NOT NULL, - `hosting_client_country` VARCHAR(40) NOT NULL, - `hosting_client_city` VARCHAR(30) NOT NULL, - `hosting_client_pcode` VARCHAR(20) NOT NULL, - `hosting_client_key` VARCHAR(8) NOT NULL, - `hosting_client_state` VARCHAR(30) NOT NULL, - `hosting_client_date` VARCHAR(30) NOT NULL, - `hosting_client_status` INT(1) NOT NULL, - `hosting_client_company` VARCHAR(50) NOT NULL, - `hosting_client_password` VARCHAR(64) NOT NULL, - PRIMARY KEY (`hosting_client_id`) + `client_id` INT(11) unsigned NOT NULL AUTO_INCREMENT, + `client_fname` VARCHAR(30) NOT NULL, + `client_lname` VARCHAR(30) NOT NULL, + `client_email` VARCHAR(70) NOT NULL, + `client_phone` VARCHAR(30) NOT NULL, + `client_address` VARCHAR(50) NOT NULL, + `client_country` VARCHAR(40) NOT NULL, + `client_city` VARCHAR(30) NOT NULL, + `client_pcode` VARCHAR(20) NOT NULL, + `client_key` VARCHAR(8) NOT NULL, + `client_state` VARCHAR(30) NOT NULL, + `client_date` VARCHAR(30) NOT NULL, + `client_status` INT(1) NOT NULL, + `client_company` VARCHAR(50) NOT NULL, + `client_password` VARCHAR(64) NOT NULL, + PRIMARY KEY (`client_id`) ) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4;'); $sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_domain_extensions` ( From 48ae5ead667bae183539a334ee852e3ca8608a77 Mon Sep 17 00:00:00 2001 From: Jackson Dou Date: Tue, 13 Dec 2022 00:01:51 +0800 Subject: [PATCH 2/2] update --- .editorconfig | 7 +++++++ .prettierrc | 8 ++++++++ README.md | 2 +- SECURITY.md | 18 ++++++++++++++++++ src/security_code.php | 6 +++--- 5 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 .editorconfig create mode 100644 .prettierrc create mode 100644 SECURITY.md diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..b5bca10 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,7 @@ +[*.{js,jsx,ts,tsx,vue}] +indent_style = space +indent_size = 4 +end_of_line = lf +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 300 diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..0f956ea --- /dev/null +++ b/.prettierrc @@ -0,0 +1,8 @@ +{ + "eslintIntegration": true, + "tabWidth": 4, + "singleQuote": true, + "trailingComma": "none", + "printWidth": 300, + "semi": false +} diff --git a/README.md b/README.md index f1554d9..f3ebc6b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # UIISC -An Open Source Management System for MyOwnFreeHost +An Open Source Web Hosting Account and Support Management System for MyOwnFreeHost * Official Site : [uiisc.com](http://uiisc.com "UIISC") * Author : [Jackson Dou](https://github.com/jksdou "Jackson Dou") diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..368e756 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,18 @@ +# Security Policy + +## Supported Versions + +There is the list of supported versions of php to run UIISC + +| Version | Supported | +| ------- | ------------------ | +| 8.0.x | :white_check_mark: | +| > 7.4 | :white_check_mark: | +| 7.1.x | :white_check_mark: | +| > 5.6.x | :white_check_mark: | +| < 5.6 | :x: | + +## Reporting a Vulnerability + +In case of any error the user can report it by sending email to `admin@uiisc.org` or by contacting phone at `+86-021-51351888`. + diff --git a/src/security_code.php b/src/security_code.php index 3ce7978..c547a31 100644 --- a/src/security_code.php +++ b/src/security_code.php @@ -4,13 +4,13 @@ require __DIR__ . '/core/application.php'; $security_id = $_GET["id"]; header('Content-Type:image/png'); -$url = "http://order.uiisc.com/image.php?id=".$security_id."";//图片链接 +$url = "http://order.uiisc.com/image.php?id=" . $security_id; //图片链接 $ch = curl_init(); // Cookie:PHPSESSID=121b1127dcded8702c6a1e702c40eca4 curl_setopt($ch, CURLOPT_URL, $url); // curl_setopt($ch,CURLOPT_COOKIE,'PHPSESSID=121b1127dcded8702c6a1e702c40eca4'); // 如果不需要cookies就删除这条语句 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0); -curl_setopt($ch, CURLOPT_TIMEOUT,0); // 忽略超时 +curl_setopt($ch, CURLOPT_TIMEOUT, 0); // 忽略超时 curl_setopt($ch, CURLOPT_NOBODY, false); $str = curl_exec($ch); -curl_close($ch); \ No newline at end of file +curl_close($ch);