新增托管服务回调功能:账号激活、暂停deng,支持多个托管服务
This commit is contained in:
parent
60169378f7
commit
a3374a79da
72 changed files with 1881 additions and 1132 deletions
3
nginx.conf
Normal file
3
nginx.conf
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
location /callback {
|
||||||
|
rewrite ^(.*)$ /callback/index.php?s=$1 last; break;
|
||||||
|
}
|
|
@ -32,12 +32,20 @@ if (empty($AccountInfo)) {
|
||||||
// redirect('admin/accounts', '', array('action' => 'view', 'account_id' => $account_id));
|
// redirect('admin/accounts', '', array('action' => 'view', 'account_id' => $account_id));
|
||||||
// }
|
// }
|
||||||
|
|
||||||
require_once ROOT . '/core/handler/HostingHandler.php';
|
$AccountApi = $DB->find('account_api', '*', array('api_key' => $AccountInfo['account_api_key']), null, 1);
|
||||||
|
|
||||||
|
$AccountApiConfig = array(
|
||||||
|
'apiUsername' => $AccountApi['api_username'],
|
||||||
|
'apiPassword' => $AccountApi['api_password'],
|
||||||
|
// 'apiUrl' => 'https://panel.myownfreehost.net/xml-api/',
|
||||||
|
'plan' => $AccountApi['api_package'],
|
||||||
|
);
|
||||||
|
|
||||||
require_once ROOT . '/modules/autoload.php';
|
require_once ROOT . '/modules/autoload.php';
|
||||||
|
|
||||||
use \InfinityFree\MofhClient\Client;
|
use \InfinityFree\MofhClient\Client;
|
||||||
|
|
||||||
$client = Client::create($HostingApiConfig);
|
$client = Client::create($AccountApiConfig);
|
||||||
$request = $client->suspend(array(
|
$request = $client->suspend(array(
|
||||||
'username' => $AccountInfo['account_key'],
|
'username' => $AccountInfo['account_key'],
|
||||||
'reason' => $reason,
|
'reason' => $reason,
|
||||||
|
|
|
@ -8,13 +8,13 @@ if (empty($account_id)) {
|
||||||
redirect('admin/accounts');
|
redirect('admin/accounts');
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = $DB->find('account', '*', array('account_id' => $account_id), null, 1);
|
$AccountInfo = $DB->find('account', '*', array('account_id' => $account_id), null, 1);
|
||||||
|
|
||||||
if (empty($data)) {
|
if (empty($AccountInfo)) {
|
||||||
redirect('admin/accounts');
|
redirect('admin/accounts');
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once ROOT . '/core/handler/HostingHandler.php';
|
$AccountApi = $DB->find('account_api', '*', array('api_key' => $AccountInfo['account_api_key']), null, 1);
|
||||||
|
|
||||||
$filemanager_url = get_filemanager_url($HostingApi['api_cpanel_url'], $data['account_username'], $data['account_password']);
|
$filemanager_url = get_filemanager_url($AccountApi['api_server_ftp_domain'], $AccountInfo['account_username'], $AccountInfo['account_password']);
|
||||||
header("Location: " . $filemanager_url);
|
header("Location: " . $filemanager_url);
|
||||||
|
|
|
@ -14,4 +14,4 @@ if (empty($AccountInfo)) {
|
||||||
redirect('admin/accounts');
|
redirect('admin/accounts');
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once ROOT . '/core/handler/HostingHandler.php';
|
$AccountApi = $DB->find('account_api', '*', array('api_key' => $AccountInfo['account_api_key']), null, 1);
|
||||||
|
|
|
@ -32,12 +32,20 @@ if ($AccountInfo['account_status'] != 1) {
|
||||||
redirect('admin/accounts', '', array('action' => 'edit', 'account_id' => $account_id));
|
redirect('admin/accounts', '', array('action' => 'edit', 'account_id' => $account_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once ROOT . '/core/handler/HostingHandler.php';
|
$AccountApi = $DB->find('account_api', '*', array('api_key' => $AccountInfo['account_api_key']), null, 1);
|
||||||
|
|
||||||
|
$AccountApiConfig = array(
|
||||||
|
'apiUsername' => $AccountApi['api_username'],
|
||||||
|
'apiPassword' => $AccountApi['api_password'],
|
||||||
|
// 'apiUrl' => 'https://panel.myownfreehost.net/xml-api/',
|
||||||
|
'plan' => $AccountApi['api_package'],
|
||||||
|
);
|
||||||
|
|
||||||
require_once ROOT . '/modules/autoload.php';
|
require_once ROOT . '/modules/autoload.php';
|
||||||
|
|
||||||
use \InfinityFree\MofhClient\Client;
|
use \InfinityFree\MofhClient\Client;
|
||||||
|
|
||||||
$client = Client::create($HostingApiConfig);
|
$client = Client::create($AccountApiConfig);
|
||||||
$request = $client->password([
|
$request = $client->password([
|
||||||
'username' => $AccountInfo['account_key'],
|
'username' => $AccountInfo['account_key'],
|
||||||
'password' => $new_password,
|
'password' => $new_password,
|
||||||
|
|
|
@ -25,12 +25,20 @@ if ($AccountInfo['account_status'] == 1) {
|
||||||
redirect('admin/accounts', '', array('action' => 'view', 'account_id' => $account_id));
|
redirect('admin/accounts', '', array('action' => 'view', 'account_id' => $account_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once ROOT . '/core/handler/HostingHandler.php';
|
$AccountApi = $DB->find('account_api', '*', array('api_key' => $AccountInfo['account_api_key']), null, 1);
|
||||||
|
|
||||||
|
$AccountApiConfig = array(
|
||||||
|
'apiUsername' => $AccountApi['api_username'],
|
||||||
|
'apiPassword' => $AccountApi['api_password'],
|
||||||
|
// 'apiUrl' => 'https://panel.myownfreehost.net/xml-api/',
|
||||||
|
'plan' => $AccountApi['api_package'],
|
||||||
|
);
|
||||||
|
|
||||||
require_once ROOT . '/modules/autoload.php';
|
require_once ROOT . '/modules/autoload.php';
|
||||||
|
|
||||||
use \InfinityFree\MofhClient\Client;
|
use \InfinityFree\MofhClient\Client;
|
||||||
|
|
||||||
$client = Client::create($HostingApiConfig);
|
$client = Client::create($AccountApiConfig);
|
||||||
$request = $client->unsuspend(array(
|
$request = $client->unsuspend(array(
|
||||||
'username' => $AccountInfo['account_key'],
|
'username' => $AccountInfo['account_key'],
|
||||||
));
|
));
|
||||||
|
|
|
@ -10,13 +10,12 @@ if (empty($account_id)) {
|
||||||
redirect('admin/accounts');
|
redirect('admin/accounts');
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once ROOT . '/core/handler/HostingHandler.php';
|
|
||||||
|
|
||||||
$PageInfo['title'] = 'View Account (#' . $account_id . ')';
|
|
||||||
|
|
||||||
$AccountInfo = $DB->find('account', '*', array('account_id' => $account_id), null, 1);
|
$AccountInfo = $DB->find('account', '*', array('account_id' => $account_id), null, 1);
|
||||||
|
|
||||||
if (empty($AccountInfo)) {
|
if (empty($AccountInfo)) {
|
||||||
setMessage('not found', 'danger');
|
setMessage('not found', 'danger');
|
||||||
redirect('admin/accounts');
|
redirect('admin/accounts');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$PageInfo['title'] = 'View Account (#' . $account_id . ')';
|
||||||
|
$AccountApi = $DB->find('account_api', '*', array('api_key' => $AccountInfo['account_api_key']), null, 1);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$PageInfo['title'] = $lang->I18N('My Clients');
|
$PageInfo['title'] = $lang->I18N('Clients List');
|
||||||
|
|
||||||
$count = $DB->count('clients');
|
$count = $DB->count('clients');
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once ROOT . '/core/handler/HostingHandler.php';
|
|
||||||
require_once ROOT . '/core/library/userinfo.class.php';
|
|
||||||
require_once ROOT . '/core/library/countries.php';
|
require_once ROOT . '/core/library/countries.php';
|
||||||
|
|
||||||
$client_id = get('client_id');
|
$client_id = get('client_id');
|
||||||
|
|
||||||
if (empty($client_id)) {
|
if (empty($client_id)) {
|
||||||
redirect('admin/clients');
|
redirect('admin/clients');
|
||||||
exit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$PageInfo['title'] = 'View client (' . $client_id . ')';
|
|
||||||
|
|
||||||
$ClientInfo = $DB->find('clients', '*', array('client_id' => $client_id), null, 1);
|
$ClientInfo = $DB->find('clients', '*', array('client_id' => $client_id), null, 1);
|
||||||
|
|
||||||
|
@ -24,6 +20,7 @@ foreach ($countries as $country) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$PageInfo['title'] = 'View client (' . $client_id . ')';
|
||||||
$count_account = $DB->count('account', array('account_client_id' => $ClientInfo['client_id']));
|
$count_account = $DB->count('account', array('account_client_id' => $ClientInfo['client_id']));
|
||||||
$count_ssl = $DB->count('ssl', array('ssl_client_id' => $ClientInfo['client_id']));
|
$count_ssl = $DB->count('ssl', array('ssl_client_id' => $ClientInfo['client_id']));
|
||||||
$count_tickets = $DB->count('tickets', array('ticket_client_id' => $ClientInfo['client_id']));
|
$count_tickets = $DB->count('tickets', array('ticket_client_id' => $ClientInfo['client_id']));
|
||||||
|
|
|
@ -3,16 +3,6 @@
|
||||||
if (isset($_POST['submit'])) {
|
if (isset($_POST['submit'])) {
|
||||||
require '../../application.php';
|
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')) {
|
if (!post('api_type')) {
|
||||||
setMessage('need field: api_type', 'danger');
|
setMessage('need field: api_type', 'danger');
|
||||||
redirect('admin/hosting');
|
redirect('admin/hosting');
|
||||||
|
@ -23,6 +13,21 @@ if (isset($_POST['submit'])) {
|
||||||
redirect('admin/hosting');
|
redirect('admin/hosting');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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_server_domain')) {
|
||||||
|
setMessage('need field: api_server_domain', 'danger');
|
||||||
|
redirect('admin/hosting');
|
||||||
|
}
|
||||||
|
|
||||||
if (!post('api_cpanel_url')) {
|
if (!post('api_cpanel_url')) {
|
||||||
setMessage('need field: api_cpanel_url', 'danger');
|
setMessage('need field: api_cpanel_url', 'danger');
|
||||||
redirect('admin/hosting');
|
redirect('admin/hosting');
|
||||||
|
@ -33,6 +38,16 @@ if (isset($_POST['submit'])) {
|
||||||
redirect('admin/hosting');
|
redirect('admin/hosting');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!post('api_server_ftp_domain')) {
|
||||||
|
setMessage('need field: api_server_ftp_domain', 'danger');
|
||||||
|
redirect('admin/hosting');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!post('api_server_sql_domain')) {
|
||||||
|
setMessage('need field: api_server_sql_domain', 'danger');
|
||||||
|
redirect('admin/hosting');
|
||||||
|
}
|
||||||
|
|
||||||
if (!post('api_ns_1')) {
|
if (!post('api_ns_1')) {
|
||||||
setMessage('need field: api_ns_1', 'danger');
|
setMessage('need field: api_ns_1', 'danger');
|
||||||
redirect('admin/hosting');
|
redirect('admin/hosting');
|
||||||
|
@ -59,7 +74,10 @@ if (isset($_POST['submit'])) {
|
||||||
'api_password' => post('api_password'),
|
'api_password' => post('api_password'),
|
||||||
'api_type' => post('api_type'),
|
'api_type' => post('api_type'),
|
||||||
'api_key' => post('api_key'),
|
'api_key' => post('api_key'),
|
||||||
|
'api_server_domain' => post('api_server_domain'),
|
||||||
'api_cpanel_url' => post('api_cpanel_url'),
|
'api_cpanel_url' => post('api_cpanel_url'),
|
||||||
|
'api_server_ftp_domain' => post('api_server_ftp_domain'),
|
||||||
|
'api_server_sql_domain' => post('api_server_sql_domain'),
|
||||||
'api_server_ip' => post('api_server_ip'),
|
'api_server_ip' => post('api_server_ip'),
|
||||||
'api_ns_1' => post('api_ns_1'),
|
'api_ns_1' => post('api_ns_1'),
|
||||||
'api_ns_2' => post('api_ns_2'),
|
'api_ns_2' => post('api_ns_2'),
|
||||||
|
|
|
@ -7,12 +7,81 @@ if (isset($_POST['submit'])) {
|
||||||
setMessage('need field: api_id', 'danger');
|
setMessage('need field: api_id', 'danger');
|
||||||
redirect('admin/hosting');
|
redirect('admin/hosting');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!post('api_type')) {
|
||||||
|
setMessage('need field: api_type', 'danger');
|
||||||
|
redirect('admin/hosting', '', ['action' => 'edit', 'id' => $api_id]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!post('api_key')) {
|
||||||
|
setMessage('need field: api_key', 'danger');
|
||||||
|
redirect('admin/hosting', '', ['action' => 'edit', 'id' => $api_id]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!post('api_username')) {
|
||||||
|
setMessage('need field: api_username', 'danger');
|
||||||
|
redirect('admin/hosting', '', ['action' => 'edit', 'id' => $api_id]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!post('api_password')) {
|
||||||
|
setMessage('need field: api_password', 'danger');
|
||||||
|
redirect('admin/hosting', '', ['action' => 'edit', 'id' => $api_id]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!post('api_server_domain')) {
|
||||||
|
setMessage('need field: api_server_domain', 'danger');
|
||||||
|
redirect('admin/hosting', '', ['action' => 'edit', 'id' => $api_id]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!post('api_cpanel_url')) {
|
||||||
|
setMessage('need field: api_cpanel_url', 'danger');
|
||||||
|
redirect('admin/hosting', '', ['action' => 'edit', 'id' => $api_id]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!post('api_server_ip')) {
|
||||||
|
setMessage('need field: api_server_ip', 'danger');
|
||||||
|
redirect('admin/hosting', '', ['action' => 'edit', 'id' => $api_id]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!post('api_server_ftp_domain')) {
|
||||||
|
setMessage('need field: api_server_ftp_domain', 'danger');
|
||||||
|
redirect('admin/hosting', '', ['action' => 'edit', 'id' => $api_id]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!post('api_server_sql_domain')) {
|
||||||
|
setMessage('need field: api_server_sql_domain', 'danger');
|
||||||
|
redirect('admin/hosting', '', ['action' => 'edit', 'id' => $api_id]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!post('api_ns_1')) {
|
||||||
|
setMessage('need field: api_ns_1', 'danger');
|
||||||
|
redirect('admin/hosting', '', ['action' => 'edit', 'id' => $api_id]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!post('api_ns_2')) {
|
||||||
|
setMessage('need field: api_ns_2', 'danger');
|
||||||
|
redirect('admin/hosting', '', ['action' => 'edit', 'id' => $api_id]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!post('api_package')) {
|
||||||
|
setMessage('need field: api_package', 'danger');
|
||||||
|
redirect('admin/hosting', '', ['action' => 'edit', 'id' => $api_id]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!post('api_callback_token')) {
|
||||||
|
setMessage('need field: api_callback_token', 'danger');
|
||||||
|
redirect('admin/hosting', '', ['action' => 'edit', 'id' => $api_id]);
|
||||||
|
}
|
||||||
|
|
||||||
$data = array(
|
$data = array(
|
||||||
'api_username' => post('api_username'),
|
'api_username' => post('api_username'),
|
||||||
'api_password' => post('api_password'),
|
'api_password' => post('api_password'),
|
||||||
'api_type' => post('api_type'),
|
'api_type' => post('api_type'),
|
||||||
'api_key' => post('api_key'),
|
'api_key' => post('api_key'),
|
||||||
|
'api_server_domain' => post('api_server_domain'),
|
||||||
'api_cpanel_url' => post('api_cpanel_url'),
|
'api_cpanel_url' => post('api_cpanel_url'),
|
||||||
|
'api_server_ftp_domain' => post('api_server_ftp_domain'),
|
||||||
|
'api_server_sql_domain' => post('api_server_sql_domain'),
|
||||||
'api_server_ip' => post('api_server_ip'),
|
'api_server_ip' => post('api_server_ip'),
|
||||||
'api_ns_1' => post('api_ns_1'),
|
'api_ns_1' => post('api_ns_1'),
|
||||||
'api_ns_2' => post('api_ns_2'),
|
'api_ns_2' => post('api_ns_2'),
|
||||||
|
@ -28,7 +97,7 @@ if (isset($_POST['submit'])) {
|
||||||
setMessage("Something went's wrong !", 'danger');
|
setMessage("Something went's wrong !", 'danger');
|
||||||
}
|
}
|
||||||
|
|
||||||
redirect('admin/hosting');
|
redirect('admin/hosting', '', ['action' => 'edit', 'id' => $api_id]);
|
||||||
} else {
|
} else {
|
||||||
if (!defined('IN_CRONLITE')) {
|
if (!defined('IN_CRONLITE')) {
|
||||||
exit('Access Denied');
|
exit('Access Denied');
|
||||||
|
|
|
@ -5,10 +5,16 @@ if (!defined('IN_CRONLITE')) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$api_id = get('id');
|
$api_id = get('id');
|
||||||
|
$api_key = get('api_key');
|
||||||
|
|
||||||
if ($api_id > 0) {
|
if ($api_id > 0) {
|
||||||
// $PageInfo = ['title' => 'View Hosting Provider #' . $api_id, 'rel' => ''];
|
|
||||||
$data = $DB->find('account_api', '*', array('api_id' => $api_id), null, 1);
|
$data = $DB->find('account_api', '*', array('api_id' => $api_id), null, 1);
|
||||||
|
$api_callback_url = "{$site_url}/callback/{$data['api_key']}/{$data['api_callback_token']}";
|
||||||
|
$PageInfo = ['title' => 'View Hosting Provider', 'rel' => ''];
|
||||||
|
} else if (!empty($api_key)) {
|
||||||
|
$data = $DB->find('account_api', '*', array('api_key' => $api_key), null, 1);
|
||||||
|
$api_callback_url = "{$site_url}/callback/{$data['api_key']}/{$data['api_callback_token']}";
|
||||||
|
$PageInfo = ['title' => 'View Hosting Provider', 'rel' => ''];
|
||||||
} else {
|
} else {
|
||||||
$PageInfo = ['title' => 'Unathorized Access', 'rel' => ''];
|
$PageInfo = ['title' => 'Unathorized Access', 'rel' => ''];
|
||||||
$data = null;
|
$data = null;
|
||||||
|
|
|
@ -19,7 +19,7 @@ if (isset($_POST['submit'])) {
|
||||||
}
|
}
|
||||||
redirect('admin/news');
|
redirect('admin/news');
|
||||||
} else {
|
} else {
|
||||||
$PageInfo['title'] = 'Add News';
|
$PageInfo['title'] = $lang->I18N('News Add');
|
||||||
$status_types = array(
|
$status_types = array(
|
||||||
"关闭",
|
"关闭",
|
||||||
"打开",
|
"打开",
|
||||||
|
|
|
@ -45,3 +45,5 @@ if ($id > 0) {
|
||||||
$news = $DB->find('news', '*', array('news_id' => $id), null, 1);
|
$news = $DB->find('news', '*', array('news_id' => $id), null, 1);
|
||||||
}
|
}
|
||||||
$load_editor = 1;
|
$load_editor = 1;
|
||||||
|
|
||||||
|
$PageInfo['title'] = $lang->I18N('News Edit');
|
||||||
|
|
|
@ -12,3 +12,5 @@ $status_types = array(
|
||||||
"关闭",
|
"关闭",
|
||||||
"打开",
|
"打开",
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$PageInfo['title'] = $lang->I18N('News List');
|
|
@ -20,3 +20,5 @@ $data = null;
|
||||||
if ($id > 0) {
|
if ($id > 0) {
|
||||||
$data = $DB->find('news', '*', array('news_id' => $id), null, 1);
|
$data = $DB->find('news', '*', array('news_id' => $id), null, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$PageInfo['title'] = $lang->I18N('News Details');
|
|
@ -1,5 +1,3 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$PageInfo['title'] = $lang->I18N('My Profile');
|
$PageInfo['title'] = $lang->I18N('My Profile');
|
||||||
|
|
||||||
require_once ROOT . '/core/library/userinfo.class.php';
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
// require_once ROOT . '/library/userinfo.class.php';
|
|
||||||
|
|
||||||
$Statuses = array(
|
$Statuses = array(
|
||||||
array('name' => 'Live', 'value' => '1'),
|
array('name' => 'Live', 'value' => '1'),
|
||||||
array('name' => 'Maintaince', 'value' => '0'),
|
array('name' => 'Maintaince', 'value' => '0'),
|
||||||
|
|
|
@ -8,8 +8,6 @@ if (!in_array($action, array('list', 'add', 'edit', 'view'))) {
|
||||||
$action = 'list';
|
$action = 'list';
|
||||||
}
|
}
|
||||||
|
|
||||||
$PageInfo['title'] = 'News ' . ucfirst($action);
|
|
||||||
|
|
||||||
require __DIR__ . '/controllers/news/' . $action . '.php';
|
require __DIR__ . '/controllers/news/' . $action . '.php';
|
||||||
require __DIR__ . '/views/common/header.php';
|
require __DIR__ . '/views/common/header.php';
|
||||||
require __DIR__ . '/views/common/navbar.php';
|
require __DIR__ . '/views/common/navbar.php';
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once __DIR__ . '/application.php';
|
require_once __DIR__ . '/application.php';
|
||||||
require_once ROOT . '/core/library/userinfo.class.php';
|
|
||||||
require_once ROOT . '/core/library/tickets.php';
|
require_once ROOT . '/core/library/tickets.php';
|
||||||
|
|
||||||
$action = get('action', 'list');
|
$action = get('action', 'list');
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
<table class="table table-stripped table-bordered table-hover">
|
<table class="table table-stripped table-bordered table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
|
<th><?php echo $lang->I18N('Clients'); ?></th>
|
||||||
|
<th><?php echo $lang->I18N('Provider'); ?></th>
|
||||||
<th><?php echo $lang->I18N('Username'); ?></th>
|
<th><?php echo $lang->I18N('Username'); ?></th>
|
||||||
<th><?php echo $lang->I18N('Domain'); ?></th>
|
<th><?php echo $lang->I18N('Domain'); ?></th>
|
||||||
<th><?php echo $lang->I18N('Deploy Date'); ?></th>
|
<th><?php echo $lang->I18N('Deploy Date'); ?></th>
|
||||||
|
@ -23,7 +25,13 @@
|
||||||
<?php if ($count > 0): ?>
|
<?php if ($count > 0): ?>
|
||||||
<?php foreach ($rows as $row): ?>
|
<?php foreach ($rows as $row): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td># <?php $row['account_id'];?></td>
|
<td><?php echo $row['account_id'];?></td>
|
||||||
|
<td><?php echo $row['account_client_id']; ?></td>
|
||||||
|
<td>
|
||||||
|
<a href="hosting.php?action=view&api_key=<?php echo $row['account_api_key']; ?>">
|
||||||
|
<?php echo $row['account_api_key']; ?>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
<td><?php echo $row['account_username']; ?></td>
|
<td><?php echo $row['account_username']; ?></td>
|
||||||
<td><?php echo $row['account_domain']; ?></td>
|
<td><?php echo $row['account_domain']; ?></td>
|
||||||
<td><?php echo $row['account_date']; ?></td>
|
<td><?php echo $row['account_date']; ?></td>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<hr />
|
<hr />
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<p>Now you are going to be redirected to the control panel. It can take upto 5 seconds based on your internet connecion speed.</p>
|
<p>Now you are going to be redirected to the control panel. It can take upto 5 seconds based on your internet connecion speed.</p>
|
||||||
<form name="login" action="https://<?php echo $HostingApi['api_cpanel_url'] ?>/login.php" id="account_ogin" method="post">
|
<form name="login" action="https://<?php echo $AccountApi['api_cpanel_url'] ?>/login.php" id="account_ogin" method="post">
|
||||||
<input type="hidden" name="uname" value="<?php echo $AccountInfo['account_username']; ?>">
|
<input type="hidden" name="uname" value="<?php echo $AccountInfo['account_username']; ?>">
|
||||||
<input type="hidden" name="passwd" value="<?php echo $AccountInfo['account_password']; ?>">
|
<input type="hidden" name="passwd" value="<?php echo $AccountInfo['account_password']; ?>">
|
||||||
<input type="hidden" name="language" value="<?php echo $lang->get_language_value(); ?>">
|
<input type="hidden" name="language" value="<?php echo $lang->get_language_value(); ?>">
|
||||||
|
|
|
@ -35,13 +35,13 @@
|
||||||
<hr />
|
<hr />
|
||||||
<div class="col-md-4 col-sm-6">
|
<div class="col-md-4 col-sm-6">
|
||||||
<div class="m-5">
|
<div class="m-5">
|
||||||
<b>Cpanel Username:</b>
|
<b>Control Panel Username:</b>
|
||||||
<span><?php echo $AccountInfo['account_username']; ?></span>
|
<span><?php echo $AccountInfo['account_username']; ?></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4 col-sm-6">
|
<div class="col-md-4 col-sm-6">
|
||||||
<div class="d-flex justify-content-between align-items-center m-5">
|
<div class="d-flex justify-content-between align-items-center m-5">
|
||||||
<b>Cpanel Password:</b>
|
<b>Control Panel Password:</b>
|
||||||
<span><kbd><?php echo $AccountInfo['account_password']; ?></kbd></span>
|
<span><kbd><?php echo $AccountInfo['account_password']; ?></kbd></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -53,8 +53,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4 col-sm-6">
|
<div class="col-md-4 col-sm-6">
|
||||||
<div class="d-flex justify-content-between align-items-center m-5">
|
<div class="d-flex justify-content-between align-items-center m-5">
|
||||||
<b>Cpanel Domain:</b>
|
<b>Control Panel Domain:</b>
|
||||||
<span><?php echo $HostingApi['api_cpanel_url']; ?></span>
|
<span><?php echo $AccountApi['api_cpanel_url']; ?></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4 col-sm-6 col-md-6">
|
<div class="col-md-4 col-sm-6 col-md-6">
|
||||||
|
@ -80,19 +80,19 @@
|
||||||
<div class="col-md-4 col-sm-6">
|
<div class="col-md-4 col-sm-6">
|
||||||
<div class="d-flex justify-content-between align-items-center m-5">
|
<div class="d-flex justify-content-between align-items-center m-5">
|
||||||
<b>Server IP:</b>
|
<b>Server IP:</b>
|
||||||
<span><?php echo $HostingApi['api_server_ip']; ?></span>
|
<span><?php echo $AccountApi['api_server_ip']; ?></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4 col-sm-6">
|
<div class="col-md-4 col-sm-6">
|
||||||
<div class="d-flex justify-content-between align-items-center m-5">
|
<div class="d-flex justify-content-between align-items-center m-5">
|
||||||
<b>Your IP:</b>
|
<b>Your IP:</b>
|
||||||
<span><?php echo UserInfo::get_ip() ?></span>
|
<span><?php echo get_client_ip(); ?></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4 col-sm-6">
|
<div class="col-md-4 col-sm-6">
|
||||||
<div class="d-flex justify-content-between align-items-center m-5">
|
<div class="d-flex justify-content-between align-items-center m-5">
|
||||||
<b>FTP Hostname:</b>
|
<b>FTP Hostname:</b>
|
||||||
<span><?php echo str_replace('cpanel', 'ftp', $HostingApi['api_cpanel_url']) ?></span>
|
<span><?php echo $AccountApi['api_server_ftp_domain']; ?></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4 col-sm-6">
|
<div class="col-md-4 col-sm-6">
|
||||||
|
@ -104,7 +104,7 @@
|
||||||
<div class="col-md-4 col-sm-6">
|
<div class="col-md-4 col-sm-6">
|
||||||
<div class="d-flex justify-content-between align-items-center m-5">
|
<div class="d-flex justify-content-between align-items-center m-5">
|
||||||
<b>MySQL Hostname:</b>
|
<b>MySQL Hostname:</b>
|
||||||
<span><?php echo str_replace('cpanel', 'sqlxxx', $HostingApi['api_cpanel_url']) ?></span>
|
<span><?php echo $AccountInfo['account_sql'] . '.' . $AccountApi['api_server_sql_domain']; ?></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4 col-sm-6">
|
<div class="col-md-4 col-sm-6">
|
||||||
|
@ -116,13 +116,13 @@
|
||||||
<div class="col-md-4 col-sm-6">
|
<div class="col-md-4 col-sm-6">
|
||||||
<div class="d-flex justify-content-between align-items-center m-5">
|
<div class="d-flex justify-content-between align-items-center m-5">
|
||||||
<b>Nameserver 1:</b>
|
<b>Nameserver 1:</b>
|
||||||
<span><?php echo $HostingApi['api_ns_1']; ?></span>
|
<span><?php echo $AccountApi['api_ns_1']; ?></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4 col-sm-6">
|
<div class="col-md-4 col-sm-6">
|
||||||
<div class="d-flex justify-content-between align-items-center m-5">
|
<div class="d-flex justify-content-between align-items-center m-5">
|
||||||
<b>Nameserver 2:</b>
|
<b>Nameserver 2:</b>
|
||||||
<span><?php echo $HostingApi['api_ns_2']; ?></span>
|
<span><?php echo $AccountApi['api_ns_2']; ?></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="card m-20 p-20">
|
<div class="card m-20 p-20">
|
||||||
<div class="card-header d-flex justify-content-between align-items-center">
|
<div class="card-header d-flex justify-content-between align-items-center">
|
||||||
<h3 class="m-0"><?php echo $lang->I18N('My Clients'); ?></h3>
|
<h3 class="m-0"><?php echo $lang->I18N('Clients List'); ?></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>
|
<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>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
|
@ -10,19 +10,21 @@
|
||||||
<table class="table table-stripped table-bordered table-hover">
|
<table class="table table-stripped table-bordered table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
<th>Name</th>
|
<th><?php echo $lang->I18N('Name'); ?></th>
|
||||||
<th>Email</th>
|
<th><?php echo $lang->I18N('Email'); ?></th>
|
||||||
<th>Date</th>
|
<th><?php echo $lang->I18N('Phone'); ?></th>
|
||||||
<th>Status</th>
|
<th><?php echo $lang->I18N('Date'); ?></th>
|
||||||
<th>Action</th>
|
<th><?php echo $lang->I18N('Status'); ?></th>
|
||||||
|
<th><?php echo $lang->I18N('Action'); ?></th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php if ($count > 0): ?>
|
<?php if ($count > 0): ?>
|
||||||
<?php foreach ($rows as $value): ?>
|
<?php foreach ($rows as $value): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td># <?php echo $value['client_id']; ?></td>
|
<td><?php echo $value['client_id']; ?></td>
|
||||||
<td><?php echo $value['client_fname'] . " " . $value['client_lname']; ?></td>
|
<td><?php echo $value['client_fname'] . " " . $value['client_lname']; ?></td>
|
||||||
<td><?php echo $value['client_email']; ?></td>
|
<td><?php echo $value['client_email']; ?></td>
|
||||||
|
<td><?php echo $value['client_phone']; ?></td>
|
||||||
<td><?php echo $value['client_date']; ?></td>
|
<td><?php echo $value['client_date']; ?></td>
|
||||||
<td><?php
|
<td><?php
|
||||||
if ($value['client_status'] == '0') {
|
if ($value['client_status'] == '0') {
|
||||||
|
|
|
@ -23,11 +23,11 @@ $avatar_path = $AdminInfo['admin_email'] ? md5($AdminInfo['admin_email']) : 'def
|
||||||
</a>
|
</a>
|
||||||
<a href="clients.php" class="sidebar-link sidebar-link-with-icon">
|
<a href="clients.php" class="sidebar-link sidebar-link-with-icon">
|
||||||
<span class="sidebar-icon bg-transparent"><i class="fa fa-users" aria-hidden="true"></i></span>
|
<span class="sidebar-icon bg-transparent"><i class="fa fa-users" aria-hidden="true"></i></span>
|
||||||
<?php echo $lang->I18N('Clients'); ?>
|
<?php echo $lang->I18N('Clients List'); ?>
|
||||||
</a>
|
</a>
|
||||||
<a href="tickets.php" class="sidebar-link sidebar-link-with-icon">
|
<a href="tickets.php" class="sidebar-link sidebar-link-with-icon">
|
||||||
<span class="sidebar-icon bg-transparent"><i class="fa fa-ticket-alt" 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'); ?>
|
<?php echo $lang->I18N('Tickets List'); ?>
|
||||||
</a>
|
</a>
|
||||||
<a href="sslcert.php" class="sidebar-link sidebar-link-with-icon">
|
<a href="sslcert.php" class="sidebar-link sidebar-link-with-icon">
|
||||||
<span class="sidebar-icon bg-transparent"><i class="fa fa-shield-alt" aria-hidden="true"></i></span>
|
<span class="sidebar-icon bg-transparent"><i class="fa fa-shield-alt" aria-hidden="true"></i></span>
|
||||||
|
@ -43,7 +43,7 @@ $avatar_path = $AdminInfo['admin_email'] ? md5($AdminInfo['admin_email']) : 'def
|
||||||
</a>
|
</a>
|
||||||
<a href="news.php" class="sidebar-link sidebar-link-with-icon">
|
<a href="news.php" class="sidebar-link sidebar-link-with-icon">
|
||||||
<span class="sidebar-icon bg-transparent"><i class="fa fa-newspaper" aria-hidden="true"></i></span>
|
<span class="sidebar-icon bg-transparent"><i class="fa fa-newspaper" aria-hidden="true"></i></span>
|
||||||
<?php echo $lang->I18N('News'); ?>
|
<?php echo $lang->I18N('News List'); ?>
|
||||||
</a>
|
</a>
|
||||||
<a href="hosting.php" class="sidebar-link sidebar-link-with-icon">
|
<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>
|
<span class="sidebar-icon bg-transparent"><i class="fa fa-server" aria-hidden="true"></i></span>
|
||||||
|
|
|
@ -12,6 +12,20 @@
|
||||||
<hr />
|
<hr />
|
||||||
<form class="card-body" action="controllers/hosting/add.php" method="post">
|
<form class="card-body" action="controllers/hosting/add.php" method="post">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="mb-10 px-10">
|
||||||
|
<label class="form-label required"><?php echo $lang->I18N('Provider Type'); ?></label>
|
||||||
|
<select name="api_type" class="form-control" required>
|
||||||
|
<option value="myownfreehost" selected>MyOwnFreeHost</option>
|
||||||
|
</select>
|
||||||
|
</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-12">
|
<div class="col-md-12">
|
||||||
<div class="mb-10 px-10">
|
<div class="mb-10 px-10">
|
||||||
<label class="form-label required">MOFH API Username</label>
|
<label class="form-label required">MOFH API Username</label>
|
||||||
|
@ -26,26 +40,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="mb-10 px-10">
|
<div class="mb-10 px-10">
|
||||||
<label class="form-label required">Hosting Type</label>
|
<label class="form-label required">Server domain</label>
|
||||||
<input type="text" name="api_type" class="form-control" required>
|
<input type="text" name="api_server_domain" 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>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
|
@ -56,8 +52,26 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="mb-10 px-10">
|
<div class="mb-10 px-10">
|
||||||
<label class="form-label required">API Callback Token</label>
|
<label class="form-label required">FTP Server</label>
|
||||||
<input type="text" name="api_callback_token" class="form-control" maxlength="32" required>
|
<input type="text" name="api_server_ftp_domain" class="form-control" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="mb-10 px-10">
|
||||||
|
<label class="form-label required">SQL Server</label>
|
||||||
|
<input type="text" name="api_server_sql_domain" class="form-control" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="mb-10 px-10">
|
||||||
|
<label class="form-label required">Control Panel 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>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
|
@ -72,11 +86,23 @@
|
||||||
<input type="text" name="api_ns_2" class="form-control" required>
|
<input type="text" name="api_ns_2" class="form-control" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-12">
|
||||||
|
<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-12">
|
||||||
|
<div class="mb-10 px-10">
|
||||||
|
<label class="form-label">API Callback URL</label>
|
||||||
|
<input type="text" class="form-control" value="<?php echo $site_url ?>/callback/[Hosting Key]/[API Callback Token]" readonly>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="mb-10 px-10">
|
<div class="my-10 px-10">
|
||||||
<button name="submit" class="btn btn-primary"><?php echo $lang->I18N('Save'); ?></button>
|
<button name="submit" class="btn btn-primary"><?php echo $lang->I18N('Save'); ?></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -13,6 +13,18 @@
|
||||||
<form class="card-body" action="controllers/hosting/edit.php" method="post">
|
<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;">
|
<input type="hidden" name="api_id" value="<?php echo $data['api_id']; ?>" style="display:none;">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="mb-10 px-10">
|
||||||
|
<label class="form-label required"><?php echo $lang->I18N('Provider Type'); ?></label>
|
||||||
|
<input type="text" name="api_type" value="<?php echo $data['api_type']; ?>" class="form-control" required readonly>
|
||||||
|
</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 readonly>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="mb-10 px-10">
|
<div class="mb-10 px-10">
|
||||||
<label class="form-label required">MOFH API Username</label>
|
<label class="form-label required">MOFH API Username</label>
|
||||||
|
@ -27,26 +39,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="mb-10 px-10">
|
<div class="mb-10 px-10">
|
||||||
<label class="form-label required">Hosting Type</label>
|
<label class="form-label required">Server domain</label>
|
||||||
<input type="text" name="api_type" value="<?php echo $data['api_type']; ?>" class="form-control" required>
|
<input type="text" name="api_server_domain" value="<?php echo $data['api_server_domain']; ?>" 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>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
|
@ -57,8 +51,26 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="mb-10 px-10">
|
<div class="mb-10 px-10">
|
||||||
<label class="form-label required">API Callback Token</label>
|
<label class="form-label required">FTP Server</label>
|
||||||
<input type="text" name="api_callback_token" value="<?php echo $data['api_callback_token']; ?>" class="form-control" maxlength="32" required>
|
<input type="text" name="api_server_ftp_domain" value="<?php echo $data['api_server_ftp_domain']; ?>" class="form-control" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="mb-10 px-10">
|
||||||
|
<label class="form-label required">SQL Server</label>
|
||||||
|
<input type="text" name="api_server_sql_domain" value="<?php echo $data['api_server_sql_domain']; ?>" class="form-control" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="mb-10 px-10">
|
||||||
|
<label class="form-label required">Control Panel 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>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
|
@ -73,11 +85,17 @@
|
||||||
<input type="text" name="api_ns_2" value="<?php echo $data['api_ns_2']; ?>" class="form-control" required>
|
<input type="text" name="api_ns_2" value="<?php echo $data['api_ns_2']; ?>" class="form-control" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-12">
|
||||||
|
<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>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="mb-10 px-10">
|
<div class="my-10 px-10">
|
||||||
<button name="submit" class="btn btn-primary"><?php echo $lang->I18N('Save'); ?></button>
|
<button name="submit" class="btn btn-primary"><?php echo $lang->I18N('Save'); ?></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<th>Key</th>
|
<th>Key</th>
|
||||||
<th>Type</th>
|
<th>Type</th>
|
||||||
<th>Cpanel URL</th>
|
<th>Panel URL</th>
|
||||||
<th>Package</th>
|
<th>Package</th>
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
|
@ -18,6 +18,18 @@
|
||||||
<hr />
|
<hr />
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="mb-10 px-10">
|
||||||
|
<label class="form-label"><?php echo $lang->I18N('Provider 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">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-12">
|
<div class="col-md-12">
|
||||||
<div class="mb-10 px-10">
|
<div class="mb-10 px-10">
|
||||||
<label class="form-label">MOFH API Username</label>
|
<label class="form-label">MOFH API Username</label>
|
||||||
|
@ -32,14 +44,26 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="mb-10 px-10">
|
<div class="mb-10 px-10">
|
||||||
<label class="form-label">Hosting Type</label>
|
<label class="form-label">Hosting Server</label>
|
||||||
<input type="text" name="api_type" value="<?php echo $data['api_type']; ?>" class="form-control" readonly>
|
<input type="text" name="api_server_domain" value="<?php echo $data['api_server_domain']; ?>" class="form-control" readonly>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="mb-10 px-10">
|
<div class="mb-10 px-10">
|
||||||
<label class="form-label">Hosting Key</label>
|
<label class="form-label">Server IP</label>
|
||||||
<input type="text" name="api_key" value="<?php echo $data['api_key']; ?>" class="form-control" readonly>
|
<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">FTP Server</label>
|
||||||
|
<input type="text" name="api_server_ftp_domain" value="<?php echo $data['api_server_ftp_domain']; ?>" class="form-control" readonly>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="mb-10 px-10">
|
||||||
|
<label class="form-label">SQL Server</label>
|
||||||
|
<input type="text" name="api_server_sql_domain" value="<?php echo $data['api_server_sql_domain']; ?>" class="form-control" readonly>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
|
@ -54,18 +78,6 @@
|
||||||
<input type="text" name="api_package" value="<?php echo $data['api_package']; ?>" class="form-control" readonly>
|
<input type="text" name="api_package" value="<?php echo $data['api_package']; ?>" class="form-control" readonly>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
|
||||||
<div class="mb-10 px-10">
|
|
||||||
<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">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 class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="mb-10 px-10">
|
<div class="mb-10 px-10">
|
||||||
<label class="form-label">Nameserver 1</label>
|
<label class="form-label">Nameserver 1</label>
|
||||||
|
@ -78,11 +90,23 @@
|
||||||
<input type="text" name="api_ns_2" value="<?php echo $data['api_ns_2']; ?>" class="form-control" readonly>
|
<input type="text" name="api_ns_2" value="<?php echo $data['api_ns_2']; ?>" class="form-control" readonly>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="mb-10 px-10">
|
||||||
|
<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 class="col-md-12">
|
||||||
|
<div class="mb-10 px-10">
|
||||||
|
<label class="form-label">API Callback URL</label>
|
||||||
|
<input type="text" class="form-control" value="<?php echo $api_callback_url; ?>" readonly>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="mb-10 px-10">
|
<div class="mb-20 px-10">
|
||||||
<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>
|
<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>
|
</div>
|
||||||
|
|
|
@ -8,7 +8,7 @@ if (!defined('IN_CRONLITE')) {
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="card py-0">
|
<div class="card py-0">
|
||||||
<div class="d-flex justify-content-between align-items-center pt-15">
|
<div class="d-flex justify-content-between align-items-center pt-15">
|
||||||
<h5 class="m-0">Add News</h5>
|
<h5 class="m-0"><?php echo $PageInfo['title']; ?></h5>
|
||||||
<a href="news.php" class="btn btn-sm btn-danger"><i class="fa fa-backward"></i> <?php echo $lang->I18N('Return'); ?></a>
|
<a href="news.php" class="btn btn-sm btn-danger"><i class="fa fa-backward"></i> <?php echo $lang->I18N('Return'); ?></a>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
|
@ -8,7 +8,7 @@ if (!defined('IN_CRONLITE')) {
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="card py-0">
|
<div class="card py-0">
|
||||||
<div class="d-flex justify-content-between align-items-center pt-15">
|
<div class="d-flex justify-content-between align-items-center pt-15">
|
||||||
<h5 class="m-0">Edit News</h5>
|
<h5 class="m-0"><?php echo $PageInfo['title']; ?></h5>
|
||||||
<div>
|
<div>
|
||||||
<a href="news.php" class="btn btn-sm btn-danger">
|
<a href="news.php" class="btn btn-sm btn-danger">
|
||||||
<i class="fa fa-backward"></i> <?php echo $lang->I18N('Return'); ?>
|
<i class="fa fa-backward"></i> <?php echo $lang->I18N('Return'); ?>
|
||||||
|
|
|
@ -8,7 +8,7 @@ if (!defined('IN_CRONLITE')) {
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="card py-0">
|
<div class="card py-0">
|
||||||
<div class="d-flex justify-content-between align-items-center pt-15">
|
<div class="d-flex justify-content-between align-items-center pt-15">
|
||||||
<h5 class="m-0"><?php echo $lang->I18N('news'); ?></h5>
|
<h5 class="m-0"><?php echo $PageInfo['title']; ?></h5>
|
||||||
<a href="news.php?action=add" class="btn text-white btn-success btn-sm">
|
<a href="news.php?action=add" class="btn text-white btn-success btn-sm">
|
||||||
<i class="fa fa-plus"></i> <?php echo $lang->I18N('add'); ?>
|
<i class="fa fa-plus"></i> <?php echo $lang->I18N('add'); ?>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -10,7 +10,7 @@ if (!defined('IN_CRONLITE')) {
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="card py-0">
|
<div class="card py-0">
|
||||||
<div class="d-flex justify-content-between align-items-center pt-15">
|
<div class="d-flex justify-content-between align-items-center pt-15">
|
||||||
<h5 class="m-0">News Details #<?php echo $id; ?></h5>
|
<h5 class="m-0"><?php echo $PageInfo['title']; ?> #<?php echo $id; ?></h5>
|
||||||
<div>
|
<div>
|
||||||
<a href="news.php" class="btn btn-sm btn-danger">
|
<a href="news.php" class="btn btn-sm btn-danger">
|
||||||
<i class="fa fa-backward"></i> <?php echo $lang->I18N('Return'); ?>
|
<i class="fa fa-backward"></i> <?php echo $lang->I18N('Return'); ?>
|
||||||
|
|
|
@ -19,19 +19,19 @@
|
||||||
<h6 class="mb-0"><b><?php echo $lang->I18N('Email Address'); ?>:</b> <?php echo $AdminInfo['admin_email']; ?></h6>
|
<h6 class="mb-0"><b><?php echo $lang->I18N('Email Address'); ?>:</b> <?php echo $AdminInfo['admin_email']; ?></h6>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<h6 class="mb-0"><b><?php echo $lang->I18N('IP Address'); ?>:</b> <?php echo UserInfo::get_ip(); ?></h6>
|
<h6 class="mb-0"><b><?php echo $lang->I18N('IP Address'); ?>:</b> <?php echo get_client_ip(); ?></h6>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<h6 class="mb-0"><b>Shared IP:</b> <?php echo gethostbyname($_SERVER['HTTP_HOST']); ?></h6>
|
<h6 class="mb-0"><b>Shared IP:</b> <?php echo gethostbyname($_SERVER['HTTP_HOST']); ?></h6>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<h6 class="mb-0"><b>Device Type:</b> <?php echo UserInfo::get_device(); ?></h6>
|
<h6 class="mb-0"><b>Device Type:</b> <?php echo get_client_device(); ?></h6>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<h6 class="mb-0"><b>Device OS:</b> <?php echo UserInfo::get_os(); ?></h6>
|
<h6 class="mb-0"><b>Device OS:</b> <?php echo get_client_os(); ?></h6>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<h6 class="mb-0"><b>Web Browser:</b> <?php echo UserInfo::get_browser(); ?></h6>
|
<h6 class="mb-0"><b>Web Browser:</b> <?php echo get_client_browser(); ?></h6>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-12"><hr></div>
|
<div class="col-md-12"><hr></div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header d-flex justify-content-between align-items-center">
|
<div class="card-header d-flex justify-content-between align-items-center">
|
||||||
<h3 class="m-0"><?php echo $lang->I18N('My Tickets'); ?></h3>
|
<h3 class="m-0"><?php echo $lang->I18N('Tickets List'); ?></h3>
|
||||||
<a href="index.php" class="btn text-white btn-danger btn-sm">
|
<a href="index.php" class="btn text-white btn-danger btn-sm">
|
||||||
<i class="fa fa-backward"></i> <?php echo $lang->I18N('Return'); ?>
|
<i class="fa fa-backward"></i> <?php echo $lang->I18N('Return'); ?>
|
||||||
</a>
|
</a>
|
||||||
|
|
8
src/callback/.htaccess
Normal file
8
src/callback/.htaccess
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<IfModule mod_rewrite.c>
|
||||||
|
Options +FollowSymlinks -Multiviews
|
||||||
|
RewriteEngine On
|
||||||
|
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
|
||||||
|
</IfModule>
|
|
@ -1,34 +1,36 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
header("X-Powered-By: UIISC");
|
|
||||||
header("Server: UIISC");
|
|
||||||
header("Content-Type: text/html; charset=UTF-8");
|
|
||||||
|
|
||||||
if (!isset($_GET['token']) || empty($_GET['token'])) {
|
|
||||||
header("status: 401");
|
|
||||||
exit('401 Unauthorized');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($_GET['key']) || empty($_GET['key'])) {
|
|
||||||
header("status: 401");
|
|
||||||
exit('401 Unauthorized');
|
|
||||||
}
|
|
||||||
|
|
||||||
require_once __DIR__ . '/../core/application.php';
|
require_once __DIR__ . '/../core/application.php';
|
||||||
|
$path_array = explode('/', trim($path_info, '/'));
|
||||||
|
|
||||||
$token = get('token');
|
if (!$path_array || count($path_array) < 2) {
|
||||||
$key = get('key');
|
exit('401 Unauthorized');
|
||||||
|
|
||||||
$HostingApi = $DB->find('account_api', '*', array('api_key' => $key), null, 1);
|
|
||||||
|
|
||||||
if (!$HostingApi) {
|
|
||||||
header("status: 404");
|
|
||||||
exit('404 Not Found');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($token != $HostingApi['api_callback_token']) {
|
if (!isset($path_array[0]) || empty($path_array[0])) {
|
||||||
header("status: 404");
|
header("status: 401");
|
||||||
exit('404 Not Found');
|
exit('401 Unauthorized');
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once __DIR__ . '/' . $key . '/app.php';
|
if (!isset($path_array[1]) || empty($path_array[1])) {
|
||||||
|
header("status: 401");
|
||||||
|
exit('401 Unauthorized');
|
||||||
|
}
|
||||||
|
|
||||||
|
$api_key = $path_array[0];
|
||||||
|
$token = $path_array[1];
|
||||||
|
|
||||||
|
$AccountApi = $DB->find('account_api', '*', array('api_key' => $api_key), null, 1);
|
||||||
|
|
||||||
|
if (!$AccountApi) {
|
||||||
|
exit('Not Found');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($token != $AccountApi['api_callback_token']) {
|
||||||
|
exit('Unauthorized');
|
||||||
|
}
|
||||||
|
|
||||||
|
file_put_contents('./log.txt', json_encode($_POST), FILE_APPEND);
|
||||||
|
file_put_contents('./log.txt', "\n", FILE_APPEND);
|
||||||
|
|
||||||
|
require_once __DIR__ . '/' . $AccountApi['api_type'] . '/app.php';
|
||||||
|
|
|
@ -12,49 +12,89 @@ if (!$username) {
|
||||||
exit('need: username');
|
exit('need: username');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$callback_log = array(
|
||||||
|
'callback_date' => date('Y-m-d H:i:s'),
|
||||||
|
'callback_username' => $username,
|
||||||
|
'callback_action' => $status,
|
||||||
|
'callback_comments' => post('comments'),
|
||||||
|
'callback_client_id' => 0,
|
||||||
|
'callback_raw' => json_encode(post())
|
||||||
|
);
|
||||||
|
|
||||||
// 账号信息
|
// 账号信息
|
||||||
$AccountInfo = $DB->find('account', '*', array('account_username' => $username, 'account_api_key' => $HostingApi['api_key']));
|
$AccountInfo = $DB->find('account', '*', array('account_username' => $username));
|
||||||
if ($AccountInfo) {
|
if ($AccountInfo) {
|
||||||
// 账号存在 激活账号
|
// 更新账号信息
|
||||||
$res = $DB->update('account', array('account_sql' => $status, 'account_status' => '1'), array('account_id' => $AccountInfo['account_id']));
|
$res = $DB->update('account', array('account_status' => '1'), array('account_id' => $AccountInfo['account_id']));
|
||||||
|
|
||||||
// 查找客户信息
|
// 查找客户信息
|
||||||
$ClientInfo = $DB->find('clients', 'client_email, client_fname', array('client_id' => $AccountInfo['account_client_id']));
|
$ClientInfo = $DB->find('clients', 'client_email, client_fname', array('client_id' => $AccountInfo['account_client_id']));
|
||||||
if ($ClientInfo) {
|
if ($ClientInfo) {
|
||||||
|
$callback_log['callback_client_id'] = $AccountInfo['account_client_id'];
|
||||||
$EmailTo = $ClientInfo['client_email'];
|
$EmailTo = $ClientInfo['client_email'];
|
||||||
$EmailSubject = 'New Hosting Account';
|
$EmailToNickname = $ClientInfo['client_fname'];
|
||||||
$EmailToPeople = $ClientInfo['client_fname'];
|
|
||||||
} else {
|
} else {
|
||||||
$EmailTo = $SiteConfig['site_email'];
|
$EmailTo = $SiteConfig['site_email'];
|
||||||
$EmailToPeople = 'Administrator';
|
$EmailToNickname = 'Administrator';
|
||||||
}
|
}
|
||||||
$EmailContent = '<p>You have successfully created a new hosting account the details are given bellow.</p>';
|
$EmailContent = '<p>You have successfully created a new hosting account the details are given bellow.</p>';
|
||||||
} else {
|
} else {
|
||||||
// TODO: 账号不存在,入库
|
// 账号不存在,入库
|
||||||
|
$AccountInfo = array(
|
||||||
|
'account_username' => $username,
|
||||||
|
'account_password' => '********',
|
||||||
|
'account_key' => substr(str_shuffle('qwertyuioplkjhgfdsazxcvbnm012345789QWERTYUIOPLKJHGFDSAZXCVBNM'), 0, 8),
|
||||||
|
'account_api_key' => $api_key,
|
||||||
|
'account_domain' => '***.' . $AccountApi['api_server_domain'],
|
||||||
|
'account_status' => '1',
|
||||||
|
'account_date' => $callback_log['callback_date'],
|
||||||
|
'account_client_id' => 0,
|
||||||
|
'account_sql' => 'sql***'
|
||||||
|
);
|
||||||
|
$DB->insert('account', $AccountInfo);
|
||||||
|
|
||||||
$EmailTo = $SiteConfig['site_email'];
|
$EmailTo = $SiteConfig['site_email'];
|
||||||
$EmailToPeople = 'Administrator';
|
$EmailToNickname = 'Administrator';
|
||||||
$EmailContent = '<p>Congratulations !</p><p>You have successfully received a new hosting account, the details are given bellow.</p>';
|
$EmailContent = '<p>Congratulations !</p><p>You have successfully received a new hosting account, the details are given bellow.</p>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 记录日志
|
||||||
|
$DB->insert('account_callback', $callback_log);
|
||||||
|
|
||||||
$EmailDescription = '
|
$EmailDescription = '
|
||||||
<b>cPanel Username: </b><span>' . $AccountInfo['account_username'] . '</span><br />
|
<p>Account domain : ' . $AccountInfo['account_domain'] . '<br />
|
||||||
<b>cPanel Password: </b><span>' . $AccountInfo['account_password'] . '</span><br />
|
Account date : ' . $AccountInfo['account_date'] . '<br />
|
||||||
<b>cPanel URL : </b><span>' . $HostingApi['api_cpanel_url'] . '</span><br /><br />
|
Server IP : ' . $AccountApi['api_server_ip'] . '<br />
|
||||||
<b>Main Domain : </b><span>' . $AccountInfo['account_domain'] . '</span><br />
|
Hosting package: ' . $AccountApi['api_package'] . '<br /></p>
|
||||||
<b>Account Date : </b><span>' . $AccountInfo['account_date'] . '</span><br />
|
<p>Control Panel username : ' . $AccountInfo['account_username'] . '<br />
|
||||||
<b>Server IP : </b><span>' . $HostingApi['api_server_ip'] . '</span><br />
|
Control Panel password : ' . $AccountInfo['account_password'] . '<br />
|
||||||
<b>Hosting Package: </b><span>' . $HostingApi['api_package'] . '</span><br /><br />
|
Control Panel URL : ' . $AccountApi['api_cpanel_url'] . '<br /></p>
|
||||||
<b>FTP Username : </b><span>' . $AccountInfo['account_username'] . '</span><br />
|
|
||||||
<b>FTP Password : </b><span>' . $AccountInfo['account_password'] . '</span><br />
|
<p>SQL hostname : ***.' . $AccountApi['api_server_sql_domain'] . '<br />
|
||||||
<b>FTP Hostname : </b><span>ftpupload.net</span><br />
|
SQL username : ' . $AccountInfo['account_username'] . '<br />
|
||||||
<b>FTP Port : </b><span>21</span><br /><br />
|
SQL password : ' . $AccountInfo['account_password'] . '<br />
|
||||||
<b>MySQL Username : </b><span>' . $AccountInfo['account_username'] . '</span><br />
|
SQL port : 3306</p>
|
||||||
<b>MySQL Password : </b><span>' . $AccountInfo['account_password'] . '</span><br />
|
<p>FTP username : ' . $AccountInfo['account_username'] . '<br />
|
||||||
<b>MySQL Hostname : </b><span>' . str_replace('cpanel', $AccountInfo['account_sql'], $HostingApi['api_cpanel_url']) . '</span><br />
|
FTP password : ' . $AccountInfo['account_password'] . '<br />
|
||||||
<b>MySQL Port : </b><span>3306</span><br /><br />
|
FTP hostname : ' . $AccountApi['api_server_ftp_domain'] . '<br />
|
||||||
<b>Nameserver 1 : </b><span>' . $HostingApi['api_ns_1'] . '</span><br />
|
FTP port : 21<br /></p>
|
||||||
<b>Nameserver 2 : </b><span>' . $HostingApi['api_ns_2'] . '</span>';
|
<p>Nameserver 1 : ' . $AccountApi['api_ns_1'] . '<br />
|
||||||
$email_body = email_build_body('New Hosting Account', $EmailToPeople, $EmailContent, $EmailDescription);
|
Nameserver 2 : ' . $AccountApi['api_ns_2'] . '</p>';
|
||||||
|
|
||||||
|
$email_body = email_build_body('New Hosting Account', $EmailToNickname, $EmailContent, $EmailDescription);
|
||||||
|
|
||||||
|
// print($email_body);
|
||||||
|
|
||||||
|
$emails_log = array(
|
||||||
|
'email_client_id' => $AccountInfo['account_client_id'],
|
||||||
|
'email_date' => date('Y-m-d H:i:s'),
|
||||||
|
'email_to' => $EmailTo,
|
||||||
|
'email_subject' => 'New Hosting Account',
|
||||||
|
'email_body' => $email_body,
|
||||||
|
'email_read' => 0
|
||||||
|
);
|
||||||
|
// print_r($emails_log);
|
||||||
|
$DB->insert('emails', $emails_log);
|
||||||
|
|
||||||
send_mail(array(
|
send_mail(array(
|
||||||
'to' => $EmailTo,
|
'to' => $EmailTo,
|
||||||
|
|
|
@ -12,10 +12,27 @@ if (!isset($_POST['comments'])) {
|
||||||
|
|
||||||
$status = post('status');
|
$status = post('status');
|
||||||
|
|
||||||
if (substr($status, 0, 3) == 'sql') {
|
if ($status == 'ACTIVATED') {
|
||||||
|
// 帐户激活,新注册
|
||||||
require_once __DIR__ . '/activate.php';
|
require_once __DIR__ . '/activate.php';
|
||||||
} elseif ($status == 'SUSPENDED') {
|
} elseif ($status == 'SUSPENDED') {
|
||||||
|
// 帐户暂停
|
||||||
require_once __DIR__ . '/suspend.php';
|
require_once __DIR__ . '/suspend.php';
|
||||||
|
} else if ($status == 'REACTIVATE') {
|
||||||
|
// 帐户解禁
|
||||||
|
require_once __DIR__ . '/reactivate.php';
|
||||||
|
} else if ($status == 'CLIENTSUBADD') {
|
||||||
|
// 添加子域名
|
||||||
|
require_once __DIR__ . '/subdomainadd.php';
|
||||||
|
} else if ($status == 'CLIENTSUBDEL') {
|
||||||
|
// 删除子域名
|
||||||
|
require_once __DIR__ . '/subdomaindel.php';
|
||||||
|
} else if ($status == 'DELETE') {
|
||||||
|
// 帐户已删除
|
||||||
|
require_once __DIR__ . '/delete.php';
|
||||||
|
} else if (substr($status, 0, 3) == 'sql') {
|
||||||
|
// 用户sql集群已开通
|
||||||
|
require_once __DIR__ . '/sqlcluster.php';
|
||||||
} else {
|
} else {
|
||||||
exit('Access Denied');
|
exit('Access Denied');
|
||||||
}
|
}
|
||||||
|
|
86
src/callback/myownfreehost/reactivate.php
Executable file
86
src/callback/myownfreehost/reactivate.php
Executable file
|
@ -0,0 +1,86 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// require_once __DIR__ . '/../../core/application.php';
|
||||||
|
|
||||||
|
if (!defined('IN_CRONLITE')) {
|
||||||
|
exit('Access Denied');
|
||||||
|
}
|
||||||
|
|
||||||
|
$username = post('username');
|
||||||
|
|
||||||
|
if (!$username) {
|
||||||
|
exit('need: username');
|
||||||
|
}
|
||||||
|
|
||||||
|
$callback_log = array(
|
||||||
|
'callback_date' => date('Y-m-d H:i:s'),
|
||||||
|
'callback_username' => $username,
|
||||||
|
'callback_action' => $status,
|
||||||
|
'callback_comments' => post('comments'),
|
||||||
|
'callback_client_id' => 0,
|
||||||
|
'callback_raw' => json_encode(post())
|
||||||
|
);
|
||||||
|
|
||||||
|
// 账号信息
|
||||||
|
$AccountInfo = $DB->find('account', '*', array('account_username' => $username));
|
||||||
|
if ($AccountInfo) {
|
||||||
|
// 更新账号信息
|
||||||
|
$res = $DB->update('account', array('account_status' => '1'), array('account_id' => $AccountInfo['account_id']));
|
||||||
|
|
||||||
|
// 查找客户信息
|
||||||
|
$ClientInfo = $DB->find('clients', 'client_email, client_fname', array('client_id' => $AccountInfo['account_client_id']));
|
||||||
|
if ($ClientInfo) {
|
||||||
|
$callback_log['callback_client_id'] = $AccountInfo['account_client_id'];
|
||||||
|
$EmailTo = $ClientInfo['client_email'];
|
||||||
|
$EmailToNickname = $ClientInfo['client_fname'];
|
||||||
|
$EmailContent = '<p>Your hosting account has been reactivated, and you can continue to use it now.</p>';
|
||||||
|
} else {
|
||||||
|
$EmailTo = $SiteConfig['site_email'];
|
||||||
|
$EmailToNickname = 'Administrator';
|
||||||
|
$EmailContent = '<p>An Unassigned hosting account has been reactivated. The details are given bellow.</p>';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 账号不存在,入库
|
||||||
|
$AccountInfo = array(
|
||||||
|
'account_username' => $username,
|
||||||
|
'account_password' => '********',
|
||||||
|
'account_key' => substr(str_shuffle('qwertyuioplkjhgfdsazxcvbnm012345789QWERTYUIOPLKJHGFDSAZXCVBNM'), 0, 8),
|
||||||
|
'account_api_key' => $api_key,
|
||||||
|
'account_domain' => '***.' . $AccountApi['api_server_domain'],
|
||||||
|
'account_status' => '1',
|
||||||
|
'account_date' => $callback_log['callback_date'],
|
||||||
|
'account_client_id' => 0,
|
||||||
|
'account_sql' => 'sql***'
|
||||||
|
);
|
||||||
|
$DB->insert('account', $AccountInfo);
|
||||||
|
|
||||||
|
$EmailTo = $SiteConfig['site_email'];
|
||||||
|
$EmailToNickname = 'Administrator';
|
||||||
|
$EmailContent = '<p>An Unassigned hosting account has been reactivated. The details are given bellow.</p>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 记录日志
|
||||||
|
$DB->insert('account_callback', $callback_log);
|
||||||
|
|
||||||
|
$EmailDescription = '<p>Hosting Account : ' . $AccountInfo['account_username'] . '</p>';
|
||||||
|
|
||||||
|
$email_body = email_build_body('Hosting Account Status Changed', $EmailToNickname, $EmailContent, $EmailDescription);
|
||||||
|
|
||||||
|
// print($email_body);
|
||||||
|
|
||||||
|
$emails_log = array(
|
||||||
|
'email_client_id' => $AccountInfo['account_client_id'],
|
||||||
|
'email_date' => date('Y-m-d H:i:s'),
|
||||||
|
'email_to' => $EmailTo,
|
||||||
|
'email_subject' => 'Hosting Account Status Changed',
|
||||||
|
'email_body' => $email_body,
|
||||||
|
'email_read' => 0
|
||||||
|
);
|
||||||
|
// print_r($emails_log);
|
||||||
|
$DB->insert('emails', $emails_log);
|
||||||
|
|
||||||
|
send_mail(array(
|
||||||
|
'to' => $EmailTo,
|
||||||
|
'message' => $email_body,
|
||||||
|
'subject' => 'Hosting Account Status Changed'
|
||||||
|
));
|
87
src/callback/myownfreehost/sqlcluster.php
Executable file
87
src/callback/myownfreehost/sqlcluster.php
Executable file
|
@ -0,0 +1,87 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
if (!defined('IN_CRONLITE')) {
|
||||||
|
exit('Access Denied');
|
||||||
|
}
|
||||||
|
|
||||||
|
$username = post('username');
|
||||||
|
|
||||||
|
if (!$username) {
|
||||||
|
exit('need: username');
|
||||||
|
}
|
||||||
|
|
||||||
|
$callback_log = array(
|
||||||
|
'callback_date' => date('Y-m-d H:i:s'),
|
||||||
|
'callback_username' => $username,
|
||||||
|
'callback_action' => $status,
|
||||||
|
'callback_comments' => post('comments'),
|
||||||
|
'callback_client_id' => 0,
|
||||||
|
'callback_raw' => json_encode(post())
|
||||||
|
);
|
||||||
|
|
||||||
|
// 账号信息
|
||||||
|
$AccountInfo = $DB->find('account', '*', array('account_username' => $username));
|
||||||
|
if ($AccountInfo) {
|
||||||
|
// 账号存在
|
||||||
|
// 更新sql集群
|
||||||
|
$res = $DB->update('account', array('account_sql' => $status), array('account_id' => $AccountInfo['account_id']));
|
||||||
|
// 查找客户信息
|
||||||
|
$ClientInfo = $DB->find('clients', 'client_email, client_fname', array('client_id' => $AccountInfo['account_client_id']));
|
||||||
|
if ($ClientInfo) {
|
||||||
|
$callback_log['callback_client_id'] = $AccountInfo['account_client_id'];
|
||||||
|
$EmailTo = $ClientInfo['client_email'];
|
||||||
|
$EmailToNickname = $ClientInfo['client_fname'];
|
||||||
|
} else {
|
||||||
|
$EmailTo = $SiteConfig['site_email'];
|
||||||
|
$EmailToNickname = 'Administrator';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 账号不存在,入库
|
||||||
|
$AccountInfo = array(
|
||||||
|
'account_username' => $username,
|
||||||
|
'account_password' => 0,
|
||||||
|
'account_key' => substr(str_shuffle('qwertyuioplkjhgfdsazxcvbnm012345789QWERTYUIOPLKJHGFDSAZXCVBNM'), 0, 8),
|
||||||
|
'account_api_key' => $api_key,
|
||||||
|
'account_domain' => '***.' . $AccountApi['api_server_domain'],
|
||||||
|
'account_status' => '1',
|
||||||
|
'account_date' => $callback_log['callback_date'],
|
||||||
|
'account_client_id' => 0,
|
||||||
|
'account_sql' => $status
|
||||||
|
);
|
||||||
|
$account_id = $DB->insert('account', $AccountInfo);
|
||||||
|
|
||||||
|
$EmailTo = $SiteConfig['site_email'];
|
||||||
|
$EmailToNickname = 'Unassigned Account';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 记录日志
|
||||||
|
$DB->insert('account_callback', $callback_log);
|
||||||
|
|
||||||
|
$EmailDescription = '
|
||||||
|
<p>MySQL Server Information:</p>
|
||||||
|
hostname : ' . $status . '.' . $AccountApi['api_server_sql_domain'] . '<br />
|
||||||
|
username : ' . $AccountInfo['account_username'] . '<br />
|
||||||
|
password : ' . $AccountInfo['account_password'] . '<br />
|
||||||
|
port : 3306';
|
||||||
|
|
||||||
|
$EmailContent = '<p>Your SQL Cluster is now ready for deployment and use. The details are given bellow.</p>';
|
||||||
|
$email_body = email_build_body('Hosting SQL Cluster Status Changed', $EmailToNickname, $EmailContent, $EmailDescription);
|
||||||
|
|
||||||
|
// print($email_body);
|
||||||
|
|
||||||
|
$emails_log = array(
|
||||||
|
'email_client_id' => $AccountInfo['account_client_id'],
|
||||||
|
'email_date' => date('Y-m-d H:i:s'),
|
||||||
|
'email_to' => $EmailTo,
|
||||||
|
'email_subject' => 'Hosting SQL Cluster Status Changed',
|
||||||
|
'email_body' => $email_body,
|
||||||
|
'email_read' => 0
|
||||||
|
);
|
||||||
|
// print_r($emails_log);
|
||||||
|
$DB->insert('emails', $emails_log);
|
||||||
|
|
||||||
|
send_mail(array(
|
||||||
|
'to' => $EmailTo,
|
||||||
|
'message' => $email_body,
|
||||||
|
'subject' => 'Hosting SQL Cluster Status Changed'
|
||||||
|
));
|
84
src/callback/myownfreehost/subdomainadd.php
Executable file
84
src/callback/myownfreehost/subdomainadd.php
Executable file
|
@ -0,0 +1,84 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
if (!defined('IN_CRONLITE')) {
|
||||||
|
exit('Access Denied');
|
||||||
|
}
|
||||||
|
|
||||||
|
$username = post('username');
|
||||||
|
|
||||||
|
if (!$username) {
|
||||||
|
exit('need: username');
|
||||||
|
}
|
||||||
|
|
||||||
|
$callback_log = array(
|
||||||
|
'callback_date' => date('Y-m-d H:i:s'),
|
||||||
|
'callback_username' => $username,
|
||||||
|
'callback_action' => $status,
|
||||||
|
'callback_comments' => post('comments'),
|
||||||
|
'callback_client_id' => 0,
|
||||||
|
'callback_raw' => json_encode(post())
|
||||||
|
);
|
||||||
|
|
||||||
|
// 账号信息
|
||||||
|
$AccountInfo = $DB->find('account', '*', array('account_username' => $username));
|
||||||
|
if ($AccountInfo) {
|
||||||
|
// 禁用账号
|
||||||
|
// $res = $DB->update('account', array('account_status' => '2'), array('account_id' => $AccountInfo['account_id']));
|
||||||
|
|
||||||
|
// 查找客户信息
|
||||||
|
$ClientInfo = $DB->find('clients', 'client_email, client_fname', array('client_id' => $AccountInfo['account_client_id']));
|
||||||
|
if ($ClientInfo) {
|
||||||
|
$callback_log['callback_client_id'] = $AccountInfo['account_client_id'];
|
||||||
|
$EmailTo = $ClientInfo['client_email'];
|
||||||
|
$EmailToNickname = $ClientInfo['client_fname'];
|
||||||
|
$EmailContent = '<p>Your hosting account has successfully added a new sub domain. The details are given bellow.</p>';
|
||||||
|
} else {
|
||||||
|
$EmailTo = $SiteConfig['site_email'];
|
||||||
|
$EmailToNickname = 'Administrator';
|
||||||
|
$EmailContent = '<p>An unassigned hosting account has successfully added a new sub domain. The details are given bellow.</p>';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 账号不存在,入库
|
||||||
|
$AccountInfo = array(
|
||||||
|
'account_username' => $username,
|
||||||
|
'account_password' => '********',
|
||||||
|
'account_key' => substr(str_shuffle('qwertyuioplkjhgfdsazxcvbnm012345789QWERTYUIOPLKJHGFDSAZXCVBNM'), 0, 8),
|
||||||
|
'account_api_key' => $api_key,
|
||||||
|
'account_domain' => '***.' . $AccountApi['api_server_domain'],
|
||||||
|
'account_status' => '1',
|
||||||
|
'account_date' => $callback_log['callback_date'],
|
||||||
|
'account_client_id' => 0,
|
||||||
|
'account_sql' => 'sql***'
|
||||||
|
);
|
||||||
|
$DB->insert('account', $AccountInfo);
|
||||||
|
|
||||||
|
$EmailTo = $SiteConfig['site_email'];
|
||||||
|
$EmailToNickname = 'Administrator';
|
||||||
|
$EmailContent = '<p>An unassigned hosting account has successfully added a new sub domain. The details are given bellow.</p>';
|
||||||
|
}
|
||||||
|
$EmailDescription = '<p><pre>' . $callback_log['callback_comments'] . '</pre></p>
|
||||||
|
<p>The new sub domain is now available for use.</p>';
|
||||||
|
|
||||||
|
// 记录日志
|
||||||
|
$DB->insert('account_callback', $callback_log);
|
||||||
|
|
||||||
|
$email_body = email_build_body('Hosting Account Domain Changed', $EmailToNickname, $EmailContent, $EmailDescription);
|
||||||
|
|
||||||
|
// print_r($email_body);
|
||||||
|
|
||||||
|
$emails_log = array(
|
||||||
|
'email_client_id' => $AccountInfo['account_client_id'],
|
||||||
|
'email_date' => date('Y-m-d H:i:s'),
|
||||||
|
'email_to' => $EmailTo,
|
||||||
|
'email_subject' => 'Hosting Account Domain Changed',
|
||||||
|
'email_body' => $email_body,
|
||||||
|
'email_read' => 0
|
||||||
|
);
|
||||||
|
// print_r($emails_log);
|
||||||
|
$DB->insert('emails', $emails_log);
|
||||||
|
|
||||||
|
send_mail(array(
|
||||||
|
'to' => $EmailTo,
|
||||||
|
'message' => $email_body,
|
||||||
|
'subject' => 'Hosting Account Domain Changed'
|
||||||
|
));
|
84
src/callback/myownfreehost/subdomaindel.php
Executable file
84
src/callback/myownfreehost/subdomaindel.php
Executable file
|
@ -0,0 +1,84 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
if (!defined('IN_CRONLITE')) {
|
||||||
|
exit('Access Denied');
|
||||||
|
}
|
||||||
|
|
||||||
|
$username = post('username');
|
||||||
|
|
||||||
|
if (!$username) {
|
||||||
|
exit('need: username');
|
||||||
|
}
|
||||||
|
|
||||||
|
$callback_log = array(
|
||||||
|
'callback_date' => date('Y-m-d H:i:s'),
|
||||||
|
'callback_username' => $username,
|
||||||
|
'callback_action' => $status,
|
||||||
|
'callback_comments' => post('comments'),
|
||||||
|
'callback_client_id' => 0,
|
||||||
|
'callback_raw' => json_encode(post())
|
||||||
|
);
|
||||||
|
|
||||||
|
// 账号信息
|
||||||
|
$AccountInfo = $DB->find('account', '*', array('account_username' => $username));
|
||||||
|
if ($AccountInfo) {
|
||||||
|
// 禁用账号
|
||||||
|
// $res = $DB->update('account', array('account_status' => '2'), array('account_id' => $AccountInfo['account_id']));
|
||||||
|
|
||||||
|
// 查找客户信息
|
||||||
|
$ClientInfo = $DB->find('clients', 'client_email, client_fname', array('client_id' => $AccountInfo['account_client_id']));
|
||||||
|
if ($ClientInfo) {
|
||||||
|
$callback_log['callback_client_id'] = $AccountInfo['account_client_id'];
|
||||||
|
$EmailTo = $ClientInfo['client_email'];
|
||||||
|
$EmailToNickname = $ClientInfo['client_fname'];
|
||||||
|
$EmailContent = '<p>Your hosting account has successfully deleted a sub domain. The details are given bellow.</p>';
|
||||||
|
} else {
|
||||||
|
$EmailTo = $SiteConfig['site_email'];
|
||||||
|
$EmailToNickname = 'Administrator';
|
||||||
|
$EmailContent = '<p>An unassigned hosting account has successfully deleted a sub domain. The details are given bellow.</p>';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 账号不存在,入库
|
||||||
|
$AccountInfo = array(
|
||||||
|
'account_username' => $username,
|
||||||
|
'account_password' => '********',
|
||||||
|
'account_key' => substr(str_shuffle('qwertyuioplkjhgfdsazxcvbnm012345789QWERTYUIOPLKJHGFDSAZXCVBNM'), 0, 8),
|
||||||
|
'account_api_key' => $api_key,
|
||||||
|
'account_domain' => '***.' . $AccountApi['api_server_domain'],
|
||||||
|
'account_status' => '1',
|
||||||
|
'account_date' => $callback_log['callback_date'],
|
||||||
|
'account_client_id' => 0,
|
||||||
|
'account_sql' => 'sql***'
|
||||||
|
);
|
||||||
|
$DB->insert('account', $AccountInfo);
|
||||||
|
|
||||||
|
$EmailTo = $SiteConfig['site_email'];
|
||||||
|
$EmailToNickname = 'Administrator';
|
||||||
|
$EmailContent = '<p>An unassigned hosting account has successfully deleted a sub domain. The details are given bellow.</p>';
|
||||||
|
}
|
||||||
|
$EmailDescription = '<p><pre>' . $callback_log['callback_comments'] . '</pre></p>
|
||||||
|
<p>The sub domain is no longer usable.</p>';
|
||||||
|
|
||||||
|
// 记录日志
|
||||||
|
$DB->insert('account_callback', $callback_log);
|
||||||
|
|
||||||
|
$email_body = email_build_body('Hosting Account Domain Changed', $EmailToNickname, $EmailContent, $EmailDescription);
|
||||||
|
|
||||||
|
// print_r($email_body);
|
||||||
|
|
||||||
|
$emails_log = array(
|
||||||
|
'email_client_id' => $AccountInfo['account_client_id'],
|
||||||
|
'email_date' => date('Y-m-d H:i:s'),
|
||||||
|
'email_to' => $EmailTo,
|
||||||
|
'email_subject' => 'Hosting Account Domain Changed',
|
||||||
|
'email_body' => $email_body,
|
||||||
|
'email_read' => 0
|
||||||
|
);
|
||||||
|
// print_r($emails_log);
|
||||||
|
$DB->insert('emails', $emails_log);
|
||||||
|
|
||||||
|
send_mail(array(
|
||||||
|
'to' => $EmailTo,
|
||||||
|
'message' => $email_body,
|
||||||
|
'subject' => 'Hosting Account Domain Changed'
|
||||||
|
));
|
|
@ -1,30 +1,88 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once __DIR__ . '/../../core/application.php';
|
if (!defined('IN_CRONLITE')) {
|
||||||
|
exit('Access Denied');
|
||||||
|
}
|
||||||
|
|
||||||
$username = post('username');
|
$username = post('username');
|
||||||
|
|
||||||
// 账号信息
|
if (!$username) {
|
||||||
$AccountInfo = $DB->find('account', '*', array('account_username' => $username, 'account_api_key' => $HostingApi['api_key']));
|
exit('need: username');
|
||||||
if (!$AccountInfo) {
|
|
||||||
// 账号不存在
|
|
||||||
exit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$callback_log = array(
|
||||||
|
'callback_date' => date('Y-m-d H:i:s'),
|
||||||
|
'callback_username' => $username,
|
||||||
|
'callback_action' => $status,
|
||||||
|
'callback_comments' => post('comments'),
|
||||||
|
'callback_client_id' => 0,
|
||||||
|
'callback_raw' => json_encode(post())
|
||||||
|
);
|
||||||
|
|
||||||
|
// 账号信息
|
||||||
|
$AccountInfo = $DB->find('account', '*', array('account_username' => $username));
|
||||||
|
if ($AccountInfo) {
|
||||||
// 禁用账号
|
// 禁用账号
|
||||||
$DB->update('account', array('account_status' => '2'), array('account_id' => $AccountInfo['account_id']));
|
$res = $DB->update('account', array('account_status' => '2'), array('account_id' => $AccountInfo['account_id']));
|
||||||
// 创建删除任务
|
|
||||||
// $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', 'client_email, client_fname', array('client_id' => $AccountInfo['account_client_id']));
|
$ClientInfo = $DB->find('clients', 'client_email, client_fname', array('client_id' => $AccountInfo['account_client_id']));
|
||||||
|
if ($ClientInfo) {
|
||||||
|
$callback_log['callback_client_id'] = $AccountInfo['account_client_id'];
|
||||||
|
$EmailTo = $ClientInfo['client_email'];
|
||||||
|
$EmailToNickname = $ClientInfo['client_fname'];
|
||||||
|
$EmailContent = '<p>Your hosting account has been suspended.</p>';
|
||||||
|
$EmailDescription = '<p>the hosting account ' . $username . ' has been Deactivated.</p>
|
||||||
|
<p>All files and database will be deleted within 30 days.</p>
|
||||||
|
<p>Please perform data backup and data migration as soon as possible !</p>
|
||||||
|
<p>If you have any questions, please contact the administrator.</p>';
|
||||||
|
} else {
|
||||||
|
$EmailTo = $SiteConfig['site_email'];
|
||||||
|
$EmailToNickname = 'Administrator';
|
||||||
|
$EmailContent = '<p>An unassigned hosting account has been suspended. The details are given bellow.</p>';
|
||||||
|
$EmailDescription = '<p>the hosting account ' . $username . ' has been Deactivated.</p><p>All files and database will be deleted within 30 days.</p>';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 账号不存在,入库
|
||||||
|
$AccountInfo = array(
|
||||||
|
'account_username' => $username,
|
||||||
|
'account_password' => '********',
|
||||||
|
'account_key' => substr(str_shuffle('qwertyuioplkjhgfdsazxcvbnm012345789QWERTYUIOPLKJHGFDSAZXCVBNM'), 0, 8),
|
||||||
|
'account_api_key' => $api_key,
|
||||||
|
'account_domain' => '***.' . $AccountApi['api_server_domain'],
|
||||||
|
'account_status' => '2',
|
||||||
|
'account_date' => $callback_log['callback_date'],
|
||||||
|
'account_client_id' => 0,
|
||||||
|
'account_sql' => 'sql***'
|
||||||
|
);
|
||||||
|
$DB->insert('account', $AccountInfo);
|
||||||
|
|
||||||
$EmailContent = '<p>We had a good time with you while you were with us. </p>';
|
$EmailTo = $SiteConfig['site_email'];
|
||||||
$EmailDescription = '<p>Your account(' . $username . ') have been deactivate successfully and all files and database will be deleted within 30 days.</p><br>';
|
$EmailToNickname = 'Administrator';
|
||||||
$email_body = email_build_body('Hosting Account Deactivated', $ClientInfo['client_fname'], $EmailContent, $EmailDescription);
|
$EmailContent = '<p>An unassigned hosting account has been suspended. The details are given bellow.</p>';
|
||||||
|
$EmailDescription = '<p>the hosting account ' . $username . ' has been Deactivated.</p><p>All files and database will be deleted within 30 days.</p>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 记录日志
|
||||||
|
$DB->insert('account_callback', $callback_log);
|
||||||
|
|
||||||
|
$email_body = email_build_body('Hosting Account Status Changed', $EmailToNickname, $EmailContent, $EmailDescription);
|
||||||
|
|
||||||
|
// print_r($email_body);
|
||||||
|
|
||||||
|
$emails_log = array(
|
||||||
|
'email_client_id' => $AccountInfo['account_client_id'],
|
||||||
|
'email_date' => date('Y-m-d H:i:s'),
|
||||||
|
'email_to' => $EmailTo,
|
||||||
|
'email_subject' => 'Hosting Account Status Changed',
|
||||||
|
'email_body' => $email_body,
|
||||||
|
'email_read' => 0
|
||||||
|
);
|
||||||
|
// print_r($emails_log);
|
||||||
|
$DB->insert('emails', $emails_log);
|
||||||
|
|
||||||
send_mail(array(
|
send_mail(array(
|
||||||
'to' => $ClientInfo['client_email'],
|
'to' => $EmailTo,
|
||||||
'message' => $email_body,
|
'message' => $email_body,
|
||||||
'subject' => 'Hosting Account Deactivated'
|
'subject' => 'Hosting Account Status Changed'
|
||||||
));
|
));
|
||||||
|
|
|
@ -4,34 +4,41 @@ require_once __DIR__ . '/../../application.php';
|
||||||
|
|
||||||
$PageInfo = ['title' => 'New Account', 'rel' => ''];
|
$PageInfo = ['title' => 'New Account', 'rel' => ''];
|
||||||
|
|
||||||
require_once ROOT . '/core/handler/HostingHandler.php';
|
|
||||||
require_once ROOT . '/modules/autoload.php';
|
require_once ROOT . '/modules/autoload.php';
|
||||||
|
|
||||||
// require_once ROOT . '/core/library/userinfo.class.php';
|
|
||||||
|
|
||||||
use \InfinityFree\MofhClient\Client;
|
use \InfinityFree\MofhClient\Client;
|
||||||
|
|
||||||
if (isset($_POST['submit'])) {
|
if (isset($_POST['submit'])) {
|
||||||
|
$api_key = post('api_key');
|
||||||
|
if (empty($api_key)) {
|
||||||
|
send_response([500, '', 'api_key cannot be <b>empty</b> !']);
|
||||||
|
}
|
||||||
$FormData = array(
|
$FormData = array(
|
||||||
'username' => substr(str_shuffle('qwertyuioplkjhgfdsazxcvbnm012345789QWERTYUIOPLKJHGFDSAZXCVBNM'), 0, 8),
|
'username' => substr(str_shuffle('qwertyuioplkjhgfdsazxcvbnm012345789QWERTYUIOPLKJHGFDSAZXCVBNM'), 0, 8),
|
||||||
'password' => substr(str_shuffle('qwertyuioplkjhgfdsazxcvbnm012345789QWERTYUIOPLKJHGFDSAZXCVBNM'), 0, 16),
|
'password' => substr(str_shuffle('qwertyuioplkjhgfdsazxcvbnm012345789QWERTYUIOPLKJHGFDSAZXCVBNM'), 0, 16),
|
||||||
'account_domain' => post('domain'),
|
'account_domain' => post('domain'),
|
||||||
'email' => $ClientInfo['client_email'],
|
'email' => $ClientInfo['client_email'],
|
||||||
'plan' => post('package'),
|
// 'plan' => post('package'),
|
||||||
);
|
);
|
||||||
if (empty($FormData['account_domain'])) {
|
if (empty($FormData['account_domain'])) {
|
||||||
setMessage('Domain cannot be <b>empty</b> !', 'danger');
|
send_response([500, '', 'Domain cannot be <b>empty</b> !']);
|
||||||
redirect('clientarea/accounts', '', array('action' => 'add'));
|
|
||||||
} else {
|
} else {
|
||||||
$AccountList = $DB->findAll('account', '*', array('account_client_id' => $ClientInfo['client_id']));
|
$AccountList = $DB->findAll('account', '*', array('account_client_id' => $ClientInfo['client_id']));
|
||||||
if (count($AccountList) < 3) {
|
if (count($AccountList) < 3) {
|
||||||
$client = Client::create($HostingApiConfig);
|
$AccountApi = $DB->find('account_api', '*', array('api_key' => post('api_key')), null, 1);
|
||||||
|
$AccountApiConfig = array(
|
||||||
|
'apiUsername' => $AccountApi['api_username'],
|
||||||
|
'apiPassword' => $AccountApi['api_password'],
|
||||||
|
// 'apiUrl' => 'https://panel.myownfreehost.net/xml-api/',
|
||||||
|
'plan' => $AccountApi['api_package'],
|
||||||
|
);
|
||||||
|
$client = Client::create($AccountApiConfig);
|
||||||
$request = $client->createAccount(array(
|
$request = $client->createAccount(array(
|
||||||
'username' => $FormData['username'],
|
'username' => $FormData['username'],
|
||||||
'password' => $FormData['password'],
|
'password' => $FormData['password'],
|
||||||
'domain' => $FormData['account_domain'],
|
'domain' => $FormData['account_domain'],
|
||||||
'email' => $FormData['email'],
|
'email' => $FormData['email'],
|
||||||
'plan' => $FormData['plan'],
|
'plan' => $AccountApiConfig['plan'],
|
||||||
));
|
));
|
||||||
$response = $request->send();
|
$response = $request->send();
|
||||||
$Data = $response->getData();
|
$Data = $response->getData();
|
||||||
|
@ -39,17 +46,19 @@ if (isset($_POST['submit'])) {
|
||||||
'account_username' => $Data['result']['options']['vpusername'],
|
'account_username' => $Data['result']['options']['vpusername'],
|
||||||
'message' => $Data['result']['statusmsg'],
|
'message' => $Data['result']['statusmsg'],
|
||||||
'status' => $Data['result']['status'],
|
'status' => $Data['result']['status'],
|
||||||
'account_domain' => str_replace('cpanel', strtolower($FormData['username']), $HostingApi['api_cpanel_url']),
|
'account_domain' => str_replace('cpanel', strtolower($FormData['username']), $AccountApi['api_cpanel_url']),
|
||||||
'date' => date('Y-m-d H:i:s'),
|
'date' => date('Y-m-d H:i:s'),
|
||||||
);
|
);
|
||||||
if ($Result['status'] == 0 && strlen($Result['message']) > 1) {
|
if ($Result['status'] == 0 && strlen($Result['message']) > 1) {
|
||||||
setMessage($Result['message'], 'danger');
|
send_response([500, '', $Result['message']]);
|
||||||
redirect('clientarea/accounts', '', array('action' => 'add'));
|
// setMessage($Result['message'], 'danger');
|
||||||
|
// redirect('clientarea/accounts', '', array('action' => 'add'));
|
||||||
} elseif ($Result['status'] == 1 && strlen($Result['message']) > 1) {
|
} elseif ($Result['status'] == 1 && strlen($Result['message']) > 1) {
|
||||||
$account_id = $DB->insert('account', array(
|
$account_id = $DB->insert('account', array(
|
||||||
'account_username' => $Result['account_username'],
|
'account_username' => $Result['account_username'],
|
||||||
'account_password' => $FormData['password'],
|
'account_password' => $FormData['password'],
|
||||||
'account_key' => $FormData['username'],
|
'account_key' => $FormData['username'],
|
||||||
|
'account_api_key' => post('api_key'),
|
||||||
'account_domain' => $Result['account_domain'],
|
'account_domain' => $Result['account_domain'],
|
||||||
'account_status' => '1',
|
'account_status' => '1',
|
||||||
'account_date' => $Result['date'],
|
'account_date' => $Result['date'],
|
||||||
|
@ -59,21 +68,20 @@ if (isset($_POST['submit'])) {
|
||||||
if ($account_id) {
|
if ($account_id) {
|
||||||
$EmailTo = $FormData['email'];
|
$EmailTo = $FormData['email'];
|
||||||
|
|
||||||
$EmailContent = '
|
$EmailContent = '<p>Congratulations !</p>
|
||||||
<p>Congratulations !</p>
|
|
||||||
<p>You have successfully created a new free hosting account, more details are given below:</p><br />';
|
<p>You have successfully created a new free hosting account, more details are given below:</p><br />';
|
||||||
$EmailDescription = '
|
$EmailDescription = '
|
||||||
<b>cPanel Username : </b><span>' . $Result['account_username'] . '</span><br />
|
<b>Control Panel Username : </b><span>' . $Result['account_username'] . '</span><br />
|
||||||
<b>cPanel Password : </b><span>' . $FormData['password'] . '</span><br />
|
<b>Control Panel Password : </b><span>' . $FormData['password'] . '</span><br />
|
||||||
|
<b>Control Panel URL : </b><span>' . $AccountApi['api_cpanel_url'] . '</span><br />
|
||||||
<b>Main Domain : </b><span>' . $Result['account_domain'] . '</span><br />
|
<b>Main Domain : </b><span>' . $Result['account_domain'] . '</span><br />
|
||||||
<b>Account Date : </b><span>' . $Result['date'] . '</span><br />
|
<b>Account Date : </b><span>' . $Result['date'] . '</span><br />
|
||||||
<b>cPanel URL : </b><span>' . $HostingApi['api_cpanel_url'] . '</span><br />
|
<b>Server IP : </b><span>' . $AccountApi['api_server_ip'] . '</span><br />
|
||||||
<b>Server IP : </b><span>' . $HostingApi['api_server_ip'] . '</span><br />
|
<b>Hosting Package : </b><span>' . $AccountApi['api_package'] . '</span><br />
|
||||||
<b>Hosting Package : </b><span>' . $HostingApi['api_package'] . '</span><br />
|
<b>FTP Hostname : </b><span>' . $AccountApi['api_server_ftp_domain'] . '</span><br />
|
||||||
<b>FTP Hostname : </b><span>ftpupload.net</span><br />
|
<b>MySQL Hostname : </b><span>' . $AccountApi['api_server_sql_domain'] . '</span><br />
|
||||||
<b>MySQL Hostname : </b><span>' . str_replace('cpanel', 'sqlxxx', $HostingApi['api_cpanel_url']) . '</span><br />
|
<b>Nameserver 1 : </b><span>' . $AccountApi['api_ns_1'] . '</span><br />
|
||||||
<b>Nameserver 1 : </b><span>' . $HostingApi['api_ns_1'] . '</span><br />
|
<b>Nameserver 2 : </b><span>' . $AccountApi['api_ns_2'] . '</span>
|
||||||
<b>Nameserver 2 : </b><span>' . $HostingApi['api_ns_2'] . '</span>
|
|
||||||
<br />
|
<br />
|
||||||
<p>Next, </p>
|
<p>Next, </p>
|
||||||
<br />';
|
<br />';
|
||||||
|
@ -85,25 +93,30 @@ if (isset($_POST['submit'])) {
|
||||||
'message' => $email_body,
|
'message' => $email_body,
|
||||||
'subject' => 'New Hosting Account'
|
'subject' => 'New Hosting Account'
|
||||||
));
|
));
|
||||||
|
send_response([500, '', 'Account created <b>successfully</b> !']);
|
||||||
setMessage('Account created <b>successfully</b> !', 'success');
|
|
||||||
redirect('clientarea/accounts', '', array('action' => 'view', 'account_id' => $account_id));
|
|
||||||
} else {
|
} else {
|
||||||
setMessage('Something went' . "'" . 's <b>wrong</b> !', 'danger');
|
send_response([500, '', 'Something went' . "'" . 's <b>wrong</b> !']);
|
||||||
redirect('clientarea/accounts', '', array('action' => 'add'));
|
|
||||||
}
|
}
|
||||||
} elseif ($Result['status'] == 0 && $Result['message'] == 0) {
|
} elseif ($Result['status'] == 0 && $Result['message'] == 0) {
|
||||||
setMessage('Something went' . "'" . 's <b>wrong</b> !', 'danger');
|
send_response([500, '', 'Something went' . "'" . 's <b>wrong</b> !']);
|
||||||
redirect('clientarea/accounts', '', array('action' => 'add'));
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setMessage('Free account limit <b>reached</b> !', 'danger');
|
send_response([500, '', 'Free account limit <b>reached</b> !']);
|
||||||
redirect('clientarea/accounts', '', array('action' => 'add'));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
$api_key = get('api_key');
|
||||||
|
if (empty($api_key)) {
|
||||||
|
setMessage('api_key cannot be <b>empty</b> !', 'danger');
|
||||||
|
redirect('clientarea/accounts');
|
||||||
|
}
|
||||||
$ExtensionInfo = $DB->findAll('domain_extensions', '*', array(), 'extension_id');
|
$ExtensionInfo = $DB->findAll('domain_extensions', '*', array(), 'extension_id');
|
||||||
|
$AccountApi = $DB->find('account_api', '*', array('api_key' => get('api_key')), null, 1);
|
||||||
|
$AccountApiConfig = array(
|
||||||
|
'apiUsername' => $AccountApi['api_username'],
|
||||||
|
'apiPassword' => $AccountApi['api_password'],
|
||||||
|
'plan' => $AccountApi['api_package'],
|
||||||
|
);
|
||||||
if (empty($ExtensionInfo)) {
|
if (empty($ExtensionInfo)) {
|
||||||
$ExtensionInfo = array(
|
$ExtensionInfo = array(
|
||||||
'extension_value' => '.html-5.me',
|
'extension_value' => '.html-5.me',
|
||||||
|
|
|
@ -32,12 +32,20 @@ if ($AccountInfo['account_status'] != 1) {
|
||||||
redirect('clientarea/accounts', '', array('action' => 'view', 'account_id' => $account_id));
|
redirect('clientarea/accounts', '', array('action' => 'view', 'account_id' => $account_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once ROOT . '/core/handler/HostingHandler.php';
|
$AccountApi = $DB->find('account_api', '*', array('api_key' => $AccountInfo['account_api_key']), null, 1);
|
||||||
|
|
||||||
|
$AccountApiConfig = array(
|
||||||
|
'apiUsername' => $AccountApi['api_username'],
|
||||||
|
'apiPassword' => $AccountApi['api_password'],
|
||||||
|
// 'apiUrl' => 'https://panel.myownfreehost.net/xml-api/',
|
||||||
|
'plan' => $AccountApi['api_package'],
|
||||||
|
);
|
||||||
|
|
||||||
require_once ROOT . '/modules/autoload.php';
|
require_once ROOT . '/modules/autoload.php';
|
||||||
|
|
||||||
use \InfinityFree\MofhClient\Client;
|
use \InfinityFree\MofhClient\Client;
|
||||||
|
|
||||||
$client = Client::create($HostingApiConfig);
|
$client = Client::create($AccountApiConfig);
|
||||||
$request = $client->suspend(array(
|
$request = $client->suspend(array(
|
||||||
'username' => $AccountInfo['account_key'],
|
'username' => $AccountInfo['account_key'],
|
||||||
'reason' => $reason,
|
'reason' => $reason,
|
||||||
|
|
|
@ -21,7 +21,7 @@ if ($AccountInfo['account_status'] != 1) {
|
||||||
redirect('clientarea/accounts', '', array('action' => 'view', 'account_id' => $account_id));
|
redirect('clientarea/accounts', '', array('action' => 'view', 'account_id' => $account_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once ROOT . '/core/handler/HostingHandler.php';
|
$AccountApi = $DB->find('account_api', '*', array('api_key' => $AccountInfo['account_api_key']), null, 1);
|
||||||
|
|
||||||
$filemanager_url = get_filemanager_url($HostingApi['api_cpanel_url'], $AccountInfo['account_username'], $AccountInfo['account_password'], $domain);
|
$filemanager_url = get_filemanager_url($AccountApi['api_server_ftp_domain'], $AccountInfo['account_username'], $AccountInfo['account_password'], $domain);
|
||||||
header("Location: " . $filemanager_url);
|
header("Location: " . $filemanager_url);
|
||||||
|
|
|
@ -21,6 +21,6 @@ if ($AccountInfo['account_status'] != 1) {
|
||||||
redirect('clientarea/accounts', '', array('action' => 'view', 'account_id' => $account_id));
|
redirect('clientarea/accounts', '', array('action' => 'view', 'account_id' => $account_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once ROOT . '/core/handler/HostingHandler.php';
|
$AccountApi = $DB->find('account_api', 'api_cpanel_url', array('api_key' => $AccountInfo['account_api_key']), null, 1);
|
||||||
|
|
||||||
$PageInfo['title'] = 'Login to Control Panel';
|
$PageInfo['title'] = 'Login to Control Panel';
|
||||||
|
|
|
@ -32,13 +32,21 @@ $FormData = array(
|
||||||
'account_username' => $AccountInfo['account_username']
|
'account_username' => $AccountInfo['account_username']
|
||||||
);
|
);
|
||||||
|
|
||||||
require_once ROOT . '/core/handler/HostingHandler.php';
|
$AccountApi = $DB->find('account_api', '*', array('api_key' => $AccountInfo['account_api_key']), null, 1);
|
||||||
|
|
||||||
|
$AccountApiConfig = array(
|
||||||
|
'apiUsername' => $AccountApi['api_username'],
|
||||||
|
'apiPassword' => $AccountApi['api_password'],
|
||||||
|
// 'apiUrl' => 'https://panel.myownfreehost.net/xml-api/',
|
||||||
|
'plan' => $AccountApi['api_package'],
|
||||||
|
);
|
||||||
|
|
||||||
require_once ROOT . '/modules/autoload.php';
|
require_once ROOT . '/modules/autoload.php';
|
||||||
|
|
||||||
use \InfinityFree\MofhClient\Client;
|
use \InfinityFree\MofhClient\Client;
|
||||||
|
|
||||||
if ($FormData['old_password'] == $AccountInfo['account_password']) {
|
if ($FormData['old_password'] == $AccountInfo['account_password']) {
|
||||||
$client = Client::create($HostingApiConfig);
|
$client = Client::create($AccountApiConfig);
|
||||||
$request = $client->password([
|
$request = $client->password([
|
||||||
'username' => $AccountInfo['account_key'],
|
'username' => $AccountInfo['account_key'],
|
||||||
'password' => $FormData['new_password'],
|
'password' => $FormData['new_password'],
|
||||||
|
|
|
@ -1,15 +1,23 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once __DIR__ . '/../../application.php';
|
require_once __DIR__ . '/../../application.php';
|
||||||
|
|
||||||
require_once ROOT . '/core/handler/HostingHandler.php';
|
|
||||||
require_once ROOT . '/modules/autoload.php';
|
require_once ROOT . '/modules/autoload.php';
|
||||||
|
|
||||||
use \InfinityFree\MofhClient\Client;
|
use \InfinityFree\MofhClient\Client;
|
||||||
|
|
||||||
if (isset($_POST['submit'])) {
|
if (isset($_POST['submit'])) {
|
||||||
$domain = post('domain');
|
$domain = post('domain');
|
||||||
$client = Client::create($HostingApiConfig);
|
|
||||||
|
$AccountApi = $DB->find('account_api', '*', array('api_key' => 'ttkl.cf'), null, 1);
|
||||||
|
|
||||||
|
$AccountApiConfig = array(
|
||||||
|
'apiUsername' => $AccountApi['api_username'],
|
||||||
|
'apiPassword' => $AccountApi['api_password'],
|
||||||
|
// 'apiUrl' => 'https://panel.myownfreehost.net/xml-api/',
|
||||||
|
'plan' => $AccountApi['api_package'],
|
||||||
|
);
|
||||||
|
|
||||||
|
$client = Client::create($AccountApiConfig);
|
||||||
$request = $client->availability(array('domain' => $domain));
|
$request = $client->availability(array('domain' => $domain));
|
||||||
$response = $request->send();
|
$response = $request->send();
|
||||||
if ($response->isSuccessful() == 0 && strlen($response->getMessage()) > 1) {
|
if ($response->isSuccessful() == 0 && strlen($response->getMessage()) > 1) {
|
||||||
|
|
|
@ -19,33 +19,39 @@ if (empty($AccountInfo)) {
|
||||||
redirect('clientarea/accounts');
|
redirect('clientarea/accounts');
|
||||||
}
|
}
|
||||||
|
|
||||||
// require_once ROOT . '/core/library/userinfo.class.php';
|
|
||||||
// TODO: Change to an asynchronous request
|
// TODO: Change to an asynchronous request
|
||||||
require_once ROOT . '/core/handler/HostingHandler.php';
|
|
||||||
require_once ROOT . '/modules/autoload.php';
|
require_once ROOT . '/modules/autoload.php';
|
||||||
|
|
||||||
use \InfinityFree\MofhClient\Client;
|
use \InfinityFree\MofhClient\Client;
|
||||||
|
|
||||||
$PageInfo['title'] = 'View Account (#' . $account_id . ')';
|
$PageInfo['title'] = 'View Account (#' . $account_id . ')';
|
||||||
|
|
||||||
|
$AccountApi = $DB->find('account_api', '*', array('api_key' => $AccountInfo['account_api_key']), null, 1);
|
||||||
|
$AccountApiConfig = array(
|
||||||
|
'apiUsername' => $AccountApi['api_username'],
|
||||||
|
'apiPassword' => $AccountApi['api_password'],
|
||||||
|
// 'apiUrl' => 'https://panel.myownfreehost.net/xml-api/',
|
||||||
|
'plan' => $AccountApi['api_package'],
|
||||||
|
);
|
||||||
|
|
||||||
if ($AccountInfo['account_status'] == 1) {
|
if ($AccountInfo['account_status'] == 1) {
|
||||||
$data = array_merge(array(), $HostingApi, $AccountInfo, array(
|
$data = array_merge(array(), $AccountApi, $AccountInfo, array(
|
||||||
'user_ip' => UserInfo::get_ip(),
|
'user_ip' => get_client_ip(),
|
||||||
'ftp_host' => str_replace('cpanel', 'ftp', $HostingApi['api_cpanel_url']),
|
'ftp_host' => $AccountApi['api_server_ftp_domain'],
|
||||||
'ftp_port' => 21,
|
'ftp_port' => 21,
|
||||||
'mysql_host' => str_replace('cpanel', 'sqlxxx', $HostingApi['api_cpanel_url']),
|
'mysql_host' => $AccountApi['api_server_sql_domain'],
|
||||||
'mysql_port' => 3306,
|
'mysql_port' => 3306,
|
||||||
));
|
));
|
||||||
|
|
||||||
$client = Client::create($HostingApiConfig);
|
$client = Client::create($AccountApiConfig);
|
||||||
$request = $client->getUserDomains(array('username' => $AccountInfo['account_username']));
|
$request = $client->getUserDomains(array('username' => $AccountInfo['account_username']));
|
||||||
$response = $request->send();
|
$response = $request->send();
|
||||||
$DomainList = $response->getDomains();
|
$DomainList = $response->getDomains();
|
||||||
} else {
|
} else {
|
||||||
// inactive
|
// inactive
|
||||||
$DomainList = array();
|
$DomainList = array();
|
||||||
$data = array_merge(array(), $HostingApi, $AccountInfo, array(
|
$data = array_merge(array(), $AccountApi, $AccountInfo, array(
|
||||||
'user_ip' => UserInfo::get_ip(),
|
'user_ip' => get_client_ip(),
|
||||||
'account_username' => '-',
|
'account_username' => '-',
|
||||||
'account_password' => '-',
|
'account_password' => '-',
|
||||||
'account_domain' => '-',
|
'account_domain' => '-',
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once ROOT . '/core/library/userinfo.class.php';
|
|
||||||
require_once ROOT . '/core/library/countries.php';
|
require_once ROOT . '/core/library/countries.php';
|
||||||
|
|
||||||
$CountryName = 'Not Defined';
|
$CountryName = 'Not Defined';
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once ROOT . '/core/library/userinfo.class.php';
|
|
||||||
|
|
||||||
// $PageInfo = ['title' => 'New SSL', 'rel' => ''];
|
// $PageInfo = ['title' => 'New SSL', 'rel' => ''];
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require ROOT . '/core/library/userinfo.class.php';
|
|
||||||
|
|
||||||
$count = $DB->count('ssl', array('ssl_client_id' => $ClientInfo['client_id']));
|
$count = $DB->count('ssl', array('ssl_client_id' => $ClientInfo['client_id']));
|
||||||
|
|
||||||
if ($count > 0) {
|
if ($count > 0) {
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
$PageInfo['title'] = $lang->I18N('My Tickets');
|
$PageInfo['title'] = $lang->I18N('My Tickets');
|
||||||
|
|
||||||
require_once ROOT . '/core/library/userinfo.class.php';
|
|
||||||
|
|
||||||
$count = $DB->count('tickets', array('ticket_client_id' => $ClientInfo['client_id']));
|
$count = $DB->count('tickets', array('ticket_client_id' => $ClientInfo['client_id']));
|
||||||
|
|
||||||
if ($count > 0) {
|
if ($count > 0) {
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
require_once __DIR__ . '/application.php';
|
require_once __DIR__ . '/application.php';
|
||||||
|
|
||||||
require_once ROOT . '/core/library/userinfo.class.php';
|
|
||||||
require_once ROOT . '/core/library/countries.php';
|
require_once ROOT . '/core/library/countries.php';
|
||||||
|
|
||||||
$PageInfo['title'] = $lang->I18N('Profile Settings');
|
$PageInfo['title'] = $lang->I18N('Profile Settings');
|
||||||
|
|
|
@ -44,8 +44,8 @@
|
||||||
<div class="alert alert-secondary my-5">
|
<div class="alert alert-secondary my-5">
|
||||||
<p>You need to set these nameservers in order to host your domain with us</p>
|
<p>You need to set these nameservers in order to host your domain with us</p>
|
||||||
<ul class="mb-0">
|
<ul class="mb-0">
|
||||||
<li class="mb-0"><?php echo $HostingApi['api_ns_1'] ?></li>
|
<li class="mb-0"><?php echo $AccountApi['api_ns_1'] ?></li>
|
||||||
<li class="mb-0"><?php echo $HostingApi['api_ns_2'] ?></li>
|
<li class="mb-0"><?php echo $AccountApi['api_ns_2'] ?></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<label class="form-label required">Custom Domain Name</label>
|
<label class="form-label required">Custom Domain Name</label>
|
||||||
|
@ -76,12 +76,12 @@
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="col-md-12 mb-15">
|
<div class="col-md-12 mb-15">
|
||||||
<form action="controllers/accounts/add.php" method="post">
|
<!-- <form action="controllers/accounts/add.php" method="post"> -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="mb-10 px-10">
|
<div class="mb-10 px-10">
|
||||||
<label class="form-label required">Hosting Package</label>
|
<label class="form-label required">Hosting Package</label>
|
||||||
<input type="text" name="package" value="<?php echo $HostingApi['api_package']; ?>" class="form-control disabled" readonly>
|
<input type="text" name="package" value="<?php echo $AccountApi['api_package']; ?>" class="form-control disabled" readonly>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
|
@ -104,11 +104,11 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="mb-10 px-10">
|
<div class="mb-10 px-10">
|
||||||
<button class="btn btn-primary" name="submit">Request Account</button>
|
<button class="btn btn-primary" onclick="create_account()">Request Account</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
<!-- </form> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -163,4 +163,22 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
function create_account() {
|
||||||
|
$('#hidden-area').html('');
|
||||||
|
var domain = $('#sudomain').val();
|
||||||
|
var extensions = $('#extension').val();
|
||||||
|
var validomain = domain + extensions;
|
||||||
|
$.post('controllers/accounts/add.php', {
|
||||||
|
domain: validomain,
|
||||||
|
api_key: 'ttkl.cf',
|
||||||
|
submit: ""
|
||||||
|
}, function(data) {
|
||||||
|
if (validomain != data) {
|
||||||
|
$('#hidden-area').html('<div class="alert alert-danger" role="alert"><button class="close" data-dismiss="alert" type="button" aria-label="Close"><span aria-hidden="true">×</span></button>'+data+'</div>');
|
||||||
|
} else {
|
||||||
|
$('#hidden-area').html('<div class="alert alert-success" role="alert"><button class="close" data-dismiss="alert" type="button" aria-label="Close"><span aria-hidden="true">×</span></button>Domain is available and selected <b>successfully!</b></div>');
|
||||||
|
$('#validomain').val(data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<hr>
|
<hr>
|
||||||
<div class="mb-15">
|
<div class="mb-15">
|
||||||
<p>You will now be redirected to the control panel. It can take up to 5 seconds based on your internet connecion speed.</p>
|
<p>You will now be redirected to the control panel. It can take up to 5 seconds based on your internet connecion speed.</p>
|
||||||
<form id="Login" action="https://<?php echo $HostingApi['api_cpanel_url']; ?>/login.php" method="post" name="login">
|
<form id="Login" action="https://<?php echo $AccountApi['api_cpanel_url']; ?>/login.php" method="post" name="login">
|
||||||
<input type="hidden" name="uname" value="<?php echo $AccountInfo['account_username']; ?>">
|
<input type="hidden" name="uname" value="<?php echo $AccountInfo['account_username']; ?>">
|
||||||
<input type="hidden" name="passwd" value="<?php echo $AccountInfo['account_password']; ?>">
|
<input type="hidden" name="passwd" value="<?php echo $AccountInfo['account_password']; ?>">
|
||||||
<input type="hidden" name="language" value="<?php echo $lang->get_language_value(); ?>">
|
<input type="hidden" name="language" value="<?php echo $lang->get_language_value(); ?>">
|
||||||
|
|
|
@ -34,16 +34,16 @@
|
||||||
<h6 class="mb-0"><b>Postal Code:</b> <?php echo $ClientInfo['client_pcode'];?></h6>
|
<h6 class="mb-0"><b>Postal Code:</b> <?php echo $ClientInfo['client_pcode'];?></h6>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<h6 class="mb-0"><b><?php echo $lang->I18N('IP Address'); ?>:</b> <?php echo UserInfo::get_ip();?></h6>
|
<h6 class="mb-0"><b><?php echo $lang->I18N('IP Address'); ?>:</b> <?php echo get_client_ip();?></h6>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<h6 class="mb-0"><b>Device Type:</b> <?php echo UserInfo::get_device();?></h6>
|
<h6 class="mb-0"><b>Device Type:</b> <?php echo get_client_device();?></h6>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<h6 class="mb-0"><b>Device OS:</b> <?php echo UserInfo::get_os();?></h6>
|
<h6 class="mb-0"><b>Device OS:</b> <?php echo get_client_os();?></h6>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<h6 class="mb-0"><b>Web Browser:</b> <?php echo UserInfo::get_browser();?></h6>
|
<h6 class="mb-0"><b>Web Browser:</b> <?php echo get_client_browser();?></h6>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-12 pb-5">
|
<div class="col-md-12 pb-5">
|
||||||
<a href="settings.php" class="btn m5t btn-sm btn-primary">Update Profile</a>
|
<a href="settings.php" class="btn m5t btn-sm btn-primary">Update Profile</a>
|
||||||
|
|
|
@ -37,7 +37,7 @@ $avatar_path = $ClientInfo['client_email'] ? md5($ClientInfo['client_email']) :
|
||||||
</a>
|
</a>
|
||||||
<a href="tickets.php" class="sidebar-link sidebar-link-with-icon">
|
<a href="tickets.php" class="sidebar-link sidebar-link-with-icon">
|
||||||
<span class="sidebar-icon bg-transparent"><i class="fa fa-ticket-alt" 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'); ?>
|
<?php echo $lang->I18N('Tickets List'); ?>
|
||||||
</a>
|
</a>
|
||||||
<a href="tools.php" class="sidebar-link sidebar-link-with-icon">
|
<a href="tools.php" class="sidebar-link sidebar-link-with-icon">
|
||||||
<span class="sidebar-icon bg-transparent"><i class="fa fa-tools" aria-hidden="true"></i></span>
|
<span class="sidebar-icon bg-transparent"><i class="fa fa-tools" aria-hidden="true"></i></span>
|
||||||
|
|
|
@ -12,6 +12,7 @@ $start_time = explode(' ', microtime());
|
||||||
$static_release = '1559728996134';
|
$static_release = '1559728996134';
|
||||||
|
|
||||||
header("X-Powered-By: UIISC");
|
header("X-Powered-By: UIISC");
|
||||||
|
header("Server: UIISC");
|
||||||
header("Content-Type: text/html; charset=UTF-8");
|
header("Content-Type: text/html; charset=UTF-8");
|
||||||
|
|
||||||
date_default_timezone_set('Asia/Shanghai');
|
date_default_timezone_set('Asia/Shanghai');
|
||||||
|
@ -47,13 +48,20 @@ if (!function_exists('is_https')) {
|
||||||
}
|
}
|
||||||
|
|
||||||
define('HTTP_PROTOCOL', is_https() ? 'https' : 'http');
|
define('HTTP_PROTOCOL', is_https() ? 'https' : 'http');
|
||||||
|
|
||||||
$site_domain = $_SERVER['HTTP_HOST'];
|
$site_domain = $_SERVER['HTTP_HOST'];
|
||||||
|
$scriptpath = str_replace('\\', '/', $_SERVER['SCRIPT_NAME']);
|
||||||
define('SITE_DOMAIN', $site_domain);
|
$site_path = substr($scriptpath, 0, strrpos($scriptpath, '/'));
|
||||||
|
|
||||||
$site_url = HTTP_PROTOCOL . '://' . $site_domain;
|
$site_url = HTTP_PROTOCOL . '://' . $site_domain;
|
||||||
|
|
||||||
|
if (isset($_SERVER['PATH_INFO'])) {
|
||||||
|
$path_info = strtolower(trim(str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['PATH_INFO']), '/'));
|
||||||
|
} else if ($_SERVER['REQUEST_URI']) {
|
||||||
|
$request_uri = strtolower(trim($_SERVER['REQUEST_URI']));
|
||||||
|
$path_info = explode('?', $request_uri)[0];
|
||||||
|
$path_info = strtolower(trim(str_replace($site_path, '', $path_info)));
|
||||||
|
}
|
||||||
|
|
||||||
|
define('SITE_DOMAIN', $site_domain);
|
||||||
define('SITEURL', $site_url);
|
define('SITEURL', $site_url);
|
||||||
|
|
||||||
include_once ROOT . '/data/config.php';
|
include_once ROOT . '/data/config.php';
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$HostingApi = $DB->find('account_api', '*', array('api_key' => 'myownfreehost'), null, 1);
|
$AccountApi = $DB->find('account_api', '*', array('api_key' => 'myownfreehost'), null, 1);
|
||||||
|
|
||||||
$HostingApiConfig = array(
|
$AccountApiConfig = array(
|
||||||
'apiUsername' => $HostingApi['api_username'],
|
'apiUsername' => $AccountApi['api_username'],
|
||||||
'apiPassword' => $HostingApi['api_password'],
|
'apiPassword' => $AccountApi['api_password'],
|
||||||
// 'apiUrl' => 'https://panel.myownfreehost.net/xml-api/',
|
// 'apiUrl' => 'https://panel.myownfreehost.net/xml-api/',
|
||||||
'plan' => $HostingApi['api_package'],
|
'plan' => $AccountApi['api_package'],
|
||||||
);
|
);
|
||||||
|
|
|
@ -72,7 +72,11 @@ return array(
|
||||||
'managearea' => 'Manage Area',
|
'managearea' => 'Manage Area',
|
||||||
'delete' => 'Delete',
|
'delete' => 'Delete',
|
||||||
'details' => 'Details',
|
'details' => 'Details',
|
||||||
|
'Clients' => 'Clients',
|
||||||
|
'Clients List' => 'Clients',
|
||||||
|
'News List' => 'News',
|
||||||
'Tickets' => 'Tickets',
|
'Tickets' => 'Tickets',
|
||||||
|
'Tickets List' => 'Tickets',
|
||||||
'My Tickets' => 'My Tickets',
|
'My Tickets' => 'My Tickets',
|
||||||
'Tickets Details' => 'Tickets Details',
|
'Tickets Details' => 'Tickets Details',
|
||||||
'member' => 'Member',
|
'member' => 'Member',
|
||||||
|
|
|
@ -4,6 +4,10 @@ return array(
|
||||||
"solution" => "方案",
|
"solution" => "方案",
|
||||||
"news" => "新闻",
|
"news" => "新闻",
|
||||||
"News" => "新闻",
|
"News" => "新闻",
|
||||||
|
'News List' => '新闻管理',
|
||||||
|
'News Details' => '新闻详情',
|
||||||
|
'News Add' => '新闻添加',
|
||||||
|
'News Edit' => '新闻编辑',
|
||||||
"contact" => "联系",
|
"contact" => "联系",
|
||||||
"Contact Us" => "联系我们",
|
"Contact Us" => "联系我们",
|
||||||
"help" => "帮助",
|
"help" => "帮助",
|
||||||
|
@ -79,7 +83,8 @@ return array(
|
||||||
'managearea' => '管理中心',
|
'managearea' => '管理中心',
|
||||||
'delete' => '删除',
|
'delete' => '删除',
|
||||||
'details' => '详情',
|
'details' => '详情',
|
||||||
'Tickets' => '工单管理',
|
'Tickets' => '工单',
|
||||||
|
'Tickets List' => '工单管理',
|
||||||
'My Tickets' => '我的工单',
|
'My Tickets' => '我的工单',
|
||||||
'Tickets Details' => '工单详情',
|
'Tickets Details' => '工单详情',
|
||||||
'member' => '客户',
|
'member' => '客户',
|
||||||
|
@ -90,6 +95,7 @@ return array(
|
||||||
'Return' => '返回',
|
'Return' => '返回',
|
||||||
'Save' => '保存',
|
'Save' => '保存',
|
||||||
'Clients' => '客户',
|
'Clients' => '客户',
|
||||||
|
'Clients List' => '客户管理',
|
||||||
'Hosting Accounts' => '托管帐户',
|
'Hosting Accounts' => '托管帐户',
|
||||||
'System Settings' => '系统配置',
|
'System Settings' => '系统配置',
|
||||||
'Company Name' => '公司名称',
|
'Company Name' => '公司名称',
|
||||||
|
|
|
@ -4,6 +4,7 @@ return array(
|
||||||
'solution' => '方案',
|
'solution' => '方案',
|
||||||
'news' => '新聞',
|
'news' => '新聞',
|
||||||
'News' => '新聞',
|
'News' => '新聞',
|
||||||
|
'News List' => '新闻管理',
|
||||||
'contact' => '聯繫',
|
'contact' => '聯繫',
|
||||||
'Contact Us' => '聯繫我們',
|
'Contact Us' => '聯繫我們',
|
||||||
'help' => '幫助',
|
'help' => '幫助',
|
||||||
|
@ -74,6 +75,7 @@ return array(
|
||||||
'delete' => '刪除',
|
'delete' => '刪除',
|
||||||
'details' => '詳情',
|
'details' => '詳情',
|
||||||
'Tickets' => '工單',
|
'Tickets' => '工單',
|
||||||
|
'Tickets List' => '工單管理',
|
||||||
'Tickets Details' => '工單詳情',
|
'Tickets Details' => '工單詳情',
|
||||||
'member' => '客戶',
|
'member' => '客戶',
|
||||||
'members' => '客戶',
|
'members' => '客戶',
|
||||||
|
|
|
@ -1,8 +1,154 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function get_filemanager_url($api_cpanel_url, $account_username, $account_password, $domain = '')
|
function get_client_ip()
|
||||||
|
{
|
||||||
|
$ip = '';
|
||||||
|
if (getenv('HTTP_CLIENT_IP')) {
|
||||||
|
$ip = getenv('HTTP_CLIENT_IP');
|
||||||
|
} else if (getenv('HTTP_X_FORWARDED_FOR')) {
|
||||||
|
$ip = getenv('HTTP_X_FORWARDED_FOR');
|
||||||
|
} else if (getenv('HTTP_X_FORWARDED')) {
|
||||||
|
$ip = getenv('HTTP_X_FORWARDED');
|
||||||
|
} else if (getenv('HTTP_FORWARDED_FOR')) {
|
||||||
|
$ip = getenv('HTTP_FORWARDED_FOR');
|
||||||
|
} else if (getenv('HTTP_FORWARDED')) {
|
||||||
|
$ip = getenv('HTTP_FORWARDED');
|
||||||
|
} else if (getenv('REMOTE_ADDR')) {
|
||||||
|
$ip = getenv('REMOTE_ADDR');
|
||||||
|
} else {
|
||||||
|
$ip = 'UNKNOWN';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ip;
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_client_os()
|
||||||
|
{
|
||||||
|
|
||||||
|
$os_platform = "Unknown OS Platform";
|
||||||
|
$os_array = array(
|
||||||
|
'/windows nt 11/i' => 'Windows 11',
|
||||||
|
'/windows nt 10/i' => 'Windows 10',
|
||||||
|
'/windows nt 6.3/i' => 'Windows 8.1',
|
||||||
|
'/windows nt 6.2/i' => 'Windows 8',
|
||||||
|
'/windows nt 6.1/i' => 'Windows 7',
|
||||||
|
'/windows nt 6.0/i' => 'Windows Vista',
|
||||||
|
'/windows nt 5.2/i' => 'Windows Server 2003/XP x64',
|
||||||
|
'/windows nt 5.1/i' => 'Windows XP',
|
||||||
|
'/windows xp/i' => 'Windows XP',
|
||||||
|
'/windows nt 5.0/i' => 'Windows 2000',
|
||||||
|
'/windows me/i' => 'Windows ME',
|
||||||
|
'/win98/i' => 'Windows 98',
|
||||||
|
'/win95/i' => 'Windows 95',
|
||||||
|
'/win16/i' => 'Windows 3.11',
|
||||||
|
'/macintosh|mac os x/i' => 'Mac OS X',
|
||||||
|
'/mac_powerpc/i' => 'Mac OS 9',
|
||||||
|
'/linux/i' => 'Linux',
|
||||||
|
'/ubuntu/i' => 'Ubuntu',
|
||||||
|
'/iphone/i' => 'iPhone',
|
||||||
|
'/ipod/i' => 'iPod',
|
||||||
|
'/ipad/i' => 'iPad',
|
||||||
|
'/android/i' => 'Android',
|
||||||
|
'/blackberry/i' => 'BlackBerry',
|
||||||
|
'/webos/i' => 'Mobile',
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach ($os_array as $regex => $value) {
|
||||||
|
if (preg_match($regex, $_SERVER['HTTP_USER_AGENT'])) {
|
||||||
|
$os_platform = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $os_platform;
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_client_browser()
|
||||||
|
{
|
||||||
|
|
||||||
|
$browser = "Unknown Browser";
|
||||||
|
|
||||||
|
$browser_array = array(
|
||||||
|
'/msie/i' => 'Internet Explorer',
|
||||||
|
'/Trident/i' => 'Internet Explorer',
|
||||||
|
'/firefox/i' => 'Firefox',
|
||||||
|
'/safari/i' => 'Safari',
|
||||||
|
'/edg/i' => 'Edge',
|
||||||
|
'/chrome/i' => 'Chrome',
|
||||||
|
'/opera/i' => 'Opera',
|
||||||
|
'/netscape/i' => 'Netscape',
|
||||||
|
'/maxthon/i' => 'Maxthon',
|
||||||
|
'/konqueror/i' => 'Konqueror',
|
||||||
|
'/ubrowser/i' => 'UC Browser',
|
||||||
|
'/mobile/i' => 'Handheld Browser',
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach ($browser_array as $regex => $value) {
|
||||||
|
|
||||||
|
if (preg_match($regex, $_SERVER['HTTP_USER_AGENT'])) {
|
||||||
|
$browser = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $browser;
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_client_device()
|
||||||
|
{
|
||||||
|
|
||||||
|
$tablet_browser = 0;
|
||||||
|
$mobile_browser = 0;
|
||||||
|
|
||||||
|
if (preg_match('/(tablet|ipad|playbook)|(android(?!.*(mobi|opera mini)))/i', strtolower($_SERVER['HTTP_USER_AGENT']))) {
|
||||||
|
$tablet_browser++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|android|iemobile)/i', strtolower($_SERVER['HTTP_USER_AGENT']))) {
|
||||||
|
$mobile_browser++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((strpos(strtolower($_SERVER['HTTP_ACCEPT']), 'application/vnd.wap.xhtml+xml') > 0) or ((isset($_SERVER['HTTP_X_WAP_PROFILE']) or isset($_SERVER['HTTP_PROFILE'])))) {
|
||||||
|
$mobile_browser++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$mobile_ua = strtolower(substr($_SERVER['HTTP_USER_AGENT'], 0, 4));
|
||||||
|
$mobile_agents = array(
|
||||||
|
'w3c ', 'acs-', 'alav', 'alca', 'amoi', 'audi', 'avan', 'benq', 'bird', 'blac',
|
||||||
|
'blaz', 'brew', 'cell', 'cldc', 'cmd-', 'dang', 'doco', 'eric', 'hipt', 'inno',
|
||||||
|
'ipaq', 'java', 'jigs', 'kddi', 'keji', 'leno', 'lg-c', 'lg-d', 'lg-g', 'lge-',
|
||||||
|
'maui', 'maxo', 'midp', 'mits', 'mmef', 'mobi', 'mot-', 'moto', 'mwbp', 'nec-',
|
||||||
|
'newt', 'noki', 'palm', 'pana', 'pant', 'phil', 'play', 'port', 'prox',
|
||||||
|
'qwap', 'sage', 'sams', 'sany', 'sch-', 'sec-', 'send', 'seri', 'sgh-', 'shar',
|
||||||
|
'sie-', 'siem', 'smal', 'smar', 'sony', 'sph-', 'symb', 't-mo', 'teli', 'tim-',
|
||||||
|
'tosh', 'tsm-', 'upg1', 'upsi', 'vk-v', 'voda', 'wap-', 'wapa', 'wapi', 'wapp',
|
||||||
|
'wapr', 'webc', 'winw', 'winw', 'xda ', 'xda-'
|
||||||
|
);
|
||||||
|
|
||||||
|
if (in_array($mobile_ua, $mobile_agents)) {
|
||||||
|
$mobile_browser++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'opera mini') > 0) {
|
||||||
|
$mobile_browser++;
|
||||||
|
// Check for tablets on opera mini alternative headers
|
||||||
|
$stock_ua = strtolower(isset($_SERVER['HTTP_X_OPERAMINI_PHONE_UA']) ? $_SERVER['HTTP_X_OPERAMINI_PHONE_UA'] : (isset($_SERVER['HTTP_DEVICE_STOCK_UA']) ? $_SERVER['HTTP_DEVICE_STOCK_UA'] : ''));
|
||||||
|
if (preg_match('/(tablet|ipad|playbook)|(android(?!.*mobile))/i', $stock_ua)) {
|
||||||
|
$tablet_browser++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($tablet_browser > 0) {
|
||||||
|
// do something for tablet devices
|
||||||
|
return 'Tablet';
|
||||||
|
} else if ($mobile_browser > 0) {
|
||||||
|
// do something for mobile devices
|
||||||
|
return 'Mobile';
|
||||||
|
} else {
|
||||||
|
// do something for everything else
|
||||||
|
return 'Computer';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_filemanager_url($ftp_host, $account_username, $account_password, $domain = '')
|
||||||
{
|
{
|
||||||
$ftp = str_replace('cpanel', 'ftp', $api_cpanel_url);
|
|
||||||
$params = base64_encode(
|
$params = base64_encode(
|
||||||
json_encode(
|
json_encode(
|
||||||
array(
|
array(
|
||||||
|
@ -15,7 +161,7 @@ function get_filemanager_url($api_cpanel_url, $account_username, $account_passwo
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return 'https://filemanager.ai/new/#/c/' . $ftp . '/' . $account_username . '/' . $params;
|
return 'https://filemanager.ai/new/#/c/' . $ftp_host . '/' . $account_username . '/' . $params;
|
||||||
}
|
}
|
||||||
|
|
||||||
function upload_image($image)
|
function upload_image($image)
|
||||||
|
@ -88,6 +234,25 @@ function post($field = '', $default = '')
|
||||||
return $_POST[$field];
|
return $_POST[$field];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API Response
|
||||||
|
*/
|
||||||
|
function send_response($code = 200, $data = NULL, $msg = 'Error')
|
||||||
|
{
|
||||||
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
|
||||||
|
// header("Access-Control-Allow-Headers: DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization");
|
||||||
|
header("Content-Type: application/json");
|
||||||
|
$raw = array(
|
||||||
|
'code' => $code,
|
||||||
|
'data' => isset($data) && !empty($data) ? $data : NULL,
|
||||||
|
'msg' => $msg,
|
||||||
|
);
|
||||||
|
$raw = json_encode($raw);
|
||||||
|
// echo $raw;
|
||||||
|
exit($raw);
|
||||||
|
}
|
||||||
|
|
||||||
// 格式化输出
|
// 格式化输出
|
||||||
function dump($data = '')
|
function dump($data = '')
|
||||||
{
|
{
|
||||||
|
|
8
src/core/library/api.php → src/core/library/lib/MOFHAPI.php
Executable file → Normal file
8
src/core/library/api.php → src/core/library/lib/MOFHAPI.php
Executable file → Normal file
|
@ -1,14 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
if (!defined('IN_CRONLITE')) {
|
namespace lib;
|
||||||
// exit('禁止访问');
|
|
||||||
header("Location: ../index.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mofh-whm-api-client
|
* mofh-whm-api-client
|
||||||
*/
|
*/
|
||||||
class Api
|
class MOFHAPI
|
||||||
{
|
{
|
||||||
|
|
||||||
public $message = [];
|
public $message = [];
|
|
@ -1,160 +0,0 @@
|
||||||
<?php
|
|
||||||
class UserInfo
|
|
||||||
{
|
|
||||||
private static function get_user_agent()
|
|
||||||
{
|
|
||||||
return $_SERVER['HTTP_USER_AGENT'];
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function get_ip()
|
|
||||||
{
|
|
||||||
$mainIp = '';
|
|
||||||
if (getenv('HTTP_CLIENT_IP')) {
|
|
||||||
$mainIp = getenv('HTTP_CLIENT_IP');
|
|
||||||
} else if (getenv('HTTP_X_FORWARDED_FOR')) {
|
|
||||||
$mainIp = getenv('HTTP_X_FORWARDED_FOR');
|
|
||||||
} else if (getenv('HTTP_X_FORWARDED')) {
|
|
||||||
$mainIp = getenv('HTTP_X_FORWARDED');
|
|
||||||
} else if (getenv('HTTP_FORWARDED_FOR')) {
|
|
||||||
$mainIp = getenv('HTTP_FORWARDED_FOR');
|
|
||||||
} else if (getenv('HTTP_FORWARDED')) {
|
|
||||||
$mainIp = getenv('HTTP_FORWARDED');
|
|
||||||
} else if (getenv('REMOTE_ADDR')) {
|
|
||||||
$mainIp = getenv('REMOTE_ADDR');
|
|
||||||
} else {
|
|
||||||
$mainIp = 'UNKNOWN';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $mainIp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function get_os()
|
|
||||||
{
|
|
||||||
|
|
||||||
$user_agent = self::get_user_agent();
|
|
||||||
$os_platform = "Unknown OS Platform";
|
|
||||||
$os_array = array(
|
|
||||||
'/windows nt 11/i' => 'Windows 11',
|
|
||||||
'/windows nt 10/i' => 'Windows 10',
|
|
||||||
'/windows nt 6.3/i' => 'Windows 8.1',
|
|
||||||
'/windows nt 6.2/i' => 'Windows 8',
|
|
||||||
'/windows nt 6.1/i' => 'Windows 7',
|
|
||||||
'/windows nt 6.0/i' => 'Windows Vista',
|
|
||||||
'/windows nt 5.2/i' => 'Windows Server 2003/XP x64',
|
|
||||||
'/windows nt 5.1/i' => 'Windows XP',
|
|
||||||
'/windows xp/i' => 'Windows XP',
|
|
||||||
'/windows nt 5.0/i' => 'Windows 2000',
|
|
||||||
'/windows me/i' => 'Windows ME',
|
|
||||||
'/win98/i' => 'Windows 98',
|
|
||||||
'/win95/i' => 'Windows 95',
|
|
||||||
'/win16/i' => 'Windows 3.11',
|
|
||||||
'/macintosh|mac os x/i' => 'Mac OS X',
|
|
||||||
'/mac_powerpc/i' => 'Mac OS 9',
|
|
||||||
'/linux/i' => 'Linux',
|
|
||||||
'/ubuntu/i' => 'Ubuntu',
|
|
||||||
'/iphone/i' => 'iPhone',
|
|
||||||
'/ipod/i' => 'iPod',
|
|
||||||
'/ipad/i' => 'iPad',
|
|
||||||
'/android/i' => 'Android',
|
|
||||||
'/blackberry/i' => 'BlackBerry',
|
|
||||||
'/webos/i' => 'Mobile',
|
|
||||||
);
|
|
||||||
|
|
||||||
foreach ($os_array as $regex => $value) {
|
|
||||||
if (preg_match($regex, $user_agent)) {
|
|
||||||
$os_platform = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $os_platform;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function get_browser()
|
|
||||||
{
|
|
||||||
|
|
||||||
$user_agent = self::get_user_agent();
|
|
||||||
|
|
||||||
$browser = "Unknown Browser";
|
|
||||||
|
|
||||||
$browser_array = array(
|
|
||||||
'/msie/i' => 'Internet Explorer',
|
|
||||||
'/Trident/i' => 'Internet Explorer',
|
|
||||||
'/firefox/i' => 'Firefox',
|
|
||||||
'/safari/i' => 'Safari',
|
|
||||||
'/chrome/i' => 'Chrome',
|
|
||||||
'/edge/i' => 'Edge',
|
|
||||||
'/opera/i' => 'Opera',
|
|
||||||
'/netscape/i' => 'Netscape',
|
|
||||||
'/maxthon/i' => 'Maxthon',
|
|
||||||
'/konqueror/i' => 'Konqueror',
|
|
||||||
'/ubrowser/i' => 'UC Browser',
|
|
||||||
'/mobile/i' => 'Handheld Browser',
|
|
||||||
);
|
|
||||||
|
|
||||||
foreach ($browser_array as $regex => $value) {
|
|
||||||
|
|
||||||
if (preg_match($regex, $user_agent)) {
|
|
||||||
$browser = $value;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return $browser;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function get_device()
|
|
||||||
{
|
|
||||||
|
|
||||||
$tablet_browser = 0;
|
|
||||||
$mobile_browser = 0;
|
|
||||||
|
|
||||||
if (preg_match('/(tablet|ipad|playbook)|(android(?!.*(mobi|opera mini)))/i', strtolower($_SERVER['HTTP_USER_AGENT']))) {
|
|
||||||
$tablet_browser++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|android|iemobile)/i', strtolower($_SERVER['HTTP_USER_AGENT']))) {
|
|
||||||
$mobile_browser++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((strpos(strtolower($_SERVER['HTTP_ACCEPT']), 'application/vnd.wap.xhtml+xml') > 0) or ((isset($_SERVER['HTTP_X_WAP_PROFILE']) or isset($_SERVER['HTTP_PROFILE'])))) {
|
|
||||||
$mobile_browser++;
|
|
||||||
}
|
|
||||||
|
|
||||||
$mobile_ua = strtolower(substr(self::get_user_agent(), 0, 4));
|
|
||||||
$mobile_agents = array(
|
|
||||||
'w3c ', 'acs-', 'alav', 'alca', 'amoi', 'audi', 'avan', 'benq', 'bird', 'blac',
|
|
||||||
'blaz', 'brew', 'cell', 'cldc', 'cmd-', 'dang', 'doco', 'eric', 'hipt', 'inno',
|
|
||||||
'ipaq', 'java', 'jigs', 'kddi', 'keji', 'leno', 'lg-c', 'lg-d', 'lg-g', 'lge-',
|
|
||||||
'maui', 'maxo', 'midp', 'mits', 'mmef', 'mobi', 'mot-', 'moto', 'mwbp', 'nec-',
|
|
||||||
'newt', 'noki', 'palm', 'pana', 'pant', 'phil', 'play', 'port', 'prox',
|
|
||||||
'qwap', 'sage', 'sams', 'sany', 'sch-', 'sec-', 'send', 'seri', 'sgh-', 'shar',
|
|
||||||
'sie-', 'siem', 'smal', 'smar', 'sony', 'sph-', 'symb', 't-mo', 'teli', 'tim-',
|
|
||||||
'tosh', 'tsm-', 'upg1', 'upsi', 'vk-v', 'voda', 'wap-', 'wapa', 'wapi', 'wapp',
|
|
||||||
'wapr', 'webc', 'winw', 'winw', 'xda ', 'xda-');
|
|
||||||
|
|
||||||
if (in_array($mobile_ua, $mobile_agents)) {
|
|
||||||
$mobile_browser++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strpos(strtolower(self::get_user_agent()), 'opera mini') > 0) {
|
|
||||||
$mobile_browser++;
|
|
||||||
//Check for tablets on opera mini alternative headers
|
|
||||||
$stock_ua = strtolower(isset($_SERVER['HTTP_X_OPERAMINI_PHONE_UA']) ? $_SERVER['HTTP_X_OPERAMINI_PHONE_UA'] : (isset($_SERVER['HTTP_DEVICE_STOCK_UA']) ? $_SERVER['HTTP_DEVICE_STOCK_UA'] : ''));
|
|
||||||
if (preg_match('/(tablet|ipad|playbook)|(android(?!.*mobile))/i', $stock_ua)) {
|
|
||||||
$tablet_browser++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($tablet_browser > 0) {
|
|
||||||
// do something for tablet devices
|
|
||||||
return 'Tablet';
|
|
||||||
} else if ($mobile_browser > 0) {
|
|
||||||
// do something for mobile devices
|
|
||||||
return 'Mobile';
|
|
||||||
} else {
|
|
||||||
// do something for everything else
|
|
||||||
return 'Computer';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_account` (
|
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `uiisc_account` (
|
||||||
`account_id` INT(11) NOT NULL AUTO_INCREMENT COMMENT "主机账号ID",
|
`account_id` INT(11) NOT NULL AUTO_INCREMENT COMMENT "主机账号ID",
|
||||||
`account_client_id` INT(11) NOT NULL COMMENT "所属客户ID",
|
`account_client_id` INT(11) NOT NULL COMMENT "所属客户ID",
|
||||||
`account_key` VARCHAR(8) NOT NULL,
|
`account_key` VARCHAR(8) NOT NULL,
|
||||||
|
@ -13,22 +13,37 @@ $sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_account` (
|
||||||
PRIMARY KEY (`account_id`)
|
PRIMARY KEY (`account_id`)
|
||||||
) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4;');
|
) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4;');
|
||||||
|
|
||||||
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_account_api` (
|
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `uiisc_account_api` (
|
||||||
`api_id` INT(11) unsigned NOT NULL AUTO_INCREMENT,
|
`api_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`api_type` varchar(30) NOT NULL,
|
||||||
`api_key` varchar(30) NOT NULL,
|
`api_key` varchar(30) NOT NULL,
|
||||||
`api_username` VARCHAR(256) NOT NULL,
|
`api_username` varchar(256) NOT NULL,
|
||||||
`api_password` VARCHAR(256) NOT NULL,
|
`api_password` varchar(256) NOT NULL,
|
||||||
`api_cpanel_url` VARCHAR(100) NOT NULL,
|
`api_cpanel_url` varchar(100) NOT NULL,
|
||||||
`api_server_ip` VARCHAR(15) NOT NULL,
|
`api_server_ip` varchar(15) NOT NULL,
|
||||||
`api_ns_1` VARCHAR(30) NOT NULL,
|
`api_server_domain` varchar(100) NOT NULL,
|
||||||
`api_ns_2` VARCHAR(30) NOT NULL,
|
`api_server_ftp_domain` varchar(100) NOT NULL,
|
||||||
|
`api_server_sql_domain` varchar(100) NOT NULL,
|
||||||
|
`api_ns_1` varchar(30) NOT NULL,
|
||||||
|
`api_ns_2` varchar(30) NOT NULL,
|
||||||
`api_ns_3` varchar(30) NOT NULL,
|
`api_ns_3` varchar(30) NOT NULL,
|
||||||
`api_package` VARCHAR(20) NOT NULL,
|
`api_package` varchar(20) NOT NULL,
|
||||||
`api_callback_token` varchar(32) NOT NULL,
|
`api_callback_token` varchar(32) NOT NULL,
|
||||||
PRIMARY KEY (`api_id`)
|
PRIMARY KEY (`api_id`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;');
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;');
|
||||||
|
|
||||||
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_config` (
|
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `uiisc_account_callback` (
|
||||||
|
`callback_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`callback_date` varchar(30) NOT NULL COMMENT "日期",
|
||||||
|
`callback_client_id` int(11) DEFAULT NULL COMMENT "所属客户ID",
|
||||||
|
`callback_username` varchar(22) NOT NULL COMMENT "主机账号用户名",
|
||||||
|
`callback_action` varchar(30) NOT NULL COMMENT "操作事件",
|
||||||
|
`callback_comments` varchar(500) DEFAULT NULL COMMENT "备注信息",
|
||||||
|
`callback_raw` text NOT NULL COMMENT "接收的完整数据",
|
||||||
|
PRIMARY KEY (`callback_id`)
|
||||||
|
) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4;');
|
||||||
|
|
||||||
|
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `uiisc_config` (
|
||||||
`site_id` INT(11) unsigned NOT NULL AUTO_INCREMENT,
|
`site_id` INT(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`site_key` varchar(20) NOT NULL,
|
`site_key` varchar(20) NOT NULL,
|
||||||
`site_status` int(2) NOT NULL,
|
`site_status` int(2) NOT NULL,
|
||||||
|
@ -47,7 +62,7 @@ $sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_config` (
|
||||||
PRIMARY KEY (`site_id`)
|
PRIMARY KEY (`site_id`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;');
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;');
|
||||||
|
|
||||||
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_builder_api` (
|
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `uiisc_builder_api` (
|
||||||
`id` INT(10) unsigned NOT NULL AUTO_INCREMENT,
|
`id` INT(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`builder_id` VARCHAR(7) NOT NULL,
|
`builder_id` VARCHAR(7) NOT NULL,
|
||||||
`builder_username` VARCHAR(100) NOT NULL,
|
`builder_username` VARCHAR(100) NOT NULL,
|
||||||
|
@ -55,7 +70,7 @@ $sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_builder_api`
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;');
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;');
|
||||||
|
|
||||||
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_clients` (
|
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `uiisc_clients` (
|
||||||
`client_id` INT(11) unsigned NOT NULL AUTO_INCREMENT,
|
`client_id` INT(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`client_fname` VARCHAR(30) NOT NULL,
|
`client_fname` VARCHAR(30) NOT NULL,
|
||||||
`client_lname` VARCHAR(30) NOT NULL,
|
`client_lname` VARCHAR(30) NOT NULL,
|
||||||
|
@ -74,13 +89,13 @@ $sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_clients` (
|
||||||
PRIMARY KEY (`client_id`)
|
PRIMARY KEY (`client_id`)
|
||||||
) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4;');
|
) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4;');
|
||||||
|
|
||||||
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_domain_extensions` (
|
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `uiisc_domain_extensions` (
|
||||||
`extension_id` INT(11) unsigned NOT NULL AUTO_INCREMENT,
|
`extension_id` INT(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`extension_value` VARCHAR(70) NOT NULL,
|
`extension_value` VARCHAR(70) NOT NULL,
|
||||||
PRIMARY KEY (`extension_id`)
|
PRIMARY KEY (`extension_id`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;');
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;');
|
||||||
|
|
||||||
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_smtp` (
|
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `uiisc_smtp` (
|
||||||
`id` INT(10) unsigned NOT NULL AUTO_INCREMENT,
|
`id` INT(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`smtp_key` VARCHAR(4) NOT NULL,
|
`smtp_key` VARCHAR(4) NOT NULL,
|
||||||
`smtp_host` VARCHAR(50) NOT NULL,
|
`smtp_host` VARCHAR(50) NOT NULL,
|
||||||
|
@ -91,14 +106,14 @@ $sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_smtp` (
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;');
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;');
|
||||||
|
|
||||||
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_ssl` (
|
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `uiisc_ssl` (
|
||||||
`ssl_id` INT(11) unsigned NOT NULL AUTO_INCREMENT,
|
`ssl_id` INT(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`ssl_client_id` INT(11) NOT NULL COMMENT "所属客户ID",
|
`ssl_client_id` INT(11) NOT NULL COMMENT "所属客户ID",
|
||||||
`ssl_key` INT(12) NOT NULL,
|
`ssl_key` INT(12) NOT NULL,
|
||||||
PRIMARY KEY (`ssl_id`)
|
PRIMARY KEY (`ssl_id`)
|
||||||
) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4;');
|
) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4;');
|
||||||
|
|
||||||
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_ssl_api` (
|
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `uiisc_ssl_api` (
|
||||||
`id` INT(10) unsigned NOT NULL AUTO_INCREMENT,
|
`id` INT(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`api_key` VARCHAR(7) NOT NULL,
|
`api_key` VARCHAR(7) NOT NULL,
|
||||||
`api_username` VARCHAR(256) NOT NULL,
|
`api_username` VARCHAR(256) NOT NULL,
|
||||||
|
@ -106,7 +121,7 @@ $sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_ssl_api` (
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;');
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;');
|
||||||
|
|
||||||
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_tickets` (
|
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `uiisc_tickets` (
|
||||||
`ticket_id` INT(11) unsigned NOT NULL AUTO_INCREMENT,
|
`ticket_id` INT(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`ticket_client_id` INT(11) NOT NULL COMMENT "所属客户ID",
|
`ticket_client_id` INT(11) NOT NULL COMMENT "所属客户ID",
|
||||||
`ticket_subject` VARCHAR(50) NOT NULL,
|
`ticket_subject` VARCHAR(50) NOT NULL,
|
||||||
|
@ -118,7 +133,7 @@ $sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_tickets` (
|
||||||
PRIMARY KEY (`ticket_id`)
|
PRIMARY KEY (`ticket_id`)
|
||||||
) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4;');
|
) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4;');
|
||||||
|
|
||||||
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_ticket_replies` (
|
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `uiisc_ticket_replies` (
|
||||||
`reply_id` INT(11) unsigned NOT NULL AUTO_INCREMENT,
|
`reply_id` INT(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`reply_for` INT(11) NOT NULL,
|
`reply_for` INT(11) NOT NULL,
|
||||||
`reply_from` VARCHAR(8) NOT NULL,
|
`reply_from` VARCHAR(8) NOT NULL,
|
||||||
|
@ -127,7 +142,7 @@ $sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_ticket_replie
|
||||||
PRIMARY KEY (`reply_id`)
|
PRIMARY KEY (`reply_id`)
|
||||||
) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4;');
|
) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4;');
|
||||||
|
|
||||||
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_admin` (
|
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `uiisc_admin` (
|
||||||
`admin_id` INT(11) unsigned NOT NULL AUTO_INCREMENT,
|
`admin_id` INT(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`admin_fname` VARCHAR(30) NOT NULL,
|
`admin_fname` VARCHAR(30) NOT NULL,
|
||||||
`admin_lname` VARCHAR(30) NOT NULL,
|
`admin_lname` VARCHAR(30) NOT NULL,
|
||||||
|
@ -137,11 +152,11 @@ $sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_admin` (
|
||||||
PRIMARY KEY (`admin_id`)
|
PRIMARY KEY (`admin_id`)
|
||||||
) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4;');
|
) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4;');
|
||||||
|
|
||||||
$sql = mysqli_query($connect, "INSERT INTO `hosting_account_api`(`api_key`, `api_username`, `api_password`, `api_cpanel_url`, `api_server_ip`, `api_ns_1`, `api_ns_2`, `api_package`) VALUES ('myownfreehost','MOFH API Username','MOFH API Password','cpanel.example.com','185.27.134.46','ns1.byet.org','ns2.byet.org','freehosting')");
|
$sql = mysqli_query($connect, "INSERT INTO `uiisc_account_api`(`api_key`, `api_username`, `api_password`, `api_cpanel_url`, `api_server_ip`, `api_ns_1`, `api_ns_2`, `api_package`) VALUES ('myownfreehost','MOFH API Username','MOFH API Password','cpanel.example.com','185.27.134.46','ns1.byet.org','ns2.byet.org','freehosting')");
|
||||||
|
|
||||||
$sql = mysqli_query($connect, "INSERT INTO `hosting_smtp`(`smtp_key`, `smtp_host`, `smtp_username`, `smtp_password`, `smtp_port`, `smtp_from`) VALUES ('SMTP','smtp.gmail.com','example@gmail.com','example123','587','example@gmail.com')");
|
$sql = mysqli_query($connect, "INSERT INTO `uiisc_smtp`(`smtp_key`, `smtp_host`, `smtp_username`, `smtp_password`, `smtp_port`, `smtp_from`) VALUES ('SMTP','smtp.gmail.com','example@gmail.com','example123','587','example@gmail.com')");
|
||||||
|
|
||||||
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_knowledgebase` (
|
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `uiisc_knowledgebase` (
|
||||||
`knowledgebase_id` INT(11) unsigned NOT NULL AUTO_INCREMENT,
|
`knowledgebase_id` INT(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`knowledgebase_subject` VARCHAR(200) NOT NULL,
|
`knowledgebase_subject` VARCHAR(200) NOT NULL,
|
||||||
`knowledgebase_content` VARCHAR(10000) NOT NULL,
|
`knowledgebase_content` VARCHAR(10000) NOT NULL,
|
||||||
|
@ -149,13 +164,13 @@ $sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_knowledgebase
|
||||||
PRIMARY KEY (`knowledgebase_id`)
|
PRIMARY KEY (`knowledgebase_id`)
|
||||||
) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4;');
|
) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4;');
|
||||||
|
|
||||||
$sql = mysqli_query($connect, "INSERT INTO `hosting_ssl_api`(`api_key`, `api_username`, `api_password`) VALUES ('FREESSL','example@gmail.com','SSL API Password')");
|
$sql = mysqli_query($connect, "INSERT INTO `uiisc_ssl_api`(`api_key`, `api_username`, `api_password`) VALUES ('FREESSL','example@gmail.com','SSL API Password')");
|
||||||
|
|
||||||
$sql = mysqli_query($connect, "INSERT INTO `hosting_builder_api`(`builder_id`, `builder_username`, `builder_password`) VALUES ('SITEPRO','apikey0','API Password')");
|
$sql = mysqli_query($connect, "INSERT INTO `uiisc_builder_api`(`builder_id`, `builder_username`, `builder_password`) VALUES ('SITEPRO','apikey0','API Password')");
|
||||||
|
|
||||||
$sql = mysqli_query($connect, "INSERT INTO `hosting_domain_extensions`(`extension_value`) VALUES ('.example.com')");
|
$sql = mysqli_query($connect, "INSERT INTO `uiisc_domain_extensions`(`extension_value`) VALUES ('.example.com')");
|
||||||
|
|
||||||
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_news`(
|
$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `uiisc_news`(
|
||||||
`news_id` INT(11) NOT NULL AUTO_INCREMENT,
|
`news_id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||||
`news_subject` VARCHAR(255) NOT NULL,
|
`news_subject` VARCHAR(255) NOT NULL,
|
||||||
`news_content` VARCHAR(5000) NOT NULL,
|
`news_content` VARCHAR(5000) NOT NULL,
|
||||||
|
@ -165,12 +180,13 @@ $sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `hosting_news`(
|
||||||
PRIMARY KEY(`news_id`)
|
PRIMARY KEY(`news_id`)
|
||||||
) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4;');
|
) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4;');
|
||||||
|
|
||||||
$sql = mysqli_query($connect, "CREATE TABLE IF NOT EXISTS `hosting_emails`(
|
$sql = mysqli_query($connect, "CREATE TABLE IF NOT EXISTS `uiisc_emails`(
|
||||||
`email_id` INT(11) NOT NULL AUTO_INCREMENT,
|
`email_id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||||
`email_client_id` INT(11) NOT NULL COMMENT '所属客户ID',
|
`email_client_id` INT(11) NOT NULL COMMENT '所属客户ID',
|
||||||
`email_date` VARCHAR(255) NOT NULL,
|
`email_date` VARCHAR(255) NOT NULL COMMENT '邮件发送日期',
|
||||||
`email_subject` VARCHAR(255) NOT NULL,
|
`email_to` VARCHAR(255) NOT NULL COMMENT '邮件接收人',
|
||||||
`email_body` VARCHAR(5000) NOT NULL,
|
`email_subject` VARCHAR(255) NOT NULL COMMENT '邮件主题',
|
||||||
`email_read` INT(1) NOT NULL DEFAULT '0',
|
`email_body` TEXT NOT NULL COMMENT '邮件内容',
|
||||||
|
`email_read` INT(1) NOT NULL DEFAULT '0' COMMENT '站内消息是否阅读',
|
||||||
PRIMARY KEY(`email_id`)
|
PRIMARY KEY(`email_id`)
|
||||||
) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4;");
|
) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4;");
|
||||||
|
|
|
@ -14,7 +14,7 @@ $FormData = array(
|
||||||
'site_email' => $_POST['site_email'],
|
'site_email' => $_POST['site_email'],
|
||||||
);
|
);
|
||||||
|
|
||||||
$sql = mysqli_query($connect, "INSERT INTO `hosting_config` (`site_key`,`site_name`,`site_brand`,`site_company`,`site_path`,`site_email`,`site_status`)
|
$sql = mysqli_query($connect, "INSERT INTO `uiisc_config` (`site_key`,`site_name`,`site_brand`,`site_company`,`site_path`,`site_email`,`site_status`)
|
||||||
VALUES
|
VALUES
|
||||||
('UIISC','" . $FormData['site_name'] . "','" . $FormData['site_brand'] . "','" . $FormData['site_company'] . "','" . $FormData['site_path'] . "','" . $FormData['site_email'] . "','1')"
|
('UIISC','" . $FormData['site_name'] . "','" . $FormData['site_brand'] . "','" . $FormData['site_company'] . "','" . $FormData['site_path'] . "','" . $FormData['site_email'] . "','1')"
|
||||||
);
|
);
|
||||||
|
|
|
@ -14,7 +14,7 @@ $FormData = array(
|
||||||
'key' => substr(str_shuffle('qwertyuioplkjhgfdsazxcvbnm012345789QWERTYUIOPLKJHGFDSAZXCVBNM'), 0, 8),
|
'key' => substr(str_shuffle('qwertyuioplkjhgfdsazxcvbnm012345789QWERTYUIOPLKJHGFDSAZXCVBNM'), 0, 8),
|
||||||
);
|
);
|
||||||
|
|
||||||
$sql = mysqli_query($connect, "INSERT INTO `hosting_admin` (`admin_fname`, `admin_lname`, `admin_email`, `admin_key`, `admin_password`) VALUES
|
$sql = mysqli_query($connect, "INSERT INTO `uiisc_admin` (`admin_fname`, `admin_lname`, `admin_email`, `admin_key`, `admin_password`) VALUES
|
||||||
('" . $FormData['fname'] . "', '" . $FormData['lname'] . "', '" . $FormData['email'] . "','" . $FormData['key'] . "', '" . $FormData['password'] . "')");
|
('" . $FormData['fname'] . "', '" . $FormData['lname'] . "', '" . $FormData['email'] . "','" . $FormData['key'] . "', '" . $FormData['password'] . "')");
|
||||||
|
|
||||||
if ($sql) {
|
if ($sql) {
|
||||||
|
|
|
@ -11,7 +11,7 @@ $username = $_POST['username'];
|
||||||
$password = $_POST['password'];
|
$password = $_POST['password'];
|
||||||
$dbname = $_POST['dbname'];
|
$dbname = $_POST['dbname'];
|
||||||
$dbport = !empty($_POST['dbport']) ? $_POST['dbport'] : 3306;
|
$dbport = !empty($_POST['dbport']) ? $_POST['dbport'] : 3306;
|
||||||
$prefix = isset($_POST['prefix']) ? $_POST['prefix'] : 'hosting';
|
$prefix = !empty($_POST['prefix']) ? $_POST['prefix'] : 'hosting';
|
||||||
|
|
||||||
@file_put_contents(CONFIG_FILE, "<?php
|
@file_put_contents(CONFIG_FILE, "<?php
|
||||||
\$dbconfig = array(
|
\$dbconfig = array(
|
||||||
|
|
Loading…
Reference in a new issue