瀏覽代碼

add checks on first install

causefx 8 年之前
父節點
當前提交
37d0621fc8
共有 2 個文件被更改,包括 18 次插入2 次删除
  1. 8 0
      api/functions/organizr-functions.php
  2. 10 2
      api/pages/wizard.php

+ 8 - 0
api/functions/organizr-functions.php

@@ -33,9 +33,17 @@ function wizardConfig($array){
             if(createFirstAdmin($location,$dbName,$username,$password,$email)){
                 if(createToken($username,$email,gravatar($email),'Admin',0,$hashKey,1)){
                     return true;
+                }else{
+                    return 'token';
                 }
+            }else{
+                return 'admin';
             }
+        }else{
+            return 'db';
         }
+    }else{
+        return 'config';
     }
     return false;
 }

+ 10 - 2
api/pages/wizard.php

@@ -127,9 +127,17 @@ $pageWizard = '
                 console.log( post );
                 organizrAPI(\'POST\',\'api/?v1/wizard_config\',post).success(function(data) {
             		var html = JSON.parse(data);
-                    if(html.data == true){
+                    if(html.data == \'true\'){
                         location.reload();
-                    }else{
+                    }else if(html.data == \'token\'){
+						console.error(\'Organizr Function: Could not create Token\');
+					}else if(html.data == \'db\'){
+						console.error(\'Organizr Function: Could not create DB - check permissions\');
+					}else if(html.data == \'admin\'){
+						console.error(\'Organizr Function: Could not create admin acct\');
+					}else if(html.data == \'config\'){
+						console.error(\'Organizr Function: Could not create config files - check permissions\');
+					}else{
                         console.error(\'Organizr Function: Signup Error Occured\');
                     }
             	}).fail(function(xhr) {