X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fxnetgrp.php;h=a558cbf7d4b9621950dfa2f508e90725eb6126b6;hb=cafb410fea6f257f45da08631c6cdb5c35f86b17;hp=9187c47d7e99d0bddb0a4bcf90ee0e46c0ece224;hpb=c76545c351fae4e2298624ff9ee5bf854dc5a5b6;p=platal.git diff --git a/modules/xnetgrp.php b/modules/xnetgrp.php index 9187c47..a558cbf 100644 --- a/modules/xnetgrp.php +++ b/modules/xnetgrp.php @@ -193,7 +193,7 @@ class XnetGrpModule extends PLModule flags={?} WHERE id={?}", Post::v('nom'), Post::v('diminutif'), - Post::v('cat'), Post::i('dom'), + Post::v('cat'), (Post::i('dom') == 0) ? null : Post::i('dom'), Post::v('descr'), $site, Post::v('mail'), Post::v('resp'), Post::v('forum'), Post::v('mail_domain'), @@ -249,8 +249,7 @@ class XnetGrpModule extends PLModule global $globals; $page->changeTpl('xnetgrp/mail.tpl'); - $mmlist = new MMList(S::v('uid'), S::v('password'), - $globals->asso('mail_domain')); + $mmlist = new MMList(S::user(), $globals->asso('mail_domain')); $page->assign('listes', $mmlist->get_lists()); $page->assign('user', S::user()); $page->addJsLink('ajax.js'); @@ -700,8 +699,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()); @@ -1172,9 +1171,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(); } }