diff options
author | Ian Moore <ian.moore@fireeye.com> | 2015-07-29 12:12:26 -0400 |
---|---|---|
committer | Ian Moore <ian.moore@fireeye.com> | 2015-07-29 12:12:26 -0400 |
commit | 83e0bc0d26bd88925053ac3a6cc84edf7236f18e (patch) | |
tree | 18ac7e2f300934ba12dcdc20531b2de6813ffde9 /endpoints/lib/auth/WebAuth.php | |
parent | 76a645369fd0dc61bca879ec5f083464d62a7369 (diff) | |
download | phpvirtualbox-83e0bc0d26bd88925053ac3a6cc84edf7236f18e.zip phpvirtualbox-83e0bc0d26bd88925053ac3a6cc84edf7236f18e.tar.gz phpvirtualbox-83e0bc0d26bd88925053ac3a6cc84edf7236f18e.tar.bz2 |
Move source tree up one level
Diffstat (limited to 'endpoints/lib/auth/WebAuth.php')
-rw-r--r-- | endpoints/lib/auth/WebAuth.php | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/endpoints/lib/auth/WebAuth.php b/endpoints/lib/auth/WebAuth.php new file mode 100644 index 0000000..fb5d4b1 --- /dev/null +++ b/endpoints/lib/auth/WebAuth.php @@ -0,0 +1,75 @@ +<?php +/* + * $Id: WebAuth.php 470 2012-10-24 21:43:25Z imooreyahoo@gmail.com $ + */ + +class phpvbAuthWebAuth implements phpvbAuth { + + var $capabilities = array( + 'canChangePassword' => false, + 'canLogout' => false + ); + + var $config = array( + 'serverUserKey' => 'REMOTE_USER' + ); + + function phpvbAuthWebAuth($userConfig = null) { + if($userConfig) $this->config = array_merge($this->config,$userConfig); + } + + function login($username, $password) + { + } + + function autoLoginHook() + { + global $_SESSION; + // WebAuth passthrough + if ( isset($_SERVER[$this->config['serverUserKey']]) ) + { + $_SESSION['valid'] = true; + $_SESSION['user'] = $_SERVER[$this->config['serverUserKey']]; + $_SESSION['admin'] = (!$this->config['adminUser']) || ($_SESSION['user'] == $this->config['adminUser']); + $_SESSION['authCheckHeartbeat'] = time(); + } + } + + function heartbeat($vbox) + { + global $_SESSION; + if ( isset($_SERVER[$this->config['serverUserKey']]) ) + { + $_SESSION['valid'] = true; + $_SESSION['authCheckHeartbeat'] = time(); + } + } + + function changePassword($old, $new) + { + } + + function logout(&$response) + { + $response['data']['result'] = 1; + if ( isset($this->config['logoutURL']) ) + { + $response['data']['url'] = $this->config['logoutURL']; + } + } + + function listUsers() + { + + } + + function updateUser($vboxRequest, $skipExistCheck) + { + + } + + function deleteUser($user) + { + + } +} |