From fc8ecd706b64edeff6dc89ede996ffe15a72b5f8 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 11 Jun 2019 21:47:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E9=99=A4ip=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 5 +++++ app/controllers/users_controller.rb | 2 +- app/views/managements/cancel_ip_limit.js.erb | 1 + app/views/managements/users.html.erb | 5 +++-- config/routes.rb | 1 + 5 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 app/views/managements/cancel_ip_limit.js.erb diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 881c5b25..e42beca7 100755 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -2049,6 +2049,11 @@ end end end + # 解除ip限制 + def cancel_ip_limit + LoginIpInfo.destroy_all + end + # 0 全部;1 活动的; 2 已注册; 3 锁定 def users @menu_type = 7 diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index e86a9be9..8242781b 100755 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -33,7 +33,7 @@ class UsersController < ApplicationController menu_item :user_messages, :only => :user_messages - # + before_filter :local_exam, only: [:user_tidings] before_filter :can_show_course, :only => [:user_courses, :user_homeworks] before_filter :check_authentication, :except => [:name_update, :realname_update, :update_user_pro, :update_user_location, :send_message_to_administrator, :show_or_hide_realname] diff --git a/app/views/managements/cancel_ip_limit.js.erb b/app/views/managements/cancel_ip_limit.js.erb new file mode 100644 index 00000000..ced881a7 --- /dev/null +++ b/app/views/managements/cancel_ip_limit.js.erb @@ -0,0 +1 @@ +notice_box("解除成功"); \ No newline at end of file diff --git a/app/views/managements/users.html.erb b/app/views/managements/users.html.erb index dadd9360..7d24d6a4 100755 --- a/app/views/managements/users.html.erb +++ b/app/views/managements/users.html.erb @@ -24,7 +24,7 @@
  • - +
  • @@ -36,7 +36,8 @@ 账号生成 课堂添加成员 - <% end %> + 解除ip限制 +<% end %>
    <%= render :partial => "managements/user_list" %> diff --git a/config/routes.rb b/config/routes.rb index 74ac7698..23c56fe6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -723,6 +723,7 @@ RedmineApp::Application.routes.draw do ## oauth相关 delete :delete_customers get :customers_list post :unlock_user_ip + delete :cancel_ip_limit end end # Enable Grack support