Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F324257
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Nov 24, 5:55 PM
Size
1 KB
Mime Type
text/x-diff
Expires
Tue, Nov 26, 5:55 PM (1 d, 3 h)
Engine
blob
Format
Raw Data
Handle
156103
Attached To
rWEBDNS WebDNS (edet4)
View Options
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb
index d95747d..ddb7820 100644
--- a/app/controllers/admin/users_controller.rb
+++ b/app/controllers/admin/users_controller.rb
@@ -1,44 +1,44 @@
module Admin
class UsersController < ApplicationController
before_action :authenticate_user!
before_action :admin_only!
# GET /users
def index
@users = User.all
end
# GET /users/orphans
def orphans
@users = User.orphans
end
# DELETE /users/:id
def destroy
@user = User.find(params[:id])
@user.destroy
redirect_to orphans_admin_users_path, notice: "#{@user.email} was deleted."
end
- def update_groups
+ def update
additions = 0
params.each_pair { |k, group_id|
next if !k.start_with?('orphan-')
_, id = k.split('-', 2)
user = User.orphans.find_by_id(id)
next if !user
group = Group.find_by_id(group_id)
next if !group
user.groups << group
additions += 1
}
redirect_to :back, notice: "#{additions} users were assigned to groups"
end
end
end
Event Timeline
Log In to Comment