siamon123 / warehouse-inventory-system

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

Sign Up page missing #20

Open osamawasim opened 7 years ago

osamawasim commented 7 years ago

Can't sign up or login new users, even new users are made from admin panel. help please

bateller commented 7 years ago

You should be able to login initially with the admin/admin credentials.

This is assuming you've created an SQL DB with the following structure: https://github.com/siamon123/warehouse-inventory-system/blob/master/oswa_inv.sql

Outside of that, the program is written such that only "Admin Users" can add new users via the "User Management->Manage Users" section of the site.

If you want to add users outside of this you can create your own call to SQL.

Here is the relevant hook in 'add_user.php':

$name = remove_junk($db->escape($_POST['full-name'])); $username = remove_junk($db->escape($_POST['username'])); $password = remove_junk($db->escape($_POST['password'])); $user_level = (int)$db->escape($_POST['level']); $password = sha1($password); $query = "INSERT INTO users ("; $query .="name,username,password,user_level,status"; $query .=") VALUES ("; $query .=" '{$name}', '{$username}', '{$password}', '{$user_level}','1'"; $query .=")"; if($db->query($query)){ //sucess $session->msg('s',"User account has been creted! "); redirect('add_user.php', false); } else { //failed $session->msg('d',' Sorry failed to create account!'); redirect('add_user.php', false); }