[TYPO3-dev] init be user in fe for use off tce
media.res | alex widschwendter
a.widschwendter at mediares.at
Mon Feb 12 15:29:30 CET 2007
hi,
i'm trying to initialize a be user in fe context to use tce for
creating, copy,... some some pages around. what did i miss?
$new_BE_USER = t3lib_div::makeInstance("t3lib_beUserAuth"); // New
backend user object
$new_BE_USER->OS = TYPO3_OS;
$new_BE_USER->setBeUserByUid(3);
$new_BE_USER->fetchGroupData();
$new_BE_USER->user["admin"]=1;
// $new_BE_USER->createUserSession($new_BE_USER);
$tce = t3lib_div::makeInstance('t3lib_TCEmain');
$tce->stripslashes_values = 0;
$data['pages'][$this->createNewPageId()] = array(
"title" => "The page title",
"subtitle" => "Other title stuff",
"pid" => "1017"
);
$tce->start($data,array(),$new_BE_USER);
$tce->process_datamap();
but this just works if im "really" logged in as an be user (must not be
beuser with id 3)
tia
alex
More information about the TYPO3-dev
mailing list