From 926edcd1d317885ef067c95fdb664b7e9ec7a77c Mon Sep 17 00:00:00 2001
From: x2000habouzit
Date: Wed, 5 Jul 2006 07:15:05 +0000
Subject: [PATCH] various path fixes.
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@377 839d8a87-29fc-0310-9880-83ba4fa771e5
---
modules/marketing.php | 26 +++++++-----
templates/marketing/private.tpl | 89 ++++++++++++++++++++---------------------
2 files changed, 59 insertions(+), 56 deletions(-)
diff --git a/modules/marketing.php b/modules/marketing.php
index b26040e..3684e33 100644
--- a/modules/marketing.php
+++ b/modules/marketing.php
@@ -79,7 +79,8 @@ class MarketingModule extends PLModule
return PL_OK;
}
- function handler_private(&$page, $uid = null)
+ function handler_private(&$page, $uid = null,
+ $action = null, $value = null)
{
global $globals;
@@ -89,6 +90,8 @@ class MarketingModule extends PLModule
return PL_NOT_FOUND;
}
+ $page->assign('path', 'marketing/private/'.$uid);
+
$res = $globals->xdb->query("SELECT nom, prenom, promo, matricule
FROM auth_user_md5
WHERE user_id={?} AND perms='pending'", $uid);
@@ -105,44 +108,45 @@ class MarketingModule extends PLModule
$page->kill('uid invalide');
}
- if (Env::has('del')) {
+ if ($action == 'del') {
$globals->xdb->execute('DELETE FROM register_marketing WHERE uid={?} AND email={?}',
- $uid, Env::get('del'));
+ $uid, $value);
}
- if (Env::has('rel') && !Env::has('valider')) {
+ if ($action == 'rel') {
require_once('marketing.inc.php');
- list($to, $title, $text) = mark_text_mail($uid, Env::get('rel'));
- $from = mark_from_mail($uid, Env::get('rel'));
+ list($to, $title, $text) = mark_text_mail($uid, $value);
+ $from = mark_from_mail($uid, $value);
$page->assign('rel_from_user', $from);
$page->assign('rel_from_staff',
"\"Equipe Polytechnique.org\" ");
$page->assign('rel_to', $to);
$page->assign('rel_title', $title);
$page->assign('rel_text', $text);
+ $page->assign('rel_email', $value);
}
- if (Env::get('valider') == 'Envoyer') {
+ if ($action == 'relforce') {
require_once('marketing.inc.php');
- mark_send_mail($uid, Env::get('rel'), Env::get('from'),
+ mark_send_mail($uid, $value, Env::get('from'),
Env::get('to'), Env::get('title'),
Env::get('message'));
$page->trig("Mail envoyé");
}
- if (Env::has('relance')) {
+ if ($action == 'insrel') {
require_once('marketing.inc.php');
if (relance($uid)) {
$page->trig('relance faite');
}
}
- if (Env::get('action') == 'ajouter') {
+ if ($action == 'add' && Post::has('email') && Post::has('type')) {
$globals->xdb->execute(
"INSERT INTO register_marketing
SET uid = {?}, sender = {?}, email = {?},
date = NOW(), type = {?}",
- $uid, Session::get('uid'), Env::get('email'), Env::get('type'));
+ $uid, Session::get('uid'), Post::get('email'), Post::get('type'));
}
$res = $globals->xdb->iterator(
diff --git a/templates/marketing/private.tpl b/templates/marketing/private.tpl
index 11fa083..b0aa4b1 100644
--- a/templates/marketing/private.tpl
+++ b/templates/marketing/private.tpl
@@ -45,58 +45,58 @@ sa derni
{/if}
-[le relancer]
+[le relancer]
{/if}
Adresses connues
-
{if $rel_to}
-