public ActionResult LogOn(LogOnModel model, string returnUrl)
        {
            if (ModelState.IsValid)
            {
                if (MembershipService.ValidateUser(model.UserName, model.Password))
                {
                    applicationBus.Send(new UserLoggedInMessage {
                        Username = model.UserName
                    });

                    FormsService.SignIn(model.UserName, model.RememberMe);
                    if (Url.IsLocalUrl(returnUrl))
                    {
                        return(Redirect(returnUrl));
                    }
                    else
                    {
                        return(RedirectToAction("Index", "Home"));
                    }
                }
                else
                {
                    ModelState.AddModelError("", "The user name or password provided is incorrect.");
                }
            }

            // If we got this far, something failed, redisplay form
            return(View(model));
        }
        private void AddSettingsMenuItem(IApplicationBus bus)
        {
            bus.Send(
                new AddMenuItem
                {
                    MenuItem = new MenuItem
                    {
                        MenuName = "Settings",
                        LinkText = "Logging",
                        ActionName = "Index",
                        ControllerName = "LoggingSettings",
                        AreaName = "Framework",
                        HtmlAttributes = new { data_role = "button" },
                        Position = int.MinValue
                    }
                });

            bus.Send(
                new AddMenuItem
                {
                    MenuItem = new MenuItem
                    {
                        MenuName = "Settings",
                        LinkText = "Caching",
                        ActionName = "Index",
                        ControllerName = "CacheSettings",
                        AreaName = "Framework",
                        HtmlAttributes = new { data_role = "button" },
                        Position = int.MinValue
                    }
                });
        }
        public override void RegisterArea(AreaRegistrationContext context, IApplicationBus bus)
        {
            RegistApi();
            bus.Send(new NHRegisterEventMessage(typeof(IMemberShipFactory), typeof(MemberShipFactory)));

            //send the init data
            bus.Send(new MemberShipData());
            ResourceSetting.Registry();

            context.MapRoute(
                AreaName + "_images",
                AreaRoutePrefix + "/images/{resourceName}",
                new
            {
                controller   = "OrnamentEmbeddedResource",
                action       = "Index",
                resourcePath = "images"
            },
                new[]
            {
                "Ornament.Web.Controllers"
            }
                );

            //MemberShips/User/Edit/admin
            context.MapRoute(AreaName + "_EditUser",
                             AreaName + "/User/Edit/{loginId}",
                             new { action = "Edit", loginId = UrlParameter.Optional, controller = "User" }
                             );


            context.MapRoute(
                AreaName + "_AssingUser",
                AreaName + "/User/Assign/{loginId}",
                new { action = "Assign", loginId = UrlParameter.Optional, controller = "User" },
                new[] { "Ornament.MemberShip.Plugin.Areas.MemberShips.Controllers" }
                );

            context.MapRoute(
                AreaName + "_default",
                AreaName + "/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional },
                new[] { "Ornament.MemberShip.Plugin.Areas.MemberShips.Controllers" }
                );


            var helper = new AreaRegistrationHelper(this, context);

            helper.RegistSeajsModule("Scripts/User");
            helper.RegistSeajsModule("Scripts/Org");
            helper.RegistSeajsModule("Scripts/Role");
            helper.RegistSeajsModule("Scripts/Share");
            helper.RegistSeajsModule("Scripts/Permissions");

            base.RegisterArea(context, bus);
        }
        public virtual void RegisterArea(AreaRegistrationContext context, IApplicationBus bus)
        {
            IEnumerable<Type> apiControllers;
            IEnumerable<Type> controllers;
            GetInjectControllers(out controllers, out apiControllers);
            bus.Send(new IocControllerInjectMessageEvent(controllers, apiControllers));

            bus.Send(new PortableAreaStartupMessage(AreaName));

            RegisterAreaEmbeddedResources(bus);
        }
        public override void RegisterArea(AreaRegistrationContext context, IApplicationBus bus)
        {
            RegistApi();
            bus.Send(new NHRegisterEventMessage(typeof (IMemberShipFactory), typeof (MemberShipFactory)));

            //send the init data
            bus.Send(new MemberShipData());
            ResourceSetting.Registry();

            context.MapRoute(
                AreaName + "_images",
                AreaRoutePrefix + "/images/{resourceName}",
                new
                {
                    controller = "OrnamentEmbeddedResource",
                    action = "Index",
                    resourcePath = "images"
                },
                new[]
                {
                    "Ornament.Web.Controllers"
                }
                );

            //MemberShips/User/Edit/admin
            context.MapRoute(AreaName + "_EditUser",
                AreaName + "/User/Edit/{loginId}",
                new {action = "Edit", loginId = UrlParameter.Optional, controller = "User"}
                );

            context.MapRoute(
                AreaName + "_AssingUser",
                AreaName + "/User/Assign/{loginId}",
                new {action = "Assign", loginId = UrlParameter.Optional, controller = "User"},
                new[] {"Ornament.MemberShip.Plugin.Areas.MemberShips.Controllers"}
                );

            context.MapRoute(
                AreaName + "_default",
                AreaName + "/{controller}/{action}/{id}",
                new {action = "Index", id = UrlParameter.Optional},
                new[] {"Ornament.MemberShip.Plugin.Areas.MemberShips.Controllers"}
                );

            var helper = new AreaRegistrationHelper(this, context);
            helper.RegistSeajsModule("Scripts/User");
            helper.RegistSeajsModule("Scripts/Org");
            helper.RegistSeajsModule("Scripts/Role");
            helper.RegistSeajsModule("Scripts/Share");
            helper.RegistSeajsModule("Scripts/Permissions");

            base.RegisterArea(context, bus);
        }
Пример #6
0
        public virtual void RegisterArea(AreaRegistrationContext context, IApplicationBus bus)
        {
            IEnumerable <Type> apiControllers;
            IEnumerable <Type> controllers;

            GetInjectControllers(out controllers, out apiControllers);
            bus.Send(new IocControllerInjectMessageEvent(controllers, apiControllers));


            bus.Send(new PortableAreaStartupMessage(AreaName));

            RegisterAreaEmbeddedResources(bus);
        }
        public override void RegisterArea(AreaRegistrationContext context, IApplicationBus bus)
        {
            bus.Send(new DataInit());
            bus.Send(new NHRegisterEventMessage(typeof(IRegionDaoFactory), typeof(RegionDaoFactory)));
            var helper = new AreaRegistrationHelper(this,  context);
            helper.RegistSeajsModule("Scripts");
            context.MapRoute(
                AreaName + "_default",
                AreaRoutePrefix + "/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
                );

            base.RegisterArea(context, bus);
        }
        public override void RegisterArea(AreaRegistrationContext context, IApplicationBus bus)
        {
            bus.Send(new DataInit());
            bus.Send(new NHRegisterEventMessage(typeof(IRegionDaoFactory), typeof(RegionDaoFactory)));
            var helper = new AreaRegistrationHelper(this, context);

            helper.RegistSeajsModule("Scripts");
            context.MapRoute(
                AreaName + "_default",
                AreaRoutePrefix + "/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
                );

            base.RegisterArea(context, bus);
        }
        public override void RegisterArea(AreaRegistrationContext context, IApplicationBus bus)
        {
            bus.Send(new RegisterAreaMessage("Link to the Demo area", AreaName, DefaultController, DefaultAction));

            RegisterRoutes(context);
            RegisterAreaEmbeddedResources();
        }
Пример #10
0
 protected void ResgistSeajsFiles(IApplicationBus bus)
 {
     foreach (SeajsModel model in _seajsEmbeddedModulePath)
     {
         string   str      = string.Format("{0}/{1}", _context.AreaName, model.BundleNamee);
         string[] strArray =
             AssemblyResourceManager.GetResourceStoreForArea(_context.AreaName)
             .MatchPath("~/" + model.FilePath, ".js");
         if ((strArray == null) || (strArray.Length == 0))
         {
             throw new FileNotFoundException(string.Format("Not found an embed js file in {0}", str));
         }
         foreach (string str2 in strArray)
         {
             var bundle = new SeajsEmbedBundle(string.Format("~/{0}/{1}", str, str2), _context.AreaName,
                                               OrnamentContext.Configuration.GetSeajsCombine());
             if (model.BundleNamee != model.FilePath)
             {
                 string virtualPath = string.Format("~/areas/{0}/{1}/{2}", _context.AreaName, model.FilePath,
                                                    str2);
                 bundle = (SeajsEmbedBundle)bundle.Include(virtualPath);
             }
             var eventMessage = new SeajsModuleBundleEventMessage(bundle);
             bus.Send(eventMessage);
         }
     }
 }
Пример #11
0
        public override void RegisterArea(AreaRegistrationContext context, IApplicationBus bus)
        {
            bus.Send(new RegisterAreaMessage("Link to the Demo area", AreaName, DefaultController, DefaultAction));

            RegisterRoutes(context);

            RegisterAreaEmbeddedResources();
        }
Пример #12
0
        public virtual void RegisterArea(AreaRegistrationContext context, IApplicationBus bus)
        {
            bus.Send(new PortableAreaStartupMessage(AreaName));

            RegisterDefaultRoutes(context);

            RegisterAreaEmbeddedResources();
        }
public virtual void RegisterArea(AreaRegistrationContext context, IApplicationBus bus)
{
    bus.Send(new PortableAreaStartupMessage(AreaName));

            RegisterDefaultRoutes(context);

            RegisterAreaEmbeddedResources();
}
Пример #14
0
        public override void RegisterArea(System.Web.Mvc.AreaRegistrationContext context, IApplicationBus bus)
        {
            bus.Send(new RegistrationMessage("Registering Login Portable Area"));
            context.MapRoute(
                "login", 
                "login/{controller}/{action}", 
                new { controller = "login", action = "index" });

            this.RegisterAreaEmbeddedResources();
        }
Пример #15
0
        public override void RegisterArea(AreaRegistrationContext context, IApplicationBus bus)
        {
            bus.Send(new RegistrationMessage("Registering Login Portable Area"));

            context.MapRoute(
                "login",
                "login/{controller}/{action}",
                new {controller = "login", action = "index"});

            RegisterTheViewsInTheEmbeddedViewEngine(GetType());
        }
Пример #16
0
        public override void RegisterArea(AreaRegistrationContext context, IApplicationBus bus)
        {
            bus.Send(new RegistrationMessage("Registering Demo Task Portable Area"));

            base.RegisterArea(context, bus);

            context.MapRoute(
                "DemoTask",
                "DemoTask/{controller}/{action}",
                new { controller = "DemoTask", action = "index" });
        }
Пример #17
0
        public override void RegisterArea(AreaRegistrationContext context, IApplicationBus bus)
        {
            bus.Send(new RegistrationMessage("Registering Login Portable Area"));

            context.MapRoute(
                "login",
                "login/{controller}/{action}",
                new { controller = "login", action = "index" });

            this.RegisterAreaEmbeddedResources();
        }
Пример #18
0
        public override void RegisterArea(AreaRegistrationContext context, IApplicationBus bus)
        {
            bus.Send(new RegistrationMessage("Registering SketchDevView Portable Area"));

            base.RegisterArea(context, bus);

            context.MapRoute(
                "SketchFixView",
                "SketchFixView/{controller}/{action}",
                new { controller = "SketchFixView", action = "index" });
        }
        public override void RegisterArea(AreaRegistrationContext context, IApplicationBus bus)
        {
            bus.Send(new PortableAreaStartupMessage(AreaName));

            context.MapRoute(
                AreaName + "_default",
                base.AreaRoutePrefix + "/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional },
                new[] { "ED47.Stack.Web.Areas.Multilingual.Controllers", "MvcContrib" }
                );

            RegisterAreaEmbeddedResources();
        }
        public override void RegisterArea(AreaRegistrationContext context, IApplicationBus bus)
        {
            bus.Send(new RegistrationMessage("Registering Read Notification Portable Area"));

            base.RegisterArea(context, bus);

            context.MapRoute(
                "ReadNotification",
                "ReadNotification/{controller}/{action}",
                new { controller = "ReadNotification", action = "index" });

            //RegisterTheViewsInTheEmbeddedViewEngine(GetType());
        }
        public override void RegisterArea(AreaRegistrationContext context, IApplicationBus bus)
        {
            bus.Send(new NHRegisterEventMessage(typeof(IMessageDaoFactory), typeof(MessageDaoFactory)));
            //初始化数据
            bus.Send(new MessageInit());

            OrnamentContext.ResourceManager.Add("Template", typeof(MessageOperator));

            var helper = new AreaRegistrationHelper(this,context);

            helper.RegistScripts("Scripts/News");
            helper.RegistScripts("Scripts/NewsType");
            helper.RegistScripts("Scripts/NotifyType");
            helper.RegistScripts("Scripts/Template");
            helper.RegistScripts("Scripts/Config");

            context.MapRoute(
                AreaName + "_images",
                AreaRoutePrefix + "/images/{resourceName}",
                new
                {
                    controller = "OrnamentEmbeddedResource",
                    action = "Index",
                    resourcePath = "images"
                },
                new[]
                {
                    "Ornament.Web.Controllers"
                }
                );
            context.MapRoute(
                AreaName + "_default",
                AreaRoutePrefix + "/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
                );
            base.RegisterArea(context, bus);
        }
Пример #22
0
        public override void RegisterArea(AreaRegistrationContext context, IApplicationBus bus)
        {
            bus.Send(new NHRegisterEventMessage(typeof(IMessageDaoFactory), typeof(MessageDaoFactory)));
            //初始化数据
            bus.Send(new MessageInit());

            OrnamentContext.ResourceManager.Add("Template", typeof(MessageOperator));

            var helper = new AreaRegistrationHelper(this, context);

            helper.RegistScripts("Scripts/News");
            helper.RegistScripts("Scripts/NewsType");
            helper.RegistScripts("Scripts/NotifyType");
            helper.RegistScripts("Scripts/Template");
            helper.RegistScripts("Scripts/Config");

            context.MapRoute(
                AreaName + "_images",
                AreaRoutePrefix + "/images/{resourceName}",
                new
            {
                controller   = "OrnamentEmbeddedResource",
                action       = "Index",
                resourcePath = "images"
            },
                new[]
            {
                "Ornament.Web.Controllers"
            }
                );
            context.MapRoute(
                AreaName + "_default",
                AreaRoutePrefix + "/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
                );
            base.RegisterArea(context, bus);
        }
Пример #23
0
        public override void RegisterArea(AreaRegistrationContext context, IApplicationBus bus)
        {
            bus.Send(new RegistrationMessage("Registering Login Portable Area"));

            context.MapRoute("logoff", "login/iamouttahere",
                             new { controller = "login", action = "LogOff" });
            context.MapRoute("login", "login/signmein",
                             new { controller = "login", action = "Index" });
            context.MapRoute(
                "loginarea",
                "login/{controller}/{action}",
                new { controller = "login", action = "index" });

            RegisterTheViewsInTheEmbeddedViewEngine(GetType());
        }
        public override void RegisterArea(System.Web.Mvc.AreaRegistrationContext context, IApplicationBus bus)
        {
            //base.RegisterArea(context, bus);
            base.RegisterAreaEmbeddedResources();

            context.MapRoute("BlogEdit"
                , "Blog/Edit/{id}"
                , new { controller = "blogadmin", action = "EditEntry", area = "blog", id = UrlParameter.Optional });

            context.MapRoute("BlogDelete"
                , "Blog/Delete/{id}"
                , new { controller = "blogadmin", action = "DeleteEntry", area = "blog", id = UrlParameter.Optional });

            context.MapRoute("BlogDeleteConfirm"
                , "Blog/ConfirmDelete/{id}"
                , new { controller = "blogadmin", action = "ConfirmDeleteEntry", area = "blog", id = UrlParameter.Optional });

            context.MapRoute("BlogShort"
                , "Blog/{action}"
                , new { controller = "blog", action = "index", area = "blog" });

            context.MapRoute("BlogComment"
                , "Blog/Comment/{id}"
                , new { controller = "blog", action = "comment", area = "blog" });

            context.MapRoute("BlogAdmin"
                , "BlogAdmin/{action}"
                , new { controller = "BlogAdmin", action = "Index", area = "blog" });

            context.MapRoute("BlogResources"
                , "BlogAdmin/Resources/{resourceType}/{resourceName}"
                , new { controller = "Resource", action = "GetResource", area = "blog" });

            var configRequest = new ConfigRequestMessage();
            bus.Send(configRequest);

            if (configRequest.Result.Success)
                (SQLBlogEngine.Engine as IBlogEngine).StartEngine(configRequest.Result.Config);
            else
                (SQLBlogEngine.Engine as IBlogEngine).StartEngine(System.Configuration.ConfigurationManager.AppSettings["BlogEngine_ConfigName"]);
        }
 protected void ResgistSeajsFiles(IApplicationBus bus)
 {
     foreach (SeajsModel model in _seajsEmbeddedModulePath)
     {
         string str = string.Format("{0}/{1}", _context.AreaName, model.BundleNamee);
         string[] strArray =
             AssemblyResourceManager.GetResourceStoreForArea(_context.AreaName)
                 .MatchPath("~/" + model.FilePath, ".js");
         if ((strArray == null) || (strArray.Length == 0))
         {
             throw new FileNotFoundException(string.Format("Not found an embed js file in {0}", str));
         }
         foreach (string str2 in strArray)
         {
             var bundle = new SeajsEmbedBundle(string.Format("~/{0}/{1}", str, str2), _context.AreaName,
                 OrnamentContext.Configuration.GetSeajsCombine());
             if (model.BundleNamee != model.FilePath)
             {
                 string virtualPath = string.Format("~/areas/{0}/{1}/{2}", _context.AreaName, model.FilePath,
                     str2);
                 bundle=(SeajsEmbedBundle)bundle.Include(virtualPath);
             }
             var eventMessage = new SeajsModuleBundleEventMessage(bundle);
             bus.Send(eventMessage);
         }
     }
 }