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.
Manually enable / disable users
-
- Posts: 21
- Joined: Fri Oct 07, 2022 12:20 pm
- Has thanked: 2 times
- Been thanked: 5 times
-
- 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
Hi,
I did this with a hook. This works with 1.80
Kind regards
Christoph
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']);
}
}
}
}
Christoph
-
- Posts: 21
- Joined: Fri Oct 07, 2022 12:20 pm
- Has thanked: 2 times
- Been thanked: 5 times
-
- Posts: 21
- Joined: Fri Oct 07, 2022 12:20 pm
- Has thanked: 2 times
- Been thanked: 5 times
Re: Manually enable / disable users
Thanks, this works. Is there a reason you made it siteWide?beerbee wrote: ↑Sat Oct 08, 2022 10:04 am Hi,
I did this with a hook. This works with 1.80Kind regardsCode: 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']); } } } }
Christoph