From 7fe0145c72acfbcd48be0914e308ef518de13f8b Mon Sep 17 00:00:00 2001 From: Jackson Dou Date: Tue, 30 May 2023 10:40:06 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E8=A7=A3=E5=86=B3=E8=AF=AD=E8=A8=80?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=8F=AF=E8=83=BD=E4=B8=8D=E7=94=9F=E6=95=88?= =?UTF-8?q?=E5=BE=97=E9=97=AE=E9=A2=98=202.=20=E6=B7=BB=E5=8A=A0=E5=AF=B9?= =?UTF-8?q?=E6=89=98=E7=AE=A1=E6=9C=8D=E5=8A=A1=E5=95=86=E7=9A=84=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=94=AF=E6=8C=81=E5=A4=9A?= =?UTF-8?q?=E4=B8=AA=E6=9C=8D=E5=8A=A1=E5=95=86=203.=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=8D=95=E8=AF=8D=E8=A7=84=E8=8C=83=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/admin/controllers/clients/activate.php | 4 +- src/admin/controllers/clients/login.php | 2 +- src/admin/controllers/clients/suspend.php | 4 +- src/admin/controllers/domain/add.php | 8 +- src/admin/controllers/domain/delete.php | 4 +- .../controllers/domain/{view.php => list.php} | 0 src/admin/controllers/hosting/add.php | 79 +++++++++++++++++ src/admin/controllers/hosting/edit.php | 58 +++++++----- src/admin/controllers/hosting/list.php | 10 +++ src/admin/controllers/hosting/view.php | 15 +++- src/admin/controllers/knowledgebase/add.php | 4 +- src/admin/controllers/knowledgebase/edit.php | 4 +- src/admin/controllers/news/add.php | 4 +- src/admin/controllers/news/edit.php | 4 +- src/admin/controllers/profile/edit.php | 4 +- src/admin/controllers/profile/password.php | 4 +- src/admin/controllers/settings/edit.php | 4 +- src/admin/controllers/sitepro/edit.php | 4 +- src/admin/controllers/smtp/edit.php | 4 +- src/admin/controllers/smtp/test.php | 4 +- src/admin/controllers/sslapi/edit.php | 4 +- src/admin/controllers/tickets/close.php | 4 +- src/admin/controllers/tickets/reply.php | 8 +- src/admin/domain.php | 18 ++++ src/admin/hosting.php | 18 ++++ src/admin/views/accounts/list.php | 10 ++- src/admin/views/common/sidebar.php | 10 ++- src/admin/views/dashboard/view.php | 2 +- src/admin/views/domain/{view.php => list.php} | 12 +-- src/admin/views/hosting/add.php | 87 ++++++++++++++++++ src/admin/views/hosting/edit.php | 88 +++++++++++++++++++ src/admin/views/hosting/list.php | 45 ++++++++++ src/admin/views/hosting/view.php | 73 ++++++++------- src/admin/views/profile/forgetpassword.php | 6 +- src/admin/views/settings/menu.php | 8 -- src/assets/js/common.js | 2 +- src/clientarea/controllers/clients/login.php | 2 +- src/clientarea/controllers/clients/logout.php | 2 +- .../controllers/settings/password.php | 2 +- src/core/application.php | 2 + src/core/clientarea.php | 4 +- src/core/language/zh-CN/language.php | 4 +- src/core/library/lib/Language.class.php | 27 +++--- src/news.php | 4 - 44 files changed, 526 insertions(+), 140 deletions(-) rename src/admin/controllers/domain/{view.php => list.php} (100%) create mode 100755 src/admin/controllers/hosting/add.php create mode 100644 src/admin/controllers/hosting/list.php create mode 100755 src/admin/domain.php create mode 100755 src/admin/hosting.php rename src/admin/views/domain/{view.php => list.php} (87%) create mode 100755 src/admin/views/hosting/add.php create mode 100755 src/admin/views/hosting/edit.php create mode 100755 src/admin/views/hosting/list.php diff --git a/src/admin/controllers/clients/activate.php b/src/admin/controllers/clients/activate.php index efce17e..828f44a 100755 --- a/src/admin/controllers/clients/activate.php +++ b/src/admin/controllers/clients/activate.php @@ -8,9 +8,9 @@ if (!$client_id) { exit('Access Denied'); } -$resault = $DB->update('clients', array('client_status' => 1), array('client_id' => $client_id)); +$result = $DB->update('clients', array('client_status' => 1), array('client_id' => $client_id)); -if ($resault) { +if ($result) { setMessage('Client activated successfully !'); } else { setMessage("Something went's wrong !", 'danger'); diff --git a/src/admin/controllers/clients/login.php b/src/admin/controllers/clients/login.php index 6188a65..7831285 100755 --- a/src/admin/controllers/clients/login.php +++ b/src/admin/controllers/clients/login.php @@ -15,7 +15,7 @@ $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, '/'); +setcookie('UIISC_MEMBER', base64_encode(gzcompress(json_encode(array('email' => $email, 'token' => $token, 'key' => $key)))), time() + $times * 86400, '/', $site_domain); setMessage('Logged in as ' . $email . ' successfully!', 'success'); diff --git a/src/admin/controllers/clients/suspend.php b/src/admin/controllers/clients/suspend.php index 175f9ec..b790c48 100755 --- a/src/admin/controllers/clients/suspend.php +++ b/src/admin/controllers/clients/suspend.php @@ -8,9 +8,9 @@ if (!$client_id) { exit('Access Denied'); } -$resault = $DB->update('clients', array('client_status' => 2), array('client_id' => $client_id)); +$result = $DB->update('clients', array('client_status' => 2), array('client_id' => $client_id)); -if ($resault) { +if ($result) { setMessage('Client suspended successfully !'); } else { setMessage("Something went's wrong !", 'danger'); diff --git a/src/admin/controllers/domain/add.php b/src/admin/controllers/domain/add.php index bf25f67..f8b2e62 100755 --- a/src/admin/controllers/domain/add.php +++ b/src/admin/controllers/domain/add.php @@ -9,7 +9,7 @@ if (!isset($_POST['submit'])) { $domain = post('domain'); if (!$domain) { - redirect('admin/settings', 'domain'); + redirect('admin/domain'); } $domain = strtolower($domain); @@ -26,12 +26,12 @@ $has = $DB->count('domain_extensions', $data); if ($has && $has > 0) { setMessage('Extension aleady exsist!', 'danger'); } else { - $resault = $DB->insert('domain_extensions', $data); - if ($resault) { + $result = $DB->insert('domain_extensions', $data); + if ($result) { setMessage('Extension added successfully!'); } else { setMessage('Something went' . "'" . 's wrong!', 'danger'); } } -redirect('admin/settings', 'domain'); +redirect('admin/domain'); diff --git a/src/admin/controllers/domain/delete.php b/src/admin/controllers/domain/delete.php index 6b4065b..e45ee49 100755 --- a/src/admin/controllers/domain/delete.php +++ b/src/admin/controllers/domain/delete.php @@ -9,7 +9,7 @@ if (!isset($_POST['submit'])) { $extension = post('extension'); if (!$extension) { - redirect('admin/settings', 'domain'); + redirect('admin/domain'); } $extension = strtolower($extension); @@ -35,4 +35,4 @@ if (!$count > 0) { } } -redirect('admin/settings', 'domain'); +redirect('admin/domain'); diff --git a/src/admin/controllers/domain/view.php b/src/admin/controllers/domain/list.php similarity index 100% rename from src/admin/controllers/domain/view.php rename to src/admin/controllers/domain/list.php diff --git a/src/admin/controllers/hosting/add.php b/src/admin/controllers/hosting/add.php new file mode 100755 index 0000000..713fa1e --- /dev/null +++ b/src/admin/controllers/hosting/add.php @@ -0,0 +1,79 @@ + post('api_username'), + 'api_password' => post('api_password'), + 'api_type' => post('api_type'), + 'api_key' => post('api_key'), + 'api_cpanel_url' => post('api_cpanel_url'), + 'api_server_ip' => post('api_server_ip'), + 'api_ns_1' => post('api_ns_1'), + 'api_ns_2' => post('api_ns_2'), + 'api_package' => post('api_package'), + 'api_callback_token' => post('api_callback_token') + ); + + $result = $DB->insert('account_api', $data); + + if ($result) { + setMessage('Hosting Provider added successfully !'); + } else { + setMessage("Something went's wrong !", 'danger'); + } + + redirect('admin/hosting'); +} diff --git a/src/admin/controllers/hosting/edit.php b/src/admin/controllers/hosting/edit.php index 77d3145..99180b6 100755 --- a/src/admin/controllers/hosting/edit.php +++ b/src/admin/controllers/hosting/edit.php @@ -1,28 +1,44 @@ post('api_username'), + 'api_password' => post('api_password'), + 'api_type' => post('api_type'), + 'api_key' => post('api_key'), + 'api_cpanel_url' => post('api_cpanel_url'), + 'api_server_ip' => post('api_server_ip'), + 'api_ns_1' => post('api_ns_1'), + 'api_ns_2' => post('api_ns_2'), + 'api_package' => post('api_package'), + 'api_callback_token' => post('api_callback_token') + ); -if (!isset($_POST['submit'])) { - exit('Access Denied'); -} + $result = $DB->update('account_api', $data, array('api_id' => $api_id)); -$data = array( - 'api_username' => post('api_username'), - 'api_password' => post('api_password'), - 'api_cpanel_url' => post('api_cpanel_url'), - 'api_server_ip' => post('api_server_ip'), - 'api_ns_1' => post('api_ns_1'), - 'api_ns_2' => post('api_ns_2'), - 'api_package' => post('api_package'), - 'api_callback_token' => post('api_callback_token') -); + if ($result) { + setMessage('Hosting Provider updated successfully !'); + } else { + setMessage("Something went's wrong !", 'danger'); + } -$resault = $DB->update('account_api', $data, array('api_key' => 'myownfreehost')); - -if ($resault) { - setMessage('Hosting Server updated successfully !'); + redirect('admin/hosting'); } else { - setMessage("Something went's wrong !", 'danger'); + if (!defined('IN_CRONLITE')) { + exit('Access Denied'); + } + $id = get('id'); + if ($id > 0) { + $data = $DB->find('account_api', '*', array('api_id' => $id), null, 1); + $PageInfo = ['title' => 'Edit Hosting Provider #' . $id, 'rel' => '']; + } else { + setMessage('need field: id', 'danger'); + redirect('admin/hosting'); + } } - -redirect('admin/settings', 'hosting'); diff --git a/src/admin/controllers/hosting/list.php b/src/admin/controllers/hosting/list.php new file mode 100644 index 0000000..77638e2 --- /dev/null +++ b/src/admin/controllers/hosting/list.php @@ -0,0 +1,10 @@ +count('account_api'); +if ($count > 0) { + $rows = $DB->findAll('account_api', '*', array(), "`api_id` DESC"); +} diff --git a/src/admin/controllers/hosting/view.php b/src/admin/controllers/hosting/view.php index 7d6b54a..c935694 100755 --- a/src/admin/controllers/hosting/view.php +++ b/src/admin/controllers/hosting/view.php @@ -1,6 +1,15 @@ 0) { + // $PageInfo = ['title' => 'View Hosting Provider #' . $api_id, 'rel' => '']; + $data = $DB->find('account_api', '*', array('api_id' => $api_id), null, 1); +} else { + $PageInfo = ['title' => 'Unathorized Access', 'rel' => '']; + $data = null; +} diff --git a/src/admin/controllers/knowledgebase/add.php b/src/admin/controllers/knowledgebase/add.php index 0a2a43f..e43daf4 100755 --- a/src/admin/controllers/knowledgebase/add.php +++ b/src/admin/controllers/knowledgebase/add.php @@ -9,8 +9,8 @@ if (isset($_POST['submit'])) { 'knowledgebase_date' => date('Y-m-d H:i:s'), ); - $resault = $DB->insert('knowledgebase', $data); - if ($resault) { + $result = $DB->insert('knowledgebase', $data); + if ($result) { setMessage('Knowledgebase added successfully !'); } else { setMessage("Something went's wrong !", 'danger'); diff --git a/src/admin/controllers/knowledgebase/edit.php b/src/admin/controllers/knowledgebase/edit.php index ef1c361..5d9fae4 100755 --- a/src/admin/controllers/knowledgebase/edit.php +++ b/src/admin/controllers/knowledgebase/edit.php @@ -23,9 +23,9 @@ if (isset($_POST['submit'])) { 'knowledgebase_content' => $editor, 'knowledgebase_date' => date('Y-m-d H:i:s'), ); - $resault = $DB->update('knowledgebase', $FormData, array('knowledgebase_id' => $id)); + $result = $DB->update('knowledgebase', $FormData, array('knowledgebase_id' => $id)); - if ($resault) { + if ($result) { setMessage('Knowledgebase updated successfully !'); } else { setMessage("Something went's wrong !", 'danger'); diff --git a/src/admin/controllers/news/add.php b/src/admin/controllers/news/add.php index cfbc3e6..28dca70 100755 --- a/src/admin/controllers/news/add.php +++ b/src/admin/controllers/news/add.php @@ -10,9 +10,9 @@ if (isset($_POST['submit'])) { 'news_date' => date('Y-m-d H:i:s'), ); - $resault = $DB->insert('news', $data); + $result = $DB->insert('news', $data); - if ($resault) { + if ($result) { setMessage('News added successfully!'); } else { setMessage("Something went's wrong!", 'danger'); diff --git a/src/admin/controllers/news/edit.php b/src/admin/controllers/news/edit.php index 41a55e3..b4fdbf4 100755 --- a/src/admin/controllers/news/edit.php +++ b/src/admin/controllers/news/edit.php @@ -13,9 +13,9 @@ if (isset($_POST['submit'])) { 'news_lastupdated' => date('Y-m-d H:i:s'), ); - $resault = $DB->update('news', $data, array('news_id' => $id)); + $result = $DB->update('news', $data, array('news_id' => $id)); - if ($resault) { + if ($result) { setMessage('News update successfully!'); } else { setMessage("Something went's wrong!", 'danger'); diff --git a/src/admin/controllers/profile/edit.php b/src/admin/controllers/profile/edit.php index 7106663..f947768 100755 --- a/src/admin/controllers/profile/edit.php +++ b/src/admin/controllers/profile/edit.php @@ -9,8 +9,8 @@ if (isset($_POST['submit'])) { 'admin_key' => $AdminInfo['admin_key'] ); - $resault = $DB->update('admin', $data, $where); - if ($resault) { + $result = $DB->update('admin', $data, $where); + if ($result) { setMessage('Profile updated successfully !'); } else { setMessage("Something went's wrong !", 'danger'); diff --git a/src/admin/controllers/profile/password.php b/src/admin/controllers/profile/password.php index e86fec0..4bf45c6 100755 --- a/src/admin/controllers/profile/password.php +++ b/src/admin/controllers/profile/password.php @@ -15,8 +15,8 @@ $FormData = array( ); if (hash('sha256', $FormData['old_password']) == $FormData['user_password']) { - $resault = $DB->update('admin', array('admin_password' => $FormData['hashed_password']), array('admin_key' => $FormData['user_key'])); - if ($resault) { + $result = $DB->update('admin', array('admin_password' => $FormData['hashed_password']), array('admin_key' => $FormData['user_key'])); + if ($result) { setMessage('Password changed successfully !'); unset($_SESSION['UIISC_ADMIN']); redirect('admin/login'); diff --git a/src/admin/controllers/settings/edit.php b/src/admin/controllers/settings/edit.php index 0ccad3c..7196f48 100755 --- a/src/admin/controllers/settings/edit.php +++ b/src/admin/controllers/settings/edit.php @@ -22,9 +22,9 @@ if (isset($_POST['submit'])) { 'site_key' => 'UIISC', ); - $resault = $DB->update('config', $data, $where); + $result = $DB->update('config', $data, $where); - if ($resault) { + if ($result) { setMessage('Clientarea updated successfully!'); } else { setMessage("Something went's wrong!", 'danger'); diff --git a/src/admin/controllers/sitepro/edit.php b/src/admin/controllers/sitepro/edit.php index 07de1cb..2cdc02f 100755 --- a/src/admin/controllers/sitepro/edit.php +++ b/src/admin/controllers/sitepro/edit.php @@ -14,9 +14,9 @@ $where = array( 'builder_id' => 'SITEPRO', ); -$resault = $DB->update('builder_api', $data, $where); +$result = $DB->update('builder_api', $data, $where); -if ($resault) { +if ($result) { setMessage('SitePro API updated successfully!'); } else { setMessage("Something went's wrong!", 'danger'); diff --git a/src/admin/controllers/smtp/edit.php b/src/admin/controllers/smtp/edit.php index 3a1facf..14b31b4 100755 --- a/src/admin/controllers/smtp/edit.php +++ b/src/admin/controllers/smtp/edit.php @@ -17,9 +17,9 @@ $where = array( 'smtp_key' => 'SMTP', ); -$resault = $DB->update('smtp', $data, $where); +$result = $DB->update('smtp', $data, $where); -if ($resault) { +if ($result) { setMessage('SMTP updated successfully!'); } else { setMessage("Something went's wrong!", 'danger'); diff --git a/src/admin/controllers/smtp/test.php b/src/admin/controllers/smtp/test.php index 7036a82..97d5af4 100755 --- a/src/admin/controllers/smtp/test.php +++ b/src/admin/controllers/smtp/test.php @@ -7,13 +7,13 @@ if (!isset($_POST['submit'])) { $email = post('email'); -$resault = send_mail(array( +$result = send_mail(array( 'to' => $email, 'message' => $lang->I18N('This test email indicates that SMTP has been configured correctly.'), 'subject' => $lang->I18N('Send Test Email'), )); -if ($resault) { +if ($result) { setMessage('The test email has been sent successfully !'); } else { setMessage("Something went's wrong!", 'danger'); diff --git a/src/admin/controllers/sslapi/edit.php b/src/admin/controllers/sslapi/edit.php index c8dd615..29a2a5b 100755 --- a/src/admin/controllers/sslapi/edit.php +++ b/src/admin/controllers/sslapi/edit.php @@ -14,9 +14,9 @@ $where = array( 'api_key' => 'FREESSL', ); -$resault = $DB->update('ssl_api', $data, $where); +$result = $DB->update('ssl_api', $data, $where); -if ($resault) { +if ($result) { setMessage('SSL API updated successfully!'); } else { setMessage("Something went's wrong!", 'danger'); diff --git a/src/admin/controllers/tickets/close.php b/src/admin/controllers/tickets/close.php index 71f5955..c11f9e2 100755 --- a/src/admin/controllers/tickets/close.php +++ b/src/admin/controllers/tickets/close.php @@ -24,9 +24,9 @@ if (!$ClientInfo) { redirect('admin/tickets'); } -$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) { $ticket_url = setURL('admin/tickets', '', array('action' => 'view', 'ticket_id' => $ticket_id)); $email_body = email_build_body('Ticket Closed', $ClientInfo['client_fname'], diff --git a/src/admin/controllers/tickets/reply.php b/src/admin/controllers/tickets/reply.php index 4448481..26a0574 100755 --- a/src/admin/controllers/tickets/reply.php +++ b/src/admin/controllers/tickets/reply.php @@ -19,17 +19,17 @@ if (!$TicketInfo) { } // update status -$resault = $DB->update('tickets', array('ticket_status' => '1'), array('ticket_id' => $ticket_id)); +$result = $DB->update('tickets', array('ticket_status' => '1'), array('ticket_id' => $ticket_id)); -if ($resault) { +if ($result) { $FormData = array( 'reply_for' => $ticket_id, 'reply_from' => 999999, 'reply_content' => post('content'), '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)); $EmailContent = '

You have received a reply from Support Staff.

'; diff --git a/src/admin/domain.php b/src/admin/domain.php new file mode 100755 index 0000000..592c8f0 --- /dev/null +++ b/src/admin/domain.php @@ -0,0 +1,18 @@ +
-
-
-
+
+
+

I18N('Return'); ?> @@ -54,7 +54,9 @@ if ($row['account_status'] == '0') {
- +
diff --git a/src/admin/views/common/sidebar.php b/src/admin/views/common/sidebar.php index 0cc2a99..66f7e17 100755 --- a/src/admin/views/common/sidebar.php +++ b/src/admin/views/common/sidebar.php @@ -26,7 +26,7 @@ $avatar_path = $AdminInfo['admin_email'] ? md5($AdminInfo['admin_email']) : 'def I18N('Clients'); ?> - + I18N('Tickets'); ?> @@ -45,6 +45,14 @@ $avatar_path = $AdminInfo['admin_email'] ? md5($AdminInfo['admin_email']) : 'def I18N('News'); ?> + + + I18N('Hosting Provider'); ?> + + + + I18N('Domain Provider'); ?> + I18N('Settings'); ?> diff --git a/src/admin/views/dashboard/view.php b/src/admin/views/dashboard/view.php index 0b20d07..8a02c5c 100755 --- a/src/admin/views/dashboard/view.php +++ b/src/admin/views/dashboard/view.php @@ -40,7 +40,7 @@

- +
View Ticket diff --git a/src/admin/views/domain/view.php b/src/admin/views/domain/list.php similarity index 87% rename from src/admin/views/domain/view.php rename to src/admin/views/domain/list.php index a769ee2..a3768ec 100755 --- a/src/admin/views/domain/view.php +++ b/src/admin/views/domain/list.php @@ -1,8 +1,8 @@ - +
-
-
-

+
+
+
I18N('Return');?> @@ -52,7 +52,9 @@

- +
diff --git a/src/admin/views/hosting/add.php b/src/admin/views/hosting/add.php new file mode 100755 index 0000000..2e019b8 --- /dev/null +++ b/src/admin/views/hosting/add.php @@ -0,0 +1,87 @@ +
+
+
+ +
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+
+ +
+
+
+
+
+
+
diff --git a/src/admin/views/hosting/edit.php b/src/admin/views/hosting/edit.php new file mode 100755 index 0000000..ebbdf18 --- /dev/null +++ b/src/admin/views/hosting/edit.php @@ -0,0 +1,88 @@ +
+
+
+ +
+
+ +
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+
+ +
+
+
+
+
+
+
diff --git a/src/admin/views/hosting/list.php b/src/admin/views/hosting/list.php new file mode 100755 index 0000000..935360d --- /dev/null +++ b/src/admin/views/hosting/list.php @@ -0,0 +1,45 @@ +
+
+
+
+
Hosting Provider
+ + I18N('add'); ?> + +
+
+
+ + + + + + + + + + 0): ?> + + + + + + + + + + + + + + + +
KeyTypeCpanel URLPackageAction
+ I18N('edit'); ?> + I18N('details'); ?> +
Nothing found
+
+

Records Found

+
+
+
\ No newline at end of file diff --git a/src/admin/views/hosting/view.php b/src/admin/views/hosting/view.php index 7d8b39a..9ab537b 100755 --- a/src/admin/views/hosting/view.php +++ b/src/admin/views/hosting/view.php @@ -1,69 +1,81 @@ +
-
-
-

- - I18N('Return'); ?> - +
+
-
+
- - + +
- - + +
- - + +
- - + +
- - + +
- - + +
- - + +
- - + +
-
-
-
- - + + +
+
+
+
+ +
@@ -71,10 +83,11 @@
- + I18N('edit'); ?>
- +
+
diff --git a/src/admin/views/profile/forgetpassword.php b/src/admin/views/profile/forgetpassword.php index 803437f..2cd2296 100755 --- a/src/admin/views/profile/forgetpassword.php +++ b/src/admin/views/profile/forgetpassword.php @@ -1,8 +1,7 @@ -
-
+
Forget Password

@@ -20,5 +19,4 @@
-
-
+
\ No newline at end of file diff --git a/src/admin/views/settings/menu.php b/src/admin/views/settings/menu.php index f65b4de..37ba7db 100644 --- a/src/admin/views/settings/menu.php +++ b/src/admin/views/settings/menu.php @@ -5,14 +5,6 @@ I18N('System Settings'); ?> - - - I18N('Hosting Settings'); ?> - - - - I18N('Domain Settings'); ?> - I18N('SMTP Settings'); ?> diff --git a/src/assets/js/common.js b/src/assets/js/common.js index b616a7f..4a1e3ad 100755 --- a/src/assets/js/common.js +++ b/src/assets/js/common.js @@ -44,7 +44,7 @@ function jumpLink(action, params, target) { * @param {string|number} expires 时长,单位天 * @param {string} path 路径 * @param {string} domain 域名 - * @param {string} secure + * @param {string} secure */ function setCookie(name, value, expires, path, domain, secure) { var today = new Date(); diff --git a/src/clientarea/controllers/clients/login.php b/src/clientarea/controllers/clients/login.php index 6578fb5..1bd73e1 100755 --- a/src/clientarea/controllers/clients/login.php +++ b/src/clientarea/controllers/clients/login.php @@ -38,7 +38,7 @@ if (isset($_POST['login'])) { $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, '/'); + setcookie('UIISC_MEMBER', base64_encode(gzcompress(json_encode($token2))), time() + $times * 86400, '/', $site_domain); setMessage('Logged in successfully !', 'success'); redirect('clientarea/index'); } diff --git a/src/clientarea/controllers/clients/logout.php b/src/clientarea/controllers/clients/logout.php index 67abf4b..8b5bf4d 100755 --- a/src/clientarea/controllers/clients/logout.php +++ b/src/clientarea/controllers/clients/logout.php @@ -1,7 +1,7 @@ successfully !', 'success'); } else { setMessage('Login to continue !', 'danger'); diff --git a/src/clientarea/controllers/settings/password.php b/src/clientarea/controllers/settings/password.php index 0afd415..b6f851c 100755 --- a/src/clientarea/controllers/settings/password.php +++ b/src/clientarea/controllers/settings/password.php @@ -18,7 +18,7 @@ if ($old_password == $ClientInfo['client_password']) { if ($result) { setMessage('Password changed successfully!', 'success'); - setcookie('UIISC_MEMBER', 'NULL', -1, '/'); + setcookie('UIISC_MEMBER', 'NULL', -1, '/', $site_domain); redirect('clientarea/login'); } else { setMessage('Something went' . "'" . 's wrong !', 'danger'); diff --git a/src/core/application.php b/src/core/application.php index 45a62bd..e2eefed 100755 --- a/src/core/application.php +++ b/src/core/application.php @@ -50,6 +50,8 @@ define('HTTP_PROTOCOL', is_https() ? 'https' : 'http'); $site_domain = $_SERVER['HTTP_HOST']; +define('SITE_DOMAIN', $site_domain); + $site_url = HTTP_PROTOCOL . '://' . $site_domain; define('SITEURL', $site_url); diff --git a/src/core/clientarea.php b/src/core/clientarea.php index 85db3f1..dc583f1 100755 --- a/src/core/clientarea.php +++ b/src/core/clientarea.php @@ -26,12 +26,12 @@ if ($SiteConfig['site_status'] != 1) { $verify = hash('sha256', json_encode([$email, $ClientInfo['client_key'], $key])); if (trim($token) !== trim($verify)) { - setcookie('UIISC_MEMBER', '', -1, '/'); + setcookie('UIISC_MEMBER', '', -1, '/', $site_domain); setMessage('Login to continue!', 'danger'); redirect('clientarea/login'); } } else { - setcookie('UIISC_MEMBER', '', -1, '/'); + setcookie('UIISC_MEMBER', '', -1, '/', $site_domain); setMessage('Login to continue!', 'danger'); redirect('clientarea/login'); } diff --git a/src/core/language/zh-CN/language.php b/src/core/language/zh-CN/language.php index b536b77..0b74463 100755 --- a/src/core/language/zh-CN/language.php +++ b/src/core/language/zh-CN/language.php @@ -127,5 +127,7 @@ return array( 'Page Keywords' => '网页关键字', 'Page Copyright' => '网页版权标识', 'Page Author' => '网页著作人', - 'Admin Area' => '管理中心' + 'Admin Area' => '管理中心', + 'Hosting Provider' => '托管提供商', + 'Domain Provider' => '域名提供商' ); diff --git a/src/core/library/lib/Language.class.php b/src/core/library/lib/Language.class.php index 9b72b7e..4ae59f1 100755 --- a/src/core/library/lib/Language.class.php +++ b/src/core/library/lib/Language.class.php @@ -120,7 +120,7 @@ class Language 'zu' => ['Zulu', 'Zulu'], ]; private $LANG = []; - private $domain; + private $site_domain; /** 构造函数 * @param string $root_default 翻译文件根目录 @@ -148,16 +148,17 @@ class Language private function init_domain() { - if (empty($this->domain)) { - $domain = $_SERVER['SERVER_NAME']; - if (strcasecmp($domain, 'localhost') === 0) { - $this->domain = $domain; - } else if (preg_match("/^(\\d+\\.){3}\\d+\$/", $domain, $domain_temp)) { - $this->domain = $domain_temp[0]; - } else { - preg_match_all("/\\w+\\.\\w+\$/", $domain, $domain); - $this->domain = $domain[0][0]; - } + if (empty($this->site_domain)) { + // $domain = $_SERVER['SERVER_NAME']; + $this->site_domain = $_SERVER['HTTP_HOST']; + // if (strcasecmp($domain, 'localhost') === 0) { + // $this->site_domain = $domain; + // } else if (preg_match("/^(\\d+\\.){3}\\d+\$/", $domain, $domain_temp)) { + // $this->site_domain = $domain_temp[0]; + // } else { + // preg_match_all("/\\w+\\.\\w+\$/", $domain, $domain); + // $this->site_domain = $domain[0][0]; + // } } } @@ -183,10 +184,10 @@ class Language $this->language_current = $this->language_default; } $this->language_cached = $this->language_current; - setcookie("lang", $this->language_current, time() + 365 * 24 * 3600, "/", $this->domain); + setcookie("lang", $this->language_current, time() + 365 * 24 * 3600, "/", $this->site_domain); } else { $this->language_cached = $this->language_current; - setcookie("lang", $this->language_current, time() + 365 * 24 * 3600, "/", $this->domain); + setcookie("lang", $this->language_current, time() + 365 * 24 * 3600, "/", $this->site_domain); } } diff --git a/src/news.php b/src/news.php index de8c27f..8b55616 100755 --- a/src/news.php +++ b/src/news.php @@ -9,7 +9,3 @@ if (!in_array($action, array('list', 'view'))) { } require __DIR__ . '/public/controllers/news/' . $action . '.php'; -// require __DIR__ . '/public/views/common/header.php'; -// require __DIR__ . '/public/views/common/navbar.php'; -// require __DIR__ . '/public/views/news/' . $action . '.php'; -// require __DIR__ . '/public/views/common/footer.php';