我安装了一个免费的扩展程序,在客户登录之前需要管理员批准。我正在破解它,试图让它允许除一个之外的所有客户组。我认为以下是我要编辑的功能,但是当我进行测试注册时,测试 cookie 不会显示在我的控制台中。有任何想法吗?
/**
* Flag new accounts as 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
// get user's customer group 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);
}
}
我的代码是:
$customer_info = $session->getCustomer(); // var $customer Mage_Customer_Model_Customer
$userinfo = $customer_info->_origData; // fetch users info
// get user's customer group id number
$customer_group = $userinfo['group_id'];
setcookie("Group", "yes");