havok89 / Hoosk

Hoosk Codeigniter CMS

Home Page:http://hoosk.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable Login

callumb opened this issue · comments

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.

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.

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

commented

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

commented

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

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

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.

I did the same thing but still not working

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

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