X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fxnetgrp.php;h=56fd3b7caa522bb8998654bdbbc77c323f92ef53;hb=905cda00459649fa751c2ea292e079f5f05cae81;hp=b1f851bc6279cd4b25e131f6bb23d028a64cdfc8;hpb=243cdb7b0cefff168039e1fc9c112cebdcdd53e7;p=platal.git diff --git a/modules/xnetgrp.php b/modules/xnetgrp.php index b1f851b..56fd3b7 100644 --- a/modules/xnetgrp.php +++ b/modules/xnetgrp.php @@ -698,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()); @@ -1170,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(); } }