Skip to content

Commit

Permalink
Nice 403 error page
Browse files Browse the repository at this point in the history
  • Loading branch information
nono committed Mar 21, 2011
1 parent c11a373 commit 5e1ed8f
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/controllers/application_controller.rb
Expand Up @@ -5,12 +5,17 @@ class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :seo_filter
helper_method :url_for_content, :path_for_content, :current_user
rescue_from Canable::Transgression, :with => :error_403

VALID_ORDERS = %w(created_at score interest last_commented_at comments_count)
REVISION = `git rev-parse HEAD`.chomp

protected

def error_403
render :file => "#{Rails.public_path}/errors/403.html", :status => 403, :layout => false
end

def seo_filter
request.session_options[:secure] = request.ssl?
headers["X-Served-By"] = Process.pid.to_s
Expand Down
49 changes: 49 additions & 0 deletions public/errors/403.html
@@ -0,0 +1,49 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<title>LinuxFr.org &gt;&gt; Erreur 403</title>
<!--[if (!IE)|(gte IE 8)]><!-->
<link href="/assets/default-datauri.css" media="screen, projection" rel="stylesheet" type="text/css" />
<!--<![endif]-->
<!--[if lte IE 7]>
<link href="/assets/default-mhtml.css" media="screen, projection" rel="stylesheet" type="text/css" />
<![endif]-->
<link rel="shortcut icon" type="image/x-icon" href="/favicon.png" />
<!--[if IE]><script src="/javascripts/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="/javascripts/IE9.js"></script><![endif]-->
</head>

<body id="error400">
<div id="top"></div>
<nav id="site">
<div class="go_to_content"><a href="#container">Aller au contenu</a></div>
<ul>
<li><a href="/">Accueil</a></li>
<li><a href="/news">Dépêches</a></li>
<li><a href="/journaux">Journaux</a></li>
<li><a href="/forums">Forums</a></li>
<li><a href="/sondages">Sondages</a></li>
<li><a href="/wiki">Wiki</a></li>
<li><a href="/suivi">Suivi</a></li>
<li><a href="/plan">Plan</a></li>
</ul>
<form action="/recherche" method="get">
<input id="query" name="q" type="search" placeholder="Entrer un mot-clé" />
<input type="submit" value="Rechercher" />
</form>
</nav>

<aside id="sidebar">
<header id="branding">
<h1 style="background-image: url('/images/logos/linuxfr2_classic.png');" title="Le logo de LinuxFr.org"><a href="/">LinuxFr.org</a></h1>
</header>
</aside>

<section id="container">
<h1>Erreur 403</h1>
<p>
Accès interdit à cette page !
</p>
<img src="/images/403.png" alt="" />
</section>
</body>
Binary file added public/images/403.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5e1ed8f

Please sign in to comment.