-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into templates
- Loading branch information
Showing
16 changed files
with
212 additions
and
60 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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class ActiveStorage::BaseController < ActionController::Base | ||
before_action :enforce_signed_in | ||
include ActiveStorage::SetCurrent | ||
protect_from_forgery with: :exception | ||
|
||
self.etag_with_template_digest = false | ||
|
||
protected | ||
|
||
def enforce_signed_in | ||
# If not restricted, the user is signed in or the environment is test, allow all content. | ||
return true if !SiteSetting['RestrictedAccess'] || user_signed_in? || Rails.env.test? | ||
|
||
redirect_to '/', status: :forbidden | ||
false | ||
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
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<%= content_for :title, "Welcome to #{SiteSetting['SiteName']}" %> | ||
|
||
<%- if request.fullpath != '/' %> | ||
<div class="notice is-danger"> | ||
<div class="container"> | ||
<p>You need to sign in before you can access this site.</p> | ||
</div> | ||
</div> | ||
<% end %> | ||
|
||
<%= raw(sanitize(render_markdown(SiteSetting['RestrictedAccessFrontPageText']), scrubber: scrubber)) %> | ||
|
||
<%- if sso_sign_in_enabled? %> | ||
<%= link_to "SSO Sign in", new_saml_user_session_path, class: 'button is-extremely-large is-filled' %><br /> | ||
<% end %> | ||
|
||
<%- if devise_sign_in_enabled? %> | ||
<%= link_to "Sign in", new_user_session_path, class: 'button is-extremely-large is-muted is-outlined' %><br /> | ||
<%= link_to "Sign up", new_user_registration_path, class: 'button is-extremely-large is-muted is-filled' %><br /> | ||
<% 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
9 changes: 9 additions & 0 deletions
9
db/migrate/202309141441_disable_needs_author_attention_flag.rb
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class DisableNeedsAuthorAttentionFlag < ActiveRecord::Migration[7.0] | ||
def up | ||
PostFlagType.unscoped.where(name: "needs author's attention").update_all(active: false) | ||
end | ||
|
||
def down | ||
PostFlagType.unscoped.where(name: "needs author's attention").update_all(active: true) | ||
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
Oops, something went wrong.