--- a/thirdparty/google_appengine/google/appengine/ext/admin/templates/js/webhook.js Sat Sep 05 14:04:24 2009 +0200
+++ b/thirdparty/google_appengine/google/appengine/ext/admin/templates/js/webhook.js Sun Sep 06 23:31:53 2009 +0200
@@ -33,7 +33,7 @@
this.payload = value;
}
}
-
+
if (this.action == '') {
return 'action not found';
}
@@ -61,7 +61,20 @@
callback(this, req, e);
return;
}
- callback(this, req, null);
+
+ // If the responseText matches our <form action="/_ah/login then the
+ // user is not logged in as an Administrator so we'll fake the request.
+ if (req.responseText.match(/<form[^>]+_ah\/login/)) {
+ var fakeReq = {
+ 'status': 403,
+ 'responseText': 'Current logged in user is not authorized ' +
+ 'to view this page'
+ }
+ fakeReq.getAllResponseHeaders = function(){};
+ callback(this, fakeReq, null);
+ } else {
+ callback(this, req, null);
+ }
};
Webhook.prototype.run = function(callback) {