Jump to content

getListingOwner issue in everywhere_com_community_access.php


Alex Andreae

Recommended Posts

I looked around the site for a bit before posting this, but I wasn't able to find more recent files.  The sticky post in this forum talked about going to the Downloads link on the left, which I didn't see, but I did find a Downloads area with Everywhere Addon support, but didn't see anything for JomSocial.  If I just missed it, please let me know where to go.

 

The issue I'm seeing is that a user that is logged in to their profile and clicks "Reply to this review" gets the following message:

You don't have enough access to perform this action.

 

In going through the code, I found this:

jreviews/controllers/owner_replies_controller.php

                $owner = $this->Listing->getListingOwner($listing['listing_id']);
                if($this->_user->id != $owner['user_id']){
                    $this->denyAccess = true;
                    return;
                }

 

Looking at the file that I believe is being called, I see the following:

jreviews/controllers/components/everywhere/everywhere_com_community_access.php

    function getListingOwner($result_id)
    {
        return $result_id;
    }

 

If I look at a different everwhere controller, the return value looks like it will be an object:

jreviews/controllers/components/everywhere/everywhere_com_content.php

    function getListingOwner($result_id)
    {
        $query = "
            SELECT
                Listing.created_by AS user_id, User.name, User.email
            FROM
                #__content AS Listing
            LEFT JOIN
                #__users AS User ON Listing.created_by = User.id
            WHERE
                Listing.id = " . (int) ($result_id);
        $this->_db->setQuery($query);
        appLogMessage($this->_db->getErrorMsg(),'owner_listing');
        return current($this->_db->loadAssocList());
    }

 

So, I don't think the everywhere_com_community_access.php file is correct, but wanted to check with you first to see if I was missing something else.

 

Thanks for your help.

 

Link to comment
×
×
  • Create New...