You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.8 KiB

  1. using Swift.DAL.BL.System.UserManagement;
  2. using Swift.web.Library;
  3. using Swift.web.SwiftSystem.UserManagement.ApplicationUserPool;
  4. using System;
  5. namespace Swift.web
  6. {
  7. public partial class LoginSession : System.Web.UI.Page
  8. {
  9. private string callFrom = "";
  10. private string userName = "";
  11. private ApplicationUserDao user = new ApplicationUserDao();
  12. protected void Page_Load(object sender, EventArgs e)
  13. {
  14. userName = GetStatic.ReadSession("usr", "");
  15. //callFrom = GetStatic.ReadSession("call", "");
  16. mes.InnerHtml = "<b>Your session has already been started.</b><br/>";
  17. mes.InnerHtml += "You are already being logged on from IP :" + UserPool.GetInstance().GetUser(userName).IPAddress + "";
  18. btnContinue.Visible = false;
  19. }
  20. protected void btnClearSession_Click(object sender, EventArgs e)
  21. {
  22. var userPool = UserPool.GetInstance();
  23. userPool.RemoveUser(user.FilterQuote(userName));
  24. mes.InnerHtml = "<b>Your session has been cleared successfully.</b>";
  25. btnContinue.Visible = true;
  26. btnClearSession.Visible = false;
  27. }
  28. protected void btnContinue_Click(object sender, EventArgs e)
  29. {
  30. Session.Clear();
  31. Session.Abandon();
  32. var url = GetStatic.GetUrlRoot();
  33. var loginType = GetStatic.ReadCookie("loginType", "");
  34. switch (loginType.ToUpper())
  35. {
  36. case "ADMIN":
  37. url += "/Admin";
  38. break;
  39. case "AGENT":
  40. url += "/Agent";
  41. break;
  42. case "AGENTINT":
  43. url += "/SendMoney";
  44. break;
  45. }
  46. Response.Redirect(url);
  47. }
  48. }
  49. }