Advertisement
Guest User

Untitled

a guest
May 20th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. 1.apelezi din clasa sessions fuctia checkSession(username)
  2. vezi ca nu e statica deci faci obiect Sessions
  3.  
  4. 2.functia aia returneaza boolean
  5. true-session valid;false altfel
  6.  
  7. 3.if(checkSession(username))//daca e valid session id ul
  8. Verifici drepturile de access:
  9. clasa Access 4 functii booleane:
  10. isStudent(username),isProfesor(username),isSecretar(username),isAdministrator(username)
  11. din astea 4 folosesti ce iti trebuie la un moment dat;gen ce nivel de access trebuie sa verifici pentru un anumit request
  12.  
  13. ex: (session_id tip String)
  14. Sessions s=new Sessions();
  15. if(s.checkSession(session_id))
  16. {
  17. String username=s.getUsername(session_id)
  18. Access a=new Access();
  19. if(a.isStudent(username))
  20. {
  21. //realizeaza operationea
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement