- #891: Improves education display -JAC
================================================================================
-VERSION 0.10.2 XX XX XXXX
+VERSION 0.10.3 XX XX XXXX
+
+New:
+
+================================================================================
+VERSION 0.10.2 13 11 2009
New:
* Core:
- Prunes old sessions/events logs after 12 months -VZA
+ - Adds proper content caching for static and semi-static content -VZA
Bug/Wish:
* Carnet:
- #975: Cleans up watch_nonins when someone dies -JAC
+ - #1000: Notifies her contacts when a user has no redirection left -JAC
* Core:
- #984: Properly upper/lowercases accented letters when necessary -JAC
all: build
-build: core conf banana wiki openid medals jquery
+build: core conf static banana wiki openid medals jquery
q:
@echo -e "Code statistics\n"
sed -e "s,@REWRITE_BASE@,$$REWRITE_BASE,g" $< > $@
##
+## static content
+##
+static: htdocs/javascript@VERSION
+
+%@VERSION: % Makefile ChangeLog
+ cd $< && rm -f $(VERSION) && ln -sf . $(VERSION)
+
+##
## wiki
##
check("select e.* from emails as e left join auth_user_md5 as u on u.user_id=e.uid where e.uid and u.prenom is null");
/* validite de forums */
-check("select f.* from forums.abos as f left join auth_user_md5 as u on u.user_id=f.uid where u.prenom is null");
-check("select f.* from forums.abos as f left join forums.list as fd on fd.fid=f.fid where fd.nom is null");
-check("select f.* from forums.respofaqs as f left join forums.list as fd on fd.fid=f.fid where fd.nom is null");
-check("select f.* from forums.respofaqs as f left join auth_user_md5 as u on u.user_id=f.uid where u.prenom is null");
+check("select f.* from #forums#.abos as f left join #x4dat#.auth_user_md5 as u on u.user_id=f.uid where u.prenom is null");
+check("select f.* from #forums#.abos as f left join #forums#.list as fd on fd.fid=f.fid where fd.nom is null");
+check("select f.* from #forums#.respofaqs as f left join #forums#.list as fd on fd.fid=f.fid where fd.nom is null");
+check("select f.* from #forums#.respofaqs as f left join #x4dat#.auth_user_md5 as u on u.user_id=f.uid where u.prenom is null");
/* validite de groupesx_ins */
check("select g.* from groupesx_ins as g left join auth_user_md5 as u on u.user_id=g.guid where u.prenom is null");
*/
function discardExpiredSessions($userPerms, $retentionPeriod, $minimalBacklog) {
XDB::execute(
- "DELETE logger.s
- FROM logger.sessions AS s
+ "DELETE #logger#.s
+ FROM #logger#.sessions AS s
JOIN (SELECT u.user_id,
(SELECT us.start
- FROM logger.sessions AS us
+ FROM #logger#.sessions AS us
WHERE us.uid = u.user_id
ORDER BY us.start DESC
LIMIT {?}, 1) AS no_discard_limit
- FROM x4dat.auth_user_md5 AS u
+ FROM #x4dat#.auth_user_md5 AS u
WHERE u.perms = {?}
ORDER BY u.user_id ASC) AS ut ON (ut.user_id = s.uid)
WHERE s.start < DATE_SUB(NOW(), INTERVAL {?} MONTH)
function checkOrphanedSessions() {
$res = XDB::query(
"SELECT COUNT(*)
- FROM logger.sessions AS s
- LEFT JOIN x4dat.auth_user_md5 AS u ON (u.user_id = s.uid)
+ FROM #logger#.sessions AS s
+ LEFT JOIN #x4dat#.auth_user_md5 AS u ON (u.user_id = s.uid)
WHERE u.user_id IS NULL");
if (($count = $res->fetchOneCell())) {
echo "Orphaned sessions: found $count orphaned sessions. Please fix that.\n";
*/
function purgeOrphanedEvents() {
XDB::execute(
- "DELETE logger.e
- FROM logger.events AS e
- LEFT JOIN logger.sessions AS s ON (s.id = e.session)
+ "DELETE #logger#.e
+ FROM #logger#.events AS e
+ LEFT JOIN #logger#.sessions AS s ON (s.id = e.session)
WHERE s.id IS NULL");
$affectedRows = XDB::affectedRows();
echo "Orphaned events: removed $affectedRows events.\n";
purgeOrphanedEvents();
// Many rows have been removed from the two logger tables. Let's optimize them.
-XDB::execute("OPTIMIZE TABLE logger.events");
-XDB::execute("OPTIMIZE TABLE logger.sessions");
+XDB::execute("OPTIMIZE TABLE #logger#.events");
+XDB::execute("OPTIMIZE TABLE #logger#.sessions");
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
?>
$res = XDB::query("SELECT count(r.stamp), UNIX_TIMESTAMP(MIN(r.stamp)),
sum(r.stamp < NOW() - $M_PERIOD), sum(r.stamp < NOW() - $R_PERIOD)
- FROM x4dat.requests AS r");
+ FROM requests AS r");
list($nb, $age, $nbold, $nbveryold) = $res->fetchOneRow();
$age = (time() - intval($age)) / 86400;
."https://www.polytechnique.org/admin/validate\n\n"
."Par catégorie :\n";
$res = XDB::iterRow("SELECT type, count(*)
- FROM x4dat.requests
+ FROM requests
GROUP BY type
ORDER BY type");
while (list($type, $nb) = $res->next()) {
$mailer->send($u['mail_fmt'] == 'html');
}
-XDB::execute("DELETE FROM watch_profile
- WHERE ts < DATE_SUB(CURRENT_DATE, INTERVAL 15 DAY)");
+XDB::execute("UPDATE watch_profile
+ SET ts = NOW()
+ WHERE field = 'broken'");
+XDB::execute('DELETE FROM watch_profile
+ WHERE ts < DATE_SUB(CURRENT_DATE, INTERVAL 15 DAY)');
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
?>
/** db params */
public $dbdb = 'x4dat';
+ public $dbprefix = '';
public $dbhost = 'localhost';
public $dbuser = 'x4dat';
public $dbpwd = 'x4dat';
$res = XDB::query("SELECT a.*, d.nom AS domnom,
FIND_IN_SET('notif_unsub', a.flags) AS notif_unsub,
FIND_IN_SET('has_ml', a.flags) AS has_ml
- FROM groupex.asso AS a
- LEFT JOIN groupex.dom AS d ON d.id = a.dom
+ FROM #groupex#.asso AS a
+ LEFT JOIN #groupex#.dom AS d ON d.id = a.dom
WHERE diminutif = {?}",
$gp);
if (!($aid = $res->fetchOneAssoc())) {
$this->session = $this->writeSession($uid, $suid);
// retrieve available actions
- $res = XDB::iterRow("SELECT id, text FROM logger.actions");
+ $res = XDB::iterRow("SELECT id, text FROM #logger#.actions");
while (list($action_id, $action_text) = $res->next()) {
$this->actions[$action_text] = $action_id;
$proxy = 'proxy';
}
- XDB::execute("INSERT INTO logger.sessions
+ XDB::execute("INSERT INTO #logger#.sessions
SET uid={?}, host={?}, ip={?}, forward_ip={?}, forward_host={?}, browser={?}, suid={?}, flags={?}",
$uid, $host, ip_to_uint($ip), ip_to_uint($forward_ip), $forward_host, $browser, $suid, $proxy);
if ($forward_ip) {
}
public function saveLastSession() {
- XDB::execute('REPLACE INTO logger.last_sessions (uid, id)
+ XDB::execute('REPLACE INTO #logger#.last_sessions (uid, id)
VALUES ({?}, {?})',
$this->uid, $this->session);
}
public function log($action, $data = null)
{
if (isset($this->actions[$action])) {
- XDB::execute("INSERT INTO logger.events
+ XDB::execute("INSERT INTO #logger#.events
SET session={?}, action={?}, data={?}",
$this->session, $this->actions[$action], $data);
} else {
$this->assign('is_admin', may_update());
$this->assign('is_member', is_member());
}
+ $this->addJsLink('jquery.js');
+ $this->addJsLink('overlib.js');
+ $this->addJsLink('wiki.js');
$this->addJsLink('xorg.js');
$this->setTitle('Les associations polytechniciennes');
}
}
$res = XDB::iterRow(
"SELECT a.nom, a.diminutif
- FROM groupex.asso AS a
- INNER JOIN groupex.membres AS m ON m.asso_id = a.id
+ FROM #groupex#.asso AS a
+ INNER JOIN #groupex#.membres AS m ON m.asso_id = a.id
WHERE m.uid={?}", S::v('uid'));
$links = '<a href="exit">déconnexion</a>';
$html = '<div>Mes groupes (' . $links . ') :</div>';
$may_update[$asso_id] = true;
} elseif (!isset($may_update[$asso_id]) || $force) {
$res = XDB::query("SELECT perms
- FROM groupex.membres
+ FROM #groupex#.membres
WHERE uid={?} AND asso_id={?}",
S::v('uid'), $asso_id);
$may_update[$asso_id] = ($res->fetchOneCell() == 'admin');
$is_member[$asso_id] = true;
} elseif (!isset($is_member[$asso_id]) || $force) {
$res = XDB::query("SELECT COUNT(*)
- FROM groupex.membres
+ FROM #groupex#.membres
WHERE uid={?} AND asso_id={?}",
S::v('uid'), $asso_id);
$is_member[$asso_id] = ($res->fetchOneCell() == 1);
// Set the default page
$this->changeTpl('platal/index.tpl');
+ $this->addJsLink('jquery.js');
+ $this->addJsLink('overlib.js');
+ $this->addJsLink('secure_hash.js');
+ $this->addJsLink('sha1.js');
+ $this->addJsLink('wiki.js');
$this->addJsLink('xorg.js');
$this->setTitle('le site des élèves et anciens élèves de l\'École polytechnique');
}
FROM auth_user_md5 AS u
INNER JOIN auth_user_quick AS q USING(user_id)
LEFT JOIN gapps_accounts AS g ON (u.user_id = g.l_userid AND g.g_status = 'active')
- LEFT JOIN logger.last_sessions AS ls ON (ls.uid = u.user_id)
- LEFT JOIN logger.sessions AS s ON(s.id = ls.id)
+ LEFT JOIN #logger#.last_sessions AS ls ON (ls.uid = u.user_id)
+ LEFT JOIN #logger#.sessions AS s ON(s.id = ls.id)
WHERE u.user_id = {?} AND u.perms IN('admin', 'user')", $uid);
if ($res->numRows() != 1) {
return false;
blacklist_check_url = ""
blacklist_host_resolution_limit =
+domain_whitelist = ""
[MailStorage]
imap_active = 0
-Subproject commit 2386dca38cb8aea249b3de8cc075a857498b7292
+Subproject commit d38df00e1a642351bf5db2eec61a86adf2052361
RewriteBase @REWRITE_BASE@
-# Rewrite URLs of the form 'index.php?q=x':
+# Rewrites URLs of the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ?n=$1 [L,QSA]
+
+# Caches the immutable resources for seven days. Generated files (images and JS
+# served by PHP) are not affected.
+ExpiresActive On
+ExpiresByType application/x-javascript "access plus 7 days"
+ExpiresByType image/gif "access plus 7 days"
+ExpiresByType image/jpeg "access plus 7 days"
+ExpiresByType image/png "access plus 7 days"
+ExpiresByType text/css "access plus 7 days"
<html>
<head>
<title>Polytechnique.org : le site des élèves et anciens élèves de l'École polytechnique</title>
- <meta http-equiv="content-type" CONTENT="text/html; charset=utf-8">
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>
<table align="center" border=0 width=600>
<p>Nous vous remercions de votre compréhension.
</p>
<p>Avec toutes nos excuses pour le dérangement occasionné et
- à bientôt !</p>
+ à bientôt !</p>
<p align="right"><b>L'équipe de Polytechnique.org</b></p>
</td>
</tr>
+# Versioning links
+/0.10.*
+
# jQuery and its plugins are downloaded by the Makefile
/jquery.*js
!/jquery.autocomplete.js
+++ /dev/null
-/*
- * md5.jvs 1.0b 27/06/96
- *
- * Javascript implementation of the RSA Data Security, Inc. MD5
- * Message-Digest Algorithm.
- *
- * Copyright (c) 1996 Henri Torgemane. All Rights Reserved.
- *
- * Permission to use, copy, modify, and distribute this software
- * and its documentation for any purposes and without
- * fee is hereby granted provided that this copyright notice
- * appears in all copies.
- *
- * Of course, this soft is provided "as is" without express or implied
- * warranty of any kind.
- *
- */
-
-function array(n) {
- for(i=0;i<n;i++) this[i]=0;
- this.length=n;
-}
-
-/* Some basic logical functions had to be rewritten because of a bug in
- * Javascript.. Just try to compute 0xffffffff >> 4 with it..
- * Of course, these functions are slower than the original would be, but
- * at least, they work!
- */
-
-function integer(n) { return n%(0xffffffff+1); }
-
-function shr(a,b) {
- a=integer(a);
- b=integer(b);
- if (a-0x80000000>=0) {
- a=a%0x80000000;
- a>>=b;
- a+=0x40000000>>(b-1);
- } else
- a>>=b;
- return a;
-}
-
-function shl1(a) {
- a=a%0x80000000;
- if (a&0x40000000==0x40000000)
- {
- a-=0x40000000;
- a*=2;
- a+=0x80000000;
- } else
- a*=2;
- return a;
-}
-
-function shl(a,b) {
- a=integer(a);
- b=integer(b);
- for (var i=0;i<b;i++) a=shl1(a);
- return a;
-}
-
-function and(a,b) {
- a=integer(a);
- b=integer(b);
- var t1=(a-0x80000000);
- var t2=(b-0x80000000);
- if (t1>=0)
- if (t2>=0)
- return ((t1&t2)+0x80000000);
- else
- return (t1&b);
- else
- if (t2>=0)
- return (a&t2);
- else
- return (a&b);
-}
-
-function or(a,b) {
- a=integer(a);
- b=integer(b);
- var t1=(a-0x80000000);
- var t2=(b-0x80000000);
- if (t1>=0)
- if (t2>=0)
- return ((t1|t2)+0x80000000);
- else
- return ((t1|b)+0x80000000);
- else
- if (t2>=0)
- return ((a|t2)+0x80000000);
- else
- return (a|b);
-}
-
-function xor(a,b) {
- a=integer(a);
- b=integer(b);
- var t1=(a-0x80000000);
- var t2=(b-0x80000000);
- if (t1>=0)
- if (t2>=0)
- return (t1^t2);
- else
- return ((t1^b)+0x80000000);
- else
- if (t2>=0)
- return ((a^t2)+0x80000000);
- else
- return (a^b);
-}
-
-function not(a) {
- a=integer(a);
- return (0xffffffff-a);
-}
-
-/* Here begin the real algorithm */
-
- var state = new array(4);
- var count = new array(2);
- count[0] = 0;
- count[1] = 0;
- var buffer = new array(64);
- var transformBuffer = new array(16);
- var digestBits = new array(16);
-
- var S11 = 7;
- var S12 = 12;
- var S13 = 17;
- var S14 = 22;
- var S21 = 5;
- var S22 = 9;
- var S23 = 14;
- var S24 = 20;
- var S31 = 4;
- var S32 = 11;
- var S33 = 16;
- var S34 = 23;
- var S41 = 6;
- var S42 = 10;
- var S43 = 15;
- var S44 = 21;
-
- function F(x,y,z) {
- return or(and(x,y),and(not(x),z));
- }
-
- function G(x,y,z) {
- return or(and(x,z),and(y,not(z)));
- }
-
- function H(x,y,z) {
- return xor(xor(x,y),z);
- }
-
- function I(x,y,z) {
- return xor(y ,or(x , not(z)));
- }
-
- function rotateLeft(a,n) {
- return or(shl(a, n),(shr(a,(32 - n))));
- }
-
- function FF(a,b,c,d,x,s,ac) {
- a = a+F(b, c, d) + x + ac;
- a = rotateLeft(a, s);
- a = a+b;
- return a;
- }
-
- function GG(a,b,c,d,x,s,ac) {
- a = a+G(b, c, d) +x + ac;
- a = rotateLeft(a, s);
- a = a+b;
- return a;
- }
-
- function HH(a,b,c,d,x,s,ac) {
- a = a+H(b, c, d) + x + ac;
- a = rotateLeft(a, s);
- a = a+b;
- return a;
- }
-
- function II(a,b,c,d,x,s,ac) {
- a = a+I(b, c, d) + x + ac;
- a = rotateLeft(a, s);
- a = a+b;
- return a;
- }
-
- function transform(buf,offset) {
- var a=0, b=0, c=0, d=0;
- var x = transformBuffer;
-
- a = state[0];
- b = state[1];
- c = state[2];
- d = state[3];
-
- for (i = 0; i < 16; i++) {
- x[i] = and(buf[i*4+offset],0xff);
- for (j = 1; j < 4; j++) {
- x[i]+=shl(and(buf[i*4+j+offset] ,0xff), j * 8);
- }
- }
-
- /* Round 1 */
- a = FF ( a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
- d = FF ( d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
- c = FF ( c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
- b = FF ( b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
- a = FF ( a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
- d = FF ( d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
- c = FF ( c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
- b = FF ( b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
- a = FF ( a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
- d = FF ( d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
- c = FF ( c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
- b = FF ( b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
- a = FF ( a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
- d = FF ( d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
- c = FF ( c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
- b = FF ( b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
-
- /* Round 2 */
- a = GG ( a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
- d = GG ( d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
- c = GG ( c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
- b = GG ( b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
- a = GG ( a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
- d = GG ( d, a, b, c, x[10], S22, 0x2441453); /* 22 */
- c = GG ( c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
- b = GG ( b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
- a = GG ( a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
- d = GG ( d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
- c = GG ( c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
- b = GG ( b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
- a = GG ( a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
- d = GG ( d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
- c = GG ( c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
- b = GG ( b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
-
- /* Round 3 */
- a = HH ( a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
- d = HH ( d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
- c = HH ( c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
- b = HH ( b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
- a = HH ( a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
- d = HH ( d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
- c = HH ( c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
- b = HH ( b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
- a = HH ( a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
- d = HH ( d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
- c = HH ( c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
- b = HH ( b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */
- a = HH ( a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
- d = HH ( d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
- c = HH ( c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
- b = HH ( b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */
-
- /* Round 4 */
- a = II ( a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
- d = II ( d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
- c = II ( c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
- b = II ( b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
- a = II ( a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
- d = II ( d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
- c = II ( c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
- b = II ( b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
- a = II ( a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
- d = II ( d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
- c = II ( c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
- b = II ( b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
- a = II ( a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
- d = II ( d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
- c = II ( c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
- b = II ( b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */
-
- state[0] +=a;
- state[1] +=b;
- state[2] +=c;
- state[3] +=d;
-
- }
-
- function init() {
- count[0]=count[1] = 0;
- state[0] = 0x67452301;
- state[1] = 0xefcdab89;
- state[2] = 0x98badcfe;
- state[3] = 0x10325476;
- for (i = 0; i < digestBits.length; i++)
- digestBits[i] = 0;
- }
-
- function update(b) {
- var index,i;
-
- index = and(shr(count[0],3) , 0x3f);
- if (count[0]<0xffffffff-7)
- count[0] += 8;
- else {
- count[1]++;
- count[0]-=0xffffffff+1;
- count[0]+=8;
- }
- buffer[index] = and(b,0xff);
- if (index >= 63) {
- transform(buffer, 0);
- }
- }
-
- function finish() {
- var bits = new array(8);
- var padding;
- var i=0, index=0, padLen=0;
-
- for (i = 0; i < 4; i++) {
- bits[i] = and(shr(count[0],(i * 8)), 0xff);
- }
- for (i = 0; i < 4; i++) {
- bits[i+4]=and(shr(count[1],(i * 8)), 0xff);
- }
- index = and(shr(count[0], 3) ,0x3f);
- padLen = (index < 56) ? (56 - index) : (120 - index);
- padding = new array(64);
- padding[0] = 0x80;
- for (i=0;i<padLen;i++)
- update(padding[i]);
- for (i=0;i<8;i++)
- update(bits[i]);
-
- for (i = 0; i < 4; i++) {
- for (j = 0; j < 4; j++) {
- digestBits[i*4+j] = and(shr(state[i], (j * 8)) , 0xff);
- }
- }
- }
-
-/* End of the MD5 algorithm */
-
-function hexa(n) {
- var hexa_h = "0123456789abcdef";
- var hexa_c="";
- var hexa_m=n;
- for (hexa_i=0;hexa_i<8;hexa_i++) {
- hexa_c=hexa_h.charAt(Math.abs(hexa_m)%16)+hexa_c;
- hexa_m=Math.floor(hexa_m/16);
- }
- return hexa_c;
-}
-
-
-var ascii="01234567890123456789012345678901" +
- " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"+
- "[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
-
-function MD5(entree)
-{
- var l,s,k,ka,kb,kc,kd;
-
- init();
- for (k=0;k<entree.length;k++) {
- l=entree.charAt(k);
- update(ascii.lastIndexOf(l));
- }
- finish();
- ka=kb=kc=kd=0;
- for (i=0;i<4;i++) ka+=shl(digestBits[15-i], (i*8));
- for (i=4;i<8;i++) kb+=shl(digestBits[15-i], ((i-4)*8));
- for (i=8;i<12;i++) kc+=shl(digestBits[15-i], ((i-8)*8));
- for (i=12;i<16;i++) kd+=shl(digestBits[15-i], ((i-12)*8));
- s=hexa(kd)+hexa(kc)+hexa(kb)+hexa(ka);
- return s;
-}
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
// {{{ function checkPassword
-function getType(char) {
- if (char >= 'a' && char <= 'z') {
+function getType(c) {
+ if (c >= 'a' && c <= 'z') {
return 1;
- } else if (char >= 'A' && char <= 'Z') {
+ } else if (c >= 'A' && c <= 'Z') {
return 2;
- } else if (char >= '0' && char <= '9') {
+ } else if (c >= '0' && c <= '9') {
return 3;
} else {
return 4;
http_redirect("https://www.polytechnique.org/lists/$action/$mbox$sup");
}
- $res = XDB::query("select diminutif from groupex.asso where mail_domain = {?}", $fqdn);
+ $res = XDB::query("SELECT diminutif FROM #groupex#.asso WHERE mail_domain = {?}", $fqdn);
if ($gpx = $res->fetchOneCell()) {
http_redirect("http://www.polytechnique.net/$gpx/lists/$action/$mbox$sup");
}
$read = Post::s('read');
if (!in_array($unread, $colors) || !in_array($read, $colors)) {
$page->trigError('Le choix de type pour l\'arborescence est invalide');
- } elseif (XDB::execute("REPLACE INTO forums.profils (uid, sig, mail, nom, flags, tree_unread, tree_read)
+ } elseif (XDB::execute("REPLACE INTO #forums#.profils (uid, sig, mail, nom, flags, tree_unread, tree_read)
VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?})",
S::v('uid'), Post::v('bananasig'),
Post::v('bananamail'), Post::v('banananame'),
FIND_IN_SET('xface', flags),
tree_unread,
tree_read
- FROM forums.profils
+ FROM #forums#.profils
WHERE uid = {?}", S::v('uid'));
if (!(list($nom, $mail, $sig, $disp, $maj, $xface, $unread, $read) = $req->fetchOneRow())) {
$nom = S::v('prenom').' '.S::v('nom');
}
if (isset($headers['x-face'])) {
$res = XDB::query("SELECT p.uid
- FROM forums.profils AS p
- INNER JOIN aliases AS a ON (p.uid = a.id)
+ FROM #forums#.profils AS p
+ INNER JOIN #x4dat#.aliases AS a ON (p.uid = a.id)
WHERE FIND_IN_SET('xface', p.flags) AND a.alias = {?}",
$login);
if ($res->numRows()) {
// }}}
// {{{ function getLinkIps()
- public function getLinkIps(&$gethostbyname_count)
+ public function getLinkIps(&$blacklist_host_resolution_count)
{
$matches = $this->parseUrlsFromArticle();
$article_ips = array();
list(, $host) = explode('@', $match);
}
- if ($gethostbyname_count < $globals->mail->blacklist_host_resolution_limit) {
+ if ($blacklist_host_resolution_count >= $globals->mail->blacklist_host_resolution_limit) {
break;
}
- if ($host != $globals->mail->alias_dom && $host != $globals->mail->alias_dom2
- && $host != $globals->mail->domain && $host != $globals->mail->domain2) {
+ if (!preg_match('/^(' . str_replace(' ', '|', $globals->mail->domain_whitelist) . ')$/i', $host)) {
$article_ips = array_merge($article_ips, array(gethostbyname($host) => $host));
- ++$gethostbyname_count;
+ ++$blacklist_host_resolution_count;
}
}
}
global $prf_desc;
$prf_desc = array('search_names' => 'L\'un de ses noms',
- 'freetext' => 'Le texte libre',
- 'mobile' => 'Son numéro de téléphone portable',
- 'nationalite' => 'Sa nationalité',
+ 'freetext' => 'Le texte libre',
+ 'mobile' => 'Son numéro de téléphone portable',
+ 'nationalite' => 'Sa nationalité',
'nationalite2' => 'Sa seconde nationalité',
'nationalite3' => 'Sa troisième nationalité',
- 'nick' => 'Son surnom',
- 'networking' => 'La liste de ses adresses de networking',
- 'edus' => 'Ses formations',
- 'addresses' => 'Ses adresses',
- 'section' => 'Sa section sportive',
- 'binets' => 'La liste de ses binets',
- 'medals' => 'Ses décorations',
- 'cv' => 'Son Curriculum Vitae',
- 'corps' => 'Son Corps d\'État',
- 'jobs' => 'Ses informations professionnelles',
- 'photo' => 'Sa photographie');
+ 'nick' => 'Son surnom',
+ 'networking' => 'La liste de ses adresses de networking',
+ 'edus' => 'Ses formations',
+ 'addresses' => 'Ses adresses',
+ 'section' => 'Sa section sportive',
+ 'binets' => 'La liste de ses binets',
+ 'medals' => 'Ses décorations',
+ 'cv' => 'Son Curriculum Vitae',
+ 'corps' => 'Son Corps d\'État',
+ 'jobs' => 'Ses informations professionnelles',
+ 'photo' => 'Sa photographie',
+ 'broken' => "Il n'a plus d'adresse de redirection valide");
function get_profile_change_details($event, $limit) {
global $prf_desc;
// has been taken into account.
public function NotifiesAction(&$page)
{
- header('Content-Type: text/html; charset=utf-8');
+ pl_content_headers("text/html");
$page->changeTpl('reminder/notification.tpl', NO_SKIN);
$page->assign('previous_reminder', $this->title());
}
// when the reminder is the only output of a page.
public function DisplayStandalone(&$page, $previous_reminder = null)
{
- header('Content-Type: text/html; charset=utf-8');
+ pl_content_headers("text/html");
$page->changeTpl('reminder/base.tpl', NO_SKIN);
$this->Prepare($page);
if ($previous_reminder) {
switch ($action) {
case 'yes':
$res = XDB::query('SELECT id
- FROM groupex.asso
+ FROM #groupex#.asso
WHERE diminutif = {?}',
S::v('promo'));
$asso_id = $res->fetchOneCell();
- XDB::execute('REPLACE INTO groupex.membres (uid, asso_id)
+ XDB::execute('REPLACE INTO #groupex#.membres (uid, asso_id)
VALUES ({?}, {?})',
S::v('uid'), $asso_id);
$mmlist = new MMList(S::v('uid'), S::v('password'));
// We only test if the user is in her promotion group for it is too
// expensive to check if she is in the corresponding ML as well.
$res = XDB::query('SELECT COUNT(*)
- FROM groupex.membres
+ FROM #groupex#.membres
WHERE uid = {?} AND asso_id = (SELECT id
- FROM groupex.asso
+ FROM #groupex#.asso
WHERE diminutif = {?})',
$user->id(), S::v('promo'));
if ($template) {
$page->assign('rss_hash', $hash);
- header('Content-Type: application/rss+xml; charset=utf8');
+ pl_content_headers("application/rss+xml");
}
return is_null($user) ? null : $user->id();
}
'user_id' => array('requests', 'user_changes'));
if ($really_del) {
- array_push($tables_to_clear['uid'], 'emails', 'groupex.membres', 'contacts', 'adresses', 'profile_phones',
- 'photo', 'perte_pass', 'langues_ins', 'forums.abos', 'forums.profils');
+ array_push($tables_to_clear['uid'], 'emails', '#groupex#.membres', 'contacts', 'adresses', 'profile_phones',
+ 'photo', 'perte_pass', 'langues_ins', '#forums#.abos', 'forums.profils');
array_push($tables_to_clear['user_id'], 'newsletter_ins', 'auth_user_quick', 'binets_ins');
$tables_to_clear['id'] = array('aliases');
$tables_to_clear['contact'] = array('contacts');
$user['binets_join'] = join(', ', $user['binets']);
$res = XDB::iterRow("SELECT a.diminutif, a.nom, a.site
- FROM groupex.asso AS a
- LEFT JOIN groupex.membres AS m ON (m.asso_id = a.id)
+ FROM #groupex#.asso AS a
+ LEFT JOIN #groupex#.membres AS m ON (m.asso_id = a.id)
WHERE m.uid = {?} AND (a.cat = 'GroupesX' OR a.cat = 'Institutions')
AND pub = 'public'", $uid);
$user['gpxs'] = Array();
global $globals;
parent::__construct('auth_user_md5 AS u',
(!empty($GLOBALS['IS_XNET_SITE']) ?
- 'INNER JOIN groupex.membres AS gxm ON (u.user_id = gxm.uid
+ 'INNER JOIN #groupex#.membres AS gxm ON (u.user_id = gxm.uid
AND gxm.asso_id = ' . $globals->asso('id') . ') ' : '')
. 'LEFT JOIN auth_user_quick AS q USING (user_id)' . $joins,
$where,
if ($this->asso == "alias") {
$new = $this->liste . '@' . $this->domain;
- XDB::query('INSERT INTO x4dat.virtual (alias, type) VALUES({?}, "user")', $new);
+ XDB::query('INSERT INTO virtual (alias, type) VALUES({?}, "user")', $new);
foreach ($this->members as $member) {
$user = User::get($member);
if ($user != null) {
XDB::query(
- "INSERT INTO x4dat.virtual_redirect (vid, redirect)
+ "INSERT INTO virtual_redirect (vid, redirect)
SELECT vid, {?}
- FROM x4dat.virtual
+ FROM virtual
WHERE alias = {?}", $user->forlifeEmail(), $new);
}
}
$app = '-' . $app;
}
$red = $this->domain . '_' . $liste;
- XDB::execute('INSERT INTO x4dat.virtual (alias, type)
+ XDB::execute('INSERT INTO virtual (alias, type)
VALUES({?}, {?})', $liste . $app . '@' . $this->domain, 'list');
- XDB::execute('INSERT INTO x4dat.virtual_redirect (vid, redirect)
+ XDB::execute('INSERT INTO virtual_redirect (vid, redirect)
VALUES ({?}, {?})', XDB::insertId(),
$red . $mdir . '@listes.polytechnique.org');
$list->mass_subscribe($liste, join(' ', $this->members));
$this->montant_max = $_montantmax;
if ($_asso_id) {
- $res = XDB::query("SELECT nom FROM groupex.asso WHERE id = {?}", $_asso_id);
+ $res = XDB::query("SELECT nom FROM #groupex#.asso WHERE id = {?}", $_asso_id);
$this->asso = $res->fetchOneCell();
}
if ($_asso_id && $_evt) {
- $res = XDB::query("SELECT intitule FROM groupex.evenements WHERE asso_id = {?} AND eid = {?}", $_asso_id, $_evt);
+ $res = XDB::query("SELECT intitule FROM #groupex#.evenements WHERE asso_id = {?} AND eid = {?}", $_asso_id, $_evt);
$this->evt_intitule = $res->fetchOneCell();
}
}
public function commit()
{
- $res = XDB::query("SELECT MAX(id) FROM paiement.paiements");
+ $res = XDB::query("SELECT MAX(id) FROM #paiement#.paiements");
$id = $res->fetchOneCell()+1;
- $ret = XDB::execute("INSERT INTO paiement.paiements VALUES
+ $ret = XDB::execute("INSERT INTO #paiement#.paiements VALUES
( {?}, {?}, {?}, '',
{?}, {?}, {?},
{?}, {?}, {?} )
$this->montant, $this->montant_min, $this->montant_max,
$this->user->bestEmail(), $this->msg_reponse, $this->asso_id);
if ($this->asso_id && $this->evt) {
- XDB::execute("UPDATE groupex.evenements
+ XDB::execute("UPDATE #groupex#.evenements
SET paiement_id = {?}
WHERE asso_id = {?} AND eid = {?}",
$id, $this->asso_id, $this->evt);
$res = XDB::query("SELECT a.nom, a.diminutif, e.intitule
- FROM groupex.asso AS a
- INNER JOIN groupex.evenements AS e ON (a.id = e.asso_id)
+ FROM #groupex#.asso AS a
+ INNER JOIN #groupex#.evenements AS e ON (a.id = e.asso_id)
WHERE e.eid = {?}",
$this->evt);
list($nom, $diminutif, $evt) = $res->fetchOneRow();
MONTH(MAX(start)), MONTH(MIN(start)),
DAYOFMONTH(MAX(start)),
DAYOFMONTH(MIN(start))
- FROM logger.sessions");
+ FROM #logger#.sessions");
list($ymax, $ymin, $mmax, $mmin, $dmax, $dmin) = $res->fetchOneRow();
if (($year < $ymin) || ($year == $ymin && $month < $mmin)) {
if ($year) {
$res = XDB::query("SELECT YEAR (MAX(start)), YEAR (MIN(start)),
MONTH(MAX(start)), MONTH(MIN(start))
- FROM logger.sessions");
+ FROM #logger#.sessions");
list($ymax, $ymin, $mmax, $mmin) = $res->fetchOneRow();
if (($year < $ymin) || ($year > $ymax)) {
$years[0] = "----";
// retrieve available years
- $res = XDB::query("select YEAR(MAX(start)), YEAR(MIN(start)) FROM logger.sessions");
+ $res = XDB::query("select YEAR(MAX(start)), YEAR(MIN(start)) FROM #logger#.sessions");
list($max, $min) = $res->fetchOneRow();
for($i = intval($min); $i<=$max; $i++) {
// we are viewing a session
$res = XDB::query("SELECT ls.*, a.alias AS username, sa.alias AS suer
- FROM logger.sessions AS ls
- LEFT JOIN aliases AS a ON (a.id = ls.uid AND a.type='a_vie')
- LEFT JOIN aliases AS sa ON (sa.id = ls.suid AND sa.type='a_vie')
+ FROM #logger#.sessions AS ls
+ LEFT JOIN #x4dat#.aliases AS a ON (a.id = ls.uid AND a.type='a_vie')
+ LEFT JOIN #x4dat#.aliases AS sa ON (sa.id = ls.suid AND sa.type='a_vie')
WHERE ls.id = {?}", $arg);
$page->assign('session', $a = $res->fetchOneAssoc());
$res = XDB::iterator('SELECT a.text, e.data, e.stamp
- FROM logger.events AS e
- LEFT JOIN logger.actions AS a ON e.action=a.id
+ FROM #logger#.events AS e
+ LEFT JOIN #logger#.actions AS a ON e.action=a.id
WHERE e.session={?}', $arg);
while ($myarr = $res->next()) {
$page->append('events', $myarr);
$where = $this->_makeWhere($year, $month, $day, $loguid);
$select = "SELECT s.id, s.start, s.uid,
a.alias as username
- FROM logger.sessions AS s
- LEFT JOIN aliases AS a ON (a.id = s.uid AND a.type='a_vie')
+ FROM #logger#.sessions AS s
+ LEFT JOIN #x4dat#.aliases AS a ON (a.id = s.uid AND a.type='a_vie')
$where
ORDER BY start DESC";
$res = XDB::iterator($select);
// attach events
$sql = "SELECT s.id, a.text
- FROM logger.sessions AS s
- LEFT JOIN logger.events AS e ON(e.session=s.id)
- INNER JOIN logger.actions AS a ON(a.id=e.action)
+ FROM #logger#.sessions AS s
+ LEFT JOIN #logger#.events AS e ON(e.session=s.id)
+ INNER JOIN #logger#.actions AS a ON(a.id=e.action)
$where";
$res = XDB::iterator($sql);
// Forum ban update.
case "b_edit":
- XDB::execute("DELETE FROM forums.innd WHERE uid = {?}", $user->id());
+ XDB::execute("DELETE FROM #forums#.innd WHERE uid = {?}", $user->id());
if (Env::v('write_perm') != "" || Env::v('read_perm') != "" || Env::v('commentaire') != "" ) {
- XDB::execute("INSERT INTO forums.innd
+ XDB::execute("INSERT INTO #forums#.innd
SET ipmin = '0', ipmax = '4294967295',
write_perm = {?}, read_perm = {?},
comment = {?}, priority = '200', uid = {?}",
// Displays last login and last host information.
$res = XDB::query("SELECT start, host
- FROM logger.sessions
+ FROM #logger#.sessions
WHERE uid = {?} AND suid = 0
ORDER BY start DESC
LIMIT 1", $user->id());
// Displays forum bans.
$res = XDB::query("SELECT write_perm, read_perm, comment
- FROM forums.innd
+ FROM #forums#.innd
WHERE uid = {?}", $user->id());
$bans = $res->fetchOneAssoc();
$page->assign('bans', $bans);
$res = XDB::iterator(
"SELECT u.promo, u.nom, u.prenom, u.deces, u.hruid, DATE(MAX(s.start)) AS last
- FROM auth_user_md5 AS u
- LEFT JOIN logger.sessions AS s ON (s.uid = u.user_id AND suid = 0)
+ FROM #x4dat#.auth_user_md5 AS u
+ LEFT JOIN #logger#.sessions AS s ON (s.uid = u.user_id AND suid = 0)
WHERE perms IN ('admin', 'user') AND deces <> 0
GROUP BY u.user_id
ORDER BY u.promo, u.nom");
function handler_logger_actions(&$page, $action = 'list', $id = null) {
$page->setTitle('Administration - Actions');
$page->assign('title', 'Gestion des actions de logger');
- $table_editor = new PLTableEditor('admin/logger/actions','logger.actions','id');
+ $table_editor = new PLTableEditor('admin/logger/actions','#logger#.actions','id');
$table_editor->describe('text','intitulé',true);
$table_editor->describe('description','description',true);
$table_editor->apply($page, $action, $id);
}
$page->changeTpl('admin/wiki.tpl');
- $page->addJsLink('jquery.js');
$page->assign('wiki_pages', $wiki_tree);
$page->assign('perms_opts', $perms);
}
IF(w.ip = s2.ip, s2.host, s2.forward_host),
IF(w.ip = s.ip, s.host, s.forward_host)),
w.mask, w.detection, w.state, u.hruid
- FROM ip_watch AS w
- LEFT JOIN logger.sessions AS s ON (s.ip = w.ip)
- LEFT JOIN logger.sessions AS s2 ON (s2.forward_ip = w.ip)
- LEFT JOIN auth_user_md5 AS u ON (u.user_id = s.uid)
+ FROM #x4dat#.ip_watch AS w
+ LEFT JOIN #logger#.sessions AS s ON (s.ip = w.ip)
+ LEFT JOIN #logger#.sessions AS s2 ON (s2.forward_ip = w.ip)
+ LEFT JOIN #x4dat#.auth_user_md5 AS u ON (u.user_id = s.uid)
GROUP BY w.ip, u.hruid
ORDER BY w.state, w.ip, u.hruid";
$it = Xdb::iterRow($sql);
} elseif ($action == 'edit') {
$sql = "SELECT w.detection, w.state, w.last, w.description, w.mask,
u1.hruid AS edit, u2.hruid AS hruid, s.host
- FROM ip_watch AS w
- LEFT JOIN auth_user_md5 AS u1 ON (u1.user_id = w.uid)
- LEFT JOIN logger.sessions AS s ON (w.ip = s.ip)
- LEFT JOIN auth_user_md5 AS u2 ON (u2.user_id = s.uid)
+ FROM #x4dat#.ip_watch AS w
+ LEFT JOIN #x4dat#.auth_user_md5 AS u1 ON (u1.user_id = w.uid)
+ LEFT JOIN #logger#.sessions AS s ON (w.ip = s.ip)
+ LEFT JOIN #x4dat#.auth_user_md5 AS u2 ON (u2.user_id = s.uid)
WHERE w.ip = {?}
GROUP BY u2.hruid
ORDER BY u2.hruid";
$res .= "</membres>\n\n";
- header('Content-Type: text/xml; charset="UTF-8"');
+ pl_content_headers("text/xml");
echo $res;
}
exit;
$request = @$GLOBALS['HTTP_RAW_POST_DATA'];
$response = xmlrpc_server_call_method($server, $request, null);
- header('Content-Type: text/xml');
+ pl_content_headers("text/xml");
print $response;
xmlrpc_server_destroy($server);
}
} else if ($val == 'grpauth') {
if (isset($_GET['group'])) {
$res = XDB::query("SELECT perms
- FROM groupex.membres
- INNER JOIN groupex.asso ON(id = asso_id)
+ FROM #groupex#.membres
+ INNER JOIN #groupex#.asso ON(id = asso_id)
WHERE uid = {?} AND diminutif = {?}",
S::v('uid'), $_GET['group']);
$perms = $res->fetchOneCell();
function handler_icone(&$page)
{
- header("Content-Type: image/png");
+ pl_cached_content_headers("image/png");
readfile('../htdocs/images/x.png');
exit();
}
function handler_html(&$page, $login = '')
{
+ pl_cached_content_headers("text/html");
$page->changeTpl('skin/common.bandeau.tpl', NO_SKIN);
$page->assign('login', $login == 'login');
$page->assign('seed', $login);
function handler_css(&$page)
{
- header("Content-Type: text/css");
+ pl_cached_content_headers("text/css");
readfile('../htdocs/css/bandeau.css');
exit();
}
}
$page->assign('events', $annivs);
- header('Content-Type: text/calendar; charset=utf-8');
+ pl_content_headers("text/calendar");
}
function handler_vcard(&$page, $photos = null)
$to2 = getEmails(Env::v('to_contacts'));
$cc2 = getEmails(Env::v('cc_contacts'));
$txt = str_replace('^M', '', Env::v('contenu'));
- $to = Env::v('to');
- $subj = Env::v('sujet');
- $from = Env::v('from');
- $cc = trim(Env::v('cc'));
- $bcc = trim(Env::v('bcc'));
-
+ $to = str_replace(';', ',', Env::t('to'));
+ $subj = Env::t('sujet');
+ $from = Env::t('from');
+ $cc = str_replace(';', ',', Env::t('cc'));
+ $bcc = str_replace(';', ',', Env::t('bcc'));
+
+ $email_regex = '/^[a-z0-9.\-+_\$]+@([\-.+_]?[a-z0-9])+$/i';
+ foreach (explode(',', $to . ',' . $cc . ',' . $bcc) as $email) {
+ $email = trim($email);
+ if ($email != '' && !preg_match($email_regex, $email)) {
+ $page->trigError("L'adresse email " . $email . ' est erronée.');
+ $error = true;
+ }
+ }
if (empty($to) && empty($cc) && empty($to2) && empty($bcc) && empty($cc2)) {
$page->trigError("Indique au moins un destinataire.");
+ $error = true;
+ }
+
+ if ($error) {
$page->assign('uploaded_f', PlUpload::listFilenames(S::user()->login(), 'emails.send'));
} else {
$mymail = new PlMailer();
foreach ($broken_list as $orig_email) {
$email = valide_email(trim($orig_email));
if (empty($email) || $email == '@') {
- $invalid_emails[] = "$orig_email: invalid email";
- } else {
+ $invalid_emails[] = trim($orig_email) . ': invalid email';
+ } elseif (!in_array($email, $valid_emails)) {
$res = XDB::query('SELECT COUNT(*)
FROM emails
WHERE email = {?}', $email);
// Output the list of users with recently broken addresses,
// along with the count of valid redirections.
- header('Content-Type: text/x-csv; charset=utf-8;');
- header('Cache-Control: no-cache');
+ require_once 'include/notifs.inc.php';
+ pl_content_headers("text/x-csv");
$csv = fopen('php://output', 'w');
- fputcsv($csv, array('nom', 'prenom', 'alias', 'bounce', 'nbmails', 'url'), ';');
+ fputcsv($csv, array('nom', 'prenom', 'promo', 'alias', 'bounce', 'nbmails', 'url'), ';');
foreach ($broken_user_list as $alias => $mails) {
$sel = Xdb::query(
"SELECT u.user_id, count(e.email) AS nb_mails, u.nom, u.prenom, u.promo
GROUP BY u.user_id", $alias);
if ($x = $sel->fetchOneAssoc()) {
+ if ($x['nb_mails'] == 0) {
+ register_profile_update($x['user_id'], 'broken');
+ }
fputcsv($csv, array($x['nom'], $x['prenom'], $x['promo'], $alias,
- join(',', $mails), $x['nb_mails']),
- 'https://www.polytechnique.org/marketing/broken/' . $alias, ';');
+ join(',', $mails), $x['nb_mails'],
+ 'https://www.polytechnique.org/marketing/broken/' . $alias), ';');
}
}
fclose($csv);
$res = XDB::query("SELECT * FROM evenements_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;
}
require_once 'validations.inc.php';
$valid = Validate::get_request_by_id($valid);
if ($valid && $valid->img) {
- header('Content-Type: image/' . $valid->imgtype);
+ pl_cached_dynamic_content_headers("image/" . $valid->imgtype);
echo $valid->img;
exit;
}
} else {
$upload = new PlUpload(S::user()->login(), 'event');
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;
}
}
$page->assign('texte', $texte);
$page->assign('titre', $titre);
- header('Content-Type: text/html; charset=utf-8');
+ pl_content_headers("text/html");
}
function handler_ev_submit(&$page)
function handler_tips(&$page, $tips = null)
{
- header('Content-Type: text/html; charset="UTF-8"');
+ pl_content_headers("text/html");
$page->changeTpl('include/tips.tpl', NO_SKIN);
$page->assign('tips', $this->get_tips($tips));
}
{
$page->setTitle('Administration - Bannissements des forums');
$page->assign('title', 'Gestion des mises au ban');
- $table_editor = new PLTableEditor('admin/forums','forums.innd','id_innd');
+ $table_editor = new PLTableEditor('admin/forums','#forums#.innd','id_innd');
$table_editor->add_sort_field('priority', true, true);
$table_editor->describe('read_perm','lecture',true);
$table_editor->describe('write_perm','écriture',true);
$table_editor->describe('comment','commentaire',true);
$table_editor->apply($page, $action, $id);
$page->changeTpl('forums/admin.tpl');
- $page->addJsLink('jquery.js');
}
static function run_banana(&$page, $params = null)
function init_igoogle_xml($template)
{
Platal::page()->changeTpl($template, NO_SKIN);
-
- header('Content-Type: application/xml; charset=utf-8');
+ pl_cached_content_headers("application/xml", "utf-8");
}
function init_igoogle_html($template, $auth = AUTH_PUBLIC)
function handler_ajax(&$page, $list = null)
{
- header('Content-Type: text/html; charset="UTF-8"');
+ pl_content_headers("text/html");
$domain = $this->prepare_client($page);
$page->changeTpl('lists/liste.inc.tpl', NO_SKIN);
S::assert_xsrf_token();
}
$new = $liste . '@' . $domain;
- $res = XDB::query('SELECT COUNT(*) FROM x4dat.virtual WHERE alias={?}', $new);
+ $res = XDB::query('SELECT COUNT(*) FROM virtual WHERE alias={?}', $new);
} else {
if ($asso == "groupex") {
$groupex_name = Post::v('groupex_name');
- $res_groupe = XDB::query('SELECT mail_domain FROM groupex.asso WHERE nom={?}', $groupex_name);
+ $res_groupe = XDB::query('SELECT mail_domain FROM #groupex#.asso WHERE nom={?}', $groupex_name);
$domain = $res_groupe->fetchOneCell();
if (!$domain) {
}
$new = $liste . '@' . $domain;
- $res = XDB::query('SELECT COUNT(*) FROM x4dat.virtual WHERE alias={?}', $new);
+ $res = XDB::query('SELECT COUNT(*) FROM virtual WHERE alias={?}', $new);
} else {
$res = XDB::query("SELECT COUNT(*) FROM aliases WHERE alias={?}", $liste);
$domain = $globals->mail->domain;
}
if (!$page->nb_errs()) {
+ $page->trigSuccess('Demande de création envoyée !');
$page->assign('created', true);
require_once 'validations.inc.php';
$req = new ListeReq(S::user(), $asso, $liste, $domain,
$this->prepare_client($page);
$members = $this->client->get_members($liste);
$list = list_fetch_names(list_extract_members($members[1]));
- header('Content-Type: text/x-csv; charset=utf-8;');
- header('Pragma: ');
- header('Cache-Control: ');
+ pl_content_headers("text/x-csv");
echo "email,nom,prenom,promo\n";
foreach ($list as $member) {
S::assert_xsrf_token();
$members = User::getBulkForlifeEmails(Env::v('add_member'),
- false,
+ true,
array('ListsModule', 'no_login_callback'));
$arr = $this->client->mass_subscribe($liste, $members);
if (is_array($arr)) {
$page->trigError('Une erreur s\'est produite lors du téléchargement du fichier');
} else {
$members = User::getBulkForlifeEmails($upload->getContents(),
- false,
+ true,
array('ListsModule', 'no_login_callback'));
$arr = $this->client->mass_subscribe($liste, $members);
if (is_array($arr)) {
IF(m2.origine="X", u.nom, m1.nom) AS nom,
IF(m2.origine="X", u.promo, "non-X") AS promo,
0 AS lost
- FROM groupex.membres AS m1
- LEFT JOIN groupex.membres AS m2 ON(m1.email=m2.email AND m2.asso_id={?})
- LEFT JOIN auth_user_md5 AS u ON(m2.origine = "X" AND m2.uid = u.user_id)
+ FROM #groupex#.membres AS m1
+ LEFT JOIN #groupex#.membres AS m2 ON(m1.email=m2.email AND m2.asso_id={?})
+ LEFT JOIN #x4dat#.auth_user_md5 AS u ON(m2.origine = "X" AND m2.uid = u.user_id)
WHERE m1.email={?}', $globals->asso('id'), $member);
}
if ($res->numRows() == 0) {
}
if ($aid == 'blacklist_check') {
+ global $globals;
$ips_to_check = array();
- $gethostbyname_count = 0;
+ $blacklist_host_resolution_count = 0;
foreach ($nl->_arts as $key => $articles) {
foreach ($articles as $article) {
- $article_ips = $article->getLinkIps($gethostbyname_count);
+ $article_ips = $article->getLinkIps($blacklist_host_resolution_count);
if (!empty($article_ips)) {
$ips_to_check[$article->title()] = $article_ips;
}
}
$page->assign('ips_to_check', $ips_to_check);
- if ($gethostbyname_count >= $globals->mail->blacklist_host_resolution_limit) {
- $page-trigError("Toutes les url et adresses emails de la lettre"
+ if ($blacklist_host_resolution_count >= $globals->mail->blacklist_host_resolution_limit) {
+ $page->trigError("Toutes les url et adresses emails de la lettre"
. " n'ont pas été prises en compte car la"
. " limite du nombre de résolutions DNS"
. " autorisée a été atteinte.");
// Renders the main XRDS page.
public function RenderMainXrdsPage(&$page)
{
- header('Content-type: application/xrds+xml');
+ pl_content_headers("application/xrds+xml");
$page->changeTpl('openid/idp_xrds.tpl', NO_SKIN);
$page->assign('type2', Auth_OpenID_TYPE_2_0_IDP);
$page->assign('sreg', Auth_OpenID_SREG_URI);
// Renders the XRDS page of |user|.
public function RenderUserXrdsPage(&$page, User &$user)
{
- header('Content-type: application/xrds+xml');
+ pl_content_headers("application/xrds+xml");
$page->changeTpl('openid/user_xrds.tpl', NO_SKIN);
$page->assign('type2', Auth_OpenID_TYPE_2_0);
$page->assign('type1', Auth_OpenID_TYPE_1_1);
return PL_NOT_FOUND;
}
$res = XDB::query("SELECT asso_id
- FROM paiement.paiements
+ FROM #paiement#.paiements
WHERE asso_id = {?} AND id = {?}",
$globals->asso('id'), $ref);
if (!$res->numRows()) {
$pay->prepareform($pay);
} else {
$res = XDB::iterator("SELECT timestamp, montant
- FROM paiement.transactions
+ FROM #paiement#.transactions
WHERE uid = {?} AND ref = {?}
ORDER BY timestamp DESC",
S::v('uid', -1), $ref);
echo ($ref = $matches[1]);
$res = XDB::query("SELECT mail,text,confirmation
- FROM paiement.paiements
+ FROM #paiement#.paiements
WHERE id={?}", $ref);
if (!list($conf_mail,$conf_title,$conf_text) = $res->fetchOneRow()) {
cb_erreur("référence de commande inconnue");
/* on extrait le code de retour */
if ($champ906 != "0000") {
$res = XDB::query("SELECT rcb.text,c.id,c.text
- FROM paiement.codeRCB AS rcb
- LEFT JOIN paiement.codeC AS c ON rcb.codeC=c.id
+ FROM #paiement#.codeRCB AS rcb
+ LEFT JOIN #paiement#.codeC AS c ON rcb.codeC=c.id
WHERE rcb.id={?}", $champ906);
if (list($rcb_text, $c_id, $c_text) = $res->fetchOneRow()) {
cb_erreur("erreur lors du paiement : $c_text ($c_id)");
}
/* on fait l'insertion en base de donnees */
- XDB::execute("INSERT INTO paiement.transactions (id,uid,ref,fullref,montant,cle,comment)
+ XDB::execute("INSERT INTO #paiement#.transactions (id,uid,ref,fullref,montant,cle,comment)
VALUES ({?},{?},{?},{?},{?},{?},{?})",
$champ901, $uid, $ref, $champ200, $montant, $champ905,Env::v('comment'));
// We check if it is an Xnet payment and then update the related ML.
$res = XDB::query('SELECT eid
- FROM groupex.evenements
+ FROM #groupex#.evenements
WHERE paiement_id = {?}', $ref);
if ($eid = $res->fetchOneCell()) {
$this->load('xnetevents.inc.php');
$ref = $matches[1];
$res = XDB::query("SELECT mail,text,confirmation
- FROM paiement.paiements
+ FROM #paiement#.paiements
WHERE id={?}", $ref);
if (!list($conf_mail,$conf_title,$conf_text) = $res->fetchOneRow()) {
paypal_erreur("référence de commande inconnue");
}
/* on fait l'insertion en base de donnees */
- XDB::execute("INSERT INTO paiement.transactions (id,uid,ref,fullref,montant,cle,comment)
+ XDB::execute("INSERT INTO #paiement#.transactions (id,uid,ref,fullref,montant,cle,comment)
VALUES ({?},{?},{?},{?},{?},{?},{?})",
$no_transaction, $uid, $ref, $fullref, $montant, $clef, Env::v('comment'));
// We check if it is an Xnet payment and then update the related ML.
$res = XDB::query('SELECT eid
- FROM groupex.evenements
+ FROM #groupex#.evenements
WHERE paiement_id = {?}', $ref);
if ($eid = $res->fetchOneCell()) {
$this->load('xnetevents.inc.php');
return PL_FORBIDDEN;
}
$res = XDB::query("SELECT 1
- FROM groupex.evenements AS e
- INNER JOIN groupex.evenements_participants AS ep ON (ep.eid = e.eid AND uid = {?})
+ FROM #groupex#.evenements AS e
+ INNER JOIN #groupex#.evenements_participants AS ep ON (ep.eid = e.eid AND uid = {?})
WHERE e.paiement_id = {?} AND e.asso_id = {?}",
S::i('uid'), $pid, $globals->asso('id'));
if ($res->numRows() == 0) {
'montant' => strtr($sum, '.', ',').' €');
}
$res = XDB::iterRow("SELECT e.eid, e.short_name, e.intitule, ep.nb, ei.montant, ep.paid
- FROM groupex.evenements AS e
- LEFT JOIN groupex.evenements_participants AS ep ON (ep.eid = e.eid AND uid = {?})
- INNER JOIN groupex.evenements_items AS ei ON (ep.eid = ei.eid AND ep.item_id = ei.item_id)
+ FROM #groupex#.evenements AS e
+ LEFT JOIN #groupex#.evenements_participants AS ep ON (ep.eid = e.eid AND uid = {?})
+ INNER JOIN #groupex#.evenements_items AS ei ON (ep.eid = ei.eid AND ep.item_id = ei.item_id)
WHERE e.paiement_id = {?}",
S::v('uid'), $pid);
$event[$pid] = array();
function handler_admin(&$page, $action = 'list', $id = null) {
$page->setTitle('Administration - Paiements');
$page->assign('title', 'Gestion des télépaiements');
- $table_editor = new PLTableEditor('admin/payments','paiement.paiements','id');
- $table_editor->add_join_table('paiement.transactions','ref',true);
+ $table_editor = new PLTableEditor('admin/payments','#paiement#.paiements','id');
+ $table_editor->add_join_table('#paiement#.transactions','ref',true);
$table_editor->add_sort_field('flags');
$table_editor->add_sort_field('id', true, true);
- $table_editor->on_delete("UPDATE paiement.paiements SET flags = 'old' WHERE id = {?}", "Le paiement a été archivé");
+ $table_editor->on_delete("UPDATE #paiement#.paiements SET flags = 'old' WHERE id = {?}", "Le paiement a été archivé");
$table_editor->describe('text','intitulé',true);
$table_editor->describe('url','site web',false);
$table_editor->describe('montant_def','montant par défaut',false);
{
if ($this->asso_id) {
$res = XDB::query("SELECT e.eid, a.diminutif
- FROM groupex.evenements AS e
- INNER JOIN groupex.asso AS a ON (e.asso_id = a.id)
- LEFT JOIN groupex.evenements_participants AS p ON (p.eid = e.eid AND p.uid = {?})
+ FROM #groupex#.evenements AS e
+ INNER JOIN #groupex#.asso AS a ON (e.asso_id = a.id)
+ LEFT JOIN #groupex#.evenements_participants AS p ON (p.eid = e.eid AND p.uid = {?})
WHERE e.paiement_id = {?} AND p.uid IS NULL", S::i('uid'), $this->id);
if ($res->numRows()) {
return $res->fetchOneAssoc();
function handler_cacert(&$page)
{
- $data = file_get_contents("/etc/ssl/xorgCA/cacert.pem","r");
- header("Pragma:");
- header("Set-Cookie:");
- header("Cache-Control:");
- header("Expires:");
- header("Content-Type: application/x-x509-ca-cert");
- header("Content-Length: ".strlen($data));
- echo $data;
+ pl_cached_content_headers("application/x-x509-ca-cert");
+ readfile("/etc/ssl/xorgCA/cacert.pem");
exit;
}
// Display the photo, or a default one when not available.
if ($photo_type && $photo_data != null) {
- header('Content-type: image/' . $photo_type);
+ pl_cached_dynamic_content_headers("image/$photo_type");
echo $photo_data;
} else {
- header('Content-type: image/png');
+ pl_cached_dynamic_content_headers("image/png");
echo file_get_contents(dirname(__FILE__).'/../htdocs/images/none.png');
}
exit;
$img = $thumb ?
dirname(__FILE__).'/../htdocs/images/medals/thumb/' . $res->fetchOneCell() :
dirname(__FILE__).'/../htdocs/images/medals/' . $res->fetchOneCell();
- $type = mime_content_type($img);
- header("Content-Type: $type");
+ pl_cached_content_headers(mime_content_type($img));
echo file_get_contents($img);
exit;
}
function handler_education_js(&$page)
{
- header('Content-Type: text/javascript; charset=utf-8');
- 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');
+ pl_cached_content_headers("text/javascript", "utf-8");
$page->changeTpl('profile/education.js.tpl', NO_SKIN);
- require_once "education.func.inc.php";
+ require_once 'education.func.inc.php';
}
function handler_grades_js(&$page)
{
- header('Content-Type: text/javascript; charset=utf-8');
- 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');
+ pl_cached_content_headers("text/javascript", "utf-8");
$page->changeTpl('profile/grades.js.tpl', NO_SKIN);
$res = XDB::iterator("SELECT *
FROM profile_medals_grades
function handler_ajax_address(&$page, $id)
{
- header('Content-Type: text/html; charset=utf-8');
+ pl_content_headers("text/html");
$page->changeTpl('profile/adresses.address.tpl', NO_SKIN);
$page->assign('i', $id);
$page->assign('address', array());
function handler_ajax_tel(&$page, $prefid, $prefname, $telid)
{
- header('Content-Type: text/html; charset=utf-8');
+ pl_content_headers("text/html");
$page->changeTpl('profile/phone.tpl', NO_SKIN);
$page->assign('prefid', $prefid);
$page->assign('prefname', $prefname);
function handler_ajax_medal(&$page, $id)
{
- header('Content-Type: text/html; charset=utf-8');
+ pl_content_headers("text/html");
$page->changeTpl('profile/deco.medal.tpl', NO_SKIN);
$page->assign('id', $id);
$page->assign('medal', array('valid' => 0, 'grade' => 0));
function handler_ajax_job(&$page, $id)
{
- header('Content-Type: text/html; charset=utf-8');
+ pl_content_headers("text/html");
$page->changeTpl('profile/jobs.job.tpl', NO_SKIN);
$page->assign('i', $id);
$page->assign('job', array());
function handler_ajax_sector(&$page, $id, $jobid, $jobpref, $sect, $ssect = -1)
{
- header('Content-Type: text/html; charset=utf-8');
+ pl_content_headers("text/html");
$res = XDB::iterator("SELECT id, name, FIND_IN_SET('optgroup', flags) AS optgroup
FROM profile_job_subsector_enum
WHERE sectorid = {?}", $sect);
function handler_ajax_skill(&$page, $cat, $id)
{
- header('Content-Type: text/html; charset=utf-8');
+ pl_content_headers("text/html");
$page->changeTpl('profile/skill.skill.tpl', NO_SKIN);
$page->assign('cat', $cat);
$page->assign('id', $id);
function handler_ref_sect(&$page, $sect)
{
- header('Content-Type: text/html; charset=utf-8');
+ pl_content_headers("text/html");
$page->changeTpl('include/field.select.tpl', NO_SKIN);
$page->assign('onchange', 'setSSectors()');
$page->assign('id', 'ssect_field');
function handler_ref_country(&$page, $sect, $ssect = '')
{
- header('Content-Type: text/html; charset=utf-8');
+ pl_content_headers("text/html");
$page->changeTpl('include/field.select.tpl', NO_SKIN);
$page->assign('name', 'pays_sel');
$where = ($ssect ? ' AND ms.subsectorid = {?}' : '');
$req = XDB::query('
SELECT m.asso_id, a.nom, diminutif, a.logo IS NOT NULL AS has_logo,
COUNT(e.eid) AS events, mail_domain AS lists
- FROM groupex.membres AS m
- INNER JOIN groupex.asso AS a ON(m.asso_id = a.id)
- LEFT JOIN groupex.evenements AS e ON(e.asso_id = m.asso_id AND e.archive = 0)
+ FROM #groupex#.membres AS m
+ INNER JOIN #groupex#.asso AS a ON(m.asso_id = a.id)
+ LEFT JOIN #groupex#.evenements AS e ON(e.asso_id = m.asso_id AND e.archive = 0)
WHERE uid = {?} GROUP BY m.asso_id ORDER BY a.nom', S::i('uid'));
$page->assign('assos', $req->fetchAllAssoc());
}
}
$res = XDB::query('SELECT logo, logo_mime
- FROM groupex.asso
+ FROM #groupex#.asso
WHERE id = {?}', $id);
list($logo, $logo_mime) = $res->fetchOneRow();
if (!empty($logo)) {
- header("Content-type: $mime");
+ pl_cached_dynamic_content_headers($logo_mime);
echo $logo;
} else {
- header('Content-type: image/jpeg');
+ pl_cached_dynamic_content_headers("image/jpeg");
readfile(dirname(__FILE__) . '/../htdocs/images/dflt_carre.jpg');
}
switch ($action) {
case "original":
- header("Content-type: image/jpeg");
+ pl_cached_content_headers("image/jpeg");
readfile("/home/web/trombino/photos" . $user->promo() . "/" . $user->login() . ".jpg");
exit;
- break;
case "new":
S::assert_xsrf_token();
public function _prepare(PlPage &$page, $id)
{
$page->assign('mygroups', XDB::iterator("SELECT a.nom, a.site, a.diminutif, a.unsub_url, a.pub, m.perms
- FROM groupex.asso AS a
- INNER JOIN groupex.membres AS m ON (m.asso_id = a.id)
+ FROM #groupex#.asso AS a
+ INNER JOIN #groupex#.membres AS m ON (m.asso_id = a.id)
WHERE m.uid = {?} AND (a.cat = 'GroupesX' OR a.cat = 'Institutions')",
S::i('uid')));
$page->assign('listgroups', XDB::iterator("SELECT a.nom, a.diminutif, a.sub_url,
IF (a.cat = 'Institutions', a.cat, d.nom) AS dom
- FROM groupex.asso AS a
- LEFT JOIN groupex.dom AS d ON (d.id = a.dom)
+ FROM #groupex#.asso AS a
+ LEFT JOIN #groupex#.dom AS d ON (d.id = a.dom)
WHERE a.inscriptible != 0
AND (a.cat = 'GroupesX' OR a.cat = 'Institutions')
ORDER BY a.cat, a.dom, a.nom"));
$storage->activate();
break;
case 'ml_promo':
- $r = XDB::query('SELECT id FROM groupex.asso WHERE diminutif = {?}', S::user()->promo());
+ $r = XDB::query('SELECT id FROM #groupex#.asso WHERE diminutif = {?}', S::user()->promo());
if ($r->numRows()) {
$asso_id = $r->fetchOneCell();
- XDB::execute('REPLACE INTO groupex.membres (uid, asso_id)
+ XDB::execute('REPLACE INTO #groupex#.membres (uid, asso_id)
VALUES ({?}, {?})',
S::user()->id(), $asso_id);
$mmlist = new MMList(S::user()->id(), S::v('password'));
$promo_forum = 'xorg.promo.x' . $promo;
$registered_forums = array('xorg.general', 'xorg.pa.divers', 'xorg.pa.logements', $promo_forum);
foreach ($registered_forums as $forum) {
- XDB::execute("INSERT INTO forums.abos (fid,uid)
+ XDB::execute("INSERT INTO #forums#.abos (fid,uid)
SELECT fid, {?}
- FROM forums.list
+ FROM #forums#.list
WHERE nom = {?}",
$uid, $val);
{
global $globals;
- $res = XDB::query("SELECT MIN(`diminutif`), MAX(`diminutif`)
- FROM `groupex`.`asso`
- WHERE `cat` = 'Promotions'");
+ $res = XDB::query("SELECT MIN(diminutif), MAX(diminutif)
+ FROM #groupex#.asso
+ WHERE cat = 'Promotions'");
list($min, $max) = $res->fetchOneRow();
$page->assign('promo_min', $min);
$page->assign('promo_max', $max);
'binet' => array('field' => 'id', 'table' => 'binets_def', 'text' => 'text', 'exact' => false),
'networking_type' => array('field' => 'network_type', 'table' => 'profile_networking_enum',
'text' => 'name', 'exact' => false),
- 'groupex' => array('field' => 'id', 'table' => 'groupex.asso',
+ 'groupex' => array('field' => 'id', 'table' => '#groupex#.asso',
'text' => "(cat = 'GroupesX' OR cat = 'Institutions') AND pub = 'public' AND nom",
'exact' => false),
'section' => array('field' => 'id', 'table' => 'sections', 'text' => 'text', 'exact' => false),
// result1|nb1
// result2|nb2
// ...
- header('Content-Type: text/plain; charset="UTF-8"');
+ pl_content_headers("text/plain");
$q = preg_replace(array('/\*+$/', // always look for $q*
'/([\^\$\[\]])/', // escape special regexp char
'/\*/'), // replace joker by regexp joker
$beginwith = false;
break;
case 'groupexTxt':
- $db = "groupex.asso AS a INNER JOIN
- groupex.membres AS m ON(a.id = m.asso_id
+ $db = "#groupex#.asso AS a INNER JOIN
+ #groupex#.membres AS m ON(a.id = m.asso_id
AND (a.cat = 'GroupesX' OR a.cat = 'Institutions')
AND a.pub = 'public')";
$field='a.nom';
$field = '`fonction_fr`';
break;
case 'diploma':
- header('Content-Type: text/xml; charset="UTF-8"');
+ pl_content_headers("text/xml");
$this->get_diplomas();
$page->changeTpl('search/adv.grade.form.tpl', NO_SKIN);
return;
case 'groupex':
- $db = 'groupex.asso';
+ $db = '#groupex#.asso';
$where = " WHERE (cat = 'GroupesX' OR cat = 'Institutions') AND pub = 'public'";
$field = 'nom';
break;
default: exit();
}
if (isset($idVal)) {
- header('Content-Type: text/plain; charset="UTF-8"');
+ pl_content_headers("text/plain");
$result = XDB::query('SELECT '.$field.' AS field FROM '.$db.' WHERE '.$id.' = {?} LIMIT 1',$idVal);
echo $result->fetchOneCell();
exit();
}
- header('Content-Type: text/xml; charset="UTF-8"');
+ pl_content_headers("text/xml");
$page->changeTpl('include/field.select.tpl', NO_SKIN);
$page->assign('name', $type);
$page->assign('list', XDB::iterator('SELECT '.$field.' AS field,
$join .= "LEFT JOIN emails AS ems ON (ems.uid = u.user_id)";
}
if (!empty($this->ip)) {
- $join .= "INNER JOIN logger.sessions AS ls ON (ls.uid = u.user_id)\n";
+ $join .= "INNER JOIN #logger#.sessions AS ls ON (ls.uid = u.user_id)\n";
}
if (!empty($this->phone)) {
if (!S::logged()) {
$natField = new RefSField('nationalite', array('u.nationalite', 'u.nationalite2', 'u.nationalite3'), '', '', '');
$binetField = new RefSField('binet', array('b.binet_id'), 'binets_ins', 'b', 'u.user_id=b.user_id');
- $groupexField = new RefSField('groupex', array('g.id'), array('groupex.asso', 'groupex.membres'), array('g', 'gm'),
+ $groupexField = new RefSField('groupex', array('g.id'), array('#groupex#.asso', '#groupex#.membres'), array('g', 'gm'),
array("(g.cat = 'GroupesX' OR g.cat = 'Institutions') AND g.pub = 'public'",
'gm.asso_id = g.id AND u.user_id = gm.uid'));
$sectionField = new RefSField('section', array('u.section'), '', '', '');
}
//Genere le graphique à la volée avec GNUPLOT
- header( "Content-type: image/png");
+ pl_cached_dynamic_content_headers("image/png");
$delt = ($total - $init_nb)/10;
$delt = $delt ? $delt : 5;
EOF2;
}
- header('Content-type: image/png');
+ pl_cached_dynamic_content_headers("image/png");
passthru($gnuplot);
exit;
}
return PL_DO_AUTH;
}
if ($show == 'csv') {
- header('Content-Type: text/csv; charset="UTF-8"');
+ pl_content_headers("text/csv");
echo $survey->toCSV();
exit;
} else {
function handler_ajax(&$page, $type)
{
$this->load('survey.inc.php');
- header('Content-Type: text/html; charset="UTF-8"');
+ pl_content_headers("text/html");
if (Survey::isType($type)) { // when type has been chosen, the form is updated to fit exactly the type of question chosen
$page->changeTpl('survey/edit_new.tpl', NO_SKIN);
$page->assign('survey_types', Survey::getTypes());
if ($this->mode == self::MODE_ALL) {
$args['promos'] = '';
}
+ $args['promos'] = str_replace(' ', '', $args['promos']);
$this->promos = ($args['promos'] == '' || preg_match('#^(\d{4}-?|(\d{4})?-\d{4})(,(\d{4}-?|(\d{4})?-\d{4}))*$#', $args['promos']))? $args['promos'] : '#';
}
// }}}
WHERE alias = {?}", $x);
if ((list($type, $data) = $res->fetchOneRow())) {
- Header("Content-type: image/$type");
+ pl_cached_dynamic_content_headers("image/$type");
echo $data;
} else {
- Header('Content-type: image/png');
+ pl_cached_dynamic_content_headers("image/png");
echo file_get_contents(dirname(__FILE__).'/../htdocs/images/none.png');
}
exit;
if (Get::has('del')) {
$res = XDB::query('SELECT id, nom, mail_domain
- FROM groupex.asso WHERE diminutif={?}',
+ FROM #groupex#.asso WHERE diminutif={?}',
Get::v('del'));
list($id, $nom, $domain) = $res->fetchOneRow();
$page->assign('nom', $nom);
if ($id && Post::has('del')) {
S::assert_xsrf_token();
- XDB::query('DELETE FROM groupex.membres WHERE asso_id={?}', $id);
+ XDB::query('DELETE FROM #groupex#.membres WHERE asso_id={?}', $id);
$page->trigSuccess('membres supprimés');
if ($domain) {
}
}
- XDB::query('DELETE FROM groupex.asso WHERE id={?}', $id);
+ XDB::query('DELETE FROM #groupex#.asso WHERE id={?}', $id);
$page->trigSuccess("Groupe $nom supprimé");
Get::kill('del');
}
S::assert_xsrf_token();
$res = XDB::query('SELECT COUNT(*)
- FROM groupex.asso
+ FROM #groupex#.asso
WHERE diminutif = {?}',
Post::v('diminutif'));
if ($res->fetchOneCell() == 0) {
- XDB::execute('INSERT INTO groupex.asso (id, diminutif)
+ XDB::execute('INSERT INTO #groupex#.asso (id, diminutif)
VALUES (NULL, {?})',
Post::v('diminutif'));
pl_redirect('../' . Post::v('diminutif') . '/edit');
}
$res = XDB::query('SELECT nom, diminutif
- FROM groupex.asso
+ FROM #groupex#.asso
ORDER BY nom');
$page->assign('assos', $res->fetchAllAssoc());
}
$res = XDB::iterator(
'SELECT dom.id, dom.nom as domnom, asso.diminutif, asso.nom
- FROM groupex.dom
- INNER JOIN groupex.asso ON dom.id = asso.dom
+ FROM #groupex#.dom
+ INNER JOIN #groupex#.asso ON dom.id = asso.dom
WHERE FIND_IN_SET("GroupesX", dom.cat) AND FIND_IN_SET("GroupesX", asso.cat)
ORDER BY dom.nom, asso.nom');
$groupesx = array();
$res = XDB::iterator(
'SELECT dom.id, dom.nom as domnom, asso.diminutif, asso.nom
- FROM groupex.dom
- INNER JOIN groupex.asso ON dom.id = asso.dom
+ FROM #groupex#.dom
+ INNER JOIN #groupex#.asso ON dom.id = asso.dom
WHERE FIND_IN_SET("Binets", dom.cat) AND FIND_IN_SET("Binets", asso.cat)
ORDER BY dom.nom, asso.nom');
$binets = array();
$res = XDB::iterator(
'SELECT asso.diminutif, asso.nom
- FROM groupex.asso
+ FROM #groupex#.asso
WHERE cat LIKE "%Promotions%"
ORDER BY diminutif');
$page->assign('promos', $res);
$res = XDB::iterator(
'SELECT asso.diminutif, asso.nom
- FROM groupex.asso
+ FROM #groupex#.asso
WHERE FIND_IN_SET("Institutions", cat)
ORDER BY diminutif');
$page->assign('inst', $res);
$page->assign('cat', $cat);
$page->assign('dom', $dom);
- $res = XDB::query("SELECT id,nom FROM groupex.dom
- WHERE FIND_IN_SET({?}, cat)
- ORDER BY nom", $cat);
+ $res = XDB::query("SELECT id,nom
+ FROM #groupex#.dom
+ WHERE FIND_IN_SET({?}, cat)
+ ORDER BY nom", $cat);
$doms = $res->fetchAllAssoc();
$page->assign('doms', $doms);
if (empty($doms)) {
- $res = XDB::query("SELECT diminutif, nom, site FROM groupex.asso
- WHERE FIND_IN_SET({?}, cat)
- ORDER BY nom", $cat);
+ $res = XDB::query("SELECT diminutif, nom, site
+ FROM #groupex#.asso
+ WHERE FIND_IN_SET({?}, cat)
+ ORDER BY nom", $cat);
$page->assign('gps', $res->fetchAllAssoc());
} elseif (!is_null($dom)) {
- $res = XDB::query("SELECT diminutif, nom, site FROM groupex.asso
- WHERE FIND_IN_SET({?}, cat) AND dom={?}
- ORDER BY nom", $cat, $dom);
+ $res = XDB::query("SELECT diminutif, nom, site
+ FROM #groupex#.asso
+ WHERE FIND_IN_SET({?}, cat) AND dom={?}
+ ORDER BY nom", $cat, $dom);
$page->assign('gps', $res->fetchAllAssoc());
}
$allkeys = func_get_args();
unset($allkeys[0]);
$url = join('/',$allkeys);
- header("Content-type: text/javascript; charset=utf-8");
+ pl_content_headers("text/javascript");
echo '$.ajax({ url: "'.$url.'?forceXml=1", dataType: "xml", success: function(xml) { $("body",xml).insertBefore("body"); $("body:eq(1)").remove(); }});';
exit;
}
}
S::assert_xsrf_token();
- $res = XDB::query("SELECT asso_id, short_name FROM groupex.evenements
+ $res = XDB::query("SELECT asso_id, short_name FROM #groupex#.evenements
WHERE eid = {?} AND asso_id = {?}",
$eid, $globals->asso('id'));
}
// deletes the event items
- XDB::execute('DELETE FROM groupex.evenements_items
+ XDB::execute('DELETE FROM #groupex#.evenements_items
WHERE eid = {?}', $eid);
// deletes the event participants
- XDB::execute('DELETE FROM groupex.evenements_participants
+ XDB::execute('DELETE FROM #groupex#.evenements_participants
WHERE eid = {?}', $eid);
// deletes the event
- XDB::execute('DELETE FROM groupex.evenements
+ XDB::execute('DELETE FROM #groupex#.evenements
WHERE eid = {?} AND asso_id = {?}',
$eid, $globals->asso('id'));
}
if ($action == 'archive') {
- XDB::execute("UPDATE groupex.evenements
+ XDB::execute("UPDATE #groupex#.evenements
SET archive = 1
WHERE eid = {?} AND asso_id = {?}",
$eid, $globals->asso('id'));
}
if ($action == 'unarchive') {
- XDB::execute("UPDATE groupex.evenements
+ XDB::execute("UPDATE #groupex#.evenements
SET archive = 0
WHERE eid = {?} AND asso_id = {?}",
$eid, $globals->asso('id'));
1) AS inscr_open, e.deadline_inscription,
u.nom, u.prenom, u.promo, a.alias,
MAX(ep.nb) IS NOT NULL AS inscrit, MAX(ep.paid) AS paid
- FROM groupex.evenements AS e
- INNER JOIN x4dat.auth_user_md5 AS u ON u.user_id = e.organisateur_uid
- INNER JOIN x4dat.aliases AS a ON (a.type = 'a_vie' AND a.id = u.user_id)
- LEFT JOIN groupex.evenements_participants AS ep ON (ep.eid = e.eid AND ep.uid = {?})
+ FROM #groupex#.evenements AS e
+ INNER JOIN #x4dat#.auth_user_md5 AS u ON u.user_id = e.organisateur_uid
+ INNER JOIN #x4dat#.aliases AS a ON (a.type = 'a_vie' AND a.id = u.user_id)
+ LEFT JOIN #groupex#.evenements_participants AS ep ON (ep.eid = e.eid AND ep.uid = {?})
WHERE asso_id = {?}
AND archive = " . ($archive ? "1 " : "0 ")
. "GROUP BY e.eid
$e['show_participants'] = ($e['show_participants'] && (is_member() || may_update()));
$res = XDB::query(
"SELECT titre, details, montant, ei.item_id, nb, ep.paid
- FROM groupex.evenements_items AS ei
- LEFT JOIN groupex.evenements_participants AS ep
+ FROM #groupex#.evenements_items AS ei
+ LEFT JOIN #groupex#.evenements_participants AS ep
ON (ep.eid = ei.eid AND ep.item_id = ei.item_id AND uid = {?})
WHERE ei.eid = {?}",
S::v('uid'), $e['eid']);
foreach ($subs as $j => $nb) {
if ($nb >= 0) {
XDB::execute(
- "REPLACE INTO groupex.evenements_participants
+ "REPLACE INTO #groupex#.evenements_participants
VALUES ({?}, {?}, {?}, {?}, {?}, {?})",
$eid, S::v('uid'), $j, $nb, Env::has('notify_payment') ? 'notify_payment' : '',
$j == 1 ? $paid - $telepaid : 0);
$updated = $eid;
} else {
XDB::execute(
- "DELETE FROM groupex.evenements_participants
+ "DELETE FROM #groupex#.evenements_participants
WHERE eid = {?} AND uid = {?} AND item_id = {?}",
$eid, S::v("uid"), $j);
$updated = $eid;
return PL_NOT_FOUND;
}
- header('Content-type: text/x-csv; encoding=UTF-8');
- header('Pragma: ');
- header('Cache-Control: ');
-
+ pl_content_headers("text/x-csv");
$page->changeTpl('xnetevents/csv.tpl', NO_SKIN);
$admin = may_update();
$page->register_function('display_ical', 'display_ical');
$page->assign_by_ref('e', $evt);
- header('Content-Type: text/calendar; charset=utf-8');
+ pl_content_headers("text/calendar");
}
function handler_edit(&$page, $eid = null)
// get eid if the the given one is a short name
if (!is_null($eid) && !is_numeric($eid)) {
$res = XDB::query("SELECT eid
- FROM groupex.evenements
+ FROM #groupex#.evenements
WHERE asso_id = {?} AND short_name = {?}",
$globals->asso('id'), $eid);
if ($res->numRows()) {
// check the event is in our group
if (!is_null($eid)) {
$res = XDB::query("SELECT short_name
- FROM groupex.evenements
+ FROM #groupex#.evenements
WHERE eid = {?} AND asso_id = {?}",
$eid, $globals->asso('id'));
if ($res->numRows()) {
}
// Store the modifications in the database
- XDB::execute('REPLACE INTO groupex.evenements
+ XDB::execute('REPLACE INTO #groupex#.evenements
SET eid={?}, asso_id={?}, organisateur_uid={?}, intitule={?},
paiement_id = {?}, descriptif = {?}, debut = {?},
fin = {?}, show_participants = {?}, short_name = {?},
$montant = strtr(Post::v('montant'.$i), ',', '.');
$money_defaut += (float)$montant;
XDB::execute("
- REPLACE INTO groupex.evenements_items
+ REPLACE INTO #groupex#.evenements_items
VALUES ({?}, {?}, {?}, {?}, {?})",
$eid, $i, Post::v('titre'.$i),
Post::v('details'.$i), $montant);
} else {
- XDB::execute("DELETE FROM groupex.evenements_items
+ XDB::execute("DELETE FROM #groupex#.evenements_items
WHERE eid = {?} AND item_id = {?}", $eid, $i);
}
}
// events with no sub-event: add a sub-event with no name
if ($nb_moments == 0) {
- XDB::execute("INSERT INTO groupex.evenements_items
+ XDB::execute("INSERT INTO #groupex#.evenements_items
VALUES ({?}, {?}, '', '', 0)", $eid, 1);
}
// when modifying an old event retreive the old datas
if ($eid) {
$res = XDB::query(
- "SELECT eid, intitule, descriptif, debut, fin, organisateur_uid,
- show_participants, paiement_id, short_name,
- deadline_inscription, noinvite, accept_nonmembre
- FROM groupex.evenements
+ "SELECT eid, intitule, descriptif, debut, fin, organisateur_uid,
+ show_participants, paiement_id, short_name,
+ deadline_inscription, noinvite, accept_nonmembre
+ FROM #groupex#.evenements
WHERE eid = {?}", $eid);
$evt = $res->fetchOneAssoc();
// find out if there is already a request for a payment for this event
$page->assign('evt', $evt);
// get all the different moments infos
$res = XDB::iterator(
- "SELECT item_id, titre, details, montant
- FROM groupex.evenements_items AS ei
- INNER JOIN groupex.evenements AS e ON(e.eid = ei.eid)
- WHERE e.eid = {?}
+ "SELECT item_id, titre, details, montant
+ FROM #groupex#.evenements_items AS ei
+ INNER JOIN #groupex#.evenements AS e ON(e.eid = ei.eid)
+ WHERE e.eid = {?}
ORDER BY item_id", $eid);
$items = array();
while ($item = $res->next()) {
// change the price paid by a participant
if (Env::v('adm') == 'prix' && $member) {
- XDB::execute("UPDATE groupex.evenements_participants
+ XDB::execute("UPDATE #groupex#.evenements_participants
SET paid = paid + {?}
WHERE uid = {?} AND eid = {?} AND item_id = 1",
strtr(Env::v('montant'), ',', '.'),
// change the number of personns coming with a participant
if (Env::v('adm') == 'nbs' && $member) {
$res = XDB::query("SELECT paid
- FROM groupex.evenements_participants
+ FROM #groupex#.evenements_participants
WHERE uid = {?} AND eid = {?}",
$member['uid'], $evt['eid']);
foreach ($nbs as $id => $nb) {
$nb = max(intval($nb), 0);
- XDB::execute("REPLACE INTO groupex.evenements_participants
+ XDB::execute("REPLACE INTO #groupex#.evenements_participants
VALUES ({?}, {?}, {?}, {?}, {?}, {?})",
$evt['eid'], $member['uid'], $id, $nb, '', $id == 1 ? $paid : 0);
}
$res = XDB::query("SELECT COUNT(uid) AS cnt, SUM(nb) AS nb
- FROM groupex.evenements_participants
+ FROM #groupex#.evenements_participants
WHERE uid = {?} AND eid = {?}
GROUP BY uid",
$member['uid'], $evt['eid']);
'SELECT UPPER(SUBSTRING(IF(u.nom IS NULL, m.nom,
IF(u.nom_usage<>"", u.nom_usage, u.nom)), 1, 1)),
COUNT(DISTINCT ep.uid)
- FROM groupex.evenements_participants AS ep
- INNER JOIN groupex.evenements AS e ON (ep.eid = e.eid)
- LEFT JOIN groupex.membres AS m ON ( ep.uid = m.uid AND e.asso_id = m.asso_id)
- LEFT JOIN auth_user_md5 AS u ON ( u.user_id = ep.uid )
+ FROM #groupex#.evenements_participants AS ep
+ INNER JOIN #groupex#.evenements AS e ON (ep.eid = e.eid)
+ LEFT JOIN #groupex#.membres AS m ON ( ep.uid = m.uid AND e.asso_id = m.asso_id)
+ LEFT JOIN #x4dat#.auth_user_md5 AS u ON ( u.user_id = ep.uid )
WHERE ep.eid = {?} '.$whereitemid . '
GROUP BY UPPER(SUBSTRING(IF(u.nom IS NULL,m.nom,u.nom), 1, 1))', $evt['eid']);
"SELECT IF(u.nom_usage<>'', u.nom_usage, u.nom) AS nom, u.prenom,
u.promo, a.alias AS email, t.montant
FROM {$globals->money->mpay_tprefix}transactions AS t
- INNER JOIN auth_user_md5 AS u ON(t.uid = u.user_id)
- INNER JOIN aliases AS a ON (a.id = t.uid AND a.type='a_vie' )
- LEFT JOIN groupex.evenements_participants AS ep ON(ep.uid = t.uid AND ep.eid = {?})
+ INNER JOIN #x4dat#.auth_user_md5 AS u ON(t.uid = u.user_id)
+ INNER JOIN #x4dat#.aliases AS a ON (a.id = t.uid AND a.type='a_vie' )
+ LEFT JOIN #groupex#.evenements_participants AS ep ON(ep.uid = t.uid AND ep.eid = {?})
WHERE t.ref = {?} AND ep.uid IS NULL",
$evt['eid'], $evt['paiement_id']);
$page->assign('oublis', $res->total());
IF(m.origine = 'X', u.promo, m.origine) AS promo,
IF(m.origine = 'X', FIND_IN_SET('femme', u.flags), m.sexe) AS sexe,
IF(m.origine = 'X', a.alias, m.email) AS email
- FROM groupex.evenements_participants AS p
- INNER JOIN groupex.membres AS m USING(uid)
- LEFT JOIN groupex.evenements_participants AS p2 ON (p2.uid = m.uid AND p2.eid = p.eid
- AND p2.nb != 0)
- LEFT JOIN auth_user_md5 AS u ON (u.user_id = m.uid)
- LEFT JOIN aliases AS a ON (a.id = u.user_id AND a.type = 'a_vie')
+ FROM #groupex#.evenements_participants AS p
+ INNER JOIN #groupex#.membres AS m USING(uid)
+ LEFT JOIN #groupex#.evenements_participants AS p2 ON (p2.uid = m.uid AND p2.eid = p.eid
+ AND p2.nb != 0)
+ LEFT JOIN #x4dat#.auth_user_md5 AS u ON (u.user_id = m.uid)
+ LEFT JOIN #x4dat#.aliases AS a ON (a.id = u.user_id AND a.type = 'a_vie')
WHERE p.eid = {?} AND p2.eid IS NULL
" . (Env::v('initiale') ? " AND IF(u.nom IS NULL, m.nom,
IF(u.nom_usage<>'', u.nom_usage, u.nom)) LIKE '" . Env::v('initiale') . "%'"
al.vid AS absent_list, pl.vid AS participant_list,
bl.vid AS payed_list, ul.vid AS booked_unpayed_list,
a.nom, a.prenom, a.promo, aa.alias
- FROM groupex.evenements AS e
- INNER JOIN x4dat.auth_user_md5 AS a ON a.user_id = e.organisateur_uid
- INNER JOIN x4dat.aliases AS aa ON (aa.type = 'a_vie' AND aa.id = a.user_id)
- INNER JOIN groupex.evenements_items AS ei ON (e.eid = ei.eid)
- LEFT JOIN groupex.evenements_participants AS ep ON (e.eid = ep.eid AND ei.item_id = ep.item_id)
- LEFT JOIN virtual AS al ON (al.type = 'evt' AND al.alias = CONCAT(short_name, {?}))
- LEFT JOIN virtual AS pl ON (pl.type = 'evt' AND pl.alias = CONCAT(short_name, {?}))
- LEFT JOIN virtual AS bl ON (bl.type = 'evt' AND bl.alias = CONCAT(short_name, {?}))
- LEFT JOIN virtual AS ul ON (ul.type = 'evt' AND ul.alias = CONCAT(short_name, {?}))
+ FROM #groupex#.evenements AS e
+ INNER JOIN #x4dat#.auth_user_md5 AS a ON a.user_id = e.organisateur_uid
+ INNER JOIN #x4dat#.aliases AS aa ON (aa.type = 'a_vie' AND aa.id = a.user_id)
+ INNER JOIN #groupex#.evenements_items AS ei ON (e.eid = ei.eid)
+ LEFT JOIN #groupex#.evenements_participants AS ep ON (e.eid = ep.eid AND ei.item_id = ep.item_id)
+ LEFT JOIN #x4dat#.virtual AS al ON (al.type = 'evt' AND al.alias = CONCAT(short_name, {?}))
+ LEFT JOIN #x4dat#.virtual AS pl ON (pl.type = 'evt' AND pl.alias = CONCAT(short_name, {?}))
+ LEFT JOIN #x4dat#.virtual AS bl ON (bl.type = 'evt' AND bl.alias = CONCAT(short_name, {?}))
+ LEFT JOIN #x4dat#.virtual AS ul ON (ul.type = 'evt' AND ul.alias = CONCAT(short_name, {?}))
WHERE (e.eid = {?} OR e.short_name = {?}) AND ei.item_id = {?} AND e.asso_id = {?}
GROUP BY ei.item_id",
'-absents@' . $globals->xnet->evts_domain,
if (!$item_id) {
$res = XDB::query(
"SELECT MAX(nb)
- FROM groupex.evenements AS e
- INNER JOIN groupex.evenements_items AS ei ON (e.eid = ei.eid)
- LEFT JOIN groupex.evenements_participants AS ep
+ FROM #groupex#.evenements AS e
+ INNER JOIN #groupex#.evenements_items AS ei ON (e.eid = ei.eid)
+ LEFT JOIN #groupex#.evenements_participants AS ep
ON (e.eid = ep.eid AND ei.item_id = ep.item_id)
WHERE e.eid = {?}
GROUP BY ep.uid", $evt['eid']);
$res = XDB::query(
"SELECT titre, details, montant, ei.item_id, nb, ep.paid, FIND_IN_SET('notify_payment', ep.flags) AS notify_payment
- FROM groupex.evenements_items AS ei
- LEFT JOIN groupex.evenements_participants AS ep
+ FROM #groupex#.evenements_items AS ei
+ LEFT JOIN #groupex#.evenements_participants AS ep
ON (ep.eid = ei.eid AND ep.item_id = ei.item_id AND uid = {?})
WHERE ei.eid = {?}",
S::v('uid'), $evt['eid']);
(m.origine = 'X' OR m.origine IS NULL) AS x,
ep.uid, SUM(ep.paid) AS paid, SUM(ep.nb) AS nb,
FIND_IN_SET('notify_payment', ep.flags) AS notify_payment
- FROM groupex.evenements_participants AS ep
- INNER JOIN groupex.evenements AS e ON (ep.eid = e.eid)
- LEFT JOIN groupex.membres AS m ON ( ep.uid = m.uid AND e.asso_id = m.asso_id)
- LEFT JOIN auth_user_md5 AS u ON ( u.user_id = ep.uid )
- LEFT JOIN aliases AS a ON ( a.id = ep.uid AND a.type='a_vie' )
+ FROM #groupex#.evenements_participants AS ep
+ INNER JOIN #groupex#.evenements AS e ON (ep.eid = e.eid)
+ LEFT JOIN #groupex#.membres AS m ON ( ep.uid = m.uid AND e.asso_id = m.asso_id)
+ LEFT JOIN #x4dat#.auth_user_md5 AS u ON ( u.user_id = ep.uid )
+ LEFT JOIN #x4dat#.aliases AS a ON ( a.id = ep.uid AND a.type='a_vie' )
WHERE ep.eid = {?}
".(($item_id)?" AND item_id = $item_id":"")."
$where
$u['telepayment'] = $u['paid'] - $u['adminpaid'];
$res_ = XDB::iterator(
"SELECT ep.nb, ep.item_id, ei.montant
- FROM groupex.evenements_participants AS ep
- INNER JOIN groupex.evenements_items AS ei ON (ei.eid = ep.eid AND ei.item_id = ep.item_id)
+ FROM #groupex#.evenements_participants AS ep
+ INNER JOIN #groupex#.evenements_items AS ei ON (ei.eid = ep.eid AND ei.item_id = ep.item_id)
WHERE ep.eid = {?} AND ep.uid = {?}",
$eid, $u['uid']);
while ($i = $res_->next()) {
$email = $user->forlifeEmail();
} else {
$res = XDB::query("SELECT email
- FROM groupex.membres
+ FROM #groupex#.membres
WHERE uid = {?} AND asso_id = {?}",
$uid, $globals->asso('id'));
$email = $res->fetchOneCell();
//vérifier que l'alias n'est pas déja pris
if ($new && $old != $new) {
$res = XDB::query('SELECT COUNT(*)
- FROM groupex.evenements
+ FROM #groupex#.evenements
WHERE short_name = {?}',
$new);
if ($res->fetchOneCell() > 0) {
foreach (array('-participants@', '-paye@', '-participants-non-paye@') as $v) {
XDB::execute("INSERT IGNORE INTO virtual_redirect (
SELECT {?} AS vid, IF(a.alias IS NULL, m.email, CONCAT(a.alias, {?})) AS redirect
- FROM groupex.evenements_participants AS ep
- LEFT JOIN groupex.membres AS m ON (ep.uid = m.uid)
- LEFT JOIN auth_user_md5 AS u ON (u.user_id = ep.uid)
- LEFT JOIN aliases AS a ON (a.id = ep.uid AND a.type = 'a_vie')
+ FROM #groupex#.evenements_participants AS ep
+ LEFT JOIN #groupex#.membres AS m ON (ep.uid = m.uid)
+ LEFT JOIN #x4dat#.auth_user_md5 AS u ON (u.user_id = ep.uid)
+ LEFT JOIN #x4dat#.aliases AS a ON (a.id = ep.uid AND a.type = 'a_vie')
WHERE ep.eid = {?} AND " . $where[$v] . "
GROUP BY ep.uid)",
$lastid[$v], '@' . $globals->mail->domain, $eid);
}
XDB::execute("INSERT IGNORE INTO virtual_redirect (
SELECT {?} AS vid, IF(a.alias IS NULL, m.email, CONCAT(a.alias, {?})) AS redirect
- FROM groupex.membres AS m
- LEFT JOIN groupex.evenements_participants AS ep ON (ep.uid = m.uid AND ep.eid = {?})
- LEFT JOIN auth_user_md5 AS u ON (u.user_id = m.uid)
- LEFT JOIN aliases AS a ON (a.id = m.uid AND a.type = 'a_vie ')
+ FROM #groupex#.membres AS m
+ LEFT JOIN #groupex#.evenements_participants AS ep ON (ep.uid = m.uid AND ep.eid = {?})
+ LEFT JOIN #x4dat#.auth_user_md5 AS u ON (u.user_id = m.uid)
+ LEFT JOIN #x4dat#.aliases AS a ON (a.id = m.uid AND a.type = 'a_vie')
WHERE m.asso_id = {?} AND ep.uid IS NULL
GROUP BY m.uid)",
$lastid['-absents@'], '@' . $globals->mail->domain, $eid, $globals->asso('id'));
$res = XDB::query(
"SELECT uid, nom, prenom, email, email AS email2, perms='admin', origine, comm, sexe
- FROM groupex.membres
+ FROM #groupex#.membres
WHERE $field = {?} AND asso_id = {?}", $email, $globals->asso('id'));
if ($res->numRows()) {
CONCAT(b.alias, '@polytechnique.org') AS email2,
m.perms = 'admin' AS perms, m.origine, m.comm,
FIND_IN_SET('femme', u.flags) AS sexe
- FROM auth_user_md5 AS u
- INNER JOIN aliases AS a ON ( u.user_id = a.id AND a.type != 'homonyme' )
- INNER JOIN aliases AS b ON ( u.user_id = b.id AND b.type = 'a_vie' )
- LEFT JOIN groupex.membres AS m ON ( m.uid = u.user_id AND asso_id={?})
+ FROM #x4dat#.auth_user_md5 AS u
+ INNER JOIN #x4dat#.aliases AS a ON ( u.user_id = a.id AND a.type != 'homonyme' )
+ INNER JOIN #x4dat#.aliases AS b ON ( u.user_id = b.id AND b.type = 'a_vie' )
+ LEFT JOIN #groupex#.membres AS m ON ( m.uid = u.user_id AND asso_id={?})
WHERE a.alias = {?} AND u.user_id < 50000", $globals->asso('id'), $mbox);
return $res->fetchOneAssoc();
}
if (S::logged()) {
if (Env::has('read')) {
- XDB::query('DELETE groupex.r.*
- FROM groupex.announces_read AS r
- INNER JOIN groupex.announces AS a ON a.id = r.announce_id
+ XDB::query('DELETE #groupex#.r.*
+ FROM #groupex#.announces_read AS r
+ INNER JOIN #groupex#.announces AS a ON a.id = r.announce_id
WHERE peremption < CURRENT_DATE()');
- XDB::query('INSERT INTO groupex.announces_read
+ XDB::query('INSERT INTO #groupex#.announces_read
VALUES ({?}, {?})',
Env::i('read'), S::i('uid'));
pl_redirect("");
}
if (Env::has('unread')) {
- XDB::query('DELETE FROM groupex.announces_read
+ XDB::query('DELETE FROM #groupex#.announces_read
WHERE announce_id={?} AND user_id={?}',
Env::i('unread'), S::i('uid'));
pl_redirect("#art" . Env::i('unread'));
}
$arts = XDB::iterator("SELECT a.*, u.nom, u.prenom, u.promo, u.hruid,
FIND_IN_SET('photo', a.flags) AS photo
- FROM groupex.announces AS a
- INNER JOIN auth_user_md5 AS u USING(user_id)
- LEFT JOIN groupex.announces_read AS r ON (r.user_id = {?} AND r.announce_id = a.id)
+ FROM #groupex#.announces AS a
+ INNER JOIN #x4dat#.auth_user_md5 AS u USING(user_id)
+ LEFT JOIN #groupex#.announces_read AS r ON (r.user_id = {?} AND r.announce_id = a.id)
WHERE asso_id = {?} AND peremption >= CURRENT_DATE()
AND (promo_min = 0 OR promo_min <= {?})
AND (promo_max = 0 OR promo_max >= {?})
ORDER BY a.peremption",
S::i('uid'), $globals->asso('id'), S::i('promo'), S::i('promo'));
$index = XDB::iterator("SELECT a.id, a.titre, r.user_id IS NULL AS nonlu
- FROM groupex.announces AS a
- LEFT JOIN groupex.announces_read AS r ON (a.id = r.announce_id AND r.user_id = {?})
+ FROM #groupex#.announces AS a
+ LEFT JOIN #groupex#.announces_read AS r ON (a.id = r.announce_id AND r.user_id = {?})
WHERE asso_id = {?} AND peremption >= CURRENT_DATE()
AND (promo_min = 0 OR promo_min <= {?})
AND (promo_max = 0 OR promo_max >= {?})
$page->assign('article_index', $index);
} else {
$arts = XDB::iterator("SELECT a.*, u.nom, u.prenom, u.promo, FIND_IN_SET('photo', a.flags) AS photo
- FROM groupex.announces AS a
- INNER JOIN auth_user_md5 AS u USING(user_id)
+ FROM #groupex#.announces AS a
+ INNER JOIN #x4dat#.auth_user_md5 AS u USING(user_id)
WHERE asso_id = {?} AND peremption >= CURRENT_DATE()
AND FIND_IN_SET('public', u.flags)",
$globals->asso('id'));
}
if (may_update()) {
$subs_valid = XDB::query("SELECT uid
- FROM groupex.membres_sub_requests
+ FROM #groupex#.membres_sub_requests
WHERE asso_id = {?}",
$globals->asso('id'));
$page->assign('requests', $subs_valid->numRows());
global $globals;
$res = XDB::query("SELECT logo, logo_mime
- FROM groupex.asso WHERE id = {?}",
+ FROM #groupex#.asso WHERE id = {?}",
$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;
}
return;
}
XDB::execute(
- "UPDATE groupex.asso
+ "UPDATE #groupex#.asso
SET nom={?}, diminutif={?}, cat={?}, dom={?},
descr={?}, site={?}, mail={?}, resp={?},
forum={?}, mail_domain={?}, ax={?}, pub={?},
}
} else {
XDB::execute(
- "UPDATE groupex.asso
+ "UPDATE #groupex#.asso
SET descr={?}, site={?}, mail={?}, resp={?},
forum={?}, pub= {?}, sub_url={?},
unsub_url={?},flags={?}
if ($_FILES['logo']['name']) {
$logo = file_get_contents($_FILES['logo']['tmp_name']);
$mime = $_FILES['logo']['type'];
- XDB::execute('UPDATE groupex.asso
+ XDB::execute('UPDATE #groupex#.asso
SET logo={?}, logo_mime={?}
WHERE id={?}', $logo, $mime,
$globals->asso('id'));
}
if (S::admin()) {
- $dom = XDB::iterator('SELECT * FROM groupex.dom ORDER BY nom');
+ $dom = XDB::iterator('SELECT * FROM #groupex#.dom ORDER BY nom');
$page->assign('dom', $dom);
$page->assign('super', true);
}
'SELECT UPPER(SUBSTRING(
IF(m.origine="X", IF(u.nom_usage<>"", u.nom_usage, u.nom),m.nom),
1, 1)) as letter, COUNT(*)
- FROM groupex.membres AS m
- LEFT JOIN auth_user_md5 AS u ON ( u.user_id = m.uid)
+ FROM #groupex#.membres AS m
+ LEFT JOIN #x4dat#.auth_user_md5 AS u ON ( u.user_id = m.uid)
WHERE asso_id = {?} and (u.perms != \'pending\' OR m.email IS NOT NULL)
GROUP BY letter
ORDER BY letter', $globals->asso('id'));
'SELECT IF(m.origine="X",u.promo,
IF(m.origine="ext", "extérieur", "personne morale")) AS promo,
COUNT(*), IF(m.origine="X",u.promo,"") AS promo_o
- FROM groupex.membres AS m
- LEFT JOIN auth_user_md5 AS u ON ( u.user_id = m.uid )
+ FROM #groupex#.membres AS m
+ LEFT JOIN #x4dat#.auth_user_md5 AS u ON ( u.user_id = m.uid )
WHERE asso_id = {?}
GROUP BY promo
ORDER BY promo_o DESC', $globals->asso('id'));
u.perms!='pending' AS inscrit,
m.comm as comm,
m.uid, IF(e.email IS NULL AND FIND_IN_SET('googleapps', u.mail_storage) = 0, NULL, 1) AS actif
- FROM groupex.membres AS m
- LEFT JOIN auth_user_md5 AS u ON ( u.user_id = m.uid )
- LEFT JOIN aliases AS a ON ( a.id = m.uid AND a.type='a_vie' )
- LEFT JOIN emails AS e ON ( e.flags = 'active' AND e.uid = m.uid)
+ FROM #groupex#.membres AS m
+ LEFT JOIN #x4dat#.auth_user_md5 AS u ON ( u.user_id = m.uid )
+ LEFT JOIN #x4dat#.aliases AS a ON ( a.id = m.uid AND a.type='a_vie' )
+ LEFT JOIN #x4dat#.emails AS e ON ( e.flags = 'active' AND e.uid = m.uid)
WHERE m.asso_id = {?} $ini
AND (m.origine != 'X' OR u.perms != 'pending' OR m.email IS NOT NULL)
GROUP BY m.uid
{
global $globals;
$res = XDB::query('SELECT uid
- FROM groupex.membres
+ FROM #groupex#.membres
WHERE asso_id = {?}', $globals->asso('id'));
$vcard = new VCard($photos == 'photos', 'Membre du groupe ' . $globals->asso('nom'));
$vcard->addUsers($res->fetchColumn());
IF(m.origine='X' AND u.perms != 'pending',CONCAT(a.alias, '@', {?}), m.email) AS email,
IF(m.origine='X',FIND_IN_SET('femme', u.flags), m.sexe) AS femme,
m.comm as comm
- FROM groupex.membres AS m
- LEFT JOIN auth_user_md5 AS u ON ( u.user_id = m.uid )
- LEFT JOIN aliases AS a ON ( a.id = m.uid AND a.type = 'a_vie' )
+ FROM #groupex#.membres AS m
+ LEFT JOIN #x4dat#.auth_user_md5 AS u ON ( u.user_id = m.uid )
+ LEFT JOIN #x4dat#.aliases AS a ON ( a.id = m.uid AND a.type = 'a_vie' )
WHERE m.asso_id = {?}
AND (m.origine != 'X' OR u.perms != 'pending' OR m.email IS NOT NULL)
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);
}
private function removeSubscriptionRequest($uid)
{
global $globals;
- XDB::execute("DELETE FROM groupex.membres_sub_requests
+ XDB::execute("DELETE FROM #groupex#.membres_sub_requests
WHERE asso_id = {?} AND uid = {?}",
$globals->asso('id'), $uid);
}
{
global $globals;
$this->removeSubscriptionRequest($user->id());
- XDB::execute("INSERT IGNORE INTO groupex.membres (asso_id, uid)
+ XDB::execute("INSERT IGNORE INTO #groupex#.membres (asso_id, uid)
VALUES ({?}, {?})",
$globals->asso('id'), $user->id());
if (XDB::affectedRows() == 1) {
// Retrieves the subscription status, and the reason.
$res = XDB::query("SELECT reason
- FROM groupex.membres_sub_requests
+ FROM #groupex#.membres_sub_requests
WHERE asso_id = {?} AND uid = {?}",
$globals->asso('id'), $user->id());
$reason = ($res->numRows() ? $res->fetchOneCell() : null);
$res = XDB::query("SELECT COUNT(*)
- FROM groupex.membres
+ FROM #groupex#.membres
WHERE asso_id = {?} AND uid = {?}",
$globals->asso('id'), $user->id());
$already_member = ($res->fetchOneCell() > 0);
}
$res = XDB::query("SELECT uid
- FROM groupex.membres_sub_requests
+ FROM #groupex#.membres_sub_requests
WHERE uid = {?} AND asso_id = {?}",
S::i('uid'), $globals->asso('id'));
if ($res->numRows() != 0) {
if (Post::has('inscrire')) {
S::assert_xsrf_token();
- XDB::execute("INSERT INTO groupex.membres_sub_requests (asso_id, uid, ts, reason)
+ XDB::execute("INSERT INTO #groupex#.membres_sub_requests (asso_id, uid, ts, reason)
VALUES ({?}, {?}, NOW(), {?})",
$globals->asso('id'), S::i('uid'), Post::v('message'));
$res = XDB::query('SELECT IF(m.email IS NULL,
CONCAT(al.alias,"@polytechnique.org"),
m.email)
- FROM groupex.membres AS m
- INNER JOIN aliases AS al ON (al.type = "a_vie"
+ FROM #groupex#.membres AS m
+ INNER JOIN #x4dat#.aliases AS al ON (al.type = "a_vie"
AND al.id = m.uid)
WHERE perms="admin" AND m.asso_id = {?}',
$globals->asso('id'));
$it = XDB::iterator("SELECT IF(u.nom_usage != '', u.nom_usage, u.nom) AS nom,
u.prenom, u.promo, u.hruid, s.ts AS date
- FROM groupex.membres_sub_requests AS s
- INNER JOIN auth_user_md5 AS u ON (s.uid = u.user_id)
+ FROM #groupex#.membres_sub_requests AS s
+ INNER JOIN #x4dat#.auth_user_md5 AS u ON (s.uid = u.user_id)
WHERE asso_id = {?}
ORDER BY nom, prenom",
$globals->asso('id'));
foreach ($subscribers as $mail) {
$res = XDB::query(
'SELECT COUNT(*)
- FROM groupex.membres AS m
- LEFT JOIN auth_user_md5 AS u ON (m.uid=u.user_id AND m.uid<50000)
- LEFT JOIN aliases AS a ON (a.id=u.user_id and a.type="a_vie")
+ FROM #groupex#.membres AS m
+ LEFT JOIN #x4dat#.auth_user_md5 AS u ON (m.uid = u.user_id AND m.uid < 50000)
+ LEFT JOIN #x4dat#.aliases AS a ON (a.id = u.user_id and a.type = "a_vie")
WHERE asso_id = {?} AND
(m.email = {?} OR CONCAT(a.alias, "@polytechnique.org") = {?})',
$globals->asso('id'), $mail, $mail);
if (!User::isForeignEmailAddress($email)) {
$user = User::get($email);
if ($user) {
- XDB::execute("REPLACE INTO groupex.membres (uid, asso_id, origine)
+ XDB::execute("REPLACE INTO #groupex#.membres (uid, asso_id, origine)
VALUES ({?}, {?}, 'X')",
$user->id(), $globals->asso('id'));
pl_redirect("member/" . $user->login());
$market->add();
}
}
- XDB::execute('REPLACE INTO groupex.membres (uid, asso_id, origine, email)
+ XDB::execute('REPLACE INTO #groupex#.membres (uid, asso_id, origine, email)
VALUES ({?}, {?}, "X", {?})',
$uid, $globals->asso('id'), $email);
$this->removeSubscriptionRequest($uid);
}
$page->trigError("Utilisateur invalide");
} else {
- $res = XDB::query('SELECT MAX(uid)+1 FROM groupex.membres');
+ $res = XDB::query('SELECT MAX(uid) + 1 FROM #groupex#.membres');
$uid = max(intval($res->fetchOneCell()), 50001);
- XDB::execute('REPLACE INTO groupex.membres (uid, asso_id, origine, email)
+ XDB::execute('REPLACE INTO #groupex#.membres (uid, asso_id, origine, email)
VALUES ({?}, {?}, "ext", {?})',
$uid, $globals->asso('id'), $email);
pl_redirect("member/$email");
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')) {
{
global $globals;
XDB::execute(
- "DELETE FROM groupex.membres WHERE uid={?} AND asso_id={?}",
+ "DELETE FROM #groupex#.membres WHERE uid={?} AND asso_id={?}",
$user['uid'], $globals->asso('id'));
if ($globals->asso('notif_unsub')) {
$mailer = new PlMailer('xnetgrp/unsubscription-notif.mail.tpl');
$res = XDB::iterRow("SELECT a.alias, u.prenom, IF(u.nom_usage != '', u.nom_usage, u.nom) AS nom
- FROM groupex.membres AS m
- INNER JOIN aliases AS a ON (m.uid = a.id AND FIND_IN_SET('bestalias', a.flags))
- INNER JOIn auth_user_md5 AS u ON (u.user_id = a.id)
+ FROM #groupex#.membres AS m
+ INNER JOIN #x4dat#.aliases AS a ON (m.uid = a.id AND FIND_IN_SET('bestalias', a.flags))
+ INNER JOIn #x4dat#.auth_user_md5 AS u ON (u.user_id = a.id)
WHERE m.asso_id = {?} AND m.perms = 'admin'",
$globals->asso('id'));
while (list($alias, $prenom, $nom) = $res->next()) {
// Check if the user is already in the group
global $globals;
$res = XDB::query("SELECT uid, email
- FROM groupex.membres
+ FROM #groupex#.membres
WHERE uid = {?} AND asso_id = {?}",
$uid, $globals->asso('id'));
if ($res->numRows()) {
list($uid, $email) = $res->fetchOneRow();
- XDB::execute("DELETE FROM groupex.membres
+ XDB::execute("DELETE FROM #groupex#.membres
WHERE uid = {?}",
$user['uid']);
} else {
$email = $user['email'];
- XDB::execute("UPDATE groupex.membres
+ XDB::execute("UPDATE #groupex#.membres
SET uid = {?}, origine = 'X'
WHERE uid = {?} AND asso_id = {?}",
$uid, $user['uid'], $globals->asso('id'));
$user['prenom'] = (Post::v('origine') == 'ext') ? Post::v('prenom') : '';
$user['sexe'] = (Post::v('origine') == 'ext') ? Post::v('sexe') : 0;
$user['origine'] = Post::v('origine');
- XDB::query('UPDATE groupex.membres
- SET prenom={?}, nom={?}, email={?}, sexe={?}, origine={?}
- WHERE uid={?} AND asso_id={?}',
+ XDB::query('UPDATE #groupex#.membres
+ SET prenom = {?}, nom = {?}, email = {?}, sexe = {?}, origine = {?}
+ WHERE uid = {?} AND asso_id = {?}',
$user['prenom'], $user['nom'], Post::v('email'),
$user['sexe'], $user['origine'],
$user['uid'], $globals->asso('id'));
$perms = Post::i('is_admin');
$comm = trim(Post::s('comm'));
if ($user['perms'] != $perms || $user['comm'] != $comm) {
- XDB::query('UPDATE groupex.membres
- SET perms={?}, comm={?}
- WHERE uid={?} AND asso_id={?}',
+ XDB::query('UPDATE #groupex#.membres
+ SET perms = {?}, comm = {?}
+ WHERE uid = {?} AND asso_id = {?}',
$perms ? 'admin' : 'membre', $comm,
$user['uid'], $globals->asso('id'));
if ($perms != $user['perms']) {
function handler_photo_announce(&$page, $eid = null) {
if ($eid) {
- $res = XDB::query("SELECT * FROM groupex.announces_photo WHERE eid = {?}", $eid);
+ $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;
}
}
$art['photo'] = $upload->exists() || Post::i('photo');
if (Post::v('valid') == 'Pas d\'image' && !is_null($aid)) {
- XDB::query("DELETE FROM groupex.announces_photo WHERE eid = {?}", $aid);
+ XDB::query("DELETE FROM #groupex#.announces_photo WHERE eid = {?}", $aid);
$upload->rm();
Post::kill('valid');
$art['photo'] = false;
$post = $banana->post($globals->asso('forum'), null,
$art['titre'], MiniWiki::wikiToText($fulltext, false, 0, 80));
}*/
- XDB::query("INSERT INTO groupex.announces
+ XDB::query("INSERT INTO #groupex#.announces
(user_id, asso_id, create_date, titre, texte, contacts,
peremption, promo_min, promo_max, flags, post_id)
VALUES ({?}, {?}, NOW(), {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?})",
$aid = XDB::insertId();
if ($art['photo']) {
list($imgx, $imgy, $imgtype) = $upload->imageInfo();
- XDB::execute("INSERT INTO groupex.announces_photo
+ XDB::execute("INSERT INTO #groupex#.announces_photo
SET eid = {?}, attachmime = {?}, x = {?}, y = {?}, attach = {?}",
$aid, $imgtype, $imgx, $imgy, $upload->getContents());
}
$page->trigWarning("La parution dans la Lettre Mensuelle est en attente de validation.");
}
} else {
- XDB::query("UPDATE groupex.announces
+ XDB::query("UPDATE #groupex#.announces
SET titre={?}, texte={?}, contacts={?}, peremption={?},
promo_min={?}, promo_max={?}, flags={?}
WHERE id={?} AND asso_id={?}",
$art['id'], $globals->asso('id'));
if ($art['photo'] && $upload->exists()) {
list($imgx, $imgy, $imgtype) = $upload->imageInfo();
- XDB::execute("REPLACE INTO groupex.announces_photo
- SET eid = {?}, attachmime = {?}, x = {?}, y = {?}, attach = {?}",
+ XDB::execute("REPLACE INTO #groupex#.announces_photo
+ SET eid = {?}, attachmime = {?}, x = {?}, y = {?}, attach = {?}",
$aid, $imgtype, $imgx, $imgy, $upload->getContents());
$upload->rm();
}
$res = XDB::query("SELECT a.*, u.nom, u.prenom, u.promo, u.hruid,
FIND_IN_SET('public', a.flags) AS public,
FIND_IN_SET('photo', a.flags) AS photo
- FROM groupex.announces AS a
- INNER JOIN auth_user_md5 AS u USING(user_id)
+ FROM #groupex#.announces AS a
+ INNER JOIN #x4dat#.auth_user_md5 AS u USING(user_id)
WHERE asso_id = {?} AND a.id = {?}",
$globals->asso('id'), $aid);
if ($res->numRows()) {
if (is_null($aid)) {
$events = XDB::iterator("SELECT *
- FROM groupex.evenements
+ FROM #groupex#.evenements
WHERE asso_id = {?} AND archive = 0",
$globals->asso('id'));
if ($events->total()) {
if (Env::has('del')) {
S::assert_xsrf_token();
- XDB::execute("DELETE FROM groupex.announces
+ XDB::execute("DELETE FROM #groupex#.announces
WHERE id = {?} AND asso_id = {?}",
Env::i('del'), $globals->asso('id'));
}
$res = XDB::iterator("SELECT a.id, a.titre, a.peremption, a.peremption < CURRENT_DATE() AS perime
- FROM groupex.announces AS a
+ FROM #groupex#.announces AS a
WHERE a.asso_id = {?}
ORDER BY a.peremption DESC",
$globals->asso('id'));
CONCAT(u2.prenom, ' ', IF(u2.nom_usage != '', u2.nom_usage, u2.nom), ' (X', u2.promo, ')') AS author,
FIND_IN_SET('photo', a.flags) AS photo,
CONCAT({?}, '/#art', a.id) AS link
- FROM auth_user_md5 AS u
- INNER JOIN groupex.announces AS a ON ( (a.promo_min = 0 OR a.promo_min <= u.promo)
- AND (a.promo_max = 0 OR a.promo_max <= u.promo))
- INNER JOIN auth_user_md5 AS u2 ON (u2.user_id = a.user_id)
+ FROM #x4dat#.auth_user_md5 AS u
+ INNER JOIN #groupex#.announces AS a ON ((a.promo_min = 0 OR a.promo_min <= u.promo)
+ AND (a.promo_max = 0 OR a.promo_max <= u.promo))
+ INNER JOIN #x4dat#.auth_user_md5 AS u2 ON (u2.user_id = a.user_id)
WHERE u.user_id = {?} AND peremption >= NOW() AND a.asso_id = {?}",
$this->link, $user->id(), $globals->asso('id'));
} else {
CONCAT(u.prenom, ' ', IF(u.nom_usage != '', u.nom_usage, u.nom), ' (X', u.promo, ')') AS author,
CONCAT({?}, '/#art', a.id) AS link,
NULL AS photo, NULL AS contacts
- FROM groupex.announces AS a
- INNER JOIN auth_user_md5 AS u USING(user_id)
+ FROM #groupex#.announces AS a
+ INNER JOIN #x4dat#.auth_user_md5 AS u USING(user_id)
WHERE FIND_IN_SET('public', a.flags) AND peremption >= NOW() AND a.asso_id = {?}",
$this->link, $globals->asso('id'));
}
IF(u.prenom <> "", u.prenom, m.prenom) AS prenom,
IF(m.email <> "", m.email, CONCAT(a.alias, "@polytechnique.org")) as email,
IF(m.sexe IS NULL, FIND_IN_SET("femme", u.flags), m.sexe) AS sexe
- FROM groupex.membres AS m
- LEFT JOIN auth_user_md5 AS u ON (m.uid=u.user_id AND m.uid<50000)
- LEFT JOIN aliases AS a ON (a.id=u.user_id and a.type="a_vie")
+ FROM #groupex#.membres AS m
+ LEFT JOIN #x4dat#.auth_user_md5 AS u ON (m.uid=u.user_id AND m.uid<50000)
+ LEFT JOIN #x4dat#.aliases AS a ON (a.id=u.user_id and a.type="a_vie")
WHERE asso_id = {?}
AND m.origine IN (' . $membres . ')
AND (m.email <> "" OR u.perms <> "pending")', $globals->asso('id'));
$tos[] = $person;
}
} else {
- $res = XDB::query('SELECT prenom, nom, sexe FROM groupex.membres WHERE email={?}', $mem[1]);
+ $res = XDB::query('SELECT prenom, nom, sexe FROM #groupex#.membres WHERE email={?}', $mem[1]);
if ($person = $res->fetchOneAssoc()) {
$person['email'] = $mem[1];
$tos[] = $person;
$alias = substr($alias, 0, strpos($alias, '@')).'@'.$globals->asso('mail_domain');
XDB::query(
'DELETE FROM r, v
- USING x4dat.virtual AS v
- LEFT JOIN x4dat.virtual_redirect AS r USING(vid)
+ USING virtual AS v
+ LEFT JOIN virtual_redirect AS r USING(vid)
WHERE v.alias={?}', $alias);
$page->trigSuccess(Post::v('del_alias')." supprimé !");
}
$alias = XDB::iterator(
'SELECT alias,type
- FROM x4dat.virtual
+ FROM virtual
WHERE alias
LIKE {?} AND type="user"
ORDER BY alias', '%@'.$globals->asso('mail_domain'));
$page->assign('may_update', may_update());
if (count($listes) > 0 && !$globals->asso('has_ml')) {
- XDB::execute("UPDATE groupex.asso
+ XDB::execute("UPDATE #groupex#.asso
SET flags = CONCAT_WS(',', IF(flags = '', NULL, flags), 'has_ml')
WHERE id = {?}",
$globals->asso('id'));
}
$new = $liste.'@'.$globals->asso('mail_domain');
- $res = XDB::query('SELECT alias FROM x4dat.virtual WHERE alias={?}', $new);
+ $res = XDB::query('SELECT alias FROM virtual WHERE alias={?}', $new);
if ($res->numRows()) {
$page->trigError('cet alias est déjà pris');
if (!empty($app)) {
$app = '-' . $app;
}
- XDB::execute('INSERT INTO x4dat.virtual (alias,type)
+ XDB::execute('INSERT INTO virtual (alias,type)
VALUES({?},{?})', $liste. $app . '@'.$dom, 'list');
- XDB::execute('INSERT INTO x4dat.virtual_redirect (vid,redirect)
+ XDB::execute('INSERT INTO virtual_redirect (vid,redirect)
VALUES ({?}, {?})', XDB::insertId(),
$red . $mdir . '@listes.polytechnique.org');
}
- XDB::execute("UPDATE groupex.asso
+ XDB::execute("UPDATE #groupex#.asso
SET flags = CONCAT_WS(',', IF(flags = '', NULL, flags), 'has_ml')
WHERE id = {?}",
$globals->asso('id'));
if (m.origine='X',FIND_IN_SET('femme', u.flags),0) AS femme,
m.perms='admin' AS admin,
m.origine='X' AS x
- FROM groupex.membres AS m
- LEFT JOIN auth_user_md5 AS u ON ( u.user_id = m.uid )
- LEFT JOIN aliases AS a ON ( a.id = m.uid AND a.type='a_vie' )
+ FROM #groupex#.membres AS m
+ LEFT JOIN #x4dat#.auth_user_md5 AS u ON ( u.user_id = m.uid )
+ LEFT JOIN #x4dat#.aliases AS a ON ( a.id = m.uid AND a.type='a_vie' )
WHERE m.asso_id = {?}
ORDER BY promo, nom, prenom", $globals->asso('id'));
if ($dom == 'polytechnique.org' || $dom == 'm4x.org') {
$res = XDB::query(
"SELECT a.alias, b.alias
- FROM x4dat.aliases AS a
- LEFT JOIN x4dat.aliases AS b ON (a.id=b.id AND b.type = 'a_vie')
+ FROM aliases AS a
+ LEFT JOIN aliases AS b ON (a.id=b.id AND b.type = 'a_vie')
WHERE a.alias={?} AND a.type!='homonyme'", $mbox);
if (list($alias, $blias) = $res->fetchOneRow()) {
$alias = empty($blias) ? $alias : $blias;
XDB::query(
- "INSERT IGNORE INTO x4dat.virtual_redirect (vid,redirect)
+ "INSERT IGNORE INTO virtual_redirect (vid,redirect)
SELECT vid, {?}
- FROM x4dat.virtual
+ FROM virtual
WHERE alias={?}", "$alias@m4x.org", $lfull);
$page->trigSuccess("$alias@m4x.org ajouté");
} else {
}
} else {
XDB::query(
- "INSERT IGNORE INTO x4dat.virtual_redirect (vid,redirect)
+ "INSERT IGNORE INTO virtual_redirect (vid,redirect)
SELECT vid,{?}
- FROM x4dat.virtual
+ FROM virtual
WHERE alias={?}", "$mbox@$dom", $lfull);
$page->trigSuccess("$mbox@$dom ajouté");
}
if (Env::has('del_member')) {
S::assert_xsrf_token();
XDB::query(
- "DELETE FROM x4dat.virtual_redirect
- USING x4dat.virtual_redirect
- INNER JOIN x4dat.virtual USING(vid)
+ "DELETE FROM virtual_redirect
+ USING virtual_redirect
+ INNER JOIN virtual USING(vid)
WHERE redirect={?} AND alias={?}", Env::v('del_member'), $lfull);
pl_redirect('alias/admin/'.$lfull);
}
FROM (SELECT redirect AS redirect,
IF(SUBSTRING_INDEX(redirect, '@', -1) IN ({?}, {?}),
SUBSTRING_INDEX(redirect, '@', 1), NULL) AS login
- FROM x4dat.virtual_redirect AS vr
- INNER JOIN x4dat.virtual AS v USING(vid)
+ FROM #x4dat#.virtual_redirect AS vr
+ INNER JOIN #x4dat#.virtual AS v USING(vid)
WHERE v.alias = {?}
- ORDER BY redirect) AS r
- LEFT JOIN aliases AS a ON (r.login IS NOT NULL AND r.login = a.alias)
- LEFT JOIN auth_user_md5 AS u ON (u.user_id = a.id)
- LEFT JOIN groupex.membres AS m ON (m.asso_id = {?} AND IF(r.login IS NULL, m.email = r.redirect, m.uid = u.user_id))",
+ ORDER BY redirect) AS r
+ LEFT JOIN #x4dat#.aliases AS a ON (r.login IS NOT NULL AND r.login = a.alias)
+ LEFT JOIN #x4dat#.auth_user_md5 AS u ON (u.user_id = a.id)
+ LEFT JOIN #groupex#.membres AS m ON (m.asso_id = {?} AND IF(r.login IS NULL, m.email = r.redirect, m.uid = u.user_id))",
$globals->mail->domain, $globals->mail->domain2,
$lfull, $globals->asso('id'));
$page->assign('mem', $res);
}
$new = $liste.'@'.$globals->asso('mail_domain');
- $res = XDB::query('SELECT COUNT(*) FROM x4dat.virtual WHERE alias={?}', $new);
+ $res = XDB::query('SELECT COUNT(*) FROM virtual WHERE alias = {?}', $new);
$n = $res->fetchOneCell();
if ($n) {
$page->trigError('cet alias est déjà pris');
return;
}
- XDB::query('INSERT INTO x4dat.virtual (alias,type) VALUES({?}, "user")', $new);
+ XDB::query('INSERT INTO virtual (alias,type) VALUES({?}, "user")', $new);
pl_redirect("alias/admin/$new");
}
{* *}
{**************************************************************************}
-
-
<form action="admin/deaths" method="post">
<table class="bicol">
<tr>
</table>
</form>
-<script type='text/javascript' src='javascript/jquery.js'></script>
<script type="text/javascript">//<![CDATA[
{literal}
- $('input.deathDate').change(
- function ()
- {
- $(this).addClass('sendDate');
- });
+ $('input.deathDate').change(function () {
+ $(this).addClass('sendDate');
+ });
- $('#deathDateList').submit(
- function ()
- {
- // Avoid sending useless data to the webserver
- $('input.deathDate').not('.sendDate').attr('disabled', true);
- });
+ $('#deathDateList').submit(function () {
+ // Avoid sending useless data to the webserver
+ $('input.deathDate').not('.sendDate').attr('disabled', true);
+ });
{/literal}
//]]></script>
Sur la page de résultats d'une recherche, tu peux ajouter un contact en cliquant sur {icon name=add}.
</p>
+{if $plset_count || $smarty.request.quick}
<p>
Tu peux télécharger des informations sur tes contacts :
</p>
-{if $plset_count || $smarty.request.quick}
<ul>
<li>Tes contacts en PDF, sans les photos :
[<a href="carnet/contacts/pdf/promo/mescontacts.pdf" class='popup'><strong>tri par promo</strong></a>]
<form method="post" action="{$platal->ns}admin/emails/broken" enctype="multipart/form-data">
{xsrf_token_field}
- <textarea name="list" cols="60" rows="30">{if $valid_emails || $invalid_emails}{foreach from=$valid_emails item=email}{$email}{/foreach}
+ <textarea name="list" cols="60" rows="30">{if $valid_emails || $invalid_emails}{foreach from=$valid_emails item=email}{$email}
+{/foreach}
-{foreach from=$invalid_emails item=email}{$email}{/foreach}{/if}</textarea><br />
+{foreach from=$invalid_emails item=email}{$email}
+{/foreach}{/if}</textarea><br />
<input type="submit" name="sort_broken"
value="Trie et supprime les doublons de la liste d'adresses" /><br />
<input type="submit" name="process_broken"
{
_selectAll('to_contacts');
_selectAll('cc_contacts');
- if(form.sujet.value == "" && !confirm("Le sujet de l'email est vide, veux-tu continuer ?")) {
+ if(form.sujet.value == "" && !confirm("Le sujet de l'email est vide, veux-tu continuer ?")) {
form.sujet.focus();
return false;
}
alert("Il faut définir au moins un destinataire.");
return false;
}
- if (!confirm("Tous les destinataires sont en copie cachée, veux-tu continuer ?")) {
+ if (!confirm("Tous les destinataires sont en copie cachée, veux-tu continuer ?")) {
form.to.focus();
return false;
}
</tr>
<tr class="impair">
<td class="titre">Admin</td>
- <td><a href="survey/admin/edit/req/{$valid->id()}">Voir / Éditer le sondage complet</a></td>
+ <td><a href="survey/admin/edit/req/{$valid->id()}">Voir/Éditer le sondage complet</a></td>
</tr>
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
Création d'une liste de diffusion
</h1>
-{if $created}
-
-<p class='erreur'>Demande de création envoyée !</p>
-
-{else}
+{if !$created}
<p>
N'importe qui peut faire la demande de création d'une liste de diffusion, il suffit pour cela d'être au
<select name="ref" onchange="payment_submit(this.form)">
{select_db_table table="`$prefix`paiements" valeur=$pay->id
where="WHERE FIND_IN_SET(\'old\',t.flags)=0"
- join="LEFT JOIN groupex.asso AS g ON (t.asso_id = g.id)" group="g.nom"}
+ join="LEFT JOIN #groupex#.asso AS g ON (t.asso_id = g.id)" group="g.nom"}
</select>
{/if}
{if $pay->url}
<td>Méthode</td>
<td>
<select name="methode">
- {select_db_table table="paiement.methodes" valeur=$smarty.request.methode}
+ {select_db_table table="#paiement#.methodes" valeur=$smarty.request.methode}
</select>
</td>
</tr>
<h1>Comment faire une recherche ?</h1>
-<h2>Nom, Prénom, Promotion…<h2>
+<h2>Nom, Prénom, Promotion…</h2>
<p>
La ligne de recherche ci-dessus accepte non seulement des mélanges de <strong>noms</strong> et de <strong>prénoms</strong>…
-{**************************************************************************}\r
-{* *}\r
-{* Copyright (C) 2003-2009 Polytechnique.org *}\r
-{* http://opensource.polytechnique.org/ *}\r
-{* *}\r
-{* This program is free software; you can redistribute it and/or modify *}\r
-{* it under the terms of the GNU General Public License as published by *}\r
-{* the Free Software Foundation; either version 2 of the License, or *}\r
-{* (at your option) any later version. *}\r
-{* *}\r
-{* This program is distributed in the hope that it will be useful, *}\r
-{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}\r
-{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}\r
-{* GNU General Public License for more details. *}\r
-{* *}\r
-{* You should have received a copy of the GNU General Public License *}\r
-{* along with this program; if not, write to the Free Software *}\r
-{* Foundation, Inc., *}\r
-{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}\r
-{* *}\r
-{**************************************************************************}\r
-\r
- <link rel="stylesheet" media="screen" type="text/css" href="css/bandeau.css"/>\r
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2009 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 *}
+{* *}
+{**************************************************************************}
+
+<link rel="stylesheet" media="screen" type="text/css" href="css/bandeau.css"/>
+
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="Le Portail des Polytechniciens" />
<meta name="keywords" content="Ecole polytechnique, anciens eleves, portail, alumni, AX, X, routage, reroutage, e-mail, email, mail" />
+
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<link rel="icon" href="/images/favicon.png" type="image/png" />
<link rel="apple-touch-icon" href="images/logo.png" type="image/png" />
+
+ <link rel="stylesheet" type="text/css" href="css/base.css" media="all"/>
+ <link rel="stylesheet" type="text/css" href="css/print.css" media="print"/>
+
<link rel="index" href="" />
<link rel="author" href="changelog" />
<link rel="search" href="search" />
<link rel="bookmark" href="http://www.polytechnique.fr/eleves/" title="| Site d'élèves" />
{include core=plpage.header.tpl}
- <link rel="stylesheet" type="text/css" href="css/base.css" media="all"/>
- <link rel="stylesheet" type="text/css" href="css/print.css" media="print"/>
- <script type="text/javascript">
- var platal_baseurl = "{$globals->baseurl}/";
- </script>
- {javascript name=overlib}
- {javascript name=md5}
- {javascript name=sha1}
- {javascript name=secure_hash}
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
<tr>
<td colspan='2'>
- Remplissez ici une description générale du sondage, puis cliquer sur "Continuer"
- pour passer à l'édition des questions.
+ Remplissez ici une description générale du sondage, puis cliquer sur "Continuer"
+ pour passer à l'édition des questions.
</td>
</tr>
{include file='survey/edit_root.tpl'}
<tr id="ln_promo_exp">
<td></td>
<td class="smaller">
- Exemple : 1954,1986-1989,-1942,2000- restreindra le sondage à toutes les promotions suivantes :<br/>
- 1954, 1986 à 1989, toutes jusqu'à 1942 et toutes à partir 2000 (les bornes sont systématiquement incluses)
+ Exemple : 1954,1986-1989,-1942,2000- restreindra le sondage à toutes les promotions suivantes :<br/>
+ 1954, 1986 à 1989, toutes jusqu'à 1942 et toutes à partir 2000 (les bornes sont systématiquement incluses).<br />
+ Pour sélectionner toutes les promotions, laisser le vide.
</td>
</tr>
</table>
<div class="center">
<input type="submit" name="survey_submit" value="{if $survey_type == 'newsurvey'}Continuer{else}Valider{/if}"/>
- <input type="reset" name="survey_reset" value="Réinitialiser"/>
+ <input type="reset" name="survey_reset" value="Réinitialiser"/>
<input type="submit" name="survey_cancel" value="Annuler"/>
</div>
</form>
{elseif $survey_message neq ""}
{$survey_message}
{else}
-Une erreur inconnue est survenue dans l'édition de ce sondage. N'hésite pas à <a href='send_bug/{ $smarty.server.REQUEST_URI }'>signaler ce bug</a> s'il persiste.
+Une erreur inconnue est survenue dans l'édition de ce sondage. N'hésite pas à <a href='send_bug/{ $smarty.server.REQUEST_URI }'>signaler ce bug</a> s'il persiste.
{/if}
<br/>
<a href="{$survey_link}">Retour</a>
<tr>
<td class="titre">Promotions :</td>
<td>
- {if $survey.promos eq "#"}
- erreur
- {elseif $survey.promos eq ""}
- aucune restriction
- {else}
- {$survey.promos}
+ {if $survey.promos eq "#"}
+ <span class="erreur">erreur</span>
+ {elseif $survey.promos eq ""}
+ aucune restriction
+ {else}
+ {$survey.promos}
{/if}
</td>
</tr>
{/if}
</table>
{if $survey_resultmode}
- <p class="smaller">{$survey.votes} personnes ont répondu à ce sondage.<br />
- Récupérer <a href="survey/result/{$survey.id}/csv">l'ensemble des résultats</a> au format csv
+ <p class="smaller">{$survey.votes} personnes ont répondu à ce sondage.<br />
+ Récupérer <a href="survey/result/{$survey.id}/csv">l'ensemble des résultats</a> au format csv
</p>
{/if}
</td>
{assign var="survey_editallmode" value=true}
{/if}
{if $survey_editmode}
- <td class="smaller" style="width: 30%">
+ <td style="width: 30%">
<a href='survey/edit/question/root'>{icon name=page_edit} Modifier la description</a>
- {if $survey_editallmode}<br /><a href='survey/edit/add/0'>{icon name=add} Ajouter une question au début</a>{/if}
+ {if $survey_editallmode}<br /><a href='survey/edit/add/0'>{icon name=add} Ajouter une question au début</a>{/if}
</td>
{/if}
</tr>
<td class="smaller" style="width: 30%; vertical-align: middle">
<a href='survey/edit/question/{$squestion.id}'>{icon name=page_edit} Modifier cette question</a><br />
<a href='survey/edit/del/{$squestion.id}'>{icon name=delete} Supprimer cette question</a><br />
- <a href='survey/edit/add/{$squestion.id+1}'>{icon name=add} Ajouter une question après</a>
+ <a href='survey/edit/add/{$squestion.id+1}'>{icon name=add} Ajouter une question après</a>
</td>
{/if}
</tr>
</a> |
<a href='survey/edit/cancel'>
{icon name=cross} Annuler
- {if $survey_updatemode}les modifications{else}totalement la création de ce sondage{/if}
+ {if $survey_updatemode}les modifications{else}totalement la création de ce sondage{/if}
</a>
{elseif $survey_adminmode}
{if !$survey.valid}<a href="survey/admin/valid/{$survey.id}">Valider ce sondage</a> | {/if}
{**************************************************************************}
{if $survey_resultmode}
- Quelques réponses données par les personnes sondées :
+ Quelques réponses données par les personnes sondées :
<ul>
{foreach item=sresult from=$squestion.result}
<li>{$sresult.answer}</li>
{**************************************************************************}
{if $survey_resultmode}
- Quelques réponses données par les personnes sondées :
+ Quelques réponses données par les personnes sondées :
<ul>
{foreach item=sresult from=$squestion.result}
<li>{$sresult.answer}</li>
{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
{* *}
{**************************************************************************}
-<h1>Sondages : succès</h1>
+<h1>Sondages : succès</h1>
{if $survey_message neq ""}
{$survey_message}
{else}
- Opération réussie
+ Opération réussie
{/if}
<br/>
<a href="{$survey_link}">Retour</a>
<link rel="bookmark" href="http://www.polytechnique.fr/eleves/" title="| Site d'élèves" />
{include core=plpage.header.tpl}
- <script type="text/javascript">
- var platal_baseurl = "{$globals->baseurl}/"
- if (window.top != window)
- document.write('<link rel="stylesheet" type="text/css" href="css/onlycontent.css" media="all"/>');
- </script>
- {javascript name=overlib}
{include file=skin/common.bandeau.head.tpl}
</head>
<body>
</tr>
<tr>
<td class="titre">Tarif :<br /><small>(par participant)</small></td>
- <td><input type="text" name="montant{$i}" value="{if $moment.montant}{$moment.montant|replace:".":","}{else}0,00{/if}" size="7" maxlength="7" /> € <small>(0 si gratuit)</small></td>
+ <td><input type="text" name="montant{$i}" value="{if $moment.montant}{$moment.montant|replace:".":","}{else}0,00{/if}" size="7" maxlength="7" /> € <small>(0 si gratuit)</small></td>
</tr>
{/foreach}
</table>
--- /dev/null
+#!/bin/bash
+
+. ../inc/pervasive.sh
+
+mailman_stop
+mailman_templates
+mailman_start
+
+###########################################################
+for sql in *.sql
+do
+ echo -n $sql
+ $MYSQL $DATABASE < $sql &>/dev/null || echo -n " ERROR"
+ echo .
+done
--- /dev/null
+#!/bin/bash
+
+. ../inc/pervasive.sh
+
+mailman_stop
+mailman_templates
+mailman_start
+
+###########################################################
+for sql in *.sql
+do
+ echo -n $sql
+ $MYSQL $DATABASE < $sql &>/dev/null || echo -n " ERROR"
+ echo .
+done
exit 1
fi
+if [[ -n "${DBPREFIX}" ]]; then
+ echo "Using non-default database ${DBPREFIX}x4dat."
+fi
+declare -r DATABASE="${DBPREFIX}x4dat"
+
function mailman_stop() {
echo -n "stops mailman"
/etc/init.d/mailman stop &>/dev/null
/etc/init.d/mailman start &>/dev/null
echo .
}
-