Changeset 95149 in spip-zone


Ignore:
Timestamp:
Feb 16, 2016, 5:35:50 PM (4 years ago)
Author:
real3t@…
Message:

Report de [94722] (chez moi ça marche™).

En cas de problème, je pourrais faire un revert.

Location:
_plugins_/acces_restreint/branches/v3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/acces_restreint/branches/v3.3/plugin.xml

    r84104 r95149  
    66        <auteur>[cedric.morin@yterium.com->http://www.yterium.net]</auteur>
    77        <licence>GPL &#169; 2007-2008</licence>
    8         <version>3.3.5</version>
     8        <version>3.3.6</version>
    99        <version_base>0.3.0.2</version_base>
    1010        <etat>stable</etat>
  • _plugins_/acces_restreint/branches/v3.3/public/acces_restreint.php

    r72596 r95149  
    101101function accesrestreint_articles_accessibles_where($primary, $_publique=''){
    102102        # hack : on utilise zzz pour eviter que l'optimiseur ne confonde avec un morceau de la requete principale
    103         return "array('NOT IN','$primary','('.sql_get_select('zzza.id_article','spip_articles as zzza',".accesrestreint_rubriques_accessibles_where('zzza.id_rubrique','',$_publique).",'','','','',\$connect).')')";
     103        return "array('NOT IN','$primary','(SELECT * FROM('.sql_get_select('zzza.id_article','spip_articles as zzza',".accesrestreint_rubriques_accessibles_where('zzza.id_rubrique','',$_publique).",'','','','',\$connect).') AS subquery)')";
    104104        #return array('SUBSELECT','id_article','spip_articles',array(".accesrestreint_rubriques_accessibles_where('id_rubrique').")))";
    105105}
     
    113113function accesrestreint_breves_accessibles_where($primary, $_publique=''){
    114114        # hack : on utilise zzz pour eviter que l'optimiseur ne confonde avec un morceau de la requete principale
    115         return "array('NOT IN','$primary','('.sql_get_select('zzzb.id_breve','spip_breves as zzzb',".accesrestreint_rubriques_accessibles_where('zzzb.id_rubrique','',$_publique).",'','','','',\$connect).')')";
     115        return "array('NOT IN','$primary','(SELECT * FROM('.sql_get_select('zzzb.id_breve','spip_breves as zzzb',".accesrestreint_rubriques_accessibles_where('zzzb.id_rubrique','',$_publique).",'','','','',\$connect).') AS subquery)')";
    116116        #return "array('IN','$primary',array('SUBSELECT','id_breve','spip_breves',array(".accesrestreint_rubriques_accessibles_where('id_rubrique').")))";
    117117}
     
    125125function accesrestreint_syndic_articles_accessibles_where($primary, $_publique=''){
    126126        # hack : on utilise zzz pour eviter que l'optimiseur ne confonde avec un morceau de la requete principale
    127         return "array('NOT IN','$primary','('.sql_get_select('zzzs.id_syndic','spip_syndic as zzzs',".accesrestreint_rubriques_accessibles_where('zzzs.id_rubrique','',$_publique).",'','','','',\$connect).')')";
     127        return "array('NOT IN','$primary','(SELECT * FROM('.sql_get_select('zzzs.id_syndic','spip_syndic as zzzs',".accesrestreint_rubriques_accessibles_where('zzzs.id_rubrique','',$_publique).",'','','','',\$connect).') AS subquery)')";
    128128        #return "array('IN','$primary',array('SUBSELECT','id_syndic','spip_syndic',array(".accesrestreint_rubriques_accessibles_where('id_rubrique').")))";
    129129}
     
    142142        $where = "array('OR',$where,".accesrestreint_articles_accessibles_where('zzzf.id_article',$_publique).")";
    143143        $where = "array('OR',$where,".accesrestreint_breves_accessibles_where('zzzf.id_breve',$_publique).")";
    144         return "array('IN','$primary','('.sql_get_select('zzzf.id_forum','spip_forum as zzzf',array($where),'','','','',\$connect).')')";
     144        return "array('IN','$primary','(SELECT * FROM('.sql_get_select('zzzf.id_forum','spip_forum as zzzf',array($where),'','','','',\$connect).') AS subquery)')";
    145145}
    146146
     
    162162       
    163163        $where = "array('OR',
    164         array('IN','$primary','('.sql_get_select('zzzd.id_document','spip_documents_liens as zzzd',array($where),'','','','',\$connect).')'),
    165         array('NOT IN','$primary','('.sql_get_select('zzzd.id_document','spip_documents_liens as zzzd','','','','','',\$connect).')')
     164        array('IN','$primary','(SELECT * FROM('.sql_get_select('zzzd.id_document','spip_documents_liens as zzzd',array($where),'','','','',\$connect).') AS subquery)'),
     165        array('NOT IN','$primary','(SELECT * FROM('.sql_get_select('zzzd.id_document','spip_documents_liens as zzzd','','','','','',\$connect).') AS subquery)')
    166166        )";
    167167       
Note: See TracChangeset for help on using the changeset viewer.