No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

second_ask_html.htm 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <dl class="row">
  2. <dt class="tit">
  3. <label for="security_ask_open">密保状态</label>
  4. </dt>
  5. <dd class="opt">
  6. <label class="curpoin"><input id="security_ask_open1" name="security_ask_open" value="1" type="radio" onclick="security_verify_open(this);" {if condition="!empty($security.security_ask_open)"} checked="checked"{/if}>开启</label>
  7. &nbsp;
  8. <label class="curpoin"><input id="security_ask_open0" name="security_ask_open" value="0" type="radio" onclick="security_verify_open(this);" {if condition="empty($security.security_ask_open)"} checked="checked"{/if}>关闭</label>
  9. <span class="err"></span>
  10. <p class="notic">开启后,部分功能使用前,将进行二次问答验证</p>
  11. </dd>
  12. </dl>
  13. <div id="div_security_verify" class="{if condition='empty($security.security_ask_open)'}none{/if}">
  14. <input type="hidden" id="is_ask_add_edit" value="{empty name='$security.security_ask'}add{else /}edit{/empty}">
  15. <textarea id="security_askanswer_content" style="display: none;">{$security_askanswer_content|default=''}</textarea>
  16. <textarea id="security_ask_content" style="display: none;">{$security['security_ask']|default=''}</textarea>
  17. {empty name='$security.security_ask'}
  18. <dl class="row">
  19. <dt class="tit">
  20. <label for="security_ask"><em>*</em>设置密保问题</label>
  21. </dt>
  22. <dd class="opt" style="width: auto;">
  23. <select name="security_ask" id="security_ask" class="w210">
  24. <option value="-1">请选择…</option>
  25. {volist name='$security_askanswer_list' id='vo'}
  26. <option value="{$key}">{$vo}</option>
  27. {/volist}
  28. </select>
  29. &nbsp;<a href="javascript:void(0);" onclick="get_ask_list(this);" class="ncap-btn ncap-btn-green">问题列表</a>
  30. <span class="err"></span>
  31. <p class="notic"></p>
  32. </dd>
  33. </dl>
  34. <dl class="row">
  35. <dt class="tit">
  36. <label for="security_answer"><em>*</em>设置密保答案</label>
  37. </dt>
  38. <dd class="opt" style="width: auto;">
  39. <input type="text" name="security_answer" value="" id="security_answer" class="w200" autocomplete="off">
  40. <span class="err"></span>
  41. <p class="notic"></p>
  42. </dd>
  43. </dl>
  44. {else /}
  45. <dl class="row">
  46. <dt class="tit">
  47. <label for="security_ask_old">密保问题</label>
  48. </dt>
  49. <dd class="opt" style="width: auto;">
  50. {$security.security_ask}
  51. <input type="hidden" name="security_ask_old" id="security_ask_old" value="{$security.security_ask}">
  52. <span class="err"></span>
  53. <p class="notic"></p>
  54. </dd>
  55. </dl>
  56. <dl class="row">
  57. <dt class="tit">
  58. <label for="security_answer_old"><em id="security_answer_old_em" style="display: none;">*</em>密保答案</label>
  59. </dt>
  60. <dd class="opt" style="width: auto;">
  61. <input type="text" name="security_answer_old" value="" id="security_answer_old" placeholder="" class="w200" autocomplete="off">
  62. <span class="err"></span>
  63. <p class="notic">不重新设置无需填写问题答案</p>
  64. </dd>
  65. </dl>
  66. <dl class="row edit_colse">
  67. <dt class="tit">
  68. <label for="security_ask">重置密保问题</label>
  69. </dt>
  70. <dd class="opt" style="width: auto;">
  71. <select name="security_ask" id="security_ask" class="w210">
  72. <option value="-1">请选择…</option>
  73. {volist name='$security_askanswer_list' id='vo'}
  74. <option value="{$key}">{$vo}</option>
  75. {/volist}
  76. </select>
  77. &nbsp;<a href="javascript:void(0);" onclick="get_ask_list(this);" class="ncap-btn ncap-btn-green">问题列表</a>
  78. <span class="err"></span>
  79. <p class="notic"></p>
  80. </dd>
  81. </dl>
  82. <dl class="row edit_colse">
  83. <dt class="tit">
  84. <label for="security_answer"><em id="security_answer_em" style="display: none;">*</em>重置密保答案</label>
  85. </dt>
  86. <dd class="opt" style="width: auto;">
  87. <input type="text" name="security_answer" value="" id="security_answer" class="w200" autocomplete="off">
  88. <span class="err"></span>
  89. <p class="notic">为空默认不修改</p>
  90. </dd>
  91. </dl>
  92. <script type="text/javascript">
  93. $(function(){
  94. // 新设置安全问题
  95. $('select[name=security_ask]').change(function(){
  96. var security_ask = $(this).val();
  97. var security_answer = $.trim($('input[name=security_answer]').val());
  98. if (0 > security_ask && security_answer === '') {
  99. $('#security_answer_em').hide();
  100. $('#security_answer_old_em').hide();
  101. $('#security_answer_old').removeClass('emptytips');
  102. } else {
  103. $('#security_answer_em').show();
  104. $('#security_answer_old_em').show();
  105. $('#security_answer_old').addClass('emptytips');
  106. }
  107. });
  108. // 新设置问题答案
  109. $('input[name=security_answer]').keyup(function(){
  110. var security_ask = $('select[name=security_ask]').val();
  111. var security_answer = $.trim($(this).val());
  112. if (security_answer === '' && 0 > security_ask) {
  113. $('#security_answer_em').hide();
  114. $('#security_answer_old_em').hide();
  115. $('#security_answer_old').removeClass('emptytips');
  116. } else {
  117. $('#security_answer_em').show();
  118. $('#security_answer_old_em').show();
  119. $('#security_answer_old').addClass('emptytips');
  120. }
  121. });
  122. });
  123. </script>
  124. {/empty}
  125. <dl class="row edit_colse">
  126. <dt class="tit">
  127. <label for="security_verifyfunc">应用范围</label>
  128. </dt>
  129. <dd class="opt">
  130. <!-- <label title="强制勾选"><input type="checkbox" name="security_verifyfunc[]" value="Security@*" checked="checked" disabled="true">安全中心</label>&nbsp;&nbsp; -->
  131. <label title="强制勾选"><input type="checkbox" name="security_verifyfunc[]" value="Filemanager@*" checked="checked" disabled="true">模板管理</label>&nbsp;&nbsp;
  132. <label class="curpoin"><input type="checkbox" name="security_verifyfunc[]" value="Weapp@*" {if condition="!empty($security['security_verifyfunc']) && in_array('Weapp@*', $security['security_verifyfunc'])"}checked="checked"{/if}>插件应用</label>&nbsp;&nbsp;
  133. <label class="curpoin" title="修改管理员、会员密码都要密保验证"><input type="checkbox" name="security_verifyfunc[]" value="edit_pwd" {if condition="!empty($security['security_verifyfunc']) && in_array('edit_pwd', $security['security_verifyfunc'])"}checked="checked"{/if}>修改密码</label>
  134. <p class="notic">建议勾选,避免存在被注入木马的安全漏洞隐患</p>&nbsp;&nbsp;
  135. </dd>
  136. </dl>
  137. <dl class="row edit_colse">
  138. <dt class="tit">
  139. <label for="security_ask_ip_open">IP白名单</label>
  140. </dt>
  141. <dd class="opt">
  142. <label class="curpoin"><input id="security_ask_ip_open1" name="security_ask_ip_open" value="1" type="radio" {if condition="!isset($security.security_ask_ip_open) || $security.security_ask_ip_open == 1"} checked="checked"{/if}>开启</label>
  143. &nbsp;
  144. <label class="curpoin"><input id="security_ask_ip_open0" name="security_ask_ip_open" value="0" type="radio" {if condition="isset($security.security_ask_ip_open) && $security.security_ask_ip_open == 0"} checked="checked"{/if}>关闭</label>
  145. <span class="err"></span>
  146. <p class="notic">如果开启该功能,在相同IP下登录后,任意一个管理员二次验证成功,其他人不再弹出验证</p>
  147. </dd>
  148. </dl>
  149. </div>
  150. <script type="text/javascript">
  151. function get_ask_list(obj)
  152. {
  153. layer.prompt({
  154. title: '密保问题管理',
  155. id: 'layerid_1645756024',
  156. formType: 2,
  157. btn: ['保存','取消'],
  158. shade: layer_shade,
  159. closeBtn: 0,
  160. value: $('#security_askanswer_content').val(),
  161. success: function(layero, index) {
  162. if ('edit' == $('#is_ask_add_edit').val()) {
  163. var security_ask_content = "{$security.security_ask}";
  164. if (security_ask_content == '') {
  165. security_ask_content = $('#security_ask_content').val();
  166. }
  167. var before_str = "<div style='margin: -8px 0px 10px 0px;'>当前问题名称:<font style='color: red;'>"+security_ask_content+"</font></div>";
  168. $("#layerid_1645756024").prepend(before_str);
  169. var after_str = "<div style='margin-top: 5px;font-size: 12px; color: #999999;'>保存后,已设置的问题名称会默认存入问题列表</div>";
  170. $("#layerid_1645756024").append(after_str);
  171. }
  172. $("#layerid_1645756024").find('textarea').attr('placeholder', '一行代表一个问题');
  173. },
  174. btn2: function(index, layero){
  175. layer.close(index);
  176. return false;
  177. }
  178. }, function(value, index) {
  179. save_ask_list(value);
  180. });
  181. }
  182. function save_ask_list(value)
  183. {
  184. //loading层
  185. var loading = layer.load(3, {
  186. shade: [0.1,'#fff'] //0.1透明度的白色背景
  187. });
  188. $.ajax({
  189. type : 'post',
  190. url : "{:url('Security/save_ask_list', ['_ajax'=>1])}",
  191. data : {value:value},
  192. dataType : 'json',
  193. success : function(res) {
  194. if (res.code == 1) {
  195. layer.closeAll();
  196. var selected_text = $('select[name=security_ask] option:selected').text();
  197. var option_html = '<option value="-1">请选择…</option>';
  198. $.each(res.data.security_askanswer_list, function(index, item) {
  199. if (selected_text == item) {
  200. option_html += '<option value="'+index+'" selected="true">'+item+'</option>';
  201. } else {
  202. option_html += '<option value="'+index+'">'+item+'</option>';
  203. }
  204. });
  205. $('select[name=security_ask]').html(option_html);
  206. $('#security_askanswer_content').val(res.data.value);
  207. layer.msg(res.msg, {shade: 0.1, time: 1000});
  208. }else{
  209. layer.close(loading);
  210. $('#layerid_1645756024').find('input[type=textarea]').focus();
  211. layer.msg(res.msg, {time: 1000});
  212. }
  213. },
  214. error: function(e) {
  215. layer.close(loading);
  216. showErrorAlert(e.responseText);
  217. }
  218. });
  219. }
  220. function security_verify_open(obj)
  221. {
  222. var is_open = $(obj).val();
  223. var is_ask_add_edit = $('#is_ask_add_edit').val();
  224. if (1 == is_open) {
  225. $('#div_security_verify').show();
  226. if ('edit' == is_ask_add_edit) {
  227. $('#security_answer_old_em').hide();
  228. $('#security_answer_old').removeClass('emptytips');
  229. $('.edit_colse').show();
  230. }
  231. } else {
  232. if ('edit' == is_ask_add_edit) {
  233. $('#security_answer_old_em').show();
  234. $('#security_answer_old').addClass('emptytips').focus();
  235. $('.edit_colse').hide();
  236. } else if ('add' == is_ask_add_edit) {
  237. $('#div_security_verify').hide();
  238. }
  239. }
  240. }
  241. </script>