Forums / Developer / User (Members) cannot upload images to gallery

User (Members) cannot upload images to gallery

Author Message

D K

Thursday 19 March 2009 3:17:39 am

Hi,

I have setup image gallery in my website. There is a facility upload images to the image gallery. All administrators can upload images for any gallery through the frontend.

But Members cannot upload images. Anybody can help on this regard.

Thanks.

http://www.eyepax.com

Noicokuna Niemoge

Thursday 19 March 2009 4:22:50 am

You have to give regular members permissions to add pictures to the gallery. Check the gallery node ID and add the proper permission for that node.

http://ez.no/doc/ez_publish/technical_manual/4_0/concepts_and_basics/access_control

Shiki soku ze ku...

D K

Thursday 19 March 2009 4:45:20 am

Hi Noicokuna,

Thank you for your response.

I have given the permission to create content with

Class: File, Gallery and Image
Section: Photo
Parent CLass: Indifferent
Depth: Indiferent
Language: Indifferent

Selected the Gallery class type nodes in the nodes list.

But this is also not working.

Could you tell me the permission setting details please.

Thanks

http://www.eyepax.com

Yannick Komotir

Thursday 19 March 2009 5:55:48 am

Hi,
can you verify that the choosen section is correct ?

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk

Jean-Yves Zinsou

Thursday 19 March 2009 1:54:30 pm

Hello,
I am not quite sure but make sure that your users have the ability to use the content functions needed (read, browse, etc...)

HTH

Jey

Do Androids Dream of Electric Sheep?
I dream of eZpubliSheep....
------------------------------------------------------------------------
http://www.alma.fr

D K

Thursday 19 March 2009 8:56:07 pm

Hi Jey,

Yes. Users has that permissions. Is there anything to check?

Thanks.

http://www.eyepax.com

justin kazadi

Friday 20 March 2009 1:13:29 am

Hi,
you talk about the front or back office?

if you talk about the front office ,
i think you have same things like this in your template

<form method=”post”
action={'/content/action'|ezurl}>
<input type="submit" name="NewButton"
value="image gallerie" />
<input type="hidden" name="ClassID"
value="your_desired_class_id" />
<input type="hidden" name="NodeID"
value="the_node_id_of_parent" />
</form>

verified that the NodeID

the_node_id_of_parent

and the childreen who will be created belong to the same section if it is not the case , then add to the member role the section of the NodeID.

add this permission to the "member" role

Section: of the NodeID

i think this can help you.
good luck

The theory is when we know everything and nothing works.
The practice is when everything works and nobody knows why.
If the practice and theory are met, nothing works and we do not know why.

Albert Einstein

D K

Monday 23 March 2009 2:05:41 am

Hi Justin,

I am talking about add images to the gallery in frontend.

I am using the code you provided. Also I have given the permission. But still not working. But if you logged in as a admin from frontend you can add images.

Following is the template used in the image upload

<form enctype="multipart/form-data" method="post" action={concat( "/content/edit/", $object.id, "/", $edit_version, "/", $edit_language|not|choose( concat( $edit_language, "/" ), '' ) )|ezurl}>

{include uri="design:content/edit_validation.tpl"}

<div class="block">
{attribute_edit_gui attribute_base=$attribute_base attribute=$object.data_map.name}
<input type="hidden" name="ContentObjectAttribute_id[]" value="{$object.data_map.name.id}" />
</div>

<div class="block">
{attribute_edit_gui attribute_base=$attribute_base attribute=$object.data_map.caption}
<input type="hidden" name="ContentObjectAttribute_id[]" value="{$object.data_map.caption.id}" />
</div>

<div class="block">
{attribute_edit_gui attribute_base=$attribute_base attribute=$object.data_map.image}
<input type="hidden" name="ContentObjectAttribute_id[]" value="{$object.data_map.image.id}" />
</div>

<div class="buttonblock">
<input type="hidden" name="MainNodeID" value="{$main_node_id }" />
<input type="hidden" name="DiscardConfirm" value="0" />
<input class="image" type="submit" name="PublishButton" value="{'Send for publishing'|i18n('design/ezwebin/edit/comment')}" />
<input class="image" type="submit" name="DiscardButton" value="{'Discard'|i18n('design/ezwebin/edit/comment')}" />
</div>

</form>

Please help.

THanks.

http://www.eyepax.com

Yannick Komotir

Monday 23 March 2009 8:57:48 am

verify that value VarDir's value in the site.ini of your siteaccess is right.

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk

D K

Monday 23 March 2009 9:15:42 pm

Yes it is correct.

[FileSettings]
VarDir=var/ezwebin_site

If I logged in as administrator I can add images for the gallery. That means same template describes above post.

But If I logged in as Member I cannot. I have setup permission for Member as follows.

content create Class( Image ) , Section( Photo ) , ParentClass( Gallery ) Modifier
content edit Class( Image ) , Section( Photo ) , Owner( Self ) Modifier
package create Type( Content object ) Modifier
package edit Type( Content object ) Modifier
user login SiteAccess( ezwebin_site_admin , admin , fre , ezwebin_site ) Modifier
content read Class( Image , Gallery ) , Section( Photo )

http://www.eyepax.com

Yannick Komotir

Tuesday 24 March 2009 2:00:27 am

Hi,

Go step by step for solving your problem.
First try with setup this permission
content create Class( Image ), all section, anywhere

instead of

content create Class( Image ) , Section( Photo ) , ParentClass( Gallery ) Modifier
check if it's right that someone in your deny is bad

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk

D K

Tuesday 24 March 2009 5:34:21 am

Hi,

Thank you for your support.

I checked the database contentobject table. Once I click on the "New Image" it creates the new content object in the table.

Then when you do the editing (CHeck following codes) it is not updated the created object.

Link to create new Image in the template
----------------------------------------------------------------
<form method="post" action={"content/action"|ezurl}>
<div class="buttonblock">
<input type="hidden" name="ClassIdentifier" value="image" />
<input type="hidden" name="NodeID" value="{$node.node_id}" />
<input class="button-new-image" type="submit" name="NewButton" value="Nouvelle image" />
</div>
</form>

Image edit template
--------------------------------
<form enctype="multipart/form-data" method="post" action={concat("/content/edit/",$object.id,"/",$edit_version,"/"
,$edit_language|not|choose(concat($edit_language,"/"),''))|ezurl}>

{include uri="design:content/edit_validation.tpl"}

<div class="block">
{attribute_edit_gui attribute_base=$attribute_base attribute=$object.data_map.name}
<input type="hidden" name="ContentObjectAttribute_id[]" value="{$object.data_map.name.id}" />
</div>

<div class="block">
{attribute_edit_gui attribute_base=$attribute_base attribute=$object.data_map.caption}
<input type="hidden" name="ContentObjectAttribute_id[]" value="{$object.data_map.caption.id}" />
</div>

<div class="block">
{attribute_edit_gui attribute_base=$attribute_base attribute=$object.data_map.image}
<input type="hidden" name="ContentObjectAttribute_id[]" value="{$object.data_map.image.id}" />
</div>

<div class="buttonblock">
<input type="hidden" name="MainNodeID" value="{$main_node_id }" />
<input type="hidden" name="DiscardConfirm" value="0" />
<input class="image" type="submit" name="PublishButton" value="{'Send for publishing'|i18n('design/ezwebin/edit/comment')}" />
<input class="image" type="submit" name="DiscardButton" value="{'Discard'|i18n('design/ezwebin/edit/comment')}" />
</div>

</form>

Please help!!

http://www.eyepax.com

Yannick Komotir

Tuesday 24 March 2009 7:15:55 am

Hi,

For now use the default edit template, your Image edit template have probably mistakes.

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk

D K

Tuesday 24 March 2009 10:37:54 pm

Hi,

I have done this. Still the same problem is there.

Also I have created new content for links. Same problem is there when allow users to add link content.

Please help!

http://www.eyepax.com