如何在 Zotonic 验证器的管理界面中引用配置值?
我希望能够引用模板中 Zotonic 管理界面中设置的系统配置值。
特别是,我想创建一个可配置的密码复杂性正则表达式,以便我可以编写一个验证语句,如下所示:
{% validate id="new_password" type={format pattern=config.mod_admin_identity.password_regex %}
How do yourefer to Config value from the admin interface in Zotonic validators?
I would like to be able to refer to a System Configuration value set in the Zotonic admin interface within a template.
In particular I would like to create a configurable password complexity regex so I can write a validate statement like the following:
{% validate id="new_password" type={format pattern=config.mod_admin_identity.password_regex %}
How do you refer to Config values from the admin interface in Zotonic validators?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于 Arjan 的新搜索,我很快就能找到答案 http://zotonic.com/search?q =config 到 http://zotonic.com/documentation/719/m-config< /a> 并使用 m_config 快速设计了一个解决方案。
以下是对
_action_dialog_set_username_password.tpl
的修改,它基于模块mod_admin_identity
的管理配置提供密码复杂性强制执行,其中密钥password_regex
自动降级为一个简单的存在检查:The answer is quick to retrieve thanks to Arjan's new search I went from http://zotonic.com/search?q=config to http://zotonic.com/documentation/719/m-config and quickly devised a solution using m_config.
Here is a modification to
_action_dialog_set_username_password.tpl
that provides password complexity enforcement based on an admin config for modulemod_admin_identity
with keypassword_regex
that auto-degrades to a simple presence check: