Skip to content
This repository has been archived by the owner on Mar 15, 2022. It is now read-only.

Commit

Permalink
consmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vikin91 committed May 22, 2016
1 parent 58540fe commit 124a69b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 26 deletions.
24 changes: 5 additions & 19 deletions lib/BibSpace/Controller/Login.pm
Original file line number Diff line number Diff line change
Expand Up @@ -487,55 +487,41 @@ sub post_do_register{
if($self->users->login_exists($login, $dbh) == 0){
$self->users->add_new_user($login,$email,$name,$password1,0,$dbh);

# $self->stash(msg => "User created successfully! You may now login using login: $login.");

$self->flash(msg => "User created successfully! You may now login using login: $login.");
$self->stash(msg => "User created successfully! You may now login using login: $login.");
$self->write_log("Login: registration successful for login: $login.");
$self->redirect_to('/');
# return;
}
else{
# $self->stash(msg => "This login is already taken");

$self->flash(msg => "This login is already taken", name => $name, email => $email, login => $login, password1 => $password1, password2 => $password2);
$self->stash(msg => "This login is already taken", name => $name, email => $email, login => $login, password1 => $password1, password2 => $password2);
$self->flash(msg => "This login is already taken");
$self->stash(name => $name, email => $email, login => $login, password1 => $password1, password2 => $password2);
$self->write_log("Login: registration unsuccessful for login: $login. Login taken.");
$self->redirect_to('register');
# $self->render(template => 'login/register');
# return;
}
}
else{
# $self->stash(msg => "Password is too short");


$self->flash(msg => "Password is too short, use minimum 4 symbols", name => $name, email => $email, login => $login, password1 => $password1, password2 => $password2);
$self->stash(msg => "Password is too short, use minimum 4 symbols", name => $name, email => $email, login => $login, password1 => $password1, password2 => $password2);
$self->flash(msg => "Password is too short, use minimum 4 symbols");
$self->stash(name => $name, email => $email, login => $login, password1 => $password1, password2 => $password2);
$self->write_log("Login: registration unsuccessful for login: $login. Password too short.");
$self->redirect_to('register');
# $self->render(template => 'login/register');
# return;
}
}
else{
# $self->stash(msg => "Passwords don't match!");
$self->flash(msg => "Passwords don't match!", name => $name, email => $email, login => $login, password1 => $password1, password2 => $password2);
$self->stash(msg => "Passwords don't match!", name => $name, email => $email, login => $login, password1 => $password1, password2 => $password2);
$self->write_log("Login: registration unsuccessful for login: $login. Passwords don't match");
$self->redirect_to('register');
# $self->render(template => 'login/register');
# return;
}
}
else{
# $self->stash(msg => "Some input is missing!");
$self->flash(msg => "Some input is missing!", name => $name, email => $email, login => $login, password1 => $password1, password2 => $password2);
$self->stash(msg => "Some input is missing!", name => $name, email => $email, login => $login, password1 => $password1, password2 => $password2);
$self->stash(name => $name, email => $email, login => $login, password1 => $password1, password2 => $password2);
$self->write_log("Login: registration unsuccessful for login: $login. Input missing.");
$self->redirect_to('register', msg => "Some input is missing!", name => $name, email => $email, login => $login, password1 => $password1, password2 => $password2);
# $self->render(template => 'login/register');
# return;
}

}
Expand Down
4 changes: 0 additions & 4 deletions t/00_prepare.t
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
use Mojo::Base -strict;


BEGIN {
$ENV{MOJO_MODE} = 'testing';
}

use Test::More;
use Test::Mojo;

Expand Down
3 changes: 0 additions & 3 deletions t/02_user_management.t
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
use Mojo::Base -strict;

BEGIN {
$ENV{MOJO_MODE} = 'testing';
}

use Test::More;
use Test::Mojo;
Expand Down

0 comments on commit 124a69b

Please sign in to comment.