]>
git.defcon.no Git - hermes/blob - api/lib/auth_plugins/permitall.php
3 permitall.php is a sample authentication plugin
4 that responds with 'accept' regardless of what
5 usernames and passwords are passed to it.
7 This plugin should serve as a sample plugin:
8 all authentication plugins must implement
9 all functions defined here.
11 NOTE that the auth-plugins are for authentication
12 only, and is not doing any kind of authorization.
14 NOTE that the auth-plugins handle user
15 authentication for API functions....
19 // Is the backend readonly?
20 function authmethod_readonly ()
22 // Each auth-plugin must specify if users can
23 // be modified in the backend by responding to
24 // the authmethod_readonly with a true/false.
26 // By returning false to a readonly-poll, the
27 // plugin should be able to add users to the
28 // backend, and also must be able to change
29 // user data and passwords.
33 // Fetch user geckos (basic display info)
34 function authuser_getinfo ( $username )
36 $user['name'] = "Default User";
37 $user['email'] = "example@example.com";
41 // Update geckos-info for user in backend
42 function authuser_setinfo ( $username, $name, $email )
44 // RW plugins should return false on failure,
45 // and true on success updating user information
46 // RO plugins should always return false
50 // Change a user-password in the backend
51 function authuser_password ( $username, $password )
53 // RW plugins should return false on failure,
54 // and true on success updating user information
55 // RO plugins should always return false
59 // Add a user to the backend
60 function authuser_add ( $username, $name, $email, $password )
62 // RW plugins should return false on failure,
63 // and true on success updating user information
64 // RO plugins should always return false
68 // Remove a user from the backend.
69 function authuser_delete ( $username )
71 // RW plugins should return false on failure,
72 // and true on success updating user information
73 // RO plugins should always return false
77 // Username+password verification. Basically "login"
78 function authuser_verify ( $username, $password )
80 // This plugin will always accept.
81 // A real plugin should naturally perform strong user
84 // Valid return values from this function:
85 // * -1 -> Failure (e.g. backend not available)
86 // * 0 -> username/password rejected
87 // * 1 -> username/password accepted