Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. /*
  3. * $Id: WebAuth.php 470 2012-10-24 21:43:25Z imooreyahoo@gmail.com $
  4. */
  5. class phpvbAuthWebAuth implements phpvbAuth {
  6. var $capabilities = array(
  7. 'canChangePassword' => false,
  8. 'canLogout' => false
  9. );
  10. var $config = array(
  11. 'serverUserKey' => 'REMOTE_USER'
  12. );
  13. function phpvbAuthWebAuth($userConfig = null) {
  14. if($userConfig) $this->config = array_merge($this->config,$userConfig);
  15. }
  16. function login($username, $password)
  17. {
  18. }
  19. function autoLoginHook()
  20. {
  21. global $_SESSION;
  22. // WebAuth passthrough
  23. if ( isset($_SERVER[$this->config['serverUserKey']]) )
  24. {
  25. $_SESSION['valid'] = true;
  26. $_SESSION['user'] = $_SERVER[$this->config['serverUserKey']];
  27. $_SESSION['admin'] = (!$this->config['adminUser']) || ($_SESSION['user'] == $this->config['adminUser']);
  28. $_SESSION['authCheckHeartbeat'] = time();
  29. }
  30. }
  31. function heartbeat($vbox)
  32. {
  33. global $_SESSION;
  34. if ( isset($_SERVER[$this->config['serverUserKey']]) )
  35. {
  36. $_SESSION['valid'] = true;
  37. $_SESSION['authCheckHeartbeat'] = time();
  38. }
  39. }
  40. function changePassword($old, $new)
  41. {
  42. }
  43. function logout(&$response)
  44. {
  45. $response['data']['result'] = 1;
  46. if ( isset($this->config['logoutURL']) )
  47. {
  48. $response['data']['url'] = $this->config['logoutURL'];
  49. }
  50. }
  51. function listUsers()
  52. {
  53. }
  54. function updateUser($vboxRequest, $skipExistCheck)
  55. {
  56. }
  57. function deleteUser($user)
  58. {
  59. }
  60. }