--- /dev/null
+<?php
+require("auto.prepend.inc.php");
+require("validations.inc.php");
+new_admin_page('admin/valider.tpl',true);
+
+if(isset($_REQUEST["uid"]) and isset($_REQUEST["type"])
+ and isset($_REQUEST["stamp"])) {
+ $req = Validate::get_request($_REQUEST["uid"],$_REQUEST['type'],$_REQUEST["stamp"]);
+ if($req)
+ $page->assign('mail', $req->handle_formu());
+}
+
+$it = new ValidateIterator ();
+
+$valids = Array();
+while($valids[] = $it->next());
+array_pop($valids);
+
+$page->assign_by_ref('valids', $valids);
+
+$page->display();
+?>
<?php
require("auto.prepend.inc.php");
-new_skinned_page('login.tpl', AUTH_COOKIE, 'login.head.tpl');
+new_skinned_page('login.tpl', AUTH_COOKIE, true, 'login.head.tpl');
$param=mysql_query("SELECT date,naissance FROM auth_user_md5 WHERE user_id={$_SESSION['uid']};");
list($date,$naissance) = mysql_fetch_row($param);
<?php
require("auto.prepend.inc.php");
-new_skinned_page('preferences.tpl', AUTH_COOKIE, 'preferences.head.tpl');
+new_skinned_page('preferences.tpl', AUTH_COOKIE, false, 'preferences.head.tpl');
$has_cookie = (isset($_COOKIE['ORGaccess']) ? 'cookie' : '');
$page->assign('has_cookie', $has_cookie);
ini_set('include_path', ".:..:/home/x2000habouzit/dev/public/include:/home/x2000habouzit/dev/diogenes/lib/:/home/x2000habouzit/dev/smarty/");
require("xorg.common.inc.php");
-function _new_page($type, $tpl_name, $tpl_head, $min_auth, $admin=false) {
+function _new_page($type, $tpl_name, $tpl_head, $min_auth, $popup=false, $admin=false) {
global $page,$globals;
require("xorg.page.inc.php");
if(!empty($admin)) {
$page->assign('xorg_head', $tpl_head);
$page->assign('xorg_tpl', $tpl_name);
+ if($popup)
+ $page->assign('popup_enable', true);
$page->compile_check=true;
$page->caching=true;
}
-function new_skinned_page($tpl_name, $min_auth, $tpl_head="") {
- _new_page(SKINNED, $tpl_name, $tpl_head, $min_auth);
+function new_skinned_page($tpl_name, $min_auth, $popup=false, $tpl_head="") {
+ _new_page(SKINNED, $tpl_name, $tpl_head, $min_auth, $popup);
}
-function new_popup_page($tpl_name, $min_auth, $tpl_head="") {
- _new_page(SKINNED, $tpl_name, $tpl_head, $min_auth);
+function new_popup_page($tpl_name, $min_auth, $popup=false, $tpl_head="") {
+ _new_page(SKINNED, $tpl_name, $tpl_head, $min_auth, $popup);
}
-function new_admin_page($tpl_name, $tpl_head="") {
- _new_page(SKINNED, $tpl_name, $tpl_head, AUTH_MDP, true);
+function new_admin_page($tpl_name, $popup=false, $tpl_head="") {
+ _new_page(SKINNED, $tpl_name, $tpl_head, AUTH_MDP, $popup, true);
}
?>
return parent::get_unique_request($uid,'alias');
}
- function echo_formu() {
- require_once("popwin.inc.php");
-?>
- <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
- <input type="hidden" name="uid" value="<?php echo $this->uid ?>">
- <input type="hidden" name="type" value="<?php echo $this->type ?>">
- <input type="hidden" name="stamp" value="<?php echo $this->stamp ?>">
+ function formu() {
+ $old = $this->old ? "({$this->old})" : "";
+ $raison = nl2br(stripslashes(htmlentities($this->raison)));
+ return <<<________EOF
+ <form action="{$_SERVER['PHP_SELF']}" method="POST">
+ <input type="hidden" name="uid" value="{$this->uid}">
+ <input type="hidden" name="type" value="{$this->type}">
+ <input type="hidden" name="stamp" value="{$this->stamp}">
<table class="bicol" align="center" cellpadding="4" summary="Demande d'alias">
<tr>
<td>Demandeur :
</td>
- <td><a href="javascript:x()" onclick="popWin('/x.php?x=<?php echo $this->username; ?>')"><?php
- echo $this->prenom." ".$this->nom;?></a>
- <?php if(isset($this->old)) echo "({$this->old})";?>
+ <td><a href="javascript:x()" onclick="popWin('/x.php?x={$this->username}">
+ {$this->prenom} {$this->nom}</a> $old
</td>
</tr>
<tr>
<td>Nouvel alias :</td>
- <td><?php echo $this->alias;?>@melix.net</td>
+ <td>{$this->alias}@melix.net</td>
</tr>
<tr>
<td>Motif :</td>
<td style="border: 1px dotted inherit">
- <?php echo nl2br($this->raison);?>
+ $raison
</td>
</tr>
<tr>
</tr>
</table>
</form>
-<?php
+________EOF;
}
function handle_formu () {
|| ($_REQUEST['submit']!="Accepter" && $_REQUEST['submit']!="Refuser"))
return false;
- require_once("mailer.inc.php");
+ require_once("diogenes.mailer.inc.php");
$mxnet = $this->alias."@melix.net";
$mxorg = $this->alias."@melix.org";
- $mymail = new mailer('Equipe Polytechnique.org <validation+melix@polytechnique.org>',
+ $mymail = new DiogenesMailer('Equipe Polytechnique.org <validation+melix@polytechnique.org>',
$this->username."@polytechnique.org",
"[Polytechnique.org/MELIX] Demande de l'alias $mxnet par ".$this->username,
false, "validation+melix@m4x.org");
$message = wordwrap($message,78);
$mymail->setBody($message);
$mymail->send();
- echo "<br />Mail envoyé";
//Suppression de la demande
$this->clean();
+ return "Mail envoyé";
}
function commit () {
return false; // non unique
}
- function echo_formu() {
-?>
-<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
- <input type="hidden" name="uid" value="<?php echo $this->uid; ?>" />
- <input type="hidden" name="type" value="<?php echo $this->type; ?>" />
- <input type="hidden" name="stamp" value="<?php echo $this->stamp; ?>" />
- <table class="bicol" align="center" cellpadding="4" summary="Annonce emploi">
- <thead>
- <tr>
- <th colspan="2">
- Offre d'emploi
- </th>
- </tr>
- </thead>
- <tbody>
+ function formu() {
+ $ent = htmlentities($this->entreprise);
+ $mail = htmlentities($this->mail);
+ $titre = htmlentities($this->titre);
+ $texte = wordwrap($this->text, 80);
+ return <<<________EOF
+ <form action="{$_SERVER['PHP_SELF']}" method="POST">
+ <input type="hidden" name="uid" value="{$this->uid}" />
+ <input type="hidden" name="type" value="{$this->type}" />
+ <input type="hidden" name="stamp" value="{$this->stamp}" />
+ <table class="bicol" align="center" cellpadding="4" summary="Annonce emploi">
+ <thead>
+ <tr>
+ <th colspan="2">Offre d'emploi</th>
+ </tr>
+ </thead>
+ <tbody>
<tr>
- <td>
- Demandeur
- </td>
- <td>
- <?php echo htmlentities($this->entreprise).
- " (".htmlentities($this->mail).")";?>
- </td>
+ <td>Demandeur</td>
+ <td>$ent ($mail)</td>
</tr>
<tr>
- <td>
- Titre du post
- </td>
- <td>
- <?php echo htmlentities($this->titre);?>
- </td>
+ <td>Titre du post</td>
+ <td>$titre</td>
</tr>
<tr>
- <td colspan="2">
- <pre><?php echo $this->text;?></pre>
- </td>
+ <td colspan="2"><pre>{$texte}</pre></td>
</tr>
<tr>
- <td class="bouton" colspan="2">
- <input type="submit" name="submit" value="Accepter" />
- <input type="submit" name="submit" value="Refuser" />
- </td>
+ <td class="bouton" colspan="2">
+ <input type="submit" name="submit" value="Accepter" />
+ <input type="submit" name="submit" value="Refuser" />
+ </td>
</tr>
- </tbody>
- </table>
-</form>
-<?php
+ </tbody>
+ </table>
+ </form>
+________EOF;
}
function handle_formu() {
if (isset($_POST['submit'])) {
- require("mailer.inc.php");
- $mymail = new mailer('Equipe Polytechnique.org '
+ require("diogenes.mailer.inc.php");
+ $mymail = new DiogenesMailer('Equipe Polytechnique.org '
.'<validation+recrutement@polytechnique.org>',
$this->mail,
"[Polytechnique.org/EMPLOI] Annonce emploi : ".$this->entreprise,
$mymail->setBody($message);
$mymail->send();
$this->clean();
+ return "Mail envoyé";
}
}
return parent::get_unique_request($uid,'epouse');
}
- function echo_formu() {
- require_once("popwin.inc.php");
-?>
- <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
- <input type="hidden" name="uid" value="<?php echo $this->uid ?>">
- <input type="hidden" name="type" value="<?php echo $this->type ?>">
- <input type="hidden" name="stamp" value="<?php echo $this->stamp ?>">
+ function formu() {
+ $old_line = $this->oldepouse ? "({$this->oldepouse} - {$this->oldalias})" : "";
+ $homonyme = "";
+
+ if (!empty($this->homonyme)) $homonyme = <<<________EOF
+ <tr>
+ <td colspan="2">
+ <span class="erreur">Probleme d'homonymie !
+ <a href="javascript:x()" onclick="popWin('/x.php?x={$this->homonyme}"> {$this->homonyme}</a>
+ </span>
+ </td>
+ </tr>
+________EOF;
+
+ return <<<________EOF
+ <form action="{$_SERVER['PHP_SELF']}" method="POST">
+ <input type="hidden" name="uid" value="{$this->uid}">
+ <input type="hidden" name="type" value="{$this->type}">
+ <input type="hidden" name="stamp" value="{$this->stamp}">
<table class="bicol" align="center" cellpadding="4" summary="Demande d'alias d'épouse">
<tr>
<td>Demandeur :</td>
- <td><a href="javascript:x()" onclick="popWin('/x.php?x=<?php echo $this->username; ?>')">
- <?php echo $this->prenom." ".$this->nom;?>
+ <td><a href="javascript:x()" onclick="popWin('/x.php?x={$this->username}')">
+ {$this->prenom} {$this->nom}
</a>
- <?php if($this->oldepouse) echo "({$this->oldepouse} - {$this->oldalias})";?>
+ $oldline
</td>
</tr>
<tr>
<td>Épouse :</td>
- <td><?php echo $this->epouse;?></td>
+ <td>{$this->epouse}</td>
</tr>
<tr>
<td>Nouvel alias :</td>
- <td><?php echo $this->alias;?></td>
+ <td>{$this->alias}</td>
</tr>
-<?php
- if (!empty($this->homonyme)) {
-?>
- <tr>
- <td colspan="2">
- <span class="erreur">Probleme d'homonymie !
- <a href="javascript:x()" onclick="popWin('/x.php?x=<?php echo $this->homonyme; ?>')">
- <?php echo $this->homonyme;?>
- </a>
- </span>
- </td>
- </tr>
-<?php
- }
-?>
+ $homonyme
<tr>
<td align="center" valign="middle">
<input type="submit" name="submit" value="Accepter">
</tr>
</table>
</form>
-<?php
+________EOF;
}
function handle_formu () {
"L'équipe X.org";
$message = wordwrap($message,78);
- require_once("mailer.inc.php");
- $mymail = new mailer('Equipe Polytechnique.org <validation+epouse@polytechnique.org>',
+ require_once("diogenes.mailer.inc.php");
+ $mymail = new DiogenesMailer('Equipe Polytechnique.org <validation+epouse@polytechnique.org>',
$this->username."@polytechnique.org",
"[Polytechnique.org/EPOUSE] Changement de nom de mariage de ".$this->username,
false, "validation+epouse@m4x.org");
$mymail->setBody($message);
$mymail->send();
- echo "<br />Mail envoyé";
$this->clean();
+ return "Mail envoyé";
}
function commit () {
return false; //non unique
}
- function echo_formu() {
- require("popwin.inc.php");
-?>
-<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" name="modif">
- <input type="hidden" name="uid" value="<?php echo $this->uid; ?>" />
- <input type="hidden" name="type" value="<?php echo $this->type; ?>" />
- <input type="hidden" name="stamp" value="<?php echo $this->stamp; ?>" />
- <table class="bicol" width="98%">
- <thead>
- <tr>
- <th colspan="2">
- Événement
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- Posté par <?php echo "<a href=\"javascript:x()\" "
- ."onclick=\"popWin('../x.php?x={$this->username}')\">"
- ."{$this->prenom} {$this->nom} (X{$this->promo})</a> "
- ."[<a href=\"mailto:{$this->username}@polytechnique.org\">lui "
- ."écrire</a>]"; ?>
- </td>
- </tr>
- <tr>
- <td class="bicoltitre">
- Titre
- </td>
- <td>
- <?php echo $this->titre; ?>
- </td>
- </tr>
- <tr>
- <td class="bicoltitre">
- Texte
- </td>
- <td>
- <?php echo $this->texte; ?>
- </td>
- </tr>
- <tr>
- <td class="bicoltitre">
- Péremption
- </td>
- <td>
- <?php echo $this->peremption ?>
- </td>
- </tr>
- <tr>
- <td class="bicoltitre">
- Promos
- </td>
- <td>
- <?php echo $this->pmin; ?> - <?php echo $this->pmax; ?>
- </td>
- </tr>
- <tr>
- <td class="bicoltitre">
- Commentaire
- </td>
- <td>
- <?php echo $this->comment; ?>
- </td>
- </tr>
- <tr>
- <td class="bouton" colspan="2">
- <input type="submit" name="action" value="Valider" />
- <input type="submit" name="action" value="Invalider" />
- <input type="submit" name="action" value="Supprimer" />
- </td>
- </tr>
- </tbody>
- </table>
-</form>
-<?php
+ function formu() {
+ return <<<________EOF
+ <form action="{$_SERVER['PHP_SELF']}" method="POST" name="modif">
+ <input type="hidden" name="uid" value="{$this->uid}" />
+ <input type="hidden" name="type" value="{$this->type}" />
+ <input type="hidden" name="stamp" value="{$this->stamp}" />
+ <table class="bicol" width="98%">
+ <thead>
+ <tr>
+ <th colspan="2">Événement</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ Posté par <a href="javascript:x()" onclick="popWin('../x.php?x={$this->username}">
+ {$this->prenom} {$this->nom} (X{$this->promo})
+ </a>
+ [<a href="mailto:{$this->username}@polytechnique.org">lui écrire</a>]"
+ </td>
+ </tr>
+ <tr>
+ <th>Titre</th>
+ <td>{$this->titre}</td>
+ </tr>
+ <tr>
+ <th>Texte</th>
+ <td>{$this->texte}</td>
+ </tr>
+ <tr>
+ <th>Péremption</th>
+ <td>{$this->peremption}</td>
+ </tr>
+ <tr>
+ <th>Promos</th>
+ <td>{$this->pmin} - {$this->pmax}</td>
+ </tr>
+ <tr>
+ <th>Commentaire</th>
+ <td>{$this->comment}</td>
+ </tr>
+ <tr>
+ <td class="bouton" colspan="2">
+ <input type="submit" name="action" value="Valider" />
+ <input type="submit" name="action" value="Invalider" />
+ <input type="submit" name="action" value="Supprimer" />
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </form>
+________EOF;
}
function handle_formu() {
if (isset($_POST['action'])) {
- require("mailer.inc.php");
- $mymail = new mailer('Equipe Polytechnique.org '
+ require("diogenes.mailer.inc.php");
+ $mymail = new DiogenesMailer('Equipe Polytechnique.org '
.'<validation+recrutement@polytechnique.org>',
$this->username."@polytechnique.org",
"[Polytechnique.org/EVENEMENTS] Proposition d'événement",
"L'équipe X.org";
$message = wordwrap($message,78);
$mymail->setBody($message);
- if ($_POST['action']!="Supprimer")
+ if ($_POST['action']!="Supprimer")
$mymail->send();
$this->clean();
}
return false; // ben oui, c pas un objet unique !!!
}
- function echo_formu() {
- require_once("popwin.inc.php");
-?>
- <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
- <input type="hidden" name="uid" value="<?php echo $this->uid ?>">
- <input type="hidden" name="type" value="<?php echo $this->type ?>">
- <input type="hidden" name="stamp" value="<?php echo $this->stamp ?>">
+ function formu() {
+ $comment = nl2br($this->comment);
+
+ $pub = $this->publique ? "checked=\"checked\" " : "";
+ $lib = $this->libre ? "checked=\"checked\" " : "";
+ $fre = $this->freeins ? "checked=\"checked\" " : "";
+ $arc = $this->archive ? "checked=\"checked\" " : "";
+
+ $sql = mysql_query("SELECT username FROM auth_user_md5"
+ ." WHERE user_id IN ({$this->moderos})"
+ ." ORDER BY nom, prenom");
+ $tab = array();
+ while(list($username) = mysql_fetch_row($sql)) $tab[] = $username;
+ $modero = implode(', ', $tab);
+ mysql_free_result($sql);
+
+ $sql = mysql_query("SELECT username FROM auth_user_md5"
+ ." WHERE user_id IN ({$this->membres})"
+ ." ORDER BY nom, prenom");
+ $tab = array();
+ while(list($username) = mysql_fetch_row($sql)) $tab[] = $username;
+ $membres = implode(', ', $tab);
+ mysql_free_result($sql);
+
+ return <<<________EOF
+ <form action="{$_SERVER['PHP_SELF']}" method="POST">
+ <input type="hidden" name="uid" value="{$this->uid}">
+ <input type="hidden" name="type" value="{$this->type}">
+ <input type="hidden" name="stamp" value="{$this->stamp}">
<table class="bicol" align="center">
<tr>
<td>Demandeur :</td>
- <td><a href="javascript:x()" onclick="popWin('/x.php?x=<?php echo $this->username; ?>')">
- <?php echo $this->prenom." ".$this->nom;?>
+ <td><a href="javascript:x()" onclick="popWin('/x.php?x={$this->username}')">
+ {$this->prenom} {$this->nom}
</a>
</td>
</tr>
<tr>
<td>Motif :</td>
- <td><?php echo nl2br($this->comment);?>
+ <td>{$comment}
</td>
</tr>
<tr>
Alias :
</td>
<td style="border-top:1px dotted inherit">
- <input type="text" name="alias" value="<?php echo $this->alias ?>" />@polytechnique.org
+ <input type="text" name="alias" value="{$this->alias}" />@polytechnique.org
</td>
</tr>
<tr>
<td>Topic :</td>
- <td><input type="text" name="topic" size="60" value="<?php echo $this->topic ?>" />
+ <td><input type="text" name="topic" size="60" value="{$this->topic}" />
</td>
</tr>
<tr>
<td>Propriétés :</td>
<td>
- <input type="checkbox" name="publique" <?php
- echo($this->publique?"checked=\"checked\"":"")
- ?>/>Publique
- <input type="checkbox" name="libre" <?php
- echo($this->libre?"checked=\"checked\"":"")
- ?>/>Libre
- <input type="checkbox" name="freeins" <?php
- echo($this->freeins?"checked=\"checked\"":"")
- ?>/>Freeins
- <input type="checkbox" name="archive" <?php
- echo($this->archive?"checked=\"checked\"":"")
- ?>/>Archive
+ <input type="checkbox" name="publique" $pub/>Publique
+ <input type="checkbox" name="libre" $lib/>Libre
+ <input type="checkbox" name="freeins" $fre/>Freeins
+ <input type="checkbox" name="archive" $arc/>Archive
</td>
</tr>
<tr>
- <td style="border-top:1px dotted inherit">
- Modéros :
- </td>
- <td style="border-top:1px dotted inherit">
-<?php
- $sql = mysql_query("SELECT username FROM auth_user_md5"
- ." WHERE user_id IN ({$this->moderos})"
- ." ORDER BY nom, prenom");
- $tab = array();
- while(list($username) = mysql_fetch_row($sql))
- $tab[] = $username;
- echo implode(', ', $tab);
- mysql_free_result($sql);
-?>
- </td>
+ <td style="border-top:1px dotted inherit">Modéros :</td>
+ <td style="border-top:1px dotted inherit">$moderos</td>
</tr>
<tr>
<td>Membres :</td>
- <td><?php
- $sql = mysql_query("SELECT username FROM auth_user_md5"
- ." WHERE user_id IN ({$this->membres})"
- ." ORDER BY nom, prenom");
- $tab = array();
- while(list($username) = mysql_fetch_row($sql))
- $tab[] = $username;
- echo implode(', ', $tab);
- mysql_free_result($sql);
- ?>
- </td>
+ <td>$membres</td>
</tr>
<tr>
<td align="center" valign="middle" style="border-top:1px dotted inherit">
</tr>
</table>
</form>
-<?php
+________EOF;
}
function handle_formu () {
$this->clean();
$this->submit();
- require_once("mailer.inc.php");
+ require_once("diogenes.mailer.inc.php");
- $mymail = new mailer('Equipe Polytechnique.org <validation+listes@polytechnique.org>',
+ $mymail = new DiogenesMailer('Equipe Polytechnique.org <validation+listes@polytechnique.org>',
$this->username."@polytechnique.org",
"[Polytechnique.org/LISTES] Demande de la liste {$this->alias} par ".$this->username,
false, "validation+listes@m4x.org");
$message = wordwrap($message,78);
$mymail->setBody($message);
$mymail->send();
- echo "<p class=\"normal\">Mail envoyé</p>";
- return true;
+ return "Mail envoyé";
}
function commit () {
}
function echo_formu() {
- require_once("popwin.inc.php");
-?>
- <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
- <input type="hidden" name="uid" value="<?php echo $this->uid ?>">
- <input type="hidden" name="type" value="<?php echo $this->type ?>">
- <input type="hidden" name="stamp" value="<?php echo $this->stamp ?>">
+ $url_app = isset($_COOKIE[session_name()]) ? "" : "&".SID;
+ return <<<________EOF
+ <form action="{$_SERVER['PHP_SELF']}" method="POST">
+ <input type="hidden" name="uid" value="{$this->uid}">
+ <input type="hidden" name="type" value="{$this->type}">
+ <input type="hidden" name="stamp" value="{$this->stamp}">
<table class="bicol" align="center" summary="Demande d'alias">
<tr>
<td>Demandeur :</td>
- <td><a href="javascript:x()" onclick="popWin('/x.php?x=<?php echo $this->username; ?>')">
- <?php echo $this->prenom." ".$this->nom;?>
+ <td><a href="javascript:x()" onclick="popWin('/x.php?x={$this->username}')">
+ {$this->prenom} {$this->nom}
</a>
</td>
</tr>
<tr>
<td align="center" valign="middle" colspan="2">
- <img src="<?php echo "../getphoto.php?x=".$this->uid.
- (isset($_COOKIE[session_name()]) ? "" : "&".SID);?>" width=110 alt=" [ PHOTO ] " />
- <img src="<?php echo "../getphoto.php?x=".$this->uid."&req=true".
- (isset($_COOKIE[session_name()]) ? "" : "&".SID);?>" width=110 alt=" [ PHOTO ] " />
+ <img src="../getphoto.php?x={$this->uid}$url_app" width=110 alt=" [ PHOTO ] " />
+ <img src="../getphoto.php?x={$this->uid}&req=true$url_app" width=110 alt=" [ PHOTO ] " />
</td>
</tr>
<tr>
</tr>
</table>
</form>
-<?php
+________EOF;
}
function handle_formu () {
"L'équipe X.org";
$message = wordwrap($message,78);
- require_once("mailer.inc.php");
- $mymail = new mailer('Equipe Polytechnique.org <validation+trombino@polytechnique.org>',
+ require_once("diogenes.mailer.inc.php");
+ $mymail = new DiogenesMailer('Equipe Polytechnique.org <validation+trombino@polytechnique.org>',
$this->username."@polytechnique.org",
"[Polytechnique.org/PHOTO] Changement de photo de ".$this->username,
false, "validation+trombino@m4x.org");
$mymail->setBody($message);
$mymail->send();
- echo "<br />Mail envoyé";
$this->clean();
+ return "Mail envoyé";
}
function commit () {
return parent::get_request($uid,'sondage',$stamp);
}
- function echo_formu() {
- require_once("popwin.inc.php");
-?>
- <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
- <input type="hidden" name="uid" value="<?php echo $this->uid ?>">
- <input type="hidden" name="type" value="<?php echo $this->type ?>">
- <input type="hidden" name="stamp" value="<?php echo $this->stamp ?>">
+ function formu() {
+ global $baseurl;
+ $url = "$baseurl/sondage/questionnaire.php?SID=".$this->sid;
+ return <<<________EOF
+ <form action="{$_SERVER['PHP_SELF']}" method="POST">
+ <input type="hidden" name="uid" value="{$this->uid}">
+ <input type="hidden" name="type" value="{$this->type}">
+ <input type="hidden" name="stamp" value="{$this->stamp}">
<table class="bicol" align="center" cellpadding="4" summary="Sondage">
<tr>
<td>Demandeur :
</td>
- <td><a href="javascript:x()" onclick="popWin('/x.php?x=<?php echo $this->username; ?>')"><?php
- echo $this->prenom." ".$this->nom;?></a>
+ <td><a href="javascript:x()" onclick="popWin('/x.php?x={$this->username}')">
+ {$this->prenom} {$this->nom}</a>
<?php if(isset($this->old)) echo "({$this->old})";?>
</td>
</tr>
<tr>
<td>Titre du sondage :</td>
- <td><?php echo $this->titre;?></td>
+ <td>{$this->titre}</td>
</tr>
<tr>
<td>Prévisualisation du sondage :</td>
- <td><a href = <?php
- global $baseurl;
- echo "\"$baseurl/sondage/questionnaire.php?SID=".$this->sid.'"';
- echo ' target = "_blank">'.$this->titre;
- ?>
- </a></td>
+ <td><a href="$url" target="_blank">{$this->titre}</a>
+ </td>
</tr>
<tr>
<td>Alias du sondage :</td>
- <td><input type="text" name="alias" value="<?php echo $this->alias;?>"> (ne doit
+ <td><input type="text" name="alias" value="{$this->alias}"> (ne doit
pas contenir le caractère ')</td>
</tr>
<tr>
</tr>
</table>
</form>
-<?php
+________EOF;
}
function handle_formu () {
$this->alias=$alias;
}
- require_once("mailer.inc.php");
+ require_once("diogenes.mailer.inc.php");
$lien = "$baseurl/sondage/questionnaire.php?alias=".urlencode($this->alias);
$titre = '"'.str_replace(''',"'",$this->titre).'"';
- $mymail = new mailer('Equipe Polytechnique.org <validation+sondage@polytechnique.org>',
+ $mymail = new DiogenesMailer('Equipe Polytechnique.org <validation+sondage@polytechnique.org>',
$this->username."@polytechnique.org",
"[Polytechnique.org/SONDAGE] Demande de validation du sondage $titre par ".$this->username,
false, "validation+sondage@m4x.org");
$message = wordwrap($message,78);
$mymail->setBody($message);
$mymail->send();
- echo "<br />Mail envoyé";
//Suppression de la demande
$this->clean();
+ return "Mail envoyé";
}
function commit () {
<?php
/* vim: set expandtab shiftwidth=4 tabstop=4 softtabstop=4 textwidth=100:
- * $Id: validations.inc.php,v 1.1 2004-01-26 22:29:02 x2000habouzit Exp $
+ * $Id: validations.inc.php,v 1.2 2004-01-27 09:08:56 x2000habouzit Exp $
*
*/
.($this->unique ? "" : " AND stamp='".$this->stamp."'"));
}
- /** doit afficher le fomulaire de validation de la donnée
+ /** doit retourner le fomulaire de validation de la donnée
* XXX la fonction est "virtuelle" XXX
* XXX doit définir les variables $uid et $stamp en hidden XXX
*/
- function echo_formu() { }
+ function formu() { }
/** fonction à réaliser en cas de valistion du formulaire
* XXX la fonction est "virtuelle" XXX
*/
--- /dev/null
+{* $Id: valider.tpl,v 1.1 2004-01-27 09:08:57 x2000habouzit Exp $ *}
+
+{dynamic}
+{$mail}
+{foreach item=valid from=$valids}
+<br />
+{$valid->formu()}
+{/foreach}
+{/dynamic}
+
+{* vim:set et sw=2 sts=2 sws=2: *}
-{* $Id: login.head.tpl,v 1.2 2004-01-26 12:45:07 x2000habouzit Exp $ *}
+{* $Id: login.head.tpl,v 1.3 2004-01-27 09:08:56 x2000habouzit Exp $ *}
{literal}
<style type="text/css" media="screen">
-->
</style>
{/literal}
- <script language="javascript" src="{"javascript/popwin.js.php"|url}" type="text/javascript"></script>
{* vim:set et sw=2 sts=2 sws=2: *}
-{* $Id: common.header.tpl,v 1.2 2004-01-26 12:36:32 x2000habouzit Exp $ *}
+{* $Id: common.header.tpl,v 1.3 2004-01-27 09:08:57 x2000habouzit Exp $ *}
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="Le Portail des Polytechniciens" />
Anciens eleves Polytechnique, annuaire email, Alumni
</title>
<script language="JavaScript" type="text/javascript" src="javascript/getnow.js"></script>
+{if $popup_enable}
+ <script language="javascript" type="text/javascript" src="javascript/popwin.js.php"> </script>
+{/if}
{* vim:set et sw=2 sts=2 sws=2: *}