Detect special login problems and alert

Bug #375465 reported by Paul Everitt
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KARL3
Fix Released
Medium
Balazs Ree

Bug Description

We heard from Nat that he gets lots of trouble tickets filed on login because people put a space at the end of their login by accident. Let's detect that and display an error message. Also display a different error message if there are any spaces (e.g. in the middle).

Revision history for this message
Paul Everitt (paul-agendaless) wrote :

Move to M15.

Changed in karl3:
milestone: m14 → m15
Revision history for this message
Paul Everitt (paul-agendaless) wrote :

Balazs said he would help me out of the mess I was going to make. Below is the diff for the direction I was going.

He plans to alter directions. Instead of going with the top-of-the-form message, he will try to do something directly on the field, like tagbox does (much better). He will also try to avoid the quagmire I got into by having an invisible div already present in the form.

$ svn diff src/karl/karl/views
Index: src/karl/karl/views/templates/login.pt
===================================================================
--- src/karl/karl/views/templates/login.pt (revision 2805)
+++ src/karl/karl/views/templates/login.pt (working copy)
@@ -7,16 +7,34 @@

     <div metal:use-macro="api.snippets.macros['status_message']"/>

+ <div class="portalMessage" style="display:none"></div>
     <form name="formLogin" method="post" action="${app_url}/login">

- <fieldset class="field">
+ <fieldset class="field" id="username-field">

        <span class="loginLabelWrapper">
           <label for="username">Username</label>
        </span>
        <input name="login" id="username" value="" size="30"
                tal:attributes="value username|nothing" />
-
+ <script language="javascript" type="text/javascript">
+ $(document).ready(function() {
+ // Some simple validators for common mistakes
+ $('input#username:first')
+ .change(function(e) {
+ alert($('input#username:first').size());
+ var msg1 = 'msg 1';
+ var pm = $('.portalMessage');
+ pm.css('display', 'none');
+ var newval = this.value;
+ if (newval == 'xxx') {
+ pm.text(msg1);
+ pm.css('display', 'block');
+ }
+ });
+ });
+ </script>
+ <span class="errorMessage"></span>
       </fieldset>

       <fieldset class="field">

Changed in karl3:
assignee: Paul Everitt (paul-agendaless) → Balazs Ree (ree)
importance: Medium → Low
Balazs Ree (ree)
Changed in karl3:
status: New → Fix Committed
Revision history for this message
Paul Everitt (paul-agendaless) wrote :

Per Jason, we should remove the part of the enhancement that blocks (with a message) a space in the middle. But we *keep* the detection of a space at the end.

Jason and Ajo are working on a longer-term writeup.

Changed in karl3:
importance: Low → Medium
milestone: m15 → m17
status: Fix Committed → In Progress
Revision history for this message
Paul Everitt (paul-agendaless) wrote :

Well, that didn't last long. Change of plan to the change of plan...remove everything that was done in support of this ticket. Nothing should be done to detect special login problems.

Balazs Ree (ree)
Changed in karl3:
status: In Progress → Fix Committed
Revision history for this message
Paul Everitt (paul-agendaless) wrote :

Confirmed on staging.

Changed in karl3:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.