User group access and asign form submited data to user

maxslo 31 Jan, 2017
I have a form with some data to enter. This form should be accessible only for registered or specific user group.
When user is loged in, can see form and enter data. When submit, this data must be asigned/conected to that user.
So in received email i have user info (name and email) + form data. Same when I export form submited data with export function.
maxslo 31 Jan, 2017
Thank you, but this didnt help me😉
GreyHead 31 Jan, 2017
Hi maxslo,

You can use an Authenticator action from the Security actions group in the Setup tab to limit access to signed-in users or to a specific group or groups.

Please see this FAQ for saving and loading user related records.

Bob
maxslo 31 Jan, 2017
I try Authenticator action, but redirects me back to login, even if im loged in.

For loading user, will try.
maxslo 31 Jan, 2017
i have try this faq, but I dont get user data in email and in database only user id is there.
I need user name and email, both in email and database.
GreyHead 31 Jan, 2017
Hi Maxslo,

You have to set Public to 'allowed' in the Authenticator action. That setting applies to all users.

Please see this FAQ for getting more user information.

Bob
maxslo 31 Jan, 2017
Well, now I managed to set Authenticator action and works, but it seems that we have a bug in Joomla with login redirect. No mater what, Im redirected to profile page (then i can select form url from menu or direct).
Anyone have same problem?

For user data asign I use this FAQ
maxslo 07 Feb, 2017
I cant post new post on forum (white page), so I continue here.
I need to get data from user in email.

Im using custom block with code
<?php
$user =& JFactory::getUser();
$name = '';
$email = '';
$readonly = '';
if ( $user->id > 0 ) {
  $name = $user->name;
  $email = $user->email;
  $readonly = "readonly='readonly'";
}
?>
<div class="ccms_form_element cfdiv_text" id="name_container_div" style="">
  <label for="name" class="control-label">Ime</label>
  <input id="name" maxlength="150" size="30" class="form-control" 
    title="" value=" <?php echo $name; ?> " name="name" 
    type="text" <?php echo $readonly; ?> />
  <div class="clear"></div>
  <div id="error-message-name"></div>
</div>
<div class="ccms_form_element cfdiv_text" id="email_container_div" style="">
  <label for="email" class="control-label">Email</label>
  <input id="email" maxlength="150" size="30" class="form-control" 
    title="" value=" <?php echo $email; ?> " name="email" 
    type="text" <?php echo $readonly; ?> />
  <div class="clear"></div>
  <div id="error-message-email"></div>
</div>


to colect loged in user name and email.

In form setup I use db read and db save



In html email template I have

<table>
<tr><td>Uporabnik</td><td>{custom}</td></tr>
<tr><td>....


When mail delivered, I only see Uporabnik and no data for user ({custom}).

How to get user data in mail.

In DB i get corect data for user (data listing-record view).
GreyHead 07 Feb, 2017
Hi maxslo,

Please see this FAQ

Note a Custom Code action does not create a form variable called 'custom' so {custom} in your email will always be blank.

Bob
maxslo 07 Feb, 2017
Thank you.
I dont realy understand what to do next. So how to get user data in email?
GreyHead 07 Feb, 2017
Hi maxslo,

From the FAQ:

To use this information in another action e.g. an email, you need to add it to the ChronoForms $form->data array. For example to add the user email:
$form->data['user_email'] = $user->email;

You can then add user_email into one of the Email action Dynamic Email Address boxes, or use {user_email} in the Email template.

Bob
This topic is locked and no more replies can be posted.