forked from bigbluebutton/greenlight
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GRN2-xx: Fixed issue with recording row and added small fix to roles …
…migration (Fixed bigbluebutton#717, bigbluebutton#718) (bigbluebutton#719) * Fixed issue with recording row and added small fix to roles migration * Fixed issue with edit user avatar * Small bug fixes for user settings * Added autofocus on name field when joining * Added extra check for admin password check * Rubocop fixes
- Loading branch information
1 parent
4fc1714
commit 60f5cd5
Showing
7 changed files
with
99 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,8 +137,8 @@ def default_meeting_options | |
|
||
# Checks to make sure that the admin has changed his password from the default | ||
def check_admin_password | ||
if current_user&.has_role?(:admin) && current_user&.greenlight_account? && | ||
current_user&.authenticate(Rails.configuration.admin_password_default) | ||
if current_user&.has_role?(:admin) && current_user.email == "[email protected]" && | ||
current_user&.greenlight_account? && current_user&.authenticate(Rails.configuration.admin_password_default) | ||
|
||
flash.now[:alert] = I18n.t("default_admin", | ||
edit_link: edit_user_path(user_uid: current_user.uid) + "?setting=password").html_safe | ||
|
@@ -157,28 +157,7 @@ def set_user_domain | |
else | ||
@user_domain = parse_user_domain(request.host) | ||
|
||
# Checks to see if the user exists | ||
begin | ||
retrieve_provider_info(@user_domain, 'api2', 'getUserGreenlightCredentials') | ||
rescue => e | ||
# Use the default site settings | ||
@user_domain = "greenlight" | ||
|
||
if e.message.eql? "No user with that id exists" | ||
render "errors/greenlight_error", locals: { message: I18n.t("errors.not_found.user_not_found.message"), | ||
help: I18n.t("errors.not_found.user_not_found.help") } | ||
elsif e.message.eql? "Provider not included." | ||
render "errors/greenlight_error", locals: { message: I18n.t("errors.not_found.user_missing.message"), | ||
help: I18n.t("errors.not_found.user_missing.help") } | ||
elsif e.message.eql? "That user has no configured provider." | ||
render "errors/greenlight_error", locals: { status_code: 501, | ||
message: I18n.t("errors.no_provider.message"), | ||
help: I18n.t("errors.no_provider.help") } | ||
else | ||
render "errors/greenlight_error", locals: { status_code: 500, message: I18n.t("errors.internal.message"), | ||
help: I18n.t("errors.internal.help"), display_back: true } | ||
end | ||
end | ||
check_provider_exists | ||
end | ||
end | ||
helper_method :set_user_domain | ||
|
@@ -199,4 +178,38 @@ def check_user_role | |
def handle_bigbluebutton_error | ||
render "errors/bigbluebutton_error" | ||
end | ||
|
||
private | ||
|
||
def check_provider_exists | ||
# Checks to see if the user exists | ||
begin | ||
# Check if the session has already checked that the user exists | ||
# and return true if they did for this domain | ||
return if session[:provider_exists] == @user_domain | ||
|
||
retrieve_provider_info(@user_domain, 'api2', 'getUserGreenlightCredentials') | ||
|
||
# Add a session variable if the provider exists | ||
session[:provider_exists] = @user_domain | ||
rescue => e | ||
# Use the default site settings | ||
@user_domain = "greenlight" | ||
|
||
if e.message.eql? "No user with that id exists" | ||
render "errors/greenlight_error", locals: { message: I18n.t("errors.not_found.user_not_found.message"), | ||
help: I18n.t("errors.not_found.user_not_found.help") } | ||
elsif e.message.eql? "Provider not included." | ||
render "errors/greenlight_error", locals: { message: I18n.t("errors.not_found.user_missing.message"), | ||
help: I18n.t("errors.not_found.user_missing.help") } | ||
elsif e.message.eql? "That user has no configured provider." | ||
render "errors/greenlight_error", locals: { status_code: 501, | ||
message: I18n.t("errors.no_provider.message"), | ||
help: I18n.t("errors.no_provider.help") } | ||
else | ||
render "errors/greenlight_error", locals: { status_code: 500, message: I18n.t("errors.internal.message"), | ||
help: I18n.t("errors.internal.help"), display_back: true } | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters