Page 1 of 2

(^o^) Cyber Coffee Application (^o^)

Posted: Thu Jan 20, 2005 12:24 am
by NightWalker
Hi! I'm developing a Cyber Coffee application, the application must have a listing of the computers the cyber coffee is running and it should be able to "block" a client PC from a server PC.

I did two application in C++ Builder 5 (a client and a server application) I used the socket components and it works just fine, in my server app I use the ServerSocket component and in the client app I use the ClientSocket component, my server application runs an begans listening for clients and when the client apps get activated the socket connection is open, so I can have n client app requesting connections to one server app which is constantly listening for clients. Is this the best practice to do so?

When I use the Socket componets I set port property to 1024 (I do this because it was what the borland chat example did) but I'm not sure why, does it have to be this port number? what's the diference if I use other port?

Another feature of the system I'm developing is that I need to control the client PC all the time, so I can't let the client application to shut down! (or having a customer shutting it down) I want the client PC to run the client app in background all the time (even if the client PC is resetted), so the server app can be used to lock and unlock the client app. Is this done using services right?

How can I lock (disable) the keyboard and mouse events on the client PC, so an user
is not able to hit "crtl + alt + del" or "alt + f4" to shut down the client application / service??

Finally although I did both the client and server applications using C++ builder (for testing and learning about sockets purposes), the server application should run from a web page for this I'm using PHP, is there a way to have the client application/service developed in builder to comunicate to a web page using PHP??

Even better can I do the whole system using web format? (both client and server in PHP)

What if I want the server/clients to run diferent OS (Windows/Linux/Mac)?

Thanks in Advance!

Posted: Thu Jan 20, 2005 12:40 am
by feyd
  • you can use any port you wish... basically..
  • services are the way to go
  • locking ctrl-alt-del is fairly tough, but you can get to it easier by setting the machine into kiosk mode.. although I don't know how directly.. check msdn: http://msdn.microsoft.com/library/

    Alt-F4 is easily avoided by the message pump system in windows applications. Other things you'll need to turn off is the task manager (possible through Kiosk mode I believe)

    There may be some registry hacks that can do this, however my experience with trying to do these things for video games is, it's completely against Microsoft usage policies, so we never really got to test our theories much.
  • it's possible to create a new server with php, however actual server applications are often better, at least in response times for this because they are compiled and have less overhead to deal with (most often). I'm not sure what you'd want the client application to communicate with a webpage for, other than telling the OS to switch to the home page or similar.
  • You may want to look into skinning Mozilla or Firefox using XUL to completely mask out the "normal" controls, and block the hotkeys...

Posted: Thu Jan 20, 2005 11:21 am
by NightWalker
* I also would have to block the "Start" and "Pop up Menu" Keys...

* Do you mean that it is hard to block the keys from a web page? what about in the C++ Builder app? I know that I have to use some of the properties of the form like KeyPreview and some events like OnKeyDown but I don't remember how to block the key combinations and the special keys like Start and such.

* The Kiosk Mode is when a web browser window appear maximized and has no tool bars, right? But in this mode the window still has the "window" buttoms like Minimize, Maximize and Close, can I diasble or disappear these?

* I'll rather do the whole application using c++ builder, but one of the requirements is that it has to be on web format!. I could go with the Client app in C++, but the Server commands to the Client Machines have to be triggered from a web page!.

Posted: Thu Jan 20, 2005 11:25 am
by onion2k
Whats a 'cyber coffee'?

Posted: Thu Jan 20, 2005 11:39 am
by feyd
the keys cannot be blocked via a web page.

you're thinking about full-screen mode.. kiosk mode has no controls whatsoever.

the start menu and alt-text is another challenge block.. alt-text being somewhat easier, as it just sends a message to the focus'd app. The start menu can be disabled via registry entries.

I still don't understand your "web format" ... It may be best to create a fullscreen modal dialogue box, and use the IE or Mozilla/Firefox backends for it.. and use registry entries to disable the task bar, task switcher, among other things..

Personally, I'd prefer just re-engineering Firefox. However, since most pages are intended for IE, you may need to use that exclusively.

Posted: Thu Jan 20, 2005 12:22 pm
by timvw
there is a reason why you probably will have a port number >= 1024:
on linux (and other *nix) only root can bind with a portnumber < 1024

your server-app appears to work without problems. (porting to a different OS/platform depends on what libraries you are using. Don't know how well that goes with the borland tools.) Anyway, there is more than enough portable code out there that does what you are looking for (gcc, java, ...)

not allowing the client(pc) to do some operations, requires you to contact a good sysadmin ;) as feyd already mentionned kiosk mode (windows policy editor etc can come in handy too).

You probably want client (where you have no control what they do), then have a webapp that accepts input from the client, and forwards it to the server with fsockopen etc...

think you will have to specify more what you want to do

Posted: Thu Jan 20, 2005 5:31 pm
by Cronikeys
Perhaps find an open sourced browser and then add some C++ code to THAT which disallows the buttons ;) that way the whole program will be in it's own browser :)

Posted: Thu Jan 20, 2005 5:41 pm
by timvw
A browser should browse, not control my keys :p

If my browser would insist on controlling my keys, it's probably Internet Exploder :p

Posted: Fri Jan 21, 2005 11:05 pm
by NightWalker
onion2k wrote:Whats a 'cyber coffee'?
A Cyber Cofee is a "store" where you go and "rent" a computer with internet conection, you can use the computer, browse the web, buy snaks, etc. and they charge you a fee.
feyd wrote:the keys cannot be blocked via a web page.
I guess I'll have to use Borland C++ for the Client application then..
feyd wrote:you're thinking about full-screen mode.. kiosk mode has no controls whatsoever.

the start menu and alt-text is another challenge block.. alt-text being somewhat easier, as it just sends a message to the focus'd app. The start menu can be disabled via registry entries.
How do you programatically set this kiosk mode? is there a PHP function to do so?
are there PHP functions for the key blocking routines?
feyd wrote:I still don't understand your "web format" ... It may be best to create a fullscreen modal dialogue box, and use the IE or Mozilla/Firefox backends for it.. and use registry entries to disable the task bar, task switcher, among other things..

Personally, I'd prefer just re-engineering Firefox. However, since most pages are intended for IE, you may need to use that exclusively.
The "web format" thing is just that at least the Server application has to run on a web page... using HTML and PHP.
timvw wrote:there is a reason why you probably will have a port number >= 1024:
on linux (and other *nix) only root can bind with a portnumber < 1024

your server-app appears to work without problems. (porting to a different OS/platform depends on what libraries you are using. Don't know how well that goes with the borland tools.) Anyway, there is more than enough portable code out there that does what you are looking for (gcc, java, ...)

not allowing the client(pc) to do some operations, requires you to contact a good sysadmin ;) as feyd already mentionned kiosk mode (windows policy editor etc can come in handy too).

You probably want client (where you have no control what they do), then have a webapp that accepts input from the client, and forwards it to the server with fsockopen etc...

think you will have to specify more what you want to do
What do you mean with "contact a good sysadmin"?

What I want to do is:

* I have a Sever PC and several Client PC's connected via a LAN.
* The Server PC should be running Linux (*).
* The Client PC's should be running Windows XP (*).
(*) at least, It would be great if I could have a nice plataform independet system!

* I have a MySQL Data Base running on the Server PC.
* I have a Apache 2 HTTP Server running on the Server PC.
* I have PHP 4 installed on the Server PC.

The system I'm developing should be able to control everything in the "Cyber Cafee" bussiness - The bussiness owner / employee should be able to run the bussiness using this system.

The "Cyber Coffee" system works as follows:

* There are several computers (Client PC's) ready for rent.
* There is a person (employee) that's in charge of selling snacks and "allow" the customer to use a PC.
* The customer ask the employee for a PC.
* The employee checks which PC's are available for use.
* The employee "un-blocks" the selected PC, so the customer can use it.
* The customer can buy snaks and other miscelaneous things.
* When the customer decides he/she has had enough, ask the employee for checkout.
* The employee calculates how much the customer ows, and charges him/her.
* The customer pays and receive an invoice with all the products/services he/she has consumed.

Basically the system should manage all that, the Accounting, employee information and stadistics.

There is also a "On Line" reservation system, where a customer (through a web page) can register in the system as a client (gets an id and password) and is able to make a reservation to use a PC at a particular time.

The employees have also a id and password to access the system and are allowed to enter in the modules where they are allowed acording to their user privilegies.

The system specifications:

* The system has to be made on dinamyc web pages, I have several web pages (for the diferent modules in the system) that access the data base and do the proper operations.
* I'm using PHP 4 as my dinamic pages Server.
* I'm using MySQL as my data base Server.
* I'm using Apache 2 as my HTTP Server.
* All this is running on the Server PC.
* I'm also using Dreamweaver MX for the HTML editing and page layouts and Flash MX for some layout effects and animations -- user friendly interface ^^.
* As you may have noticed by now, the system in the Server PC has to be able to have control over the Client PC's.
* I have a web page that "shows" which Client PC's are available for use by the customers.
* From this web page I should be able to "block" or "un-block" a Client PC.

* Of course this means that the Client PC's should have some sort of mechanism that blocks the computer and doesn't allow an unautorized user to use the computer.
* This mechanism shoul work under any circunstances, even if the user resets or turn off and on again the PC.
* The Client PC can use a "real" application (not a web page, like the C++ builder one I did) to implement this mechanism (although I'd like to know if it is possible to do it using a web page)


As I explained before I made two applications in C++ Builder, a Client one and a Sever one, that comunicate using sockets, and are able to send and receive messages and I managed to perform actions (such as maximize and minimize the application window) on the Client PC using the Server application.
In C++ Builder I can make the application form "stay on top", take out the bars, maximize it and it will take the whole screen, if I capture the key events, I can prevent any way of shuting down the application.

* The way I can make the C++ Builder Client application to run under any circunstances is developing it as service, right?
* Can I implement the same functionality of the C++ Builder Client application using a web page?
I was thinking.... If the only way to do this is by re-engeneering an open source web browser.... umh... what if instead of understanding someone else's code... I could make a very simple web browser using C++ Builder.... that would be the same as having C++ Builder application that can browse web pages.... I'm not sure if I can implement it as a service too... but if I can... and if I can connect using sockets from a web page... this opens some interesting paths.... uhmmm...
* I have to substitute the C++ Builder Server application with some mechanism in the web page in the Server PC. Are there PHP functions to implement the socket connections? can I connect from the C++ Builder Client aplication to a PHP web page using sockets?

I think this should clear some doubts... ^^

Posted: Fri Jan 21, 2005 11:39 pm
by feyd
This sounds more complicated than it has to be..

here's something I envision:
  • Server and computers connected via a LAN .. Potentially wireless.
  • Set your server up as a proxy/router for the entire network. So all traffic inside the shop has to go through it.
  • Automate allowance and denial through the proxy serving, use standard software, not custom stuff.
  • Have one "client" be the adminstrator of the server. Could potentially just make a secured page, on some low level port (1024+) that a machine can connect to, log in, and control the proxy settings.
  • It should be possible to set the proxy to deny any particular client based on timeout values you can set up.. like 30 minutes after "first" access.
You can create a small application (agent) that checks to see that the browser window is open and responding, shut it down if needed, and restart it automatically if shutdown. You can also "watch" the user's inputs (mouse, keyboard, whatever) .. and after a period of inactivity, tell the browser to go to its home page (which is ~hardwired to your server.)

Posted: Fri Jan 28, 2005 8:46 pm
by NightWalker
Actually it has to be done in the way I described...

Posted: Mon Feb 07, 2005 11:32 am
by NightWalker
any help?

Posted: Mon Feb 07, 2005 11:41 am
by feyd
NightWalker wrote:any help?
with what? You basically ended the conversation with your previous last post. If you want someone to write it for you, good luck. Post a request in either the Job Hunt or Volunteer boards, as this area is not for enlisting a freelancer. Should probably expect to have to pay someone, as this is a revenue generating device...

Posted: Mon Feb 07, 2005 12:03 pm
by NightWalker
feyd wrote:Should probably expect to have to pay someone, as this is a revenue generating device...
No it isn't!, it's an assignment for the university, and I dont want someone to write code for me I just want some help in the technologies I'm not an expert in...

Posted: Mon Feb 07, 2005 12:32 pm
by feyd
we've already pointed you in directions to research. That's all we will likely do.