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

eZ debug

Timing: Jan 18 2025 11:36:32
Script start
Timing: Jan 18 2025 11:36:32
Module start 'content'
Timing: Jan 18 2025 11:36:33
Module end 'content'
Timing: Jan 18 2025 11:36:33
Script end

Main resources:

Total runtime1.0886 sec
Peak memory usage4,096.0000 KB
Database Queries233

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 589.2734180.8125
Module start 'content' 0.00630.9356 770.0859817.6406
Module end 'content' 0.94190.1467 1,587.7266357.3047
Script end 1.0886  1,945.0313 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.3795210.0002
Check MTime0.00160.1463210.0001
Mysql Total
Database connection0.00080.070610.0008
Mysqli_queries0.960388.20782330.0041
Looping result0.00290.26522310.0000
Template Total1.054596.920.5273
Template load0.00230.215620.0012
Template processing1.052296.649920.5261
Template load and register function0.00020.019110.0002
states
state_id_array0.00220.202610.0022
state_identifier_array0.00230.208120.0011
Override
Cache load0.00290.26761510.0000
Sytem overhead
Fetch class attribute can translate value0.00190.174960.0003
Fetch class attribute name0.00130.1230170.0001
XML
Image XML parsing0.00210.194260.0004
class_abstraction
Instantiating content class attribute0.00000.0035200.0000
General
dbfile0.00210.1956390.0001
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
14content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
33content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
20content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
6content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 78
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs