Пример #1
0
    private void ResolveDependencies()
    {
        CurrentRequest.Resolver.AppName = this.AppName;
        PhraseLib = CurrentRequest.Resolver.Resolve <IPhraseLib>();
        m_common  = CurrentRequest.Resolver.Resolve <CMS.AMS.Common>();

        m_CustomerGroupCondition = CurrentRequest.Resolver.Resolve <ICustomerGroupCondition>();
        m_Offer        = CurrentRequest.Resolver.Resolve <IOffer>();
        m_ErrorHandler = CurrentRequest.Resolver.Resolve <IErrorHandler>();
        m_OAWService   = CurrentRequest.Resolver.Resolve <IOfferApprovalWorkflowService>();
        MyCommon       = new Copient.CommonInc();
        Logix          = new Copient.LogixInc();
        Object o = MyCommon;

        Logix.Load_Roles(ref o, AdminUserID);
        m_common.Open_LogixRT();
    }
Пример #2
0
    public long Verify_AdminUser(ref object Common, ref object MyLogix)
    {
        String  Authtoken = "";
        String  MyURI;
        String  TransferKey = "";
        Boolean Debug       = false;

        if (AdminUserID != 0)
        {
            if (Debug)
            {
                lCommon.Write_Log("auth.txt", "AppName=" + lCommon.AppName + " - Verify_AdminUser was called, but we already know the AdminUserID=" + AdminUserID, true);
            }
            //'we already know who the AdminUser is ... we shouldn't be looking him up more than once

            Object o = lCommon;
            lLogix.Load_Roles(ref o, AdminUserID);
            return(AdminUserID);
        }


        //'1st, check the transferkey and see if the user is being transferred into AMS from another product (PrefMan)
        if (GetCgiValue("transferkey") != String.Empty)
        {
            if (Debug)
            {
                lCommon.Write_Log("auth.txt", "AppName=" + lCommon.AppName + " - Checking the TransferKey (" + GetCgiValue("transferkey") + ")  AdminUserID=" + AdminUserID, true);
            }
            TransferKey = GetCgiValue("transferkey");
            AdminUserID = lLogix.Auth_TransferKey_Verify(ref lCommon, TransferKey, ref AdminName, ref LanguageID, ref Authtoken);
            if (Debug)
            {
                lCommon.Write_Log("auth.txt", "AppName=" + lCommon.AppName + " - After TransferKey_Verify AdminUserID=" + AdminUserID, true);
            }
            if (AdminUserID != 0)
            {
                Response.Cookies["AuthToken"].Value = Authtoken;
                Object o = lCommon;
                lLogix.Load_Roles(ref o, AdminUserID);
                return(AdminUserID);
            }
        }
        else
        {
        }
        Authtoken = "";
        if (Request.Cookies["AuthToken"] != null)
        {
            Authtoken = Request.Cookies["AuthToken"].Value;
        }

        if (Debug)
        {
            lCommon.Write_Log("auth.txt", "AppName=" + lCommon.AppName + " - AuthToken='" + Authtoken + "'   Transferkey='" + GetCgiValue("transferkey") + "'", true);
        }
        AdminUserID = 0;
        AdminUserID = lLogix.Auth_Token_Verify(ref lCommon, Authtoken, ref AdminName, ref LanguageID);
        if (Debug)
        {
            lCommon.Write_Log("auth.txt", "AppName=" + lCommon.AppName + " - After checking AuthToken, AdminUserID=" + AdminUserID, true);
        }


        if (AdminUserID == 0)
        {
            MyURI = System.Web.HttpUtility.UrlEncode(Request.Url.AbsoluteUri);

            /*
             * Send("<!DOCTYPE html ")
             * Send("     PUBLIC ""-//W3C//DTD XHTML 1.0 Transitional//EN""")
             * Send("     ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"">")
             * Send("<html xmlns=""http://www.w3.org/1999/xhtml"">")
             * Send("<head>")
             * Send("<meta http-equiv=""refresh"" content=""0; url=/logix/login.aspx?mode=invalid&amp;bounceback=" & MyURI & """ />")
             * Send("<title>Logix</title>")
             * Send("</head>")
             * Send("<body bgcolor=""#ffffff"">")
             * Send("<!-- Bouncing -->")
             * Send("</body>")
             * Send("</html>")
             * Response.End()*/
        }
        else
        {
            Object o = lCommon;
            lLogix.Load_Roles(ref o, AdminUserID);
        }
        return(AdminUserID);
    }