Merge branch 'platal-0.9.17'
[platal.git] / modules / xnetevents / xnetevents.inc.php
index d179a70..9c2f4ff 100644 (file)
@@ -51,9 +51,12 @@ function get_event_detail($eid, $item_id = false, $asso_id = null)
 
     $evt = $res->fetchOneAssoc();
 
-    if (!$evt || ($GLOBALS['IS_XNET_SITE'] && $evt['accept_nonmembre'] == 0 && !is_member() && !may_update())) {
+    if (!$evt) {
         return null;
     }
+    if ($GLOBALS['IS_XNET_SITE'] && $evt['accept_nonmembre'] == 0 && !is_member() && !may_update()) {
+        return false;
+    }
 
     // smart calculation of the total number
     if (!$item_id) {
@@ -216,7 +219,7 @@ function subscribe_lists_event($participate, $uid, $evt)
         $res = XDB::query("SELECT email
                              FROM groupex.membres
                             WHERE uid = {?} AND asso_id = {?}",
-                            S::v('uid'), $globals->asso('id'));
+                          $uid, $globals->asso('id'));
         $email = $res->fetchOneCell();
     }
 
@@ -302,7 +305,7 @@ function event_change_shortname(&$page, $eid, $old, $new)
 
         $lastid = XDB::insertId();
         XDB::execute(
-          "INSERT INTO virtual_redirect (
+          "INSERT IGNORE INTO virtual_redirect (
                 SELECT {?} AS vid, IF(u.nom IS NULL, m.email, CONCAT(a.alias, {?})) AS redirect
                   FROM groupex.evenements_participants AS ep
              LEFT JOIN groupex.membres AS m ON (ep.uid = m.uid)