private void SetDefaultVpnServer() { Majorsilence.Vpn.Logic.ActionLog.Log_BackgroundThread("Attempt to set default vpn server after payment made", sessionInstance.UserId); try { var details = new Majorsilence.Vpn.Logic.Accounts.ServerDetails(); using (var sshNewServer = new Majorsilence.Vpn.Logic.Ssh.LiveSsh(SiteInfo.SshPort, SiteInfo.VpnSshUser, SiteInfo.VpnSshPassword)) using (var sshRevokeServer = new Majorsilence.Vpn.Logic.Ssh.LiveSsh(SiteInfo.SshPort, SiteInfo.VpnSshUser, SiteInfo.VpnSshPassword)) using (var sftp = new Majorsilence.Vpn.Logic.Ssh.LiveSftp(SiteInfo.SshPort, SiteInfo.VpnSshUser, SiteInfo.VpnSshPassword)) { var cert = new CertsOpenVpnGenerateCommand(sessionInstance.UserId, details.Info.First().VpnServerId, sshNewServer, sshRevokeServer, sftp); cert.Execute(); } using (var sshNewServer = new Majorsilence.Vpn.Logic.Ssh.LiveSsh(SiteInfo.SshPort, SiteInfo.VpnSshUser, SiteInfo.VpnSshPassword)) using (var sshRevokeServer = new Majorsilence.Vpn.Logic.Ssh.LiveSsh(SiteInfo.SshPort, SiteInfo.VpnSshUser, SiteInfo.VpnSshPassword)) { var pptp = new Majorsilence.Vpn.Logic.Ppp.ManagePPTP(sessionInstance.UserId, details.Info.First().VpnServerId, sshNewServer, sshRevokeServer); pptp.AddUser(); } } catch (Exception ex) { Majorsilence.Vpn.Logic.Helpers.Logging.Log(ex); Majorsilence.Vpn.Logic.ActionLog.Log_BackgroundThread("Failed to set default vpn server after payment made", sessionInstance.UserId); } }
public void CreatePptp() { using (var sshNewServer = new Majorsilence.Vpn.Logic.Ssh.FakeSsh()) using (var sshRevokeServer = new Majorsilence.Vpn.Logic.Ssh.FakeSsh()) { var ppt = new Majorsilence.Vpn.Logic.Ppp.ManagePPTP(2, 1, sshNewServer, sshRevokeServer); ppt.AddUser(); } }
private void PptpServer(int vpnServerId) { using (var sshNewServer = new Majorsilence.Vpn.Logic.Ssh.LiveSsh(Majorsilence.Vpn.Logic.Helpers.SiteInfo.SshPort, Majorsilence.Vpn.Logic.Helpers.SiteInfo.VpnSshUser, Majorsilence.Vpn.Logic.Helpers.SiteInfo.VpnSshPassword)) using (var sshRevokeServer = new Majorsilence.Vpn.Logic.Ssh.LiveSsh(Majorsilence.Vpn.Logic.Helpers.SiteInfo.SshPort, Majorsilence.Vpn.Logic.Helpers.SiteInfo.VpnSshUser, Majorsilence.Vpn.Logic.Helpers.SiteInfo.VpnSshPassword)) { var pptp = new Majorsilence.Vpn.Logic.Ppp.ManagePPTP(sessionInstance.UserId, vpnServerId, sshNewServer, sshRevokeServer); pptp.AddUser(); } }