Page 1 of 1

Manually enable / disable users

Posted: Fri Oct 07, 2022 12:40 pm
by cut-n-paste
I am using CE Phoenix v1.0.8.17 and I would like to manually approve users.

I have mostly achieved this by copying the newsletter customer data module with the help of the YouTube video about customer data modules. (thanks @zipurman for the detailed tutorials!) I have created my own version of the module cm_login_form to check for this field at login which works fine, but I notice when you register for the first time, you also get automatically get logged in. I was able bypass the session creation back in days of OsCommerce but cannot work out how to do this in CE Phoenix.

Re: Manually enable / disable users

Posted: Fri Oct 07, 2022 4:08 pm
by Omar_one
@cut-n-paste check this
viewtopic.php?p=6525#p6525

Re: Manually enable / disable users

Posted: Sat Oct 08, 2022 10:04 am
by beerbee
Hi,
I did this with a hook. This works with 1.80

Code: Select all

<?php
class hook_shop_siteWide_unset_custsession {
 
  function listen_postRegistration() {   
    if ($GLOBALS['PHP_SELF'] == 'create_account.php')
    {

     if ( isset($_SESSION['customer_id']) ) {
          unset($_SESSION['customer_default_address_id']);
          unset($_SESSION['customer_first_name']);
          unset($_SESSION['customer_country_id']);
          unset($_SESSION['customer_zone_id']);
          unset($_SESSION['customer_id']);
       }
      }
     }
    }
    
Kind regards
Christoph

Re: Manually enable / disable users

Posted: Sun Oct 09, 2022 10:47 am
by cut-n-paste
Omar_one wrote: Fri Oct 07, 2022 4:08 pm @cut-n-paste check this
viewtopic.php?p=6525#p6525
Thanks but doesn't seem to exist or I don't have permissions?

Re: Manually enable / disable users

Posted: Sun Oct 09, 2022 11:01 am
by cut-n-paste
beerbee wrote: Sat Oct 08, 2022 10:04 am Hi,
I did this with a hook. This works with 1.80

Code: Select all

<?php
class hook_shop_siteWide_unset_custsession {
 
  function listen_postRegistration() {   
    if ($GLOBALS['PHP_SELF'] == 'create_account.php')
    {

     if ( isset($_SESSION['customer_id']) ) {
          unset($_SESSION['customer_default_address_id']);
          unset($_SESSION['customer_first_name']);
          unset($_SESSION['customer_country_id']);
          unset($_SESSION['customer_zone_id']);
          unset($_SESSION['customer_id']);
       }
      }
     }
    }
    
Kind regards
Christoph
Thanks, this works. Is there a reason you made it siteWide?

Re: Manually enable / disable users

Posted: Sun Oct 09, 2022 2:14 pm
by beerbee
No did this to try it and left it that way, but could/should be a page specific hook.

Kind regards
Christoph