Clidus / gwl

Video game collection, wishlist and backlog tracker.
https://www.gamingwithlemons.com/
MIT License
18 stars 6 forks source link

Admin Account #62

Closed dinosaw closed 9 years ago

dinosaw commented 9 years ago

I did not see this explained in the documentation, but how exactly do I create an admin account? I attempted to go to www.url.com/admin but got a 404. I also changed the admin value in the MySQL database from 0 to 1 but that did not seem to work either.

Clidus commented 9 years ago

https://www.url.com/admin does work if you have admin permissions and 404's if you don't.

You were on the right track by changing the admin value from 0 to 1. All you need to do is log out and back in after doing that, as the permission is stored in the php session.

You can see this happening in: https://github.com/Clidus/gwl/blob/master/ignition_application/models/ignition/user.php

            // create session
            $newdata = array(
                'UserID' => $user->UserID,
                'Username' => $user->Username,
                'Admin' => $user->Admin,
                'DateTimeFormat' => $user->DateTimeFormat,
                'ProfileImage' => $user->ProfileImage == null ? $this->config->item('default_profile_image') : $user->ProfileImage
            );
            $this->session->set_userdata($newdata);

Once you log back in, you should see an admin link in the navigation.

capture

dinosaw commented 9 years ago

Oh geez. My problem was I hadn't signed in and out. Thank you for the clarification! :)

Clidus commented 9 years ago

No problem!