Skip to content

Commit

Permalink
fixed bug after register/login, that the user has no role
Browse files Browse the repository at this point in the history
fixed change pw length in filter
  • Loading branch information
kokspflanze committed May 18, 2015
1 parent 4cbe643 commit be89e6b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
16 changes: 12 additions & 4 deletions src/PServerCMS/Controller/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ public function registerAction()
}
}

return [ 'registerForm' => $form ];
return [
'registerForm' => $form
];
}

/**
Expand Down Expand Up @@ -70,7 +72,9 @@ public function registerConfirmAction()
}
}

return [ 'registerForm' => $form ];
return [
'registerForm' => $form
];
}

public function ipConfirmAction()
Expand Down Expand Up @@ -108,7 +112,9 @@ public function pwLostAction()
}
}

return [ 'pwLostForm' => $form ];
return [
'pwLostForm' => $form
];
}

public function pwLostDoneAction()
Expand All @@ -134,7 +140,9 @@ public function pwLostConfirmAction()
}
}

return [ 'pwLostForm' => $form ];
return [
'pwLostForm' => $form
];
}

public function pwLostConfirmDoneAction()
Expand Down
4 changes: 2 additions & 2 deletions src/PServerCMS/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ class User implements UserInterface

/**
* @var \Doctrine\Common\Collections\Collection|UserRole[]
* @ORM\ManyToMany(targetEntity="PServerCMS\Entity\UserRole", mappedBy="user")
* @ORM\ManyToMany(targetEntity="PServerCMS\Entity\UserRole", mappedBy="user", fetch="EAGER")
*/
private $userRole;

/**
* @var \Doctrine\Common\Collections\Collection|UserExtension[]
* @ORM\OneToMany(targetEntity="UserExtension", mappedBy="user")
* @ORM\OneToMany(targetEntity="UserExtension", mappedBy="user", fetch="EAGER")
* @ORM\JoinColumn(name="usrId", referencedColumnName="userId")
*/
private $userExtension;
Expand Down
2 changes: 1 addition & 1 deletion src/PServerCMS/Entity/UserExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class UserExtension

/**
* @var string
* @ORM\Column(name="key", type="string", length=255, nullable=false)
* @ORM\Column(name="`key`", type="string", length=255, nullable=false)
*/
private $key;

Expand Down
6 changes: 3 additions & 3 deletions src/PServerCMS/Form/ChangePwdFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function __construct(){
'name' => 'StringLength',
'options' => array(
'min' => 6,
'max' => 16,
'max' => 32,
),
),
),
Expand All @@ -32,7 +32,7 @@ public function __construct(){
'name' => 'StringLength',
'options' => array(
'min' => 6,
'max' => 16,
'max' => 32,
),
),
),
Expand All @@ -47,7 +47,7 @@ public function __construct(){
'name' => 'StringLength',
'options' => array(
'min' => 6,
'max' => 16,
'max' => 32,
),
),
array(
Expand Down
3 changes: 0 additions & 3 deletions src/PServerCMS/Service/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -542,9 +542,6 @@ public function doAuthentication( UserInterface $user )
$userNew = $repository->getUser4UserName( $user->getUsername() );

$authService = $this->getAuthService();
// FIX: no roles after register
$userNew->getUserRole();
$userNew->getUserExtension();

$authService->getStorage()->write( $userNew );
}
Expand Down

0 comments on commit be89e6b

Please sign in to comment.