You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Madhi Krishnan <ma...@udyogmandir.in> on 2018/12/14 13:23:47 UTC

How to divert createCustomer success request to login page

Hey everyone..
I have noticed that when user register himself with a new account and click
save..the request goes to the createCustomer request.
and than he get logged in and get diverted to the main page...
so what i'm trying to do is that he should not redirect to the main page
rather than he should be redirected  to the login page...and than he should
enter his username and password and than get logged in.
I have tried to change the the success request to login it didn't work
Any suggestions, tips?

Regards,
Madhi Krishnan

Re: How to divert createCustomer success request to login page

Posted by Madhi Krishnan <ma...@udyogmandir.in>.
hai jason..
What if i want him to divert to some other custom screen?

On Sat, Dec 15, 2018 at 1:25 AM Madhi Krishnan <
madhi.krishnan@udyogmandir.in> wrote:

> Hai jason
> Thank you for you time...
> That worked for me..
>
>
>
>
> On Fri, Dec 14, 2018 at 8:39 PM Jason RJ <ja...@reast.net> wrote:
>
>> Hi Madhi,
>>
>> If you are doing this from the ecommerce module, take a look at
>> ecommerce\script\org\ofbiz\ecommerce\customer\CustomerEvents.xml inside the
>> createCustomer simple-method there is this logic:
>>
>>         <if-compare field="allowPassword" operator="equals" value="Y">
>>             <call-bsh><![CDATA[
>>
>> org.ofbiz.webapp.control.LoginWorker.doBasicLogin(createdUserLogin,
>> request);
>>
>> org.ofbiz.webapp.control.LoginWorker.autoLoginSet(request, response);
>>                 session = request.getSession();
>>                 cart = session.getAttribute("shoppingCart");
>>                 if (cart != null) {
>>                     cart.setOrderPartyId(tempMap.get("partyId"));
>>                 }
>>             ]]></call-bsh>
>>         </if-compare>
>>
>> Removing that should help.
>>
>> Jason
>>
>>
>> On 14/12/2018 13:23, Madhi Krishnan wrote:
>>
>> Hey everyone..
>> I have noticed that when user register himself with a new account and
>> click
>> save..the request goes to the createCustomer request.
>> and than he get logged in and get diverted to the main page...
>> so what i'm trying to do is that he should not redirect to the main page
>> rather than he should be redirected  to the login page...and than he
>> should
>> enter his username and password and than get logged in.
>> I have tried to change the the success request to login it didn't work
>> Any suggestions, tips?
>>
>> Regards,
>> Madhi Krishnan
>>
>>
>>

Re: How to divert createCustomer success request to login page

Posted by Madhi Krishnan <ma...@udyogmandir.in>.
Hai jason
Thank you for you time...
That worked for me..




On Fri, Dec 14, 2018 at 8:39 PM Jason RJ <ja...@reast.net> wrote:

> Hi Madhi,
>
> If you are doing this from the ecommerce module, take a look at
> ecommerce\script\org\ofbiz\ecommerce\customer\CustomerEvents.xml inside the
> createCustomer simple-method there is this logic:
>
>         <if-compare field="allowPassword" operator="equals" value="Y">
>             <call-bsh><![CDATA[
>
> org.ofbiz.webapp.control.LoginWorker.doBasicLogin(createdUserLogin,
> request);
>                 org.ofbiz.webapp.control.LoginWorker.autoLoginSet(request,
> response);
>                 session = request.getSession();
>                 cart = session.getAttribute("shoppingCart");
>                 if (cart != null) {
>                     cart.setOrderPartyId(tempMap.get("partyId"));
>                 }
>             ]]></call-bsh>
>         </if-compare>
>
> Removing that should help.
>
> Jason
>
>
> On 14/12/2018 13:23, Madhi Krishnan wrote:
>
> Hey everyone..
> I have noticed that when user register himself with a new account and click
> save..the request goes to the createCustomer request.
> and than he get logged in and get diverted to the main page...
> so what i'm trying to do is that he should not redirect to the main page
> rather than he should be redirected  to the login page...and than he should
> enter his username and password and than get logged in.
> I have tried to change the the success request to login it didn't work
> Any suggestions, tips?
>
> Regards,
> Madhi Krishnan
>
>
>

Re: How to divert createCustomer success request to login page

Posted by Jason RJ <ja...@reast.net>.
Hi Madhi,

If you are doing this from the ecommerce module, take a look at ecommerce\script\org\ofbiz\ecommerce\customer\CustomerEvents.xml inside the createCustomer simple-method there is this logic:

        <if-compare field="allowPassword" operator="equals" value="Y">
            <call-bsh><![CDATA[
                org.ofbiz.webapp.control.LoginWorker.doBasicLogin(createdUserLogin, request);
                org.ofbiz.webapp.control.LoginWorker.autoLoginSet(request, response);
                session = request.getSession();
                cart = session.getAttribute("shoppingCart");
                if (cart != null) {
                    cart.setOrderPartyId(tempMap.get("partyId"));
                }
            ]]></call-bsh>
        </if-compare>

Removing that should help.

Jason


On 14/12/2018 13:23, Madhi Krishnan wrote:

Hey everyone..
I have noticed that when user register himself with a new account and click
save..the request goes to the createCustomer request.
and than he get logged in and get diverted to the main page...
so what i'm trying to do is that he should not redirect to the main page
rather than he should be redirected  to the login page...and than he should
enter his username and password and than get logged in.
I have tried to change the the success request to login it didn't work
Any suggestions, tips?

Regards,
Madhi Krishnan