[TYPO3-dev] FE extension to create new pages
Jigal van Hemert
jigal.van.hemert at typo3.org
Sun May 27 13:18:57 CEST 2012
Hi,
On 27-5-2012 2:33, Michael wrote:
> I struggle with using the t3lib_TCEmain class in the FE and I suspect
> this is because of the missing BE_USER object. I assume I have to create
> an alternative userobject and I would be more than happy to see a
> working FE extension that creates pages (properly) and without a
> logged-in BE user :-)
Indeed, you can pass the start() method an alternative user object. It
can be as simple as:
$myBackendUser = t3lib_div::makeInstance('t3lib_userAuth');
$myBackendUser->user['uid'] = 0;
$myBackendUser->user['username'] = 'myExtBeUser'; // or use something to
reflect the FE user identity
$myBackendUser->user['admin'] = TRUE;
$myBackendUser->user['uc']['recursiveDelete'] = FALSE;
It's a bit ugly, but at least you can use the process_datamap() method
to properly create new records. If you include sensible data for the BE
user the log entries are also informative.
--
Jigal van Hemert
TYPO3 Core Team member
TYPO3 .... inspiring people to share!
Get involved: typo3.org
More information about the TYPO3-dev
mailing list