From 38f72a85e4ae12f6562f05a9047211a5ec0a62c8 Mon Sep 17 00:00:00 2001 From: yumaojun <719118794@qq.com> Date: Mon, 4 Jan 2016 13:13:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=89=8D=E7=AB=AF=E7=A6=81?= =?UTF-8?q?=E6=AD=A2root=E7=9A=84=E6=AD=A3=E5=88=99=E8=A1=A8=E8=BE=BE?= =?UTF-8?q?=E5=BC=8F=EF=BC=8C=E5=81=9A=E7=B2=BE=E7=A1=AE=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/jperm/perm_role_add.html | 5 ++--- templates/jperm/perm_role_edit.html | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/templates/jperm/perm_role_add.html b/templates/jperm/perm_role_add.html index 381e4da86..f002b8263 100644 --- a/templates/jperm/perm_role_add.html +++ b/templates/jperm/perm_role_add.html @@ -92,15 +92,14 @@ $('#roleForm').validator({ timely: 2, theme: "yellow_right_effect", rules: { - check_name: [/^\w{2,20}$/, '大小写字母数字和下划线,2-20位'], - check_name_root: [/[^rR][^oO][^oO][^tT]/, '禁止使用root用户作为系统用户,这样非常危险!'], + check_name: [/(?!root)^\w{2,20}$/i, '大小写字母数字和下划线,2-20位,并且非root'], check_begin: [/^[\-]+BEGIN RSA PRIVATE KEY[\-]+/gm, 'RSA Key填写有误,请检查'], }, fields: { "role_name": { - rule: "required;check_name;check_name_root", + rule: "required;check_name", tip: "输入系统用户名称", ok: "", msg: {required: "系统用户名称必填"} diff --git a/templates/jperm/perm_role_edit.html b/templates/jperm/perm_role_edit.html index c216517e3..2189b6208 100644 --- a/templates/jperm/perm_role_edit.html +++ b/templates/jperm/perm_role_edit.html @@ -94,8 +94,7 @@ $('#roleForm').validator({ timely: 2, theme: "yellow_right_effect", rules: { - check_name: [/^\w{2,20}$/, '大小写字母数字和下划线,2-20位'], - check_name_root: [/[^rR][^oO][^oO][^tT]/, '禁止使用root用户作为系统用户,这样非常危险!'], + check_name: [/(?!root)^\w{2,20}$/i, '大小写字母数字和下划线,2-20位,并且非root'], check_begin: [/^[\-]+BEGIN RSA PRIVATE KEY[\-]+/gm, 'RSA Key填写有误,请检查'], },