1. 解决语言设置可能不生效得问题
2. 添加对托管服务商的配置功能,支持多个服务商 3. 代码单词规范处理
This commit is contained in:
parent
a7f7814e74
commit
7fe0145c72
44 changed files with 526 additions and 140 deletions
|
@ -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');
|
||||
|
|
|
@ -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 . ' <b>successfully!</b>', 'success');
|
||||
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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 <b>exsist!</b>', 'danger');
|
||||
} else {
|
||||
$resault = $DB->insert('domain_extensions', $data);
|
||||
if ($resault) {
|
||||
$result = $DB->insert('domain_extensions', $data);
|
||||
if ($result) {
|
||||
setMessage('Extension added <b>successfully!</b>');
|
||||
} else {
|
||||
setMessage('Something went' . "'" . 's <b>wrong!</b>', 'danger');
|
||||
}
|
||||
}
|
||||
|
||||
redirect('admin/settings', 'domain');
|
||||
redirect('admin/domain');
|
||||
|
|
|
@ -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');
|
||||
|
|
79
src/admin/controllers/hosting/add.php
Executable file
79
src/admin/controllers/hosting/add.php
Executable file
|
@ -0,0 +1,79 @@
|
|||
<?php
|
||||
|
||||
if (isset($_POST['submit'])) {
|
||||
require '../../application.php';
|
||||
|
||||
if (!post('api_username')) {
|
||||
setMessage('need field: api_username', 'danger');
|
||||
redirect('admin/hosting');
|
||||
}
|
||||
|
||||
if (!post('api_password')) {
|
||||
setMessage('need field: api_password', 'danger');
|
||||
redirect('admin/hosting');
|
||||
}
|
||||
|
||||
if (!post('api_type')) {
|
||||
setMessage('need field: api_type', 'danger');
|
||||
redirect('admin/hosting');
|
||||
}
|
||||
|
||||
if (!post('api_key')) {
|
||||
setMessage('need field: api_key', 'danger');
|
||||
redirect('admin/hosting');
|
||||
}
|
||||
|
||||
if (!post('api_cpanel_url')) {
|
||||
setMessage('need field: api_cpanel_url', 'danger');
|
||||
redirect('admin/hosting');
|
||||
}
|
||||
|
||||
if (!post('api_server_ip')) {
|
||||
setMessage('need field: api_server_ip', 'danger');
|
||||
redirect('admin/hosting');
|
||||
}
|
||||
|
||||
if (!post('api_ns_1')) {
|
||||
setMessage('need field: api_ns_1', 'danger');
|
||||
redirect('admin/hosting');
|
||||
}
|
||||
|
||||
if (!post('api_ns_2')) {
|
||||
setMessage('need field: api_ns_2', 'danger');
|
||||
redirect('admin/hosting');
|
||||
}
|
||||
|
||||
if (!post('api_package')) {
|
||||
setMessage('need field: api_package', 'danger');
|
||||
redirect('admin/hosting');
|
||||
}
|
||||
|
||||
if (!post('api_callback_token')) {
|
||||
setMessage('need field: api_callback_token', 'danger');
|
||||
redirect('admin/hosting');
|
||||
}
|
||||
|
||||
|
||||
$data = array(
|
||||
'api_username' => 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');
|
||||
}
|
|
@ -1,28 +1,44 @@
|
|||
<?php
|
||||
|
||||
require '../../application.php';
|
||||
if (isset($_POST['submit'])) {
|
||||
require '../../application.php';
|
||||
$api_id = post('api_id');
|
||||
if (!$api_id) {
|
||||
setMessage('need field: api_id', 'danger');
|
||||
redirect('admin/hosting');
|
||||
}
|
||||
$data = array(
|
||||
'api_username' => 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');
|
||||
|
|
10
src/admin/controllers/hosting/list.php
Normal file
10
src/admin/controllers/hosting/list.php
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
if (!defined('IN_CRONLITE')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
$count = $DB->count('account_api');
|
||||
if ($count > 0) {
|
||||
$rows = $DB->findAll('account_api', '*', array(), "`api_id` DESC");
|
||||
}
|
|
@ -1,6 +1,15 @@
|
|||
<?php
|
||||
|
||||
require_once ROOT . '/core/library/userinfo.class.php';
|
||||
require_once ROOT . '/core/handler/HostingHandler.php';
|
||||
if (!defined('IN_CRONLITE')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
$PageInfo['title'] = 'Hosting Settings';
|
||||
$api_id = get('id');
|
||||
|
||||
if ($api_id > 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;
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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 <b>successfully!</b>');
|
||||
} else {
|
||||
setMessage("Something went's <b>wrong!</b>", 'danger');
|
||||
|
|
|
@ -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 <b>successfully!</b>');
|
||||
} else {
|
||||
setMessage("Something went's <b>wrong!</b>", 'danger');
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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 <b>successfully!</b>');
|
||||
} else {
|
||||
setMessage("Something went's <b>wrong!</b>", 'danger');
|
||||
|
|
|
@ -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 <b>successfully!</b>');
|
||||
} else {
|
||||
setMessage("Something went's <b>wrong!</b>", 'danger');
|
||||
|
|
|
@ -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 <b>successfully!</b>');
|
||||
} else {
|
||||
setMessage("Something went's <b>wrong!</b>", 'danger');
|
||||
|
|
|
@ -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 <b>successfully</b> !');
|
||||
} else {
|
||||
setMessage("Something went's <b>wrong!</b>", 'danger');
|
||||
|
|
|
@ -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 <b>successfully!</b>');
|
||||
} else {
|
||||
setMessage("Something went's <b>wrong!</b>", 'danger');
|
||||
|
|
|
@ -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'],
|
||||
|
|
|
@ -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 = '<p>You have received a reply from Support Staff.</p>';
|
||||
|
|
18
src/admin/domain.php
Executable file
18
src/admin/domain.php
Executable file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
require_once __DIR__ . '/application.php';
|
||||
|
||||
$action = get('action', 'list');
|
||||
|
||||
if (!in_array($action, array('list', 'add', 'edit', 'view'))) {
|
||||
$action = 'list';
|
||||
}
|
||||
|
||||
$PageInfo['title'] = 'Domain Provider ' . ucfirst($action);
|
||||
|
||||
require __DIR__ . '/controllers/domain/' . $action . '.php';
|
||||
require __DIR__ . '/views/common/header.php';
|
||||
require __DIR__ . '/views/common/navbar.php';
|
||||
require __DIR__ . '/views/common/sidebar.php';
|
||||
require __DIR__ . '/views/domain/' . $action . '.php';
|
||||
require __DIR__ . '/views/common/footer.php';
|
18
src/admin/hosting.php
Executable file
18
src/admin/hosting.php
Executable file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
require_once __DIR__ . '/application.php';
|
||||
|
||||
$action = get('action', 'list');
|
||||
|
||||
if (!in_array($action, array('list', 'add', 'edit', 'view'))) {
|
||||
$action = 'list';
|
||||
}
|
||||
|
||||
$PageInfo['title'] = 'Hosting Provider ' . ucfirst($action);
|
||||
|
||||
require __DIR__ . '/controllers/hosting/' . $action . '.php';
|
||||
require __DIR__ . '/views/common/header.php';
|
||||
require __DIR__ . '/views/common/navbar.php';
|
||||
require __DIR__ . '/views/common/sidebar.php';
|
||||
require __DIR__ . '/views/hosting/' . $action . '.php';
|
||||
require __DIR__ . '/views/common/footer.php';
|
|
@ -1,9 +1,9 @@
|
|||
|
||||
<div class="content-wrapper">
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h5 class="m-0"><?php echo $PageInfo['title']; ?></h5>
|
||||
<div class="card py-0">
|
||||
<div class="d-flex justify-content-between align-items-center pt-15">
|
||||
<h3 class="m-0"><?php echo $PageInfo['title']; ?></h3>
|
||||
<a href="index.php" class="btn text-white btn-danger btn-sm">
|
||||
<i class="fa fa-backward"></i> <?php echo $lang->I18N('Return'); ?>
|
||||
</a>
|
||||
|
@ -54,7 +54,9 @@ if ($row['account_status'] == '0') {
|
|||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer"><?php echo $count; ?> Records Founds</div>
|
||||
<div class="card-footer">
|
||||
<p class="py-10"><?php echo $count; ?> Records Founds</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -26,7 +26,7 @@ $avatar_path = $AdminInfo['admin_email'] ? md5($AdminInfo['admin_email']) : 'def
|
|||
<?php echo $lang->I18N('Clients'); ?>
|
||||
</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="sslcert.php" class="sidebar-link sidebar-link-with-icon">
|
||||
|
@ -45,6 +45,14 @@ $avatar_path = $AdminInfo['admin_email'] ? md5($AdminInfo['admin_email']) : 'def
|
|||
<span class="sidebar-icon bg-transparent"><i class="fa fa-newspaper" aria-hidden="true"></i></span>
|
||||
<?php echo $lang->I18N('News'); ?>
|
||||
</a>
|
||||
<a href="hosting.php" class="sidebar-link sidebar-link-with-icon">
|
||||
<span class="sidebar-icon bg-transparent"><i class="fa fa-server" aria-hidden="true"></i></span>
|
||||
<?php echo $lang->I18N('Hosting Provider'); ?>
|
||||
</a>
|
||||
<a href="domain.php" class="sidebar-link sidebar-link-with-icon">
|
||||
<span class="sidebar-icon bg-transparent"><i class="fa fa-globe" aria-hidden="true"></i></span>
|
||||
<?php echo $lang->I18N('Domain Provider'); ?>
|
||||
</a>
|
||||
<a href="settings.php" class="sidebar-link sidebar-link-with-icon">
|
||||
<span class="sidebar-icon bg-transparent"><i class="fa fa-cog" aria-hidden="true"></i></span>
|
||||
<?php echo $lang->I18N('Settings'); ?>
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
<div class="card text-center bg-matrix-4 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_tickets; ?></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>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
<div class="content-wrapper">
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h3 class="m-0"><?php echo $PageInfo['title']; ?></h3>
|
||||
<div class="card py-0">
|
||||
<div class="d-flex justify-content-between align-items-center pt-15">
|
||||
<h5 class="m-0"><?php echo $PageInfo['title']; ?></h5>
|
||||
<a href="index.php" class="btn btn-danger btn-sm">
|
||||
<i class="fa fa-backward"></i> <?php echo $lang->I18N('Return');?>
|
||||
</a>
|
||||
|
@ -52,7 +52,9 @@
|
|||
</table>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="card-footer"><?php echo $count; ?> Records Founds</div>
|
||||
<div class="card-footer">
|
||||
<p class="pb-10"><?php echo $count; ?> Records Found</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
87
src/admin/views/hosting/add.php
Executable file
87
src/admin/views/hosting/add.php
Executable file
|
@ -0,0 +1,87 @@
|
|||
<div class="content-wrapper">
|
||||
<div class="container-fluid">
|
||||
<div class="card py-0">
|
||||
<div class="d-flex justify-content-between align-items-center pt-15">
|
||||
<h5 class="m-0"><?php echo $PageInfo['title']; ?></h5>
|
||||
<div>
|
||||
<a href="hosting.php" class="btn btn-danger btn-sm">
|
||||
<i class="fa fa-backward"></i> <?php echo $lang->I18N('Return'); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<form class="card-body" action="controllers/hosting/add.php" method="post">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">MOFH API Username</label>
|
||||
<input type="text" name="api_username" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">MOFH API Password</label>
|
||||
<input type="text" name="api_password" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">Hosting Type</label>
|
||||
<input type="text" name="api_type" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">Hosting Key</label>
|
||||
<input type="text" name="api_key" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">cPanel URL</label>
|
||||
<input type="text" name="api_cpanel_url" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">Hosting Package</label>
|
||||
<input type="text" name="api_package" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">Server IP</label>
|
||||
<input type="text" name="api_server_ip" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">API Callback Token</label>
|
||||
<input type="text" name="api_callback_token" class="form-control" maxlength="32" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">Nameserver 1</label>
|
||||
<input type="text" name="api_ns_1" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">Nameserver 2</label>
|
||||
<input type="text" name="api_ns_2" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="mb-10 px-10">
|
||||
<button name="submit" class="btn btn-primary"><?php echo $lang->I18N('Save'); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
88
src/admin/views/hosting/edit.php
Executable file
88
src/admin/views/hosting/edit.php
Executable file
|
@ -0,0 +1,88 @@
|
|||
<div class="content-wrapper">
|
||||
<div class="container-fluid">
|
||||
<div class="card py-0">
|
||||
<div class="d-flex justify-content-between align-items-center pt-15">
|
||||
<h5 class="m-0"><?php echo $PageInfo['title']; ?></h5>
|
||||
<div>
|
||||
<a href="hosting.php" class="btn btn-danger btn-sm">
|
||||
<i class="fa fa-backward"></i> <?php echo $lang->I18N('Return'); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<form class="card-body" action="controllers/hosting/edit.php" method="post">
|
||||
<input type="hidden" name="api_id" value="<?php echo $data['api_id']; ?>" style="display:none;">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">MOFH API Username</label>
|
||||
<input type="text" name="api_username" value="<?php echo $data['api_username']; ?>" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">MOFH API Password</label>
|
||||
<input type="text" name="api_password" value="<?php echo $data['api_password']; ?>" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">Hosting Type</label>
|
||||
<input type="text" name="api_type" value="<?php echo $data['api_type']; ?>" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">Hosting Key</label>
|
||||
<input type="text" name="api_key" value="<?php echo $data['api_key']; ?>" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">cPanel URL</label>
|
||||
<input type="text" name="api_cpanel_url" value="<?php echo $data['api_cpanel_url']; ?>" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">Hosting Package</label>
|
||||
<input type="text" name="api_package" value="<?php echo $data['api_package']; ?>" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">Server IP</label>
|
||||
<input type="text" name="api_server_ip" value="<?php echo $data['api_server_ip']; ?>" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">API Callback Token</label>
|
||||
<input type="text" name="api_callback_token" value="<?php echo $data['api_callback_token']; ?>" class="form-control" maxlength="32" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">Nameserver 1</label>
|
||||
<input type="text" name="api_ns_1" value="<?php echo $data['api_ns_1']; ?>" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">Nameserver 2</label>
|
||||
<input type="text" name="api_ns_2" value="<?php echo $data['api_ns_2']; ?>" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="mb-10 px-10">
|
||||
<button name="submit" class="btn btn-primary"><?php echo $lang->I18N('Save'); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
45
src/admin/views/hosting/list.php
Executable file
45
src/admin/views/hosting/list.php
Executable file
|
@ -0,0 +1,45 @@
|
|||
<div class="content-wrapper">
|
||||
<div class="container-fluid">
|
||||
<div class="card py-0">
|
||||
<div class="d-flex justify-content-between align-items-center pt-15">
|
||||
<h5 class="m-0">Hosting Provider</h5>
|
||||
<a href="hosting.php?action=add" class="btn btn-primary btn-sm">
|
||||
<i class="fa fa-plus"></i> <?php echo $lang->I18N('add'); ?>
|
||||
</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-stripped table-bordered table-hover">
|
||||
<thead>
|
||||
<th>Key</th>
|
||||
<th>Type</th>
|
||||
<th>Cpanel URL</th>
|
||||
<th>Package</th>
|
||||
<th>Action</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ($count > 0): ?>
|
||||
<?php foreach ($rows as $value): ?>
|
||||
<tr>
|
||||
<td><?php echo $value['api_key']; ?></td>
|
||||
<td><?php echo $value['api_type']; ?></td>
|
||||
<td><?php echo $value['api_cpanel_url']; ?></td>
|
||||
<td><?php echo $value['api_package']; ?></td>
|
||||
<td>
|
||||
<a href="hosting.php?action=edit&id=<?php echo $value['api_id']; ?>" class="btn btn-sm btn-secondary mx-5 btn-rounded"><i class="fa fa-edit"></i> <?php echo $lang->I18N('edit'); ?></a>
|
||||
<a href="hosting.php?action=view&id=<?php echo $value['api_id']; ?>" class="btn btn-sm btn-secondary mx-5 btn-rounded"><i class="fa fa-info-circle"></i> <?php echo $lang->I18N('details'); ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
<?php else: ?>
|
||||
<tr>
|
||||
<td colspan="5" class="text-center">Nothing found</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="pb-10"><?php echo $count; ?> Records Found</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,69 +1,81 @@
|
|||
<div class="content-wrapper">
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h3 class="m-0"><?php echo $PageInfo['title']; ?></h3>
|
||||
<a href="index.php" class="btn btn-danger btn-sm pull-right">
|
||||
<i class="fa fa-backward"></i> <?php echo $lang->I18N('Return'); ?>
|
||||
</a>
|
||||
<div class="card py-0">
|
||||
<div class="d-flex justify-content-between align-items-center pt-15">
|
||||
<h5 class="m-0"><?php echo $PageInfo['title']; ?></h5>
|
||||
<div>
|
||||
<a href="hosting.php" class="btn btn-sm btn-danger">
|
||||
<i class="fa fa-backward"></i> <?php echo $lang->I18N('Return'); ?>
|
||||
</a>
|
||||
<a href="<?php echo setURL('admin/hosting', '', array('action' => 'edit', 'id' => $data['api_id'])); ?>" class="btn btn-sm btn-success">
|
||||
<i class="fa fa-edit"></i> <?php echo $lang->I18N('edit'); ?>
|
||||
</a>
|
||||
<a href="hosting.php?action=add" class="btn btn-sm btn-primary">
|
||||
<i class="fa fa-plus"></i> <?php echo $lang->I18N('add'); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<form class="card-body" action="controllers/hosting/edit.php" method="post">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">MOFH API Username</label>
|
||||
<input type="text" name="api_username" value="<?php echo $HostingApi['api_username']; ?>" class="form-control" required>
|
||||
<label class="form-label">MOFH API Username</label>
|
||||
<input type="text" name="api_username" value="<?php echo $data['api_username']; ?>" class="form-control" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">MOFH API Password</label>
|
||||
<input type="text" name="api_password" value="<?php echo $HostingApi['api_password']; ?>" class="form-control" required>
|
||||
<label class="form-label">MOFH API Password</label>
|
||||
<input type="text" name="api_password" value="<?php echo $data['api_password']; ?>" class="form-control" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">cPanel URL</label>
|
||||
<input type="text" name="api_cpanel_url" value="<?php echo $HostingApi['api_cpanel_url']; ?>" class="form-control" required>
|
||||
<label class="form-label">Hosting Type</label>
|
||||
<input type="text" name="api_type" value="<?php echo $data['api_type']; ?>" class="form-control" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">Hosting Package</label>
|
||||
<input type="text" name="api_package" value="<?php echo $HostingApi['api_package']; ?>" class="form-control" required>
|
||||
<label class="form-label">Hosting Key</label>
|
||||
<input type="text" name="api_key" value="<?php echo $data['api_key']; ?>" class="form-control" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">Server IP</label>
|
||||
<input type="text" name="api_server_ip" value="<?php echo $HostingApi['api_server_ip']; ?>" class="form-control" required>
|
||||
<label class="form-label">Control Panel URL</label>
|
||||
<input type="text" name="api_cpanel_url" value="<?php echo $data['api_cpanel_url']; ?>" class="form-control" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">Shared IP</label>
|
||||
<input type="text" value="<?php echo gethostbyname($_SERVER['HTTP_HOST']); ?>" class="form-control" required>
|
||||
<label class="form-label">Hosting Package</label>
|
||||
<input type="text" name="api_package" value="<?php echo $data['api_package']; ?>" class="form-control" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">Nameserver 1</label>
|
||||
<input type="text" name="api_ns_1" value="<?php echo $HostingApi['api_ns_1']; ?>" class="form-control" required>
|
||||
<label class="form-label">Server IP</label>
|
||||
<input type="text" name="api_server_ip" value="<?php echo $data['api_server_ip']; ?>" class="form-control" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">Nameserver 2</label>
|
||||
<input type="text" name="api_ns_2" value="<?php echo $HostingApi['api_ns_2']; ?>" class="form-control" required>
|
||||
<label class="form-label">API Callback Token</label>
|
||||
<input type="text" name="api_callback_token" value="<?php echo $data['api_callback_token']; ?>" class="form-control" maxlength="32" readonly>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">Callback Token</label>
|
||||
<input type="text" name="api_callback_token" value="<?php echo $HostingApi['api_callback_token']; ?>" class="form-control" maxlength="32" required>
|
||||
<label class="form-label">Nameserver 1</label>
|
||||
<input type="text" name="api_ns_1" value="<?php echo $data['api_ns_1']; ?>" class="form-control" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label">Nameserver 2</label>
|
||||
<input type="text" name="api_ns_2" value="<?php echo $data['api_ns_2']; ?>" class="form-control" readonly>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -71,10 +83,11 @@
|
|||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="mb-10 px-10">
|
||||
<button name="submit" class="btn btn-primary"><?php echo $lang->I18N('Save'); ?></button>
|
||||
<a href="<?php echo setURL('admin/hosting', '', array('action' => 'edit', 'id' => $data['api_id'])); ?>" class="btn btn-sm btn-secondary mx-5 btn-rounded"><i class="fa fa-edit"></i> <?php echo $lang->I18N('edit'); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
|
||||
<div class="content-wrapper">
|
||||
<div class="container-fluid" id="login">
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-md-offset-2 col-lg-4 offset-lg-4">
|
||||
<div class="m-auto" style="width: 400px;">
|
||||
<div class="card mx-30" style="opacity: 80%">
|
||||
<form action="controllers/profile/forgetpassword.php" method="post">
|
||||
<h5 class="m-0 text-center">Forget Password</h5><hr>
|
||||
|
@ -20,5 +19,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -5,14 +5,6 @@
|
|||
<a href="<?php echo setRouter('settings');?>" class="btn<?php if ($section == 'settings') echo ' btn-primary'; ?>">
|
||||
<i class="fa fa-cog"></i> <?php echo $lang->I18N('System Settings'); ?>
|
||||
</a>
|
||||
<a href="<?php echo setRouter('settings', 'hosting');?>" class="btn<?php if ($section == 'hosting') echo ' btn-primary'; ?>">
|
||||
<i class="fa fa-server"></i></span>
|
||||
<?php echo $lang->I18N('Hosting Settings'); ?>
|
||||
</a>
|
||||
<a href="<?php echo setRouter('settings', 'domain');?>" class="btn<?php if ($section == 'domain') echo ' btn-primary'; ?>">
|
||||
<i class="fa fa-plug"></i></span>
|
||||
<?php echo $lang->I18N('Domain Settings'); ?>
|
||||
</a>
|
||||
<a href="<?php echo setRouter('settings', 'smtp');?>" class="btn<?php if ($section == 'smtp') echo ' btn-primary'; ?>">
|
||||
<i class="fa fa-inbox"></i></span>
|
||||
<?php echo $lang->I18N('SMTP Settings'); ?>
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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 <b>successfully</b> !', 'success');
|
||||
redirect('clientarea/index');
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
if (isset($_COOKIE['UIISC_MEMBER'])) {
|
||||
setcookie('UIISC_MEMBER', '', -1, '/');
|
||||
setcookie('UIISC_MEMBER', '', -1, '/', $site_domain);
|
||||
setMessage('Logged out <b>successfully !</b>', 'success');
|
||||
} else {
|
||||
setMessage('Login to <b>continue !</b>', 'danger');
|
||||
|
|
|
@ -18,7 +18,7 @@ if ($old_password == $ClientInfo['client_password']) {
|
|||
|
||||
if ($result) {
|
||||
setMessage('Password changed <b>successfully!</b>', 'success');
|
||||
setcookie('UIISC_MEMBER', 'NULL', -1, '/');
|
||||
setcookie('UIISC_MEMBER', 'NULL', -1, '/', $site_domain);
|
||||
redirect('clientarea/login');
|
||||
} else {
|
||||
setMessage('Something went' . "'" . 's <b>wrong !</b>', 'danger');
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 <b>continue!</b>', 'danger');
|
||||
redirect('clientarea/login');
|
||||
}
|
||||
} else {
|
||||
setcookie('UIISC_MEMBER', '', -1, '/');
|
||||
setcookie('UIISC_MEMBER', '', -1, '/', $site_domain);
|
||||
setMessage('Login to <b>continue!</b>', 'danger');
|
||||
redirect('clientarea/login');
|
||||
}
|
||||
|
|
|
@ -127,5 +127,7 @@ return array(
|
|||
'Page Keywords' => '网页关键字',
|
||||
'Page Copyright' => '网页版权标识',
|
||||
'Page Author' => '网页著作人',
|
||||
'Admin Area' => '管理中心'
|
||||
'Admin Area' => '管理中心',
|
||||
'Hosting Provider' => '托管提供商',
|
||||
'Domain Provider' => '域名提供商'
|
||||
);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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';
|
||||
|
|
Loading…
Reference in a new issue