Quote from: sottwell at Jan 13, 2014, 07:50 PMWell, you would have to. You cannot use one of those addresses to connect through the live Internet. However, I would presume that each of the offsite locations has its own dedicated IP address (or block), so you can know when someone is coming in from one of those locations.
Well, I decided to use HTML5 and local storage to try to solve my problem. I do not know if it is going to work for everything, but it is working in my office. More testing to follow.
The code I am using(on a chunk called after the user logs on) follows. The Allow_Internal_External is a snippet that retrieves an extended attribute telling the user that they can or cannot log in away from a "designated" timeclock device. The timeclock device is "designated" as such by writing a matched pair to It's localStorage using localStorage.setItem('Timeclock',some Value):
<script>
function CheckTimeclock() {
var mod1 = 'test'; // pair name pair Value
mod1=localStorage.getItem('Timeclock','Timeclock');
var x = '[[!Allow_Internal_External?]]';
// If user can only log in on a designated timeclock
if(!(x=="Y")) {
//If not a designated timeclock
if(!(mod1=='Timeclock')) {
window.location.href = '
https://www.your site/index.php?id=32';
}
}
return;
}
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}
addLoadEvent(CheckTimeclock);
addLoadEvent(redirectionTimer);
addLoadEvent(function() {
document.body.style.backgroundColor = '#EFDF95';
})
</script>
Thanks to all for your insights.
[ed. note: cdurbin last edited this post 12 years, 9 months ago.]