summaryrefslogtreecommitdiff
path: root/users
diff options
context:
space:
mode:
Diffstat (limited to 'users')
m---------users/app/assets/javascripts/srp0
-rw-r--r--users/app/controllers/users_controller.rb14
-rw-r--r--users/app/views/sessions/new.html.haml1
-rw-r--r--users/app/views/users/_warnings.html.haml12
-rw-r--r--users/app/views/users/edit.html.haml7
-rw-r--r--users/app/views/users/new.html.haml1
-rw-r--r--users/leap_web_users.gemspec4
7 files changed, 19 insertions, 20 deletions
diff --git a/users/app/assets/javascripts/srp b/users/app/assets/javascripts/srp
-Subproject fff770a866b44abce6fe0fc5d5ffde034225436
+Subproject e7a0b830b8f994316a560001a9e7397422b184b
diff --git a/users/app/controllers/users_controller.rb b/users/app/controllers/users_controller.rb
index 6664bd7..4ce970b 100644
--- a/users/app/controllers/users_controller.rb
+++ b/users/app/controllers/users_controller.rb
@@ -3,6 +3,7 @@
#
class UsersController < UsersBaseController
+
before_filter :authorize, :only => [:show, :edit, :update, :destroy]
before_filter :fetch_user, :only => [:show, :edit, :update, :destroy]
before_filter :authorize_admin, :only => [:index]
@@ -33,20 +34,9 @@ class UsersController < UsersBaseController
def edit
end
- #
- # The API user update is used instead. Maybe someday we will have something for which this makes sense.
- #
- #def update
- # @user.update_attributes(params[:user])
- # respond_with @user
- #end
-
def destroy
@user.destroy
- respond_to do |format|
- format.html { redirect_to(admin? ? users_path : root_path) }
- format.json { head :no_content }
- end
+ redirect_to admin? ? users_url : root_url
end
end
diff --git a/users/app/views/sessions/new.html.haml b/users/app/views/sessions/new.html.haml
index 81a55b8..c915968 100644
--- a/users/app/views/sessions/new.html.haml
+++ b/users/app/views/sessions/new.html.haml
@@ -1,5 +1,6 @@
.span1
.span9
+ = render :partial => 'users/warnings'
%h2=t :login
= simple_form_for @session, :validate => true, :html => { :id => :new_session, :class => 'form-horizontal' } do |f|
= f.input :login, :required => false, :label => t(:username), :input_html => { :id => :srp_username }
diff --git a/users/app/views/users/_warnings.html.haml b/users/app/views/users/_warnings.html.haml
new file mode 100644
index 0000000..7e0b2ce
--- /dev/null
+++ b/users/app/views/users/_warnings.html.haml
@@ -0,0 +1,12 @@
+%noscript
+ %div.alert.alert-error=t :js_required
+#cookie_warning.alert.alert-error{:style => "display:none"}
+ =t :cookie_disabled_warning
+:javascript
+ document.cookie = "testing=cookies_enabled; path=/";
+ if(document.cookie.indexOf("testing=cookies_enabled") < 0)
+ {
+ document.getElementById('cookie_warning').style.display = 'block';
+ } else {
+ document.getElementById('cookie_warning').style.display = 'none';
+ } \ No newline at end of file
diff --git a/users/app/views/users/edit.html.haml b/users/app/views/users/edit.html.haml
index f06df44..08e9dc3 100644
--- a/users/app/views/users/edit.html.haml
+++ b/users/app/views/users/edit.html.haml
@@ -1,6 +1 @@
-= render 'edit'
-
-
-=# user_form_with 'login_and_password_fields', :legend => :update_login_and_password if @user == current_user
-=# render 'cancel_account'
-
+= render 'edit' \ No newline at end of file
diff --git a/users/app/views/users/new.html.haml b/users/app/views/users/new.html.haml
index b1953e1..f8d14b5 100644
--- a/users/app/views/users/new.html.haml
+++ b/users/app/views/users/new.html.haml
@@ -6,6 +6,7 @@
.span1
.span9
+ = render :partial => 'warnings'
%h2=t :signup
= simple_form_for(@user, form_options) do |f|
%legend= t(:signup_message)
diff --git a/users/leap_web_users.gemspec b/users/leap_web_users.gemspec
index c57937f..013b44a 100644
--- a/users/leap_web_users.gemspec
+++ b/users/leap_web_users.gemspec
@@ -11,8 +11,8 @@ Gem::Specification.new do |s|
s.homepage = "http://www.leap.se"
s.summary = "User registration and authorization for the leap platform"
s.description = "This this plugin for the leap platform provides user signup and login. It uses Secure Remote Password for the authentication."
-
- s.files = Dir["{app,config,db,lib}/**/*"] + ["Rakefile", "Readme.md"]
+
+ s.files = Dir["{app,config,db,lib}/**/*"] + ["Rakefile"]
s.test_files = Dir["test/**/*"]
s.add_dependency "leap_web_core", LeapWeb::VERSION