Automatic installer.php lang files by installer_builder (20080621)
[moodle.git] / auth / README
blob251d28ddbf94f5e861299372271be0bc45c36d53
1 This directory contains authentication modules.
3 Each of these modules describes a different way to 
4 check that a user has provided a correct 
6    - username, and 
7    - password.
9 Even when external forms of authentication are being
10 used, Moodle still maintains the internal "user" table 
11 with all the associated information about that user such
12 as name, email address and so on.
14 The active method is set by the admin on the Configuration page.
17 email - authentication by email  (DEFAULT METHOD)
19     - user fills out form with email address
20     - email sent to user with link 
21     - user clicks on link in email to confirm
22     - user account is created
23     - user can log in
26 none  - no authentication at all .. very insecure!!
27     
28     - user logs in using ANY username and password
29     - if the username doesn't already exist then
30       a new account is created
31     - when user tries to access a course they 
32       are forced to set up their account details
34 manual - internal authentication only
36     - user logs in using username and password
37     - no way for user to make their own account
40 ldap  - Uses an external LDAP server
42     - user logs in using username and password
43     - these are checked against an LDAP server
44     - if correct, user is logged in
45     - optionally, info is copied from the LDAP
46       database to the Moodle user database
48     (see the ldap/README for more details on config etc...)
51 imap  - Uses an external IMAP server
53     - user logs in using username and password
54     - these are checked against an IMAP server
55     - if correct, user is logged in
56     - if the username doesn't already exist then
57       a new account is created
60 pop3  - Uses an external POP3 server
62     - user logs in using username and password
63     - these are checked against a POP3 server
64     - if correct, user is logged in
65     - if the username doesn't already exist then
66       a new account is created
69 nntp  - Uses an external NNTP server
71     - user logs in using username and password
72     - these are checked against an NNTP server
73     - if correct, user is logged in
74     - if the username doesn't already exist then
75       a new account is created
78 db  - Uses an external database to check username/password
79     
80     - user logs in using username and password
81     - these are checked against an external database
82     - if correct, user is logged in
83     - if the username doesn't already exist then
84       a new Moodle account is created
87 ------------------------------------------------------------------------------------
89 Authentication API
91 This file describes Moodle interface functions to authentication modules.
93 Most of functions are from ldap-authentication module and are not implemented (yet?)
94 on other modules. Please feel free to extend other modules to support same features
95 or roll your own module.
97 Some of new function are still tested and are not documented here yet.
101 AUTHENTICATION
102 Basic fuctions to authenticate users with external db
104 Mandatory: 
105     
106     auth_user_login ($username, $password) 
107     
108     Authenticate username, password with userdatabase.
110     Returns:
111     true if the username and password work
112     and false if they don't
114 Optional:
115     
116     auth_get_userinfo($username)
117     
118     Query other userinformation from database.
120     Returns:
121     Userinformation in array ( name => value, .... 
122     or false in case of error
124     auth_validate_form(&$form, &$err)
125     
126     Validate form data.
128     Returns:
129     Bool. Manipulates $form and $err arrays in place
132 COURSE CREATING
134     auth_iscreator($username)
136     should user have rights to create courses
138     Returns:
139     True if user have rights to crete cources otherwise false
142 USER CREATION
144 Functions that enable usercreation, activation and deactivation
145 from moodle to external database
146   
147   
148     auth_user_exists ($username) 
149    
150     Checks if given username exist on external db
152     Returns:
153     true if given usernname exist or false
155     auth_user_create ($userobject,$plainpass) 
157     Creates new user to external db. User should be created
158     in inactive stage until confirmed by email.
160     Returns:
161     True on success otherwise false
164     auth_user_activate ($username) 
165     
166     activate new user after email-address is confirmed
168     Returns:
169     True on success otherwise false
172     auth_user_disable ($username) {
173     
174     deactivate  user in external db.
175     
176     Returns:
177     True on success otherwise false
181 USER INFORMATION AND SYNCRONIZATION
183     auth_get_userlist () 
185     Get list of usernames in external db.
187     Returns:
188     All usernames in array or false on error.
189     
191     auth_get_users($filter='*') 
192     
193     Get ALL USEROBJECTS FROM EXTERNAL DB.
195     Returns:
196     Array of all users as objects from external db