"Use emails for login" still shows username field on the registration page

Permalink 1 user found helpful
We have a client that wants to simplify the login page so we've checked "Use emails for login" in the public registration settings.

I've temporarily turned off our custom registration single page but even the default c5 registration page still shows the "Username" field.

Both the default and our custom single page contain:
<?php  if ($displayUserName) { ?>
    <div class="control-group">
    <?php echo  $form->label('uName',t('Username')); ?>
    <div class="controls">
      <?php echo  $form->text('uName'); ?>
    </div>
  </div>
<?php  } ?>


Has anyone else encountered this with a 5.6.0.2 - and does anyone know how to remedy the situation?

Cheers

Ben

 
uswebdesigner replied on at Permalink Reply
uswebdesigner
Did you figure out how to get that working?
cmscss replied on at Permalink Reply
Actually, I had to get a developer look at it. I'll take a look in git and see what the issue was for you.
cmscss replied on at Permalink Reply
Hmm, it looks like the developer overode the register.php controller file with his own.

Try creating a file called register.php and putting this code into it - then place into the top-level /controllers/register.php

<?php 
defined('C5_EXECUTE') or die("Access Denied.");
class RegisterController extends Controller {
   public $helpers = array('form', 'html');
   public function __construct() {
      if(!ENABLE_REGISTRATION) {
         $this->render("/page_not_found");
      }
      parent::__construct();
      Loader::model('user_attributes');
      $u = new User();
      $this->set('u', $u);
      if (USER_REGISTRATION_WITH_EMAIL_ADDRESS) {
         $this->set('displayUserName', false);
      } else {


Also, here is my final registration.php single page just incase they work together (just remove all the bootstrap form styling if you don't need it - place into the top-level: /single_pages/register.php

<?php defined('C5_EXECUTE') or die("Access Denied."); ?>
<!-- HIGHLIGHT USERNAME FIELD ON PAGE LOAD
________________________________________________________________________________________________ -->
<script type="text/javascript">
$(function() {
  $("input[name=uName]").focus();
});
</script>
<!-- VALIDATION - Moved from view.php because it casued duplicate validation messages during checkout
________________________________________________________________________________________________ -->
<?php // error validation logic
   if (isset($error) && $error != '') { ?>
   <?php  
      if ($error instanceof Exception) {
         $_error[] = $error->getMessage();


This all works for me on a 5.6.0.2 site so see how you go.
uswebdesigner replied on at Permalink Reply
uswebdesigner
Thank you. Also, in my continued search, I found this thread which worked for me.

http://www.concrete5.org/community/forums/customizing_c5/removing-u...