I made this modification to mybic for my own apps to
allow for a configuratble not-authorized behavior.
I've found that in most cases I want unauthorized
requests to have the same result. It's usually
something like displaying an alert message or
redirecting the browser to a login page. Rather than
having to check for an unauthrorized response in my
every js handler function I thought it would be simpler
to specify a function that would automatically be
called for an unauthorized response. Here's an example:
var ajaxObj = new XMLHTTP('mybic_server.php');
ajaxObj.not_authorized_func = denyAccess;
function denyAccess () {
alert('You are not authorized');
window.location = "login.php";
}
if ajaxObj.not_authorized_func is not specified the
behavior continues to the current mybic behavior.
I've attached a simple patch if you like this idea.
Patch for adding not_authorized_func API
Logged In: YES
user_id=1491998
I'll add this for the 1.0 release, thanks Dell