Ver código fonte

NEW Restriction des droits et page pour les accès non authorisés

julien.legrand 9 anos atrás
pai
commit
0a38022351

+ 10 - 3
Web/CG67.FicheCollege.Web/Web.config

@@ -27,9 +27,7 @@
     </httpHandlers>
 
     <compilation debug="true" targetFramework="4.0"/>
-    <authentication mode="Forms">
-      <forms loginUrl="~/Account/Login.aspx" timeout="2880"/>
-    </authentication>
+    <authentication mode="Windows" />
     <membership>
       <providers>
         <clear/>
@@ -49,6 +47,11 @@
         <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/>
       </providers>
     </roleManager>
+  	<authorization>
+		  <allow roles="CG67\GS - Fiches collèges" />
+		  <deny roles="CG67\GS - Fiches collèges - exclusion" />
+		  <deny users="*" />
+    </authorization>
   </system.web>
   <system.webServer>
     <modules runAllManagedModulesForAllRequests="true"/>
@@ -57,6 +60,10 @@
              resourceType="Unspecified" preCondition="classicMode,runtimeVersionv4.0,bitness32"/>
       <add name="FileDownloadHandler" path="file.download" verb="*" type="CG67.FicheCollege.FileDownloadHandler, CG67.FicheCollege" allowPathInfo="false"  preCondition="integratedMode,runtimeVersionv4.0" />
     </handlers>
+    <httpErrors errorMode="DetailedLocalOnly">
+      <remove statusCode="401" subStatusCode="-1" />
+      <error statusCode="401" prefixLanguageFilePath="" path="/errors/unauthorized.html" responseMode="ExecuteURL" />
+    </httpErrors>
     <!--<staticContent>
       <mimeMap fileExtension="" mimeType="" />
     </staticContent>-->

+ 26 - 0
Web/CG67.FicheCollege.Web/errors/unauthorized.html

@@ -0,0 +1,26 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 //EN"
+          "http://www.w3.org/TR/html4/strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+    <meta http-equiv="X-UA-Compatible" content="IE=9" />
+    <title>
+        Fiche de synthèse collège
+    </title>
+    <link href="../css/fichecollegev2.css" rel="stylesheet" type="text/css" />
+    <link href="../css/Print.css" rel="stylesheet" type="text/css" />
+</head>
+<body id="Default">
+    <div id="header_index">
+        <img id="logo" src="../images/bandeau-fiche-college.png" alt="Logo du CG67" />
+    </div>
+    <div>
+        <h1>Accès non authorisé à la fiche collège</h1>
+        Pour obtenir l'accès, veuillez vous adresser au contacter le secrétariat du secteur collège :
+        <ul>
+            <li>Diana SBAFFI</li>
+            <li>Marie-Christine OBRY</li>
+        </ul>
+    </div>
+</body>
+</html>