Kullanıcıları yönetmek için FOSUser paketini kullanıyorum, sorunu elime koyduğumda imzaladığınız zaman oturum açma/oturum açma formunu yeniden belirten ve ne istediğimi Eğer bar tarayıcı/oturum açma koyduysanız ve oturum açmadan bana otomatik olarak beni/dizini yeniden yönlendirirseniz, formu yeniden görüntülemek için formu yeniden görüntüleyin.Symfony2 bakışı göremedi giriş yaptıktan sonra
Yardımcı olabilir misiniz? Oturum açma kontrolörü olarak
class SecurityController extends ContainerAware
{
public function loginAction()
{
$request = $this->container->get('request');
$session = $request->getSession();
if ($request->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) {
$error = $request->attributes->get(SecurityContext::AUTHENTICATION_ERROR);
} elseif (null !== $session && $session->has(SecurityContext::AUTHENTICATION_ERROR)) {
$error = $session->get(SecurityContext::AUTHENTICATION_ERROR);
$session->remove(SecurityContext::AUTHENTICATION_ERROR);
} else {
$error = '';
}
if ($error) {
$error = $error->getMessage();
}
$lastUsername = (null === $session) ? '' : $session->get(SecurityContext::LAST_USERNAME);
$csrfToken = $this->container->get('form.csrf_provider')->generateCsrfToken('authenticate');
return $this->renderLogin(array(
'last_username' => $lastUsername,
'error' => $error,
'csrf_token' => $csrfToken,
));
}
protected function renderLogin(array $data)
{
$template = sprintf('FOSUserBundle:Security:login.html.%s', $this->container->getParameter('fos_user.template.engine'));
return $this->container->get('templating')->renderResponse($template, $data);
}
public function checkAction()
{
throw new \RuntimeException('You must configure the check path to be handled by the firewall using form_login in your security firewall configuration.');
}
public function logoutAction()
{
throw new \RuntimeException('You must activate the logout in your security firewall configuration.');
}
}
Lütfen security.yml dosya içeriğini sağlayın – LMS94
Tamam, Sadece mesajı düzenleyin. – elAIR