//Commented because of some oddity in NetworkManager that emits these signals multiple times with erroneous data. /* * void OnConnectionAdded (string objectPath) * { * Console.WriteLine ("Connection added: {0}", objectPath); * } * * void OnNetworkConnectionRemoved (object o, NetworkConnection.NetworkConnectionRemovedArgs args) * { * Console.WriteLine ("connection removed: {0}", args.ConnectionName); * } */ public void UpdateConnections() { lock (SystemConnections) { SystemConnections.Clear(); try { foreach (string con in SystemConnectionManager.BusObject.ListConnections()) { NetworkConnection connection = new NetworkConnection(SystemBus, con, ConnectionOwner.System); if (connection.Settings.ContainsKey("802-11-wireless")) { connection = new WirelessConnection(SystemBus, con, ConnectionOwner.System); } else if (connection.Settings.ContainsKey("802-3-ethernet")) { connection = new WiredConnection(SystemBus, con, ConnectionOwner.System); } else { continue; } //connection.ConnectionRemoved += OnNetworkConnectionRemoved; SystemConnections.Add(connection); } } catch (Exception e) { Log <ConnectionManager> .Error(e.Message); Log <ConnectionManager> .Debug(e.StackTrace); } } lock (UserConnections) { UserConnections.Clear(); try { foreach (string con in UserConnectionManager.BusObject.ListConnections()) { NetworkConnection connection = new NetworkConnection(UserBus, con, ConnectionOwner.User); if (connection.Settings.ContainsKey("802-11-wireless")) { connection = new WirelessConnection(UserBus, con, ConnectionOwner.User); } else if (connection.Settings.ContainsKey("802-3-ethernet")) { connection = new WiredConnection(UserBus, con, ConnectionOwner.User); } else { continue; } //connection.ConnectionRemoved += OnNetworkConnectionRemoved; UserConnections.Add(connection); } } catch (Exception e) { Log <ConnectionManager> .Error(e.Message); Log <ConnectionManager> .Debug(e.StackTrace); } } }
public ActionResult Visitors() { mu = Membership.GetUser(); uad = new UserAccountDetail(); ua = new UserAccount(Convert.ToInt32(mu.ProviderUserKey)); if (ua.IsAdmin) { ViewBag.AdminLink = "/m/auth/default.aspx"; } uad.GetUserAccountDeailForUser(ua.UserAccountID); UserAccountDetail uadLooker = new UserAccountDetail(); uadLooker.GetUserAccountDeailForUser(ua.UserAccountID); UserConnections unconfirmedUsers = new UserConnections(); UserConnections allusrcons = new UserConnections(); allusrcons.GetUserConnections(Convert.ToInt32(mu.ProviderUserKey)); foreach (UserConnection uc1 in allusrcons) { if (!uc1.IsConfirmed && Convert.ToInt32(mu.ProviderUserKey) != uc1.FromUserAccountID) { unconfirmedUsers.Add(uc1); } } ViewBag.ApprovalList = unconfirmedUsers.ToUnorderdList; ViewBag.BlockedUsers = BootBaronLib.AppSpec.DasKlub.BOL.BlockedUsers.HasBlockedUsers(Convert.ToInt32(mu.ProviderUserKey)); ViewBag.EnableProfileLogging = uad.EnableProfileLogging; LoadVisitorsView(ua.UserName); return View(); }
public ActionResult MyUsers() { mu = Membership.GetUser(); ViewBag.CurrentUserName = mu.UserName; if (mu != null) { uad = new UserAccountDetail(); uad.GetUserAccountDeailForUser(Convert.ToInt32(mu.ProviderUserKey)); ViewBag.EnableProfileLogging = uad.EnableProfileLogging; } UserConnections unconfirmedUsers = new UserConnections(); UserConnections allusrcons = new UserConnections(); allusrcons.GetUserConnections(Convert.ToInt32(mu.ProviderUserKey)); foreach (UserConnection uc1 in allusrcons) { if (!uc1.IsConfirmed && Convert.ToInt32(mu.ProviderUserKey) != uc1.FromUserAccountID) { unconfirmedUsers.Add(uc1); } } ViewBag.ApprovalList = unconfirmedUsers.ToUnorderdList; ViewBag.BlockedUsers = BootBaronLib.AppSpec.DasKlub.BOL.BlockedUsers.HasBlockedUsers(Convert.ToInt32(mu.ProviderUserKey)); return View(); }