MDL-46449 fix username prompt in login block when authloginviaemail enabled
authorPetr Skoda <petr.skoda@totaralms.com>
Mon, 21 Jul 2014 06:21:54 +0000 (18:21 +1200)
committerPetr Skoda <petr.skoda@totaralms.com>
Thu, 24 Jul 2014 22:10:29 +0000 (10:10 +1200)
blocks/login/block_login.php

index be63064..2c4eda4 100644 (file)
@@ -70,10 +70,15 @@ class block_login extends block_base {
         $this->content->text = '';
 
         if (!isloggedin() or isguestuser()) {   // Show the block
+            if (empty($CFG->authloginviaemail)) {
+                $strusername = get_string('username');
+            } else {
+                $strusername = get_string('usernameemail');
+            }
 
             $this->content->text .= "\n".'<form class="loginform" id="login" method="post" action="'.get_login_url().'" '.$autocomplete.'>';
 
-            $this->content->text .= '<div class="c1 fld username"><label for="login_username">'.get_string('username').'</label>';
+            $this->content->text .= '<div class="c1 fld username"><label for="login_username">'.$strusername.'</label>';
             $this->content->text .= '<input type="text" name="username" id="login_username" value="'.s($username).'" /></div>';
 
             $this->content->text .= '<div class="c1 fld password"><label for="login_password">'.get_string('password').'</label>';