/** * Get the SAM-compatible username of the currently logged-on user. * * @return String. */ public static String getCurrentUsername() { return Secur32Util.getUserNameEx(Secur32.EXTENDED_NAME_FORMAT.NameSamCompatible); }
/** * Get the SAM-compatible username of the currently logged-on user. * * @return String. */ public static String getCurrentUsername() { return Secur32Util.getUserNameEx(EXTENDED_NAME_FORMAT.NameSamCompatible); }
/** * Get the SAM-compatible username of the currently logged-on user. * * @return String. */ public static String getCurrentUsername() { return Secur32Util.getUserNameEx(EXTENDED_NAME_FORMAT.NameSamCompatible); }
/** * Get the SAM-compatible username of the currently logged-on user. * * @return String. */ public static String getCurrentUsername() { return Secur32Util.getUserNameEx(Secur32.EXTENDED_NAME_FORMAT.NameSamCompatible); }
/** * Get the SAM-compatible username of the currently logged-on user. * * @return String. */ public static String getCurrentUsername() { return Secur32Util.getUserNameEx(EXTENDED_NAME_FORMAT.NameSamCompatible); }
/** * Get the SAM-compatible username of the currently logged-on user. * * @return String. */ public static String getCurrentUsername() { return Secur32Util.getUserNameEx(EXTENDED_NAME_FORMAT.NameSamCompatible); }
/** * Get local groups of the current user. * @return Local groups. */ public static Group[] getCurrentUserLocalGroups() { return getUserLocalGroups(Secur32Util.getUserNameEx(EXTENDED_NAME_FORMAT.NameSamCompatible)); }
/** * Get local groups of the current user. * @return Local groups. */ public static Group[] getCurrentUserLocalGroups() { return getUserLocalGroups(Secur32Util.getUserNameEx(EXTENDED_NAME_FORMAT.NameSamCompatible)); }
/** * Will login the current user with any password. Will logon a "Guest" user as guest. * * @param username * the username * @param password * the password * @return the i windows identity */ @Override public IWindowsIdentity logonUser(final String username, final String password) { final String currentUsername = Secur32Util.getUserNameEx(EXTENDED_NAME_FORMAT.NameSamCompatible); if (username.equals(currentUsername)) { return new MockWindowsIdentity(currentUsername, this.groups); } else if (username.equals(MockWindowsAuthProvider.GUEST)) { return new MockWindowsIdentity(MockWindowsAuthProvider.GUEST, this.groups); } else { throw new RuntimeException("Mock error: " + username); } }
/** * Will login the current user with any password. Will logon a "Guest" user as guest. * * @param username * the username * @param password * the password * @return the i windows identity */ @Override public IWindowsIdentity logonUser(final String username, final String password) { final String currentUsername = Secur32Util.getUserNameEx(EXTENDED_NAME_FORMAT.NameSamCompatible); if (username.equals(currentUsername)) { return new MockWindowsIdentity(currentUsername, this.groups); } else if (username.equals(MockWindowsAuthProvider.GUEST)) { return new MockWindowsIdentity(MockWindowsAuthProvider.GUEST, this.groups); } else { throw new RuntimeException("Mock error: " + username); } }
/** * Will login the current user with any password. Will logon a "Guest" user as guest. * * @param username * the username * @param password * the password * @return the i windows identity */ @Override public IWindowsIdentity logonUser(final String username, final String password) { final String currentUsername = Secur32Util.getUserNameEx(EXTENDED_NAME_FORMAT.NameSamCompatible); if (username.equals(currentUsername)) { return new MockWindowsIdentity(currentUsername, this.groups); } else if (username.equals(MockWindowsAuthProvider.GUEST)) { return new MockWindowsIdentity(MockWindowsAuthProvider.GUEST, this.groups); } else { throw new RuntimeException("Mock error: " + username); } }