]> git.mjollnir.org Git - moodle.git/commitdiff
New authentication method - a very simple one called "manual".
authormoodler <moodler>
Thu, 24 Apr 2003 15:01:15 +0000 (15:01 +0000)
committermoodler <moodler>
Thu, 24 Apr 2003 15:01:15 +0000 (15:01 +0000)
Accounts have to exist in the internal database, and there is
no way to create an account on the site - admins have to do it.

auth/README
auth/manual/config.html [new file with mode: 0644]
auth/manual/lib.php [new file with mode: 0644]
lang/en/auth.php

index 6262f643bdc56073cac1a2a488a3a531fd4446d5..2eda1f668fa73549c922d69c4656869bbe6bc0a6 100644 (file)
@@ -31,6 +31,11 @@ none  - no authentication at all .. very insecure!!
     - when user tries to access a course they 
       are forced to set up their account details
 
+manual - internal authentication only
+
+    - user logs in using username and password
+    - no way for user to make their own account
+
 
 ldap  - Uses an external LDAP server
 
diff --git a/auth/manual/config.html b/auth/manual/config.html
new file mode 100644 (file)
index 0000000..57c87aa
--- /dev/null
@@ -0,0 +1,11 @@
+<TR VALIGN=TOP>
+       <TD ALIGN=RIGHT><P><? print_string("instructions", "auth") ?>:</TD>
+       <TD>
+    <TEXTAREA NAME=auth_instructions COLS=30 ROWS=10 WRAP=virtual><? p($config->auth_instructions) ?></TEXTAREA> 
+    </TD>
+    <TD>
+    <? print_string("authinstructions","auth") ?>
+    <? helpbutton("text", get_string("helptext")) ?>
+    </TD>
+</TR>
+
diff --git a/auth/manual/lib.php b/auth/manual/lib.php
new file mode 100644 (file)
index 0000000..0dce1fc
--- /dev/null
@@ -0,0 +1,16 @@
+<?PHP  // $Id$
+       // manual method - Just does a simple check against the database
+
+function auth_user_login ($username, $password) {
+// Returns false if the username doesn't exist yet
+// Returns true if the username and password work
+
+    if ($user = get_user_info_from_db("username", $username)) {
+        return ($user->password == md5($password));
+    }
+
+    return false;
+}
+
+
+?>
index 91587498dc423a74db2a4537041b1eca5fc226bb..3a79d955b75bda5122c90456e44075a58cd59559 100644 (file)
@@ -38,6 +38,8 @@ $string['auth_ldapdescription'] = "This method provides authentication against a
                                   password are checked.";
 $string['auth_ldapextrafields'] = "These fields are optional.  You can choose to pre-fill some Moodle user fields with information from the <B>LDAP fields</B> that you specify here. <P>If you leave these fields blank, then nothing will be transferred from LDAP and Moodle defaults will be used instead.<P>In either case, the user will be able to edit all of these fields after they log in.";
 $string['auth_ldaptitle'] = "Use an LDAP server";
+$string['auth_manualdescription'] = "This method removes any way for users to create their own accounts.  All accounts must be manually created by the admin user.";
+$string['auth_manualtitle'] = "Manual accounts only";
 $string['auth_nntpdescription'] = "This method uses an NNTP server to check whether a given username and password is valid.";
 $string['auth_nntphost'] = "The NNTP server address. Use the IP number, not DNS name.";
 $string['auth_nntpport'] = "Server port (119 is the most common)";