MC Editing Access

Brian
Brian
Offline
0
Do to the fact that any kind of permission feature as far as editing Artist, Albums or songs has been ignored...

1) What would I need to do to allow all registered users to be able to edit any and all music?

2) How would I remove the delete option from the MC front-end?

Thanks!
Responses (13)
  • Accepted Answer

    Thursday, June 16 2011, 04:01 PM - #Permalink
    0
    1) are you sure you want to allow this? ok..

    open com_muscol/controller.php

    line 64 and following, the variable $can_edit determines if the user can edit. if you set it always to TRUE that would do it.
    hey, but.. I don't make responsible of what happens next!! it's up to you! ;)

    2) on helpers/helpers.php

    fins the functions edit_button_album and edit_button_artist you will see they return EDIT and DELETE buttons. just crop out the delete button part...

    AT YOUR OWN RISK!

    Germi
    The reply is currently minimized Show
  • Accepted Answer

    Brian
    Brian
    Offline
    Thursday, June 16 2011, 04:42 PM - #Permalink
    0
    Thanks Germi

    I am only using my site as a place for personal friends to share music. Therefore I don't have much to worry about as far as editing permission. I trust'em!... I think :)
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, June 16 2011, 04:44 PM - #Permalink
    0
    no worries then ;)
    The reply is currently minimized Show
  • Accepted Answer

    Brian
    Brian
    Offline
    Thursday, June 16 2011, 04:55 PM - #Permalink
    0
    germi wrote:
    1)open com_muscol/controller.php

    line 64 and following, the variable $can_edit determines if the user can edit. if you set it always to TRUE that would do it.
    hey, but.. I don't make responsible of what happens next!! it's up to you! ;)


    I did this but is doesn't seem to be working... Below is the code...
    			else{ // registered

    switch($view){
    case "album":
    $can_edit = TRUE;
    $msg = JText::_('NOT_AUTHORIZED_ALBUM');
    $link = JRoute::_('index.php?option=com_muscol&view=album&id='. $id . $itemid);
    break;

    case "song":
    $can_edit = TRUE;
    $msg = JText::_('NOT_AUTHORIZED_SONG');
    $link = JRoute::_('index.php?option=com_muscol&view=song&id='. $id . $itemid);
    break;

    case "artist":
    $can_edit = TRUE;
    $msg = JText::_('NOT_AUTHORIZED_ARTIST');
    $link = JRoute::_('index.php?option=com_muscol&view=artist&id='. $id . $itemid);

    if(!$params->get('users_add_artists')){
    $can_edit = false ;
    $msg = JText::_('NOT_AUTHORIZED_ARTISTS');
    $link = JRoute::_('index.php?option=com_muscol&view=artists' . $itemid);
    }
    The reply is currently minimized Show
  • Accepted Answer

    Friday, June 17 2011, 04:09 PM - #Permalink
    0
    hmm.. do you still get the messages "you're not authorized".. ?
    I guess you are trying to add album as a registered user... right?
    The reply is currently minimized Show
  • Accepted Answer

    Brian
    Brian
    Offline
    Friday, June 17 2011, 08:47 PM - #Permalink
    0
    germi wrote:
    hmm.. do you still get the messages "you're not authorized".. ?
    I guess you are trying to add album as a registered user... right?


    No, users can add albums no problem... I want all users to be able to edit any album or artists or song throughout the collection (regardless of who initially added the album artist or song).
    The reply is currently minimized Show
  • Accepted Answer

    Brian
    Brian
    Offline
    Saturday, June 18 2011, 01:37 AM - #Permalink
    0
    It turns out that your changes do allow any users to edit any album etc. However the edit button is not showing up. This can be changed by editing helpers/helpers.php


    	function edit_button_song($id){
    $user =& JFactory::getUser();

    if(!$user->id) return "";

    $db =& JFactory::getDBO();

    $query = ' SELECT user_id FROM #__muscol_songs WHERE id = ' .$id;
    $db->setQuery( $query ) ;
    $owner = $db->loadResult();

    if($user->id != $owner) return "";

    $params = &JComponentHelper::getParams( 'com_muscol' );
    $itemid = $params->get('itemid');
    if($itemid != "") $itemid = "&Itemid=" . $itemid;

    return "" . JHTML::image('components/com_muscol/assets/images/page_white_edit.png', JText::_('Edit')) . "";


    to

    	
    return "" . JHTML::image('components/com_muscol/assets/images/page_white_edit.png', JText::_('Edit')) . "";



    Thanks for the help!
    The reply is currently minimized Show
  • Accepted Answer

    ViRulent
    ViRulent
    Offline
    Monday, November 14 2011, 08:22 PM - #Permalink
    0
    Hi,

    About Editing Access... not exactly like Max Power (I dont want everyone to be able to edit !) but on the opposite, I don't want that the only user capable of editing is the user who added the artist/album/song.

    I'd like myself and some Helpers to be able to edit everything in frontend...

    I thought about this... if I set my user_id and my Helpers' user_ids under 50... Would it be possible to code something like :

    $can_edit = user_id "who created it" AND/OR user_id "under50"

    if yes, can you help me out with this code ???
    The reply is currently minimized Show
  • Accepted Answer

    Monday, December 26 2011, 01:55 PM - #Permalink
    0
    I got the edit graphic to show up but there is no link with it. I click the graphic and nothing happens...

    What am I missing?? http://www.joomlamusicsolutions.com/images/fbfiles/images/Capture2.PNG
    Attachments:
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, December 27 2011, 04:17 PM - #Permalink
    0
    no link? :S that makes no sense.. can you post a link, and provide me access?
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, December 27 2011, 06:28 PM - #Permalink
    0
    I realized I did not purchase the edit in front version...

    I will upgrade in the future
    The reply is currently minimized Show
  • Accepted Answer

    ViRulent
    ViRulent
    Offline
    Tuesday, January 24 2012, 03:32 PM - #Permalink
    0
    ViRulent wrote:
    Hi,

    About Editing Access... not exactly like Max Power (I dont want everyone to be able to edit !) but on the opposite, I don't want that the only user capable of editing is the user who added the artist/album/song.

    I'd like myself and some Helpers to be able to edit everything in frontend...

    I thought about this... if I set my user_id and my Helpers' user_ids under 50... Then, in com_muscol/controller.php would it be possible to code something like :

    $can_edit = user_id "who created it" AND/OR user_id "under50"

    if yes, can you help me out with this code ???

    bump!
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, February 07 2012, 07:00 PM - #Permalink
    0
    ooopss!
    missed this one..

    yes you could do something like that... on the function check_album_permission() of the controller.php

    it's very easy, you'll see how this function works..!
    The reply is currently minimized Show
Your Reply