Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 02ae5e1f9e
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (21 sloc) 0.557 kB
class AdminsController < ApplicationController
skip_before_filter :require_admin_in_system, :require_login
before_filter :require_no_admin
def new
@user = User.new
end
def create
@user = User.new(permitted_params.user)
@user.password_required = true
@user.is_admin = true
if @user.save
redirect_to new_session_url, :notice => t(:admin_user_created_successfully)
else
render :action => 'new'
end
end
private
def require_no_admin
redirect_to new_session_url unless User.no_admin_yet?
end
end
Jump to Line
Something went wrong with that request. Please try again.