Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Symfony] sfDoctrineGuardPlugin - routing
stirith
post
Post #1





Grupa: Zarejestrowani
Postów: 162
Pomógł: 2
Dołączył: 18.01.2008

Ostrzeżenie: (0%)
-----


Postępuje zgodnie z instrukcją czyli:

- instaluje plugin,
- dodaje go jako: enabled do ProjectConfiguration.class.php
- Przebudowywuje mój model
- cc
- dodaje:
Kod
<span style="font-family: monospace;"></span><code>enabled_modules:      [default, sfGuardAuth]</code>

- dodaje:
Kod
login_module:           sfGuardAuth

login_action:           signin



secure_module:          sfGuardAuth

secure_action:          secure


- w frontend/lib zmieniam na :
Kod
sfGuardSecurityUser


i dla określonego module daje :

Kod
default:

   is_secure: true



Jak używałem propela, to tyle wystarczyło...

co mam jeszcze zrobić używając doctrine, żeby po autoryzacji zapamiętał adres który użytkownik chciał wcześniej wejść, a nie przenosił na strone główną, czyli:
użytkownik wchodzi na www.mojastrona.pl/profil -> wyskakuje formularz do logowania, uwierzytelnienie jest ok, i teraz powinno go przekierować na

www.mojastrona.pl/profil a nie na www.mojastrona.pl -> Jak to osiągnąć ?

chodzi o wersje 1.2

?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
stirith
post
Post #2





Grupa: Zarejestrowani
Postów: 162
Pomógł: 2
Dołączył: 18.01.2008

Ostrzeżenie: (0%)
-----


1.

Kod
sfGuardSecurityUser::getReferer()


Propel:

Kod
   $referer = $this->getAttribute('referer', $default);
     $this->getAttributeHolder()->remove('referer');

     return $referer ? $referer : $default;


Doctrine:

Kod
    $referer = $this->getAttribute('referer', $default);
     $this->getAttributeHolder()->remove('referer');

     return $referer;


2.

Kod
sfGuardAuth::signin()


Propel:
Kod
$signinUrl = sfConfig::get('app_sf_guard_plugin_success_signin_url', $user->getReferer('@homepage'));

         return $this->redirect($signinUrl);


Doctrine:

Kod
$signinUrl = sfConfig::get('app_sf_guard_plugin_success_signin_url', $user->getReferer($request->getReferer()));

         return $this->redirect('' != $signinUrl ? $signinUrl : '@homepage');



Szczerze mówiąc mało mi to mówi...Rzucicie okiem ?
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 14.10.2025 - 09:32