[TYPO3-dev] TSFE->fe_user confusion
Koen vn
nospam at aa.bb
Wed Apr 5 03:51:05 CEST 2006
Good night.
I tried to send 3 hidden fields with the Typo3 mail form.
Current User his name, email and id.
So I wrote some php code and included this functions in the Template Setup.
Every user has to log in to enter the site.
It looked like it worked well, but sometimes it gives strange results.
Then it appears like an other users data is sended with the mail form.
We could reproduce the problem, so we are sure it occured.
Now I've set the no cache checkbox on true in the page header of the mail
form page.
Afterworth I couldn't reproduce the problem, but I doubt this is the right
solution.
If anybody has an idea if this is the right solution, or has the right
solution,
it would be very kind to share it with me and the rest of the community.
:-))))
Thanks a lot for reading this post anyway!!!
Kind regards,
Koen Van Nuffelen
The php code.
<?php
class user_gate74_tools{
var $cObj;
function getUserEmail($content,$conf){
global $TSFE;
$out = $TSFE->fe_user->user['email'];
return $out;
}
function getUserName($content,$conf){
global $TSFE;
$out = $TSFE->fe_user->user['name'];
return $out;
}
function getUserKey_id($content,$conf){
global $TSFE;
//$out = $GLOBALS["TSFE"]->fe_user->getKey("user","id");
$out = $TSFE->fe_user->user['uid'];
return $out;
}
}
?>
The included functions in the Template Setup:
tt_content.mailform.20.hiddenFields.hidden_fe_username = USER
tt_content.mailform.20.hiddenFields.hidden_fe_username.userFunc=user_gate74_
tools->getUserName
tt_content.mailform.20.hiddenFields.hidden_user_email = USER
tt_content.mailform.20.hiddenFields.hidden_user_email.userFunc=user_gate74_t
ools->getUserEmail
tt_content.mailform.20.hiddenFields.hidden_user_key_id = USER
tt_content.mailform.20.hiddenFields.hidden_user_key_id.userFunc=user_gate74_
tools->getUserKey_id
(TYPO3 Ver. 3.8.0)
More information about the TYPO3-dev
mailing list