[TYPO3-project-formidable] HOWTO get the cruser_id, .

François SCHOSSIG fs.nospam1 at a-e-r.org
Fri Nov 10 10:03:50 CET 2006


Jeremy,

There is another way for dealing with the modifications to be done  
before saving or submitting a form. Perhaps you already know this as  
your question is an old question! But this gives the possibility to  
have the answer somewhere in this forum.
You can do the next thing :
   <control>
     <datahandler:DB>
       <tablename>fe_users</tablename>
       <keyname>uid</keyname>
       <labelname>username</labelname>
       <process>
         <beforeinsertion>
           <userobj>
             <php><![CDATA[
               $aParams = func_get_args();
               $aData = $aParams[1];

               $aData["tstamp"] = time();
               $aData["crdate"] = time();
               $aData["disable"] = 1;
               $aData["password"] = $this->_oParent->oAERoutils- 
 >aer_generatePassword();
               $aData["tx_aerfeuser_intlcode_phone"] = $this- 
 >_oParent->aer_nettoieIntlCode($aData["tx_aerfeuser_intlcode_phone"]);

               return $aData;
             ]]></php>
           </userobj>
         </beforeinsertion>
       </process>
     </datahandler:DB>

     ../..

   </control>
--
F. SCHOSSIG, ICT Manager
Assemblée des Régions d'Europe
http://www.a-e-r.org

Le 21 sept. 06 à 19:52, Jerome Schneider a écrit :

> Hi Jeremy,
>
> If you're using the pre-v0.6 formidable, you can't use anymore the
> "defaultvalue" property on a PASSTHRU.
>
> We had to change this because it makes no sense to use a  
> defaultvalue on a
> field that users can't modify, and we had a lot of problems trying to
> implement this.
>
> Try to use "value" instead, this should fix the problem.
>
> If you need a value that has to be hidden, but still modifiable at  
> runtime
> by the user, you should rather use the renderlet:HIDDEN, because it  
> can
> manage value & defaultvalue.
>
>
> The PASSTRHU's job is just to inject data into the datahandler at  
> runtime,
> and has nothing to do with the form itselves ( really useful, for  
> instance,
> for injecting cruser_id, pid, tstamp, crdate, ... in your database ).
>
> If, for security reasons, you still preafer that the hidden value  
> doesn't
> transit at all in the form HTML, you implement something like this :
> (i also included this code into a flie joint to this mail )
>
> <renderlet:LINK>
>   <label>Click me if you want to change the passthru value</label>
>   <onclick runat="server"when="after-init-datahandler">
>     <userobj>
>       <php><![CDATA[
>         $this->aORenderlets["mypassthrurdt"]->setValue(
>           "SOMETHING ELSE"    // passthru 'mypassthrurdt'
>           );  // value changed at runtime if user clicks on the link
>       ]]></php>
>     </userobj>
>   </onclick>
> </renderlet:LINK>
>
> <renderlet:PASSTHRU name="mypassthrurdt" value="SOMETHING" />
>
> Hope this helps ;)
>
> "JÈrÈmy Lecour" <jeremy.lecour at gmail.com> a Ècrit dans le message  
> de news:
> mailman.9699.1158855653.6429.typo3-project- 
> formidable at lists.netfielders.de...
> Hi
>
> I have a form with some PASSTHRU fields at the end, like this one :
> <renderlet:PASSTHRU name="cruser_id">
> <data>
> <defaultvalue>CURRENT_USERID</defaultvalue>
> </data>
> </renderlet:PASSTHRU>
>
> I'm making an ACTIONLET that has to deal with form data after it is
> submitted. I'm able to catch the form data with "$aData =
> $this->oForm->oDataHandler->_getFormData();" but the PASSTHRU fields
> are empty at this step of the process.
>
> Maybe I'm missing something or even I'm wrong using an ACTIONLET for
> this job but would rather using a DATAHANDLER. The purpose is to
> update the "fe_user" record that is filling the form.
>
> Thanks for any tip.
>
> -- 
> JÈrÈmy Lecour : <mailto:jeremy.lecour at gmail.com>
> webdesigner, webmaster et dÈveloppeur web
> TrÈsorier du PLUG : Provence Linux User Group
> http://www.plugfr.org



More information about the TYPO3-project-formidable mailing list