Introduction:
Here is a package I put together to allow fellow who use LTSP for
Internet Cafe. I created a simple python for client side and enter the bills
to a MySQL database. For displaying all workstations status and all reports,
i use phpSiCafe with a litle modifications. I hope you enjoy. There still are
some bugs since I quickly packaged them together.
Requirement:
- php 3 or higher [I use php4.0.6 and i don't know if other version will
work since i don't know much about php :-)=- ]
- MySQL server, MySQL module for python and php.
- python 2.0 or higher [ i use v 2.1.1]
- wxpython and wxpython-gl (the version is deppends on your python version)
- wxGTK and wxGTK-gl (the version is deppends on your python version)
- LTSP v2.08 or higher [Any version of LTSP should work i think]
How to install:
- Extract the package ( tar -zxvf ltsp_phpSiCafe-0.0.1.tgz )
- Create the tables (sicafe_log table and sicafe_status table) in your
MySQL database. The tables structure is include in the distribution and
you can use it with mysql command.
Example: 'mysql -u dbuser dbname < ltsp_phpsicafe.sql'.
- Open the file inc-config.php in billing/ with your favourite editor
and change the values for any variables to fit your environment
(don't forget the MySQL varibles!).
- Copy billing/ dir to somewhere in your webserver directory
Example: 'cp -R billing/ /var/www/html/'.
- Open http://localhost/your-installation-dir/ on your browser. Enter
your Admin password (which you set in inc-config.php) then Sign-in.
Add your workstations manually.
- Edit user.py inside "EDIT YOUR OWN CONFIGURATIONS HERE" section.
Change the variables that suit to your configurations (esp MySQL)
- Copy user.py to somewhere which everybody can't access it.
Example: 'cp user.py /your/private/dir/'. where the dir mod is 700.
It's dangerous if someone can read user.py since there's your MySQL
configuration in it.
- Make user.py executed everytime user login from xDM.
I use GDM, here's what i do:
Add this line into /etc/X11/gdm/PreSession/Default :
python /path/to/your/user.py
So only the system can access and read the file.
For anyone use XDM add the line into /etc/X11/xdm/GiveConsole.
I don't know any other xDM, please read the doc to do similar thing.
How it works:
- User login from xDM, and it will display the billing system.
- When user wants to finish his session, click "finish" button.
- The admin, who monitor the billing, should set the workstation status
to 'Idle' from the browser. If it is 'Stopped', user cannot login
to the workstation.
Installation notes:
Make sure all workstations status are 'Idle' before it is used and
after a user end his session.
Contact Info:
This is a first cut of the modified script, and as such is pretty rough.
If you have comments or suggestions, please E-mail me to
pradity@yahoo.com
Todo:
- Clean up the code
- Add more docs
- Add logging of some kind