]> git.mjollnir.org Git - moodle.git/commitdiff
Added SMTP authentication for email delivery
authormoodler <moodler>
Tue, 5 Nov 2002 06:06:18 +0000 (06:06 +0000)
committermoodler <moodler>
Tue, 5 Nov 2002 06:06:18 +0000 (06:06 +0000)
admin/config.html
lang/en/moodle.php
lib/defaults.php
lib/moodlelib.php
version.php

index 89a8496924e9e5cfb5b8624377614f8882c4b794..9b1642c04c45512de0885fb89d225327658f0120 100644 (file)
     <? print_string("configsmtphosts") ?>
     </TD>
 </TR>
+<TR VALIGN=TOP>
+       <TD ALIGN=RIGHT><P>smtpuser:</TD>
+       <TD>
+    <INPUT NAME=smtpuser TYPE=text SIZE=10 VALUE="<?=$config->smtpuser?>">
+    <? formerr($err["smtpuser"]); ?>
+    </TD>
+    <TD ROWSPAN=2>
+    <? print_string("configsmtpuser") ?>
+    </TD>
+</TR>
+<TR VALIGN=TOP>
+       <TD ALIGN=RIGHT><P>smtppass:</TD>
+       <TD>
+    <INPUT NAME=smtppass TYPE=text SIZE=10 VALUE="<?=$config->smtppass?>">
+    <? formerr($err["smtppass"]); ?>
+    </TD>
+</TR>
 <TR VALIGN=TOP>
        <TD ALIGN=RIGHT><P>gdversion:</TD>
        <TD>
index 2a76c8074ac548129e211ad222737b745e1f4efc..45561973bab3a5ab33eac43f8f723e7641437f06 100644 (file)
@@ -63,6 +63,7 @@ $string['configmaxeditingtime'] = "This specifies the amount of time people have
 $string['configproxyhost'] = "If this <B>server</B> needs to use a proxy computer (eg a firewall) to access the Internet, then provide the proxy hostname and port here.  Otherwise leave it blank.";
 $string['configslasharguments'] = "Files (images, uploads etc) are provided via a script using 'slash arguments' (the second option here). This method allows files to be more easily cached in web browsers, proxy servers etc.  Unfortunately, some PHP servers don't allow this method, so if you have trouble viewing uploaded files or images (eg user pictures), set this variable to the first option";
 $string['configsmtphosts'] = "Give the full name of one or more local SMTP servers that Moodle should use to send mail (eg 'mail.a.com' or 'mail.a.com;mail.b.com'). If you leave it blank, Moodle will use the PHP default method of sending mail.";
+$string['configsmtpuser'] = "If you have specified an SMTP server above, and the server requires authentication, then enter the username and password here.";
 $string['configunzip'] = "Indicate the location of your unzip program (Unix only).  This is needed to unpack zip archives on the server.";
 $string['configvariables'] = "Configure variables";
 $string['configzip'] = "Indicate the location of your zip program (Unix only).  This is needed to create zip archives on the server.";
index 602d2125bda529a7de8798ce4f17f4537a028279..f42d2f138a741e4f119471ff7b6cbf7c4f9b88b6 100644 (file)
@@ -10,6 +10,8 @@
        "locale"         => "en",
        "auth"           => "email",
        "smtphosts"      => "",
+       "smtpuser"       => "",
+       "smtppass"       => "",
        "gdversion"      =>  1,
        "longtimenosee"  =>  100,
        "zip"            => "/usr/bin/zip",
index d3f8fd77e764fb37651a0d26b51dce9af49bb2c7..10038882fcf5eb544e3e30e10d76ea532e79d50f 100644 (file)
@@ -1527,6 +1527,12 @@ function email_to_user($user, $from, $subject, $messagetext, $messagehtml="", $a
     if ($CFG->smtphosts) {
         $mail->IsSMTP();                               // use SMTP directly
         $mail->Host = "$CFG->smtphosts";               // specify main and backup servers
+
+        if ($CFG->smtpuser) {                          // Use SMTP authentication
+            $mail->SMTPAuth = true;
+            $mail->Username = $CFG->smtpuser;
+            $mail->Password = $CFG->smtppass;
+        }
     } else {
         $mail->IsMail();                               // use PHP mail() = sendmail
     }
index ce1b735c23a44db0073a4f0ceb2c9be67d085403..858e6a32480bf1c74c2891769e414a1f993925ae 100644 (file)
@@ -5,7 +5,7 @@
 // database to determine whether upgrades should
 // be performed (see lib/db/*.php)
 
-$version = 2002103000;   // The current version is a date (YYYYMMDDXX)
+$version = 2002110500;   // The current version is a date (YYYYMMDDXX)
 
-$release = "1.0.6 +";  // User-friendly version number
+$release = "1.0.7 dev";  // User-friendly version number