Changeset 6213


Ignore:
Timestamp:
05/17/10 22:10:09 (9 years ago)
Author:
grum
Message:

results for request builder if filtered with user rights access

Location:
extensions/GrumPluginClasses
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/GrumPluginClasses/classes/GPCRequestBuilder.class.inc.php

    r6208 r6213  
    164164   * @return Boolean : true if registering is Ok, otherwise false 
    165165   */ 
    166   static public function register($pluginName, $fileName, $dialogBoxObject) 
     166  static public function register($pluginName, $fileName) 
    167167  { 
    168168    $config=Array(); 
     
    172172        'name' => $pluginName, 
    173173        'fileName' => $fileName, 
    174         'dialogBox' => $dialogBoxObject, 
    175174        'date' => date("Y-m-d H:i:s"), 
    176175        'version' => self::$version, 
     
    400399    $tmpBuild=Array( 
    401400      'FROM' => Array( 
    402         '('.IMAGES_TABLE.' pit LEFT JOIN '.IMAGE_CATEGORY_TABLE.' pic ON pit.id = pic.image_id)', //JOIN IMAGES & IMAGE_CATEGORY tables 
     401        '('.IMAGES_TABLE.' pit LEFT JOIN '.IMAGE_CATEGORY_TABLE.' pic ON pit.id = pic.image_id)' /*JOIN IMAGES & IMAGE_CATEGORY tables*/ 
     402       .'   JOIN '.USER_CACHE_CATEGORIES_TABLE.' pucc ON pucc.cat_id=pic.category_id',  /* IMAGE_CATEGORY & USER_CACHE_CATEGORIES_TABLE tables*/ 
     403 
    403404      ), 
    404405      'WHERE' => Array(), 
    405       'JOIN' => Array(), 
     406      'JOIN' => Array(999=>'pucc.user_id='.$user['id']), 
    406407      'GROUPBY' => Array( 
    407408        'pit.id' 
     
    464465    unset($tmpBuild['FROM']); 
    465466 
    466  
    467467    /* build WHERE 
    468468     */ 
     
    532532  static private function getPage($requestNumber, $pageNumber, $numPerPage) 
    533533  { 
    534     global $conf; 
     534    global $conf, $user; 
    535535    $request=self::getRequest($requestNumber); 
    536536 
     
    561561      'FROM' => Array( 
    562562        // join rb result_cache table with piwigo's images table, joined with the piwigo's image_category table, joined with the categories table 
    563         'RB' => "((".self::$tables['result_cache']." pgrc 
     563        'RB' => "(((".self::$tables['result_cache']." pgrc 
    564564                  RIGHT JOIN ".IMAGES_TABLE." pit 
    565565                  ON pgrc.image_id = pit.id) 
    566566                    RIGHT JOIN ".IMAGE_CATEGORY_TABLE." pic 
    567567                    ON pit.id = pic.image_id) 
    568                        RIGHT JOIN piwigo_categories pct 
    569                        ON pct.id = pic.category_id ", 
     568                       RIGHT JOIN ".CATEGORIES_TABLE." pct 
     569                       ON pct.id = pic.category_id) 
     570                          RIGHT JOIN ".USER_CACHE_CATEGORIES_TABLE." pucc 
     571                          ON pucc.cat_id = pic.category_id", 
    570572      ), 
    571573      'WHERE' => Array( 
    572         'RB' => "pgrc.id=".$requestNumber, 
     574        'RB' => "pgrc.id=".$requestNumber." AND pucc.user_id=".$user['id'], 
    573575        ), 
    574576      'JOIN' => Array(), 
Note: See TracChangeset for help on using the changeset viewer.