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

Setting user previlledges #4

Closed rakhitanwar closed 7 years ago

rakhitanwar commented 9 years ago

Hi,

Thanks for the great tool, I want to add two users in the application one is admin and second is for entries only who can not add or remove users.

Thanks

siamon123 commented 9 years ago

you have to write new function for that. if you can wait two more weeks.i will help you out. i am currently working on multi level user management system. Thank you.

rakhitanwar commented 9 years ago

Thanks for prompt reply. waiting for solution . Thanks

ghost commented 9 years ago

Ey, this is good topic. I'm camping here.

ghost commented 9 years ago

I hope product pictures and user pictures could be added in this system too. That would be like so awesome.

siamon123 commented 9 years ago

you have to add a new column in user table

user_level INT(11) NOT NULL

Then put this function in sql.php file

/--------------------------------------------------------------/ /Check User Level /--------------------------------------------------------------*/ function check_user_level($level) { global $session; $current_user = current_user(); if($current_user['user_level'] <= (int)$level){ return $level; } else { $session->msg("d", "Sorry you don't have permission to view this page."); redirect('home.php', false); } }

now you just have to call the function check_user_level(1); after checking isUserLoggedIn(true). Remember 1 is admin privilege. Hope it's will solve you'r problem. @exoticmankey i will add it in near feature. Thank you!

rhonpicache commented 9 years ago

hi, i already got into the login screen. the problem is i cannot sign in. i used the default admin admin. i even created a new user on phpmyadmin. still cannot access. hope you can help me. thanks

siamon123 commented 9 years ago

Did you put your database info in config.php?

rhonpicache commented 9 years ago

thank you for your response. i kinda figured it out. nice tool. thank you ^^

ghost commented 9 years ago

Ey man can you let us know how you figured the thing out? thanks

rhonpicache commented 9 years ago

under config.php <?php // Database Constants define('DB_SERVER','localhost'); define('DB_USER','root'); define('DB_PASS',''); define('DB_NAME','inventory'); //inventory is my database name

?>

under database.php

<?php include_once('config.php');

$con = mysqli_connect('localhost','root','');

if(!$con){ die('

 Database Connection Failed '.mysqli_connect_error().'
' ); } else { $select_db = $con->select_db('inventory'); if(!$select_db){ die('Sorry failed to select Database'); } }

?>

siamon123 commented 9 years ago

are you using xampp server?

rhonpicache commented 9 years ago

yep

siamon123 commented 9 years ago

Some xampp user having include file issue.i updated database.php, if it's work please let me know and i am sorry for respond you late. Thank you!

hidelberto commented 8 years ago

Your "Check User Level" script doesn't run. I'm trying to call check_user_level(1); after checking isUserLoggedIn(true) but doesn't work. Could you check your code if something is missing?

siamon123 commented 8 years ago

i might missing something, sorry not sure but i next version i am take care of it. i just need little time to finish sales and report section. Thank you. screen shot 2015-09-23 at 12 36 28 am

hidelberto commented 8 years ago

Thank you. Your inventory system is great!! I will waiting for the next version.

ghost commented 8 years ago

Hi Siamon the great creator of this inventory system, how to I see the latest updates you have made with the codes? I mean the one with dates? thank you very much!

hidelberto commented 8 years ago

Hi siamon i just found a solution: you must call the function check_user_level(0) instead of (1)

siamon123 commented 8 years ago

i have plan to update on Sunday Night @exoticmankey , i think you missing something, it's should not be 0 @hidelberto.

ghost commented 8 years ago

siamon which area should i monitor to find out if you have already updated with the new codes? tq

hidelberto commented 8 years ago

Hi siamon, I am wondering when you plan to do the next inventory system update? thanks...

siamon123 commented 8 years ago

Sorry guys, only categories section didn't change that much @exoticmankey. i just push it @hidelberto Thank you.

ghost commented 8 years ago

@siamon123 I am voluteering to do test unit(s) document from your inventory software. I really like it.

siamon123 commented 8 years ago

it's will be great @exoticmankey

ghost commented 8 years ago

Yes this my return favor to your great app @siamon123 the great! harhar

SIMONTSAO commented 8 years ago

Hello slamon: when I run Sales Report --> Sales by dates, I get this message

  1. "Parse error: syntax error, unexpected '[' in /home/xxx/sale_report_process.php on line 117"
  2. Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/xxx/includes/load.php:2) in /home/xxx/includes/session.php on line 2

    how can I solve the problem ?

siamon123 commented 8 years ago

i just modify edit_sale And sale_report_process.php files just re-download those two files. Thank you @SIMONTSAO for Letting me.