projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Clear mentor entry of the user when is expertise is empty.
[platal.git]
/
modules
/
xnetgrp.php
diff --git
a/modules/xnetgrp.php
b/modules/xnetgrp.php
index
f5fb9bd
..
b3de66d
100644
(file)
--- a/
modules/xnetgrp.php
+++ b/
modules/xnetgrp.php
@@
-209,7
+209,7
@@
class XnetGrpModule extends PLModule
global $globals;
$site = $globals->asso('site');
if (!$site) {
global $globals;
$site = $globals->asso('site');
if (!$site) {
- $page->trig('Le groupe n\'a pas de site web');
+ $page->trig('Le groupe n\'a pas de site web
.
');
return $this->handler_index($page);
}
http_redirect($site);
return $this->handler_index($page);
}
http_redirect($site);
@@
-222,6
+222,8
@@
class XnetGrpModule extends PLModule
$page->changeTpl('xnetgrp/edit.tpl');
if (Post::has('submit')) {
$page->changeTpl('xnetgrp/edit.tpl');
if (Post::has('submit')) {
+ S::assert_xsrf_token();
+
if (S::has_perms()) {
if (Post::v('mail_domain') && (strstr(Post::v('mail_domain'), '.') === false)) {
$page->trig("le domaine doit être un FQDN (aucune modif effectuée) !!!");
if (S::has_perms()) {
if (Post::v('mail_domain') && (strstr(Post::v('mail_domain'), '.') === false)) {
$page->trig("le domaine doit être un FQDN (aucune modif effectuée) !!!");
@@
-432,7
+434,7
@@
class XnetGrpModule extends PLModule
m.perms='admin' AS admin,
m.origine='X' AS x,
u.perms!='pending' AS inscrit,
m.perms='admin' AS admin,
m.origine='X' AS x,
u.perms!='pending' AS inscrit,
- m.uid, IF(e.email IS NULL
,NULL,
1) AS actif
+ 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' )
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' )
@@
-510,10
+512,11
@@
class XnetGrpModule extends PLModule
. "j'ai le plaisir de t'annoncer que ton inscription a été validée !\n"
. "\n"
. "Bien cordialement,\n"
. "j'ai le plaisir de t'annoncer que ton inscription a été validée !\n"
. "\n"
. "Bien cordialement,\n"
+ . "-- \n"
. "{$_SESSION["prenom"]} {$_SESSION["nom"]}.";
$mailer->setTxtBody($message);
$mailer->send();
. "{$_SESSION["prenom"]} {$_SESSION["nom"]}.";
$mailer->setTxtBody($message);
$mailer->send();
-
$page->kill("$prenom $nom a bien été inscrit" . ($sexe ? 'e' : '') . ".
");
+
pl_redirect("member/$u
");
}
elseif (Env::has('refuse'))
{
}
elseif (Env::has('refuse'))
{
@@
-524,7
+527,7
@@
class XnetGrpModule extends PLModule
$mailer->setSubject('['.$globals->asso('nom').'] Demande d\'inscription annulée');
$mailer->setTxtBody(Env::v('motif'));
$mailer->send();
$mailer->setSubject('['.$globals->asso('nom').'] Demande d\'inscription annulée');
$mailer->setTxtBody(Env::v('motif'));
$mailer->send();
- $page->kill("
la demande $prenom $nom a bien été refusée
");
+ $page->kill("
La demande de $prenom $nom a bien été refusée.
");
} else {
$page->assign('show_form', true);
$page->assign('prenom', $prenom);
} else {
$page->assign('show_form', true);
$page->assign('prenom', $prenom);
@@
-538,7
+541,7
@@
class XnetGrpModule extends PLModule
}
if (is_member()) {
}
if (is_member()) {
- $page->kill("
t
u es déjà membre !");
+ $page->kill("
T
u es déjà membre !");
return;
}
return;
}
@@
-722,7
+725,7
@@
class XnetGrpModule extends PLModule
pl_redirect("member/$email");
}
} else {
pl_redirect("member/$email");
}
} else {
- $page->trig("« <strong>$email</strong> » n'est pas une adresse mail valide");
+ $page->trig("« <strong>$email</strong> » n'est pas une adresse mail valide
.
");
}
}
}
}
}
}
@@
-857,10
+860,10
@@
class XnetGrpModule extends PLModule
if ($res->numRows() == 0) {
$x = get_not_registered_user($login);
if (!$x) {
if ($res->numRows() == 0) {
$x = get_not_registered_user($login);
if (!$x) {
- $page->trig("Le login $login ne correspond à aucun X");
+ $page->trig("Le login $login ne correspond à aucun X
.
");
return false;
} else if (count($x) > 1) {
return false;
} else if (count($x) > 1) {
- $page->trig("Le login $login correspond a plusieurs camarades");
+ $page->trig("Le login $login correspond a plusieurs camarades
.
");
return false;
}
$uid = $x[0]['user_id'];
return false;
}
$uid = $x[0]['user_id'];
@@
-959,7
+962,7
@@
class XnetGrpModule extends PLModule
$perms ? 'admin' : 'membre',
$user['uid'], $globals->asso('id'));
$user['perms'] = $perms;
$perms ? 'admin' : 'membre',
$user['uid'], $globals->asso('id'));
$user['perms'] = $perms;
- $page->trig('
permissions modifiées
');
+ $page->trig('
Permissions modifiées !
');
}
// Update ML subscriptions
}
// Update ML subscriptions
@@
-968,7
+971,7
@@
class XnetGrpModule extends PLModule
if ($ask == $state) {
if ($state && $email_changed) {
$mmlist->replace_email($ml, $from_email, $user['email2']);
if ($ask == $state) {
if ($state && $email_changed) {
$mmlist->replace_email($ml, $from_email, $user['email2']);
- $page->trig("L'abonnement de {$user['prenom']} {$user['nom']} à $ml@ a été mis à jour");
+ $page->trig("L'abonnement de {$user['prenom']} {$user['nom']} à $ml@ a été mis à jour
.
");
}
continue;
}
}
continue;
}
@@
-978,14
+981,14
@@
class XnetGrpModule extends PLModule
."cours sur <strong>$ml@</strong> !!!");
} elseif ($ask) {
$mmlist->mass_subscribe($ml, Array($user['email2']));
."cours sur <strong>$ml@</strong> !!!");
} elseif ($ask) {
$mmlist->mass_subscribe($ml, Array($user['email2']));
- $page->trig("{$user['prenom']} {$user['nom']} a été abonné à $ml@");
+ $page->trig("{$user['prenom']} {$user['nom']} a été abonné à $ml@
.
");
} else {
if ($email_changed) {
$mmlist->mass_unsubscribe($ml, Array($from_email));
} else {
$mmlist->mass_unsubscribe($ml, Array($user['email2']));
}
} else {
if ($email_changed) {
$mmlist->mass_unsubscribe($ml, Array($from_email));
} else {
$mmlist->mass_unsubscribe($ml, Array($user['email2']));
}
- $page->trig("{$user['prenom']} {$user['nom']} a été désabonné de $ml@");
+ $page->trig("{$user['prenom']} {$user['nom']} a été désabonné de $ml@
.
");
}
}
}
}
@@
-997,14
+1000,14
@@
class XnetGrpModule extends PLModule
XDB::query("INSERT INTO virtual_redirect (vid,redirect)
SELECT vid,{?} FROM virtual WHERE alias={?}",
$user['email'], $ml);
XDB::query("INSERT INTO virtual_redirect (vid,redirect)
SELECT vid,{?} FROM virtual WHERE alias={?}",
$user['email'], $ml);
- $page->trig("{$user['prenom']} {$user['nom']} a été abonné à $ml");
+ $page->trig("{$user['prenom']} {$user['nom']} a été abonné à $ml
.
");
} else {
XDB::query("DELETE FROM virtual_redirect
USING virtual_redirect
INNER JOIN virtual USING(vid)
WHERE redirect={?} AND alias={?}",
$user['email'], $ml);
} else {
XDB::query("DELETE FROM virtual_redirect
USING virtual_redirect
INNER JOIN virtual USING(vid)
WHERE redirect={?} AND alias={?}",
$user['email'], $ml);
- $page->trig("{$user['prenom']} {$user['nom']} a été désabonné de $ml");
+ $page->trig("{$user['prenom']} {$user['nom']} a été désabonné de $ml
.
");
}
}
}
}
}
}
@@
-1030,7
+1033,8
@@
class XnetGrpModule extends PLModule
if ($uid) {
$rss = XDB::iterator("SELECT a.id, a.titre, a.texte, a.contacts, a.create_date,
if ($uid) {
$rss = XDB::iterator("SELECT a.id, a.titre, a.texte, a.contacts, a.create_date,
- IF(u2.nom_usage != '', u2.nom_usage, u2.nom) AS nom, u2.prenom, u2.promo
+ IF(u2.nom_usage != '', u2.nom_usage, u2.nom) AS nom, u2.prenom, u2.promo,
+ FIND_IN_SET('photo', a.flags) AS photo
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))
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))
@@
-1130,12
+1134,12
@@
class XnetGrpModule extends PLModule
($art['promo_min'] != 0 && ($art['promo_min'] <= 1900 || $art['promo_min'] >= 2020)) ||
($art['promo_max'] != 0 && ($art['promo_max'] <= 1900 || $art['promo_max'] >= 2020))))
{
($art['promo_min'] != 0 && ($art['promo_min'] <= 1900 || $art['promo_min'] >= 2020)) ||
($art['promo_max'] != 0 && ($art['promo_max'] <= 1900 || $art['promo_max'] >= 2020))))
{
- $page->trig("L'intervalle de promotions est invalide");
+ $page->trig("L'intervalle de promotions est invalide
.
");
Post::kill('valid');
}
if (!trim($art['titre']) || !trim($art['texte'])) {
Post::kill('valid');
}
if (!trim($art['titre']) || !trim($art['texte'])) {
- $page->trig("L'article doit avoir un titre et un contenu");
+ $page->trig("L'article doit avoir un titre et un contenu
.
");
Post::kill('valid');
}
Post::kill('valid');
}
@@
-1194,7
+1198,7
@@
class XnetGrpModule extends PLModule
$art['promo_min'], $art['promo_max'], $art['peremption'], "", S::v('uid'),
$upload);
$article->submit();
$art['promo_min'], $art['promo_max'], $art['peremption'], "", S::v('uid'),
$upload);
$article->submit();
- $page->trig("L'affichage sur la page d'accueil de Polytechnique.org est en attente de validation");
+ $page->trig("L'affichage sur la page d'accueil de Polytechnique.org est en attente de validation
.
");
} else if ($upload && $upload->exists()) {
$upload->rm();
}
} else if ($upload && $upload->exists()) {
$upload->rm();
}
@@
-1203,7
+1207,7
@@
class XnetGrpModule extends PLModule
$article = new NLReq(S::v('uid'), $globals->asso('nom') . " : " .$art['titre'],
$art['texte'], $art['contact_html']);
$article->submit();
$article = new NLReq(S::v('uid'), $globals->asso('nom') . " : " .$art['titre'],
$art['texte'], $art['contact_html']);
$article->submit();
- $page->trig("La parution dans la Lettre Mensuelle est en attente de validation");
+ $page->trig("La parution dans la Lettre Mensuelle est en attente de validation
.
");
}
} else {
XDB::query("UPDATE groupex.announces
}
} else {
XDB::query("UPDATE groupex.announces
@@
-1239,7
+1243,7
@@
class XnetGrpModule extends PLModule
$art = $res->fetchOneAssoc();
$art['contact_html'] = $art['contacts'];
} else {
$art = $res->fetchOneAssoc();
$art['contact_html'] = $art['contacts'];
} else {
- $page->kill("Aucun article correspond à l'identifiant indiqué");
+ $page->kill("Aucun article correspond à l'identifiant indiqué
.
");
}
}
}
}