Page 1 of 1

HTTPS in module API [solved]

Posted: Mon Mar 30, 2009 4:07 am
by milehigh
I don't see anything in the API docs but I wanted to check here to be sure. Is there anything in the module API that can change the output of $this->CreateFormStart($id,'default',$returnid,'post','multipart/form-data');

from this:



to this:




I created a
CreateSecureFormStart($id, $action='default', $returnid='', $method='post', $enctype='', $inline=false, $idsuffix='', $params = array(), $extra='')
and included it within my module (so i can still use the default core install). It swaps the default action with an https: action.

Re: HTTPS in module API [solved]

Posted: Tue Mar 31, 2009 9:25 pm
by alby
milehigh wrote: I don't see anything in the API docs but I wanted to check here to be sure. Is there anything in the module API that can change the output of $this->CreateFormStart($id,'default',$returnid,'post','multipart/form-data');
Which CMSMS version?
For me CreateFormStart() in 1.5.3 create a correct action in form tag

Alby

Re: HTTPS in module API [solved]

Posted: Wed Apr 01, 2009 6:29 am
by milehigh
There is one instance in the site where I need the form action to go from http to https so I simply just added a CreateSECUREFormStart function in my module which basically is a carbon copy of the CreateFormStart function but swapping out the _curPageURL with a function that forces https://

If you are already on https CreateFormStart keeps you on https and all works perfectly. But if you are on http: I didn't see away to change the 'action' from http to https. I needed to gather some basic info, post that to an https and then gather the rest of the info encrypted from there.

I probably made it harder than it needed to be but its working as I need it to now.