From: moodler Date: Tue, 31 Dec 2002 08:45:37 +0000 (+0000) Subject: More robustness, and some little bug fixes. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=50c4bd4145b45a23938c9d1ced75efa39067397f;p=moodle.git More robustness, and some little bug fixes. Also, database module now supports md5 passwords --- diff --git a/admin/auth.php b/admin/auth.php index 5b5e4cfc10..13e5dd29e6 100644 --- a/admin/auth.php +++ b/admin/auth.php @@ -59,6 +59,20 @@ if (! isset($config->guestloginbutton)) { $config->guestloginbutton = 1; } + if (! isset($config->auth_instructions)) { + $config->auth_instructions = ""; + } + if (! isset($config->changepassword)) { + $config->changepassword = ""; + } + $user_fields = array("firstname", "lastname", "email", "phone1", "phone2", "department", "address", "city", "country", "description", "idnumber", "lang"); + + foreach ($user_fields as $user_field) { + $user_field = "auth_user_$user_field"; + if (! isset($config->$user_field)) { + $config->$user_field = ""; + } + } if (empty($focus)) { $focus = ""; diff --git a/auth/db/config.html b/auth/db/config.html index efe04cd93a..db36f1b54e 100644 --- a/auth/db/config.html +++ b/auth/db/config.html @@ -1,8 +1,37 @@ +auth_dbhost)) { + $config->auth_dbhost = "localhost"; + } + if (!isset($config->auth_dbtype)) { + $config->auth_dbtype = "mysql"; + } + if (!isset($config->auth_dbname)) { + $config->auth_dbname = ""; + } + if (!isset($config->auth_dbuser)) { + $config->auth_dbuser = ""; + } + if (!isset($config->auth_dbpass)) { + $config->auth_dbpass = ""; + } + if (!isset($config->auth_dbtable)) { + $config->auth_dbtable = ""; + } + if (!isset($config->auth_dbfielduser)) { + $config->auth_dbfielduser = ""; + } + if (!isset($config->auth_dbfieldpass)) { + $config->auth_dbfieldpass = ""; + } + if (!isset($config->auth_dbpasstype)) { + $config->auth_dbpasstype = "plaintext"; + } +?>

auth_dbhost: - + @@ -29,7 +58,7 @@

auth_dbname: - + @@ -40,7 +69,7 @@

auth_dbuser: - + @@ -51,7 +80,7 @@

auth_dbpass: - + @@ -62,7 +91,7 @@

auth_dbtable: - + @@ -73,7 +102,7 @@

auth_dbfielduser: - + @@ -84,13 +113,28 @@

auth_dbfieldpass: - + + +

auth_dbpasstype: + + auth_dbpasstype, ""); + ?> + + + + + + + +

: diff --git a/auth/db/lib.php b/auth/db/lib.php index 45ed5cf0d3..6d9eda0ca0 100644 --- a/auth/db/lib.php +++ b/auth/db/lib.php @@ -1,9 +1,6 @@ PConnect($CFG->auth_dbhost,$CFG->auth_dbuser,$CFG->auth_dbpass,$CFG->auth_dbname); + switch ($CFG->auth_dbpasstype) { // Re-format password accordingly + case "md5": + $password = md5($password); + break; + } $rs = $authdb->Execute("SELECT * FROM $CFG->auth_dbtable WHERE $CFG->auth_dbfielduser = '$username' diff --git a/auth/imap/config.html b/auth/imap/config.html index 79089256d4..b8818a3ebd 100644 --- a/auth/imap/config.html +++ b/auth/imap/config.html @@ -1,8 +1,19 @@ +auth_imaphost)) { + $config->auth_imaphost = "127.0.0.1"; + } + if (!isset($config->auth_imaptype)) { + $config->auth_imaptype = "imap"; + } + if (!isset($config->auth_imapport)) { + $config->auth_imapport = "143"; + } +?>

auth_imaphost: - + @@ -28,7 +39,7 @@

auth_imapport: - + diff --git a/auth/ldap/config.html b/auth/ldap/config.html index aff8268330..65eb78f78b 100644 --- a/auth/ldap/config.html +++ b/auth/ldap/config.html @@ -1,8 +1,28 @@ +ldap_host_url)) { + $config->ldap_host_url = ""; + } + if (!isset($config->ldap_contexts)) { + $config->ldap_contexts = ""; + } + if (!isset($config->ldap_user_attribute)) { + $config->ldap_user_attribute = ""; + } + if (!isset($config->ldap_search_sub)) { + $config->ldap_search_sub = ""; + } + if (!isset($config->ldap_bind_dn)) { + $config->ldap_bind_dn = ""; + } + if (!isset($config->ldap_bind_pw)) { + $config->ldap_bind_pw = ""; + } +?>

ldap_host_url: - + @@ -10,10 +30,10 @@ -

ldap_user_context: +

ldap_contexts: - + @@ -24,7 +44,7 @@

ldap_user_attribute: - + @@ -35,7 +55,7 @@

ldap_search_sub: - + @@ -46,17 +66,17 @@

ldap_bind_dn: - + -

ldap_bind_password: +

ldap_bind_pw: - + diff --git a/auth/nntp/config.html b/auth/nntp/config.html index 5b4375e75b..453ffb8a6c 100644 --- a/auth/nntp/config.html +++ b/auth/nntp/config.html @@ -1,8 +1,17 @@ +auth_nntphost)) { + $config->auth_nntphost = "127.0.0.1"; + } + if (!isset($config->auth_nntpport)) { + $config->auth_nntpport = "119"; + } +?> +

auth_nntphost: - + @@ -12,8 +21,8 @@

auth_nntpport: - - + + diff --git a/auth/pop3/config.html b/auth/pop3/config.html index 19847cc55f..9e42e351a3 100644 --- a/auth/pop3/config.html +++ b/auth/pop3/config.html @@ -1,8 +1,19 @@ +auth_pop3host)) { + $config->auth_pop3host = "127.0.0.1"; + } + if (!isset($config->auth_pop3type)) { + $config->auth_pop3type = "pop3"; + } + if (!isset($config->auth_pop3port)) { + $config->auth_pop3port = "110"; + } +?>

auth_pop3host: - + @@ -18,7 +29,6 @@ } choose_from_menu($pop3options, "auth_pop3type", $config->auth_pop3type, ""); ?> - @@ -29,7 +39,7 @@

auth_pop3port: - + diff --git a/lang/en/auth.php b/lang/en/auth.php index 07f1718d1d..804379631a 100644 --- a/lang/en/auth.php +++ b/lang/en/auth.php @@ -9,6 +9,7 @@ $string['auth_dbfielduser'] = "Name of the field containing usernames"; $string['auth_dbhost'] = "The computer hosting the database server."; $string['auth_dbname'] = "Name of the database itself"; $string['auth_dbpass'] = "Password matching the above username"; +$string['auth_dbpasstype'] = "Specify the format that the password field is using. MD5 encryption is useful for connecting to other common web applications like PostNuke"; $string['auth_dbtable'] = "Name of the table in the database"; $string['auth_dbtitle'] = "Use an external database"; $string['auth_dbtype'] = "The database type (See the ADOdb documentation for details)"; @@ -52,6 +53,8 @@ $string['changepassword'] = "Change password URL"; $string['changepasswordhelp'] = "Here you can specify a location at which your users can recover or change their username/password if they've forgotten it. This will be provided to users as a button on the login page and their user page. if you leave this blank the button will not be printed."; $string['chooseauthmethod'] = "Choose an authentication method: "; $string['guestloginbutton'] = "Guest login button"; +$string['md5'] = "MD5 encryption"; +$string['plaintext'] = "Plain text"; $string['showguestlogin'] = "You can hide or show the guest login button on the login page."; ?>