ExistingUserTest.js (598B)
1 /** 2 * Tests if an user already exists 3 */ 4 Ext.define('PartKeeprSetup.ExistingUserTest', { 5 extend: 'PartKeeprSetup.AbstractTest', 6 action: 'testExistingUsers', 7 name: "Database", 8 message: "Checking for existing users", 9 10 onAfterRunTest: function (data) 11 { 12 var config = PartKeeprSetup.getApplication().getSetupConfig(); 13 14 config.existingUsers = data.totalUsers; 15 config.legacyUsers = data.legacyUsers; 16 17 if (config.existingUsers > 0) { 18 config.createUser = false; 19 } else { 20 config.createUser = true; 21 } 22 } 23 });