News:

Dear forum visitors, if the support forum is not available, please try again a few minutes later. Thanks!

Main Menu
Support-Forum

Jdownloads latest module bug

Started by m.iannozzi, 08.12.2014 18:34:35

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

m.iannozzi

Hi,
In my site I have two menu link like below

index.php?option=com_jdownloads&view=categories&Itemid=178
index.php?option=com_jdownloads&view=categories&Itemid=183

I have also Group-One and Group-Two
Group-One is a part of "Access Levels"-->One
Group-Two is a part of "Access Levels"-->Two

The first menu link (Itemid=178) is configured with Access setting to "Access Levels"-->One
The first menu link (Itemid=183) is configured with Access setting to "Access Levels"-->Two

I'm using also "jDownloads Latest" module

Userids in Group-One can see/access only JDownloads menu Item with Itemid=178 and userids in Group-Two can see/access only to JDownloads Menu Item with Itemid=183

Now beging the bug.

When I'm logged in Joomla with Userid-Two and I click on document link from "jDownloads Latest module" this link point to Itemid=178 (Itemid=178 is accessible only for Userid-One).
So document view fails and I get error that I haven't rights to view the link resource.
I hope is clear for you.

Thanks a lot.

  •  

m.iannozzi

For now I have bypass problem inverting Itemid in url
itemid 178 is now 183
and
itemid 183 is now 178
I have disabled module in Itemid=183 where I don't need module.
I see infact that module get the first Itemid in menu but this is a bug because it can't manage multiple same Jdownloads url with different access level.
I hope problem will be fixed in some future release.
  •  

ColinM

This may not just be an Access problem.
  This may be a problem due to Joomla caching.  If you do have caching on then the module will not be run the second and subsequent times because Joomla saves the HTML view in its cache.  So you get the 'old info' and hence the result you observed.

It would be most helpful if you could reset to where you were originally and retry with Joomla caching off.
Also  do you have the jDownloads Latest module as part of an article where the module would be invoked by a {loadposition xxx} plugin or similar?

If it is a caching problem then help is on its way with an updated jDownloads system plugin that allows selecting that certain items should not be cached.

Thanks in anticipation
Colin M
  •  

m.iannozzi

Hi Colin,
Thanks a lot for your feedback.
I have restored previous setting and disabled cache on module but problem still.
It get first Itemid that it found for menu.
I can confirm that I have loadmodule position plugin enabled in my site but I don't use it to load Jdownload module.
  •  

ColinM

Just thought.  What access levels have you set on the categories and downloads themselves? 
Colin M
  •  

m.iannozzi

#5
Hi Colin, I try to explain my site config access level.
I have a set of permissions to each other very well intertwined.

In practice in my site I have:

folder-1 and subfolders
folder-2 and subfolders
folder-N and subfolders
etc..etc..

I have also

Admin-1
Admin-2
Admin-N
etc..etc..

AdminGroup-1
AdminGroup-2
AdminGroup-N

UserGroup-1
UserGroup-2
UserGroup-N
etc..etc..


Admin are in AdminGroup-1 AdminGroup-2 AdminGroup-N (normally in this group exist only a single Admin for any group)
Users are in UserGroup-1 UserGroup-2 UserGroup-N etc..etc..

Only Admins can upload file

Admin in AdminGroup-1 can see and upload files only in Folder-1 and subfolders ---> normally Admin-1 can't see any other folder like Folder-2 or Folder-N etc..etc..
Admin in AdminGroup-2  can see and upload files only in Folder-2 and subfolders ---> normally Admin-2 can't see any other folder like Folder-1 or Folder-N etc..etc..
Admin in AdminGroup-N can see and upload files only in Folder-N and subfolders ---> normally Admin-N can't see any other folder like Folder-1 or Folder-2 etc..etc..
For exception some AdminGroup can access more of single folder.
The concept is similar to users own folders. Admin can view and upload files only it their "own" folder and subfolders

Users can't upload file in any folder

Users in UserGroup-1 can see and download files in Folder-1 and subfolders and like Admins in normal way User-1 can't see any others Folders (like Folder-2 on Folrder-N)
Users in UserGroup-2 can see Folder-2 and download file from this folder but not from other folders like Folder-1 or Folder-N
Users in UserGroup-N can see Folder-N and download file from this folder but not from other folders like Folder-1 or Folder-2

Same as Admin if exception in defined some User is a part of more Group and can see more of single Folder

I hope is clear for you.


  •  

m.iannozzi

In previous post I have missing to say that all groups are created as child of Registered group but Admins and Users are not a part of Registered.
In Joomla User view "Assigned User Groups" nobody user have flag in Registered group.
  •  

m.iannozzi

Sorry for multiple post but I think that also this info can be useful.
This is the group tree

|?   Registered
|?|?   SuperAdminGroup
|?|?|?GroupAdmin-1
|?|?|?GroupAdmin-2
|?|?|?GroupAdmin-N
|?|?|?etc..
|?|?   SuperUserGroup
|?|?|?SuperUserGroup-1
|?|?|?SuperUserGroup-2
|?|?|?SuperUserGroup-N
|?|?|?etc..

I have Viewing Access level for SuperAdminGroup and SuperUserGroup (this view have same name of SuperGroup)
Menu index.php?option=com_jdownloads&view=categories&Itemid=178 is set with "Access" to SuperAdminGroup
Menu index.php?option=com_jdownloads&view=categories&Itemid=183 is set with "Access" to SuperUserGroup
Jdownload Latest module is assigned to these menu link

If Admin (Itemid=178) logon in joomla  "Jdownloads Latest Module" works good. "Jdownloads Latest Module" have access set to "Registered"
If Normal user (Itemid=183) logon to Joomla when click on "Jdownloads Latest Module" file link point to menu with Itemid=178 and Joomla say me that I haven't right to access.

I have switched Normal User to Itemid=178 and set "Jdownloads Latest Module" access set to "SuperUserGroup". So only normal user can see module (is not important for me if admin doesn't see it) but as I say in previous post I think that this is a bug because module get the first Itemid that it found on menu.
I'm thinking in this moment that I can use a second istance of "Jdownloads Latest Module" and set access to "SuperAdminGroup" and assigned one module to menu with itemid=178 and one to menu with itemid=183. In this way I can bypass problem and have module for UserGroup and AdminGroup.

  •  

m.iannozzi

For a complete description of problem I have tried to create a second instance of module and it get the first Itemid that found on menu (Itemid=178) also if logged user have access to Jdownload menu with Itmeid=183
So problem still.
The only way is to use module only with a menu link with lowest itemid=178
  •  

ColinM

I understand the permission organisation you have set up. It looks fine but there may be a proble. In Joomla a child user group automatically belongs to all the precedent parent groups. So auser in super user group 1 is also an implict  memberof SuperUserGroup, of Registered group and the public .group. The same back trace occurs for your user groups.  Thus they are all implicit members of the Registered group even though you have untickked the explict membership group.  This is nothing to do with jDownloads but it does mean that there is a one to many relationship of groups for each user.

To solve which group to use in this circumstance jD has defined an importance mechanism in the User Group settings  (see documentation). The default setting for all user(admiin) created User Groups is zero but is nonzero fo the 'traditional' groups.  If you have not changed those settings then jD will have used the Registered group!

I would suggest that you put the super users with Publisher as their parent.  This works better.
Maybe test with a couple of user groups to see if it resolves the menu item.  Of course it may be a menu bug but I would have expected it to have been found earlier! But maybe not!!
Colin M
  •  

m.iannozzi

Hi Colin,
I confirm that JDownloads in my configuration use Registered group.
I have changed configuration as you suggestion but problem still.
Jdownloads Latest module still to use the first Itemid that it found on menu and say me that I haven't right to view it.



  •  

ColinM

Hi
Hmm! Not sure, could be a bug but I cannot reproduce :-\
Would it be possible to take a look at your site?  If it is then PM me login details for admin access
Colin M
  •  

m.iannozzi

Hi Colin,
I'm using Jdownloads in Intranet site but I have tried to take a look on modules php

I have found in tmpl/default.php but also in tmpl/alternate.php  below code

Quote$database->setQuery("SELECT id from #__menu WHERE link = 'index.php?option=com_jdownloads&view=category&catid=".$files[$i]->cat_id."' and published = 1");
         $Itemid = $database->loadResult();
         if (!$Itemid){
            $Itemid = $root_itemid;
         } 
....

// create the link
            if ($detail_view == '1'){
            $link = JRoute::_('index.php?option='.$option.'&view=download&catid='.$files[$i]->cat_id.'&id='.$files[$i]->file_id.'&Itemid='.$Itemid);
         } else {   
            $link = JRoute::_('index.php?option='.$option.'&view=category&catid='.$files[$i]->cat_id.'&Itemid='.$Itemid);
         }   

Similar code in mod_jdownloads_latest.php

Quote
$database->setQuery("SELECT id from #__menu WHERE link = 'index.php?option=com_jdownloads&view=categories' and published = 1");
    $root_itemid = $database->loadResult();

Itemid is based on menu link and not to current url so Itemid is the same for all Jdownloads menu link and it get the first Itemid found in database.
I have different Jdownloads menu with different access setting so it's normal to get perms error like in my case.
I don't use other Jdownloads modules but if they use same logic they will fails in same way.

Let me know if you have other doubts.




  •