Wednesday, 15 May 2013

php - Magento Customer Activation module hack customer group -



php - Magento Customer Activation module hack customer group -

i installed free extension requires admin approval before client can log in. hacking seek allow client groups except one. think next function edit, when test registration test cookie not show in console. ideas?

/** * flag new accounts such * * @param varien_event_observer $observer */ public function customersavebefore($observer) { $customer = $observer->getevent()->getcustomer(); $storeid = mage::helper('customeractivation')->getcustomerstoreid($customer); $session = mage::getsingleton('customer/session'); // var $session mage_customer_model_session $customer_info = $session->getcustomer(); // var $customer mage_customer_model_customer $userinfo = $customer_info->_origdata; // fetch users info // user's client grouping id number $customer_group = $userinfo['group_id']; setcookie("group", "yes"); if (mage::getstoreconfig(self::xml_path_module_disabled, $storeid)) { return; } if (!$customer->getid()) { $defaultstatus = mage::getstoreconfig(self::xml_path_default_status, $storeid); $customer->setcustomeractivated($defaultstatus); $customer->setcustomeractivationnewaccount(true); } }

my code the:

$customer_info = $session->getcustomer(); // var $customer mage_customer_model_customer $userinfo = $customer_info->_origdata; // fetch users info // user's client grouping id number $customer_group = $userinfo['group_id']; setcookie("group", "yes");

first: please don't seek hack module. improve create own module rewriting classes of original module, you'll still able update original one.

second: sure part of code executed? happens if come in die() in it?

third: can see list of triggered event implementing firegento-debug module, check if event fired , observer called.

php magento

No comments:

Post a Comment