<commit_before># $Id$

package EnsEMBL::Web::Component::Account::Login;

### Module to create user login form 

use strict;
use warnings;
no warnings "uninitialized";
use base qw(EnsEMBL::Web::Component::Account);
use EnsEMBL::Web::RegObj;
use EnsEMBL::Web::Form;

sub _init {
  my $self = shift;
  $self->cacheable( 0 );
  $self->ajaxable(  0 );
}

sub caption {
  my $self = shift;
  return 'Login';
}

sub content {
  my $self = shift;

  ## Control panel fixes
  my $dir = '/'.$ENV{'ENSEMBL_SPECIES'};
  $dir = '' if $dir !~ /_/;
  
  my $referer = '_referer=' . $self->object->param('_referer');
  $referer .= ';x_requested_with=' . $self->object->param('x_requested_with') if $ENSEMBL_WEB_REGISTRY->check_ajax;
  
  my $form = EnsEMBL::Web::Form->new( 'login', "$dir/Account/SetCookie", 'post' );
  my $reg_url = $self->url("$dir/Account/User/Add?$referer");
  my $pwd_url = $self->url("$dir/Account/LostPassword?$referer");

  $form->add_element('type'  => 'Email',    'name'  => 'email', 'label' => 'Email', 'required' => 'yes');
  $form->add_element('type'  => 'Password', 'name'  => 'password', 'label' => 'Password', 'required' => 'yes');
  $form->add_element('type'  => 'Hidden',   'name'  => 'url', 'value' => $self->object->param('url'));
  $form->add_element('type'  => 'Hidden',   'name'  => 'popup', 'value' => $self->object->param('popup'));
  $form->add_element('type'  => 'Hidden',   'name'  => '_referer', 'value' => $self->object->param('_referer'));
  $form->add_element('type'  => 'Hidden',   'name'  => 'x_requested_with', 'value' => $self->object->param('x_requested_with'));
  $form->add_element('type'  => 'Submit',   'name'  => 'submit', 'value' => 'Log in', 'class'=>'cp-refresh');
  $form->add_element('type'  => 'Information',
                     'value' => qq(<p><a href="$reg_url" class="modal_link">Register</a>
                                  | <a href="$pwd_url" class="modal_link">Lost password</a></p>));

  return $form->render;<commit_msg>used species_path for constructing URL<commit_after># $Id$

package EnsEMBL::Web::Component::Account::Login;

### Module to create user login form 

use strict;
use warnings;
no warnings "uninitialized";
use base qw(EnsEMBL::Web::Component::Account);
use EnsEMBL::Web::RegObj;
use EnsEMBL::Web::Form;

sub _init {
  my $self = shift;
  $self->cacheable( 0 );
  $self->ajaxable(  0 );
}

sub caption {
  my $self = shift;
  return 'Login';
}

sub content {
  my $self = shift;

  ## Control panel fixes
  my $dir = '';
  $dir = $self->object->species_defs->species_path($ENV{'ENSEMBL_SPECIES'}) if ($ENV{'ENSEMBL_SPECIES'});
  
  my $referer = '_referer=' . $self->object->param('_referer');
  $referer .= ';x_requested_with=' . $self->object->param('x_requested_with') if $ENSEMBL_WEB_REGISTRY->check_ajax;
  
  my $form = EnsEMBL::Web::Form->new( 'login', "$dir/Account/SetCookie", 'post' );
  my $reg_url = $self->url("$dir/Account/User/Add?$referer");
  my $pwd_url = $self->url("$dir/Account/LostPassword?$referer");

  $form->add_element('type'  => 'Email',    'name'  => 'email', 'label' => 'Email', 'required' => 'yes');
  $form->add_element('type'  => 'Password', 'name'  => 'password', 'label' => 'Password', 'required' => 'yes');
  $form->add_element('type'  => 'Hidden',   'name'  => 'url', 'value' => $self->object->param('url'));
  $form->add_element('type'  => 'Hidden',   'name'  => 'popup', 'value' => $self->object->param('popup'));
  $form->add_element('type'  => 'Hidden',   'name'  => '_referer', 'value' => $self->object->param('_referer'));
  $form->add_element('type'  => 'Hidden',   'name'  => 'x_requested_with', 'value' => $self->object->param('x_requested_with'));
  $form->add_element('type'  => 'Submit',   'name'  => 'submit', 'value' => 'Log in', 'class'=>'cp-refresh');
  $form->add_element('type'  => 'Information',
                     'value' => qq(<p><a href="$reg_url" class="modal_link">Register</a>
                                  | <a href="$pwd_url" class="modal_link">Lost password</a></p>));

  return $form->render;
{'fraction_non_alphanumeric': 0.23417408506429277, 'fraction_numerical': 0.0009891196834817012, 'mean_word_length': 4.364721485411141, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 124, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1207231', 'n_tokens_mistral': 1508, 'n_tokens_neox': 1480, 'n_words': 273}