summaryrefslogtreecommitdiffstats
path: root/modules/vauth/auth.lib.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/vauth/auth.lib.php')
-rw-r--r--modules/vauth/auth.lib.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/modules/vauth/auth.lib.php b/modules/vauth/auth.lib.php
index aff9ee49..cf8cfe1c 100644
--- a/modules/vauth/auth.lib.php
+++ b/modules/vauth/auth.lib.php
@@ -172,4 +172,40 @@ function vauth_ldap_auth($username, $password) {
} // vauth_ldap_auth
+
+/**
+ * vauth_http_auth
+ * This auth method relies on HTTP auth from Apache
+ * This is not a very secure method of authentication
+ * defaulted to off. Because if they can load the page they
+ * are considered to be authenticated we need to look and
+ * see if their user exists and if not, by golly we just
+ * go ahead and created it. NOT SECURE!!!!!
+ */
+function vauth_http_auth($username) {
+
+ /* Check if the user exists */
+ if ($user = new User($username)) {
+ $results['success'] = true;
+ $results['type'] = 'mysql';
+ $results['username'] = $username;
+ $results['name'] = $user->fullname;
+ $results['email'] = $user->email;
+ return $results;
+ }
+
+
+ /* If not then we auto-create the entry as a user.. :S */
+ $user->create($username,$username,'',md5(rand()),'25');
+ $user = new User($username);
+
+ $results['success'] = true;
+ $results['type'] = 'mysql';
+ $results['username'] = $username;
+ $results['name'] = $user->fullname;
+ $results['email'] = $user->email;
+ return $results;
+
+} // vauth_http_auth
+
?>