greengeek
greengeek
Offline
0
How can I make it so that Joomla Music Solutions only shows up for registered users? I don't want everyone that stumbles across my site to see the pages. I was able to hide the links and the player module by setting it to registered, but all the music pages can still be accessible by just typing in the url such as www.mysite.com/index.php?option=com_muscol I find if a user logs out and then they type in the url like above it bypasses any checks and shows the page.

I would rather users not logged in that hit any of the joomla music solution pages to just get the "To access the private area of this site, please log in. " message. That way only registered users that are logged in can see the music pages.

Please advise.

Thank you.
Responses (10)
  • Accepted Answer

    Saturday, February 20 2010, 10:46 AM - #Permalink
    0
    well, the solution that comes into my mind is this:

    associate all the Music Collection to an Itemid (using the default itemid parameter). this ID would be the one you use to enter MC, and you must set it as protected (only registered)

    then, how to avoid people just typing the url on the browser, WITHOUT the itemid, so they skip the "blocking"? well, the best way, if you ask me, is to use a SEF solution, such as ARTIO:

    Artio saves the itemid of each url, and makes it to be always that one. so your users wont be able to type any address without and Itemid, because this is always added by Artio jomsef.

    do you know what I mean?

    This is my "personal" joomla solution for REALLY restricting pages on a joomls site.

    it's my personal trick ;) I've used it on hundreds of sites.
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, February 20 2010, 10:47 AM - #Permalink
    0
    if you dont want this solution, you can always add a little code on a file to just TOTALLY block MC from unregistered users

    is just a couple lines of code, I can tell you how to do it if you want it
    The reply is currently minimized Show
  • Accepted Answer

    greengeek
    greengeek
    Offline
    Friday, February 26 2010, 02:12 AM - #Permalink
    0
    germi wrote:
    if you dont want this solution, you can always add a little code on a file to just TOTALLY block MC from unregistered users

    is just a couple lines of code, I can tell you how to do it if you want it


    If you could provide the code, it would be greatly appreciated. Thank you.
    The reply is currently minimized Show
  • Accepted Answer

    Friday, February 26 2010, 03:35 PM - #Permalink
    0
    open /components/com_muscol/muscol.php

    and add this quite at the beginning of the file, about line 12 or 13


    $user =& JFactory::getUser();
    if(!$user->id){
    JError::raiseError(401, 'You are not authorized to view this content');
    return;
    }


    this will quick out every non-registered user that tries to access any music collection content, throwing out a 401 (unauthorized) message

    Germi
    The reply is currently minimized Show
  • Accepted Answer

    greengeek
    greengeek
    Offline
    Saturday, February 27 2010, 03:02 AM - #Permalink
    0
    Awesome! Thanks for the code. I will give it a try.
    The reply is currently minimized Show
  • Accepted Answer

    greengeek
    greengeek
    Offline
    Saturday, February 27 2010, 08:07 AM - #Permalink
    0
    Just tested it out and it works great. Thanks!
    The reply is currently minimized Show
  • Accepted Answer

    Corin
    Corin
    Offline
    Wednesday, April 21 2010, 03:14 AM - #Permalink
    0
    Hi,

    I want to use the 401 response status to deny access to unauthorized file downloads on my website, but I was reading (here) that the response is required to include the WWW-Authenticate header field. I don't think Joomla! framework does this, is it something we should handle, if so how?

    Thanks,
    Corin.
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, April 21 2010, 01:51 PM - #Permalink
    0
    sorry

    can you provide me your music collection purchase id? I cant find it in our system..

    Germi
    The reply is currently minimized Show
  • Accepted Answer

    Corin
    Corin
    Offline
    Wednesday, April 21 2010, 01:55 PM - #Permalink
    0
    Hey,

    Sorry, you misunderstand me... I don't have a purchase.

    Thanks,
    Corin.
    The reply is currently minimized Show
  • Accepted Answer

    Corin
    Corin
    Offline
    Wednesday, April 21 2010, 01:57 PM - #Permalink
    0
    I found this post via Google, I'm just interested in the general problem.
    The reply is currently minimized Show
Your Reply