Author: rgardler
Date: Tue Nov 22 00:43:28 2011
New Revision: 1204766
URL: http://svn.apache.org/viewvc?rev=1204766&view=rev
Log:
myExperiment API has an awful habit of reporting success when in fact it is an
error - this is not really appropriate of the template but it won't harm others
before I factor it out.
Modified:
incubator/wookie/trunk/widgets/templates/login/scripts/auth_controller.js
Modified:
incubator/wookie/trunk/widgets/templates/login/scripts/auth_controller.js
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/templates/login/scripts/auth_controller.js?rev=1204766&r1=1204765&r2=1204766&view=diff
==============================================================================
--- incubator/wookie/trunk/widgets/templates/login/scripts/auth_controller.js
(original)
+++ incubator/wookie/trunk/widgets/templates/login/scripts/auth_controller.js
Tue Nov 22 00:43:28 2011
@@ -41,9 +41,13 @@ var ${widget.shortname}_auth_controller
data: payload,
cache: false,
success: function (html, statusText, response) {
- var headers = response.getAllResponseHeaders();
- session_controller.session_id =
${widget.shortname}_auth_controller.get_cookie("_m2_session_id");
- alert("logged in");
+ if (html.indexOf("Invalid username or password") > -1) {
+ alert("There seems to be a problem with your login details.");
+ } else {
+ var headers = response.getAllResponseHeaders();
+
session_controller.setSessionId(${widget.shortname}_auth_controller.get_cookie("_m2_session_id"));;
+ alert("logged in");
+ }
},
error: function (xhr, error) {
alert("readyState: "+xhr.readyState+"\nstatus: "+xhr.status);