private bool RemoteCompCanBeAccessed() { if (this.RemoteSourceIP == null) { return(false); } Computer computer = Programs.getComputer(this.os, this.RemoteSourceIP); if (computer == null || (double)computer.bootTimer > 0.0) { return(false); } WhitelistConnectionDaemon daemon = (WhitelistConnectionDaemon)computer.getDaemon(typeof(WhitelistConnectionDaemon)); return(daemon == null || daemon.comp.files.root.searchForFolder("Whitelist").searchForFile("authenticator.dll") != null); }
public bool IPCanPassWhitelist(string ip, bool isFromRemote) { if (!this.AuthenticatesItself && !isFromRemote) { return(true); } if (this.RemoteSourceIP != null) { Computer computer = Programs.getComputer(this.os, this.RemoteSourceIP); if (!this.RemoteCompCanBeAccessed() || this.folder.searchForFile("authenticator.dll") == null) { return(true); } WhitelistConnectionDaemon daemon = (WhitelistConnectionDaemon)computer.getDaemon(typeof(WhitelistConnectionDaemon)); if (daemon == null) { return(true); } return(daemon.IPCanPassWhitelist(ip, true)); } if (this.folder.searchForFile("authenticator.dll") == null) { return(true); } FileEntry fileEntry = this.folder.searchForFile("list.txt"); if (fileEntry == null) { return(true); } foreach (string str in fileEntry.data.Split(Utils.robustNewlineDelim, StringSplitOptions.RemoveEmptyEntries)) { if (this.os.thisComputer.ip == str.Trim()) { return(true); } } return(false); }