Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Autoryzacja - Skąd to ugryźć !?
Turgon
post
Post #1





Grupa: Zarejestrowani
Postów: 800
Pomógł: 0
Dołączył: 26.11.2005
Skąd: Nowy Sącz

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


Otóż mamy sobie taką klasę :
  1. <?php
  2. class TurAuthenticate{
  3. private $isAuthenticated = false;
  4. private $oUser;
  5. private $oSession;
  6.  
  7. public function __construct(){
  8. $this->oSession = new TurSession('UserSession');
  9. if(!isset($this->oSession->userId))$this->oSession->userId = -1; 
  10. $this->oUser = new TurUser('id',$this->oSession->userId);
  11. $this->IsAuthenticated = $this->oSession->isAuthenticated;
  12. }
  13.  
  14. public function isAuth(){
  15. return $this->isAuthenticated;
  16. }
  17.  
  18. public function signOut(){
  19. $this->oSession->userId = -1;
  20. $this->oUser = null;
  21. $this->isAuthenticated = false;
  22. $this->oSession->isAuthenticated = false;
  23. }
  24.  
  25. public function signIn($name,$pass){
  26. $this->oUser = new TurUser('name',$name);
  27. if($this->oUser->pass = $pass){
  28. $this->isAuthenticated = true;
  29. $this->oSession->isAuthenticated = true;
  30. $this->oSession->userId = $this->oUser->id;
  31. }
  32. }
  33. }
  34. ?>


Ale problem pojawia się gdy trzeba wywalić sesję. Zliczyć je, to dopiero masakra... Jakieś konkretne propozycje ?
Może własny SessionHandler ? Na bazie ? Jak tak to mySQL czy coś innego? Jak to robić ?
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: 25.08.2025 - 04:47