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.net/images/dflt_carre.jpg');
+ readfile(dirname(__FILE__).'/../htdocs/images/dflt_carre.jpg');
}
exit;
if (Post::has('submit')) {
if (S::has_perms()) {
- if (Post::get('mail_domain') && (strstr(Post::get('mail_domain'), '.') === false)) {
- $page->trig_run("le domaine doit être un FQDN (aucune modif effectuée) !!!");
+ if (Post::v('mail_domain') && (strstr(Post::v('mail_domain'), '.') === false)) {
+ $page->trig("le domaine doit être un FQDN (aucune modif effectuée) !!!");
+ return;
}
XDB::execute(
"UPDATE groupex.asso
forum={?}, mail_domain={?}, ax={?}, pub={?},
sub_url={?}, inscriptible={?}
WHERE id={?}",
- Post::get('nom'), Post::get('diminutif'),
- Post::get('cat'), Post::getInt('dom'),
- Post::get('descr'), Post::get('site'),
- Post::get('mail'), Post::get('resp'),
- Post::get('forum'), Post::get('mail_domain'),
+ Post::v('nom'), Post::v('diminutif'),
+ Post::v('cat'), Post::i('dom'),
+ Post::v('descr'), Post::v('site'),
+ Post::v('mail'), Post::v('resp'),
+ Post::v('forum'), Post::v('mail_domain'),
Post::has('ax'), Post::has('pub')?'private':'public',
- Post::get('sub_url'), Post::get('inscriptible'),
+ Post::v('sub_url'), Post::v('inscriptible'),
$globals->asso('id'));
- if (Post::get('mail_domain')) {
+ if (Post::v('mail_domain')) {
XDB::execute('INSERT INTO virtual_domains (domain) VALUES({?})',
- Post::get('mail_domain'));
+ Post::v('mail_domain'));
}
} else {
XDB::execute(
SET descr={?}, site={?}, mail={?}, resp={?},
forum={?}, ax={?}, pub= {?}, sub_url={?}
WHERE id={?}",
- Post::get('descr'), Post::get('site'),
- Post::get('mail'), Post::get('resp'),
- Post::get('forum'), Post::has('ax'),
+ Post::v('descr'), Post::v('site'),
+ Post::v('mail'), Post::v('resp'),
+ Post::v('forum'), Post::has('ax'),
Post::has('pub')?'private':'public',
- Post::get('sub_url'), $globals->asso('id'));
+ Post::v('sub_url'), $globals->asso('id'));
}
if ($_FILES['logo']['name']) {
$globals->asso('id'));
}
- pl_redirect('../'.Post::get('diminutif', $globals->asso('diminutif')).'/edit');
+ pl_redirect('../'.Post::v('diminutif', $globals->asso('diminutif')).'/edit');
}
if (S::has_perms()) {
$page->assign('listes', $client->get_lists());
if (Post::has('send')) {
- $from = Post::get('from');
- $sujet = Post::get('sujet');
- $body = Post::get('body');
+ $from = Post::v('from');
+ $sujet = Post::v('sujet');
+ $body = Post::v('body');
- $mls = array_keys(Env::getMixed('ml', array()));
+ $mls = array_keys(Env::v('ml', array()));
require_once 'xnet/mail.inc.php';
$tos = get_all_redirects(Post::has('membres'), $mls, $client);
- send_xnet_mails($from, $sujet, $body, $tos, Post::get('replyto'));
+ send_xnet_mails($from, $sujet, $body, $tos, Post::v('replyto'));
$page->kill("Mail envoyé !");
$page->assign('sent', true);
}
$page->assign('admin', may_update());
- switch (Env::get('order')) {
+ switch (Env::v('order')) {
case 'promo' : $group = 'promo'; $tri = 'promo_o DESC, nom, prenom'; break;
case 'promo_inv': $group = 'promo'; $tri = 'promo_o, nom, prenom'; break;
case 'alpha_inv': $group = 'initiale'; $tri = 'nom DESC, prenom DESC, promo'; break;
while (list($char, $nb) = $res->next()) {
$alphabet[] = $char;
$nb_tot += $nb;
- if (Env::has($group) && $char == strtoupper(Env::get($group))) {
+ if (Env::has($group) && $char == strtoupper(Env::v($group))) {
$tot = $nb;
}
}
$page->assign('group', $group);
- $page->assign('request_group', Env::get($group));
+ $page->assign('request_group', Env::v($group));
$page->assign('alphabet', $alphabet);
$page->assign('nb_tot', $nb_tot);
- $ofs = Env::getInt('offset');
- $tot = Env::get($group) ? $tot : $nb_tot;
+ $ofs = Env::i('offset');
+ $tot = Env::v($group) ? $tot : $nb_tot;
$nbp = intval(($tot-1)/NB_PER_PAGE);
$links = array();
if ($ofs) {
if (Env::has('initiale')) {
$ini = 'AND IF(m.origine="X",
IF(u.nom_usage<>"", u.nom_usage, u.nom),
- m.nom) LIKE "'.addslashes(Env::get('initiale')).'%"';
+ m.nom) LIKE "'.addslashes(Env::v('initiale')).'%"';
} elseif (Env::has('promo')) {
$ini = 'AND IF(m.origine="X", u.promo, "extérieur") = "'
- .addslashes(Env::get('promo')).'"';
+ .addslashes(Env::v('promo')).'"';
}
$ann = XDB::iterator(
IF(m.origine='X',u.promo,'extérieur') AS promo,
IF(m.origine='X',u.promo,'') AS promo_o,
IF(m.origine='X',a.alias,m.email) AS email,
- IF(m.origine='X',FIND_IN_SET('femme', u.flags),0) AS femme,
+ IF(m.origine='X',FIND_IN_SET('femme', u.flags), m.sexe) AS femme,
m.perms='admin' AS admin,
m.origine='X' AS x,
m.uid
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' )
WHERE m.asso_id = {?} $ini
+ AND (m.origine = 'ext' OR u.perms != 'pending')
ORDER BY $tri
LIMIT {?},{?}", $globals->asso('id'), $ofs*NB_PER_PAGE, NB_PER_PAGE);
$u, $globals->asso('id'));
$n = $res->fetchOneCell();
if ($n) {
- $page->trig_run("$prenom $nom est déjà membre du groupe !");
+ $page->kill("$prenom $nom est déjà membre du groupe !");
+ return;
}
elseif (Env::has('accept'))
{
XDB::execute("INSERT INTO groupex.membres
- VALUES ({?}, {?}, 'membre', 'X', NULL, NULL, NULL, NULL)",
+ VALUES ({?}, {?}, 'membre', 'X', NULL, NULL, NULL, NULL, NULL)",
$globals->asso('id'), $uid);
require_once 'diogenes/diogenes.hermes.inc.php';
$mailer = new HermesMailer();
$mailer->setFrom('"'.S::v('prenom').' '.S::v('nom')
.'" <'.S::v('forlife').'@polytechnique.org>');
$mailer->setSubject('['.$globals->asso('nom').'] Demande d\'inscription annulée');
- $mailer->setTxtBody(Env::get('motif'));
+ $mailer->setTxtBody(Env::v('motif'));
$mailer->send();
$page->kill("la demande $prenom $nom a bien été refusée");
} else {
$mailer->setFrom('"'.S::v('prenom').' '.S::v('nom')
.'" <'.S::v('forlife').'@polytechnique.org>');
$mailer->setSubject('['.$globals->asso('nom').'] Demande d\'inscription');
- $mailer->setTxtBody(Post::get('message').$append);
+ $mailer->setTxtBody(Post::v('message').$append);
$mailer->send();
}
}
$tit = $res->fetchAllAssoc();
$page->assign('titres', $tit);
- $order = Env::get('order', 'timestamp');
+ $order = Env::v('order', 'timestamp');
$orders = array('timestamp', 'nom', 'promo', 'montant');
if (!in_array($order, $orders)) {
$order = 'timestamp';
}
- $inv_order = Env::get('order_inv', 0);
+ $inv_order = Env::v('order_inv', 0);
$page->assign('order', $order);
$page->assign('order_inv', !$inv_order);
FROM auth_user_md5 AS u
INNER JOIN aliases AS a ON (u.user_id = a.id)
WHERE a.alias={?}', $globals->asso('id'), $forlife);
- global $platal;
pl_redirect("member/$email");
} else {
$page->trig($email." n'est pas un alias polytechnique.org valide");
XDB::execute('INSERT INTO groupex.membres (uid,asso_id,origine,email)
VALUES({?},{?},"ext",{?})', $uid,
$globals->asso('id'), $email);
- global $platal;
pl_redirect("member/$email");
} else {
$page->trig("« <strong>$email</strong> » n'est pas une adresse mail valide");
if (Post::has('change')) {
if ($user['origine'] != 'X') {
XDB::query('UPDATE groupex.membres
- SET prenom={?}, nom={?}, email={?}
- WHERE uid={?} AND asso_id={?}',
- Post::get('prenom'), Post::get('nom'),
- Post::get('email'), $user['uid'],
- $globals->asso('id'));
- $user['nom'] = Post::get('nom');
- $user['prenom'] = Post::get('prenom');
- $user['email'] = Post::get('email');
- $user['email2'] = Post::get('email');
+ SET prenom={?}, nom={?}, email={?}, sexe={?}
+ WHERE uid={?} AND asso_id={?}',
+ Post::v('prenom'), Post::v('nom'),
+ Post::v('email'), Post::v('sexe'),
+ $user['uid'], $globals->asso('id'));
+ $user['nom'] = Post::v('nom');
+ $user['prenom'] = Post::v('prenom');
+ $user['sexe'] = Post::v('sexe');
+ $user['email'] = Post::v('email');
+ $user['email2'] = Post::v('email');
}
- $perms = Post::getInt('is_admin');
+ $perms = Post::i('is_admin');
if ($user['perms'] != $perms) {
XDB::query('UPDATE groupex.membres SET perms={?}
- WHERE uid={?} AND asso_id={?}',
- $perms ? 'admin' : 'membre',
- $user['uid'], $globals->asso('id'));
+ WHERE uid={?} AND asso_id={?}',
+ $perms ? 'admin' : 'membre',
+ $user['uid'], $globals->asso('id'));
$user['perms'] = $perms;
$page->trig('permissions modifiées');
}
- foreach (Env::getMixed('ml1', array()) as $ml => $state) {
+ foreach (Env::v('ml1', array()) as $ml => $state) {
$ask = empty($_REQUEST['ml2'][$ml]) ? 0 : 2;
if ($ask == $state) continue;
if ($state == '1') {
}
}
- foreach (Env::getMixed('ml3', array()) as $ml => $state) {
+ foreach (Env::v('ml3', array()) as $ml => $state) {
$ask = !empty($_REQUEST['ml4'][$ml]);
if($state == $ask) continue;
if($ask) {