Remove "edit permissions" when user uploads zip file

smilem

Joined: 2009-02-25
Posts: 118
Posted: Tue, 2013-03-19 05:42

Hello, The original thread is here, I could not reply to it for some reason.
http://galleryproject.org/node/73921
http://galleryproject.org/node/70844

I have just update to gallery 2.3.2 and decided to add upload by zip option, since the javascript plugin is not update anymore and it has trouble on some systems etc.

The problem is with permissions when user uploads a folder with other folders that become gallery subalbums.

I can see the "edit album", "edit permissions", "reorder items" added to the available actions for any subalbums. I know I need to edit something to not display them, I would like to keep using the zip file upload feature.

However if the user creates subalbums they are OK, only uploading zip file is a problem.

Can anyone help me?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2013-03-19 12:04
Quote:
since the javascript plugin is not update anymore

huh? what javascript plugin?

have you tried http://codex.galleryproject.org/Gallery2:Modules:uploadifyuploadify?

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
smilem

Joined: 2009-02-25
Posts: 118
Posted: Tue, 2013-03-19 15:14
suprsidr wrote:
Quote:
since the javascript plugin is not update anymore

huh? what javascript plugin?

have you tried http://codex.galleryproject.org/Gallery2:Modules:uploadifyuploadify?

-s
________________________________
All New jQuery Minislideshow for G2/G3

I was using this Upload Applet v1.0.11 http://codex.galleryproject.org/Gallery2:Modules:uploadapplet
I tried the uploadify and it works OK for single and chunks of photos. Thank you !
Where can I specify that "Have gallery create resizes at upload time." would be ON by default?

I tried to upload zip file and it simply uploaded zip file. Anyway it would be nice if I could fix this ZIP file permission problem too.

Where I can specify what file types are uploadable?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2013-03-19 15:33
Quote:
I was using this Upload Applet v1.0.11 http://codex.galleryproject.org/Gallery2:Modules:uploadapplet

that's java not javascript and is wildly outdated and always suffered from memory limitations

Quote:
Where can I specify that "Have gallery create resizes at upload time." would be ON by default?

you'll have to add checked="checked" to the /uploadify/templates/ItemAddUploadify.tpl template at the resizes checkbox input

Quote:
Anyway it would be nice if I could fix this ZIP file permission problem too.

any albums created are supposed to inherit the album permissions of the parent album

Quote:
Where I can specify what file types are uploadable?

http://codex.galleryproject.org/Gallery2:Modules:mime

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
smilem

Joined: 2009-02-25
Posts: 118
Posted: Thu, 2013-03-21 17:51
Quote:
any albums created are supposed to inherit the album permissions of the parent album

yes I know that, but since the file is decompressed and then placed into users album the folders that are zipped together inside zip archive become subalbums, for some reason they have additional permissions.

I can't see the aditional permissions when I login with my admin account and browse them, I did not check the database yet, but something is created differently. Permissions on created subalbums are not inherited.

Also uploading zip file with the uploadify, does not decompress it. It simply uploads a zip file. Despite the archive plugin being active and working if you upload from browser as single file, why is this?

 
smilem

Joined: 2009-02-25
Posts: 118
Posted: Mon, 2013-03-25 21:57

Hmm, uploadify is based on java, so it doesn't work on any android based device :(

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2013-03-25 22:16

Nope, no java there, just flash... still.

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
smilem

Joined: 2009-02-25
Posts: 118
Posted: Wed, 2013-04-03 13:07

Uploadify works on MAC and but does not work on Android phones like samsung s3 :(

Since I can't post in the old thread is there a way to remove the "Delete album" from main user album, because if user deletes by accident the main album all photos are lost, and I need to recreate the account for the main album to be created with proper permissions.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2013-04-03 14:19

Try the following in gallery2/themes/your theme/templates/local/theme.tpl <- You may have to copy the original here
just before </head> add:

{if $theme.item.parentId == 7 && !$user.isAdmin}
  {literal}
    <style> .gbLink-core_ItemAdmin-core_ItemDelete-album { display: none; } </style>
  {/literal}
{/if}

where 7 is the id of the parent album to all user albums.
Notice admin will not be affected so you will need to test w/ non-admin account or remove && !$user.isAdmin

Untested

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2013-04-03 14:23
Quote:
Uploadify works on MAC and but does not work on Android phones like samsung s3

There is flashplayer for Android phones and tablets but not iOS devices.

There is an uploadify update for newer devices, but it is not free and won't work on older devices. There is always a trade-off.

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
smilem

Joined: 2009-02-25
Posts: 118
Posted: Mon, 2013-04-22 22:55

I'm using matrix theme. see attached file, rename to tpl
I made a backup of theme.tpl and edited the file directly, by adding the code you posted:

Looks like this:

Quote:
{*
* $Revision: 16727 $
* Read this before changing templates! http://codex.gallery2.org/Gallery2:Editing_Templates
*}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="{g->language}" xmlns="http://www.w3.org/1999/xhtml">
<head>
{* Let Gallery print out anything it wants to put into the <head> element *}
{g->head}

{* If Gallery doesn't provide a header, we use the album/photo title (or filename) *}
{if empty($head.title)}
<title>{$theme.item.title|markup:strip|default:$theme.item.pathComponent}</title>
{/if}

{* Include this theme's style sheet *}
<link rel="stylesheet" type="text/css" href="{g->theme url="theme.css"}"/>
{if $theme.item.parentId == 7 && !$user.isAdmin}
{literal}
<style> .gbLink-core_ItemAdmin-core_ItemDelete-album { display: none; } </style>
{/literal}
{/if}
</head>

But it made no change at all, I cleared template cache, and logged in with simple user account created earlier.
What I'm doing wrong here. I appreciate you help tremendously.

Permissions for user gallery main folder (auto assigned):

Group Permissions

Everybody [rating] All access
Registered Users [checkout] Purchase item
Registered Users [checkout] Purchase album
Site Admins All access

User Permissions

test1 [core] Add sub-album
test1 [core] Add sub-item
test1 [core] Delete item
test1 [core] View item
test1 [core] View resized version(s)

Gallery main folder permisions:

Group Permissions

Everybody [core] View all versions
Everybody [rating] All access
Registered Users [checkout] Purchase item
Registered Users [checkout] Purchase album
Site Admins All access

User Permissions

admin All access

 
smilem

Joined: 2009-02-25
Posts: 118
Posted: Sat, 2013-08-10 18:35

Hello, You were abroad last time I asked for some help with this problem, perhaps you are back now and could have a look.
I appreciate your help.

 
smilem

Joined: 2009-02-25
Posts: 118
Posted: Fri, 2013-09-13 14:16

Hello, I still hope for a reply ?