From b9dcbdddb6ac127cb08bcc6c279ec58d0663c3a0 Mon Sep 17 00:00:00 2001 From: x2003bruneau Date: Mon, 26 Feb 2007 17:03:09 +0000 Subject: [PATCH] Close #595. Factorize [1479] in order to use it in several purpose git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1523 839d8a87-29fc-0310-9880-83ba4fa771e5 --- ChangeLog | 3 +++ htdocs/javascript/ajax.js | 40 ++++++++++++++++++++++++++++++++++++++++ modules/xnetgrp.php | 14 +++++++++----- templates/emails/antispam.tpl | 26 ++++++++++++++++++-------- templates/emails/index.tpl | 42 ++++-------------------------------------- templates/emails/redirect.tpl | 21 +++++++++++++++++---- templates/search/quick.tpl | 2 +- 7 files changed, 92 insertions(+), 56 deletions(-) diff --git a/ChangeLog b/ChangeLog index 604250f..91911aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,9 @@ Bug/Wish: * Carnet: - #510: Use RSS hash to get iCal -FRU + * Emails: + - #595: Update antispam description -FRU + * Profile: - Better checks on image type for photos -FRU diff --git a/htdocs/javascript/ajax.js b/htdocs/javascript/ajax.js index 2bf3c02..71382a9 100644 --- a/htdocs/javascript/ajax.js +++ b/htdocs/javascript/ajax.js @@ -69,4 +69,44 @@ Ajax = { } } +var currentTempMessage = 0; +function setOpacity(obj, opacity) +{ + opacity = (opacity == 100)?99:opacity; + // IE + obj.style.filter = "alpha(opacity:"+opacity+")"; + // Safari < 1.2, Konqueror + obj.style.KHTMLOpacity = opacity/100; + // Old Mozilla + obj.style.MozOpacity = opacity/100; + // Safari >= 1.2, Firefox and Mozilla, CSS3 + obj.style.opacity = opacity/100 +} + +function _showTempMessage(id, state, back) +{ + var obj = document.getElementById(id); + if (currentTempMessage != state) { + return; + } + setOpacity(obj, back * 5); + if (back > 0) { + setTimeout("_showTempMessage('" + id + "', " + currentTempMessage + "," + (back-1) + ")", 100); + } else { + obj.innerHTML = ""; + } +} + +function showTempMessage(id, message, success) +{ + var obj = document.getElementById(id); + obj.innerHTML = (success ? " " + : " ") + message; + obj.style.fontWeight = "bold"; + obj.style.color = (success ? "green" : "red");; + currentTempMessage++; + setOpacity(obj, 100); + setTimeout("_showTempMessage('" + id + "', " + currentTempMessage + ", 20)", 700); +} + // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: diff --git a/modules/xnetgrp.php b/modules/xnetgrp.php index b677692..2383b30 100644 --- a/modules/xnetgrp.php +++ b/modules/xnetgrp.php @@ -656,11 +656,14 @@ class XnetGrpModule extends PLModule return; } - list(,$fqdn) = explode('@', $email); - $fqdn = strtolower($fqdn); - $x = ($fqdn == 'polytechnique.org' || $fqdn == 'melix.org' || - $fqdn == 'm4x.org' || $fqdn == 'melix.net'); - + if (strpos($email, '@') === false) { + $x = true; + } else { + list(,$fqdn) = explode('@', $email, 2); + $fqdn = strtolower($fqdn); + $x = ($fqdn == 'polytechnique.org' || $fqdn == 'melix.org' || + $fqdn == 'm4x.org' || $fqdn == 'melix.net'); + } if ($x) { require_once 'user.func.inc.php'; if ($forlife = get_user_forlife($email)) { @@ -675,6 +678,7 @@ class XnetGrpModule extends PLModule $page->trig($email." n'est pas un alias polytechnique.org valide"); } } else { + require_once 'xorg.misc.inc.php'; if (isvalid_email($email)) { if (Env::v('x') && Env::has('userid') && Env::i('userid')) { $uid = Env::i('userid'); diff --git a/templates/emails/antispam.tpl b/templates/emails/antispam.tpl index b3ad69e..4ec1279 100644 --- a/templates/emails/antispam.tpl +++ b/templates/emails/antispam.tpl @@ -23,21 +23,31 @@ {include file=../spool/wiki.d/cache_Xorg.Antispam.tpl part=1 included=1} +
Choisis ton propre réglage : - - + +
- - + +
- - + +
- - + +
+

+ {include file=../spool/wiki.d/cache_Xorg.Antispam.tpl part=2 included=1} {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/templates/emails/index.tpl b/templates/emails/index.tpl index 04048cb..fa0d53e 100644 --- a/templates/emails/index.tpl +++ b/templates/emails/index.tpl @@ -26,43 +26,9 @@ {literal} {/literal} @@ -80,7 +46,7 @@ function bestaliasUpdated(htmltxt, back) {
{/iterate} -
+

L'adresse cochée est celle que tu utilises le plus (et qui sera donc affichée sur ta carte de visite, ta fiche, etc...). Coche une autre case pour en changer ! diff --git a/templates/emails/redirect.tpl b/templates/emails/redirect.tpl index 3147c30..8cda86e 100644 --- a/templates/emails/redirect.tpl +++ b/templates/emails/redirect.tpl @@ -72,7 +72,17 @@ {#globals.mail.domain2#}, ou lorsque tu utilises notre service d'envoi de courrier SMTP sécurisé.

- + + + +

@@ -81,7 +91,7 @@ - {foreach from=$emails item=e} + {foreach from=$emails item=e name=redirect} + active}checked="checked"{/if} + {if $smarty.foreach.redirect.total eq 1}disabled="disabled"{/if} + onchange="Ajax.update_html(null,'{$globals->baseurl}/emails/redirect/'+(this.checked?'':'in')+'active/{$e->email}', redirectUpdate)" />
Réécriture  
@@ -92,9 +102,12 @@ - active}checked="checked"{/if} onclick="Ajax.update_html(null,'{$globals->baseurl}/emails/redirect/'+(this.checked?'':'in')+'active/{$e->email}')"/> - {foreach from=$alias item=a}