Pman.Login.js
authorKH Lau <khlau@roojs.com>
Mon, 28 Aug 2017 02:53:47 +0000 (10:53 +0800)
committerKH Lau <khlau@roojs.com>
Mon, 28 Aug 2017 02:53:47 +0000 (10:53 +0800)
Attribute changed Pman.Login.js

Pman.Login.js

index d8f9f17..446139c 100644 (file)
@@ -372,14 +372,17 @@ Pman.Login =  new Roo.util.Observable({
           
         Roo.bootstrap.MessageBox.alert("Error", "Admin accounts have not been created - use the old admin at present");
 
-        // admin company has been created - create the user..
-        if (Pman.Login.authUser.company_id_id* 1 > 0) {
-            this.openSystemCreateUser();
+        // create company if company_id is -1 
+        if (Pman.Login.authUser.company_id* 1 < 0) {
+            this.openSystemCreateCompany();
             return;
         }
         
-        this.openSystemCreateCompany();
-        /// create account..
+        // create user if id is -1 
+        if (Pman.Login.authUser.id* 1 < 0) {
+            this.openSystemCreateUser();
+            return;
+        }