Manually enable / disable users

Ask the community for help and support.
Post Reply
cut-n-paste
Posts: 21
Joined: Fri Oct 07, 2022 12:20 pm
Has thanked: 2 times
Been thanked: 5 times

Manually enable / disable users

Post 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.
Omar_one
VIP Member
VIP Member
Posts: 481
Joined: Fri Oct 25, 2019 5:06 pm
Has thanked: 48 times
Been thanked: 27 times

Re: Manually enable / disable users

Post by Omar_one »

@cut-n-paste check this
viewtopic.php?p=6525#p6525
beerbee
VIP Member
VIP Member
Posts: 46
Joined: Mon Oct 26, 2020 4:56 pm
Has thanked: 2 times
Been thanked: 3 times

Re: Manually enable / disable users

Post 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
cut-n-paste
Posts: 21
Joined: Fri Oct 07, 2022 12:20 pm
Has thanked: 2 times
Been thanked: 5 times

Re: Manually enable / disable users

Post 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?
cut-n-paste
Posts: 21
Joined: Fri Oct 07, 2022 12:20 pm
Has thanked: 2 times
Been thanked: 5 times

Re: Manually enable / disable users

Post 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?
beerbee
VIP Member
VIP Member
Posts: 46
Joined: Mon Oct 26, 2020 4:56 pm
Has thanked: 2 times
Been thanked: 3 times

Re: Manually enable / disable users

Post by beerbee »

No did this to try it and left it that way, but could/should be a page specific hook.

Kind regards
Christoph
Post Reply