News:

Support for jDownloads 3 has been ended
Since 17 August 2023 Joomla.org has discontinued support for Joomla 3.x. Therefore, we will no longer offer official support for our Joomla 3 jDownloads version 3.9.x from January 2024.
Please update your website to the latest Joomla version (Joomla 4 or Joomla 5) as soon as possible. Afterwards, please update jDownloads to the latest published version. The longer you delay, the more difficult the upgrade process for your website is likely to be.

Main Menu
Support-Forum

Upload Link / icon not show for Guest /Public ? Bug?[solved]

Started by Nyx, 17.04.2015 14:30:44

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nyx

hi,

I want that my Website visitors can create a download without useraccount / registered so everyone.

Is this so "designed" that as Guest (with out user login) the upload Button / text is not show?

All rights in the backend are ok. Allowed to create downloads for Guest, ok.
And I can browse to the link "www.domain.com/?view=form&layout=edit" without to login.

But in the layout no Upload button ({upload_link}) will show.


so when i remove in e.g. "www.domain.com/components/com_jdownloads/views/categories/view.html.php" in Line 52
the IF -> "if (!$user->guest){" so the download button is show.

so why you block to see the downlaodbutton as Guest? And the Frorm will work for guest?
And why the ACL "jform_rules_core.create_1" on "YES" or "NO" is not enough?
  •  

ColinM

Nyx
I think that way back in the early stages of the jD move to the 2.5 and 3.2 series that it was too dangerouis to generally allow non registered users to be able to upload.  There are so many issues like to which category will they be allowed to upload, will they be able to set permissions and access levels, and so on.

Perhaps you could explain a little more about the scheme you have in mind. Selecting a specific set of categories for public use is readily achievable now by using the View Access Level.  All the non accessible ones would be set to say Registered Access Level and all the Public ones to Public Access Level.  Would need to add in Managers and Admins as they are on a different branch but that is straight forward..

Need to discuss with Arno

Colin
Colin M
  •  

Nyx

hi,

thanks for you answer.

The idea is that each website visitors may submit a download.
So a file, a screenshot and description, etc.

And the download is automatically unpublished, I verify the download submitted. And if everything works I published this.
  •  

ColinM

Hi
In the longer term Arno is planning a 'user private files area'.  In the meantime perhaps an upload form which uses a fixed category, and includes a user "name" as a prefix to each item (or maybe date and time prefix).  Still means more effort by you but creating a category and moving the files to it is not so much as checking the upload itself.

Will think a bit more.

Colin
Colin M
  •  

Nyx

Hi,

in my case I don't need the private area.

It's a public Download DB for everyone to Down & Upload.
And I check the Upload before I publish it.

So I see no risk.
I have the security option - e.g. captcha, set cat, upload is unpublish, file type restriction, .htaccess, IP restriction, etc.

To register for a single upload itself is very cumbersome for the user.
  •  

ColinM

Hi
I am looking into why the Add button does not show.  However I do not think you need it as explained below.

One can put an 'upload menu item' on a menu that will allow Public User Group to upload.  This does not need to stay permanently.
I have a Top Level Category called 'Public DownLoads'.  It has several subcategories.  The Create and Download permissions on the Category were set as shown in PubUpload01.png .  Suggest you do not set Edit or Edit Own as the user could then modify the upload, and actually change the file itself by uploading another one!  The Access Level was of course set to Public.   Do Not set in the Component permissions, leave these as inherited - (accessed by Options button on jD Control Panel).

Now create a Menu Item for Uploading as indicated.  There is a choice of a fixed category or ability for user to select category.

Rather than have the standard jD Add button another solution is to edit the relevant Layout and add ones own button. See pic 'PubUpload07.png' as an example where I have used a different upload icon to show the point. The action on the button would be set to the same as the upload menu item.  Once setup the upload Menu item could be 'unpublished' but must not be deleted.  If you like this idea then I will detail how to add the relevant HTML in the Layout.  Typically the link would be  http://your-site.com/upload-data where upload-data was the alias in the menu item.

Colin

[gelöscht durch Administrator]
Colin M
  •  

Nyx

Hi, thanks for your description.
This is a way.

But my Question was, why the Placeholder for the upload Button is for guest /public with the correct rights not show.

May be can give Arno a answer?

but it's ok, i can remove the if's in views e.g. "(www.domain.com/components/com_jdownloads/views/categories/view.html.php" in Line 52
the IF -> "if (!$user->guest){" )"

or replace the placeholder in the layout with a link.
  •  

ColinM

Nyx
I think the most likely reason is that in the early days of the jD 2.5/3.2 series the permissions handling was not correct.  So the relevant code was introduced in order to stop the upload icon appearing for Public and Guest.  Maybe it is not necessary now.

Colin
Colin M
  •  

Arno

Quote from: Nyx on 23.04.2015 13:22:56
...
But my Question was, why the Placeholder for the upload Button is for guest /public with the correct rights not show.

May be can give Arno a answer?

but it's ok, i can remove the if's in views e.g. "(www.domain.com/components/com_jdownloads/views/categories/view.html.php" in Line 52
the IF -> "if (!$user->guest){" )"

or replace the placeholder in the layout with a link.
Hi,
we had in the last months some users, which would not see the upload icon, when the user had not the 'create' permissions.
So i had changed it and the icon was only viewed when (at minimum) for a single category exist the 'create' permission.
But now had we again a new problem:
- when a website has many hundreds categories, we must check for every category the permissions
- but this makes the script very slow in big download areas
- so i had it again modified and have used now the $user->guest variable (i had hoped that nobody would use this really for 'all' visitors)
- so we have now 'your' problem...  ;D ::)

But i will check this later today more. Can also be a simple bug.  ;)
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

ColinM

Arno
As a test I have commented out the line  "if (!$user->guest){"  and its closing "}"  The Add button now appears but it appears even if I do not have Create permission for public. ???  If I then click on the icon it gives me, correctly, the message "Error You do not have permission to create a new download."  Hmm!

Colin
Colin M
  •  

ColinM

Nyx
The source of the problem has now been identified.  Solution should be included in next release.
Colin
Colin M
  •  

Nyx

  •  

Arno

@ Nyx:
when you will allow in your case for all visitors to create new downloads so it works also yet. But only the 'upload' icon is not always viewed correctly.
But you can use then the 'Create Download' menu item. 

With next version 3.2.32 is this a little bit modified. So when you set the components 'create' permissions (for 'public' user group) the icon should then be viewed correctly.
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

Nyx

ok thank you.

at the moment my code in all views are this:

at line 50:
        $this->view_upload_button = false;
       
        if (!$user->guest){
            // we must here check whether the user has the permissions to create new downloads
            // this can be defined in the components permissions but also in any category
           
            // 1. check the component permissions
            if (!$user->authorise('core.create', 'com_jdownloads')){
                // 2. not global permissions so we must check now every category (for a lot of categories can this be very slow)
                $this->authorised_cats = JDHelper::getAuthorisedJDCategories('core.create', $user);
                if (count($this->authorised_cats > 0)){
                    $this->view_upload_button = true;
                }
            } else {
                $this->view_upload_button = true;
            }
        } else {
                $this->view_upload_button = true;
            }
  ;)
  •  

Arno

Yes this trick does.  :D
The next version is in work and will be published very soon.
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •