My goal is to build a system (PHP + MySQL) where a user will have access to particular data only when logged in locally (from one of the office computers with a local IP), and to all the non-sensitive data when logged in both from a local network and from the outside (regular web host).
I already have the software running on a web server (Centos 5, PHP + MySQL), but I can't store on it any sensitive information, e.g. costs and other financial data. And I have a private network in my office where I can build any server configuration I need (Windows or Linux based server - any configuration is accepted). What I need is:
- if a user has an IP different from a predefined range, limit the access to only non-sensitive fields of the data;
- if a user has in IP from a white-list (local network), grant the access to all the data, including the sensitive data;
- if a user changes something from inside a local network, the changes will be visible on the outside immediately;
- if a user changes something from the outside (on a public server), the changes will also be visible on the inside immediately.
Currently I don't know whether to create two separate systems and somehow manage to synchronize data between them, or to store all the data locally and in the scripts check user's permissions, or to do something different. What I do know is that the financial data cannot be stored on the outside and cannot be accessed directly from the outside in any way.
I'll be glad for any the help with this problem, even with general direction that I may research.