<?php
/**
 * @package linea21.core
 * @subpackage user
 * @author linea21 <info@linea21.com>
 * @version $id SVN
 * @access public
 * @license http://opensource.org/licenses/gpl-3.0.html
 */

//////////// Check Inclusion de pages ////////////
if (!function_exists('AuthenthificationProcess')) {
    include_once("../lib/lib_common.php");
    ReloadIndex('admin');
} 
////////////



		/** Préparation du mail
		* $email_html_body
		* $email_text_body
		* $email_subject
		* $email_dest
		**/
		switch($todo_mail) {
			case 'add_user':
				$email_html_body = _t('user','mail_add_body1') . "<br />\n";
				$email_html_body .= _t('user','mail_add_body2') . "<br />\n";
				$email_html_body .= _t('user','login') . " : " . $data_table_user[0] . "<br />\n";
				$email_html_body .= _t('user','password') . " : " . $data_table_user[3] . "<br /><br />\n";
				$email_html_body .= _t('user','mail_head') . " : <a href=\"" . SITE_CITY_URL . "\">" . SITE_CITY_NAME . "</a><br />\n";
				$email_html_body .= _t('user','mail_bottom') . ": <a href=\"mailto:" . SITE_CITY_MAIL . "\">" . SITE_CITY_MAIL . "</a><br />\n";
				
				$email_text_body = _t('user','mail_add_body1') . "\n";
				$email_text_body .= _t('user','mail_add_body2') . "\n";
				$email_text_body .= _t('user','login') . " : " . $data_table_user[0] . "\n";
				$email_text_body .= _t('user','password') . " : " . $data_table_user[3] . "\n\n";
				$email_text_body .= _t('user','mail_head') . " " . SITE_CITY_URL . "\n";
				$email_text_body .= _t('user','mail_bottom') . " " . SITE_CITY_MAIL . "\n";
				
				$email_subject = _t('user','mail_add_subject').' '.SITE_CITY_NAME;
				$email_dest = $data_table_user[1];
				//$email_method = 'SSL';
				break;
			case 'change_pass':
				$email_html_body = _t('user','mail_changepass_body1') . "<br />\n";
				$email_html_body .= _t('user','mail_changepass_body2') . "<br />\n";
				$email_html_body .= _t('user','password') . " : " . $new_pass . "<br /><br />\n";
				$email_html_body .= _t('user','mail_head') . " : <a href=\"" . SITE_CITY_URL . "\">" . SITE_CITY_NAME . "</a><br />\n";
				$email_html_body .= _t('user','mail_bottom') . ": <a href=\"mailto:" . SITE_CITY_MAIL . "\">" . SITE_CITY_MAIL . "</a><br />\n";
					
				$email_text_body = _t('user','mail_changepass_body1') . "\n";
				$email_text_body .= _t('user','mail_changepass_body2') . "\n";
				$email_text_body .= _t('user','password') . " : " . $new_pass . "\n";
				$email_text_body .= _t('user','mail_head') . " " . SITE_CITY_URL . "\n";
				$email_text_body .= _t('user','mail_bottom') . " " . SITE_CITY_MAIL . "\n";
				
				$email_subject = _t('user','mail_changemail_subject').' - '.SITE_CITY_NAME;
				$email_dest = $user_email;
				//$email_method = 'SSL';
				break;
			case 'change_mail':
				$email_html_body = _t('user','mail_changemail_body1') . "<br />\n";
				$email_html_body .= _t('user','mail_changemail_body2') . "<br />\n";
				$email_html_body .= _t('user','password') . " : " . $new_pass . "<br /><br />\n";
				$email_html_body .= _t('user','mail_head') . " : <a href=\"" . SITE_CITY_URL . "\">" . SITE_CITY_NAME . "</a><br />\n";
				$email_html_body .= _t('user','mail_bottom') . ": <a href=\"" . SITE_CITY_MAIL . "\">" . SITE_CITY_MAIL . "</a><br />\n";
					
				$email_text_body = _t('user','mail_changemail_body1') . "\n";
				$email_text_body .= _t('user','mail_changemail_body2') . "\n";
				$email_text_body .= _t('user','password') . " : " . $new_pass . "\n";
				$email_text_body .= _t('user','mail_head') . " " . SITE_CITY_URL . "\n";
				$email_text_body .= _t('user','mail_bottom') . " " . SITE_CITY_MAIL . "\n";
				
				$email_subject = _t('user','mail_changemail_subject').' - '.SITE_CITY_NAME;

				$email_dest = $new_email;
				//$email_method = 'SSL';
				break;
			default:
				exit();
		}
		
?>
