From bdbe352c3c2dab7e918f6219cbb3a053be4cf781 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Wed, 24 Aug 2011 00:58:07 +0200 Subject: [PATCH] Use a different skin for the X.org auth-groupe-x page when performing group login. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaël Barrois --- modules/auth.php | 11 ++++++++ templates/skin/group_login.tpl | 62 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 templates/skin/group_login.tpl diff --git a/modules/auth.php b/modules/auth.php index 85d86d0..fde9de5 100644 --- a/modules/auth.php +++ b/modules/auth.php @@ -120,6 +120,17 @@ class AuthModule extends PLModule { if (!S::logged()) { $page->assign('referer', true); + $page->setTitle('Authentification'); + $page->setDefaultSkin('group_login'); + + if (Get::has('group')) { + $res = XDB::query('SELECT nom + FROM groups + WHERE diminutif = {?}', Get::s('group')); + $page->assign('group', $res->fetchOneCell()); + } else { + $page->assign('group', null); + } return PL_DO_AUTH; } diff --git a/templates/skin/group_login.tpl b/templates/skin/group_login.tpl new file mode 100644 index 0000000..047629e --- /dev/null +++ b/templates/skin/group_login.tpl @@ -0,0 +1,62 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2011 Polytechnique.org *} +{* http://opensource.polytechnique.org/ *} +{* *} +{* This program is free software; you can redistribute it and/or modify *} +{* it under the terms of the GNU General Public License as published by *} +{* the Free Software Foundation; either version 2 of the License, or *} +{* (at your option) any later version. *} +{* *} +{* This program is distributed in the hope that it will be useful, *} +{* but WITHOUT ANY WARRANTY; without even the implied warranty of *} +{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} +{* GNU General Public License for more details. *} +{* *} +{* You should have received a copy of the GNU General Public License *} +{* along with this program; if not, write to the Free Software *} +{* Foundation, Inc., *} +{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} +{* *} +{**************************************************************************} + +{include file=skin/common.doctype.tpl} + + {include file=skin/common.header.tpl} + + + {include core=plpage.devel.tpl} + {if !$simple} + {include file=skin/common.bandeau.tpl} + {/if} + {if t($smarty.session.suid)} + + {/if} + + {if $simple} +
+ {include core=plpage.content.tpl} +
+ {else} + + + + + + + +
+ [ LOGO ] + [ Polytechnique.org ]
+ [LES X SUR LE WEB] +
+ {include core=plpage.content.tpl} +
+ {/if} + + +{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} -- 2.1.4