Group adminGroup = m_settingDao.getGroupByName(User.GROUP_RESOURCE_ID, ADMIN_GROUP_NAME); if (adminGroup == null) { adminGroup = new Group(); adminGroup.setName(ADMIN_GROUP_NAME); adminGroup.setResource(User.GROUP_RESOURCE_ID); adminGroup.setDescription("Users with superadmin privileges"); } Permission.SUPERADMIN.setEnabled(adminGroup, true); Permission.TUI_CHANGE_PIN.setEnabled(adminGroup, false);  m_settingDao.saveGroup(adminGroup);    String superadmin = "superadmin"; User admin = loadUserByUserName(superadmin); if (admin == null) { admin = new User(); admin.setUserName(superadmin);     admin.setPintoken(""); }  admin.addGroup(adminGroup); saveUser(admin);
createAdminGroupAndInitialUser(null);
    public void createAdminGroupAndInitialUserTask() {        Group adminGroup = m_settingDao.getGroupByName(User.GROUP_RESOURCE_ID, ADMIN_GROUP_NAME);        if (adminGroup == null) {                        adminGroup = new Group();            adminGroup.setName(ADMIN_GROUP_NAME);            adminGroup.setResource(User.GROUP_RESOURCE_ID);            adminGroup.setDescription("Users with superadmin privileges");        }        Permission.SUPERADMIN.setEnabled(adminGroup, true);        Permission.TUI_CHANGE_PIN.setEnabled(adminGroup, false);        m_settingDao.saveGroup(adminGroup);        // using superadmin name not to disrupt existing customers        // can be anything        String superadmin = "superadmin";        User admin = loadUserByUserName(superadmin);        if (admin == null) {            admin = new User();            admin.setUserName(superadmin);            // Note: previously this hack set the pintoken to 'password', relying on another hack            // that allowed the password and pintoken to be the same. That hack is gone so setting            // the pintoken to 'password' would no longer work because the password would then be            // the inverse hash of 'password' rather than 'password'.            admin.setPintoken("");        }        admin.addGroup(adminGroup);        saveUser(admin);    }