Index: lib/authlib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/authlib.php,v
retrieving revision 1.9
diff -u -r1.9 authlib.php
--- lib/authlib.php	31 Jan 2008 22:02:44 -0000	1.9
+++ lib/authlib.php	13 Mar 2008 10:37:52 -0000
@@ -342,6 +342,17 @@
         }
         return $authdescription;
     }
+    
+    /**
+     * Returns whether or not the captcha element is enabled, and the admin settings fulfil its requirements.
+     * @return bool
+     */
+    function is_captcha_enabled() {
+        global $CFG;
+        return isset($CFG->recaptchapublickey) && isset($CFG->recaptchaprivatekey) && get_config("auth/{$this->authtype}", 'recaptcha');
+    }
+
+
 }
 
 ?>
Index: login/signup.php
===================================================================
RCS file: /cvsroot/moodle/moodle/login/signup.php,v
retrieving revision 1.56
diff -u -r1.56 signup.php
--- login/signup.php	17 Aug 2007 19:09:21 -0000	1.56
+++ login/signup.php	13 Mar 2008 10:37:52 -0000
@@ -1,7 +1,8 @@
-<?php  // $Id: signup.php,v 1.56 2007/08/17 19:09:21 nicolasconnault Exp $
+<?php  // $Id: signup.php,v 1.57 2008/03/10 17:32:32 nicolasconnault Exp $
 
     require_once('../config.php');
     require_once('signup_form.php');
+    
 
     if (empty($CFG->registerauth)) {
         error("Sorry, you may not use this page.");
@@ -48,7 +49,7 @@
     $navlinks[] = array('name' => $newaccount, 'link' => null, 'type' => 'misc');
     $navigation = build_navigation($navlinks);
     print_header($newaccount, $newaccount, $navigation, $mform_signup->focus(), "", true, "<div class=\"langmenu\">$langmenu</div>");
-
+    
     $mform_signup->display();
     print_footer();
 
Index: login/signup_form.php
===================================================================
RCS file: /cvsroot/moodle/moodle/login/signup_form.php,v
retrieving revision 1.37
diff -u -r1.37 signup_form.php
--- login/signup_form.php	27 Dec 2007 11:18:55 -0000	1.37
+++ login/signup_form.php	13 Mar 2008 10:37:52 -0000
@@ -1,4 +1,4 @@
-<?php  // $Id: signup_form.php,v 1.37 2007/12/27 11:18:55 poltawski Exp $
+<?php  // $Id: signup_form.php,v 1.39 2008/03/11 10:34:50 nicolasconnault Exp $
 
 require_once($CFG->libdir.'/formslib.php');
 require_once($CFG->dirroot.'/user/profile/lib.php');
@@ -62,6 +62,13 @@
         }else{
             $mform->setDefault('country', '');
         }
+        
+        $authplugin = get_auth_plugin($CFG->registerauth);
+        if ($authplugin->is_captcha_enabled()) {
+            $mform->addElement('recaptcha', 'recaptcha_element', get_string('recaptcha', 'auth'));
+            $mform->setHelpButton('recaptcha_element', array('recaptcha', get_string('recaptcha', 'auth'))); 
+            $mform->addRule('recaptcha_element', get_string('required'), 'required', null, 'server');
+        }
 
         profile_signup_fields($mform);
 
@@ -131,10 +138,17 @@
         if (!check_password_policy($data['password'], $errmsg)) {
             $errors['password'] = $errmsg;
         }
+        
+        if ($authplugin->is_captcha_enabled()) {
+            $recaptcha_element = $this->_form->getElement('recaptcha_element'); 
+            $challenge_field = $this->_form->_submitValues['recaptcha_challenge_field'];
+            $response_field = $this->_form->_submitValues['recaptcha_response_field'];
+            if (true !== ($result = $recaptcha_element->verify($challenge_field, $response_field))) {
+                $errors['recaptcha'] = $result;
+            }
+        }
 
-        return $errors;
-
-
+        return $errors; 
     }
 }
 
Index: lang/en_utf8/auth.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lang/en_utf8/auth.php,v
retrieving revision 1.39
diff -u -r1.39 auth.php
--- lang/en_utf8/auth.php	29 Feb 2008 22:12:07 -0000	1.39
+++ lang/en_utf8/auth.php	13 Mar 2008 10:37:52 -0000
@@ -1,4 +1,4 @@
-<?php // $Id: auth.php,v 1.39 2008/02/29 22:12:07 nicolasconnault Exp $ 
+<?php // $Id: auth.php,v 1.41 2008/03/11 10:34:50 nicolasconnault Exp $ 
       // auth.php - created with Moodle 1.5 UNSTABLE DEVELOPMENT (2005010100)
 
 
@@ -117,6 +117,9 @@
 $string['auth_emailtitle'] = 'Email-based self-registration';
 $string['auth_emailnoinsert'] = 'Could not add your record to the database!';
 $string['auth_emailnoemail'] = 'Tried to send you an email but failed!';
+$string['auth_emailrecaptcha'] = 'Adds a visual/audio confirmation form element to the signup page for email self-registering users. This protects your site against spammers and contributes to a worthwhile cause. See http://recaptcha.net/learnmore.html for more details.';
+$string['auth_emailrecaptcha_key'] = 'Enable reCAPTCHA element';
+$string['auth_emailsettings'] = 'Settings';
 
 // FirstClass plugin
 $string['auth_fccreators'] = 'List of groups whose members are allowed to create new courses. Separate multiple groups with \';\'. Names must be spelled exactly as on FirstClass server. System is case-sensitive.';
@@ -374,5 +377,11 @@
 $string['unlocked'] = 'Unlocked';
 $string['unlockedifempty'] = 'Unlocked if empty';
 $string['locked'] = 'Locked';
-
+$string['incorrectpleasetryagain'] = 'Incorrect. Please try again.';
+$string['enterthewordsabove'] = 'Enter the words above';
+$string['enterthenumbersyouhear'] = 'Enter the numbers you hear';
+$string['getanothercaptcha'] = 'Get another CAPTCHA';
+$string['getanaudiocaptcha'] = 'Get an audio CAPTCHA';
+$string['getanimagecaptcha'] = 'Get an image CAPTCHA';
+$string['recaptcha'] = 'reCAPTCHA';
 ?>
Index: lib/form/recaptcha.php
===================================================================
RCS file: lib/form/recaptcha.php
diff -N lib/form/recaptcha.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ lib/form/recaptcha.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,139 @@
+<?php
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * textarea_counter.php
+ *
+ * @category  Admin
+ * @package   admin
+ * @author    Nicolas Connault <nicolasconnault@gmail.com>
+ * @version   $Id$
+ */
+
+
+/**
+ * @category Admin
+ * @package  admin
+ */
+class MoodleQuickForm_recaptcha extends HTML_QuickForm_input {
+
+    /**
+     * html for help button, if empty then no help
+     *
+     * @var string
+     */
+    var $_helpbutton='';
+
+    /**
+     * <code>
+     * $form->addElement('textarea_counter', 'message', 'Message',
+     *   array('cols'=>60, 'rows'=>10), 160);
+     * </code>
+     */
+    function HTML_QuickForm_recaptcha($elementName = null, $elementLabel = null, $attributes = null) {
+        parent::HTML_QuickForm_input($elementName, $elementLabel, $attributes);
+        $this->_type = 'recaptcha';
+    }
+
+    /**
+     * Returns the recaptcha element in HTML
+     *
+     * @since     1.0
+     * @access    public
+     * @return    string
+     */
+    function toHtml() {
+        global $CFG;
+        require_once $CFG->libdir . '/recaptchalib.php';
+
+        $html = '<script type="text/javascript">
+            var RecaptchaOptions = {
+                theme : \'custom\',
+                tabindex : 2,
+                custom_theme_widget : \'recaptcha_widget\'
+            };
+              </script>' . "\n";
+
+        $attributes = $this->getAttributes();
+        if (empty($attributes['error_message'])) {
+            $attributes['error_message'] = null;
+            $this->setAttributes($attributes);
+        }
+        $error = $attributes['error_message'];
+        unset($attributes['error_message']);
+        
+        $strincorrectpleasetryagain = get_string('incorrectpleasetryagain', 'auth');
+        $strenterthewordsabove = get_string('enterthewordsabove', 'auth');
+        $strenterthenumbersyouhear = get_string('enterthenumbersyouhear', 'auth');
+        $strgetanothercaptcha = get_string('getanothercaptcha', 'auth');
+        $strgetanaudiocaptcha = get_string('getanaudiocaptcha', 'auth');
+        $strgetanimagecaptcha = get_string('getanimagecaptcha', 'auth');
+
+        $html .= '
+<div id="recaptcha_widget" style="display:none">
+
+<div id="recaptcha_image"></div>
+<div class="recaptcha_only_if_incorrect_sol" style="color:red">' . $strincorrectpleasetryagain . '</div>
+
+<span class="recaptcha_only_if_image"><label for="recaptcha_response_field">' . $strenterthewordsabove . '</label></span>
+<span class="recaptcha_only_if_audio"><label for="recaptcha_response_field">' . $strenterthenumbersyouhear . '</label></span>
+
+<input type="text" id="recaptcha_response_field" name="recaptcha_response_field" />
+<input type="hidden" name="recaptcha_element" value="dummyvalue" /> <!-- Dummy value to fool formslib -->
+<div><a href="javascript:Recaptcha.reload()">' . $strgetanothercaptcha . '</a></div>
+<div class="recaptcha_only_if_image"><a href="javascript:Recaptcha.switch_type(\'audio\')">' . $strgetanaudiocaptcha . '</a></div>
+<div class="recaptcha_only_if_audio"><a href="javascript:Recaptcha.switch_type(\'image\')">' . $strgetanimagecaptcha . '</a></div>
+</div>'; 
+
+        return $html . recaptcha_get_html($CFG->recaptchapublickey, $error);
+    }
+    
+    /**
+     * set html for help button
+     *
+     * @access   public
+     * @param array $help array of arguments to make a help button
+     * @param string $function function name to call to get html
+     */
+    function setHelpButton($helpbuttonargs, $function='helpbutton'){
+        if (!is_array($helpbuttonargs)){
+            $helpbuttonargs=array($helpbuttonargs);
+        }else{
+            $helpbuttonargs=$helpbuttonargs;
+        }
+        //we do this to to return html instead of printing it
+        //without having to specify it in every call to make a button.
+        if ('helpbutton' == $function){
+            $defaultargs=array('', '', 'moodle', true, false, '', true);
+            $helpbuttonargs=$helpbuttonargs + $defaultargs ;
+        }
+        $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+    }
+    /**
+     * get html for help button
+     *
+     * @access   public
+     * @return  string html for help button
+     */
+    function getHelpButton(){
+        return $this->_helpbutton;
+    }
+
+    function verify($challenge_field, $response_field) {
+        global $CFG;
+        require_once $CFG->libdir . '/recaptchalib.php';
+        $response = recaptcha_check_answer($CFG->recaptchaprivatekey,
+                                           $_SERVER['REMOTE_ADDR'],
+                                           $challenge_field,
+                                           $response_field);
+        if (!$response->is_valid) {
+            $attributes = $this->getAttributes();
+            $attributes['error_message'] = $response->error;
+            $this->setAttributes($attributes);
+            return $response->error;
+        }
+        return true;
+    }
+}
+
+?>
Index: lib/recaptchalib.php
===================================================================
RCS file: lib/recaptchalib.php
diff -N lib/recaptchalib.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ lib/recaptchalib.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,313 @@
+<?php
+/*
+ * This is a PHP library that handles calling reCAPTCHA.
+ *    - Documentation and latest version
+ *          http://recaptcha.net/plugins/php/
+ *    - Get a reCAPTCHA API Key
+ *          http://recaptcha.net/api/getkey
+ *    - Discussion group
+ *          http://groups.google.com/group/recaptcha
+ *
+ * Copyright (c) 2007 reCAPTCHA -- http://recaptcha.net
+ * AUTHORS:
+ *   Mike Crawford
+ *   Ben Maurer
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+/**
+ * The reCAPTCHA server URL's
+ */
+define("RECAPTCHA_API_SERVER", "http://api.recaptcha.net");
+define("RECAPTCHA_API_SECURE_SERVER", "https://api-secure.recaptcha.net");
+define("RECAPTCHA_VERIFY_SERVER", "api-verify.recaptcha.net");
+
+/**
+ * Encodes the given data into a query string format
+ * @param $data - array of string elements to be encoded
+ * @return string - encoded request
+ */
+function _recaptcha_qsencode ($data) {
+        $req = "";
+        foreach ( $data as $key => $value )
+                $req .= $key . '=' . urlencode( stripslashes($value) ) . '&';
+
+        // Cut the last '&'
+        $req=substr($req,0,strlen($req)-1);
+        return $req;
+}
+
+
+
+/**
+ * Submits an HTTP POST to a reCAPTCHA server
+ * @param string $host
+ * @param string $path
+ * @param array $data
+ * @param int port
+ * @return array response
+ */
+function _recaptcha_http_post($host, $path, $data, $port = 80) {
+        global $CFG;
+        require_once $CFG->libdir . '/filelib.php';
+        
+        $req = _recaptcha_qsencode ($data);
+        
+        $headers = array();
+        $headers['Host'] = $host;
+        $headers['Content-Type'] = 'application/x-www-form-urlencoded';
+        $headers['Content-Length'] = strlen($req);
+        $headers['User-Agent'] = 'reCAPTCHA/PHP';
+
+        $results = download_file_content('http://' . $host . $path, $headers, $data);
+        
+        if ($results) {
+            return array(1 => $results);
+        } else {
+            return false;
+        }
+}
+
+
+
+/**
+ * Gets the challenge HTML (javascript and non-javascript version).
+ * This is called from the browser, and the resulting reCAPTCHA HTML widget
+ * is embedded within the HTML form it was called from.
+ * @param string $pubkey A public key for reCAPTCHA
+ * @param string $error The error given by reCAPTCHA (optional, default is null)
+ * @param boolean $use_ssl Should the request be made over ssl? (optional, default is false)
+
+ * @return string - The HTML to be embedded in the user's form.
+ */
+function recaptcha_get_html ($pubkey, $error = null, $use_ssl = false) {
+    global $CFG;
+
+    $recaptchatype = optional_param('recaptcha', 'image', PARAM_TEXT);
+
+	if ($pubkey == null || $pubkey == '') {
+		die ("To use reCAPTCHA you must get an API key from <a href='http://recaptcha.net/api/getkey'>http://recaptcha.net/api/getkey</a>");
+	}
+	
+	if ($use_ssl) {
+        $server = RECAPTCHA_API_SECURE_SERVER;
+    } else {
+        $server = RECAPTCHA_API_SERVER;
+    }
+
+    $errorpart = "";
+    if ($error) {
+       $errorpart = "&amp;error=" . $error;
+    }
+
+    require_once $CFG->libdir . '/filelib.php';
+    $html = download_file_content($server . '/noscript?k=' . $pubkey . $errorpart);
+    preg_match('/image\?c\=([A-Za-z0-9\-\_]*)\"/', $html, $matches);
+    $challenge_hash = $matches[1];
+    $image_url = $server . '/image?c=' . $challenge_hash;
+    
+    $strincorrectpleasetryagain = get_string('incorrectpleasetryagain', 'auth');
+    $strenterthewordsabove = get_string('enterthewordsabove', 'auth');
+    $strenterthenumbersyouhear = get_string('enterthenumbersyouhear', 'auth');
+    $strgetanothercaptcha = get_string('getanothercaptcha', 'auth');
+    $strgetanaudiocaptcha = get_string('getanaudiocaptcha', 'auth');
+    $strgetanimagecaptcha = get_string('getanimagecaptcha', 'auth');
+    
+    $return = '<script type="text/javascript" src="'. $server . '/challenge?k=' . $pubkey . $errorpart . '"></script> 
+	<noscript>
+        <div id="recaptcha_widget_noscript">
+        <div id="recaptcha_image_noscript"><img src="' . $image_url . '" alt="reCAPTCHA"/></div>';
+    
+    if ($error == 'incorrect-captcha-sol') {
+        $return .= '<div class="recaptcha_only_if_incorrect_sol" style="color:red">' . $strincorrectpleasetryagain . '</div>';
+    }
+
+    if ($recaptchatype == 'image') {
+        $return .= '<span class="recaptcha_only_if_image">' . $strenterthewordsabove . '</span>';
+    } elseif ($recaptchatype == 'audio') {
+        $return .= '<span class="recaptcha_only_if_audio">' . $strenterthenumbersyouhear . '</span>'; 
+    }
+    
+    $return .= '<input type="text" id="recaptcha_response_field_noscript" name="recaptcha_response_field" />';
+    $return .= '<input type="hidden" id="recaptcha_challenge_field_noscript" name="recaptcha_challenge_field" value="' . $challenge_hash . '" />';
+    $return .= '<div><a href="signup.php">' . $strgetanothercaptcha . '</a></div>';
+    
+    // Disabling audio recaptchas for now: not language-independent
+    /*
+    if ($recaptchatype == 'image') {
+        $return .= '<div class="recaptcha_only_if_image"><a href="signup.php?recaptcha=audio">' . $strgetanaudiocaptcha . '</a></div>';
+    } elseif ($recaptchatype == 'audio') {
+        $return .= '<div class="recaptcha_only_if_audio"><a href="signup.php?recaptcha=image">' . $strgetanimagecaptcha . '</a></div>';
+    }
+    */
+
+    $return .= '
+        </div>
+	</noscript>';
+
+    return $return;
+}
+
+
+
+
+/**
+ * A ReCaptchaResponse is returned from recaptcha_check_answer()
+ */
+class ReCaptchaResponse {
+        var $is_valid;
+        var $error;
+}
+
+
+/**
+  * Calls an HTTP POST function to verify if the user's guess was correct
+  * @param string $privkey
+  * @param string $remoteip
+  * @param string $challenge
+  * @param string $response
+  * @return ReCaptchaResponse
+  */
+function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response)
+{
+	if ($privkey == null || $privkey == '') {
+		die ("To use reCAPTCHA you must get an API key from <a href='http://recaptcha.net/api/getkey'>http://recaptcha.net/api/getkey</a>");
+	}
+
+	if ($remoteip == null || $remoteip == '') {
+		die ("For security reasons, you must pass the remote ip to reCAPTCHA");
+	}
+
+	
+	
+        //discard spam submissions
+        if ($challenge == null || strlen($challenge) == 0 || $response == null || strlen($response) == 0) {
+                $recaptcha_response = new ReCaptchaResponse();
+                $recaptcha_response->is_valid = false;
+                $recaptcha_response->error = 'incorrect-captcha-sol';
+                return $recaptcha_response;
+        }
+
+        $response = _recaptcha_http_post (RECAPTCHA_VERIFY_SERVER, "/verify",
+                                          array (
+                                                 'privatekey' => $privkey,
+                                                 'remoteip' => $remoteip,
+                                                 'challenge' => $challenge,
+                                                 'response' => $response
+                                                 )
+                                          );
+
+        $answers = explode ("\n", $response [1]);
+        $recaptcha_response = new ReCaptchaResponse();
+
+        if (trim ($answers [0]) == 'true') {
+                $recaptcha_response->is_valid = true;
+        }
+        else {
+                $recaptcha_response->is_valid = false;
+                $recaptcha_response->error = $answers [1];
+        }
+        return $recaptcha_response;
+
+}
+
+/**
+ * gets a URL where the user can sign up for reCAPTCHA. If your application
+ * has a configuration page where you enter a key, you should provide a link
+ * using this function.
+ * @param string $domain The domain where the page is hosted
+ * @param string $appname The name of your application
+ */
+function recaptcha_get_signup_url ($domain = null, $appname = null) {
+	return "http://recaptcha.net/api/getkey?" .  _recaptcha_qsencode (array ('domain' => $domain, 'app' => $appname));
+}
+
+function _recaptcha_aes_pad($val) {
+	$block_size = 16;
+	$numpad = $block_size - (strlen ($val) % $block_size);
+	return str_pad($val, strlen ($val) + $numpad, chr($numpad));
+}
+
+/* Mailhide related code */
+
+function _recaptcha_aes_encrypt($val,$ky) {
+	if (! function_exists ("mcrypt_encrypt")) {
+		die ("To use reCAPTCHA Mailhide, you need to have the mcrypt php module installed.");
+	}
+	$mode=MCRYPT_MODE_CBC;   
+	$enc=MCRYPT_RIJNDAEL_128;
+	$val=_recaptcha_aes_pad($val);
+	return mcrypt_encrypt($enc, $ky, $val, $mode, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
+}
+
+
+function _recaptcha_mailhide_urlbase64 ($x) {
+	return strtr(base64_encode ($x), '+/', '-_');
+}
+
+/* gets the reCAPTCHA Mailhide url for a given email, public key and private key */
+function recaptcha_mailhide_url($pubkey, $privkey, $email) {
+	if ($pubkey == '' || $pubkey == null || $privkey == "" || $privkey == null) {
+		die ("To use reCAPTCHA Mailhide, you have to sign up for a public and private key, " .
+		     "you can do so at <a href='http://mailhide.recaptcha.net/apikey'>http://mailhide.recaptcha.net/apikey</a>");
+	}
+	
+
+	$ky = pack('H*', $privkey);
+	$cryptmail = _recaptcha_aes_encrypt ($email, $ky);
+	
+	return "http://mailhide.recaptcha.net/d?k=" . $pubkey . "&c=" . _recaptcha_mailhide_urlbase64 ($cryptmail);
+}
+
+/**
+ * gets the parts of the email to expose to the user.
+ * eg, given johndoe@example,com return ["john", "example.com"].
+ * the email is then displayed as john...@example.com
+ */
+function _recaptcha_mailhide_email_parts ($email) {
+	$arr = preg_split("/@/", $email );
+
+	if (strlen ($arr[0]) <= 4) {
+		$arr[0] = substr ($arr[0], 0, 1);
+	} else if (strlen ($arr[0]) <= 6) {
+		$arr[0] = substr ($arr[0], 0, 3);
+	} else {
+		$arr[0] = substr ($arr[0], 0, 4);
+	}
+	return $arr;
+}
+
+/**
+ * Gets html to display an email address given a public an private key.
+ * to get a key, go to:
+ *
+ * http://mailhide.recaptcha.net/apikey
+ */
+function recaptcha_mailhide_html($pubkey, $privkey, $email) {
+	$emailparts = _recaptcha_mailhide_email_parts ($email);
+	$url = recaptcha_mailhide_url ($pubkey, $privkey, $email);
+	
+	return htmlentities($emailparts[0]) . "<a href='" . htmlentities ($url) .
+		"' onclick=\"window.open('" . htmlentities ($url) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"Reveal this e-mail address\">...</a>@" . htmlentities ($emailparts [1]);
+
+}
+
+
+?>
