Change single setting in FEU

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
rotezecke
Power Poster
Power Poster
Posts: 411
Joined: Fri Apr 18, 2008 9:34 pm
Location: Nimbin, Australia

Change single setting in FEU

Post by rotezecke »

Hi, I'm trying to use FEU to keep records of employees. e.g. working at height ticket expiry dates, first aid expiry date, etc.
most of this is entered/update via back end.
Now, some settings I want to change via front-end "change settings", e.g. "I have read this document and agree to it."
my page template

Code: Select all

{if feu_smarty::is_user_memberof('Staff')}<p>Blah Blah, or link to document ...</p>{/if}
{FrontEndUsers action="changesettings" changesettingstemplate='feu_change_single_field.tpl' my_field='agree_with_doc_1'}
and the actual changesettings template is very close to the default, except this little addition at the beginning of the foreach loop:

Code: Select all

{if $field->name != $actionparams['my_field']}<input type="hidden" name="{$field->input_name}" value="{$field->value}"/>{continue}{/if}
this works fine. except, i get redirected to the default "change settings" page, where ALL settings, including username and password are displayed and changeable.
But: I do NOT want my users to change passwords or settings that I do not allow them to change. How can I prevent that redirect? i tried the code from the help section:
{if !empty($final_message)}
{cms_selflink href='members' assign='members_page_url'}
{redirect_url to=$members_page_url}
{else}
inside my custom template, but it does not work.
User avatar
rotezecke
Power Poster
Power Poster
Posts: 411
Joined: Fri Apr 18, 2008 9:34 pm
Location: Nimbin, Australia

Re: Change single setting in FEU

Post by rotezecke »

I since found a bug report that sounds related, but CG marked as 'works for me'.
http://dev.cmsmadesimple.org/bug/view/12268
i think the chance settings script runs twice, first time using the default orig_changesettings template, and second time my custom template.
When I changed the reference to the orig_changesettings template to my custom template (in action script), the results are as expected (even though script still runs twice i think).
Can anyone confirm this behaviour or found a workaround that does not involve modifying module files?
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Change single setting in FEU

Post by velden »

Perhaps you should cms_module_hint for the specific page to tell FEU to use the changesettingstemplate all the time (also after the redirect)

Note I didn't test it, just looked at the code.
User avatar
rotezecke
Power Poster
Power Poster
Posts: 411
Joined: Fri Apr 18, 2008 9:34 pm
Location: Nimbin, Australia

Re: Change single setting in FEU

Post by rotezecke »

i tried

Code: Select all

{cms_module_hint module=FrontEndUsers changesettingstemplate='feu_change_single_field.tpl'}
in "Smarty data or logic that is specific to this page" with no luck.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Change single setting in FEU

Post by velden »

Just to be sure: you also have the process_pagedata tag in the PAGE TEMPLATE of the page you added the cms_module_hint?

https://docs.cmsmadesimple.org/tags/cms ... s_pagedata

If that's not it I wouldn't know what is going on. I don't have a local install with FEU to debug this.
User avatar
rotezecke
Power Poster
Power Poster
Posts: 411
Joined: Fri Apr 18, 2008 9:34 pm
Location: Nimbin, Australia

Re: Change single setting in FEU

Post by rotezecke »

Yes, process_pagedata is called before assigning first content block. I use the "Smarty data or logic that is specific to this page" section on many other pages and it works fine.
I since reported this as bug (maybe prematurely) . But I managed to work around it with a small modification to core module file.
http://dev.cmsmadesimple.org/bug/view/12343
Post Reply

Return to “Modules/Add-Ons”