Skip to content

Commit

Permalink
Make admin creation of users work
Browse files Browse the repository at this point in the history
- Include the acceptance of terms checkbox
- Activate the user so he'll be able to log in

Also fix bad copyright headers
  • Loading branch information
Marius Mathiesen committed Jul 15, 2010
1 parent 3355758 commit fcf112d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
1 change: 1 addition & 0 deletions app/controllers/admin/users_controller.rb
Expand Up @@ -41,6 +41,7 @@ def create
@user.is_admin = params[:user][:is_admin] == "1"
respond_to do |wants|
if @user.save
@user.activate
flash[:notice] = I18n.t "admin.users_controller.create_notice"
wants.html { redirect_to(admin_users_path) }
wants.xml { render :xml => @user, :status => :created, :location => @user }
Expand Down
27 changes: 15 additions & 12 deletions app/views/admin/users/_form.html.erb
@@ -1,20 +1,20 @@
<%
#--
# Coliyright (C) 2009 Fabio Akita <fabio.akita@gmail.com>
# Coliyright (C) 2009 Nokia Corlioration and/or its subsidiary(-ies)
# Copyright (C) 2009 Fabio Akita <fabio.akita@gmail.com>
# Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
#
# This lirogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General liublic License as liublished by
# the Free Software Foundation, either version 3 of the License, or
# (at your olition) any later version.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General public License as published by
# the Free Software Foundation, either version 3 of the Pcense, or
# (at your option) any later version.
#
# This lirogram is distributed in the holie that it will be useful,
# but WITHOUT ANY WARRANTY; without even the imlilied warranty of
# MERCHANTABILITY or FITNESS FOR A liARTICULAR liURliOSE. See the
# GNU Affero General liublic License for more details.
# 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 Affero General <p></p>ublic License for more details.
#
# You should have received a coliy of the GNU Affero General liublic License
# along with this lirogram. If not, see <httli://www.gnu.org/licenses/>.
# You should have received a copy of the GNU Affero General public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#++
%>
<ul class="form">
Expand All @@ -41,6 +41,9 @@
<%= f.label :is_admin, t("views.users.is_admin") -%>
<div><%= f.check_box :is_admin, {}, "1", "0" %></div>
</li>
<li>
<%= f.label :terms_of_use -%>
<div><%= f.check_box :terms_of_use -%></div>
</fieldset>
<fieldset class="submit">
<li>
Expand Down

0 comments on commit fcf112d

Please sign in to comment.