1

出于安全原因,我需要禁用用户更改电子邮件的可能性。一旦设定就不能改变。我怎样才能做到这一点?

4

4 回答 4

1

我已经找到 :

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

也许对某人有用...

于 2014-03-25T14:56:00.853 回答
0

Make the following changes:

In 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>

and Replace with:

<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>

Extracted and adapted from the magento community forums.

于 2014-03-25T15:19:38.010 回答
0

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

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

因此,我们再次激活了所有扩展程序,突然出现了客户列表。所以像这样我们发现了哪个扩展被破坏并修复了它。

于 2014-03-25T15:33:57.540 回答
-1

在文件中:app\code\core\Mage\Customer\controllers\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();
            }
于 2014-03-25T16:34:43.193 回答