correction bug invitation quand meme user
[mw_sourceml] / app / data / modules / sql / sml_data_source_groupes.php
index 5008bb8..45d07b1 100644 (file)
       return $sources;
     }
 
+    function source_has_groupe($id_source, $id_groupe){
+      $sgbd = $this->sgbd();
+      $HAS_THIS_GROUP = 0;
+      try{
+        $sql =
+         "SELECT count(*) as n FROM #--sml_sources_authors"
+        ." WHERE id_source=".$this->eq($id_source)
+        ." AND id_author=".$this->eq($id_groupe);
+        $rst = $sgbd->query($sql);
+        if($v_rst = $sgbd->fetch_assoc($rst)) $HAS_THIS_GROUP = $v_rst["n"];
+        $sgbd->free_result($rst);
+      }
+      catch(Exception $e) { $HAS_THIS_GROUP = false; }
+      return $HAS_THIS_GROUP;
+    }
+
     function add_source_groupe($id_source, $id_groupe, $id_groupe_status)
     { $sgbd = $this->sgbd();
       try{