From c3dfc8262960cb7d4402c08e48aedda2135ddecb Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Fri, 15 May 2015 10:27:36 +0200 Subject: [PATCH] Aggiunta sito di default (con db base x auth, verificare se tenere...) --- CMS_SC/App_Readme/Elmah.txt | 15 +++++++++++ CMS_SC/App_Start/AuthConfig.cs | 31 ++++++++++++++++++++++ CMS_SC/App_Start/BundleConfig.cs | 45 ++++++++++++++++++++++++++++++++ CMS_SC/App_Start/RouteConfig.cs | 19 ++++++++++++++ 4 files changed, 110 insertions(+) create mode 100644 CMS_SC/App_Readme/Elmah.txt create mode 100644 CMS_SC/App_Start/AuthConfig.cs create mode 100644 CMS_SC/App_Start/BundleConfig.cs create mode 100644 CMS_SC/App_Start/RouteConfig.cs diff --git a/CMS_SC/App_Readme/Elmah.txt b/CMS_SC/App_Readme/Elmah.txt new file mode 100644 index 0000000..784b309 --- /dev/null +++ b/CMS_SC/App_Readme/Elmah.txt @@ -0,0 +1,15 @@ +A new HTTP handler has been configured in your application for consulting the +error log and its feeds. It is reachable at elmah.axd under your application +root. If, for example, your application is deployed at http://www.example.com, +the URL for ELMAH would be http://www.example.com/elmah.axd. You can, of +course, change this path in your application's configuration file. + +ELMAH is also set up to be secure such that it can only be accessed locally. +You can enable remote access but then it is paramount that you secure access +to authorized users or/and roles only. This can be done using standard +authorization rules and configuration already built into ASP.NET. For more +information, see http://code.google.com/p/elmah/wiki/SecuringErrorLogPages on +the project site. + +Please review the commented out authorization section under + and make the appropriate changes. diff --git a/CMS_SC/App_Start/AuthConfig.cs b/CMS_SC/App_Start/AuthConfig.cs new file mode 100644 index 0000000..0b7a629 --- /dev/null +++ b/CMS_SC/App_Start/AuthConfig.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using Microsoft.AspNet.Membership.OpenAuth; + +namespace CMS_SC +{ + internal static class AuthConfig + { + public static void RegisterOpenAuth() + { + // See http://go.microsoft.com/fwlink/?LinkId=252803 for details on setting up this ASP.NET + // application to support logging in via external services. + + //OpenAuth.AuthenticationClients.AddTwitter( + // consumerKey: "your Twitter consumer key", + // consumerSecret: "your Twitter consumer secret"); + + //OpenAuth.AuthenticationClients.AddFacebook( + // appId: "your Facebook app id", + // appSecret: "your Facebook app secret"); + + //OpenAuth.AuthenticationClients.AddMicrosoft( + // clientId: "your Microsoft account client id", + // clientSecret: "your Microsoft account client secret"); + + //OpenAuth.AuthenticationClients.AddGoogle(); + } + } +} \ No newline at end of file diff --git a/CMS_SC/App_Start/BundleConfig.cs b/CMS_SC/App_Start/BundleConfig.cs new file mode 100644 index 0000000..26aa762 --- /dev/null +++ b/CMS_SC/App_Start/BundleConfig.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Optimization; + +namespace CMS_SC +{ + public class BundleConfig + { + // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254726 + public static void RegisterBundles(BundleCollection bundles) + { + bundles.Add(new ScriptBundle("~/bundles/WebFormsJs").Include( + "~/Scripts/WebForms/WebForms.js", + "~/Scripts/WebForms/WebUIValidation.js", + "~/Scripts/WebForms/MenuStandards.js", + "~/Scripts/WebForms/Focus.js", + "~/Scripts/WebForms/GridView.js", + "~/Scripts/WebForms/DetailsView.js", + "~/Scripts/WebForms/TreeView.js", + "~/Scripts/WebForms/WebParts.js")); + + bundles.Add(new ScriptBundle("~/bundles/MsAjaxJs").Include( + "~/Scripts/WebForms/MsAjax/MicrosoftAjax.js", + "~/Scripts/WebForms/MsAjax/MicrosoftAjaxApplicationServices.js", + "~/Scripts/WebForms/MsAjax/MicrosoftAjaxTimer.js", + "~/Scripts/WebForms/MsAjax/MicrosoftAjaxWebForms.js")); + + // Use the Development version of Modernizr to develop with and learn from. Then, when you’re + // ready for production, use the build tool at http://modernizr.com to pick only the tests you need + bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( + "~/Scripts/modernizr-*")); + + + bundles.Add(new ScriptBundle("~/bundles/jquery").Include( + "~/Scripts/jquery-{version}.js")); + + bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include( + "~/Scripts/jquery-ui-{version}.js")); + bundles.Add(new ScriptBundle("~/bundles/jSteamware").Include( + "~/Scripts/jSteamware*")); + } + } +} \ No newline at end of file diff --git a/CMS_SC/App_Start/RouteConfig.cs b/CMS_SC/App_Start/RouteConfig.cs new file mode 100644 index 0000000..b1d2eb6 --- /dev/null +++ b/CMS_SC/App_Start/RouteConfig.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.Routing; +using Microsoft.AspNet.FriendlyUrls; + +namespace CMS_SC +{ + public static class RouteConfig + { + public static void RegisterRoutes(RouteCollection routes) + { + //routes.EnableFriendlyUrls(); + var settings = new FriendlyUrlSettings(); + settings.AutoRedirectMode = RedirectMode.Permanent; + routes.EnableFriendlyUrls(settings); + } + } +}