HomeHelpTrac

Ignore:
Timestamp:
01/17/10 19:32:34 (2 years ago)
Author:
Alexander Trofimov
Message:

Ticket #1705

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xmlrpc/BxDolXMLRPCMedia.php

    r13383 r13577  
    5656                $sModuleName = 'photos'; 
    5757                $sType = 'bx_photos'; 
     58                $sMemAction = 'BX_PHOTOS_VIEW'; 
    5859                break; 
    5960            case 'video': 
    6061                $sModuleName = 'videos'; 
    6162                $sType = 'bx_videos'; 
     63                $sMemAction = 'BX_VIDEOS_VIEW'; 
    6264                break; 
    6365            case 'music': 
    6466                $sModuleName = 'sounds'; 
    6567                $sType = 'bx_sounds'; 
     68                $sMemAction = 'BX_SOUNDS_VIEW'; 
    6669                break;           
    6770            default: 
    6871                return array(); 
    6972        } 
     73 
     74        if (!$this->_isMembershipEnabledFor($iIdProfileViewer, $sMemAction)) 
     75            return array (); 
     76 
    7077        bx_import('BxDolAlbums'); 
    7178        $o = new BxDolAlbums ($sType, (int)$iIdProfile); 
     
    148155        return new xmlrpcval ($aFiles, "array"); 
    149156    } 
     157 
     158    function _isMembershipEnabledFor ($iProfileId, $sMembershipActionConstant) { 
     159        defineMembershipActions (array('photos add', 'photos view', 'sounds view', 'videos view')); 
     160        if (!defined($sMembershipActionConstant)) 
     161            return false; 
     162        $aCheck = checkAction($iProfileId ? $iProfileId : $_COOKIE['memberID'], constant($sMembershipActionConstant)); 
     163        return $aCheck[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED; 
     164    }     
    150165} 
    151166 
Note: See TracChangeset for help on using the changeset viewer.