[TYPO3-dev] Hook initfeuser and realurl
Carsten Bleicker
bleicker at boros.de
Thu Oct 18 16:52:43 CEST 2007
Dmitry Dulepov [typo3] schrieb:
> Carsten Bleicker wrote:
>> -- snip // hook for initfeuser --
>> $req =& new HTTP_Request("http://myserver.com:80/");
>> $req->setMethod(HTTP_REQUEST_METHOD_POST);
>> $req->addPostData("fName", $xml, true);
>>
>> debug($xml);
>>
>> $sendRequest = $req->sendRequest();
>> -- /snip --
>>
>> index_ts.php now make an instance of tslib_fe and init the fe_user.
>> so, my debug output is shown on the page. after that, the
>> pagerendering process starts normaly.
>> during pagerendering the sendRequest inits again and again and again.
>> but no debug! im nuts???
>
> I am not sure what your code means. Can you explain?
>
Hi Dmitry, thanks for support!!!
i will try to explain a little bit more by comments, okay?
The Hook Object wich is calles in tslib_fe::initFEuser()
Object is called in ext_localconf with:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['initFEuser'][] = 'EXT:vga_feuserhook/class.tslib_fe.php:user_tslib_fe->initFEuser';
class user_tslib_fe{
...
function initFEuser(&content,&conf){
// Instance of PEAR Objekt to send HTTP Request
$req =& new HTTP_Request("http://myserver.com:80/");
// Send with POST
$req->setMethod(HTTP_REQUEST_METHOD_POST);
// Send these post data
$req->addPostData("fName", $xml, true);
debug($xml);
// Sends the http request and returns XML code wich i merge into $GLOBALS["TSFE"]->fe_user->user
$sendRequest = $req->sendRequest();
// getting response body xml
$userxml = $req->getResponseBody();
// create array out of xml
$userdata = t3lib_div::xml2array($userxml);
// merge userdata of external db into $GLOBALS["TSFE"]->fe_user->user
$content["pObj"]->fe_user->user = t3lib_div::array_merge_recursive_overrule($content["pObj"]->fe_user->user,$ais_user);
}
}
More information about the TYPO3-dev
mailing list