root 9 роки тому
батько
коміт
6434b4cffe
2 змінених файлів з 43 додано та 1 видалено
  1. 1 1
      mobile/control/crash_log.php
  2. 42 0
      shop/control/crash_log.php

+ 1 - 1
mobile/control/crash_log.php

@@ -17,7 +17,7 @@ class crash_logControl extends mobileHomeControl
         $crash_content = $_POST['content'];
         if (!empty($crash_content)) {
 
-            $platform = $_GET['platform'];
+            $platform = $_GET['client'];
             if (!empty($platform)) {
                 $path = BASE_DATA_PATH . '/log/' . $platform . '/';
             } else {

+ 42 - 0
shop/control/crash_log.php

@@ -0,0 +1,42 @@
+<?php
+/**
+ *
+ */
+
+defined('InShopNC') or exit('Access Invalid!');
+
+class crash_logControl extends BaseHomeControl
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function uploadOp()
+    {
+        if ($_FILES['file']['error'] === 0) {
+
+            $platform = $_GET['client'];
+            if (!empty($platform)) {
+                $path = BASE_DATA_PATH . '/log/' . $platform . '/';
+            } else {
+                $path = BASE_DATA_PATH . '/log/default/';
+            }
+
+            if (!is_dir($path)) mkdir($path);
+
+            $version = $_GET['version'];
+            if (!empty($version)) {
+                $path = $path . $version . '/';
+            } else {
+                $path = $path . 'default/';
+            }
+
+            if (!is_dir($path)) mkdir($path);
+
+            $file_name = date('Ymd', TIMESTAMP) . '-' . random(4) . '.crash.log';
+
+            move_uploaded_file($_FILES['file']['tmp_name'], $path . $file_name);
+        }
+    }
+}