DFdou's Blog Life is short,Be yourself.

2411/080

Drupal-用户名格式自定义模组custom_username_validation

Drupal默认的用户名对格式的限制很少,只要通过一下要求即可:
“不可以使用除了英文句号(.)、英文波折号(-)与下划线(_)之外的标点符号。”
所以,长度为1的用户名也可以存在……
早上在Drupalchina跟Drupaltaiwan看了下,都是要通过自己去定义访问规则来解决这个问题,
最可怕的是没有得到任何实质性的解决办法。
由于不熟悉,只好在Drupal.org的modules里慢慢找,结果找到了这个。
custom_username_validation模组
允许定义用户名的php正则表达式和出错信息。
看该模组的介绍,制作者是个好人哪,~以下是该模组的介绍:
“For a customer, i needed to validate the username against a german phone number, so i wrote this little module that allows to define a validation pattern for the username on registration. it's also possible to customize the error message on validation failure.”

Some Related Posts

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

:zhuang :xizao :wuwu :wenhao :wc :touxiang :shuaya :shuajian :shengtian :paopao :no :meinv :maonv :loveu :leilei :kua :jrjr :dahan :chi :chaocai :byebye


CommentLuv Enabled

No trackbacks yet.