aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/registrations_controller.rb
diff options
context:
space:
mode:
authorLuc Donnet2014-10-31 15:47:24 +0100
committerLuc Donnet2014-10-31 15:47:24 +0100
commitc9fd03422743d3d716bbd7199184c035c1b0d4c9 (patch)
tree291c67ac01b05b91d9c998edbfdf0528f3ed45be /app/controllers/registrations_controller.rb
parent85d72f54aaba1f1eca474abbf3923a9528a68625 (diff)
downloadchouette-core-c9fd03422743d3d716bbd7199184c035c1b0d4c9.tar.bz2
Fix devise flash message when signin and refuse user creation if Rails config not accepts Refs #0029417
Diffstat (limited to 'app/controllers/registrations_controller.rb')
-rw-r--r--app/controllers/registrations_controller.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb
new file mode 100644
index 000000000..f0ac420ce
--- /dev/null
+++ b/app/controllers/registrations_controller.rb
@@ -0,0 +1,17 @@
+ class RegistrationsController < Devise::RegistrationsController
+
+ prepend_before_filter :accept_user_creation, :only => [:new, :create]
+
+ private
+
+ def accept_user_creation
+ puts "J'y passe"
+ if !Rails.application.config.accept_user_creation
+ redirect_to root_path
+ return false
+ else
+ return true
+ end
+ end
+
+ end