Forums / Setup & design / Payal Returns to kernel (1) error
Michael Dowdell
Wednesday 14 September 2005 10:16:17 am
When returning to the Site from a PayPal purchase, I receive the following error. I assume this is a problem with checkout as /shop/userregister does not create or enforce creating a user. Is this a bug or my misconfiguration? Please advise.
<b>kernel(1) error.
Returning URL = http://myurl/index.php/shop/orderview/6
Access deniedYou don't have permission to access this area.
Possible reasons for this are:
You are currently not logged in to the site, to get proper access create a new user or login with an existing user. You misspelled some parts of your URL, try changing it. </b>
Wednesday 14 September 2005 5:07:14 pm
UPDATE: This screen with the above error also contains the login fields. When I logged in as an existing known user (not related to the purchase) the purchase confirmation screen displayed as it was supposed to display to the purchasing user (kind of an information breach). Tailoring the orderview in the url allowed access to all purchaser information. It looks as if this is an error in the checkout flow which needs to have the purchaser go to registration/login first, then restrict pages based upon the userid. I'm new to eZ's admin interface, having trouble setting up a workflow to accomplish this programaticly and the documentation isn't giving me much in the line of guidance. I'm fine with the coding, any insight would be helpfull on the sub structure to enable it in the UI.
Thursday 15 September 2005 1:21:38 pm
For others that may come accross this problem. Adding an Else statement to the existing user check function as shown below will redirect a user who is not logged in to the login page and return them once logged in. An unregistered user who registers will lose the purchase flow but a few descriptive links in the /kernel/user/active.php can bring them back to userregister.php to continue.
line 56: /kernel/shop/userregister.php
if ( $user->isLoggedIn() ) { $userObject = $user->attribute( 'contentobject' ); $userMap = $userObject->dataMap(); $firstName = $userMap['first_name']->content(); $lastName = $userMap['last_name']->content(); $email = $user->attribute( 'email' ); }else{ $module->redirectTo( '/user/login/' ); }