Magento - 禁用更改/重置电子邮件的客户

时间:2013-07-12 16:07:20

标签: email magento-1.7 reset

出于安全考虑,我需要禁止用户更改其电子邮件的可能性。一旦设置,它就无法改变。我怎么能这样做?

4 个答案:

答案 0 :(得分:1)

我找到了:

http://www.magentocommerce.com/boards/viewthread/8622/

可能对某人有用......

答案 1 :(得分:1)

进行以下更改:

template/customer/account/dashboard/info.phtml

<div class="inner-head">
        <h5><?php echo $this->__('Contact Information') ?></h5>
        <a href="<?php echo $this->getUrl('customer/account/edit') ?>">Edit</a>
    </div>
    <p>
        <?php echo $this->htmlEscape($this->getCustomer()->getFirstname()) ?> 
        <?php echo $this->htmlEscape($this->getCustomer()->getLastname()) ?><br />
        <?php echo $this->htmlEscape($this->getCustomer()->getEmail()) ?><br />
        <a href="<?php echo $this->getChangePasswordUrl() ?>"><?php echo $this->__('Change Password') ?></a>
    </p>

并替换为:

<div class="inner-head">
        <h5><?php echo $this->__('Contact Information') ?></h5><br />

    </div>
    <p>
        <?php echo $this->htmlEscape($this->getCustomer()->getFirstname()) ?> 
        <?php echo $this->htmlEscape($this->getCustomer()->getLastname()) ?><br />
        <a href="<?php echo $this->getChangePasswordUrl() ?>"><?php echo $this->__('Change Password') ?></a>
    </p>

magento community forums提取并改编。

答案 2 :(得分:0)

问题是我们有一个覆盖用户模型/控制器/视图的扩展,例如:社交登录,因为我们决定不使用它,我们在高级设置中禁用它。

因为它是禁用的,后端没有显示用户列表,但我可以创建一个新客户,但在新客户视图中,地址也没有显示。

因此,我们再次激活了所有扩展程序,突然显示了客户列表。因此,我们发现哪个扩展正在破坏并修复它。

答案 3 :(得分:0)

在档案中: 应用\代码\核心\法师\客户\控制器\ AccountController.php

/**
     * Change customer password action
     */
    public function editPostAction()
    {
        if (!$this->_validateFormKey()) {
            return $this->_redirect('*/*/edit');
        }

        if ($this->getRequest()->isPost()) {
            $customer = Mage::getModel('customer/customer')
                ->setId($this->_getSession()->getCustomerId())
                ->setWebsiteId($this->_getSession()->getCustomer()->getWebsiteId());

            $fields = Mage::getConfig()->getFieldset('customer_account');
            $data = $this->_filterPostData($this->getRequest()->getPost());

            //=========
           // ADD THAT // customer cannot change his email // Le customer ne peut pas modifier son email
            if(isset($data['email'])){
                $data['email'] = $this->_getSession()->getCustomer()->getData('email');
            }
            //========END   

            foreach ($fields as $code=>$node) {
                if ($node->is('update') && isset($data[$code])) {
                    $customer->setData($code, $data[$code]);
                }
            }

            $errors = $customer->validate();
            if (!is_array($errors)) {
                $errors = array();
            }
相关问题