siamon123 / warehouse-inventory-system

Open source inventory management system with php and mysql
http://www.oswapp.com
MIT License
388 stars 233 forks source link

New users cannot login #5

Closed Sqt123 closed 8 years ago

Sqt123 commented 8 years ago

Hello, I have a problem, I have created few users, and somehow they cannot login to the system Could you help me fix this problem ?

Thanks.

siamon123 commented 8 years ago

Post this code in auth.php check if its return any id or not.

<?php require_once('includes/load.php'); ?> <?php $req_fields = array('username','password' ); validate_fields($req_fields); $username = remove_junk($_POST['username']); $password = remove_junk($_POST['password']);

if(empty($errors)){ $user_id = authenticate($username, $password); var_dump($user_id); // if($user_id){ // $session->login($user_id); // $session->msg("s", "Wel Come."); // redirect('home.php',false); // } else { // // $session->msg("d", "Sorry Username/Password incorrect."); // redirect('index.php',false); // }

} else { $session->msg("d", $errors); redirect('index.php',false); }

?>

Sqt123 commented 8 years ago

It returns string(1) "0"

siamon123 commented 8 years ago

can you login as a admin?

Sqt123 commented 8 years ago

Yes as admin I can login

On 17/09/2015 21:16, Siamon Hasan wrote:

can you login as a admin?

— Reply to this email directly or view it on GitHub https://github.com/siamon123/warehouse-inventory-system/issues/5#issuecomment-141171677.

siamon123 commented 8 years ago

its mean either username or password is wrong. function should return either user id or false.

halil-indo commented 8 years ago

thanks Siamon123. its work for me, just change in database.php

add require_once("../folder/includes/config.php") for xampp

siamon123 commented 8 years ago

Yea some how XAMPP new version has include bug. i am glade you fix it on yourself. give me Feedback on Facebook. thank you.

Sqt123 commented 7 years ago

Hi,

There is some nice stuff I've just found, I thought you might be interested, just take a look http://lessandra.ajlconsultingltd.com/e3wcr/90

Bests, d.reingoldas