Fix #1216 restrict max level if max_input_vars is low

This commit is contained in:
Kijin Sung 2019-11-22 20:13:04 +09:00
parent 6213708216
commit b158aeb9d5
4 changed files with 9 additions and 4 deletions

View file

@ -6,7 +6,7 @@ $lang->about_act_config = 'Each module like board/blog has its own actions such
$lang->point_io = 'Point module On';
$lang->about_point_io = 'Point module can be on or off. If you OFF this module, every triggers will be deleted from database and will not be called by Rhymix Core. Point record would be preserved.';
$lang->max_level = 'Max Level';
$lang->about_max_level = 'You may set the max level. Level icons should be considered and the level of 1000 is the maximum value you can set';
$lang->about_max_level = 'You may set the max level. Level icons should be considered and 1000 is the maximum value you can set.<br />The maximum possible value is also restricted by the max_input_vars setting of the server. The current maximum is around %d.';
$lang->level_icon = 'Level Icon';
$lang->about_level_icon = 'Path of level icon is "./module/point/icons/[level].gif" and max level could be different with icon set. So please be careful';
$lang->point_name = 'Point Name';

View file

@ -6,7 +6,7 @@ $lang->about_act_config = '게시판, 블로그 등 각 페이지마다 글 작
$lang->point_io = '포인트 모듈 켜기';
$lang->about_point_io = '체크 하면 포인트 모듈 기능을 켤 수 있습니다. 포인트 모듈 기능을 끌 경우, 포인트 모듈의 모든 트리거가 삭제됩니다. 포인트 기록은 유지되지만 새로 기록 되지는 않습니다.';
$lang->max_level = '최고 레벨';
$lang->about_max_level = '최고레벨을 지정할 수 있습니다. 레벨 아이콘을 염두에 두어야 하고 최고 레벨은 1000이 한계입니다.';
$lang->about_max_level = '최고레벨을 지정할 수 있습니다. 레벨 아이콘을 염두에 두어야 하고 최고 레벨은 1000이 한계입니다.<br />서버의 max_input_vars 설정이 낮은 경우 최고 레벨에도 제한이 있을 수 있습니다. 이 서버에서는 %d까지 가능합니다.';
$lang->level_icon = '레벨 아이콘';
$lang->about_level_icon = '레벨 아이콘은 ./modules/point/icons/레벨.gif 로 지정되며 최고레벨과 아이콘셋이 다를 수 있으니 주의해주세요!';
$lang->point_name = '포인트 이름';

View file

@ -47,6 +47,11 @@ class pointAdminView extends point
}
}
Context::set('group_list', $selected_group_list);
// Get max level allowed by system
$system_max_level = min(1000, ini_get('max_input_vars') - 100);
Context::set('system_max_level', $system_max_level);
//Security
$security = new Security();
$security->encodeHTML('group_list..title','group_list..description');

View file

@ -18,8 +18,8 @@
<div class="x_control-group">
<label for="max_level" class="x_control-label">{$lang->max_level}</label>
<div class="x_controls">
<input type="number" min="0" max="1000" value="{$config->max_level}" name="max_level" id="max_level" />
<p class="x_help-block">{$lang->about_max_level}</p>
<input type="number" min="0" max="{$system_max_level}" value="{$config->max_level}" name="max_level" id="max_level" />
<p class="x_help-block">{sprintf($lang->about_max_level, $system_max_level)}</p>
</div>
</div>
<div class="x_control-group">