forked from External/greenlight
work on user settings
This commit is contained in:
@ -1,3 +1,7 @@
|
||||
class ApplicationRecord < ActiveRecord::Base
|
||||
self.abstract_class = true
|
||||
|
||||
def to_param
|
||||
uid
|
||||
end
|
||||
end
|
||||
|
@ -10,10 +10,6 @@ class Room < ApplicationRecord
|
||||
ROOM_ICONS = %w(circle star certificate play cloud heart square bookmark cog)
|
||||
RETURNCODE_SUCCESS = "SUCCESS"
|
||||
|
||||
def to_param
|
||||
uid
|
||||
end
|
||||
|
||||
# Determines if a user owns a room.
|
||||
def owned_by?(user)
|
||||
return false if user.nil?
|
||||
@ -72,8 +68,6 @@ class Room < ApplicationRecord
|
||||
|
||||
# Returns a URL to join a user into a meeting.
|
||||
def join_path(user, options = {})
|
||||
username = user.name if user.is_a?(User)
|
||||
|
||||
# Create the meeting if it isn't running.
|
||||
start_session(options) unless is_running?
|
||||
|
||||
@ -100,7 +94,11 @@ class Room < ApplicationRecord
|
||||
end
|
||||
|
||||
# Generate the join URL.
|
||||
bbb.join_meeting_url(bbb_id, username, password, {userID: user.uid})
|
||||
if user.is_a?(User)
|
||||
bbb.join_meeting_url(bbb_id, user.name, password, {userID: user.uid})
|
||||
else
|
||||
bbb.join_meeting_url(bbb_id, user, password)
|
||||
end
|
||||
end
|
||||
|
||||
# Fetches all recordings for a meeting.
|
||||
|
@ -22,7 +22,11 @@ class User < ApplicationRecord
|
||||
|
||||
# Generates a user from omniauth.
|
||||
def from_omniauth(auth)
|
||||
user = find_or_initialize_by(uid: auth['uid'], provider: auth['provider'])
|
||||
user = find_or_initialize_by(
|
||||
social_uid: auth['uid'],
|
||||
provider: auth['provider']
|
||||
)
|
||||
|
||||
user.name = send("#{auth['provider']}_name", auth)
|
||||
user.username = send("#{auth['provider']}_username", auth)
|
||||
user.email = send("#{auth['provider']}_email", auth)
|
||||
|
Reference in New Issue
Block a user