signon-script.php 801 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Single signon for phpMyAdmin
  5. *
  6. * This is just example how to use script based single signon with
  7. * phpMyAdmin, it is not intended to be perfect code and look, only
  8. * shows how you can integrate this functionality in your application.
  9. *
  10. * @package PhpMyAdmin
  11. * @subpackage Example
  12. */
  13. /**
  14. * This function returns username and password.
  15. *
  16. * It can optionally use configured username as parameter.
  17. *
  18. * @param string $user User name
  19. *
  20. * @return array
  21. */
  22. function get_login_credentials($user)
  23. {
  24. /* Optionally we can use passed username */
  25. if (!empty($user)) {
  26. return array($user, 'password');
  27. }
  28. /* Here we would retrieve the credentials */
  29. $credentials = array('root', '');
  30. return $credentials;
  31. }