This works as well.raiwa wrote: ↑Sat Dec 31, 2022 9:03 am Possible core change in the navbar module:
includes\modules\navbar\nb_account.php line 20:Code: Select all
if ( ($GLOBALS['customer'] ?? null) instanceof customer && isset($_SESSION['customer_id']) ) {
User Name Stays on NavBar after Logging Out
-
Moxamint
- Member
- Posts: 93
- Joined: Fri Nov 06, 2020 10:36 am
- Phoenix Version:
- Has thanked: 33 times
- Been thanked: 3 times
Re: User Name Stays on NavBar after Logging Out
- Kofod95
- Senior Contributor
- Posts: 748
- Joined: Sat Feb 06, 2021 7:38 pm
- Phoenix Version: 1.0.8.20
- Has thanked: 99 times
- Been thanked: 179 times
Re: User Name Stays on NavBar after Logging Out
We recently received the Davidoff and the Macanudo cigars celebrating the arrival of the Year of the Rabbit, so when I created the products, I did some reading
//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
Here are a lot of corns: Phoenix user guide
-
raiwa
- Certified Developer
- Posts: 1641
- Joined: Sat Dec 21, 2019 8:08 am
- Phoenix Version: 1.1.0.6
- : Buy Me A Beverage
- Has thanked: 70 times
- Been thanked: 152 times
Re: User Name Stays on NavBar after Logging Out
@ecartz Could this go into 1.0.8.21/1.0.9.0?raiwa wrote: ↑Sat Dec 31, 2022 9:03 am Possible core change in the navbar module:
includes\modules\navbar\nb_account.php line 20:Code: Select all
if ( ($GLOBALS['customer'] ?? null) instanceof customer && isset($_SESSION['customer_id']) ) {
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
-
ecartz
- Core Team
- Posts: 3084
- Joined: Tue Nov 05, 2019 6:02 pm
- Phoenix Version:
- Has thanked: 4 times
- Been thanked: 208 times
Re: User Name Stays on NavBar after Logging Out
Try: save
Code: Select all
<?php
/*
$Id$
CE Phoenix, E-Commerce made Easy
https://phoenixcart.org
Copyright (c) 2023 Phoenix Cart
Released under the GNU General Public License
*/
class global_eraser {
public function __call($name, $arguments) {
unset($GLOBALS[$name]);
}
}Code: Select all
INSERT INTO hooks (hooks_site, hooks_group, hooks_action, hooks_code, hooks_class, hooks_method) VALUES ('shop', 'logoff', 'resetStart', '_41_unset_customer', 'global_eraser', 'customer');-
raiwa
- Certified Developer
- Posts: 1641
- Joined: Sat Dec 21, 2019 8:08 am
- Phoenix Version: 1.1.0.6
- : Buy Me A Beverage
- Has thanked: 70 times
- Been thanked: 152 times
Re: User Name Stays on NavBar after Logging Out
Confirmed. Works like expected.ecartz wrote: ↑Mon Jan 02, 2023 12:38 pmTry: saveat includes/classes/magic/global_eraser.php and addCode: Select all
<?php /* $Id$ CE Phoenix, E-Commerce made Easy https://phoenixcart.org Copyright (c) 2023 Phoenix Cart Released under the GNU General Public License */ class global_eraser { public function __call($name, $arguments) { unset($GLOBALS[$name]); } }My test shop is down, so I can't test/try anything until I build a replacement. But I'd prefer not to change the logic, if customer, then do stuff with customer. I'd rather change whether or not the customer object exists. That will also be more robust in other features with the same logic.Code: Select all
INSERT INTO hooks (hooks_site, hooks_group, hooks_action, hooks_code, hooks_class, hooks_method) VALUES ('shop', 'logoff', 'resetStart', '_41_unset_customer', 'global_eraser', 'customer');
Thank you very much and a Happy New Year
Rainer
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27