diff --git a/module/custom/control.php b/module/custom/control.php index 91efeb1765..b80c365c94 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -46,6 +46,10 @@ class custom extends control $value = $_POST['values'][$index]; if(!$value or !$key) continue; $system = $_POST['systems'][$index]; + + /* the length of role is 20, check it when save. */ + if($module == 'user' and $field == 'roleList' and strlen($key) > 20) die(js::alert($this->lang->custom->notice->userRole)); + $this->custom->setItem("{$lang}.{$module}.{$field}.{$key}.{$system}", $value); } if(dao::isError()) die(js::error(dao::getError())); diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php index 5454f0cb0f..47cbec20d6 100644 --- a/module/custom/lang/en.php +++ b/module/custom/lang/en.php @@ -61,3 +61,6 @@ $lang->custom->currentLang = 'For current language'; $lang->custom->allLang = 'For all language'; $lang->custom->confirmRestore = 'Are you sure to restore the default lang setting?'; + +$lang->custom->notice = new stdclass(); +$lang->custom->notice->userRole = 'The length of key must be less than 20!'; diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php index 65a42665ce..2edeb44bac 100644 --- a/module/custom/lang/zh-cn.php +++ b/module/custom/lang/zh-cn.php @@ -61,3 +61,6 @@ $lang->custom->currentLang = '适用当前语言'; $lang->custom->allLang = '适用所有语言'; $lang->custom->confirmRestore = '是否要恢复默认语言配置?'; + +$lang->custom->notice = new stdclass(); +$lang->custom->notice->userRole = '键的长度必须小于20个字符!'; diff --git a/module/custom/view/set.html.php b/module/custom/view/set.html.php index fa761b0165..3f28999418 100644 --- a/module/custom/view/set.html.php +++ b/module/custom/view/set.html.php @@ -55,7 +55,7 @@ EOT;
-
+
custom->object[$module] . ' >> ' . $lang->custom->$module->fields[$field]?>