diff --git a/src/admin/api/hosting-hostname.php b/src/admin/api/hosting-hostname.php new file mode 100755 index 0000000..05296a7 --- /dev/null +++ b/src/admin/api/hosting-hostname.php @@ -0,0 +1,75 @@ +count('account_hostname'); + $list = array(); + if ($count > 0) { + $list = $DB->findAll('account_hostname', '*', array(), '`host_id` ASC'); + } + exit(json_encode(['code' => 0, 'total' => $total, 'list' => $list])); + break; + case 'add': + $hostname = post('hostname'); + if (!$hostname) { + exit(json_encode(['code' => -1, 'msg' => '主机名不能为空 !'])); + } + $api_id = post('api_id'); + if (!$api_id) { + exit(json_encode(['code' => -1, 'msg' => '托管服务提供商不能为空 !'])); + } + + $domain = strtolower($hostname); + + if (substr($domain, 0, 1) != '.') { + $domain = '.' . $domain; + } + + $data = array( + 'api_id' => $api_id, + 'host_name' => $domain, + ); + + $has = $DB->count('account_hostname', $data); + if ($has && $has > 0) { + exit(json_encode(['code' => -1, 'msg' => 'Hostname aleady exsist !'])); + } else { + $result = $DB->insert('account_hostname', $data); + if ($result) { + exit(json_encode(['code' => 0, 'msg' => 'Hostname added successfully !'])); + } else { + exit(json_encode(['code' => -1, 'msg' => 'Something went wrong !'])); + } + } + break; + case 'delete': + $host_id = post('host_id'); + if (!$host_id) { + exit(json_encode(['code' => -1, 'msg' => '主机ID不能为空 !'])); + } + $data = array( + 'host_id' => $host_id + ); + + $has = $DB->count('account_hostname', $data); + if (!$has > 0) { + exit(json_encode(['code' => -1, 'msg' => 'Hostname not found !'])); + } else { + $result = $DB->delete('account_hostname', $data); + if ($result) { + exit(json_encode(['code' => 0, 'msg' => 'Hostname deleted successfully !'])); + } else { + exit(json_encode(['code' => -1, 'msg' => 'Something went wrong !'])); + } + } + default: + exit('{"code":-4,"msg":"No Act"}'); + break; +} diff --git a/src/admin/controllers/domain/add.php b/src/admin/controllers/domain/add.php deleted file mode 100755 index 31e5b46..0000000 --- a/src/admin/controllers/domain/add.php +++ /dev/null @@ -1,37 +0,0 @@ - $domain, -); - -$has = $DB->count('account_domaintld', $data); -if ($has && $has > 0) { - setMessage('Extension aleady exsist!', 'danger'); -} else { - $result = $DB->insert('account_domaintld', $data); - if ($result) { - setMessage('Extension added successfully!'); - } else { - setMessage('Something went' . "'" . 's wrong!', 'danger'); - } -} - -redirect('admin/domain'); diff --git a/src/admin/controllers/domain/delete.php b/src/admin/controllers/domain/delete.php deleted file mode 100755 index 8241bc3..0000000 --- a/src/admin/controllers/domain/delete.php +++ /dev/null @@ -1,38 +0,0 @@ - $extension, -); - -$count = $DB->count('account_domaintld', $data); - -if (!$count > 0) { - setMessage('Extension won' . "'" . 't exsist!', 'danger'); -} else { - $result = $DB->delete('account_domaintld', $data); - if ($result) { - setMessage('Extension deleted successfully!'); - } else { - setMessage('Something went' . "'" . 's wrong!', 'danger'); - } -} - -redirect('admin/domain'); diff --git a/src/admin/controllers/domain/list.php b/src/admin/controllers/domain/list.php deleted file mode 100755 index ec46422..0000000 --- a/src/admin/controllers/domain/list.php +++ /dev/null @@ -1,9 +0,0 @@ -count('account_domaintld'); - -if ($count > 0) { - $rows = $DB->findAll('account_domaintld', '*', array(), '`extension_id` ASC'); -} diff --git a/src/admin/controllers/hosting-hostname/list.php b/src/admin/controllers/hosting-hostname/list.php new file mode 100755 index 0000000..c689a9f --- /dev/null +++ b/src/admin/controllers/hosting-hostname/list.php @@ -0,0 +1,17 @@ +I18N('Hosting Hostname'); + +$api_id = get('id'); +$where = array(); +if ($api_id > 0) { + $has = $DB->find('account_api', 'api_id', array('api_id' => $api_id), null, 1); + if ($has) { + $where = array('api_id' => $api_id); + } +} + +$count = $DB->count('account_hostname', $where); +if ($count > 0) { + $rows = $DB->findAll('account_hostname', '*', $where, '`host_id` ASC'); +} diff --git a/src/admin/domain.php b/src/admin/domain-provider.php similarity index 56% rename from src/admin/domain.php rename to src/admin/domain-provider.php index 52668ab..f6c3a30 100755 --- a/src/admin/domain.php +++ b/src/admin/domain-provider.php @@ -4,15 +4,14 @@ require_once __DIR__ . '/application.php'; $action = get('action', 'list'); -if (!in_array($action, array('list', 'add', 'edit', 'view'))) { +if (!in_array($action, array('list', 'add', 'edit', 'details'))) { $action = 'list'; } $PageInfo['title'] = 'Domain Provider ' . ucfirst($action); -require __DIR__ . '/controllers/domain/' . $action . '.php'; +// require __DIR__ . '/controllers/domain-provider/' . $action . '.php'; require __DIR__ . '/views/header.php'; require __DIR__ . '/views/navbar.php'; -// require __DIR__ . '/views/sidebar.php'; -require __DIR__ . '/views/domain/' . $action . '.php'; +require __DIR__ . '/views/domain-provider/' . $action . '.php'; require __DIR__ . '/views/footer.php'; diff --git a/src/admin/hosting-hostname.php b/src/admin/hosting-hostname.php new file mode 100755 index 0000000..cf64f73 --- /dev/null +++ b/src/admin/hosting-hostname.php @@ -0,0 +1,17 @@ + +
+
+ +
+ +
+ +
+ +
+
+
\ No newline at end of file diff --git a/src/admin/views/domain/list.php b/src/admin/views/domain/list.php deleted file mode 100755 index a3768ec..0000000 --- a/src/admin/views/domain/list.php +++ /dev/null @@ -1,60 +0,0 @@ -
-
-
- -
-
-
-
- - -
-
- - -
-
-
- -
-

Registered Extensions

- - - - - - - - 0): ?> - - - - - - - - - - - - - -
IDDomainAction
# -
- - -
-
No domain found
-
-
- -
-
-
diff --git a/src/admin/views/hosting-hostname/list.php b/src/admin/views/hosting-hostname/list.php new file mode 100755 index 0000000..f7a9150 --- /dev/null +++ b/src/admin/views/hosting-hostname/list.php @@ -0,0 +1,143 @@ + + +
+
+ + +
+ +
+ + + + + + + + + 0): ?> + + + + + + + + + + + + + + +
IDI18N('Hosting Provider'); ?>I18N('Hostname'); ?>I18N('Action'); ?>
+ +
No Data Found
+
+ +
+
+
+ + diff --git a/src/admin/views/hosting-provider/details.php b/src/admin/views/hosting-provider/details.php index 8c56a0a..dbc3254 100755 --- a/src/admin/views/hosting-provider/details.php +++ b/src/admin/views/hosting-provider/details.php @@ -13,6 +13,7 @@ if (!defined('IN_CRONLITE')) {
+ I18N('Hostname'); ?> I18N('edit'); ?> diff --git a/src/admin/views/hosting-provider/list.php b/src/admin/views/hosting-provider/list.php index d619d45..3355bd0 100755 --- a/src/admin/views/hosting-provider/list.php +++ b/src/admin/views/hosting-provider/list.php @@ -22,10 +22,10 @@ if (!defined('IN_CRONLITE')) { - + - - + + 0): ?> @@ -38,6 +38,7 @@ if (!defined('IN_CRONLITE')) { diff --git a/src/admin/views/navbar.php b/src/admin/views/navbar.php index 8941042..88f431f 100755 --- a/src/admin/views/navbar.php +++ b/src/admin/views/navbar.php @@ -35,7 +35,7 @@
  • I18N('News List'); ?>
  • I18N('Hosting Provider'); ?>
  • I18N('SSL Provider'); ?>
  • -
  • I18N('Domain Provider'); ?>
  • +
  • I18N('Domain Provider'); ?>
  • I18N('System Settings'); ?>
  • diff --git a/src/admin/views/sidebar.php b/src/admin/views/sidebar.php index 3ce930f..cbfc8dd 100755 --- a/src/admin/views/sidebar.php +++ b/src/admin/views/sidebar.php @@ -49,7 +49,7 @@ $avatar_path = $AdminInfo['admin_email'] ? md5($AdminInfo['admin_email']) : 'def I18N('Hosting Provider'); ?> - + I18N('Domain Provider'); ?> diff --git a/src/assets/layer/theme/default/loading-1.gif b/src/assets/layer/theme/default/loading-1.gif new file mode 100644 index 0000000..db3a483 Binary files /dev/null and b/src/assets/layer/theme/default/loading-1.gif differ diff --git a/src/assets/layer/theme/default/loading-2.gif b/src/assets/layer/theme/default/loading-2.gif new file mode 100644 index 0000000..5bb90fd Binary files /dev/null and b/src/assets/layer/theme/default/loading-2.gif differ diff --git a/src/clientarea/controllers/accounts/add.php b/src/clientarea/controllers/accounts/add.php index b6aa9f5..8741eb2 100755 --- a/src/clientarea/controllers/accounts/add.php +++ b/src/clientarea/controllers/accounts/add.php @@ -110,16 +110,16 @@ if (isset($_POST['submit'])) { setMessage('api_key cannot be empty !', 'danger'); redirect('clientarea/accounts'); } - $ExtensionInfo = $DB->findAll('account_domaintld', '*', array(), 'extension_id'); + $HostnameInfo = $DB->findAll('account_hostname', '*', array(), 'host_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)) { - $ExtensionInfo = array( - 'extension_value' => '.html-5.me', + if (empty($HostnameInfo)) { + $HostnameInfo = array( + 'host_name' => '.html-5.me', ); } } diff --git a/src/clientarea/views/accounts/add.php b/src/clientarea/views/accounts/add.php index 276fe85..cfc2256 100755 --- a/src/clientarea/views/accounts/add.php +++ b/src/clientarea/views/accounts/add.php @@ -61,9 +61,9 @@
    - + +
    @@ -140,8 +140,8 @@ function check_sub_domain() { $('#hidden-area').html(''); var domain = $('#sudomain').val(); - var extensions = $('#extension').val(); - var validomain = domain + extensions; + var host_names = $('#host_name').val(); + var validomain = domain + host_names; $.post('controllers/accounts/validate_domain.php', {domain : validomain, submit: ""}, function(data){ if (validomain != data) { $('#hidden-area').html(''); @@ -166,8 +166,8 @@ function create_account() { $('#hidden-area').html(''); var domain = $('#sudomain').val(); - var extensions = $('#extension').val(); - var validomain = domain + extensions; + var host_names = $('#host_name').val(); + var validomain = domain + host_names; $.post('controllers/accounts/add.php', { domain: validomain, api_key: 'ttkl.cf', diff --git a/src/core/language/zh-CN/language.php b/src/core/language/zh-CN/language.php index fe48413..b4dcb42 100755 --- a/src/core/language/zh-CN/language.php +++ b/src/core/language/zh-CN/language.php @@ -177,5 +177,7 @@ return array( 'Page Author' => '网页著作人', 'Admin Area' => '管理中心', 'Hosting Provider' => '托管提供商', - 'Domain Provider' => '域名提供商' + 'Domain Provider' => '域名提供商', + 'Hosting Hostname' => '托管主机名', + 'Hostname' => '主机名', ); diff --git a/src/install/function/Database.php b/src/install/function/Database.php index 1c2ced7..b26655c 100755 --- a/src/install/function/Database.php +++ b/src/install/function/Database.php @@ -99,10 +99,11 @@ $sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `uiisc_clients` ( PRIMARY KEY (`client_id`) ) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4;'); -$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `uiisc_account_domaintld` ( - `extension_id` INT(11) unsigned NOT NULL AUTO_INCREMENT, - `extension_value` VARCHAR(70) NOT NULL, - PRIMARY KEY (`extension_id`) +$sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `uiisc_account_hostname` ( + `host_id` INT(11) unsigned NOT NULL AUTO_INCREMENT, + `api_id` INT(11) NOT NULL, + `host_name` VARCHAR(70) NOT NULL, + PRIMARY KEY (`host_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;'); $sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `uiisc_smtp` ( @@ -193,7 +194,7 @@ $sql = mysqli_query($connect, "INSERT INTO `uiisc_ssl_api`(`api_key`, `api_usern $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 `uiisc_account_domaintld`(`extension_value`) VALUES ('.example.com')"); +$sql = mysqli_query($connect, "INSERT INTO `uiisc_account_hostname`(`host_name`) VALUES ('.example.com')"); $sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `uiisc_news`( `news_id` INT(11) NOT NULL AUTO_INCREMENT,
    KeyTypeI18N('Type'); ?> Panel URLPackageActionI18N('Package'); ?>I18N('Action'); ?>
    I18N('edit'); ?> I18N('details'); ?> + I18N('Hostname'); ?>