php - Administrator account: Where, when and how? -


Where and how to create admin account / user for a personal website?

So what I am asking is the better technique for creating that first administrator account / user. In my case this is for a private webpage. I am talking about the account / user who That would be the owner of the application and if other administrators would need to create / promote, I think that you can make this person a root user?

Here are some other ways I saw in other websites / webpage.

Installation Wizard:
You see it a lot in blog software or forums. When you install the application, you will be asked to create an admin user, most likely it will not be possible for personal webpunication.

Installation file:
A file that you run to install your application.

Configuration files:
A configuration file that holds credentials for the administrator account.

Manually put it in a database:
Enter the administrator information in the database manually.

when:

on a bootstrapping step Has suggested seeds. RB I personally like using gem (with some extra which allows me to parse CSV files).

This action allows you to create rack work that can be implemented like this:

  rake db: bootstrap  

This initial administrator will create user, as well as any seeding data (such as a list of countries, or a default blog format etc.). The script is very flexible

How:

You can ask for it for a password or accept password parameters. Order to manage user permissions

Your administrator user will have to return the role of 'Administrator' (or the name you choose) on the list of roles associated with it. Typically I have 1 single role per user, mainly because I can use the role heritage (e.g., administrators also have editors by default) This means that in my database I have single "users for role_id" Field is found 0 is usually for administrator role, because it is created earlier.

Where:

User details with a specific file (or JML, or CSV) active admin role inside DB / BootStrap / User. Specifies. Rock DB: Boostprode parses the order that creates that file and creates the user accordingly.


Comments