Share » Forums » Developer » eZUser::currentUser() returns anonymous

eZUser::currentUser() returns anonymous

eZUser::currentUser() returns anonymous

Saturday 17 July 2010 12:02:37 pm - 1 reply

Modified on Saturday 17 July 2010 1:59:21 pm by Stéphane Le Merre

Author Message

Stéphane Le Merre

Saturday 17 July 2010 4:05:58 pm

I found out how to solve this, the checkout->after workflow is call by the bank script with no session in it, that's why eZUser::currentUser() returns anonymous. Quiet stupid question but i'm tired :)

Maybe solution can help, so i get the user from the order_id :

function execute( $process, $event )
 {
     $bResult = false;
     $s = new PremiumSubscription();
        
     $processParams  = $process->attribute( 'parameter_list' );
     $orderID        = $processParams['order_id'];
     $order          = eZOrder::fetch( $orderID );
     $currentUser    = $order->user();
     $userId         = $currentUser->id();

     //...
}

Regards,
Stéphane.

http://www.ligams.com

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu