我能够利用Griiettner的解决方案为Joomla 3.我想不会允许用户编辑他们的电子邮件地址在前端的配置文件编辑屏幕上。我只修改了它稍微,复制这个文件:
components/com_users/models/forms/profile.xml
到:
/templates/YOUR_TEMPLATE/html/com_users/profile/forms/profile.xml
也复制此文件:
components/com_users/views/profile/tmpl/edit.php
到:
/templates/YOUR_TEMPLATE/html/com_users/profile/edit.php
,并把这个代码在edit.php文件的顶部右后:
defined('_JEXEC') or die;
我离开了$this->form->reset(true); // to reset the form xml loaded by the view
,只有用这个:
// JOOMLA 3 if(!defined('DS')) define('DS', DIRECTORY_SEPARATOR); $this->form->loadFile(dirname(__FILE__) . DS . "forms" . DS . "profile.xml");
这使我可以保持在编辑表单中填充用户配置文件信息。然后我编辑profile.xml配置文件,并补充说:
readonly="true"
到EMAIL1和EMAIL2领域。这可以防止用户进行编辑。
嗨,谢谢你的回复。我已经尝试了template/templatename/html/com_users/models/login.xml以及其他变体,如template/templatename/html/com_users/models/forms/login.xml或template/templatename/html/com_users/forms/login.xml等... – theoth 2012-03-24 19:43:12