X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fxnetgrp.php;h=56fd3b7caa522bb8998654bdbbc77c323f92ef53;hb=905cda00459649fa751c2ea292e079f5f05cae81;hp=04242313009712571de6ab217698e5f77a6a684b;hpb=9f52839d4a55c6b59ab80af35026a064e007ac72;p=platal.git diff --git a/modules/xnetgrp.php b/modules/xnetgrp.php index 0424231..56fd3b7 100644 --- a/modules/xnetgrp.php +++ b/modules/xnetgrp.php @@ -253,7 +253,6 @@ class XnetGrpModule extends PLModule $globals->asso('mail_domain')); $page->assign('listes', $mmlist->get_lists()); $page->assign('user', S::user()); - $page->addJsLink('ajax.js'); if (Post::has('send')) { S::assert_xsrf_token(); @@ -628,7 +627,6 @@ class XnetGrpModule extends PLModule global $globals; $page->changeTpl('xnetgrp/membres-add.tpl'); - $page->addJsLink('ajax.js'); if (is_null($email)) { return; @@ -700,8 +698,8 @@ class XnetGrpModule extends PLModule } if ($user) { - XDB::execute('REPLACE INTO group_members (uid, asso_id) - VALUES ({?}, {?})', + XDB::execute('INSERT IGNORE INTO group_members (uid, asso_id) + VALUES ({?}, {?})', $user->id(), $globals->asso('id')); $this->removeSubscriptionRequest($user->id()); pl_redirect('member/' . $user->login()); @@ -1148,7 +1146,6 @@ class XnetGrpModule extends PLModule $aid, $imgtype, $imgx, $imgy, $upload->getContents()); } if ($art['xorg']) { - require_once('validations.inc.php'); $article = new EvtReq("[{$globals->asso('nom')}] " . $art['titre'], $fulltext, $art['promo_min'], $art['promo_max'], $art['expiration'], "", S::user(), $upload); @@ -1158,7 +1155,6 @@ class XnetGrpModule extends PLModule $upload->rm(); } if ($art['nl']) { - require_once('validations.inc.php'); $article = new NLReq(S::user(), $globals->asso('nom') . " : " .$art['titre'], $art['texte'], $art['contact_html']); $article->submit(); @@ -1174,9 +1170,10 @@ class XnetGrpModule extends PLModule $art['id'], $globals->asso('id')); if ($art['photo'] && $upload->exists()) { list($imgx, $imgy, $imgtype) = $upload->imageInfo(); - XDB::execute("REPLACE INTO group_announces_photo - SET eid = {?}, attachmime = {?}, x = {?}, y = {?}, attach = {?}", - $aid, $imgtype, $imgx, $imgy, $upload->getContents()); + XDB::execute('INSERT INTO group_announces_photo (eid, attachmime, attach, x, y) + VALUES ({?}, {?}, {?}, {?}, {?}) + ON DUPLICATE KEY UPDATE attachmime = VALUES(attachmime), attach = VALUES(attach), x = VALUES(x), y = VALUES(y)', + $aid, $imgtype, $upload->getContents(), $imgx, $imgy); $upload->rm(); } }