On our site we have forms that any anonymous user can submit, like quote requests. We use FormIt and it works great for sending emails. I toyed with the idea of creating resources to leave a db trail of the submission - the resourses later could be presented to admins & staff.
I created a hook for formit, all is fine, I can set the template, TVs, create the doc etc. except an anonymous user cannot create a resource (so this only works if a webuser is logged in).
1. I tried to trick the ACL into letting anonymous create resources in this resource group. Seems like anonymous cannot assigned any role. Is this true? Any way around this?
2. Is there an easy way to temporarily log a user in, create the resource, then panic and logout?
Thanks
what's the code of your hook?
While it should be possible to create Resources for everybody, I think, that isn't a very good idea.
Can't you create a custom-table for quote-requests?
-
☆ A M B ☆
- 24,524 Posts
That really isn't a good idea. You don't need all the overhead of a resource to keep track of form submissions. You can easily use a custom table, and use MIGxDB to create a Custom Manager Page for it. Resources are for content, not storage.
you can use something like formit2db or I think there was a hook in the extras, which stores formsubmissions into a custom-table.
with MIGXdb its easy to create your package,schema... and has all what you need to create a CMP to manage the submited records.
S & B,
thanks for the pointers, of course you're right about separating content from user submitted data. I'll definitely check these out.
You could create a bogus user and store the information in an extended field of the user profile (or -- faster -- in the regular fields of the profile) , though a custom DB table would be much faster yet and I think MIGx would be too.
You could also just create a file or use a big cookie.
I agree that letting anonymous users create resources is begging for trouble.
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html