예제 #1
0
        private string Login(int officeId, string userName, string password, string culture, bool rememberMe, string challenge, HttpContext context)
        {
            try
            {
                long signInId = Data.Office.User.SignIn(officeId, userName, password, culture, rememberMe, challenge, context);

                Log.Information("{UserName} signed in to office : #{OfficeId}.", userName, officeId);

                if (signInId > 0)
                {
                    MixERPWebpage.SetSession(this.Context.Session, signInId);
                    MixERPWebpage.SetAuthenticationTicket(this.Context.Response, signInId, rememberMe);

                    return("OK");
                }

                this.LogInvalidSignIn();
                return(Warnings.UserIdOrPasswordIncorrect);
            }
            catch (MixERPException ex)
            {
                Log.Warning("{UserName} could not sign in to office : #{OfficeId}.", userName, officeId);

                this.LogInvalidSignIn();
                return(ex.Message);
            }
        }
예제 #2
0
        private string Login(string catalog, int officeId, string userName, string password, string culture,
                             bool rememberMe, string challenge, HttpContext context)
        {
            try
            {
                long globalLoginId = Data.Office.User.SignIn(catalog, officeId, userName, password, culture, rememberMe,
                                                             challenge, context);

                Log.Information("{UserName} signed in to office : #{OfficeId} from {IP}.", userName, officeId,
                                context.Request.ServerVariables["REMOTE_ADDR"]);

                if (globalLoginId > 0)
                {
                    MixERPWebpage.SetAuthenticationTicket(HttpContext.Current.Response, globalLoginId, rememberMe);

                    AppUsers.SetCurrentLogin(globalLoginId);
                    return("OK");
                }

                this.LogInvalidSignIn();
                return(Warnings.UserIdOrPasswordIncorrect);
            }
            catch (MixERPException ex)
            {
                Log.Warning("{UserName} could not sign in to office : #{OfficeId} from {IP}.", userName, officeId,
                            context.Request.ServerVariables["REMOTE_ADDR"]);

                this.LogInvalidSignIn();
                return(ex.Message);
            }
        }
예제 #3
0
        private static bool Login(int officeId, string userName, string password, string culture, bool rememberMe, Page page)
        {
            bool results = Data.Office.User.SignIn(officeId, userName, password, culture, rememberMe, page);

            if (results)
            {
                MixERPWebpage.SetSession(page, userName);
                MixERPWebpage.SetAuthenticationTicket(page, userName, rememberMe);
            }

            return(results);
        }