Bläddra i källkod

update callback api

Jackson Dou 1 år sedan
förälder
incheckning
3a2872da2c

+ 2 - 1
.gitignore

@@ -1,4 +1,5 @@
 .DS_Store
 Thumbs.db
 test/
-install.lock
+install.lock
+log.txt

+ 1 - 1
src/admin/views/dashboard/view.php

@@ -90,7 +90,7 @@
                             </div>
                         </div>
                     </div>
-                    <a href="myssl.php">
+                    <a href="ssl.php">
                         <div class="panel-footer">
                             <span class="pull-left"><?php echo $lang->I18N('View details'); ?></span>
                             <span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>

+ 2 - 35
src/callback/index.php

@@ -1,36 +1,3 @@
 <?php
-
-require_once __DIR__ . '/../core/application.php';
-$path_array = explode('/', trim($path_info, '/'));
-
-if (!$path_array || count($path_array) < 2) {
-    exit('401 Unauthorized');
-}
-
-if (!isset($path_array[0]) || empty($path_array[0])) {
-    header("status: 401");
-    exit('401 Unauthorized');
-}
-
-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';
+// require_once __DIR__ . '/../core/application.php';
+exit('401 Unauthorized');

+ 0 - 0
src/callback/.htaccess → src/callback/myownfreehost/.htaccess


+ 2 - 2
src/callback/myownfreehost/activate.php

@@ -47,7 +47,7 @@ if ($AccountInfo) {
         'account_api_key' => $api_key,
         'account_domain' => '***.' . $AccountApi['api_server_domain'],
         'account_status' => '1',
-        'account_date' => $callback_log['callback_date'],
+        'account_addtime' => $callback_log['callback_date'],
         'account_client_id' => 0,
         'account_sql' => 'sql***'
     );
@@ -63,7 +63,7 @@ $DB->insert('account_callback', $callback_log);
 
 $EmailDescription = '
 <p>Account domain    : ' . $AccountInfo['account_domain'] . '<br />
-Account date   : ' . $AccountInfo['account_date'] . '<br />
+Account date   : ' . $AccountInfo['account_addtime'] . '<br />
 Server IP      : ' . $AccountApi['api_server_ip'] . '<br />
 Hosting package: ' . $AccountApi['api_package'] . '<br /></p>
 <p>Control Panel username : ' . $AccountInfo['account_username'] . '<br />

+ 1 - 1
src/callback/myownfreehost/delete.php

@@ -48,7 +48,7 @@ if ($AccountInfo) {
         'account_api_key' => $api_key,
         'account_domain' => '***.' . $AccountApi['api_server_domain'],
         'account_status' => '3',
-        'account_date' => $callback_log['callback_date'],
+        'account_addtime' => $callback_log['callback_date'],
         'account_client_id' => 0,
         'account_sql' => 'sql***'
     );

+ 27 - 0
src/callback/myownfreehost/index.php

@@ -0,0 +1,27 @@
+<?php
+
+require_once __DIR__ . '/../../core/application.php';
+$path_array = explode('/', trim($path_info, '/'));
+
+if (!$path_array || count($path_array) < 2) {
+    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__ . '/app.php';

+ 1 - 1
src/callback/myownfreehost/parkdomainadd.php

@@ -44,7 +44,7 @@ if ($AccountInfo) {
         'account_api_key' => $api_key,
         'account_domain' => '***.' . $AccountApi['api_server_domain'],
         'account_status' => '1',
-        'account_date' => $callback_log['callback_date'],
+        'account_addtime' => $callback_log['callback_date'],
         'account_client_id' => 0,
         'account_sql' => 'sql***'
     );

+ 1 - 1
src/callback/myownfreehost/parkdomaindel.php

@@ -51,7 +51,7 @@ if ($AccountInfo) {
         'account_api_key' => $api_key,
         'account_domain' => '***.' . $AccountApi['api_server_domain'],
         'account_status' => '1',
-        'account_date' => $callback_log['callback_date'],
+        'account_addtime' => $callback_log['callback_date'],
         'account_client_id' => 0,
         'account_sql' => 'sql***'
     );

+ 1 - 1
src/callback/myownfreehost/reactivate.php

@@ -48,7 +48,7 @@ if ($AccountInfo) {
         'account_api_key' => $api_key,
         'account_domain' => '***.' . $AccountApi['api_server_domain'],
         'account_status' => '1',
-        'account_date' => $callback_log['callback_date'],
+        'account_addtime' => $callback_log['callback_date'],
         'account_client_id' => 0,
         'account_sql' => 'sql***'
     );

+ 1 - 1
src/callback/myownfreehost/sqlcluster.php

@@ -44,7 +44,7 @@ if ($AccountInfo) {
         'account_api_key' => $api_key,
         'account_domain' => '***.' . $AccountApi['api_server_domain'],
         'account_status' => '1',
-        'account_date' => $callback_log['callback_date'],
+        'account_addtime' => $callback_log['callback_date'],
         'account_client_id' => 0,
         'account_sql' => $status
     );

+ 1 - 1
src/callback/myownfreehost/subdomainadd.php

@@ -44,7 +44,7 @@ if ($AccountInfo) {
         'account_api_key' => $api_key,
         'account_domain' => '***.' . $AccountApi['api_server_domain'],
         'account_status' => '1',
-        'account_date' => $callback_log['callback_date'],
+        'account_addtime' => $callback_log['callback_date'],
         'account_client_id' => 0,
         'account_sql' => 'sql***'
     );

+ 1 - 1
src/callback/myownfreehost/subdomaindel.php

@@ -51,7 +51,7 @@ if ($AccountInfo) {
         'account_api_key' => $api_key,
         'account_domain' => '***.' . $AccountApi['api_server_domain'],
         'account_status' => '1',
-        'account_date' => $callback_log['callback_date'],
+        'account_addtime' => $callback_log['callback_date'],
         'account_client_id' => 0,
         'account_sql' => 'sql***'
     );

+ 1 - 1
src/callback/myownfreehost/suspend.php

@@ -51,7 +51,7 @@ if ($AccountInfo) {
         'account_api_key' => $api_key,
         'account_domain' => '***.' . $AccountApi['api_server_domain'],
         'account_status' => '2',
-        'account_date' => $callback_log['callback_date'],
+        'account_addtime' => $callback_log['callback_date'],
         'account_client_id' => 0,
         'account_sql' => 'sql***'
     );