havok89 / Hoosk

Hoosk Codeigniter CMS
http://hoosk.org
Other
128 stars 87 forks source link

Unable Login #33

Closed CallumBee closed 4 years ago

CallumBee commented 7 years ago

Couple of issues after setting up, I am unable to login with the supplied username and passwords, resetting doesn't send any links to reset, digging deep and get the way is creates the links and doing it that way and resetting said password still nothing.

CallumBee commented 7 years ago

Scratch above, Fixed it with a coupe of tweaks: File: hoosk/hoosk0/controllers/admin/Admin.php Line 68.

Replace: $password = $this->input->post('password');

With: $password = md5($this->input->post('password').SALT);

Then did this: File: hoosk/hoosk0/controllers/config/config Line 383.

Set: $config['cookie_domain'] = ".".EMAIL_URL;

To: $config['cookie_domain'] = "";

And we are all good again.

milstrike commented 7 years ago

I did the same thing.., but still nothing..,

3xmo commented 7 years ago

The problem here is that there is no database entry for the admin user only for a demo user.

Workaround: go to "hoosk/hossk0/Hoosk_model.php"

and insert the following function: " function createUser2() { // Create the user account $data = array( 'userName' => 'admin', 'email' => 'test@test.com', 'password' => md5('password'.SALT), ); $this->db->insert('hoosk_user', $data); }"

The go to "hoosk/hossk0/controllers/admin/Admin.php" and edit this funtion: "public function login() { $this->data['header'] = $this->load->view('admin/headerlog', '', true); $this->data['footer'] = $this->load->view('admin/footer', '', true); $this->load->view('admin/login', $this->data); }" to this: "public function login() { $this->Hoosk_model->createUser2();

    $this->data['header'] = $this->load->view('admin/headerlog', '', true);
    $this->data['footer'] = $this->load->view('admin/footer', '', true);
    $this->load->view('admin/login', $this->data);
}"

Doing so a new user will be created when you visit to the login page. When you have visited the login page once you can revert the edits and everything will be fine.

You may want to check the database ("users") how many new admin accounts you have created by doing this ;).

Cheers

havok89 commented 7 years ago

The demo account has full admin access and can be used to create a new account once logged in

samuelesantoni commented 7 years ago

Hi, i have the same problem. If i do the login i can't enter. Some solution please?

kingdominc commented 7 years ago

I had this issue at first also. I was able to solve by modifying the cookie_domain. Since I was using an IP as my base url (which is a bad idea) I had to remove the prefix of "." from the cookie_domain in the config.php file.

GaneshKandu commented 6 years ago

I did the same thing but still not working

GaneshKandu commented 6 years ago

installation works in root only if you install in sub-directory it will not works with login its issue of cookie session name

mohsen-sojoudi commented 5 years ago

If you are using XAMPP or any local server Just add the following line in your index.php at the root folder session_start();