Create user directory on registration

3 months 5 days ago #316920 by 3cellhosting
Hello Team,

In order to solve a problem I need to create a directory for every user that registers on a client's site.

I was thinking that I would have to use CB Auto Actions. Having tried to work it out I am still lost and cold use some pointing in the right direction.

I am guessing I need trigger onAfterUserRegistration but after that I can see no way to create a directory.

Any advise please?

David

David
www.3cellhosting.com - where personality, creativity and integrity come as standard.
3 months 4 days ago #316937 by krileon
Is a userlist not sufficient for this? You can create userlists within CB > List Management.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM EST to 4:00 PM EST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
3 months 4 days ago #316948 by 3cellhosting
Hi Kyle,

I don't think so unless I have missed something.

User registration has to be apporved as it is website with training events for NHS staff within a set geographical area. Once they book a course they will only get their certification after they send their feedback form. The form generates a pdf file and I want to save the form in their own directory.

These files can then be shown in their profile in case they need to reproduce them or send them for a reference.

At the moment I can name the file using their id and full name but they all sit in one folder which I would rather not have.

Does that make more sense?

Thanks
David

David
www.3cellhosting.com - where personality, creativity and integrity come as standard.
3 months 4 days ago #316951 by krileon
CB Gallery supports file based uploads so you could just upload the PDF to their profile. If it's 1 PDF per user then a File field would also work.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM EST to 4:00 PM EST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
3 months 16 hours ago #317038 by 3cellhosting
Hi Kyle,

I had already loaded Gallery and have had a little play. Once I uploaded a file I could see the directory structure and that was fine. I now need to work out how best to create the "upload" to get the new directories.

The software creating the form allows post-submission script process so I guess I just need to write some code to check if the user already has a directory, if yes then add the file. If no, create the directory and add the file.

Ideally I want to create the directory on registration then I don't have to check if the diredtory exists, just load the file to the directory.

Unless CB has a hidden method I haven't yet played with ;)

Regards

David

David
www.3cellhosting.com - where personality, creativity and integrity come as standard.
3 months 14 hours ago #317041 by krileon
Since you're trying to insert gallery entries programmactically I suppose the best way is to first move the file to the appropriate location, which would be the below.

/images/comprofiler/plug_cbgallery/USER_ID/files

Then generate the database entry. Easiest way to get the database structure right is to first upload a file to a profile so you can see how it's written in the database. It maybe even easier to just use a file field if users are only supposed end up with 1 file. This way you'd just upload to the below folder.

/images/comprofiler/\plug_cbfilefield/USER_ID

Then set the filename in the fields column in _comprofiler.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM EST to 4:00 PM EST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Moderators: beatnantkrileon
Time to create page: 0.401 seconds

Facebook Twitter LinkedIn