Topic: Device Create a new user [Solved]

i am having the problem that once i am longed in. and i want to create a new user i am just not able to.

What i want to do is disable the ability to create users if you are not lodged in to create a private site just for members

I would show some code but i have no idea where to start looking

Last edited by moiseszaragoza (2012-06-04 22:26:21)

Re: Device Create a new user [Solved]

Quick update, i mean like the blogger.com warning where it then redirects you to the page you want.

http://www.DumpServer.co.uk Customizable RSS Aggregation

Re: Device Create a new user [Solved]

Well something like that.

Well what i want to do is as a admin be able to create a account for a user but i dont want the world be be able to sing up to this application

Re: Device Create a new user [Solved]

Sorry last comment was meant for my own thread... D'oh.


what are you using for authentication? I've worked with devise and that works quiet well.

You can create a admin role using devise then disable the user_sign up section for the users.

http://www.DumpServer.co.uk Customizable RSS Aggregation

Re: Device Create a new user [Solved]

Well i have my Admin already created. i was really happy that i was able to distinguish the admin from the users.

if i go to http://localhost:3000/users/sign_up and i am not login i am able to create a new user profile.

but i am am login as a user or a admin it takes me back to the homepage.

on my private pages controller i have a line that looks like
 

  before_filter :authenticate_user! 

this send me to the home page id i am not loged in

and that is perfect but exactly the opposite is happening when i try to create a user and u am already loged in as a admin

Re: Device Create a new user [Solved]

go to bundle open devise
and copy app/controllers/devise/registrations_controller.rb into your application

when you do look for

 prepend_before_filter :require_no_authentication, :only => [ :new, :create, :cancel ] 

then comment that line with a "#" or delete it