Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ELOSP-349 User's email metadata #178

Open
wants to merge 1 commit into
base: release-3.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions app/controllers/bigbluebutton/rooms_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def destroy
# Used to join users into a meeting. Most of the work is done in before filters.
# Can be called via GET or POST and accepts parameters both in the POST data and URL.
def join
join_internal(@user_name, @user_role, @user_id)
join_internal(@user_name, @user_role, @user_id, @user_email)
end

# Used to join private rooms or to invite anonymous users (not logged)
Expand Down Expand Up @@ -243,12 +243,13 @@ def join_check_room
end

# Checks the parameters received when calling `join` and sets them in variables to
# be accessed by other methods. Sets the user's name, id and role. Gives priority to
# be accessed by other methods. Sets the user's name, email, id and role. Gives priority to
# a logged user over the information provided in the params.
def join_user_params
# gets the user information, given priority to a possible logged user
if bigbluebutton_user.nil?
@user_name = params[:user].blank? ? nil : params[:user][:name]
@user_email = params[:user].blank? ? nil : params[:user][:email]
@user_id = nil
else
@user_name = bigbluebutton_user.name
Expand Down Expand Up @@ -315,7 +316,7 @@ def redirect_to_on_join_error
end

# The internal process to join a meeting.
def join_internal(username, role, id)
def join_internal(username, role, id, email)
begin
# first check if we have to create the room and if the user can do it
unless @room.fetch_is_running?
Expand All @@ -331,7 +332,7 @@ def join_internal(username, role, id)
end

# room created and running, try to join it
url = @room.parameterized_join_url(username, role, id, {}, bigbluebutton_user)
url = @room.parameterized_join_url(username, role, id, { 'userdata-email': email }, bigbluebutton_user)

unless url.nil?

Expand Down
6 changes: 3 additions & 3 deletions spec/controllers/bigbluebutton/rooms_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@
BigbluebuttonRails.should_receive(:use_mobile_client?).with('my-browser').and_return(true)

# here's the real verification
controller.should_receive(:join_internal).with(user.name, :moderator, user.id)
controller.should_receive(:join_internal).with(user.name, :moderator, user.id, nil)
}
it { send(method, :join, :id => room.to_param, :auto_join => true) }
end
Expand All @@ -662,7 +662,7 @@
BigbluebuttonRails.should_receive(:use_mobile_client?).with('my-browser').and_return(true)

# here's the real verification
controller.should_receive(:join_internal).with(user.name, :moderator, user.id)
controller.should_receive(:join_internal).with(user.name, :moderator, user.id, nil)
}
it { send(method, :join, :id => room.to_param, :desktop => true) }
end
Expand All @@ -677,7 +677,7 @@

# here's the validation
controller.should_receive(:join_internal)
.with(user.name, :moderator, user.id)
.with(user.name, :moderator, user.id, nil)
}
it { send(method, :join, :id => room.to_param) }
end
Expand Down
4 changes: 2 additions & 2 deletions spec/rails_app/lib/tasks/db/populate.rake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace :db do
:url => "http://bigbluebutton#{n1}.test.com/bigbluebutton/api",
:secret => Forgery(:basic).password(:at_least => 30, :at_most => 40),
:version => '0.9',
:param => "server-#{n1}"
:slug => "server-#{n1}"
}
puts "- Creating server #{params[:name]}"
server = BigbluebuttonServer.create!(params)
Expand All @@ -44,7 +44,7 @@ namespace :db do
:moderator_key => Forgery(:basic).password(:at_least => 10, :at_most => 16),
:welcome_msg => Forgery(:lorem_ipsum).sentences(2),
:private => false,
:param => "meeting-#{n1}-#{n2}",
:slug => "meeting-#{n1}-#{n2}",
:external => false,
:record_meeting => false,
:duration => 0
Expand Down