• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Access rights and prefilled fields

Access rights and prefilled fields 17 years 1 month ago #2305

  • gvag
  • gvag's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Hello everyone,

Yesterday i downloaded the trial version of RS and i find it pretty good.
Before buying a license I would like your help about a couple of issues.

First I want the form to be available only to registered users. Does anyone know how can I restrict public access? (making the menu link available to registered user is one solution but guest can still access the url if they type it for example)

The second is that I want to have a field in my form that automatically get the logged in users username and make this field unwriteable. I have found some posts about getting this info but nothing about restricting users from editing it. Any idea?

Finally, I want a script that restricts users who have allready submitted the form not to be able to submit it again.

thanks<br><br>Post edited by: gvag, at: 2008/03/07 11:51
The administrator has disabled public write access.

Re:Access rights and prefilled fields 17 years 1 month ago #2308

  • gvag
  • gvag's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
i found the solution for the second issue. 2 more to go...........
The administrator has disabled public write access.

Re:Access rights and prefilled fields 17 years 1 month ago #2507

I would like to know the answers to these questions 2. This is exactly what I need as well.

What was the solution for #2? I set the type to \"feetext\" instead of \"text\" and that made it work. However, since I'm a newbie, I just wonder if that's the right solution.

Thx!

Carlos
The administrator has disabled public write access.

Re:Access rights and prefilled fields 17 years 1 month ago #2508

I would like to know the answers to these questions 2. This is exactly what I need as well.

What was the solution for #2? I set the type to \"feetext\" instead of \"text\" and that made it work. However, since I'm a newbie, I just wonder if that's the right solution.

Thx!

Carlos
The administrator has disabled public write access.

Re:Access rights and prefilled fields 17 years 1 month ago #2509

  • gvag
  • gvag's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
code to be added at Script called on form display

/ * this code redirects users who have already submitted the form to the specified Location (content item)*/
$my = & JFactory::getUser();
$result = mysql_query(\"SELECT uid FROM jos_forme_data WHERE uid = $my->id and form_id = 3\");
$num_rows = mysql_num_rows($result);

if ($num_rows > 0)
header( 'Location: index.php?option=com_content&view=article&id=21' ) ;
else
/*this code get the user details you like id and mail in my case. You have to create some form fields in order to place this info in the form*/
if($my->id){
foreach($fields as $i=>$field){
if($field->name=='Userid') $fields[$i]->default_value = $my->id; //Assuming your rsform text field is called \"Userid\"
if($field->name=='Usermail') $fields[$i]->default_value = $my->email;
if($field->name=='Name') $fields[$i]->default_value = $my->name;
}
}
/*this code redirect unregistered user to a specified Location (content item) thus preventing them to see the form*/
else
header( 'Location: index.php?option=com_content&view=article&id=20' ) ;
The administrator has disabled public write access.

Re:Access rights and prefilled fields 17 years 1 month ago #2604

Thanks so much for posting your code!! It works great for me except for the line \"JFactory::getUser();\" which threw an error. I guess this is made for Joomla 1.5 and I have 1.0.15.
After replacing that line with \"global $my;\", everything worked like a charm!

I still need to figure out how to make the field username and email read-only (unwritable). If I set their type to \"free text\", when pressing the \"Submit\" button, the page never goes to the Thank You page and it doesn't send an email either.

Would anyone know how can I make it work?

Thanks!

Carlos
The administrator has disabled public write access.

Re:Access rights and prefilled fields 17 years 1 month ago #2607

to solve the problem re access rights you could use the mosforme mambot (included when you purchase the licence) and embed the form into content that is restricted to registered members.
The administrator has disabled public write access.

Re:Access rights and prefilled fields 17 years 1 month ago #2625

Hello all,

To have some \"read-only\" fields, simply edit the field you want and in its \"additional attributes\" type: readonly

Thanks Alex for this super easy solution! :)

Regards,

Carlos
The administrator has disabled public write access.

Re:Access rights and prefilled fields 16 years 11 months ago #3048

  • oellison
  • oellison's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Regarding restricting user access - previous version of RSForm had it.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!