Exemple #1
0
 protected bool LoadUserEmployerSessionInfo(out String lastUrl)
 {
     //Overloaded method to return whether or not the user completed IQ, no need to store in session
     using (GetKeyEmployeeInfo gkei = new GetKeyEmployeeInfo(MainLogin.UserName.Trim()))
     {
         if (!gkei.PutInSession(MainLogin.UserName))
         {
             Literal failText = (Literal)MainLogin.FindControl("FailureText");
             failText.Text    = gkei.SqlException;
             failText.Visible = true;
             lastUrl          = "error";
             return(false);
         }
         if (gkei.Tables.Count < 4)
         {
             lastUrl = "error"; return(false);
         }
         if (gkei.Tables[3].Rows.Count < 1)
         {
             lastUrl = "error"; return(false);
         }
         if (gkei.Tables[3].Rows[0].Field <string>("action") == "completed")
         {
             lastUrl = ""; return(true);
         }
         lastUrl = gkei.Tables[3].Rows[0].Field <string>("url");
         return(false);
     }
 }
Exemple #2
0
    void Cancel()
    {
        if (Exchange.gameClient != null)
        {
            Exchange.gameClient.Exit();
        }

        LoginHelpers.tryingToLogin = false;

        if (UnityEngine.GameObject.Find("RealmListFrame"))
        {
            Destroy(UnityEngine.GameObject.Find("RealmListFrame"));
        }

        if (UnityEngine.GameObject.Find("CharacterUI"))
        {
            Destroy(UnityEngine.GameObject.Find("CharacterUI"));
            UnityEngine.GameObject tempAuth = Instantiate(MainLogin.LoadPrefab("MainUI"), new Vector3(Screen.width / 2, Screen.height / 2, 0), Quaternion.identity);
            tempAuth.transform.SetParent(UnityEngine.GameObject.Find("Canvas").gameObject.transform);
            tempAuth.transform.localScale = new Vector3(1, 1, 1);
            tempAuth.name = "MainUI";
        }

        Destroy(UnityEngine.GameObject.Find("AuthFrame"));
    }
Exemple #3
0
    // Update is called once per frame
    void Update()
    {
        authMessage.text = Exchange.AuthMessage;

        if (ShowRealms)
        {
            ShowRealms = false;
            UnityEngine.GameObject RealmList = Instantiate(MainLogin.LoadPrefab("RealmList"), new Vector3(Screen.width / 2, Screen.height / 2, 0), Quaternion.identity);
            RealmList.transform.SetParent(UnityEngine.GameObject.Find("Canvas").gameObject.transform);
            RealmList.transform.localScale = new Vector3(1, 1, 1);
            RealmList.name = "RealmList";
            Destroy(UnityEngine.GameObject.Find("AuthFrame"));
            Destroy(UnityEngine.GameObject.Find("MainUI"));
        }

        if (ShowCharacterUI)
        {
            ShowCharacterUI = false;
            UnityEngine.GameObject CharacterUI = Instantiate(MainLogin.LoadPrefab("CharacterUI"), new Vector3(Screen.width / 2, Screen.height / 2, 0), Quaternion.identity);
            CharacterUI.transform.SetParent(UnityEngine.GameObject.Find("Canvas").gameObject.transform);
            CharacterUI.transform.localScale = new Vector3(1, 1, 1);
            CharacterUI.name = "CharacterUI";

            Destroy(UnityEngine.GameObject.Find("MainUI"));
            Destroy(UnityEngine.GameObject.Find("Image"));
        }
    }
Exemple #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MainLogin.DestinationPageUrl = this.Destination;
            if (!Page.IsPostBack)
            {
                //Uri u = Request.Url;
                //String[] uSegs = u.Segments.TakeWhile(seg => seg != u.Segments.Last()).ToArray();

                //((HyperLink)MainLogin.FindControl("hlReset")).NavigateUrl = ResolveUrl("ResetPassword.aspx");

                if (ClientUrl != null && ClientUrl != String.Empty)
                {
                    lbtnRegister.Visible = true;
                }

                WorkWithSignInTextBoxes();

                if (IsTimeout)
                {
                    Literal lFail = (Literal)MainLogin.FindControl("FailureText");
                    lFail.Text = "<div style=\"text-align:left;color:red;\">For your security we logged you out after being idle for 15 minutes.<br /><b style=\"color:red;\">Please sign in again.</b></div>";
                    FormsAuthentication.SignOut();
                    ThisSession.ClearSessionVariables();
                }
                else if (!System.Web.HttpContext.Current.User.Identity.IsAuthenticated)
                {
                    ThisSession.ClearSessionVariables();
                }
            }
            else
            {
            }
        }
Exemple #5
0
 public void ListRealms()
 {
     UnityEngine.GameObject RealmList = Instantiate(MainLogin.LoadPrefab("RealmList"), new Vector3(Screen.width / 2, Screen.height / 2, 0), Quaternion.identity);
     RealmList.transform.SetParent(UnityEngine.GameObject.Find("Canvas").gameObject.transform);
     RealmList.transform.localScale = new Vector3(1, 1, 1);
     RealmList.name = "RealmList";
     Destroy(UnityEngine.GameObject.Find("CharacterUI"));
 }
Exemple #6
0
        private void LogoutEventHandler(object sender, DialogClosingEventArgs eventArgs)
        {
            if ((bool)eventArgs.Parameter == false)
            {
                return;
            }

            Application.Current.Dispatcher.Invoke(new Action(() =>
            {
                //var logoutResult = WebProxy(ApiType.UserLogout, GlobalUser.USER.AccessToken);//暂时 不用调用接口  移除token记录

                string userFolder   = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, GlobalUser.DATAFOLDER);
                string userDataFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, GlobalUser.DATAFOLDER, $"user.dat");

                UserDataModel userDataModel = new UserDataModel
                {
                    UserName    = GlobalUser.USER.UserName,
                    Phone       = GlobalUser.USER.Moblie,
                    AccessToken = "",
                    Data        = new UserInfo()
                };
                GlobalUser.USER    = null;
                string userEncoded = Base64Provider.AESEncrypt(userDataModel.ToJsonItem(), Base64Provider.KEY, Base64Provider.IV);
                try
                {
                    if (!Directory.Exists(userFolder))
                    {
                        Directory.CreateDirectory(userFolder);
                    }
                    if (!File.Exists(userDataFile))
                    {
                        var file = File.Create(userDataFile);
                        file.Close();
                    }
                    using (StreamWriter sw = new StreamWriter(userDataFile, false))
                    {
                        sw.Write(userEncoded);
                    }
                }
                catch (Exception e)
                {
                    Log4NetHelper.Error("写入用户信息异常:", e);
                }

                var winLogin = new MainLogin();
                winLogin.Show();
                winLogin.Focus();

                GlobalUser.MainWin?.Hide();
                //GlobalUser.MainWin?.Close();
                GlobalUser.MainWin = null;

                //_metroWindow.Hide();
                //_metroWindow.Close();
                //_metroWindow = null;
            }));
        }
Exemple #7
0
    static public void Init(MainLogin sc, MyCamera mc)
    {
        Variables.mainLoginScript = sc;
        Variables.myCameraScript  = mc;

        UI.Init();
        Variables.Init();
        Connection.Init(sc);
        Reset();
    }
Exemple #8
0
        public MainDeptManagerApp(MainLogin lg, DataBaseManager dbm)
        {
            InitializeComponent();
            logForm = lg;
            Database = dbm;
            Database.ChangeConnectionUser(Database.ConnectedUser.UserType);

            SetUserStoreDept();

            RefreshDeptManagersList();
            RefreshTeamList();
        }
Exemple #9
0
        protected void LoadUserEmployerSessionInfo()
        {
            //Which employer database?
            GetKeyEmployeeInfo gkei = new GetKeyEmployeeInfo(MainLogin.UserName.Trim());

            if (!gkei.PutInSession(MainLogin.UserName))
            {
                Literal failText = (Literal)MainLogin.FindControl("FailureText");
                failText.Text    = gkei.SqlException;
                failText.Visible = true;
            }
        }
Exemple #10
0
        protected void LoadUserSessionInfo()
        {
            //Which employer database?
            GetKeyUserInfo gkui = new GetKeyUserInfo(ThisSession.UserLogginID);

            if (!gkui.PutInSession())
            {
                Literal failText = (Literal)MainLogin.FindControl("FailureText");
                failText.Text    = gkui.SqlException;
                failText.Visible = true;
            }
        }
Exemple #11
0
        public ActionResult Login(MainLogin data)
        {
            DataTable tbl = new DataTable();

            MainLogin obj_connection = new MainLogin();

            tbl = obj_connection.srchRecord("Select * from AdminDetails where AdminId='" + data.AdminId + "' and AdminPin='" + data.AdminPin + "'");
            if (tbl.Rows.Count > 0)
            {
                return(View("AdminZone"));
            }
            else
            {
                return(View("Invalid"));
            }
        }
Exemple #12
0
        protected void WorkWithSignInTextBoxes()
        {
            using (TextBox userName = (MainLogin.FindControl("UserName") as TextBox))
            {   //Add client side scripting to default the username text to 'Enter email address' if the user doesn't enter anything
                userName.Attributes.Add("onclick", "if(this.value=='Enter email address'){this.value='';}");
                userName.Attributes.Add("onblur", "this.value=!this.value?'Enter email address':this.value;");
            }
            using (TextBox pwdWatermark = (MainLogin.FindControl("txtPasswordWatermark") as TextBox))
            {   //Add client side scripting to allow for password hashing and default the text to 'Enter Password' if the user doesn't enter anything
                using (TextBox Password = (MainLogin.FindControl("Password") as TextBox))
                {
                    pwdWatermark.Attributes.Add("onfocus", "this.style.display = 'none';" +
                                                "document.getElementById('" + Password.ClientID + "').style.display = 'block';" +
                                                "document.getElementById('" + Password.ClientID + "').focus();");

                    Password.Style.Clear();
                    Password.Style.Add("display", "none");
                    Password.Attributes.Add("onblur", "if(this.value==''){this.style.display='none';" +
                                            "document.getElementById('" + pwdWatermark.ClientID + "').style.display = 'block';}");
                }
            }
        }
Exemple #13
0
    void Update()
    {
        if (delField.text == "delete" || delField.text == "DELETE")
        {
            Okay.enabled = true;
        }
        else
        {
            Okay.enabled = false;
        }

        if (deleteSuccessful)
        {
            deleteSuccessful = false;
            OutPacket request = new OutPacket(WorldCommand.CMSG_CHAR_ENUM);
            Exchange.gameClient.SendPacket(request);
            Destroy(UnityEngine.GameObject.Find("CharacterUI"));
            UnityEngine.GameObject CharacterUI = Instantiate(MainLogin.LoadPrefab("CharacterUI"), new Vector3(Screen.width / 2, Screen.height / 2, 0), Quaternion.identity);
            CharacterUI.transform.SetParent(UnityEngine.GameObject.Find("Canvas").gameObject.transform);
            CharacterUI.transform.localScale = new Vector3(1, 1, 1);
            CharacterUI.name = "CharacterUI";
            Destroy(gameObject);
        }
    }
Exemple #14
0
 public void Login(string user, string pass)
 {
     MainLogin   m1 = new MainLogin(user, pass);
     GrabDetails g1 = new GrabDetails();
 }
Exemple #15
0
 static public void Init(MainLogin sc)
 {
     mainLoginScript = sc;
     Reset();
 }
Exemple #16
0
 public void TestMethod1()
 {
     //Add test method
     MainLogin class1 = new MainLogin();
 }
Exemple #17
0
        protected void MainLogin_LoggedIn(object sender, EventArgs e)
        {
            String  mlUN         = MainLogin.UserName.Trim();
            Boolean IsCustomer   = Roles.IsUserInRole(mlUN, "Customer"),
                    IsCallCenter = Roles.IsUserInRole(mlUN, "CallCenter"),
                    IsAdmin      = Roles.IsUserInRole(mlUN, "Admin"),
                    IsManagement = Roles.IsUserInRole(mlUN, "Management"),
                    IsDebugUser  = Roles.IsUserInRole(mlUN, "DebugUser");

            bool iqComplete; string lastIQUrl;

            if (IsCustomer)
            {
                using (TextBox userName = (MainLogin.FindControl("UserName") as TextBox))
                {
                    String sUN = Encoder.HtmlEncode(userName.Text.Trim());

                    ThisSession.UserLogginID = Membership.GetUser(sUN).ProviderUserKey.ToString();
                    ThisSession.LoggedIn     = true;

                    LoadUserSessionInfo();
                    //LoadUserEmployerSessionInfo();
                    iqComplete = LoadUserEmployerSessionInfo(out lastIQUrl);
                    LoadEmployerContent();

                    using (GetPasswordQuestions gpq = new GetPasswordQuestions())
                    {
                        if (!gpq.PutInSession())
                        {
                            ThisSession.CurrentAvailableSecurityQuestions = new[] { "none" };
                        }
                        ThisSession.CurrentSecurityQuestion = Membership.GetUser(sUN).PasswordQuestion;
                    }
                    using (InsertUserLoginHistory iulh = new InsertUserLoginHistory())
                    {
                        iulh.UserName = Membership.GetUserNameByEmail(ThisSession.PatientEmail);
                        iulh.Domain   = Request.Url.Host;
                        if (IsDebugUser)
                        {
                            iulh.CallCenterID = Guid.Empty.ToString();
                        }
                        iulh.PostData();
                    }
                    if (ThisSession.SavingsChoiceEnabled)
                    {
                        if (!iqComplete)
                        {
                            if (lastIQUrl == null || lastIQUrl == "null" || lastIQUrl.Trim() == "" || lastIQUrl == "error")
                            {
                                Response.Redirect("~/SavingsChoice/SavingsChoiceWelcome.aspx");
                            }
                            else
                            {
                                Response.Redirect("~/SavingsChoice/" + lastIQUrl);
                            }
                        }
                    }
                }
                if (Request.QueryString.AllKeys.Contains("dest"))
                {
                    HttpContext.Current.Session["requestedTab"] = Encoder.HtmlEncode(Request.QueryString["dest"]);
                }
            }
            else if (IsCallCenter)
            {
                Response.Redirect(ResolveUrl("~/CallCenter/Default.aspx"));
            }
            else if (IsAdmin && !IsManagement)
            {
                using (InsertUserLoginHistory iulh = new InsertUserLoginHistory())
                {
                    iulh.UserName = Membership.GetUserNameByEmail(ThisSession.PatientEmail);
                    iulh.Domain   = Request.Url.Host;
                    iulh.PostData();
                    if (!iulh.HasErrors && iulh.RowsBack != 1)
                    {
                    }
                }
                Response.Redirect("~/Admin/Default.aspx");
            }
            else if (IsManagement && !IsAdmin)
            {
                Response.Redirect("~/ContentManagement/Default.aspx");
            }
            else if (IsManagement && IsAdmin)
            {
                Response.Redirect("~/AdminPortal/Default.aspx");
            }
        }