Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-04-26 14:28:24 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2018-05-04 14:52:55 +0300
commit3629dc338fbe6c351ce89a94caa4c238965ee33a (patch)
tree65263132237dc471c869b05b9071b773b7404924 /app/controllers/users
parent17b25bd263edaae70d5dae5fb035f5c28f9bb0cd (diff)
Display terms to a user
When terms are present, they can be viewed on `/-/users/terms`.
Diffstat (limited to 'app/controllers/users')
-rw-r--r--app/controllers/users/terms_controller.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/controllers/users/terms_controller.rb b/app/controllers/users/terms_controller.rb
new file mode 100644
index 00000000000..778e388ff5a
--- /dev/null
+++ b/app/controllers/users/terms_controller.rb
@@ -0,0 +1,19 @@
+module Users
+ class TermsController < ApplicationController
+ before_action :terms
+
+
+ layout 'terms'
+
+ def index
+ end
+
+ private
+
+ def terms
+ unless @terms = Gitlab::CurrentSettings.current_application_settings.latest_terms
+ redirect_to request.referer || root_path
+ end
+ end
+ end
+end