summaryrefslogtreecommitdiffstats
path: root/endpoints/lib/auth/WebAuth.php
diff options
context:
space:
mode:
Diffstat (limited to 'endpoints/lib/auth/WebAuth.php')
-rw-r--r--endpoints/lib/auth/WebAuth.php75
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)
+ {
+
+ }
+}