$globals->asso('id'));
list($logo, $logo_mime) = $res->fetchOneRow();
+ pl_cached_dynamic_content_headers(empty($logo) ? "image/jpeg" : $logo_mime);
if (!empty($logo)) {
- header("Content-type: $mime");
- header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
- header('Last-Modified:' . gmdate('D, d M Y H:i:s') . ' GMT');
- header('Cache-Control: no-cache, must-revalidate');
- header('Pragma: no-cache');
echo $logo;
} else {
- header('Content-type: image/jpeg');
- header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
- header('Last-Modified:' . gmdate('D, d M Y H:i:s') . ' GMT');
- header('Cache-Control: no-cache, must-revalidate');
- header('Pragma: no-cache');
- readfile(dirname(__FILE__).'/../htdocs/images/dflt_carre.jpg');
+ readfile(dirname(__FILE__) . '/../htdocs/images/dflt_carre.jpg');
}
-
exit;
}
if (Post::has('submit')) {
S::assert_xsrf_token();
- $flags = new PlFlagSet('wiki_desc');
+ $flags = new PlFlagSet();
if (Post::has('notif_unsub') && Post::i('notif_unsub') == 1) {
$flags->addFlag('notif_unsub');
}
}
if (S::admin()) {
if (Post::v('mail_domain') && (strstr(Post::v('mail_domain'), '.') === false)) {
- $page->trigError("le domaine doit être un FQDN (aucune modif effectuée) !!!");
+ $page->trigError('Le domaine doit être un FQDN (aucune modification effectuée) !!!');
return;
}
XDB::execute(
$page->assign('dom', $dom);
$page->assign('super', true);
}
- if (!$globals->asso('wiki_desc') && $globals->asso('descr')) {
- $page->trigWarning("Attention, le format de la description a changé et utilise désormais la syntaxe wiki "
- . "intégrée au site. Il te faudra probablement adapter le formatage du texte actuel pour "
- . "qu'il s'affiche correctement avec cette nouvelle syntaxe.");
- }
}
function handler_mail(&$page)
if ($upload) {
$upload->rm();
}
- $page->killSuccess("Email envoyé !");
+ $page->killSuccess("Email envoyé !");
$page->assign('sent', true);
}
}
while (list($char, $nb) = $res->next()) {
$alphabet[] = $char;
$nb_tot += $nb;
- if (Env::has($group) && $char == strtoupper(Env::v($group))) {
+ if (Env::has($group) && $char == mb_strtoupper(Env::v($group))) {
$tot = $nb;
}
}
GROUP BY m.uid
ORDER BY nom, prenom",
$globals->mail->domain, $globals->asso('id'));
- header('Content-Type: text/x-csv; charset=utf-8;');
- header('Pragma: ');
- header('Cache-Control: ');
+ pl_content_headers("text/x-csv");
$page->changeTpl('xnetgrp/annuaire-csv.tpl', NO_SKIN);
$page->assign('ann', $ann);
}
// Handles the membership request.
if ($already_member) {
$this->removeSubscriptionRequest($user->id());
- $page->kill($user->fullName() . " est déjà membre du groupe !");
+ $page->kill($user->fullName() . ' est déjà membre du groupe !');
} elseif (Env::has('accept')) {
S::assert_xsrf_token();
}
if (is_member()) {
- $page->kill("Tu es déjà membre !");
+ $page->kill("Tu es déjà membre !");
return;
}
. "à l'adresse : support@polytechnique.org\n";
if (!$to) {
- $to = $globals->asso("mail").", support@polytechnique.org";
+ $to = ($globals->asso('mail') != '') ? $globals->asso('mail') . ', ' : '';
+ $to .= 'support@polytechnique.org';
$append = "\n-- \nLe groupe ".$globals->asso("nom")
." n'a pas d'administrateur, l'équipe de"
." Polytechnique.org a été prévenue et va rapidement"
pl_redirect("member/$email");
}
} else {
- $page->trigError("« <strong>$email</strong> » n'est pas une adresse email valide.");
+ $page->trigError("« <strong>$email</strong> » n'est pas une adresse email valide.");
}
}
}
function handler_admin_member_new_ajax(&$page)
{
- header('Content-Type: text/html; charset="UTF-8"');
+ pl_content_headers("text/html");
$page->changeTpl('xnetgrp/membres-new-search.tpl', NO_SKIN);
$res = null;
if (Env::has('login')) {
}
if ($this->unsubscribe($user)) {
- $page->trigSuccess("{$user['prenom']} {$user['nom']} a été désabonné du groupe !");
+ $page->trigSuccess("{$user['prenom']} {$user['nom']} a été désabonné du groupe !");
} else {
- $page->trigWarning("{$user['prenom']} {$user['nom']} a été désabonné du groupe, mais des erreurs subsistent !");
+ $page->trigWarning("{$user['prenom']} {$user['nom']} a été désabonné du groupe, mais des erreurs subsistent !");
}
}
$perms ? 'admin' : 'membre', $comm,
$user['uid'], $globals->asso('id'));
if ($perms != $user['perms']) {
- $page->trigSuccess('Permissions modifiées !');
+ $page->trigSuccess('Permissions modifiées !');
}
if ($comm != $user['comm']) {
$page->trigSuccess('Commentaire mis à jour.');
$res = XDB::query("SELECT * FROM groupex.announces_photo WHERE eid = {?}", $eid);
if ($res->numRows()) {
$photo = $res->fetchOneAssoc();
- header('Content-Type: image/' . $photo['attachmime']);
+ pl_cached_dynamic_content_headers("image/" . $photo['attachmime']);
echo $photo['attach'];
exit;
}
} else {
$upload = new PlUpload(S::user()->login(), 'xnetannounce');
if ($upload->exists() && $upload->isType('image')) {
- header('Content-Type: ' . $upload->contentType());
+ pl_cached_dynamic_content_headers($upload->contentType());
echo $upload->getContents();
exit;
}
}
global $globals;
- header('Content-Type: image/png');
+ pl_cached_dynamic_content_headers("image/png");
echo file_get_contents($globals->spoolroot . '/htdocs/images/logo.png');
exit;
}