Hardware Reference
In-Depth Information
You can build your own pages using any combination of applets that you desire. This flexibility allows you
to ignore certain applets if they come from an IP address range outside the local network or even build a page
specifically for the machine. For example, knowing that your DHCP server always provides your kitchen PC with an IP
of 192.168.1.140, you can build a page that only includes a list of recipes and cooking information.
N If you access a web page through any form of proxy, including routers, you may not be able to get the correct
address, because the server will only see the IP of the proxy unless the proxy is so configured with “X-Forwarded-For”
header.
Note
With version 3.0 of Minerva, this process was grown by means of a browser factory. If you have multiple kiosk-like
devices at home, you can now write:
$appman = getBrowser()->createManager();
$appman->init();
This code creates an application manager specific to the client machine. The getBrowser method is held in
system/browserlist.conf, to translate the client IP into a specific browser object that details its function and approxiamate size.
This is a two-step process. The first maps the IP to a browser type (e.g., touchscreen, PC), like this:
$ipaddr = getIPAddress();
$style = $_GET['WRP000X0_style'];
$dostyle = array_key_exists('WRP000X0_dostyle', $_GET) ? $_GET['WRP000X0_dostyle'] : "";
switch($ipaddr) {
case "192.168.1.132": // kitchen tablet PC (height accounts for border)
$style = STYLE_TABLET_LARGE;
break;
case "192.168.1.131": // hall-mounted iPod Touch
$style = STYLE_TABLET_SMALL;
break;
default:
$browser = $_SERVER['HTTP_USER_AGENT'];
if (strstr($browser, "iPhone")) {
$style = STYLE_TABLET_SMALL;
} else if (strstr($browser, "iPad")) {
$style = STYLE_TABLET_LARGE;
}
break;
}
 
Search WWH ::




Custom Search