Upload for Users Upload for Users
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Upload for Users

Started by mexfred, December 11, 2006, 05:09:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mexfred

May be I should go away from the computer and play with anything more simple,
but 2 days ago, when I installed coopermine, I opend for my kids private galerys.
When I remember correct, there was a buttom to add fotos/files. It was possible
to upload 5 pictures at once. Today I cann`t find this funcction.
May be anybody can tell me, should I go on with playing easy games or anybody
has an idea to fix the problem.

Thanks

mexfred

when I`m (administrator) in, admin or user mode, I find the buttom to add fotos/files,
in as a user, no buttom.
May be I`m not so silly as I thought. :) :) :) :) ;D ;D ;D

How I get the buttom for my users ????????????????????????

Joachim Müller

Read the documentation. You need to allow them to upload to their personal galleries or to public galleries.

Joachim

mexfred

Hallo Joachim,
ich schreibe Dir auf Deutsch, denke Du verstehst das.
Habe die Doku gelesen, in der Usereinstellung ist das Uploaden fuer Privat Galerys freigegeben.
Funktionierte auch am Anfang. Hatte andere Probleme, konnte mich nicht einloggen hatte deshalb
auf die 4.10 upgedatet. Nach Cookie loeschen war dieses Problem dann beseitigt, Danke an Sami.
Wuesste nicht wo ich noch einen Einstellungsfehler bei den Usern habe, habe dies mind. 10 mal
angeschaut. ??? ??? ??? ??? ??? ??? ???

Wenn Du Dich nochmals bemuehen wuerdest, Danke.

Gruss Fred

Joachim Müller

On the regular support board only English is acceptable, as only Stramm and I do speak German, while the other devs don't. Additionally, your postings are suppossed to serve as a reference for others, that's the whole idea of running a support board. Therefor, I'll ignore your posting in German. This is not a private chat between you and me - it's a support board.

mexfred

Sorry, taht I wrote in German,
your first answer was to read the documentation, I did,
the permissions for User are set correct, upload to privat albums is permitted.

First the problem did not exist, it came up after updating to 4.10 because I got other
problems, thanks to Sami for fixing.

Now a user cannot upload fotos/files, before it was possible.

Thanks for help



Joachim Müller

Post a link and non-admin test user account then. Posting a screenshot of your groups page (using "additional options" when composing your message and attaching the screenshot to your posting) might help as well.

mexfred

Hey again,
its done, you can use "tester" with password "test"
group settings you fin attached.

Fred

Joachim Müller

OK, great. Now we have a test user name and correspoding password. If we had a link to your page, it would be even more helpfull ::).

mexfred


Joachim Müller

OK, I see. Looks like a bug to me. Moving accordingly. Try turning on public uploads for the registered group.

Joachim Müller

OK, this is actually a bug that existed both in the stable as well as the devel branch. When a user is member of a group that doesn't have the privilege to upload to public albums, but has the privilege to have a personal gallery, the upload link is not being displayed. When going to the upload screen manually, the user gets an error message.
I updated both branches of the SVN repository with the fixes below. Fixes will therefor be in cpg1.4.11 and cpg1.5.0 (once they get released).

To fix this manually, perform the steps outlined below:


1) upload.php
Edit upload.php, findif (!USER_CAN_UPLOAD_PICTURES) {and replace withif (!USER_CAN_UPLOAD_PICTURES && !USER_CAN_CREATE_ALBUMS) {This will make sure that the upload screen doesn't show an error message in the first place if public uploads are off and personal galleries are on.
Explanation for advanced users: the constant USER_CAN_CREATE_ALBUMS is named a bit misleading for historical reasons. Actually, it determines if a user can have a personal gallery.
Findif (!count($public_albums_list) && !count($user_albums_list)) {
    cpg_die (ERROR, $lang_upload_php['err_no_alb_uploadables'], __FILE__, __LINE__);
}
and replace withif (!count($public_albums_list) && !count($user_albums_list)) {  // there's no album where the user is allowed to upload to
    if (USER_CAN_CREATE_ALBUMS) {
        cpg_die (ERROR, $lang_upload_php['err_no_alb_uploadables'].'<br />&nbsp;<br /><a href="albmgr.php" title="'.$lang_user_admin_menu['albmgr_title'].'" class="admin_menu">'.$lang_user_admin_menu['albmgr_lnk'].'</a>', __FILE__, __LINE__);
    } else {
        cpg_die (ERROR, $lang_upload_php['err_no_alb_uploadables'], __FILE__, __LINE__);
    }
}
This will fix uploading and remind users who are allowed to have a personal gallery that they need to create at least one album before being able to upload a file.


2) include/themes.inc.php
Edit include/themes.inc.php, find    if (!USER_CAN_UPLOAD_PICTURES) {
        template_extract_block($template_sys_menu, 'upload_pic');
    }
and replace with    if (!USER_CAN_UPLOAD_PICTURES && !USER_CAN_CREATE_ALBUMS) {
        template_extract_block($template_sys_menu, 'upload_pic');
    }
This will fix the visibility of the upload link.


3) Check your custom theme
If you have created a custom theme (i.e. one that doesn't come with Coppermine by default), you will have to make sure to fix the issue as well. Open themes/yourtheme/theme.php, try to findfunction theme_main_menu($which)If you don't have that line, then you're fine and won't have to perform additional steps. If you do have that function defined in your theme, do as suggested in step 2 (searching for     if (!USER_CAN_UPLOAD_PICTURES) { and applying the suggested fix).


Finally, upload your changed files and test-drive everything.

@devs: please confirm

Cheers

Joachim

mexfred

Ok, I can confirm, your buckfix is working perfectly,
I know, you are not interested to follow up my posts, but may be, for others they got the
same problem, I post a problem (its easyer to explain in german), looks as its a buck also
and you can check and may be fix it for the comunity.

Thanks for fixing the upload problem

Saludos

Fred Mexico ;D

Joachim Müller

We have a "one issue per thread" policy that you agreed to respect when signing up. It is mandatory to respect this policy especially in postings on the bugs board, as not doing so will confuse others. You were suppossed to reply to this thread saying "your suggested fix is working as expected" or by saying "doesn't work for me". No other reply is permitted, particularly not remarks that make others think that there might be related issues. Your "wannabe-bug-report" "Keyword problem" deals with something entirely different. If you must refer to it, then provide a link as well, as others are not mind readers. There's no benefit for others if you refer to a German posting on the international bugs board.

Locking this thread now.