[TYPO3-mvc] tx_sv_authbase Authentication Service and ExtBase - TS Configuration Problems

Claus Due claus at wildside.dk
Tue Dec 27 14:27:53 CET 2011


Hi Alex,

Take a look at the Sysutils extension, it uses CommandControllers exclusively. Also you might like FED 1.4.8 which integrates these controllers with Scheduler. The Commands are executed from Tx_Fed_Scheduler_Task.

To gather the output you must read it from your Response. To simply make it output to shell when the command executes you don't need any extra processing, just use $this->response->appendContent($str) to send output to the console.

About the storagePid issue - you should check that http://forge.typo3.org/issues/28857 and http://forge.typo3.org/issues/28828 are not in play. Since there is no concept of "current page uid" when running CommandControllers you must make sure that your TS is set or included from a root TS template and that there is only one root template.

Perhaps you can debug $this->configurationManager->getConfiguration(Tx_Extbase_Configuration_CommandManagerInterface::TYPE_FULL_TYPOSCRIPT); from your Controller to see of the TS is accessible?

Cheers,
Claus

On Dec 27, 2011, at 10:36 AM, Alexander heim wrote:

> Hmmm. I tried
> 
>    $dispatcher->dispatch($request, $response);
> or
>    $this->myCommandControllerObject->processRequest($request,$response);
> 
> my function is called. Thats fine. But it does not solve my main problem at all. "newRecordStoragePid" is still completly ignored.
> 
> 
> Alex
> 
> 
> 
> 
> 
> Am 27.12.2011 09:14, schrieb Alexander heim:
>> Hi Claus,
>> 
>> sorry for my late answer.
>> I wrote a CommandController what extends Tx_Extbase_MVC_Controller_CommandController. It has the two functions for getting a user and authenticate the user. Nothing special. But I could not find any additional positive aspect with it. So I used $this->objectManager->get('Tx_Myextension_Command_MyCommandController') to get the controller. I did not initialized anything special before. But it seems like, that I should do this. Or how should the CommandController be used? Do I need to use a dispatcher? If yes, I would think to use it this way ... but somehow I have the feeling, it is wrong:
>> 
>>        $request = $this->objectManager->get('Tx_Extbase_MVC_CLI_Request');
>>        $dispatcher = $this->objectManager->get('Tx_Extbase_MVC_Dispatcher');
>>        $response = $this->objectManager->get('Tx_Extbase_MVC_CLI_Response');
>>        $request->setControllerObjectName('TxCommand_Myextension__MyextensionCommandController');
>>        $request->setControllerCommandName('getOrCreateFeUserAndGetFeUserId');
>>        $request->setArguments(array("login"=>$this->login['uname']));
>>        $dispatcher->dispatch($request, $response);
>> 
>> I also saw, that there are two public functions "canProcessRequest()" and "processRequest()". Would it be better to use them? Is Extbase intialized right at this point and is able to get the informations from TypoScript? So like:
>> 
>> 
>>        module.tx_Myextension.persistence.storagePid = 9
>>        module.tx_Myextension.persistence.newRecordStoragePid = 9
>> 
>> The Function "getOrCreateFeUserAndGetFeUserId" is a function from "TxCommand_Myextension__MyextensionCommandController" and returns false or the ID of the Frontend User of the given login.
>> 
>> If I use dispatch or processRequest ... where is the result of the called function stored? Should I use "output()" inside the command controller to return the result?
>> 
>> I know, a lot of questions, but I tried to search around inside the scheduler, but could not find a way to adapt it to my needs. I do not need the scheduler at this point or want to have access to the function from commandline. I just hope, this could be a good workaround, to make the functions available to the classical auth service.
>> 
>> 
>> Big thank you for your help
>> Alex
>> 
>> 
>> 
>> _______________________________________________
>> TYPO3-project-typo3v4mvc mailing list
>> TYPO3-project-typo3v4mvc at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
> 
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc



More information about the TYPO3-project-typo3v4mvc mailing list