Guest User

Untitled

a guest
Nov 7th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. xquery version '3.1';
  2. (:~
  3. this script must be run with a user in the DBA group
  4.  
  5. add this line to your post-install script or run it manually
  6. it will set the GID sticky bit
  7. chown('/path/to/this/script.xq', 'admin', 'dba')
  8. chmod('/path/to/this/script.xq', 'rwxr-S---')
  9. :)
  10.  
  11. (:~
  12. do some checks on the password
  13. :)
  14. declare function local:pass-ok($password) {
  15. string-length($password) > 11
  16. };
  17.  
  18. declare variable $local:user := request:get-parameter('user', '')
  19. declare variable $local:pass := request:get-parameter('pass', '')
  20.  
  21. (: check if user exists and new password is good :)
  22. if (
  23. sm:user-exists($local:user) and
  24. local:pass-ok($local:pass)
  25. )
  26. then (sm:passwd($local:user, $local:pass))
  27. else ('ERROR')
Add Comment
Please, Sign In to add comment