[LON-CAPA-cvs] cvs: loncom /auth lonlogin.pm

raeburn raeburn at source.lon-capa.org
Fri Sep 13 17:28:18 EDT 2013


raeburn		Fri Sep 13 21:28:18 2013 EDT

  Modified files:              
    /loncom/auth	lonlogin.pm 
  Log:
  - Bug 6673.
  Do not autocapitalize or autocorrect text entered in username or domain fields
  in log-in page, if user agent string implies client browser is for a mobile
  device.
    
  (Note: autocapitalize & autocorrect attributes are not compliant for 
  XHTML 1.0 Transitional)
  
  
Index: loncom/auth/lonlogin.pm
diff -u loncom/auth/lonlogin.pm:1.155 loncom/auth/lonlogin.pm:1.156
--- loncom/auth/lonlogin.pm:1.155	Mon Jan 28 02:00:58 2013
+++ loncom/auth/lonlogin.pm	Fri Sep 13 21:28:18 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Login Screen
 #
-# $Id: lonlogin.pm,v 1.155 2013/01/28 02:00:58 raeburn Exp $
+# $Id: lonlogin.pm,v 1.156 2013/09/13 21:28:18 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -111,7 +111,8 @@
 # ----------------------------------------------------------- Process Interface
     $env{'form.interface'}=~s/\W//g;
 
-    my $httpbrowser=$ENV{"HTTP_USER_AGENT"};
+    (undef,undef,undef,undef,undef,undef,my $clientmobile) =
+        &Apache::loncommon::decode_user_agent();
 
     my $iconpath= 
 	&Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL'));
@@ -433,16 +434,20 @@
                                        $authdomain,\$helpdeskscript,
                                        $showhelpdesk,\@possdoms);
 
+    my $mobileargs;
+    if ($clientmobile) {
+        $mobileargs = 'autocapitalize="off" autocorrect="off"'; 
+    }
     my $loginform=(<<LFORM);
 <form name="client" action="" onsubmit="return(send())">
   <input type="hidden" name="lextkey" value="$lextkey" />
   <input type="hidden" name="uextkey" value="$uextkey" />
   <b><label for="uname">$lt{'un'}</label>:</b><br />
-  <input type="text" name="uname" id="uname" size="15" value="$authusername" readonly="readonly" /><br />
+  <input type="text" name="uname" id="uname" size="15" value="$authusername" readonly="readonly" $mobileargs /><br />
   <b><label for="upass$now">$lt{'pw'}</label>:</b><br />
   <input type="password" name="upass$now" id="upass$now" size="15" readonly="readonly" /><br />
   <b><label for="udom">$lt{'dom'}</label>:</b><br />
-  <input type="text" name="udom" id="udom" size="15" value="$authdomain" readonly="readonly" /><br />
+  <input type="text" name="udom" id="udom" size="15" value="$authdomain" readonly="readonly" $mobileargs /><br />
   <input type="submit" value="$lt{'log'}" />
 </form>
 LFORM




More information about the LON-CAPA-cvs mailing list