summaryrefslogtreecommitdiffstats
path: root/app/helpers
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2020-08-29 06:51:21 +0000
committerGo MAEDA <maeda@farend.jp>2020-08-29 06:51:21 +0000
commit8900eb6eb5994310e3f957398cc21a512c5951ab (patch)
tree22c37392fef2ef6f750dbd9bda18c90c6cfd45b9 /app/helpers
parentbe7f5e21faa05bdc483d1b58c8887ff499082073 (diff)
downloadredmine-8900eb6eb5994310e3f957398cc21a512c5951ab.tar.gz
redmine-8900eb6eb5994310e3f957398cc21a512c5951ab.zip
Backup codes for 2fa auth (#1237).
Patch by Felix Schäfer. git-svn-id: http://svn.redmine.org/redmine/trunk@19990 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/twofa_helper.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/app/helpers/twofa_helper.rb b/app/helpers/twofa_helper.rb
new file mode 100644
index 000000000..c7ede1ceb
--- /dev/null
+++ b/app/helpers/twofa_helper.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+# Redmine - project management software
+# Copyright (C) 2006-2020 Jean-Philippe Lang
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+module TwofaHelper
+ def require_active_twofa
+ Setting.twofa? ? true : deny_access
+ end
+end