Guest User

Untitled

a guest
Apr 25th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. declare function auth:login($login as xs:string, $pass as xs:string) as xs:string
  2. {
  3. let $user := /buers/buyer[login=$login]
  4. return
  5. if($user)
  6. then
  7. (
  8. if($user/password=$pass)
  9. then
  10. (
  11. session:create(),
  12. session:set-attribute("login", $user/login),
  13. $login
  14. )
  15. else( "")
  16. )
  17. else
  18. (
  19. ""
  20. )
  21. };
Add Comment
Please, Sign In to add comment